--- rxvt-unicode/src/rxvtperl.xs 2012/06/14 19:31:17 1.199 +++ rxvt-unicode/src/rxvtperl.xs 2012/12/28 21:19:21 1.207 @@ -59,6 +59,7 @@ #if HAVE_PIXBUF typedef GdkPixbuf * urxvt__pixbuf; #endif +#if HAVE_IMG typedef rxvt_img * urxvt__img; typedef rxvt_img::nv rxvt_img__nv; @@ -107,6 +108,7 @@ } ///////////////////////////////////////////////////////////////////////////// +#endif static wchar_t * sv2wcs (SV *sv) @@ -1456,6 +1458,13 @@ OUTPUT: RETVAL +Window +rxvt_term::vt () + CODE: + RETVAL = THIS->vt; + OUTPUT: + RETVAL + void rxvt_term::vt_emask_add (U32 emask) CODE: @@ -2209,10 +2218,10 @@ img = img->clone (); // own the img if (img->repeat != RepeatNormal) // X11 only supports RepeatNormal as bg pixmap - img->sub_rect (0, 0, - border ? THIS->vt_width : THIS->szHint.width, - border ? THIS->vt_height : THIS->szHint.height) - ->replace (img); + img->sub_rect (0, 0, + border ? THIS->vt_width : THIS->szHint.width, + border ? THIS->vt_height : THIS->szHint.height) + ->replace (img); // just in case, should usually be a nop img->reify () @@ -2262,7 +2271,7 @@ void DESTROY (urxvt::pixbuf self) CODE: - gdk_pixbuf_unref (self); + g_object_unref (self); #endif @@ -2284,29 +2293,19 @@ int rxvt_img::x () + ALIAS: + x = 0 + y = 1 + w = 2 + h = 3 CODE: - RETVAL = THIS->x; - OUTPUT: - RETVAL - -int -rxvt_img::y () - CODE: - RETVAL = THIS->y; - OUTPUT: - RETVAL - -int -rxvt_img::w () - CODE: - RETVAL = THIS->w; - OUTPUT: - RETVAL - -int -rxvt_img::h () - CODE: - RETVAL = THIS->h; + switch (ix) + { + case 0: RETVAL = THIS->x; break; + case 1: RETVAL = THIS->y; break; + case 2: RETVAL = THIS->w; break; + case 3: RETVAL = THIS->h; break; + } OUTPUT: RETVAL @@ -2318,10 +2317,11 @@ RETVAL void -rxvt_img::fill (SV *c) +rxvt_img::fill (SV *c, int x = 0, int y = 0, int w = THIS->w, int h = THIS->h) + PROTOTYPE: $;$$$$ INIT: rgba cc = parse_rgba (c, THIS->s); - C_ARGS: cc + C_ARGS: cc, x, y, w, h void rxvt_img::DESTROY () @@ -2329,11 +2329,14 @@ delete THIS; void +rxvt_img::add_alpha () + +void rxvt_img::unshare () -int +void rxvt_img::repeat_mode (render_repeat_mode repeat = 0) - CODE: + PPCODE: if (items >= 2) THIS->repeat_mode (repeat); if (GIMME_V != G_VOID) @@ -2364,6 +2367,9 @@ rxvt_img::blur (int rh, int rv) rxvt_img * +rxvt_img::muladd (rxvt_img::nv mul, rxvt_img::nv add) + +rxvt_img * rxvt_img::transform (rxvt_img::nv p11, rxvt_img::nv p12, rxvt_img::nv p13, rxvt_img::nv p21, rxvt_img::nv p22, rxvt_img::nv p23, rxvt_img::nv p31, rxvt_img::nv p32, rxvt_img::nv p33) INIT: rxvt_img::nv matrix[3][3] = { @@ -2379,5 +2385,36 @@ rxvt_img * rxvt_img::rotate (int x, int y, rxvt_img::nv phi) +rxvt_img * +rxvt_img::tint (SV *c) + INIT: + rgba cc = parse_rgba (c, THIS->s); + C_ARGS: cc + +rxvt_img * +rxvt_img::filter (octet_string name, SV *params = &PL_sv_undef) + CODE: + rxvt_img::nv *vparams = 0; + int nparams = 0; + + if (SvOK (params)) + { + // we overlay rxvt_temp_buf, what a hack + assert (sizeof (rxvt_img::nv) >= sizeof (int)); + + if (!SvROK (params) || SvTYPE (SvRV (params)) != SVt_PVAV) + croak ("rxvt_img::filter: params must be an array reference with parameter values"); + + nparams = av_len ((AV *)SvRV (params)) + 1; + vparams = rxvt_temp_buf (nparams); + + for (int i = 0; i < nparams; ++i) + vparams [i] = SvNV (*av_fetch ((AV *)SvRV (params), i, 1)); + } + + RETVAL = THIS->filter (name, nparams, vparams); + OUTPUT: + RETVAL + #endif