ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtperl.xs
(Generate patch)

Comparing rxvt-unicode/src/rxvtperl.xs (file contents):
Revision 1.167 by root, Tue Jun 5 13:39:26 2012 UTC vs.
Revision 1.178 by root, Thu Jun 7 08:12:55 2012 UTC

391 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0); 391 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0);
392 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, newRV_noinc ((SV *)newAV ()), 0); 392 hv_store ((HV *)SvRV ((SV *)term->perl.self), "_selection", 10, newRV_noinc ((SV *)newAV ()), 0);
393 } 393 }
394} 394}
395 395
396void
397rxvt_perl_interp::usage (rxvt_term *term, int type)
398{
399 localise_env set_environ (perl_environ);
400
401 ENTER;
402 SAVETMPS;
403
404 dSP;
405 PUSHMARK (SP);
406 EXTEND (SP, 2);
407 PUSHs (sv_2mortal (newSVterm (term)));
408 PUSHs (sv_2mortal (newSViv (type)));
409 PUTBACK;
410 call_pv ("urxvt::usage", G_VOID | G_DISCARD);
411
412 FREETMPS;
413 LEAVE;
414}
415
416uint8_t
417rxvt_perl_interp::parse_resource (rxvt_term *term, const char *name, bool arg, bool longopt, bool flag, const char *value)
418{
419 localise_env set_environ (perl_environ);
420
421 ENTER;
422 SAVETMPS;
423
424 dSP;
425 PUSHMARK (SP);
426 EXTEND (SP, 6);
427 PUSHs (sv_2mortal (newSVterm (term)));
428 PUSHs (sv_2mortal (newSVpv (name, 0)));
429 PUSHs (arg ? &PL_sv_yes : &PL_sv_no);
430 PUSHs (longopt ? &PL_sv_yes : &PL_sv_no);
431 PUSHs (flag ? &PL_sv_yes : &PL_sv_no);
432 PUSHs (value ? sv_2mortal (newSVpv (value, 0)) : &PL_sv_undef);
433 PUTBACK;
434 call_pv ("urxvt::parse_resource", G_SCALAR);
435 SPAGAIN;
436
437 uint8_t ret = POPi;
438
439 FREETMPS;
440 LEAVE;
441
442 return ret;
443}
444
396static void 445static void
397ungrab (rxvt_term *THIS) 446ungrab (rxvt_term *THIS)
398{ 447{
399 if (THIS->perl.grabtime) 448 if (THIS->perl.grabtime)
400 { 449 {
431 } 480 }
432 } 481 }
433 482
434 bool event_consumed; 483 bool event_consumed;
435 484
436 if (htype == HOOK_INIT || htype == HOOK_DESTROY // must be called always
437 || term->perl.should_invoke [htype]) 485 if (term->perl.should_invoke [htype])
438 { 486 {
439 dSP; 487 dSP;
440 va_list ap; 488 va_list ap;
441 489
442 va_start (ap, htype); 490 va_start (ap, htype);
652 ENTER; 700 ENTER;
653 SAVETMPS; 701 SAVETMPS;
654 702
655 dSP; 703 dSP;
656 XPUSHs (sv_2mortal (newSVpvn (data, len))); 704 XPUSHs (sv_2mortal (newSVpvn (data, len)));
705 PUTBACK;
657 call_sv ((SV *)sel->cb_sv, G_VOID | G_DISCARD | G_EVAL); 706 call_sv ((SV *)sel->cb_sv, G_VOID | G_DISCARD | G_EVAL);
658 707
659 if (SvTRUE (ERRSV)) 708 if (SvTRUE (ERRSV))
660 rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV)); 709 rxvt_warn ("perl selection callback evaluation error: %s", SvPVbyte_nolen (ERRSV));
661 710
835 for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--) 884 for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--)
836 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv)); 885 newCONSTSUB (stash, (char *)civ[-1].name, newSViv (civ[-1].iv));
837} 886}
838 887
839void 888void
889log (const char *msg)
890 CODE:
891 rxvt_log ("%s", msg);
892
893void
840warn (const char *msg) 894warn (const char *msg)
841 CODE: 895 CODE:
842 rxvt_warn ("%s", msg); 896 rxvt_warn ("%s", msg);
843 897
844void 898void
1009 case HOOK_POSITION_CHANGE: 1063 case HOOK_POSITION_CHANGE:
1010 if (count) 1064 if (count)
1011 THIS->get_window_origin (THIS->parent_x, THIS->parent_y); 1065 THIS->get_window_origin (THIS->parent_x, THIS->parent_y);
1012 } 1066 }
1013 } 1067 }
1068
1069void
1070rxvt_term::put_option_db (octet_string specifier, octet_string value)
1071 CODE:
1072 XrmPutStringResource (&THIS->option_db, specifier, value);
1014 1073
1015int 1074int
1016rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) 1075rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt)
1017 CODE: 1076 CODE:
1018 RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1, 1077 RETVAL = XGrabButton (THIS->dpy, button, modifiers, window, 1,
1983 PUSHs (sv_2mortal (newSViv (THIS->szHint.width))); 2042 PUSHs (sv_2mortal (newSViv (THIS->szHint.width)));
1984 PUSHs (sv_2mortal (newSViv (THIS->szHint.height))); 2043 PUSHs (sv_2mortal (newSViv (THIS->szHint.height)));
1985 2044
1986#if HAVE_IMG 2045#if HAVE_IMG
1987 2046
2047#if 0
2048
1988rxvt_img * 2049rxvt_img *
1989rxvt_term::new_img (SV *format, int width, int height) 2050rxvt_term::new_img (SV *format, int width, int height)
1990 CODE: 2051 CODE:
1991 XRenderPictFormat *f = SvOK (format) 2052 XRenderPictFormat *f = SvOK (format)
1992 ? XRenderFindVisualFormat (THIS->dpy, THIS->visual)
1993 : XRenderFindStandardFormat (THIS->dpy, SvIV (format)); 2053 ? XRenderFindStandardFormat (THIS->dpy, SvIV (format))
2054 : XRenderFindVisualFormat (THIS->dpy, THIS->visual);
1994 RETVAL = new rxvt_img (THIS, f, width, height); 2055 RETVAL = new rxvt_img (THIS, f, width, height);
1995 OUTPUT: 2056 OUTPUT:
1996 RETVAL 2057 RETVAL
1997 2058
2059#endif
2060
1998#if ENABLE_TRANSPARENCY 2061#if ENABLE_TRANSPARENCY
1999
2000#if 0
2001 2062
2002rxvt_img * 2063rxvt_img *
2003rxvt_term::new_img_from_root () 2064rxvt_term::new_img_from_root ()
2004 CODE: 2065 CODE:
2005 RETVAL = rxvt_img::new_from_root (THIS); 2066 RETVAL = rxvt_img::new_from_root (THIS);
2006 OUTPUT: 2067 OUTPUT:
2007 RETVAL 2068 RETVAL
2008
2009#endif
2010 2069
2011#endif 2070#endif
2012 2071
2013#if HAVE_PIXBUF 2072#if HAVE_PIXBUF
2014 2073
2037 THIS->bg_pixmap = None; 2096 THIS->bg_pixmap = None;
2038 THIS->bg_flags &= ~rxvt_term::BG_NEEDS_REFRESH; 2097 THIS->bg_flags &= ~rxvt_term::BG_NEEDS_REFRESH;
2039 2098
2040 if (img) // TODO: cannot be false 2099 if (img) // TODO: cannot be false
2041 { 2100 {
2042 img->unshare (); 2101 img = img->reify ();
2102 rxvt_img *img2 = img->convert_to (XRenderFindVisualFormat (THIS->dpy, THIS->visual), THIS->pix_colors [Color_bg]);
2103 delete img;
2043 THIS->bg_pixmap = img->steal (); 2104 THIS->bg_pixmap = img2->steal ();
2044 THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH; 2105 THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH;
2045 THIS->bg_valid_since = ev::now (); // TODO: extra bloat 2106 THIS->bg_valid_since = ev::now (); // TODO: extra bloat
2046 } 2107 }
2047 2108
2048#endif 2109#endif
2099 2160
2100int 2161int
2101rxvt_img::h () 2162rxvt_img::h ()
2102 CODE: 2163 CODE:
2103 RETVAL = THIS->h; 2164 RETVAL = THIS->h;
2104 OUTPUT:
2105 RETVAL
2106
2107bool
2108rxvt_img::shared ()
2109 CODE:
2110 RETVAL = THIS->shared;
2111 OUTPUT: 2165 OUTPUT:
2112 RETVAL 2166 RETVAL
2113 2167
2114Pixmap 2168Pixmap
2115rxvt_img::pm () 2169rxvt_img::pm ()
2129rxvt_img::DESTROY () 2183rxvt_img::DESTROY ()
2130 CODE: 2184 CODE:
2131 delete THIS; 2185 delete THIS;
2132 2186
2133void 2187void
2134rxvt_img::blur (int rh, int rv) 2188rxvt_img::unshare ()
2189
2190void
2191rxvt_img::repeat_mode (render_repeat_mode repeat = RepeatNormal)
2192
2193void
2194rxvt_img::move (int dx, int dy)
2135 2195
2136void 2196void
2137rxvt_img::brightness (NV r, NV g, NV b, NV a = 1.) 2197rxvt_img::brightness (NV r, NV g, NV b, NV a = 1.)
2138 2198
2139void 2199void
2140rxvt_img::contrast (NV r, NV g, NV b, NV a = 1.) 2200rxvt_img::contrast (NV r, NV g, NV b, NV a = 1.)
2141
2142void
2143rxvt_img::unshare ()
2144 2201
2145rxvt_img * 2202rxvt_img *
2146rxvt_img::clone () 2203rxvt_img::clone ()
2147 2204
2148rxvt_img * 2205rxvt_img *
2149rxvt_img::sub_rect (int x, int y, int width, int height, render_repeat_mode repeat = RepeatNormal) 2206rxvt_img::reify ()
2150 2207
2151rxvt_img * 2208rxvt_img *
2209rxvt_img::sub_rect (int x, int y, int width, int height)
2210
2211rxvt_img *
2212rxvt_img::blur (int rh, int rv)
2213
2214rxvt_img *
2152rxvt_img::transform (int new_width, int new_height, NV p11, NV p12, NV p13, NV p21, NV p22, NV p23, NV p31, NV p32, NV p33, render_repeat_mode repeat = RepeatNormal) 2215rxvt_img::transform (int new_width, int new_height, NV p11, NV p12, NV p13, NV p21, NV p22, NV p23, NV p31, NV p32, NV p33)
2153 INIT: 2216 INIT:
2154 double matrix[9] = { 2217 double matrix[9] = {
2155 p11, p12, p13, 2218 p11, p12, p13,
2156 p21, p22, p23, 2219 p21, p22, p23,
2157 p31, p32, p33 2220 p31, p32, p33
2158 }; 2221 };
2159 C_ARGS: new_width, new_height, matrix, repeat 2222 C_ARGS: new_width, new_height, matrix
2160 2223
2161rxvt_img * 2224rxvt_img *
2162rxvt_img::scale (int new_width, int new_height) 2225rxvt_img::scale (int new_width, int new_height)
2163 2226
2164rxvt_img * 2227rxvt_img *
2165rxvt_img::rotate (int new_width, int new_height, int x, int y, NV phi, render_repeat_mode repeat = RepeatNormal) 2228rxvt_img::rotate (int new_width, int new_height, int x, int y, NV phi)
2166 2229
2167#endif 2230#endif
2168 2231

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines