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.175 by root, Wed Jun 6 20:55:37 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,
1987 2046
1988rxvt_img * 2047rxvt_img *
1989rxvt_term::new_img (SV *format, int width, int height) 2048rxvt_term::new_img (SV *format, int width, int height)
1990 CODE: 2049 CODE:
1991 XRenderPictFormat *f = SvOK (format) 2050 XRenderPictFormat *f = SvOK (format)
1992 ? XRenderFindVisualFormat (THIS->dpy, THIS->visual)
1993 : XRenderFindStandardFormat (THIS->dpy, SvIV (format)); 2051 ? XRenderFindStandardFormat (THIS->dpy, SvIV (format))
2052 : XRenderFindVisualFormat (THIS->dpy, THIS->visual);
1994 RETVAL = new rxvt_img (THIS, f, width, height); 2053 RETVAL = new rxvt_img (THIS, f, width, height);
1995 OUTPUT: 2054 OUTPUT:
1996 RETVAL 2055 RETVAL
1997 2056
1998#if ENABLE_TRANSPARENCY 2057#if ENABLE_TRANSPARENCY
1999
2000#if 0
2001 2058
2002rxvt_img * 2059rxvt_img *
2003rxvt_term::new_img_from_root () 2060rxvt_term::new_img_from_root ()
2004 CODE: 2061 CODE:
2005 RETVAL = rxvt_img::new_from_root (THIS); 2062 RETVAL = rxvt_img::new_from_root (THIS);
2006 OUTPUT: 2063 OUTPUT:
2007 RETVAL 2064 RETVAL
2008
2009#endif
2010 2065
2011#endif 2066#endif
2012 2067
2013#if HAVE_PIXBUF 2068#if HAVE_PIXBUF
2014 2069
2037 THIS->bg_pixmap = None; 2092 THIS->bg_pixmap = None;
2038 THIS->bg_flags &= ~rxvt_term::BG_NEEDS_REFRESH; 2093 THIS->bg_flags &= ~rxvt_term::BG_NEEDS_REFRESH;
2039 2094
2040 if (img) // TODO: cannot be false 2095 if (img) // TODO: cannot be false
2041 { 2096 {
2097 XRenderPictFormat *f = XRenderFindVisualFormat (THIS->dpy, THIS->visual);
2098 rxvt_img *img2 = 0;
2099
2100 if (f != img->format)
2101 img = img2 = img->convert_to (f, THIS->pix_colors [Color_bg]);
2102
2042 img->unshare (); 2103 img->unshare ();
2043 THIS->bg_pixmap = img->steal (); 2104 THIS->bg_pixmap = img->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
2107
2108 delete img2;
2046 } 2109 }
2047 2110
2048#endif 2111#endif
2049 2112
2050#endif 2113#endif
2128void 2191void
2129rxvt_img::DESTROY () 2192rxvt_img::DESTROY ()
2130 CODE: 2193 CODE:
2131 delete THIS; 2194 delete THIS;
2132 2195
2133void 2196rxvt_img *
2134rxvt_img::blur (int rh, int rv) 2197rxvt_img::blur (int rh, int rv)
2135 2198
2136void 2199void
2137rxvt_img::brightness (NV r, NV g, NV b, NV a = 1.) 2200rxvt_img::brightness (NV r, NV g, NV b, NV a = 1.)
2138 2201

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines