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.96 by root, Fri Feb 3 05:47:05 2006 UTC vs.
Revision 1.102 by root, Thu Jul 6 23:48:11 2006 UTC

355 355
356 int i; 356 int i;
357 357
358 for (i = AvFILL (overlay_av); i >= 0; i--) 358 for (i = AvFILL (overlay_av); i >= 0; i--)
359 if (SvIV (*av_fetch (overlay_av, i, 1)) == (long)this) 359 if (SvIV (*av_fetch (overlay_av, i, 1)) == (long)this)
360 {
361 av_delete (overlay_av, i, G_DISCARD);
362 break; 360 break;
363 }
364 361
365 for (; i < AvFILL (overlay_av); i++) 362 for (; i < AvFILL (overlay_av); i++)
366 av_store (overlay_av, i, SvREFCNT_inc (*av_fetch (overlay_av, i + 1, 0))); 363 av_store (overlay_av, i, SvREFCNT_inc (*av_fetch (overlay_av, i + 1, 0)));
367 364
368 av_pop (overlay_av); 365 av_pop (overlay_av);
762# include "optinc.h" 759# include "optinc.h"
763# undef nodef 760# undef nodef
764# undef def 761# undef def
765 762
766 HV *stash = gv_stashpv ("urxvt", 1); 763 HV *stash = gv_stashpv ("urxvt", 1);
767 struct { 764 static const struct {
768 const char *name; 765 const char *name;
769 IV iv; 766 IV iv;
770 } *civ, const_iv[] = { 767 } *civ, const_iv[] = {
771# define const_iv(name) { # name, (IV)name } 768# define const_iv(name) { # name, (IV)name }
772 const_iv (DEFAULT_RSTYLE), 769 const_iv (DEFAULT_RSTYLE),
790 const_iv (Button2Mask), 787 const_iv (Button2Mask),
791 const_iv (Button3Mask), 788 const_iv (Button3Mask),
792 const_iv (Button4Mask), 789 const_iv (Button4Mask),
793 const_iv (Button5Mask), 790 const_iv (Button5Mask),
794 const_iv (AnyModifier), 791 const_iv (AnyModifier),
792
793 const_iv (NoSymbol),
794 const_iv (GrabModeSync),
795 const_iv (GrabModeAsync),
795 796
796 const_iv (EVENT_NONE), 797 const_iv (EVENT_NONE),
797 const_iv (EVENT_READ), 798 const_iv (EVENT_READ),
798 const_iv (EVENT_WRITE), 799 const_iv (EVENT_WRITE),
799 800
923 RETVAL 924 RETVAL
924 925
925int 926int
926SET_FGCOLOR (int rend, int new_color) 927SET_FGCOLOR (int rend, int new_color)
927 CODE: 928 CODE:
928 RETVAL = SET_FGCOLOR (rend, new_color); 929 RETVAL = SET_FGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1));
929 OUTPUT: 930 OUTPUT:
930 RETVAL 931 RETVAL
931 932
932int 933int
933SET_BGCOLOR (int rend, int new_color) 934SET_BGCOLOR (int rend, int new_color)
934 CODE: 935 CODE:
935 RETVAL = SET_BGCOLOR (rend, new_color); 936 RETVAL = SET_BGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1));
936 OUTPUT: 937 OUTPUT:
937 RETVAL 938 RETVAL
938 939
939int 940int
940GET_CUSTOM (int rend) 941GET_CUSTOM (int rend)
1015void 1016void
1016rxvt_term::set_should_invoke (int htype, int inc) 1017rxvt_term::set_should_invoke (int htype, int inc)
1017 CODE: 1018 CODE:
1018 THIS->perl.should_invoke [htype] += inc; 1019 THIS->perl.should_invoke [htype] += inc;
1019 1020
1020void 1021int
1021rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) 1022rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt)
1022 CODE: 1023 CODE:
1023 XGrabButton (THIS->dpy, button, modifiers, window, 1, 1024 RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1,
1024 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, 1025 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
1025 GrabModeSync, GrabModeSync, None, GRAB_CURSOR); 1026 GrabModeSync, GrabModeSync, None, GRAB_CURSOR);
1027 OUTPUT: RETVAL
1026 1028
1027void 1029int
1028rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt) 1030rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt)
1029 CODE: 1031 CODE:
1030 XUngrabButton (THIS->dpy, button, modifiers, window); 1032 RETVAL = XUngrabButton (THIS->dpy, button, modifiers, window);
1033 OUTPUT: RETVAL
1031 1034
1032#if 0
1033
1034void 1035void
1035XGrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) 1036rxvt_term::XGrabKey (int keycode, U32 modifiers, Window window = THIS->vt, \
1036 C_ARGS: 1037 int owner_events = 1, int pointer_mode = GrabModeAsync, int keyboard_mode = GrabModeAsync)
1037 THIS->dpy, keycode, modifiers, window, 1, 1038 CODE:
1038 GrabModeSync, GrabModeSync 1039 XGrabKey (THIS->dpy, keycode, modifiers, window, owner_events, pointer_mode, keyboard_mode);
1039 1040
1040void 1041void
1041XUngrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) 1042rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
1043 CODE:
1042 C_ARGS: THIS->dpy, keycode, modifiers, window 1044 XUngrabKey (THIS->dpy, keycode, modifiers, window);
1043 1045
1044#endif 1046void
1047rxvt_term::XUngrabKeyboard (Time eventtime)
1048 CODE:
1049 XUngrabKeyboard (THIS->dpy, eventtime);
1045 1050
1046bool 1051bool
1047rxvt_term::grab (Time eventtime, int sync = 0) 1052rxvt_term::grab (Time eventtime, int sync = 0)
1048 CODE: 1053 CODE:
1049{ 1054{
1082 1087
1083void 1088void
1084rxvt_term::ungrab () 1089rxvt_term::ungrab ()
1085 CODE: 1090 CODE:
1086 ungrab (THIS); 1091 ungrab (THIS);
1092
1093int
1094rxvt_term::XStringToKeysym (char *string)
1095 CODE:
1096 RETVAL = XStringToKeysym (string);
1097 OUTPUT: RETVAL
1098
1099char *
1100rxvt_term::XKeysymToString (int sym)
1101 CODE:
1102 RETVAL = XKeysymToString (sym);
1103 OUTPUT: RETVAL
1104
1105int
1106rxvt_term::XKeysymToKeycode (int sym)
1107 CODE:
1108 RETVAL = XKeysymToKeycode (THIS->dpy, sym);
1109 OUTPUT: RETVAL
1110
1111int
1112rxvt_term::XKeycodeToKeysym (int code, int index)
1113 CODE:
1114 RETVAL = XKeycodeToKeysym (THIS->dpy, code, index);
1115 OUTPUT: RETVAL
1087 1116
1088int 1117int
1089rxvt_term::strwidth (SV *str) 1118rxvt_term::strwidth (SV *str)
1090 CODE: 1119 CODE:
1091{ 1120{
1209 } 1238 }
1210 OUTPUT: 1239 OUTPUT:
1211 RETVAL 1240 RETVAL
1212 1241
1213SV * 1242SV *
1214rxvt_term::_env () 1243rxvt_term::envv ()
1244 ALIAS:
1245 argv = 1
1215 CODE: 1246 PPCODE:
1216{ 1247{
1217 if (THIS->envv) 1248 stringvec *vec = ix ? THIS->argv : THIS->envv;
1218 {
1219 AV *av = newAV ();
1220 1249
1250 EXTEND (SP, vec->size ());
1251
1221 for (char **i = THIS->envv->begin (); i != THIS->envv->end (); ++i) 1252 for (char **i = vec->begin (); i != vec->end (); ++i)
1222 if (*i) 1253 if (*i)
1223 av_push (av, newSVpv (*i, 0)); 1254 PUSHs (sv_2mortal (newSVpv (*i, 0)));
1224
1225 RETVAL = newRV_noinc ((SV *)av);
1226 }
1227 else
1228 RETVAL = &PL_sv_undef;
1229} 1255}
1230 OUTPUT:
1231 RETVAL
1232 1256
1233int 1257int
1234rxvt_term::pty_ev_events (int events = EVENT_UNDEF) 1258rxvt_term::pty_ev_events (int events = EVENT_UNDEF)
1235 CODE: 1259 CODE:
1236 RETVAL = THIS->pty_ev.events; 1260 RETVAL = THIS->pty_ev.events;
1290void 1314void
1291rxvt_term::focus_in () 1315rxvt_term::focus_in ()
1292 1316
1293void 1317void
1294rxvt_term::focus_out () 1318rxvt_term::focus_out ()
1319
1320void
1321rxvt_term::key_press (unsigned int state, unsigned int keycode, Time time = CurrentTime)
1322 ALIAS:
1323 key_release = 1
1324 CODE:
1325{
1326 XKeyEvent xkey;
1327
1328 memset (&xkey, 0, sizeof (xkey));
1329
1330 xkey.time = time;
1331 xkey.state = state;
1332 xkey.keycode = keycode;
1333
1334 xkey.type = ix ? KeyRelease : KeyPress;
1335 xkey.display = THIS->dpy;
1336 xkey.window = THIS->vt;
1337 xkey.root = THIS->display->root;
1338 xkey.subwindow = THIS->vt;
1339
1340 if (ix)
1341 THIS->key_release (xkey);
1342 else
1343 THIS->key_press (xkey);
1344}
1295 1345
1296void 1346void
1297rxvt_term::want_refresh () 1347rxvt_term::want_refresh ()
1298 CODE: 1348 CODE:
1299 THIS->want_refresh = 1; 1349 THIS->want_refresh = 1;
1492 1542
1493void 1543void
1494rxvt_term::_resource (char *name, int index, SV *newval = 0) 1544rxvt_term::_resource (char *name, int index, SV *newval = 0)
1495 PPCODE: 1545 PPCODE:
1496{ 1546{
1497 struct resval { const char *name; int value; } rslist [] = { 1547 static const struct resval { const char *name; int value; } *rs, rslist [] = {
1498# define def(name) { # name, Rs_ ## name }, 1548# define def(name) { # name, Rs_ ## name },
1499# define reserve(name,count) 1549# define reserve(name,count)
1500# include "rsinc.h" 1550# include "rsinc.h"
1501# undef def 1551# undef def
1502# undef reserve 1552# undef reserve
1503 }; 1553 };
1504 1554
1505 struct resval *rs = rslist + sizeof (rslist) / sizeof (rslist [0]); 1555 rs = rslist + sizeof (rslist) / sizeof (rslist [0]);
1506 1556
1507 do { 1557 do {
1508 if (rs-- == rslist) 1558 if (rs-- == rslist)
1509 croak ("no such resource '%s', requested", name); 1559 croak ("no such resource '%s', requested", name);
1510 } while (strcmp (name, rs->name)); 1560 } while (strcmp (name, rs->name));
1786 : 1; 1836 : 1;
1787 1837
1788 XChangeProperty (THIS->dpy, window, property, 1838 XChangeProperty (THIS->dpy, window, property,
1789 type, format, PropModeReplace, 1839 type, format, PropModeReplace,
1790 (unsigned char *)data_, len / elemsize); 1840 (unsigned char *)data_, len / elemsize);
1791 XSync (THIS->dpy, 0);
1792} 1841}
1793 1842
1794Atom 1843Atom
1795XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) 1844XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE)
1796 C_ARGS: term->dpy, atom_name, only_if_exists 1845 C_ARGS: term->dpy, atom_name, only_if_exists

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines