ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtperl.xs
(Generate patch)

Comparing rxvt-unicode/src/rxvtperl.xs (file contents):
Revision 1.101 by root, Wed Jul 5 23:34:14 2006 UTC vs.
Revision 1.108 by root, Sun Dec 10 15:14:05 2006 UTC

268}; 268};
269 269
270overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) 270overlay::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 }
787 const_iv (Button2Mask), 790 const_iv (Button2Mask),
788 const_iv (Button3Mask), 791 const_iv (Button3Mask),
789 const_iv (Button4Mask), 792 const_iv (Button4Mask),
790 const_iv (Button5Mask), 793 const_iv (Button5Mask),
791 const_iv (AnyModifier), 794 const_iv (AnyModifier),
795
796 const_iv (NoSymbol),
797 const_iv (GrabModeSync),
798 const_iv (GrabModeAsync),
792 799
793 const_iv (EVENT_NONE), 800 const_iv (EVENT_NONE),
794 const_iv (EVENT_READ), 801 const_iv (EVENT_READ),
795 const_iv (EVENT_WRITE), 802 const_iv (EVENT_WRITE),
796 803
934 RETVAL 941 RETVAL
935 942
936int 943int
937GET_CUSTOM (int rend) 944GET_CUSTOM (int rend)
938 CODE: 945 CODE:
939 RETVAL = (rend && RS_customMask) >> RS_customShift; 946 RETVAL = (rend & RS_customMask) >> RS_customShift;
940 OUTPUT: 947 OUTPUT:
941 RETVAL 948 RETVAL
942 949
943int 950int
944SET_CUSTOM (int rend, int new_value) 951SET_CUSTOM (int rend, int new_value)
1012void 1019void
1013rxvt_term::set_should_invoke (int htype, int inc) 1020rxvt_term::set_should_invoke (int htype, int inc)
1014 CODE: 1021 CODE:
1015 THIS->perl.should_invoke [htype] += inc; 1022 THIS->perl.should_invoke [htype] += inc;
1016 1023
1017void 1024int
1018rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) 1025rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt)
1019 CODE: 1026 CODE:
1020 XGrabButton (THIS->dpy, button, modifiers, window, 1, 1027 RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1,
1021 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, 1028 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
1022 GrabModeSync, GrabModeSync, None, GRAB_CURSOR); 1029 GrabModeSync, GrabModeSync, None, GRAB_CURSOR);
1030 OUTPUT: RETVAL
1023 1031
1024void 1032int
1025rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt) 1033rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt)
1026 CODE: 1034 CODE:
1027 XUngrabButton (THIS->dpy, button, modifiers, window); 1035 RETVAL = XUngrabButton (THIS->dpy, button, modifiers, window);
1036 OUTPUT: RETVAL
1028 1037
1029#if 0
1030
1031void 1038void
1032XGrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) 1039rxvt_term::XGrabKey (int keycode, U32 modifiers, Window window = THIS->vt, \
1033 C_ARGS: 1040 int owner_events = 1, int pointer_mode = GrabModeAsync, int keyboard_mode = GrabModeAsync)
1034 THIS->dpy, keycode, modifiers, window, 1, 1041 CODE:
1035 GrabModeSync, GrabModeSync 1042 XGrabKey (THIS->dpy, keycode, modifiers, window, owner_events, pointer_mode, keyboard_mode);
1036 1043
1037void 1044void
1038XUngrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) 1045rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
1046 CODE:
1039 C_ARGS: THIS->dpy, keycode, modifiers, window 1047 XUngrabKey (THIS->dpy, keycode, modifiers, window);
1040 1048
1041#endif 1049void
1050rxvt_term::XUngrabKeyboard (Time eventtime)
1051 CODE:
1052 XUngrabKeyboard (THIS->dpy, eventtime);
1042 1053
1043bool 1054bool
1044rxvt_term::grab (Time eventtime, int sync = 0) 1055rxvt_term::grab (Time eventtime, int sync = 0)
1045 CODE: 1056 CODE:
1046{ 1057{
1081rxvt_term::ungrab () 1092rxvt_term::ungrab ()
1082 CODE: 1093 CODE:
1083 ungrab (THIS); 1094 ungrab (THIS);
1084 1095
1085int 1096int
1097rxvt_term::XStringToKeysym (char *string)
1098 CODE:
1099 RETVAL = XStringToKeysym (string);
1100 OUTPUT: RETVAL
1101
1102char *
1103rxvt_term::XKeysymToString (int sym)
1104 CODE:
1105 RETVAL = XKeysymToString (sym);
1106 OUTPUT: RETVAL
1107
1108int
1109rxvt_term::XKeysymToKeycode (int sym)
1110 CODE:
1111 RETVAL = XKeysymToKeycode (THIS->dpy, sym);
1112 OUTPUT: RETVAL
1113
1114int
1115rxvt_term::XKeycodeToKeysym (int code, int index)
1116 CODE:
1117 RETVAL = XKeycodeToKeysym (THIS->dpy, code, index);
1118 OUTPUT: RETVAL
1119
1120int
1086rxvt_term::strwidth (SV *str) 1121rxvt_term::strwidth (SV *str)
1087 CODE: 1122 CODE:
1088{ 1123{
1089 wchar_t *wstr = sv2wcs (str); 1124 wchar_t *wstr = sv2wcs (str);
1090 1125
1091 rxvt_push_locale (THIS->locale); 1126 rxvt_push_locale (THIS->locale);
1092 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 += max (w, 1);
1134 }
1093 rxvt_pop_locale (); 1135 rxvt_pop_locale ();
1094 1136
1095 free (wstr); 1137 free (wstr);
1096} 1138}
1097 OUTPUT: 1139 OUTPUT:
1127 rxvt_pop_locale (); 1169 rxvt_pop_locale ();
1128 1170
1129 RETVAL = wcs2sv (wstr); 1171 RETVAL = wcs2sv (wstr);
1130 free (wstr); 1172 free (wstr);
1131} 1173}
1174 OUTPUT:
1175 RETVAL
1176
1177char *
1178rxvt_term::locale ()
1179 CODE:
1180 RETVAL = THIS->locale;
1132 OUTPUT: 1181 OUTPUT:
1133 RETVAL 1182 RETVAL
1134 1183
1135#define TERM_OFFSET(sym) offsetof (TermWin_t, sym) 1184#define TERM_OFFSET(sym) offsetof (TermWin_t, sym)
1136 1185

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines