… | |
… | |
80 | new_ref (HV *hv, const char *klass) |
80 | new_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 |
|
|
86 | static SV * |
85 | static SV * |
87 | newSVptr (void *ptr, const char *klass) |
86 | newSVptr (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 | |
179 | struct timer : perl_watcher, time_watcher |
178 | struct 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 | |
200 | struct iow : perl_watcher, io_watcher |
199 | struct 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 | |
216 | struct iw : perl_watcher, idle_watcher |
215 | struct 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 | |
232 | struct pw : perl_watcher, child_watcher |
231 | struct pw : perl_watcher, child_watcher |
233 | { |
232 | { |
234 | pw () |
233 | pw () |
235 | : child_watcher (this, &pw::execute) |
234 | : child_watcher (this, &pw::execute) |
… | |
… | |
494 | static void |
493 | static void |
495 | ungrab (rxvt_term *THIS) |
494 | ungrab (rxvt_term *THIS) |
496 | { |
495 | { |
497 | if (THIS->perl.grabtime) |
496 | if (THIS->perl.grabtime) |
498 | { |
497 | { |
499 | XUngrabKeyboard (THIS->display->display, THIS->perl.grabtime); |
498 | XUngrabKeyboard (THIS->dpy, THIS->perl.grabtime); |
500 | XUngrabPointer (THIS->display->display, THIS->perl.grabtime); |
499 | XUngrabPointer (THIS->dpy, THIS->perl.grabtime); |
501 | THIS->perl.grabtime = 0; |
500 | THIS->perl.grabtime = 0; |
502 | } |
501 | } |
503 | } |
502 | } |
504 | |
503 | |
505 | bool |
504 | bool |
… | |
… | |
763 | # include "optinc.h" |
762 | # include "optinc.h" |
764 | # undef nodef |
763 | # undef nodef |
765 | # undef def |
764 | # undef def |
766 | |
765 | |
767 | HV *stash = gv_stashpv ("urxvt", 1); |
766 | HV *stash = gv_stashpv ("urxvt", 1); |
768 | struct { |
767 | static const struct { |
769 | const char *name; |
768 | const char *name; |
770 | IV iv; |
769 | IV iv; |
771 | } *civ, const_iv[] = { |
770 | } *civ, const_iv[] = { |
772 | # define const_iv(name) { # name, (IV)name } |
771 | # define const_iv(name) { # name, (IV)name } |
773 | const_iv (DEFAULT_RSTYLE), |
772 | const_iv (DEFAULT_RSTYLE), |
… | |
… | |
883 | const_iv (XIMDontChange), |
882 | const_iv (XIMDontChange), |
884 | # endif |
883 | # endif |
885 | # endif |
884 | # endif |
886 | }; |
885 | }; |
887 | |
886 | |
888 | for (civ = const_iv + sizeof (const_iv) / sizeof (const_iv [0]); |
887 | 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)); |
888 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
891 | } |
889 | } |
892 | |
890 | |
893 | void |
891 | void |
894 | warn (const char *msg) |
892 | warn (const char *msg) |
… | |
… | |
925 | RETVAL |
923 | RETVAL |
926 | |
924 | |
927 | int |
925 | int |
928 | SET_FGCOLOR (int rend, int new_color) |
926 | SET_FGCOLOR (int rend, int new_color) |
929 | CODE: |
927 | CODE: |
930 | RETVAL = SET_FGCOLOR (rend, new_color); |
928 | RETVAL = SET_FGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1)); |
931 | OUTPUT: |
929 | OUTPUT: |
932 | RETVAL |
930 | RETVAL |
933 | |
931 | |
934 | int |
932 | int |
935 | SET_BGCOLOR (int rend, int new_color) |
933 | SET_BGCOLOR (int rend, int new_color) |
936 | CODE: |
934 | CODE: |
937 | RETVAL = SET_BGCOLOR (rend, new_color); |
935 | RETVAL = SET_BGCOLOR (rend, clamp (new_color, 0, TOTAL_COLORS - 1)); |
938 | OUTPUT: |
936 | OUTPUT: |
939 | RETVAL |
937 | RETVAL |
940 | |
938 | |
941 | int |
939 | int |
942 | GET_CUSTOM (int rend) |
940 | GET_CUSTOM (int rend) |
… | |
… | |
956 | | ((new_value << RS_customShift) & RS_customMask); |
954 | | ((new_value << RS_customShift) & RS_customMask); |
957 | } |
955 | } |
958 | OUTPUT: |
956 | OUTPUT: |
959 | RETVAL |
957 | RETVAL |
960 | |
958 | |
|
|
959 | void |
|
|
960 | termlist () |
|
|
961 | PPCODE: |
|
|
962 | { |
|
|
963 | EXTEND (SP, rxvt_term::termlist.size ()); |
|
|
964 | |
|
|
965 | for (rxvt_term **t = rxvt_term::termlist.begin (); t < rxvt_term::termlist.end (); t++) |
|
|
966 | if ((*t)->perl.self) |
|
|
967 | PUSHs (sv_2mortal (newSVterm (*t))); |
|
|
968 | } |
|
|
969 | |
961 | MODULE = urxvt PACKAGE = urxvt::term |
970 | MODULE = urxvt PACKAGE = urxvt::term |
962 | |
971 | |
963 | SV * |
972 | SV * |
964 | _new (...) |
973 | _new (AV *env, AV *arg) |
965 | CODE: |
974 | CODE: |
966 | { |
975 | { |
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; |
976 | rxvt_term *term = new rxvt_term; |
971 | |
977 | |
972 | stringvec *argv = new stringvec; |
978 | stringvec *argv = new stringvec; |
973 | stringvec *envv = new stringvec; |
979 | stringvec *envv = new stringvec; |
974 | |
980 | |
975 | for (int i = 1; i < items; i++) |
981 | for (int i = 0; i <= AvFILL (arg); i++) |
976 | argv->push_back (strdup (SvPVbyte_nolen (ST (i)))); |
982 | argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); |
977 | |
983 | |
978 | AV *env = (AV *)SvRV (ST (0)); |
|
|
979 | for (int i = AvFILL (env) + 1; i--; ) |
984 | for (int i = AvFILL (env) + 1; i--; ) |
980 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
985 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
981 | |
986 | |
982 | envv->push_back (0); |
987 | envv->push_back (0); |
983 | |
988 | |
… | |
… | |
1011 | rxvt_term::set_should_invoke (int htype, int inc) |
1016 | rxvt_term::set_should_invoke (int htype, int inc) |
1012 | CODE: |
1017 | CODE: |
1013 | THIS->perl.should_invoke [htype] += inc; |
1018 | THIS->perl.should_invoke [htype] += inc; |
1014 | |
1019 | |
1015 | void |
1020 | void |
1016 | rxvt_term::grab_button (int button, U32 modifiers) |
1021 | rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) |
1017 | CODE: |
1022 | CODE: |
1018 | XGrabButton (THIS->display->display, button, modifiers, THIS->vt, 1, |
1023 | XGrabButton (THIS->dpy, button, modifiers, window, 1, |
1019 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1024 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1020 | GrabModeSync, GrabModeSync, None, GRAB_CURSOR); |
1025 | GrabModeSync, GrabModeSync, None, GRAB_CURSOR); |
1021 | |
1026 | |
|
|
1027 | void |
|
|
1028 | rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt) |
|
|
1029 | CODE: |
|
|
1030 | XUngrabButton (THIS->dpy, button, modifiers, window); |
|
|
1031 | |
|
|
1032 | #if 0 |
|
|
1033 | |
|
|
1034 | void |
|
|
1035 | XGrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) |
|
|
1036 | C_ARGS: |
|
|
1037 | THIS->dpy, keycode, modifiers, window, 1, |
|
|
1038 | GrabModeSync, GrabModeSync |
|
|
1039 | |
|
|
1040 | void |
|
|
1041 | XUngrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) |
|
|
1042 | C_ARGS: THIS->dpy, keycode, modifiers, window |
|
|
1043 | |
|
|
1044 | #endif |
|
|
1045 | |
1022 | bool |
1046 | bool |
1023 | rxvt_term::grab (Time eventtime, int sync = 0) |
1047 | rxvt_term::grab (Time eventtime, int sync = 0) |
1024 | CODE: |
1048 | CODE: |
1025 | { |
1049 | { |
1026 | int mode = sync ? GrabModeSync : GrabModeAsync; |
1050 | int mode = sync ? GrabModeSync : GrabModeAsync; |
1027 | |
1051 | |
1028 | THIS->perl.grabtime = 0; |
1052 | THIS->perl.grabtime = 0; |
1029 | |
1053 | |
1030 | if (!XGrabPointer (THIS->display->display, THIS->vt, 0, |
1054 | if (!XGrabPointer (THIS->dpy, THIS->vt, 0, |
1031 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1055 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1032 | mode, mode, None, GRAB_CURSOR, eventtime)) |
1056 | mode, mode, None, GRAB_CURSOR, eventtime)) |
1033 | if (!XGrabKeyboard (THIS->display->display, THIS->vt, 0, mode, mode, eventtime)) |
1057 | if (!XGrabKeyboard (THIS->dpy, THIS->vt, 0, mode, mode, eventtime)) |
1034 | THIS->perl.grabtime = eventtime; |
1058 | THIS->perl.grabtime = eventtime; |
1035 | else |
1059 | else |
1036 | XUngrabPointer (THIS->display->display, eventtime); |
1060 | XUngrabPointer (THIS->dpy, eventtime); |
1037 | |
1061 | |
1038 | RETVAL = !!THIS->perl.grabtime; |
1062 | RETVAL = !!THIS->perl.grabtime; |
1039 | } |
1063 | } |
1040 | OUTPUT: |
1064 | OUTPUT: |
1041 | RETVAL |
1065 | RETVAL |
1042 | |
1066 | |
1043 | void |
1067 | void |
1044 | rxvt_term::allow_events_async () |
1068 | rxvt_term::allow_events_async () |
1045 | CODE: |
1069 | CODE: |
1046 | XAllowEvents (THIS->display->display, AsyncBoth, THIS->perl.grabtime); |
1070 | XAllowEvents (THIS->dpy, AsyncBoth, THIS->perl.grabtime); |
1047 | |
1071 | |
1048 | void |
1072 | void |
1049 | rxvt_term::allow_events_sync () |
1073 | rxvt_term::allow_events_sync () |
1050 | CODE: |
1074 | CODE: |
1051 | XAllowEvents (THIS->display->display, SyncBoth, THIS->perl.grabtime); |
1075 | XAllowEvents (THIS->dpy, SyncBoth, THIS->perl.grabtime); |
1052 | |
1076 | |
1053 | void |
1077 | void |
1054 | rxvt_term::allow_events_replay () |
1078 | rxvt_term::allow_events_replay () |
1055 | CODE: |
1079 | CODE: |
1056 | XAllowEvents (THIS->display->display, ReplayPointer, THIS->perl.grabtime); |
1080 | XAllowEvents (THIS->dpy, ReplayPointer, THIS->perl.grabtime); |
1057 | XAllowEvents (THIS->display->display, ReplayKeyboard, THIS->perl.grabtime); |
1081 | XAllowEvents (THIS->dpy, ReplayKeyboard, THIS->perl.grabtime); |
1058 | |
1082 | |
1059 | void |
1083 | void |
1060 | rxvt_term::ungrab () |
1084 | rxvt_term::ungrab () |
1061 | CODE: |
1085 | CODE: |
1062 | ungrab (THIS); |
1086 | ungrab (THIS); |
… | |
… | |
1268 | |
1292 | |
1269 | void |
1293 | void |
1270 | rxvt_term::focus_out () |
1294 | rxvt_term::focus_out () |
1271 | |
1295 | |
1272 | void |
1296 | void |
|
|
1297 | rxvt_term::key_press (unsigned int state, unsigned int keycode, Time time = CurrentTime) |
|
|
1298 | ALIAS: |
|
|
1299 | key_release = 1 |
|
|
1300 | CODE: |
|
|
1301 | { |
|
|
1302 | XKeyEvent xkey; |
|
|
1303 | |
|
|
1304 | memset (&xkey, 0, sizeof (xkey)); |
|
|
1305 | |
|
|
1306 | xkey.time = time; |
|
|
1307 | xkey.state = state; |
|
|
1308 | xkey.keycode = keycode; |
|
|
1309 | |
|
|
1310 | xkey.type = ix ? KeyRelease : KeyPress; |
|
|
1311 | xkey.display = THIS->dpy; |
|
|
1312 | xkey.window = THIS->vt; |
|
|
1313 | xkey.root = THIS->display->root; |
|
|
1314 | xkey.subwindow = THIS->vt; |
|
|
1315 | |
|
|
1316 | if (ix) |
|
|
1317 | THIS->key_release (xkey); |
|
|
1318 | else |
|
|
1319 | THIS->key_press (xkey); |
|
|
1320 | } |
|
|
1321 | |
|
|
1322 | void |
1273 | rxvt_term::want_refresh () |
1323 | rxvt_term::want_refresh () |
1274 | CODE: |
1324 | CODE: |
1275 | THIS->want_refresh = 1; |
1325 | THIS->want_refresh = 1; |
1276 | |
1326 | |
1277 | void |
1327 | void |
… | |
… | |
1468 | |
1518 | |
1469 | void |
1519 | void |
1470 | rxvt_term::_resource (char *name, int index, SV *newval = 0) |
1520 | rxvt_term::_resource (char *name, int index, SV *newval = 0) |
1471 | PPCODE: |
1521 | PPCODE: |
1472 | { |
1522 | { |
1473 | struct resval { const char *name; int value; } rslist [] = { |
1523 | static const struct resval { const char *name; int value; } *rs, rslist [] = { |
1474 | # define def(name) { # name, Rs_ ## name }, |
1524 | # define def(name) { # name, Rs_ ## name }, |
1475 | # define reserve(name,count) |
1525 | # define reserve(name,count) |
1476 | # include "rsinc.h" |
1526 | # include "rsinc.h" |
1477 | # undef def |
1527 | # undef def |
1478 | # undef reserve |
1528 | # undef reserve |
1479 | }; |
1529 | }; |
1480 | |
1530 | |
1481 | struct resval *rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1531 | rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1482 | |
1532 | |
1483 | do { |
1533 | do { |
1484 | if (rs-- == rslist) |
1534 | if (rs-- == rslist) |
1485 | croak ("no such resource '%s', requested", name); |
1535 | croak ("no such resource '%s', requested", name); |
1486 | } while (strcmp (name, rs->name)); |
1536 | } while (strcmp (name, rs->name)); |
… | |
… | |
1711 | void |
1761 | void |
1712 | rxvt_term::XListProperties (Window window) |
1762 | rxvt_term::XListProperties (Window window) |
1713 | PPCODE: |
1763 | PPCODE: |
1714 | { |
1764 | { |
1715 | int count; |
1765 | int count; |
1716 | Atom *props = XListProperties (THIS->display->display, window, &count); |
1766 | Atom *props = XListProperties (THIS->dpy, window, &count); |
1717 | |
1767 | |
1718 | EXTEND (SP, count); |
1768 | EXTEND (SP, count); |
1719 | while (count--) |
1769 | while (count--) |
1720 | PUSHs (newSVuv ((U32)props [count])); |
1770 | PUSHs (newSVuv ((U32)props [count])); |
1721 | |
1771 | |
… | |
… | |
1730 | int format; |
1780 | int format; |
1731 | unsigned long nitems; |
1781 | unsigned long nitems; |
1732 | unsigned long bytes_after; |
1782 | unsigned long bytes_after; |
1733 | unsigned char *prop; |
1783 | unsigned char *prop; |
1734 | |
1784 | |
1735 | XGetWindowProperty (THIS->display->display, window, property, |
1785 | XGetWindowProperty (THIS->dpy, window, property, |
1736 | 0, 1<<24, 0, AnyPropertyType, |
1786 | 0, 1<<24, 0, AnyPropertyType, |
1737 | &type, &format, &nitems, &bytes_after, &prop); |
1787 | &type, &format, &nitems, &bytes_after, &prop); |
1738 | |
1788 | |
1739 | if (type != None) |
1789 | if (type != None) |
1740 | { |
1790 | { |
… | |
… | |
1759 | |
1809 | |
1760 | int elemsize = format == 16 ? sizeof (short) |
1810 | int elemsize = format == 16 ? sizeof (short) |
1761 | : format == 32 ? sizeof (long) |
1811 | : format == 32 ? sizeof (long) |
1762 | : 1; |
1812 | : 1; |
1763 | |
1813 | |
1764 | XChangeProperty (THIS->display->display, window, property, |
1814 | XChangeProperty (THIS->dpy, window, property, |
1765 | type, format, PropModeReplace, |
1815 | type, format, PropModeReplace, |
1766 | (unsigned char *)data_, len / elemsize); |
1816 | (unsigned char *)data_, len / elemsize); |
1767 | XSync (THIS->display->display, 0); |
1817 | XSync (THIS->dpy, 0); |
1768 | } |
1818 | } |
1769 | |
1819 | |
1770 | Atom |
1820 | Atom |
1771 | XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) |
1821 | XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) |
1772 | C_ARGS: term->display->display, atom_name, only_if_exists |
1822 | C_ARGS: term->dpy, atom_name, only_if_exists |
1773 | |
1823 | |
1774 | char * |
1824 | char * |
1775 | XGetAtomName (rxvt_term *term, Atom atom) |
1825 | XGetAtomName (rxvt_term *term, Atom atom) |
1776 | C_ARGS: term->display->display, atom |
1826 | C_ARGS: term->dpy, atom |
1777 | CLEANUP: |
1827 | CLEANUP: |
1778 | XFree (RETVAL); |
1828 | XFree (RETVAL); |
1779 | |
1829 | |
1780 | void |
1830 | void |
1781 | XDeleteProperty (rxvt_term *term, Window window, Atom property) |
1831 | XDeleteProperty (rxvt_term *term, Window window, Atom property) |
1782 | C_ARGS: term->display->display, window, property |
1832 | C_ARGS: term->dpy, window, property |
1783 | |
1833 | |
1784 | Window |
1834 | Window |
1785 | rxvt_term::DefaultRootWindow () |
1835 | rxvt_term::DefaultRootWindow () |
1786 | CODE: |
1836 | CODE: |
1787 | RETVAL = THIS->display->root; |
1837 | RETVAL = THIS->display->root; |
… | |
… | |
1790 | |
1840 | |
1791 | #if 0 |
1841 | #if 0 |
1792 | |
1842 | |
1793 | Window |
1843 | Window |
1794 | XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height) |
1844 | XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height) |
1795 | C_ARGS: term->display->display, (Window)parent, |
1845 | C_ARGS: term->dpy, (Window)parent, |
1796 | x, y, width, height, 0, |
1846 | x, y, width, height, 0, |
1797 | term->pix_colors_focused[Color_border], |
1847 | term->pix_colors_focused[Color_border], |
1798 | term->pix_colors_focused[Color_border] |
1848 | term->pix_colors_focused[Color_border] |
1799 | |
1849 | |
1800 | #endif |
1850 | #endif |
1801 | |
1851 | |
1802 | void |
1852 | void |
1803 | XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0) |
1853 | XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0) |
1804 | C_ARGS: term->display->display, window, parent, x, y |
1854 | C_ARGS: term->dpy, window, parent, x, y |
1805 | |
1855 | |
1806 | void |
1856 | void |
1807 | XMapWindow (rxvt_term *term, Window window) |
1857 | XMapWindow (rxvt_term *term, Window window) |
1808 | C_ARGS: term->display->display, window |
1858 | C_ARGS: term->dpy, window |
1809 | |
1859 | |
1810 | void |
1860 | void |
1811 | XUnmapWindow (rxvt_term *term, Window window) |
1861 | XUnmapWindow (rxvt_term *term, Window window) |
1812 | C_ARGS: term->display->display, window |
1862 | C_ARGS: term->dpy, window |
1813 | |
1863 | |
1814 | void |
1864 | void |
1815 | XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height) |
1865 | XMoveResizeWindow (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 |
1866 | C_ARGS: term->dpy, window, x, y, width, height |
1817 | |
1867 | |
1818 | void |
1868 | void |
1819 | rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0) |
1869 | rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0) |
1820 | CODE: |
1870 | CODE: |
1821 | { |
1871 | { |
1822 | XWindowAttributes attr; |
1872 | XWindowAttributes attr; |
1823 | XGetWindowAttributes (THIS->display->display, window, &attr); |
1873 | XGetWindowAttributes (THIS->dpy, window, &attr); |
1824 | XSelectInput (THIS->display->display, window, attr.your_event_mask | add_events & ~del_events); |
1874 | XSelectInput (THIS->dpy, window, attr.your_event_mask | add_events & ~del_events); |
1825 | } |
1875 | } |
1826 | |
1876 | |
1827 | void |
1877 | void |
1828 | rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y) |
1878 | rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y) |
1829 | PPCODE: |
1879 | PPCODE: |
1830 | { |
1880 | { |
1831 | int dx, dy; |
1881 | int dx, dy; |
1832 | Window child; |
1882 | Window child; |
1833 | |
1883 | |
1834 | if (XTranslateCoordinates (THIS->display->display, src, dst, x, y, &dx, &dy, &child)) |
1884 | if (XTranslateCoordinates (THIS->dpy, src, dst, x, y, &dx, &dy, &child)) |
1835 | { |
1885 | { |
1836 | EXTEND (SP, 3); |
1886 | EXTEND (SP, 3); |
1837 | PUSHs (newSViv (dx)); |
1887 | PUSHs (newSViv (dx)); |
1838 | PUSHs (newSViv (dy)); |
1888 | PUSHs (newSViv (dy)); |
1839 | PUSHs (newSVuv (child)); |
1889 | PUSHs (newSVuv (child)); |