… | |
… | |
23 | #define line_t perl_line_t |
23 | #define line_t perl_line_t |
24 | #include <EXTERN.h> |
24 | #include <EXTERN.h> |
25 | #include <perl.h> |
25 | #include <perl.h> |
26 | #include <XSUB.h> |
26 | #include <XSUB.h> |
27 | #undef line_t |
27 | #undef line_t |
|
|
28 | #undef bool // perl defines it's own bool type, except with g++... what a trap |
28 | |
29 | |
29 | #include "../config.h" |
30 | #include "../config.h" |
30 | |
31 | |
31 | #include <cstddef> |
32 | #include <stddef.h> |
32 | #include <cstdarg> |
33 | #include <stdarg.h> |
33 | |
34 | |
34 | #include "unistd.h" |
35 | #include "unistd.h" |
35 | |
36 | |
36 | #include "ev_cpp.h" |
37 | #include "ev_cpp.h" |
37 | #include "rxvt.h" |
38 | #include "rxvt.h" |
… | |
… | |
45 | |
46 | |
46 | #undef LINENO |
47 | #undef LINENO |
47 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
48 | #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) |
48 | #undef ROW |
49 | #undef ROW |
49 | #define ROW(n) THIS->row_buf [LINENO (n)] |
50 | #define ROW(n) THIS->row_buf [LINENO (n)] |
|
|
51 | |
|
|
52 | ///////////////////////////////////////////////////////////////////////////// |
|
|
53 | |
|
|
54 | typedef char * octet_string; |
|
|
55 | typedef char * utf8_string; |
|
|
56 | |
|
|
57 | typedef GdkPixbuf * urxvt__pixbuf; |
|
|
58 | typedef rxvt_img * urxvt__img; |
50 | |
59 | |
51 | ///////////////////////////////////////////////////////////////////////////// |
60 | ///////////////////////////////////////////////////////////////////////////// |
52 | |
61 | |
53 | static wchar_t * |
62 | static wchar_t * |
54 | sv2wcs (SV *sv) |
63 | sv2wcs (SV *sv) |
… | |
… | |
799 | const_iv (XIMDontChange), |
808 | const_iv (XIMDontChange), |
800 | # endif |
809 | # endif |
801 | # endif |
810 | # endif |
802 | }; |
811 | }; |
803 | |
812 | |
804 | for (civ = const_iv + ecb_array_length (const_iv); civ-- > const_iv; ) |
813 | for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--) |
805 | newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); |
814 | newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); |
806 | } |
815 | } |
807 | |
816 | |
808 | void |
817 | void |
809 | warn (const char *msg) |
818 | warn (const char *msg) |
810 | CODE: |
819 | CODE: |
… | |
… | |
920 | CODE: |
929 | CODE: |
921 | { |
930 | { |
922 | rxvt_term *term = new rxvt_term; |
931 | rxvt_term *term = new rxvt_term; |
923 | |
932 | |
924 | stringvec *argv = new stringvec; |
933 | stringvec *argv = new stringvec; |
925 | stringvec *envv = new stringvec; |
|
|
926 | |
|
|
927 | for (int i = 0; i <= AvFILL (arg); i++) |
934 | for (int i = 0; i <= AvFILL (arg); i++) |
928 | argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); |
935 | argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); |
929 | |
936 | |
|
|
937 | stringvec *envv = new stringvec; |
930 | for (int i = AvFILL (env) + 1; i--; ) |
938 | for (int i = AvFILL (env) + 1; i--; ) |
931 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
939 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
932 | |
|
|
933 | envv->push_back (0); |
|
|
934 | |
940 | |
935 | try |
941 | try |
936 | { |
942 | { |
937 | term->init (argv, envv); |
943 | term->init (argv, envv); |
938 | } |
944 | } |
… | |
… | |
978 | |
984 | |
979 | void |
985 | void |
980 | rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) |
986 | rxvt_term::XUngrabKey (int keycode, U32 modifiers, Window window = THIS->vt) |
981 | CODE: |
987 | CODE: |
982 | XUngrabKey (THIS->dpy, keycode, modifiers, window); |
988 | XUngrabKey (THIS->dpy, keycode, modifiers, window); |
983 | |
|
|
984 | void |
|
|
985 | rxvt_term::XUngrabKeyboard (Time eventtime) |
|
|
986 | CODE: |
|
|
987 | XUngrabKeyboard (THIS->dpy, eventtime); |
|
|
988 | |
989 | |
989 | bool |
990 | bool |
990 | rxvt_term::grab (Time eventtime, int sync = 0) |
991 | rxvt_term::grab (Time eventtime, int sync = 0) |
991 | CODE: |
992 | CODE: |
992 | { |
993 | { |
… | |
… | |
1104 | rxvt_pop_locale (); |
1105 | rxvt_pop_locale (); |
1105 | |
1106 | |
1106 | RETVAL = wcs2sv (wstr); |
1107 | RETVAL = wcs2sv (wstr); |
1107 | free (wstr); |
1108 | free (wstr); |
1108 | } |
1109 | } |
1109 | OUTPUT: |
|
|
1110 | RETVAL |
|
|
1111 | |
|
|
1112 | char * |
|
|
1113 | rxvt_term::locale () |
|
|
1114 | CODE: |
|
|
1115 | RETVAL = THIS->locale; |
|
|
1116 | OUTPUT: |
1110 | OUTPUT: |
1117 | RETVAL |
1111 | RETVAL |
1118 | |
1112 | |
1119 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1113 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1120 | |
1114 | |
… | |
… | |
1266 | } |
1260 | } |
1267 | OUTPUT: |
1261 | OUTPUT: |
1268 | RETVAL |
1262 | RETVAL |
1269 | |
1263 | |
1270 | void |
1264 | void |
|
|
1265 | rxvt_term::set_urgency (bool enable) |
|
|
1266 | |
|
|
1267 | void |
1271 | rxvt_term::focus_in () |
1268 | rxvt_term::focus_in () |
1272 | |
1269 | |
1273 | void |
1270 | void |
1274 | rxvt_term::focus_out () |
1271 | rxvt_term::focus_out () |
1275 | |
1272 | |
… | |
… | |
1555 | |
1552 | |
1556 | if (set >= 0) |
1553 | if (set >= 0) |
1557 | { |
1554 | { |
1558 | THIS->set_option (optval, set); |
1555 | THIS->set_option (optval, set); |
1559 | |
1556 | |
1560 | if (THIS->env_colorfgbg [0]) // avoid doing this before START |
1557 | if (THIS->init_done) // avoid doing this before START |
1561 | switch (optval) |
1558 | switch (optval) |
1562 | { |
1559 | { |
1563 | case Opt_skipBuiltinGlyphs: |
1560 | case Opt_skipBuiltinGlyphs: |
1564 | THIS->set_fonts (); |
1561 | THIS->set_fonts (); |
1565 | THIS->scr_remap_chars (); |
1562 | THIS->scr_remap_chars (); |
1566 | THIS->scr_touch (true); |
1563 | THIS->scr_touch (true); |
1567 | THIS->want_refresh = 1; |
1564 | THIS->want_refresh = 1; |
1568 | THIS->refresh_check (); |
1565 | THIS->refresh_check (); |
1569 | break; |
1566 | break; |
|
|
1567 | #ifdef CURSOR_BLINK |
|
|
1568 | case Opt_cursorBlink: |
|
|
1569 | THIS->cursor_blink_reset (); |
|
|
1570 | break; |
|
|
1571 | #endif |
1570 | |
1572 | |
1571 | case Opt_cursorUnderline: |
1573 | case Opt_cursorUnderline: |
1572 | THIS->want_refresh = 1; |
1574 | THIS->want_refresh = 1; |
1573 | THIS->refresh_check (); |
1575 | THIS->refresh_check (); |
1574 | break; |
1576 | break; |
… | |
… | |
1588 | CODE: |
1590 | CODE: |
1589 | RETVAL = 0 < THIS->parse_keysym (keysym, str); |
1591 | RETVAL = 0 < THIS->parse_keysym (keysym, str); |
1590 | THIS->keyboard->register_done (); |
1592 | THIS->keyboard->register_done (); |
1591 | OUTPUT: |
1593 | OUTPUT: |
1592 | RETVAL |
1594 | RETVAL |
|
|
1595 | |
|
|
1596 | void |
|
|
1597 | rxvt_term::register_command (int keysym, unsigned int state, SV *str) |
|
|
1598 | CODE: |
|
|
1599 | wchar_t *wstr = sv2wcs (str); |
|
|
1600 | THIS->keyboard->register_user_translation (keysym, state, wstr); |
|
|
1601 | free (wstr); |
1593 | |
1602 | |
1594 | void |
1603 | void |
1595 | rxvt_term::screen_cur (...) |
1604 | rxvt_term::screen_cur (...) |
1596 | PROTOTYPE: $;$$ |
1605 | PROTOTYPE: $;$$ |
1597 | ALIAS: |
1606 | ALIAS: |
… | |
… | |
1919 | void |
1928 | void |
1920 | overlay::DESTROY () |
1929 | overlay::DESTROY () |
1921 | |
1930 | |
1922 | INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g | |
1931 | INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g | |
1923 | |
1932 | |
|
|
1933 | MODULE = urxvt PACKAGE = urxvt::pixbuf PREFIX = gdk_pixbuf_ |
|
|
1934 | |
|
|
1935 | urxvt::pixbuf gdk_pixbuf_new_from_file (octet_string filename, GError **error = 0) |
|
|
1936 | |
|
|
1937 | void |
|
|
1938 | DESTROY (urxvt::pixbuf self) |
|
|
1939 | CODE: |
|
|
1940 | gdk_pixbuf_unref (self); |
|
|
1941 | |