… | |
… | |
36 | #include "rxvtutil.h" |
36 | #include "rxvtutil.h" |
37 | #include "rxvtperl.h" |
37 | #include "rxvtperl.h" |
38 | |
38 | |
39 | #include "perlxsi.c" |
39 | #include "perlxsi.c" |
40 | |
40 | |
|
|
41 | #if defined(HAVE_SCROLLBARS) || defined(MENUBAR) |
|
|
42 | # define GRAB_CURSOR THIS->leftptr_cursor |
|
|
43 | #else |
|
|
44 | # define GRAB_CURSOR None |
|
|
45 | #endif |
|
|
46 | |
41 | #undef LINENO |
47 | #undef LINENO |
42 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
48 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
43 | #undef ROW |
49 | #undef ROW |
44 | #define ROW(n) THIS->row_buf [LINENO (n)] |
50 | #define ROW(n) THIS->row_buf [LINENO (n)] |
45 | |
51 | |
… | |
… | |
584 | |
590 | |
585 | PROTOTYPES: ENABLE |
591 | PROTOTYPES: ENABLE |
586 | |
592 | |
587 | BOOT: |
593 | BOOT: |
588 | { |
594 | { |
589 | HV *stash = gv_stashpv ("urxvt", 1); |
595 | sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1)); |
590 | # define export_const_iv(name) newCONSTSUB (stash, # name, newSViv (name)); |
|
|
591 | |
596 | |
592 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
597 | AV *hookname = get_av ("urxvt::HOOKNAME", 1); |
593 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
598 | # define def(sym) av_store (hookname, HOOK_ ## sym, newSVpv (# sym, 0)); |
594 | # include "hookinc.h" |
599 | # include "hookinc.h" |
595 | # undef def |
600 | # undef def |
596 | |
601 | |
597 | |
602 | HV *option = get_hv ("urxvt::OPTION", 1); |
|
|
603 | # define def(name,val) hv_store (option, # name, sizeof (# name) - 1, newSVuv (Opt_ ## name), 0); |
|
|
604 | # define nodef(name) |
|
|
605 | # include "optinc.h" |
|
|
606 | # undef nodef |
|
|
607 | # undef def |
|
|
608 | |
|
|
609 | HV *stash = gv_stashpv ("urxvt", 1); |
|
|
610 | # define export_const_iv(name) newCONSTSUB (stash, # name, newSViv (name)); |
598 | export_const_iv (DEFAULT_RSTYLE); |
611 | export_const_iv (DEFAULT_RSTYLE); |
599 | export_const_iv (OVERLAY_RSTYLE); |
612 | export_const_iv (OVERLAY_RSTYLE); |
600 | export_const_iv (RS_Bold); |
613 | export_const_iv (RS_Bold); |
601 | export_const_iv (RS_Italic); |
614 | export_const_iv (RS_Italic); |
602 | export_const_iv (RS_Blink); |
615 | export_const_iv (RS_Blink); |
… | |
… | |
616 | export_const_iv (Button2Mask); |
629 | export_const_iv (Button2Mask); |
617 | export_const_iv (Button3Mask); |
630 | export_const_iv (Button3Mask); |
618 | export_const_iv (Button4Mask); |
631 | export_const_iv (Button4Mask); |
619 | export_const_iv (Button5Mask); |
632 | export_const_iv (Button5Mask); |
620 | export_const_iv (AnyModifier); |
633 | export_const_iv (AnyModifier); |
621 | |
|
|
622 | sv_setsv (get_sv ("urxvt::LIBDIR", 1), newSVpvn (LIBDIR, sizeof (LIBDIR) - 1)); |
|
|
623 | } |
634 | } |
624 | |
635 | |
625 | SV * |
636 | SV * |
626 | new (...) |
637 | new (...) |
627 | CODE: |
638 | CODE: |
… | |
… | |
730 | void |
741 | void |
731 | rxvt_term::grab_button (int button, U32 modifiers) |
742 | rxvt_term::grab_button (int button, U32 modifiers) |
732 | CODE: |
743 | CODE: |
733 | XGrabButton (THIS->display->display, button, modifiers, THIS->vt, 1, |
744 | XGrabButton (THIS->display->display, button, modifiers, THIS->vt, 1, |
734 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
745 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
735 | GrabModeSync, GrabModeSync, None, None); |
746 | GrabModeSync, GrabModeSync, None, GRAB_CURSOR); |
736 | |
747 | |
737 | bool |
748 | bool |
738 | rxvt_term::grab (U32 eventtime, int sync = 0) |
749 | rxvt_term::grab (U32 eventtime, int sync = 0) |
739 | CODE: |
750 | CODE: |
740 | { |
751 | { |
… | |
… | |
742 | |
753 | |
743 | THIS->perl.grabtime = 0; |
754 | THIS->perl.grabtime = 0; |
744 | |
755 | |
745 | if (!XGrabPointer (THIS->display->display, THIS->vt, 0, |
756 | if (!XGrabPointer (THIS->display->display, THIS->vt, 0, |
746 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
757 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
747 | mode, mode, None, None, eventtime)) |
758 | mode, mode, None, GRAB_CURSOR, eventtime)) |
748 | if (!XGrabKeyboard (THIS->display->display, THIS->vt, 0, mode, mode, eventtime)) |
759 | if (!XGrabKeyboard (THIS->display->display, THIS->vt, 0, mode, mode, eventtime)) |
749 | THIS->perl.grabtime = eventtime; |
760 | THIS->perl.grabtime = eventtime; |
750 | else |
761 | else |
751 | XUngrabPointer (THIS->display->display, eventtime); |
762 | XUngrabPointer (THIS->display->display, eventtime); |
752 | |
763 | |
… | |
… | |
1151 | else |
1162 | else |
1152 | THIS->rs [index] = 0; |
1163 | THIS->rs [index] = 0; |
1153 | } |
1164 | } |
1154 | } |
1165 | } |
1155 | |
1166 | |
|
|
1167 | bool |
|
|
1168 | rxvt_term::option (U32 optval, int set = -1) |
|
|
1169 | CODE: |
|
|
1170 | { |
|
|
1171 | RETVAL = THIS->options & optval; |
|
|
1172 | |
|
|
1173 | if (set >= 0) |
|
|
1174 | { |
|
|
1175 | if (set) |
|
|
1176 | THIS->options |= optval; |
|
|
1177 | else |
|
|
1178 | THIS->options &= ~optval; |
|
|
1179 | |
|
|
1180 | switch (optval) |
|
|
1181 | { |
|
|
1182 | case Opt_skipBuiltinGlyphs: |
|
|
1183 | THIS->set_fonts (); |
|
|
1184 | THIS->scr_remap_chars (); |
|
|
1185 | THIS->scr_touch (true); |
|
|
1186 | THIS->want_refresh = 1; |
|
|
1187 | break; |
|
|
1188 | |
|
|
1189 | case Opt_cursorUnderline: |
|
|
1190 | THIS->want_refresh = 1; |
|
|
1191 | break; |
|
|
1192 | |
|
|
1193 | # case Opt_scrollBar_floating: |
|
|
1194 | # case Opt_scrollBar_right: |
|
|
1195 | # THIS->resize_all_windows (THIS->width, THIS->height, 1); |
|
|
1196 | # break; |
|
|
1197 | } |
|
|
1198 | } |
|
|
1199 | } |
|
|
1200 | OUTPUT: |
|
|
1201 | RETVAL |
|
|
1202 | |
1156 | void |
1203 | void |
1157 | rxvt_term::cur (...) |
1204 | rxvt_term::cur (...) |
1158 | PROTOTYPE: $;$$ |
1205 | PROTOTYPE: $;$$ |
1159 | ALIAS: |
1206 | ALIAS: |
1160 | screen_cur = 0 |
1207 | screen_cur = 0 |