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