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.207 by sf-exg, Fri Dec 28 21:19:21 2012 UTC vs.
Revision 1.221 by sf-exg, Fri May 2 20:35:17 2014 UTC

793 static const struct { 793 static const struct {
794 const char *name; 794 const char *name;
795 IV iv; 795 IV iv;
796 } *civ, const_iv[] = { 796 } *civ, const_iv[] = {
797# define const_iv(name) { # name, (IV)name } 797# define const_iv(name) { # name, (IV)name }
798 const_iv (HOOK_INIT),
799 const_iv (HOOK_DESTROY),
800 const_iv (HOOK_KEYBOARD_DISPATCH),
801
798 const_iv (NUM_RESOURCES), 802 const_iv (NUM_RESOURCES),
799 const_iv (DEFAULT_RSTYLE), 803 const_iv (DEFAULT_RSTYLE),
800 const_iv (OVERLAY_RSTYLE), 804 const_iv (OVERLAY_RSTYLE),
801 const_iv (Color_Bits), 805 const_iv (Color_Bits),
802 const_iv (RS_bgShift), const_iv (RS_bgMask), 806 const_iv (RS_bgShift), const_iv (RS_bgMask),
812 const_iv (RS_Bold), 816 const_iv (RS_Bold),
813 const_iv (RS_Italic), 817 const_iv (RS_Italic),
814 const_iv (RS_Blink), 818 const_iv (RS_Blink),
815 const_iv (RS_RVid), 819 const_iv (RS_RVid),
816 const_iv (RS_Uline), 820 const_iv (RS_Uline),
821
822 // TODO: should support all colour constants, create colorinc.h &c
823 const_iv (Color_fg),
824 const_iv (Color_bg),
825#if OFF_FOCUS_FADING
826 const_iv (Color_fade),
827#endif
828 const_iv (Color_pointer_fg),
829 const_iv (Color_pointer_bg),
830 const_iv (Color_border),
831 const_iv (NRS_COLORS),
832 const_iv (TOTAL_COLORS),
817 833
818 const_iv (CurrentTime), 834 const_iv (CurrentTime),
819 const_iv (ShiftMask), 835 const_iv (ShiftMask),
820 const_iv (LockMask), 836 const_iv (LockMask),
821 const_iv (ControlMask), 837 const_iv (ControlMask),
1815} 1831}
1816 OUTPUT: 1832 OUTPUT:
1817 RETVAL 1833 RETVAL
1818 1834
1819bool 1835bool
1820rxvt_term::parse_keysym (char *keysym, char *str) 1836rxvt_term::bind_action (char *keysym, char *str)
1837 ALIAS:
1838 parse_keysym = 1
1821 CODE: 1839 CODE:
1822 RETVAL = 0 < THIS->parse_keysym (keysym, str); 1840 RETVAL = 0 < THIS->bind_action (keysym, str);
1823 THIS->keyboard->register_done (); 1841 THIS->keyboard->register_done ();
1824 OUTPUT: 1842 OUTPUT:
1825 RETVAL 1843 RETVAL
1826 1844
1827void 1845void
1828rxvt_term::register_command (int keysym, unsigned int state, SV *str) 1846rxvt_term::register_command (int keysym, unsigned int state, SV *str)
1829 CODE: 1847 CODE:
1830 wchar_t *wstr = sv2wcs (str); 1848 wchar_t *wstr = sv2wcs (str);
1831 THIS->keyboard->register_user_translation (keysym, state, wstr); 1849 THIS->keyboard->register_action (keysym, state, wstr);
1832 free (wstr); 1850 free (wstr);
1833 1851
1834void 1852void
1835rxvt_term::screen_cur (...) 1853rxvt_term::screen_cur (...)
1836 PROTOTYPE: $;$$ 1854 PROTOTYPE: $;$$
1879 1897
1880 if (ix) 1898 if (ix)
1881 { 1899 {
1882 THIS->selection.screen = THIS->current_screen; 1900 THIS->selection.screen = THIS->current_screen;
1883 1901
1884 THIS->want_refresh = 1; 1902 THIS->selection_changed ();
1885 THIS->refresh_check (); 1903 THIS->refresh_check ();
1886 } 1904 }
1887 } 1905 }
1888} 1906}
1889 1907
1895 THIS->selection.screen = screen; 1913 THIS->selection.screen = screen;
1896 OUTPUT: 1914 OUTPUT:
1897 RETVAL 1915 RETVAL
1898 1916
1899void 1917void
1918rxvt_term::selection_request (Time tm, int selnum)
1919
1920void
1900rxvt_term::selection_clear (bool clipboard = false) 1921rxvt_term::selection_clear (bool clipboard = false)
1901 1922
1902void 1923void
1903rxvt_term::selection_make (Time eventtime, bool rect = false) 1924rxvt_term::selection_make (Time eventtime, bool rect = false)
1904 CODE: 1925 CODE:
1958{ 1979{
1959 wchar_t *wstr = sv2wcs (string); 1980 wchar_t *wstr = sv2wcs (string);
1960 THIS->scr_add_lines (wstr, wcslen (wstr)); 1981 THIS->scr_add_lines (wstr, wcslen (wstr));
1961 free (wstr); 1982 free (wstr);
1962} 1983}
1984
1985void
1986rxvt_term::tt_write_user_input (SV *octets)
1987 INIT:
1988 STRLEN len;
1989 char *str = SvPVbyte (octets, len);
1990 C_ARGS:
1991 str, len
1963 1992
1964void 1993void
1965rxvt_term::tt_write (SV *octets) 1994rxvt_term::tt_write (SV *octets)
1966 INIT: 1995 INIT:
1967 STRLEN len; 1996 STRLEN len;
2203 OUTPUT: 2232 OUTPUT:
2204 RETVAL 2233 RETVAL
2205 2234
2206#endif 2235#endif
2207 2236
2208#if HAVE_BG_PIXMAP
2209
2210void 2237void
2211rxvt_term::set_background (rxvt_img *img, bool border = false) 2238rxvt_term::set_background (rxvt_img *img, bool border = false)
2212 CODE: 2239 CODE:
2213 THIS->bg_destroy (); 2240 delete THIS->bg_img;
2214 THIS->bg_flags &= ~(rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER | rxvt_term::BG_IS_TRANSPARENT); 2241 THIS->bg_img = 0;
2242 THIS->bg_flags = 0;
2215 2243
2216 if (img) // TODO: cannot be false 2244 if (img) // TODO: cannot be false
2217 { 2245 {
2218 img = img->clone (); // own the img 2246 img = img->clone (); // own the img
2219 2247
2234 THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; 2262 THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER;
2235 2263
2236 if (!border) 2264 if (!border)
2237 THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; 2265 THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT;
2238 } 2266 }
2239
2240#endif
2241 2267
2242#endif 2268#endif
2243 2269
2244############################################################################# 2270#############################################################################
2245# urxvt::overlay 2271# urxvt::overlay
2390 INIT: 2416 INIT:
2391 rgba cc = parse_rgba (c, THIS->s); 2417 rgba cc = parse_rgba (c, THIS->s);
2392 C_ARGS: cc 2418 C_ARGS: cc
2393 2419
2394rxvt_img * 2420rxvt_img *
2421rxvt_img::shade (rxvt_img::nv factor)
2422
2423rxvt_img *
2395rxvt_img::filter (octet_string name, SV *params = &PL_sv_undef) 2424rxvt_img::filter (octet_string name, SV *params = &PL_sv_undef)
2396 CODE: 2425 CODE:
2397 rxvt_img::nv *vparams = 0; 2426 rxvt_img::nv *vparams = 0;
2398 int nparams = 0; 2427 int nparams = 0;
2399 2428
2400 if (SvOK (params)) 2429 if (SvOK (params))
2401 { 2430 {
2402 // we overlay rxvt_temp_buf, what a hack
2403 assert (sizeof (rxvt_img::nv) >= sizeof (int));
2404
2405 if (!SvROK (params) || SvTYPE (SvRV (params)) != SVt_PVAV) 2431 if (!SvROK (params) || SvTYPE (SvRV (params)) != SVt_PVAV)
2406 croak ("rxvt_img::filter: params must be an array reference with parameter values"); 2432 croak ("rxvt_img::filter: params must be an array reference with parameter values");
2407 2433
2408 nparams = av_len ((AV *)SvRV (params)) + 1; 2434 nparams = av_len ((AV *)SvRV (params)) + 1;
2409 vparams = rxvt_temp_buf<rxvt_img::nv> (nparams); 2435 vparams = (rxvt_img::nv *)malloc (nparams * sizeof (rxvt_img::nv));
2410 2436
2411 for (int i = 0; i < nparams; ++i) 2437 for (int i = 0; i < nparams; ++i)
2412 vparams [i] = SvNV (*av_fetch ((AV *)SvRV (params), i, 1)); 2438 vparams [i] = SvNV (*av_fetch ((AV *)SvRV (params), i, 1));
2413 } 2439 }
2414 2440
2415 RETVAL = THIS->filter (name, nparams, vparams); 2441 RETVAL = THIS->filter (name, nparams, vparams);
2442 free (vparams);
2416 OUTPUT: 2443 OUTPUT:
2417 RETVAL 2444 RETVAL
2418 2445
2419#endif 2446#endif
2420 2447

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines