… | |
… | |
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 | typedef SV * urxvt_color; |
|
|
57 | |
|
|
58 | typedef GdkPixbuf * urxvt__pixbuf; |
|
|
59 | typedef rxvt_img * urxvt__img; |
|
|
60 | |
|
|
61 | ///////////////////////////////////////////////////////////////////////////// |
|
|
62 | |
|
|
63 | static void |
|
|
64 | parse_color (rxvt_screen *s, rxvt_color &c, SV *sv) |
|
|
65 | { |
|
|
66 | //TODO: support component stuff |
|
|
67 | c.set (s, SvPVbyte_nolen (sv)); |
|
|
68 | } |
50 | |
69 | |
51 | ///////////////////////////////////////////////////////////////////////////// |
70 | ///////////////////////////////////////////////////////////////////////////// |
52 | |
71 | |
53 | static wchar_t * |
72 | static wchar_t * |
54 | sv2wcs (SV *sv) |
73 | sv2wcs (SV *sv) |
… | |
… | |
920 | CODE: |
939 | CODE: |
921 | { |
940 | { |
922 | rxvt_term *term = new rxvt_term; |
941 | rxvt_term *term = new rxvt_term; |
923 | |
942 | |
924 | stringvec *argv = new stringvec; |
943 | stringvec *argv = new stringvec; |
925 | stringvec *envv = new stringvec; |
|
|
926 | |
|
|
927 | for (int i = 0; i <= AvFILL (arg); i++) |
944 | for (int i = 0; i <= AvFILL (arg); i++) |
928 | argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); |
945 | argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); |
929 | |
946 | |
|
|
947 | stringvec *envv = new stringvec; |
930 | for (int i = AvFILL (env) + 1; i--; ) |
948 | for (int i = AvFILL (env) + 1; i--; ) |
931 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
949 | envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); |
932 | |
950 | |
933 | try |
951 | try |
934 | { |
952 | { |
… | |
… | |
1097 | rxvt_pop_locale (); |
1115 | rxvt_pop_locale (); |
1098 | |
1116 | |
1099 | RETVAL = wcs2sv (wstr); |
1117 | RETVAL = wcs2sv (wstr); |
1100 | free (wstr); |
1118 | free (wstr); |
1101 | } |
1119 | } |
1102 | OUTPUT: |
|
|
1103 | RETVAL |
|
|
1104 | |
|
|
1105 | char * |
|
|
1106 | rxvt_term::locale () |
|
|
1107 | CODE: |
|
|
1108 | RETVAL = THIS->locale; |
|
|
1109 | OUTPUT: |
1120 | OUTPUT: |
1110 | RETVAL |
1121 | RETVAL |
1111 | |
1122 | |
1112 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1123 | #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) |
1113 | |
1124 | |
… | |
… | |
1551 | |
1562 | |
1552 | if (set >= 0) |
1563 | if (set >= 0) |
1553 | { |
1564 | { |
1554 | THIS->set_option (optval, set); |
1565 | THIS->set_option (optval, set); |
1555 | |
1566 | |
1556 | if (THIS->env_colorfgbg [0]) // avoid doing this before START |
1567 | if (THIS->init_done) // avoid doing this before START |
1557 | switch (optval) |
1568 | switch (optval) |
1558 | { |
1569 | { |
1559 | case Opt_skipBuiltinGlyphs: |
1570 | case Opt_skipBuiltinGlyphs: |
1560 | THIS->set_fonts (); |
1571 | THIS->set_fonts (); |
1561 | THIS->scr_remap_chars (); |
1572 | THIS->scr_remap_chars (); |
1562 | THIS->scr_touch (true); |
1573 | THIS->scr_touch (true); |
1563 | THIS->want_refresh = 1; |
1574 | THIS->want_refresh = 1; |
1564 | THIS->refresh_check (); |
1575 | THIS->refresh_check (); |
1565 | break; |
1576 | break; |
|
|
1577 | #ifdef CURSOR_BLINK |
|
|
1578 | case Opt_cursorBlink: |
|
|
1579 | THIS->cursor_blink_reset (); |
|
|
1580 | break; |
|
|
1581 | #endif |
1566 | |
1582 | |
1567 | case Opt_cursorUnderline: |
1583 | case Opt_cursorUnderline: |
1568 | THIS->want_refresh = 1; |
1584 | THIS->want_refresh = 1; |
1569 | THIS->refresh_check (); |
1585 | THIS->refresh_check (); |
1570 | break; |
1586 | break; |
… | |
… | |
1922 | void |
1938 | void |
1923 | overlay::DESTROY () |
1939 | overlay::DESTROY () |
1924 | |
1940 | |
1925 | INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g | |
1941 | INCLUDE: $PERL <iom_perl.xs -pe s/IOM_MODULE/urxvt/g,s/IOM_CLASS/urxvt/g | |
1926 | |
1942 | |
|
|
1943 | MODULE = urxvt PACKAGE = urxvt::pixbuf PREFIX = gdk_pixbuf_ |
|
|
1944 | |
|
|
1945 | #if HAVE_PIXBUF |
|
|
1946 | |
|
|
1947 | urxvt::pixbuf gdk_pixbuf_new_from_file (SV *klass, octet_string filename) |
|
|
1948 | C_ARGS: filename, 0 |
|
|
1949 | |
|
|
1950 | void |
|
|
1951 | DESTROY (urxvt::pixbuf self) |
|
|
1952 | CODE: |
|
|
1953 | gdk_pixbuf_unref (self); |
|
|
1954 | |
|
|
1955 | #endif |
|
|
1956 | |
|
|
1957 | MODULE = urxvt PACKAGE = urxvt::img |
|
|
1958 | |
|
|
1959 | #if HAVE_IMG |
|
|
1960 | |
|
|
1961 | # rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height); |
|
|
1962 | # rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap); |
|
|
1963 | |
|
|
1964 | void fill (urxvt::img self, SV *c) |
|
|
1965 | CODE: |
|
|
1966 | rxvt_color rc; |
|
|
1967 | parse_color (self->s, rc, c); |
|
|
1968 | self->fill (rc); |
|
|
1969 | |
|
|
1970 | void blur (urxvt::img self, int rh, int rv) |
|
|
1971 | CODE: |
|
|
1972 | self->blur (rh, rv); |
|
|
1973 | |
|
|
1974 | void brightness (urxvt::img self, double r, double g, double b, double a = 1.) |
|
|
1975 | CODE: |
|
|
1976 | self->brightness (r, g, b, a); |
|
|
1977 | |
|
|
1978 | void contrast (urxvt::img self, double r, double g, double b, double a = 1.) |
|
|
1979 | CODE: |
|
|
1980 | self->contrast (r, g, b, a); |
|
|
1981 | |
|
|
1982 | urxvt::img copy (urxvt::img self) |
|
|
1983 | CODE: |
|
|
1984 | RETVAL = self->copy (); |
|
|
1985 | OUTPUT: |
|
|
1986 | RETVAL |
|
|
1987 | |
|
|
1988 | urxvt::img scale (urxvt::img self, int new_width, int new_height) |
|
|
1989 | CODE: |
|
|
1990 | RETVAL = self->scale (new_width, new_height); |
|
|
1991 | OUTPUT: |
|
|
1992 | RETVAL |
|
|
1993 | |
|
|
1994 | # rxvt_img *transform (urxvt::img self, int new_width, int new_height, double matrix[16]); |
|
|
1995 | |
|
|
1996 | #endif |
|
|
1997 | |