--- rxvt-unicode/src/rxvtperl.xs 2012/06/14 18:19:11 1.197 +++ rxvt-unicode/src/rxvtperl.xs 2012/07/02 03:57:53 1.205 @@ -69,8 +69,10 @@ { rgba c; - if (AV *av = (AV *)SvRV (sv)) + if (SvROK (sv)) { + AV *av = (AV *)SvRV (sv); + if (SvTYPE ((SV *)av) != SVt_PVAV) croak ("colour must be either a colour string, or an array,"); @@ -911,6 +913,62 @@ const_iv (RepeatNormal), const_iv (RepeatPad), const_iv (RepeatReflect), + // all versions + const_iv (PictOpClear), + const_iv (PictOpSrc), + const_iv (PictOpDst), + const_iv (PictOpOver), + const_iv (PictOpOverReverse), + const_iv (PictOpIn), + const_iv (PictOpInReverse), + const_iv (PictOpOut), + const_iv (PictOpOutReverse), + const_iv (PictOpAtop), + const_iv (PictOpAtopReverse), + const_iv (PictOpXor), + const_iv (PictOpAdd), + const_iv (PictOpSaturate), + // 0.2+ + const_iv (PictOpDisjointClear), + const_iv (PictOpDisjointSrc), + const_iv (PictOpDisjointDst), + const_iv (PictOpDisjointOver), + const_iv (PictOpDisjointOverReverse), + const_iv (PictOpDisjointIn), + const_iv (PictOpDisjointInReverse), + const_iv (PictOpDisjointOut), + const_iv (PictOpDisjointOutReverse), + const_iv (PictOpDisjointAtop), + const_iv (PictOpDisjointAtopReverse), + const_iv (PictOpDisjointXor), + const_iv (PictOpConjointClear), + const_iv (PictOpConjointSrc), + const_iv (PictOpConjointDst), + const_iv (PictOpConjointOver), + const_iv (PictOpConjointOverReverse), + const_iv (PictOpConjointIn), + const_iv (PictOpConjointInReverse), + const_iv (PictOpConjointOut), + const_iv (PictOpConjointOutReverse), + const_iv (PictOpConjointAtop), + const_iv (PictOpConjointAtopReverse), + const_iv (PictOpConjointXor), + // 0.11+ + const_iv (PictOpMultiply), + const_iv (PictOpScreen), + const_iv (PictOpOverlay), + const_iv (PictOpDarken), + const_iv (PictOpLighten), + const_iv (PictOpColorDodge), + const_iv (PictOpColorBurn), + const_iv (PictOpHardLight), + const_iv (PictOpSoftLight), + const_iv (PictOpDifference), + const_iv (PictOpExclusion), + const_iv (PictOpHSLHue), + const_iv (PictOpHSLSaturation), + const_iv (PictOpHSLColor), + const_iv (PictOpHSLLuminosity), #endif # if 0 const_iv (XIMForwardChar), @@ -1398,6 +1456,13 @@ OUTPUT: RETVAL +Window +rxvt_term::vt () + CODE: + RETVAL = THIS->vt; + OUTPUT: + RETVAL + void rxvt_term::vt_emask_add (U32 emask) CODE: @@ -2099,7 +2164,7 @@ #if HAVE_IMG rxvt_img * -rxvt_term::new_img (SV *format, int x = 0, int y = 0, int width = 1, int height = 1) +rxvt_term::new_img (SV *format = &PL_sv_undef, int x = 0, int y = 0, int width = 1, int height = 1) CODE: XRenderPictFormat *f = SvOK (format) ? XRenderFindStandardFormat (THIS->dpy, SvIV (format)) @@ -2204,7 +2269,7 @@ void DESTROY (urxvt::pixbuf self) CODE: - gdk_pixbuf_unref (self); + g_object_unref (self); #endif @@ -2226,29 +2291,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 @@ -2260,10 +2315,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 () @@ -2271,11 +2327,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) @@ -2290,6 +2349,9 @@ void rxvt_img::contrast (rxvt_img::nv r, rxvt_img::nv g, rxvt_img::nv b, rxvt_img::nv a = 1.) +void +rxvt_img::draw (rxvt_img *img, int op = PictOpOver, rxvt_img::nv mask = 1.); + rxvt_img * rxvt_img::clone () @@ -2303,6 +2365,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] = { @@ -2318,5 +2383,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