--- rxvt-unicode/src/rxvtperl.xs 2012/06/05 13:39:26 1.167 +++ rxvt-unicode/src/rxvtperl.xs 2012/06/06 20:55:37 1.175 @@ -393,6 +393,55 @@ } } +void +rxvt_perl_interp::usage (rxvt_term *term, int type) +{ + localise_env set_environ (perl_environ); + + ENTER; + SAVETMPS; + + dSP; + PUSHMARK (SP); + EXTEND (SP, 2); + PUSHs (sv_2mortal (newSVterm (term))); + PUSHs (sv_2mortal (newSViv (type))); + PUTBACK; + call_pv ("urxvt::usage", G_VOID | G_DISCARD); + + FREETMPS; + LEAVE; +} + +uint8_t +rxvt_perl_interp::parse_resource (rxvt_term *term, const char *name, bool arg, bool longopt, bool flag, const char *value) +{ + localise_env set_environ (perl_environ); + + ENTER; + SAVETMPS; + + dSP; + PUSHMARK (SP); + EXTEND (SP, 6); + PUSHs (sv_2mortal (newSVterm (term))); + PUSHs (sv_2mortal (newSVpv (name, 0))); + PUSHs (arg ? &PL_sv_yes : &PL_sv_no); + PUSHs (longopt ? &PL_sv_yes : &PL_sv_no); + PUSHs (flag ? &PL_sv_yes : &PL_sv_no); + PUSHs (value ? sv_2mortal (newSVpv (value, 0)) : &PL_sv_undef); + PUTBACK; + call_pv ("urxvt::parse_resource", G_SCALAR); + SPAGAIN; + + uint8_t ret = POPi; + + FREETMPS; + LEAVE; + + return ret; +} + static void ungrab (rxvt_term *THIS) { @@ -433,8 +482,7 @@ bool event_consumed; - if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always - || term->perl.should_invoke [htype]) + if (term->perl.should_invoke [htype]) { dSP; va_list ap; @@ -654,6 +702,7 @@ dSP; XPUSHs (sv_2mortal (newSVpvn (data, len))); + PUTBACK; call_sv ((SV *)sel->cb_sv, G_VOID | G_DISCARD | G_EVAL); if (SvTRUE (ERRSV)) @@ -837,6 +886,11 @@ } void +log (const char *msg) + CODE: + rxvt_log ("%s", msg); + +void warn (const char *msg) CODE: rxvt_warn ("%s", msg); @@ -1012,6 +1066,11 @@ } } +void +rxvt_term::put_option_db (octet_string specifier, octet_string value) + CODE: + XrmPutStringResource (&THIS->option_db, specifier, value); + int rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) CODE: @@ -1989,16 +2048,14 @@ rxvt_term::new_img (SV *format, int width, int height) CODE: XRenderPictFormat *f = SvOK (format) - ? XRenderFindVisualFormat (THIS->dpy, THIS->visual) - : XRenderFindStandardFormat (THIS->dpy, SvIV (format)); + ? XRenderFindStandardFormat (THIS->dpy, SvIV (format)) + : XRenderFindVisualFormat (THIS->dpy, THIS->visual); RETVAL = new rxvt_img (THIS, f, width, height); OUTPUT: RETVAL #if ENABLE_TRANSPARENCY -#if 0 - rxvt_img * rxvt_term::new_img_from_root () CODE: @@ -2008,8 +2065,6 @@ #endif -#endif - #if HAVE_PIXBUF rxvt_img * @@ -2039,10 +2094,18 @@ if (img) // TODO: cannot be false { + XRenderPictFormat *f = XRenderFindVisualFormat (THIS->dpy, THIS->visual); + rxvt_img *img2 = 0; + + if (f != img->format) + img = img2 = img->convert_to (f, THIS->pix_colors [Color_bg]); + img->unshare (); THIS->bg_pixmap = img->steal (); THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH; THIS->bg_valid_since = ev::now (); // TODO: extra bloat + + delete img2; } #endif @@ -2130,7 +2193,7 @@ CODE: delete THIS; -void +rxvt_img * rxvt_img::blur (int rh, int rv) void