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.97 by root, Sat Feb 4 16:12:48 2006 UTC vs.
Revision 1.104 by root, Mon Aug 7 22:28:18 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 }
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
923 RETVAL 927 RETVAL
924 928
925int 929int
926SET_FGCOLOR (int rend, int new_color) 930SET_FGCOLOR (int rend, int new_color)
927 CODE: 931 CODE:
928 RETVAL = SET_FGCOLOR (rend, new_color); 932 RETVAL = SET_FGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1));
929 OUTPUT: 933 OUTPUT:
930 RETVAL 934 RETVAL
931 935
932int 936int
933SET_BGCOLOR (int rend, int new_color) 937SET_BGCOLOR (int rend, int new_color)
934 CODE: 938 CODE:
935 RETVAL = SET_BGCOLOR (rend, new_color); 939 RETVAL = SET_BGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1));
936 OUTPUT: 940 OUTPUT:
937 RETVAL 941 RETVAL
938 942
939int 943int
940GET_CUSTOM (int rend) 944GET_CUSTOM (int rend)
1015void 1019void
1016rxvt_term::set_should_invoke (int htype, int inc) 1020rxvt_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
1020void 1024int
1021rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) 1025rxvt_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
1027void 1032int
1028rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt) 1033rxvt_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
1034void 1038void
1035XGrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) 1039rxvt_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
1040void 1044void
1041XUngrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) 1045rxvt_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 1049void
1050rxvt_term::XUngrabKeyboard (Time eventtime)
1051 CODE:
1052 XUngrabKeyboard (THIS->dpy, eventtime);
1045 1053
1046bool 1054bool
1047rxvt_term::grab (Time eventtime, int sync = 0) 1055rxvt_term::grab (Time eventtime, int sync = 0)
1048 CODE: 1056 CODE:
1049{ 1057{
1084rxvt_term::ungrab () 1092rxvt_term::ungrab ()
1085 CODE: 1093 CODE:
1086 ungrab (THIS); 1094 ungrab (THIS);
1087 1095
1088int 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
1089rxvt_term::strwidth (SV *str) 1121rxvt_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);
1127 //TODO: use same algorithm as screen.C
1095 RETVAL = wcswidth (wstr, wcslen (wstr)); 1128 RETVAL = wcswidth (wstr, wcslen (wstr));
1096 rxvt_pop_locale (); 1129 rxvt_pop_locale ();
1097 1130
1098 free (wstr); 1131 free (wstr);
1099} 1132}
1209 } 1242 }
1210 OUTPUT: 1243 OUTPUT:
1211 RETVAL 1244 RETVAL
1212 1245
1213SV * 1246SV *
1214rxvt_term::_env () 1247rxvt_term::envv ()
1248 ALIAS:
1249 argv = 1
1215 CODE: 1250 PPCODE:
1216{ 1251{
1217 if (THIS->envv) 1252 stringvec *vec = ix ? THIS->argv : THIS->envv;
1218 {
1219 AV *av = newAV ();
1220 1253
1254 EXTEND (SP, vec->size ());
1255
1221 for (char **i = THIS->envv->begin (); i != THIS->envv->end (); ++i) 1256 for (char **i = vec->begin (); i != vec->end (); ++i)
1222 if (*i) 1257 if (*i)
1223 av_push (av, newSVpv (*i, 0)); 1258 PUSHs (sv_2mortal (newSVpv (*i, 0)));
1224
1225 RETVAL = newRV_noinc ((SV *)av);
1226 }
1227 else
1228 RETVAL = &PL_sv_undef;
1229} 1259}
1230 OUTPUT:
1231 RETVAL
1232 1260
1233int 1261int
1234rxvt_term::pty_ev_events (int events = EVENT_UNDEF) 1262rxvt_term::pty_ev_events (int events = EVENT_UNDEF)
1235 CODE: 1263 CODE:
1236 RETVAL = THIS->pty_ev.events; 1264 RETVAL = THIS->pty_ev.events;
1290void 1318void
1291rxvt_term::focus_in () 1319rxvt_term::focus_in ()
1292 1320
1293void 1321void
1294rxvt_term::focus_out () 1322rxvt_term::focus_out ()
1323
1324void
1325rxvt_term::key_press (unsigned int state, unsigned int keycode, Time time = CurrentTime)
1326 ALIAS:
1327 key_release = 1
1328 CODE:
1329{
1330 XKeyEvent xkey;
1331
1332 memset (&xkey, 0, sizeof (xkey));
1333
1334 xkey.time = time;
1335 xkey.state = state;
1336 xkey.keycode = keycode;
1337
1338 xkey.type = ix ? KeyRelease : KeyPress;
1339 xkey.display = THIS->dpy;
1340 xkey.window = THIS->vt;
1341 xkey.root = THIS->display->root;
1342 xkey.subwindow = THIS->vt;
1343
1344 if (ix)
1345 THIS->key_release (xkey);
1346 else
1347 THIS->key_press (xkey);
1348}
1295 1349
1296void 1350void
1297rxvt_term::want_refresh () 1351rxvt_term::want_refresh ()
1298 CODE: 1352 CODE:
1299 THIS->want_refresh = 1; 1353 THIS->want_refresh = 1;
1786 : 1; 1840 : 1;
1787 1841
1788 XChangeProperty (THIS->dpy, window, property, 1842 XChangeProperty (THIS->dpy, window, property,
1789 type, format, PropModeReplace, 1843 type, format, PropModeReplace,
1790 (unsigned char *)data_, len / elemsize); 1844 (unsigned char *)data_, len / elemsize);
1791 XSync (THIS->dpy, 0);
1792} 1845}
1793 1846
1794Atom 1847Atom
1795XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) 1848XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE)
1796 C_ARGS: term->dpy, atom_name, only_if_exists 1849 C_ARGS: term->dpy, atom_name, only_if_exists

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines