--- rxvt-unicode/src/rxvtperl.xs 2011/07/01 19:07:08 1.142 +++ rxvt-unicode/src/rxvtperl.xs 2012/06/03 15:54:05 1.156 @@ -25,11 +25,12 @@ #include #include #undef line_t +#undef bool // perl defines it's own bool type, except with g++... what a trap #include "../config.h" -#include -#include +#include +#include #include "unistd.h" @@ -50,6 +51,24 @@ ///////////////////////////////////////////////////////////////////////////// +typedef char * octet_string; +typedef char * utf8_string; +typedef SV * urxvt_color; + +typedef GdkPixbuf * urxvt__pixbuf; +typedef rxvt_img * urxvt__img; + +///////////////////////////////////////////////////////////////////////////// + +static void +parse_color (rxvt_screen *s, rxvt_color &c, SV *sv) +{ + //TODO: support component stuff + c.set (s, SvPVbyte_nolen (sv)); +} + +///////////////////////////////////////////////////////////////////////////// + static wchar_t * sv2wcs (SV *sv) { @@ -801,8 +820,8 @@ # endif }; - for (civ = const_iv + ecb_array_length (const_iv); civ-- > const_iv; ) - newCONSTSUB (stash, (char *)civ->name, newSViv (civ->iv)); + for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--) + newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); } void @@ -922,16 +941,13 @@ rxvt_term *term = new rxvt_term; stringvec *argv = new stringvec; - stringvec *envv = new stringvec; - for (int i = 0; i <= AvFILL (arg); i++) argv->push_back (strdup (SvPVbyte_nolen (*av_fetch (arg, i, 1)))); + stringvec *envv = new stringvec; for (int i = AvFILL (env) + 1; i--; ) envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); - envv->push_back (0); - try { term->init (argv, envv); @@ -981,11 +997,6 @@ CODE: XUngrabKey (THIS->dpy, keycode, modifiers, window); -void -rxvt_term::XUngrabKeyboard (Time eventtime) - CODE: - XUngrabKeyboard (THIS->dpy, eventtime); - bool rxvt_term::grab (Time eventtime, int sync = 0) CODE: @@ -1109,13 +1120,6 @@ OUTPUT: RETVAL -char * -rxvt_term::locale () - CODE: - RETVAL = THIS->locale; - OUTPUT: - RETVAL - #define TERM_OFFSET(sym) offsetof (TermWin_t, sym) #define TERM_OFFSET_width TERM_OFFSET(width) @@ -1268,6 +1272,9 @@ RETVAL void +rxvt_term::set_urgency (bool enable) + +void rxvt_term::focus_in () void @@ -1557,7 +1564,7 @@ { THIS->set_option (optval, set); - if (THIS->env_colorfgbg [0]) // avoid doing this before START + if (THIS->init_done) // avoid doing this before START switch (optval) { case Opt_skipBuiltinGlyphs: @@ -1567,6 +1574,11 @@ THIS->want_refresh = 1; THIS->refresh_check (); break; +#ifdef CURSOR_BLINK + case Opt_cursorBlink: + THIS->cursor_blink_reset (); + break; +#endif case Opt_cursorUnderline: THIS->want_refresh = 1; @@ -1592,6 +1604,13 @@ RETVAL void +rxvt_term::register_command (int keysym, unsigned int state, SV *str) + CODE: + wchar_t *wstr = sv2wcs (str); + THIS->keyboard->register_user_translation (keysym, state, wstr); + free (wstr); + +void rxvt_term::screen_cur (...) PROTOTYPE: $;$$ ALIAS: @@ -1921,3 +1940,58 @@ INCLUDE: $PERL s, rc, c); + self->fill (rc); + +void blur (urxvt::img self, int rh, int rv) + CODE: + self->blur (rh, rv); + +void brightness (urxvt::img self, double r, double g, double b, double a = 1.) + CODE: + self->brightness (r, g, b, a); + +void contrast (urxvt::img self, double r, double g, double b, double a = 1.) + CODE: + self->contrast (r, g, b, a); + +urxvt::img copy (urxvt::img self) + CODE: + RETVAL = self->copy (); + OUTPUT: + RETVAL + +urxvt::img scale (urxvt::img self, int new_width, int new_height) + CODE: + RETVAL = self->scale (new_width, new_height); + OUTPUT: + RETVAL + +# rxvt_img *transform (urxvt::img self, int new_width, int new_height, double matrix[16]); + +#endif +