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.94 by root, Thu Jan 26 00:09:47 2006 UTC vs.
Revision 1.102 by root, Thu Jul 6 23:48:11 2006 UTC

80new_ref (HV *hv, const char *klass) 80new_ref (HV *hv, const char *klass)
81{ 81{
82 return sv_bless (newRV ((SV *)hv), gv_stashpv (klass, 1)); 82 return sv_bless (newRV ((SV *)hv), gv_stashpv (klass, 1));
83} 83}
84 84
85//TODO: use magic
86static SV * 85static SV *
87newSVptr (void *ptr, const char *klass) 86newSVptr (void *ptr, const char *klass)
88{ 87{
89 HV *hv = newHV (); 88 HV *hv = newHV ();
90 sv_magic ((SV *)hv, 0, PERL_MAGIC_ext, (char *)ptr, 0); 89 sv_magic ((SV *)hv, 0, PERL_MAGIC_ext, (char *)ptr, 0);
113 croak ("perl code used %s object, but C++ object is already destroyed, caught", klass); 112 croak ("perl code used %s object, but C++ object is already destroyed, caught", klass);
114 113
115 return (long)mg->mg_ptr; 114 return (long)mg->mg_ptr;
116} 115}
117 116
118#define newSVterm(term) SvREFCNT_inc ((SV *)term->perl.self) 117#define newSVterm(term) SvREFCNT_inc ((SV *)(term)->perl.self)
119#define SvTERM(sv) (rxvt_term *)SvPTR (sv, "urxvt::term") 118#define SvTERM(sv) (rxvt_term *)SvPTR ((sv), "urxvt::term")
120 119
121///////////////////////////////////////////////////////////////////////////// 120/////////////////////////////////////////////////////////////////////////////
122 121
123#define SvWATCHER(sv) (perl_watcher *)SvPTR (sv, "urxvt::watcher") 122#define SvWATCHER(sv) (perl_watcher *)SvPTR (sv, "urxvt::watcher")
124 123
171 170
172 if (SvTRUE (ERRSV)) 171 if (SvTRUE (ERRSV))
173 rxvt_warn ("%s callback evaluation error: %s", type, SvPV_nolen (ERRSV)); 172 rxvt_warn ("%s callback evaluation error: %s", type, SvPV_nolen (ERRSV));
174} 173}
175 174
176#define newSVtimer(timer) new_ref (timer->self, "urxvt::timer") 175#define newSVtimer(timer) new_ref ((timer)->self, "urxvt::timer")
177#define SvTIMER(sv) (timer *)(perl_watcher *)SvPTR (sv, "urxvt::timer") 176#define SvTIMER(sv) (timer *)(perl_watcher *)SvPTR ((sv), "urxvt::timer")
178 177
179struct timer : perl_watcher, time_watcher 178struct timer : perl_watcher, time_watcher
180{ 179{
181 tstamp interval; 180 tstamp interval;
182 181
192 191
193 invoke ("urxvt::timer", newSVtimer (this)); 192 invoke ("urxvt::timer", newSVtimer (this));
194 } 193 }
195}; 194};
196 195
197#define newSViow(iow) new_ref (iow->self, "urxvt::iow") 196#define newSViow(iow) new_ref ((iow)->self, "urxvt::iow")
198#define SvIOW(sv) (iow *)(perl_watcher *)SvPTR (sv, "urxvt::iow") 197#define SvIOW(sv) (iow *)(perl_watcher *)SvPTR ((sv), "urxvt::iow")
199 198
200struct iow : perl_watcher, io_watcher 199struct iow : perl_watcher, io_watcher
201{ 200{
202 iow () 201 iow ()
203 : io_watcher (this, &iow::execute) 202 : io_watcher (this, &iow::execute)
208 { 207 {
209 invoke ("urxvt::iow", newSViow (this), revents); 208 invoke ("urxvt::iow", newSViow (this), revents);
210 } 209 }
211}; 210};
212 211
213#define newSViw(iw) new_ref (iw->self, "urxvt::iw") 212#define newSViw(iw) new_ref ((iw)->self, "urxvt::iw")
214#define SvIW(sv) (iw *)(perl_watcher *)SvPTR (sv, "urxvt::iw") 213#define SvIW(sv) (iw *)(perl_watcher *)SvPTR ((sv), "urxvt::iw")
215 214
216struct iw : perl_watcher, idle_watcher 215struct iw : perl_watcher, idle_watcher
217{ 216{
218 iw () 217 iw ()
219 : idle_watcher (this, &iw::execute) 218 : idle_watcher (this, &iw::execute)
224 { 223 {
225 invoke ("urxvt::iw", newSViw (this)); 224 invoke ("urxvt::iw", newSViw (this));
226 } 225 }
227}; 226};
228 227
229#define newSVpw(pw) new_ref (pw->self, "urxvt::pw") 228#define newSVpw(pw) new_ref ((pw)->self, "urxvt::pw")
230#define SvPW(sv) (pw *)(perl_watcher *)SvPTR (sv, "urxvt::pw") 229#define SvPW(sv) (pw *)(perl_watcher *)SvPTR ((sv), "urxvt::pw")
231 230
232struct pw : perl_watcher, child_watcher 231struct pw : perl_watcher, child_watcher
233{ 232{
234 pw () 233 pw ()
235 : child_watcher (this, &pw::execute) 234 : child_watcher (this, &pw::execute)
356 355
357 int i; 356 int i;
358 357
359 for (i = AvFILL (overlay_av); i >= 0; i--) 358 for (i = AvFILL (overlay_av); i >= 0; i--)
360 if (SvIV (*av_fetch (overlay_av, i, 1)) == (long)this) 359 if (SvIV (*av_fetch (overlay_av, i, 1)) == (long)this)
361 {
362 av_delete (overlay_av, i, G_DISCARD);
363 break; 360 break;
364 }
365 361
366 for (; i < AvFILL (overlay_av); i++) 362 for (; i < AvFILL (overlay_av); i++)
367 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)));
368 364
369 av_pop (overlay_av); 365 av_pop (overlay_av);
494static void 490static void
495ungrab (rxvt_term *THIS) 491ungrab (rxvt_term *THIS)
496{ 492{
497 if (THIS->perl.grabtime) 493 if (THIS->perl.grabtime)
498 { 494 {
499 XUngrabKeyboard (THIS->display->display, THIS->perl.grabtime); 495 XUngrabKeyboard (THIS->dpy, THIS->perl.grabtime);
500 XUngrabPointer (THIS->display->display, THIS->perl.grabtime); 496 XUngrabPointer (THIS->dpy, THIS->perl.grabtime);
501 THIS->perl.grabtime = 0; 497 THIS->perl.grabtime = 0;
502 } 498 }
503} 499}
504 500
505bool 501bool
763# include "optinc.h" 759# include "optinc.h"
764# undef nodef 760# undef nodef
765# undef def 761# undef def
766 762
767 HV *stash = gv_stashpv ("urxvt", 1); 763 HV *stash = gv_stashpv ("urxvt", 1);
768 struct { 764 static const struct {
769 const char *name; 765 const char *name;
770 IV iv; 766 IV iv;
771 } *civ, const_iv[] = { 767 } *civ, const_iv[] = {
772# define const_iv(name) { # name, (IV)name } 768# define const_iv(name) { # name, (IV)name }
773 const_iv (DEFAULT_RSTYLE), 769 const_iv (DEFAULT_RSTYLE),
791 const_iv (Button2Mask), 787 const_iv (Button2Mask),
792 const_iv (Button3Mask), 788 const_iv (Button3Mask),
793 const_iv (Button4Mask), 789 const_iv (Button4Mask),
794 const_iv (Button5Mask), 790 const_iv (Button5Mask),
795 const_iv (AnyModifier), 791 const_iv (AnyModifier),
792
793 const_iv (NoSymbol),
794 const_iv (GrabModeSync),
795 const_iv (GrabModeAsync),
796 796
797 const_iv (EVENT_NONE), 797 const_iv (EVENT_NONE),
798 const_iv (EVENT_READ), 798 const_iv (EVENT_READ),
799 const_iv (EVENT_WRITE), 799 const_iv (EVENT_WRITE),
800 800
883 const_iv (XIMDontChange), 883 const_iv (XIMDontChange),
884# endif 884# endif
885# endif 885# endif
886 }; 886 };
887 887
888 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); 888 for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); civ-- > const_iv; )
889 civ-- > const_iv; )
890 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); 889 newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv));
891} 890}
892 891
893void 892void
894warn (const char *msg) 893warn (const char *msg)
925 RETVAL 924 RETVAL
926 925
927int 926int
928SET_FGCOLOR (int rend, int new_color) 927SET_FGCOLOR (int rend, int new_color)
929 CODE: 928 CODE:
930 RETVAL = SET_FGCOLOR (rend, new_color); 929 RETVAL = SET_FGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1));
931 OUTPUT: 930 OUTPUT:
932 RETVAL 931 RETVAL
933 932
934int 933int
935SET_BGCOLOR (int rend, int new_color) 934SET_BGCOLOR (int rend, int new_color)
936 CODE: 935 CODE:
937 RETVAL = SET_BGCOLOR (rend, new_color); 936 RETVAL = SET_BGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1));
938 OUTPUT: 937 OUTPUT:
939 RETVAL 938 RETVAL
940 939
941int 940int
942GET_CUSTOM (int rend) 941GET_CUSTOM (int rend)
956 | ((new_value << RS_customShift) & RS_customMask); 955 | ((new_value << RS_customShift) & RS_customMask);
957} 956}
958 OUTPUT: 957 OUTPUT:
959 RETVAL 958 RETVAL
960 959
960void
961termlist ()
962 PPCODE:
963{
964 EXTEND (SP, rxvt_term::termlist.size ());
965
966 for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++)
967 if ((*t)->perl.self)
968 PUSHs (sv_2mortal (newSVterm (*t)));
969}
970
961MODULE = urxvt PACKAGE = urxvt::term 971MODULE = urxvt PACKAGE = urxvt::term
962 972
963SV * 973SV *
964_new (...) 974_new (AV *env, AV *arg)
965 CODE: 975 CODE:
966{ 976{
967 if (items < 1 || !SvROK (ST (0)) || SvTYPE (SvRV (ST (0))) != SVt_PVAV)
968 croak ("first argument to urxvt::term->_new must be arrayref");
969
970 rxvt_term *term = new rxvt_term; 977 rxvt_term *term = new rxvt_term;
971 978
972 stringvec *argv = new stringvec; 979 stringvec *argv = new stringvec;
973 stringvec *envv = new stringvec; 980 stringvec *envv = new stringvec;
974 981
975 for (int i = 1; i < items; i++) 982 for (int i = 0; i <= AvFILL (arg); i++)
976 argv->push_back (strdup (SvPVbyte_nolen (ST (i)))); 983 argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1))));
977 984
978 AV *env = (AV *)SvRV (ST (0));
979 for (int i = AvFILL (env) + 1; i--; ) 985 for (int i = AvFILL (env) + 1; i--; )
980 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); 986 envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1))));
981 987
982 envv->push_back (0); 988 envv->push_back (0);
983 989
1010void 1016void
1011rxvt_term::set_should_invoke (int htype, int inc) 1017rxvt_term::set_should_invoke (int htype, int inc)
1012 CODE: 1018 CODE:
1013 THIS->perl.should_invoke [htype] += inc; 1019 THIS->perl.should_invoke [htype] += inc;
1014 1020
1015void 1021int
1016rxvt_term::grab_button (int button, U32 modifiers) 1022rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt)
1017 CODE: 1023 CODE:
1018 XGrabButton (THIS->display->display, button, modifiers, THIS->vt, 1, 1024 RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1,
1019 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, 1025 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
1020 GrabModeSync, GrabModeSync, None, GRAB_CURSOR); 1026 GrabModeSync, GrabModeSync, None, GRAB_CURSOR);
1027 OUTPUT: RETVAL
1028
1029int
1030rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt)
1031 CODE:
1032 RETVAL = XUngrabButton (THIS->dpy, button, modifiers, window);
1033 OUTPUT: RETVAL
1034
1035void
1036rxvt_term::XGrabKey (int keycode, U32 modifiers, Window window = THIS->vt, \
1037 int owner_events = 1, int pointer_mode = GrabModeAsync, int keyboard_mode = GrabModeAsync)
1038 CODE:
1039 XGrabKey (THIS->dpy, keycode, modifiers, window, owner_events, pointer_mode, keyboard_mode);
1040
1041void
1042rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt)
1043 CODE:
1044 XUngrabKey (THIS->dpy, keycode, modifiers, window);
1045
1046void
1047rxvt_term::XUngrabKeyboard (Time eventtime)
1048 CODE:
1049 XUngrabKeyboard (THIS->dpy, eventtime);
1021 1050
1022bool 1051bool
1023rxvt_term::grab (Time eventtime, int sync = 0) 1052rxvt_term::grab (Time eventtime, int sync = 0)
1024 CODE: 1053 CODE:
1025{ 1054{
1026 int mode = sync ? GrabModeSync : GrabModeAsync; 1055 int mode = sync ? GrabModeSync : GrabModeAsync;
1027 1056
1028 THIS->perl.grabtime = 0; 1057 THIS->perl.grabtime = 0;
1029 1058
1030 if (!XGrabPointer (THIS->display->display, THIS->vt, 0, 1059 if (!XGrabPointer (THIS->dpy, THIS->vt, 0,
1031 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, 1060 ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask,
1032 mode, mode, None, GRAB_CURSOR, eventtime)) 1061 mode, mode, None, GRAB_CURSOR, eventtime))
1033 if (!XGrabKeyboard (THIS->display->display, THIS->vt, 0, mode, mode, eventtime)) 1062 if (!XGrabKeyboard (THIS->dpy, THIS->vt, 0, mode, mode, eventtime))
1034 THIS->perl.grabtime = eventtime; 1063 THIS->perl.grabtime = eventtime;
1035 else 1064 else
1036 XUngrabPointer (THIS->display->display, eventtime); 1065 XUngrabPointer (THIS->dpy, eventtime);
1037 1066
1038 RETVAL = !!THIS->perl.grabtime; 1067 RETVAL = !!THIS->perl.grabtime;
1039} 1068}
1040 OUTPUT: 1069 OUTPUT:
1041 RETVAL 1070 RETVAL
1042 1071
1043void 1072void
1044rxvt_term::allow_events_async () 1073rxvt_term::allow_events_async ()
1045 CODE: 1074 CODE:
1046 XAllowEvents (THIS->display->display, AsyncBoth, THIS->perl.grabtime); 1075 XAllowEvents (THIS->dpy, AsyncBoth, THIS->perl.grabtime);
1047 1076
1048void 1077void
1049rxvt_term::allow_events_sync () 1078rxvt_term::allow_events_sync ()
1050 CODE: 1079 CODE:
1051 XAllowEvents (THIS->display->display, SyncBoth, THIS->perl.grabtime); 1080 XAllowEvents (THIS->dpy, SyncBoth, THIS->perl.grabtime);
1052 1081
1053void 1082void
1054rxvt_term::allow_events_replay () 1083rxvt_term::allow_events_replay ()
1055 CODE: 1084 CODE:
1056 XAllowEvents (THIS->display->display, ReplayPointer, THIS->perl.grabtime); 1085 XAllowEvents (THIS->dpy, ReplayPointer, THIS->perl.grabtime);
1057 XAllowEvents (THIS->display->display, ReplayKeyboard, THIS->perl.grabtime); 1086 XAllowEvents (THIS->dpy, ReplayKeyboard, THIS->perl.grabtime);
1058 1087
1059void 1088void
1060rxvt_term::ungrab () 1089rxvt_term::ungrab ()
1061 CODE: 1090 CODE:
1062 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
1063 1116
1064int 1117int
1065rxvt_term::strwidth (SV *str) 1118rxvt_term::strwidth (SV *str)
1066 CODE: 1119 CODE:
1067{ 1120{
1185 } 1238 }
1186 OUTPUT: 1239 OUTPUT:
1187 RETVAL 1240 RETVAL
1188 1241
1189SV * 1242SV *
1190rxvt_term::_env () 1243rxvt_term::envv ()
1244 ALIAS:
1245 argv = 1
1191 CODE: 1246 PPCODE:
1192{ 1247{
1193 if (THIS->envv) 1248 stringvec *vec = ix ? THIS->argv : THIS->envv;
1194 {
1195 AV *av = newAV ();
1196 1249
1250 EXTEND (SP, vec->size ());
1251
1197 for (char **i = THIS->envv->begin (); i != THIS->envv->end (); ++i) 1252 for (char **i = vec->begin (); i != vec->end (); ++i)
1198 if (*i) 1253 if (*i)
1199 av_push (av, newSVpv (*i, 0)); 1254 PUSHs (sv_2mortal (newSVpv (*i, 0)));
1200
1201 RETVAL = newRV_noinc ((SV *)av);
1202 }
1203 else
1204 RETVAL = &PL_sv_undef;
1205} 1255}
1206 OUTPUT:
1207 RETVAL
1208 1256
1209int 1257int
1210rxvt_term::pty_ev_events (int events = EVENT_UNDEF) 1258rxvt_term::pty_ev_events (int events = EVENT_UNDEF)
1211 CODE: 1259 CODE:
1212 RETVAL = THIS->pty_ev.events; 1260 RETVAL = THIS->pty_ev.events;
1266void 1314void
1267rxvt_term::focus_in () 1315rxvt_term::focus_in ()
1268 1316
1269void 1317void
1270rxvt_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}
1271 1345
1272void 1346void
1273rxvt_term::want_refresh () 1347rxvt_term::want_refresh ()
1274 CODE: 1348 CODE:
1275 THIS->want_refresh = 1; 1349 THIS->want_refresh = 1;
1468 1542
1469void 1543void
1470rxvt_term::_resource (char *name, int index, SV *newval = 0) 1544rxvt_term::_resource (char *name, int index, SV *newval = 0)
1471 PPCODE: 1545 PPCODE:
1472{ 1546{
1473 struct resval { const char *name; int value; } rslist [] = { 1547 static const struct resval { const char *name; int value; } *rs, rslist [] = {
1474# define def(name) { # name, Rs_ ## name }, 1548# define def(name) { # name, Rs_ ## name },
1475# define reserve(name,count) 1549# define reserve(name,count)
1476# include "rsinc.h" 1550# include "rsinc.h"
1477# undef def 1551# undef def
1478# undef reserve 1552# undef reserve
1479 }; 1553 };
1480 1554
1481 struct resval *rs = rslist + sizeof (rslist) / sizeof (rslist [0]); 1555 rs = rslist + sizeof (rslist) / sizeof (rslist [0]);
1482 1556
1483 do { 1557 do {
1484 if (rs-- == rslist) 1558 if (rs-- == rslist)
1485 croak ("no such resource '%s', requested", name); 1559 croak ("no such resource '%s', requested", name);
1486 } while (strcmp (name, rs->name)); 1560 } while (strcmp (name, rs->name));
1711void 1785void
1712rxvt_term::XListProperties (Window window) 1786rxvt_term::XListProperties (Window window)
1713 PPCODE: 1787 PPCODE:
1714{ 1788{
1715 int count; 1789 int count;
1716 Atom *props = XListProperties (THIS->display->display, window, &count); 1790 Atom *props = XListProperties (THIS->dpy, window, &count);
1717 1791
1718 EXTEND (SP, count); 1792 EXTEND (SP, count);
1719 while (count--) 1793 while (count--)
1720 PUSHs (newSVuv ((U32)props [count])); 1794 PUSHs (newSVuv ((U32)props [count]));
1721 1795
1730 int format; 1804 int format;
1731 unsigned long nitems; 1805 unsigned long nitems;
1732 unsigned long bytes_after; 1806 unsigned long bytes_after;
1733 unsigned char *prop; 1807 unsigned char *prop;
1734 1808
1735 XGetWindowProperty (THIS->display->display, window, property, 1809 XGetWindowProperty (THIS->dpy, window, property,
1736 0, 1<<24, 0, AnyPropertyType, 1810 0, 1<<24, 0, AnyPropertyType,
1737 &type, &format, &nitems, &bytes_after, &prop); 1811 &type, &format, &nitems, &bytes_after, &prop);
1738 1812
1739 if (type != None) 1813 if (type != None)
1740 { 1814 {
1759 1833
1760 int elemsize = format == 16 ? sizeof (short) 1834 int elemsize = format == 16 ? sizeof (short)
1761 : format == 32 ? sizeof (long) 1835 : format == 32 ? sizeof (long)
1762 : 1; 1836 : 1;
1763 1837
1764 XChangeProperty (THIS->display->display, window, property, 1838 XChangeProperty (THIS->dpy, window, property,
1765 type, format, PropModeReplace, 1839 type, format, PropModeReplace,
1766 (unsigned char *)data_, len / elemsize); 1840 (unsigned char *)data_, len / elemsize);
1767 XSync (THIS->display->display, 0);
1768} 1841}
1769 1842
1770Atom 1843Atom
1771XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) 1844XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE)
1772 C_ARGS: term->display->display, atom_name, only_if_exists 1845 C_ARGS: term->dpy, atom_name, only_if_exists
1773 1846
1774char * 1847char *
1775XGetAtomName (rxvt_term *term, Atom atom) 1848XGetAtomName (rxvt_term *term, Atom atom)
1776 C_ARGS: term->display->display, atom 1849 C_ARGS: term->dpy, atom
1777 CLEANUP: 1850 CLEANUP:
1778 XFree (RETVAL); 1851 XFree (RETVAL);
1779 1852
1780void 1853void
1781XDeleteProperty (rxvt_term *term, Window window, Atom property) 1854XDeleteProperty (rxvt_term *term, Window window, Atom property)
1782 C_ARGS: term->display->display, window, property 1855 C_ARGS: term->dpy, window, property
1783 1856
1784Window 1857Window
1785rxvt_term::DefaultRootWindow () 1858rxvt_term::DefaultRootWindow ()
1786 CODE: 1859 CODE:
1787 RETVAL = THIS->display->root; 1860 RETVAL = THIS->display->root;
1790 1863
1791#if 0 1864#if 0
1792 1865
1793Window 1866Window
1794XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height) 1867XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height)
1795 C_ARGS: term->display->display, (Window)parent, 1868 C_ARGS: term->dpy, (Window)parent,
1796 x, y, width, height, 0, 1869 x, y, width, height, 0,
1797 term->pix_colors_focused[Color_border], 1870 term->pix_colors_focused[Color_border],
1798 term->pix_colors_focused[Color_border] 1871 term->pix_colors_focused[Color_border]
1799 1872
1800#endif 1873#endif
1801 1874
1802void 1875void
1803XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0) 1876XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0)
1804 C_ARGS: term->display->display, window, parent, x, y 1877 C_ARGS: term->dpy, window, parent, x, y
1805 1878
1806void 1879void
1807XMapWindow (rxvt_term *term, Window window) 1880XMapWindow (rxvt_term *term, Window window)
1808 C_ARGS: term->display->display, window 1881 C_ARGS: term->dpy, window
1809 1882
1810void 1883void
1811XUnmapWindow (rxvt_term *term, Window window) 1884XUnmapWindow (rxvt_term *term, Window window)
1812 C_ARGS: term->display->display, window 1885 C_ARGS: term->dpy, window
1813 1886
1814void 1887void
1815XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height) 1888XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height)
1816 C_ARGS: term->display->display, window, x, y, width, height 1889 C_ARGS: term->dpy, window, x, y, width, height
1817 1890
1818void 1891void
1819rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0) 1892rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0)
1820 CODE: 1893 CODE:
1821{ 1894{
1822 XWindowAttributes attr; 1895 XWindowAttributes attr;
1823 XGetWindowAttributes (THIS->display->display, window, &attr); 1896 XGetWindowAttributes (THIS->dpy, window, &attr);
1824 XSelectInput (THIS->display->display, window, attr.your_event_mask | add_events & ~del_events); 1897 XSelectInput (THIS->dpy, window, attr.your_event_mask | add_events & ~del_events);
1825} 1898}
1826 1899
1827void 1900void
1828rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y) 1901rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y)
1829 PPCODE: 1902 PPCODE:
1830{ 1903{
1831 int dx, dy; 1904 int dx, dy;
1832 Window child; 1905 Window child;
1833 1906
1834 if (XTranslateCoordinates (THIS->display->display, src, dst, x, y, &dx, &dy, &child)) 1907 if (XTranslateCoordinates (THIS->dpy, src, dst, x, y, &dx, &dy, &child))
1835 { 1908 {
1836 EXTEND (SP, 3); 1909 EXTEND (SP, 3);
1837 PUSHs (newSViv (dx)); 1910 PUSHs (newSViv (dx));
1838 PUSHs (newSViv (dy)); 1911 PUSHs (newSViv (dy));
1839 PUSHs (newSVuv (child)); 1912 PUSHs (newSVuv (child));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines