… | |
… | |
268 | }; |
268 | }; |
269 | |
269 | |
270 | overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) |
270 | overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) |
271 | : THIS(THIS), x(x_), y(y_), w(w_), h(h_), border(border == 2), overlay_av (0) |
271 | : THIS(THIS), x(x_), y(y_), w(w_), h(h_), border(border == 2), overlay_av (0) |
272 | { |
272 | { |
|
|
273 | if (w < 0) w = 0; |
|
|
274 | if (h < 0) h = 0; |
|
|
275 | |
273 | if (border == 2) |
276 | if (border == 2) |
274 | { |
277 | { |
275 | w += 2; |
278 | w += 2; |
276 | h += 2; |
279 | h += 2; |
277 | } |
280 | } |
… | |
… | |
355 | |
358 | |
356 | int i; |
359 | int i; |
357 | |
360 | |
358 | for (i = AvFILL (overlay_av); i >= 0; i--) |
361 | for (i = AvFILL (overlay_av); i >= 0; i--) |
359 | if (SvIV (*av_fetch (overlay_av, i, 1)) == (long)this) |
362 | if (SvIV (*av_fetch (overlay_av, i, 1)) == (long)this) |
360 | { |
|
|
361 | av_delete (overlay_av, i, G_DISCARD); |
|
|
362 | break; |
363 | break; |
363 | } |
|
|
364 | |
364 | |
365 | for (; i < AvFILL (overlay_av); i++) |
365 | for (; i < AvFILL (overlay_av); i++) |
366 | av_store (overlay_av, i, SvREFCNT_inc (*av_fetch (overlay_av, i + 1, 0))); |
366 | av_store (overlay_av, i, SvREFCNT_inc (*av_fetch (overlay_av, i + 1, 0))); |
367 | |
367 | |
368 | av_pop (overlay_av); |
368 | av_pop (overlay_av); |
… | |
… | |
790 | const_iv (Button2Mask), |
790 | const_iv (Button2Mask), |
791 | const_iv (Button3Mask), |
791 | const_iv (Button3Mask), |
792 | const_iv (Button4Mask), |
792 | const_iv (Button4Mask), |
793 | const_iv (Button5Mask), |
793 | const_iv (Button5Mask), |
794 | const_iv (AnyModifier), |
794 | const_iv (AnyModifier), |
|
|
795 | |
|
|
796 | const_iv (NoSymbol), |
|
|
797 | const_iv (GrabModeSync), |
|
|
798 | const_iv (GrabModeAsync), |
795 | |
799 | |
796 | const_iv (EVENT_NONE), |
800 | const_iv (EVENT_NONE), |
797 | const_iv (EVENT_READ), |
801 | const_iv (EVENT_READ), |
798 | const_iv (EVENT_WRITE), |
802 | const_iv (EVENT_WRITE), |
799 | |
803 | |
… | |
… | |
1015 | void |
1019 | void |
1016 | rxvt_term::set_should_invoke (int htype, int inc) |
1020 | rxvt_term::set_should_invoke (int htype, int inc) |
1017 | CODE: |
1021 | CODE: |
1018 | THIS->perl.should_invoke [htype] += inc; |
1022 | THIS->perl.should_invoke [htype] += inc; |
1019 | |
1023 | |
1020 | void |
1024 | int |
1021 | rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) |
1025 | rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) |
1022 | CODE: |
1026 | CODE: |
1023 | XGrabButton (THIS->dpy, button, modifiers, window, 1, |
1027 | RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, |
1024 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1028 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1025 | GrabModeSync, GrabModeSync, None, GRAB_CURSOR); |
1029 | GrabModeSync, GrabModeSync, None, GRAB_CURSOR); |
|
|
1030 | OUTPUT: RETVAL |
1026 | |
1031 | |
1027 | void |
1032 | int |
1028 | rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt) |
1033 | rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt) |
1029 | CODE: |
1034 | CODE: |
1030 | XUngrabButton (THIS->dpy, button, modifiers, window); |
1035 | RETVAL = XUngrabButton (THIS->dpy, button, modifiers, window); |
|
|
1036 | OUTPUT: RETVAL |
1031 | |
1037 | |
1032 | #if 0 |
|
|
1033 | |
|
|
1034 | void |
1038 | void |
1035 | XGrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) |
1039 | rxvt_term::XGrabKey (int keycode, U32 modifiers, Window window = THIS->vt, \ |
1036 | C_ARGS: |
1040 | int owner_events = 1, int pointer_mode = GrabModeAsync, int keyboard_mode = GrabModeAsync) |
1037 | THIS->dpy, keycode, modifiers, window, 1, |
1041 | CODE: |
1038 | GrabModeSync, GrabModeSync |
1042 | XGrabKey (THIS->dpy, keycode, modifiers, window, owner_events, pointer_mode, keyboard_mode); |
1039 | |
1043 | |
1040 | void |
1044 | void |
1041 | XUngrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) |
1045 | rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) |
|
|
1046 | CODE: |
1042 | C_ARGS: THIS->dpy, keycode, modifiers, window |
1047 | XUngrabKey (THIS->dpy, keycode, modifiers, window); |
1043 | |
1048 | |
1044 | #endif |
1049 | void |
|
|
1050 | rxvt_term::XUngrabKeyboard (Time eventtime) |
|
|
1051 | CODE: |
|
|
1052 | XUngrabKeyboard (THIS->dpy, eventtime); |
1045 | |
1053 | |
1046 | bool |
1054 | bool |
1047 | rxvt_term::grab (Time eventtime, int sync = 0) |
1055 | rxvt_term::grab (Time eventtime, int sync = 0) |
1048 | CODE: |
1056 | CODE: |
1049 | { |
1057 | { |
… | |
… | |
1084 | rxvt_term::ungrab () |
1092 | rxvt_term::ungrab () |
1085 | CODE: |
1093 | CODE: |
1086 | ungrab (THIS); |
1094 | ungrab (THIS); |
1087 | |
1095 | |
1088 | int |
1096 | int |
|
|
1097 | rxvt_term::XStringToKeysym (char *string) |
|
|
1098 | CODE: |
|
|
1099 | RETVAL = XStringToKeysym (string); |
|
|
1100 | OUTPUT: RETVAL |
|
|
1101 | |
|
|
1102 | char * |
|
|
1103 | rxvt_term::XKeysymToString (int sym) |
|
|
1104 | CODE: |
|
|
1105 | RETVAL = XKeysymToString (sym); |
|
|
1106 | OUTPUT: RETVAL |
|
|
1107 | |
|
|
1108 | int |
|
|
1109 | rxvt_term::XKeysymToKeycode (int sym) |
|
|
1110 | CODE: |
|
|
1111 | RETVAL = XKeysymToKeycode (THIS->dpy, sym); |
|
|
1112 | OUTPUT: RETVAL |
|
|
1113 | |
|
|
1114 | int |
|
|
1115 | rxvt_term::XKeycodeToKeysym (int code, int index) |
|
|
1116 | CODE: |
|
|
1117 | RETVAL = XKeycodeToKeysym (THIS->dpy, code, index); |
|
|
1118 | OUTPUT: RETVAL |
|
|
1119 | |
|
|
1120 | int |
1089 | rxvt_term::strwidth (SV *str) |
1121 | rxvt_term::strwidth (SV *str) |
1090 | CODE: |
1122 | CODE: |
1091 | { |
1123 | { |
1092 | wchar_t *wstr = sv2wcs (str); |
1124 | wchar_t *wstr = sv2wcs (str); |
1093 | |
1125 | |
1094 | rxvt_push_locale (THIS->locale); |
1126 | rxvt_push_locale (THIS->locale); |
1095 | RETVAL = wcswidth (wstr, wcslen (wstr)); |
1127 | RETVAL = 0; |
|
|
1128 | for (wchar_t *wc = wstr; *wc; wc++) |
|
|
1129 | { |
|
|
1130 | int w = WCWIDTH (*wc); |
|
|
1131 | |
|
|
1132 | if (w) |
|
|
1133 | RETVAL += min (w, 1); |
|
|
1134 | } |
1096 | rxvt_pop_locale (); |
1135 | rxvt_pop_locale (); |
1097 | |
1136 | |
1098 | free (wstr); |
1137 | free (wstr); |
1099 | } |
1138 | } |
1100 | OUTPUT: |
1139 | OUTPUT: |