… | |
… | |
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); |
… | |
… | |
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); |
… | |
… | |
494 | static void |
490 | static void |
495 | ungrab (rxvt_term *THIS) |
491 | ungrab (rxvt_term *THIS) |
496 | { |
492 | { |
497 | if (THIS->perl.grabtime) |
493 | if (THIS->perl.grabtime) |
498 | { |
494 | { |
499 | XUngrabKeyboard (THIS->xdisp, THIS->perl.grabtime); |
495 | XUngrabKeyboard (THIS->dpy, THIS->perl.grabtime); |
500 | XUngrabPointer (THIS->xdisp, 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 | |
505 | bool |
501 | bool |
… | |
… | |
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 | |
893 | void |
892 | void |
894 | warn (const char *msg) |
893 | warn (const char *msg) |
… | |
… | |
925 | RETVAL |
924 | RETVAL |
926 | |
925 | |
927 | int |
926 | int |
928 | SET_FGCOLOR (int rend, int new_color) |
927 | SET_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 | |
934 | int |
933 | int |
935 | SET_BGCOLOR (int rend, int new_color) |
934 | SET_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 | |
941 | int |
940 | int |
942 | GET_CUSTOM (int rend) |
941 | GET_CUSTOM (int rend) |
… | |
… | |
1017 | void |
1016 | void |
1018 | rxvt_term::set_should_invoke (int htype, int inc) |
1017 | rxvt_term::set_should_invoke (int htype, int inc) |
1019 | CODE: |
1018 | CODE: |
1020 | THIS->perl.should_invoke [htype] += inc; |
1019 | THIS->perl.should_invoke [htype] += inc; |
1021 | |
1020 | |
1022 | void |
1021 | int |
1023 | rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) |
1022 | rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) |
1024 | CODE: |
1023 | CODE: |
1025 | XGrabButton (THIS->xdisp, button, modifiers, window, 1, |
1024 | RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, |
1026 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1025 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1027 | GrabModeSync, GrabModeSync, None, GRAB_CURSOR); |
1026 | GrabModeSync, GrabModeSync, None, GRAB_CURSOR); |
|
|
1027 | OUTPUT: RETVAL |
1028 | |
1028 | |
1029 | void |
1029 | int |
1030 | rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt) |
1030 | rxvt_term::ungrab_button (int button, U32 modifiers, Window window = THIS->vt) |
1031 | CODE: |
1031 | CODE: |
1032 | XUngrabButton (THIS->xdisp, button, modifiers, window); |
1032 | RETVAL = XUngrabButton (THIS->dpy, button, modifiers, window); |
|
|
1033 | OUTPUT: RETVAL |
1033 | |
1034 | |
1034 | #if 0 |
|
|
1035 | |
|
|
1036 | void |
1035 | void |
1037 | XGrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) |
1036 | rxvt_term::XGrabKey (int keycode, U32 modifiers, Window window = THIS->vt, \ |
1038 | C_ARGS: |
1037 | int owner_events = 1, int pointer_mode = GrabModeAsync, int keyboard_mode = GrabModeAsync) |
1039 | THIS->xdisp, keycode, modifiers, window, 1, |
1038 | CODE: |
1040 | GrabModeSync, GrabModeSync |
1039 | XGrabKey (THIS->dpy, keycode, modifiers, window, owner_events, pointer_mode, keyboard_mode); |
1041 | |
1040 | |
1042 | void |
1041 | void |
1043 | XUngrabKey (rxvt_term *THIS, int keycode, U32 modifiers, Window window = THIS->vt) |
1042 | rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) |
1044 | C_ARGS: THIS->xdisp, keycode, modifiers, window |
1043 | CODE: |
|
|
1044 | XUngrabKey (THIS->dpy, keycode, modifiers, window); |
1045 | |
1045 | |
1046 | #endif |
1046 | void |
|
|
1047 | rxvt_term::XUngrabKeyboard (Time eventtime) |
|
|
1048 | CODE: |
|
|
1049 | XUngrabKeyboard (THIS->dpy, eventtime); |
1047 | |
1050 | |
1048 | bool |
1051 | bool |
1049 | rxvt_term::grab (Time eventtime, int sync = 0) |
1052 | rxvt_term::grab (Time eventtime, int sync = 0) |
1050 | CODE: |
1053 | CODE: |
1051 | { |
1054 | { |
1052 | int mode = sync ? GrabModeSync : GrabModeAsync; |
1055 | int mode = sync ? GrabModeSync : GrabModeAsync; |
1053 | |
1056 | |
1054 | THIS->perl.grabtime = 0; |
1057 | THIS->perl.grabtime = 0; |
1055 | |
1058 | |
1056 | if (!XGrabPointer (THIS->xdisp, THIS->vt, 0, |
1059 | if (!XGrabPointer (THIS->dpy, THIS->vt, 0, |
1057 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1060 | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | PointerMotionMask, |
1058 | mode, mode, None, GRAB_CURSOR, eventtime)) |
1061 | mode, mode, None, GRAB_CURSOR, eventtime)) |
1059 | if (!XGrabKeyboard (THIS->xdisp, THIS->vt, 0, mode, mode, eventtime)) |
1062 | if (!XGrabKeyboard (THIS->dpy, THIS->vt, 0, mode, mode, eventtime)) |
1060 | THIS->perl.grabtime = eventtime; |
1063 | THIS->perl.grabtime = eventtime; |
1061 | else |
1064 | else |
1062 | XUngrabPointer (THIS->xdisp, eventtime); |
1065 | XUngrabPointer (THIS->dpy, eventtime); |
1063 | |
1066 | |
1064 | RETVAL = !!THIS->perl.grabtime; |
1067 | RETVAL = !!THIS->perl.grabtime; |
1065 | } |
1068 | } |
1066 | OUTPUT: |
1069 | OUTPUT: |
1067 | RETVAL |
1070 | RETVAL |
1068 | |
1071 | |
1069 | void |
1072 | void |
1070 | rxvt_term::allow_events_async () |
1073 | rxvt_term::allow_events_async () |
1071 | CODE: |
1074 | CODE: |
1072 | XAllowEvents (THIS->xdisp, AsyncBoth, THIS->perl.grabtime); |
1075 | XAllowEvents (THIS->dpy, AsyncBoth, THIS->perl.grabtime); |
1073 | |
1076 | |
1074 | void |
1077 | void |
1075 | rxvt_term::allow_events_sync () |
1078 | rxvt_term::allow_events_sync () |
1076 | CODE: |
1079 | CODE: |
1077 | XAllowEvents (THIS->xdisp, SyncBoth, THIS->perl.grabtime); |
1080 | XAllowEvents (THIS->dpy, SyncBoth, THIS->perl.grabtime); |
1078 | |
1081 | |
1079 | void |
1082 | void |
1080 | rxvt_term::allow_events_replay () |
1083 | rxvt_term::allow_events_replay () |
1081 | CODE: |
1084 | CODE: |
1082 | XAllowEvents (THIS->xdisp, ReplayPointer, THIS->perl.grabtime); |
1085 | XAllowEvents (THIS->dpy, ReplayPointer, THIS->perl.grabtime); |
1083 | XAllowEvents (THIS->xdisp, ReplayKeyboard, THIS->perl.grabtime); |
1086 | XAllowEvents (THIS->dpy, ReplayKeyboard, THIS->perl.grabtime); |
1084 | |
1087 | |
1085 | void |
1088 | void |
1086 | rxvt_term::ungrab () |
1089 | rxvt_term::ungrab () |
1087 | CODE: |
1090 | CODE: |
1088 | ungrab (THIS); |
1091 | ungrab (THIS); |
|
|
1092 | |
|
|
1093 | int |
|
|
1094 | rxvt_term::XStringToKeysym (char *string) |
|
|
1095 | CODE: |
|
|
1096 | RETVAL = XStringToKeysym (string); |
|
|
1097 | OUTPUT: RETVAL |
|
|
1098 | |
|
|
1099 | char * |
|
|
1100 | rxvt_term::XKeysymToString (int sym) |
|
|
1101 | CODE: |
|
|
1102 | RETVAL = XKeysymToString (sym); |
|
|
1103 | OUTPUT: RETVAL |
|
|
1104 | |
|
|
1105 | int |
|
|
1106 | rxvt_term::XKeysymToKeycode (int sym) |
|
|
1107 | CODE: |
|
|
1108 | RETVAL = XKeysymToKeycode (THIS->dpy, sym); |
|
|
1109 | OUTPUT: RETVAL |
|
|
1110 | |
|
|
1111 | int |
|
|
1112 | rxvt_term::XKeycodeToKeysym (int code, int index) |
|
|
1113 | CODE: |
|
|
1114 | RETVAL = XKeycodeToKeysym (THIS->dpy, code, index); |
|
|
1115 | OUTPUT: RETVAL |
1089 | |
1116 | |
1090 | int |
1117 | int |
1091 | rxvt_term::strwidth (SV *str) |
1118 | rxvt_term::strwidth (SV *str) |
1092 | CODE: |
1119 | CODE: |
1093 | { |
1120 | { |
… | |
… | |
1211 | } |
1238 | } |
1212 | OUTPUT: |
1239 | OUTPUT: |
1213 | RETVAL |
1240 | RETVAL |
1214 | |
1241 | |
1215 | SV * |
1242 | SV * |
1216 | rxvt_term::_env () |
1243 | rxvt_term::envv () |
|
|
1244 | ALIAS: |
|
|
1245 | argv = 1 |
1217 | CODE: |
1246 | PPCODE: |
1218 | { |
1247 | { |
1219 | if (THIS->envv) |
1248 | stringvec *vec = ix ? THIS->argv : THIS->envv; |
1220 | { |
|
|
1221 | AV *av = newAV (); |
|
|
1222 | |
1249 | |
|
|
1250 | EXTEND (SP, vec->size ()); |
|
|
1251 | |
1223 | for (char **i = THIS->envv->begin (); i != THIS->envv->end (); ++i) |
1252 | for (char **i = vec->begin (); i != vec->end (); ++i) |
1224 | if (*i) |
1253 | if (*i) |
1225 | av_push (av, newSVpv (*i, 0)); |
1254 | PUSHs (sv_2mortal (newSVpv (*i, 0))); |
1226 | |
|
|
1227 | RETVAL = newRV_noinc ((SV *)av); |
|
|
1228 | } |
|
|
1229 | else |
|
|
1230 | RETVAL = &PL_sv_undef; |
|
|
1231 | } |
1255 | } |
1232 | OUTPUT: |
|
|
1233 | RETVAL |
|
|
1234 | |
1256 | |
1235 | int |
1257 | int |
1236 | rxvt_term::pty_ev_events (int events = EVENT_UNDEF) |
1258 | rxvt_term::pty_ev_events (int events = EVENT_UNDEF) |
1237 | CODE: |
1259 | CODE: |
1238 | RETVAL = THIS->pty_ev.events; |
1260 | RETVAL = THIS->pty_ev.events; |
… | |
… | |
1292 | void |
1314 | void |
1293 | rxvt_term::focus_in () |
1315 | rxvt_term::focus_in () |
1294 | |
1316 | |
1295 | void |
1317 | void |
1296 | rxvt_term::focus_out () |
1318 | rxvt_term::focus_out () |
|
|
1319 | |
|
|
1320 | void |
|
|
1321 | rxvt_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 | } |
1297 | |
1345 | |
1298 | void |
1346 | void |
1299 | rxvt_term::want_refresh () |
1347 | rxvt_term::want_refresh () |
1300 | CODE: |
1348 | CODE: |
1301 | THIS->want_refresh = 1; |
1349 | THIS->want_refresh = 1; |
… | |
… | |
1494 | |
1542 | |
1495 | void |
1543 | void |
1496 | rxvt_term::_resource (char *name, int index, SV *newval = 0) |
1544 | rxvt_term::_resource (char *name, int index, SV *newval = 0) |
1497 | PPCODE: |
1545 | PPCODE: |
1498 | { |
1546 | { |
1499 | struct resval { const char *name; int value; } rslist [] = { |
1547 | static const struct resval { const char *name; int value; } *rs, rslist [] = { |
1500 | # define def(name) { # name, Rs_ ## name }, |
1548 | # define def(name) { # name, Rs_ ## name }, |
1501 | # define reserve(name,count) |
1549 | # define reserve(name,count) |
1502 | # include "rsinc.h" |
1550 | # include "rsinc.h" |
1503 | # undef def |
1551 | # undef def |
1504 | # undef reserve |
1552 | # undef reserve |
1505 | }; |
1553 | }; |
1506 | |
1554 | |
1507 | struct resval *rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1555 | rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1508 | |
1556 | |
1509 | do { |
1557 | do { |
1510 | if (rs-- == rslist) |
1558 | if (rs-- == rslist) |
1511 | croak ("no such resource '%s', requested", name); |
1559 | croak ("no such resource '%s', requested", name); |
1512 | } while (strcmp (name, rs->name)); |
1560 | } while (strcmp (name, rs->name)); |
… | |
… | |
1737 | void |
1785 | void |
1738 | rxvt_term::XListProperties (Window window) |
1786 | rxvt_term::XListProperties (Window window) |
1739 | PPCODE: |
1787 | PPCODE: |
1740 | { |
1788 | { |
1741 | int count; |
1789 | int count; |
1742 | Atom *props = XListProperties (THIS->xdisp, window, &count); |
1790 | Atom *props = XListProperties (THIS->dpy, window, &count); |
1743 | |
1791 | |
1744 | EXTEND (SP, count); |
1792 | EXTEND (SP, count); |
1745 | while (count--) |
1793 | while (count--) |
1746 | PUSHs (newSVuv ((U32)props [count])); |
1794 | PUSHs (newSVuv ((U32)props [count])); |
1747 | |
1795 | |
… | |
… | |
1756 | int format; |
1804 | int format; |
1757 | unsigned long nitems; |
1805 | unsigned long nitems; |
1758 | unsigned long bytes_after; |
1806 | unsigned long bytes_after; |
1759 | unsigned char *prop; |
1807 | unsigned char *prop; |
1760 | |
1808 | |
1761 | XGetWindowProperty (THIS->xdisp, window, property, |
1809 | XGetWindowProperty (THIS->dpy, window, property, |
1762 | 0, 1<<24, 0, AnyPropertyType, |
1810 | 0, 1<<24, 0, AnyPropertyType, |
1763 | &type, &format, &nitems, &bytes_after, &prop); |
1811 | &type, &format, &nitems, &bytes_after, &prop); |
1764 | |
1812 | |
1765 | if (type != None) |
1813 | if (type != None) |
1766 | { |
1814 | { |
… | |
… | |
1785 | |
1833 | |
1786 | int elemsize = format == 16 ? sizeof (short) |
1834 | int elemsize = format == 16 ? sizeof (short) |
1787 | : format == 32 ? sizeof (long) |
1835 | : format == 32 ? sizeof (long) |
1788 | : 1; |
1836 | : 1; |
1789 | |
1837 | |
1790 | XChangeProperty (THIS->xdisp, window, property, |
1838 | XChangeProperty (THIS->dpy, window, property, |
1791 | type, format, PropModeReplace, |
1839 | type, format, PropModeReplace, |
1792 | (unsigned char *)data_, len / elemsize); |
1840 | (unsigned char *)data_, len / elemsize); |
1793 | XSync (THIS->xdisp, 0); |
|
|
1794 | } |
1841 | } |
1795 | |
1842 | |
1796 | Atom |
1843 | Atom |
1797 | XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) |
1844 | XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) |
1798 | C_ARGS: term->xdisp, atom_name, only_if_exists |
1845 | C_ARGS: term->dpy, atom_name, only_if_exists |
1799 | |
1846 | |
1800 | char * |
1847 | char * |
1801 | XGetAtomName (rxvt_term *term, Atom atom) |
1848 | XGetAtomName (rxvt_term *term, Atom atom) |
1802 | C_ARGS: term->xdisp, atom |
1849 | C_ARGS: term->dpy, atom |
1803 | CLEANUP: |
1850 | CLEANUP: |
1804 | XFree (RETVAL); |
1851 | XFree (RETVAL); |
1805 | |
1852 | |
1806 | void |
1853 | void |
1807 | XDeleteProperty (rxvt_term *term, Window window, Atom property) |
1854 | XDeleteProperty (rxvt_term *term, Window window, Atom property) |
1808 | C_ARGS: term->xdisp, window, property |
1855 | C_ARGS: term->dpy, window, property |
1809 | |
1856 | |
1810 | Window |
1857 | Window |
1811 | rxvt_term::DefaultRootWindow () |
1858 | rxvt_term::DefaultRootWindow () |
1812 | CODE: |
1859 | CODE: |
1813 | RETVAL = THIS->display->root; |
1860 | RETVAL = THIS->display->root; |
… | |
… | |
1816 | |
1863 | |
1817 | #if 0 |
1864 | #if 0 |
1818 | |
1865 | |
1819 | Window |
1866 | Window |
1820 | XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height) |
1867 | XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height) |
1821 | C_ARGS: term->xdisp, (Window)parent, |
1868 | C_ARGS: term->dpy, (Window)parent, |
1822 | x, y, width, height, 0, |
1869 | x, y, width, height, 0, |
1823 | term->pix_colors_focused[Color_border], |
1870 | term->pix_colors_focused[Color_border], |
1824 | term->pix_colors_focused[Color_border] |
1871 | term->pix_colors_focused[Color_border] |
1825 | |
1872 | |
1826 | #endif |
1873 | #endif |
1827 | |
1874 | |
1828 | void |
1875 | void |
1829 | XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0) |
1876 | XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0) |
1830 | C_ARGS: term->xdisp, window, parent, x, y |
1877 | C_ARGS: term->dpy, window, parent, x, y |
1831 | |
1878 | |
1832 | void |
1879 | void |
1833 | XMapWindow (rxvt_term *term, Window window) |
1880 | XMapWindow (rxvt_term *term, Window window) |
1834 | C_ARGS: term->xdisp, window |
1881 | C_ARGS: term->dpy, window |
1835 | |
1882 | |
1836 | void |
1883 | void |
1837 | XUnmapWindow (rxvt_term *term, Window window) |
1884 | XUnmapWindow (rxvt_term *term, Window window) |
1838 | C_ARGS: term->xdisp, window |
1885 | C_ARGS: term->dpy, window |
1839 | |
1886 | |
1840 | void |
1887 | void |
1841 | XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height) |
1888 | XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height) |
1842 | C_ARGS: term->xdisp, window, x, y, width, height |
1889 | C_ARGS: term->dpy, window, x, y, width, height |
1843 | |
1890 | |
1844 | void |
1891 | void |
1845 | rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0) |
1892 | rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0) |
1846 | CODE: |
1893 | CODE: |
1847 | { |
1894 | { |
1848 | XWindowAttributes attr; |
1895 | XWindowAttributes attr; |
1849 | XGetWindowAttributes (THIS->xdisp, window, &attr); |
1896 | XGetWindowAttributes (THIS->dpy, window, &attr); |
1850 | XSelectInput (THIS->xdisp, window, attr.your_event_mask | add_events & ~del_events); |
1897 | XSelectInput (THIS->dpy, window, attr.your_event_mask | add_events & ~del_events); |
1851 | } |
1898 | } |
1852 | |
1899 | |
1853 | void |
1900 | void |
1854 | rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y) |
1901 | rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y) |
1855 | PPCODE: |
1902 | PPCODE: |
1856 | { |
1903 | { |
1857 | int dx, dy; |
1904 | int dx, dy; |
1858 | Window child; |
1905 | Window child; |
1859 | |
1906 | |
1860 | if (XTranslateCoordinates (THIS->xdisp, src, dst, x, y, &dx, &dy, &child)) |
1907 | if (XTranslateCoordinates (THIS->dpy, src, dst, x, y, &dx, &dy, &child)) |
1861 | { |
1908 | { |
1862 | EXTEND (SP, 3); |
1909 | EXTEND (SP, 3); |
1863 | PUSHs (newSViv (dx)); |
1910 | PUSHs (newSViv (dx)); |
1864 | PUSHs (newSViv (dy)); |
1911 | PUSHs (newSViv (dy)); |
1865 | PUSHs (newSVuv (child)); |
1912 | PUSHs (newSVuv (child)); |