--- rxvt-unicode/src/rxvtperl.xs 2012/12/28 21:19:21 1.207 +++ rxvt-unicode/src/rxvtperl.xs 2014/09/03 18:47:16 1.227 @@ -3,11 +3,11 @@ *----------------------------------------------------------------------* * * All portions of code are copyright by their respective author/s. - * Copyright (c) 2005-2008,2011 Marc Lehmann + * Copyright (c) 2005-2014,2011 Marc Lehmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -495,6 +495,25 @@ } static void +_keysym_resource_push (rxvt_term *term, const char *k, const char *v) +{ + unsigned int state; + + if (term->parse_keysym (k, state) == -1) + return; + + dSP; + XPUSHs (sv_2mortal (newSVpv (v, 0))); + PUTBACK; +} + +static void +_keysym_resources (rxvt_term *term) +{ + term->enumerate_keysym_resources (_keysym_resource_push); +} + +static void ungrab (rxvt_term *THIS) { if (THIS->perl.grabtime) @@ -795,6 +814,10 @@ IV iv; } *civ, const_iv[] = { # define const_iv(name) { # name, (IV)name } + const_iv (HOOK_INIT), + const_iv (HOOK_DESTROY), + const_iv (HOOK_ACTION), + const_iv (NUM_RESOURCES), const_iv (DEFAULT_RSTYLE), const_iv (OVERLAY_RSTYLE), @@ -815,6 +838,18 @@ const_iv (RS_RVid), const_iv (RS_Uline), + // TODO: should support all colour constants, create colorinc.h &c + const_iv (Color_fg), + const_iv (Color_bg), +#if OFF_FOCUS_FADING + const_iv (Color_fade), +#endif + const_iv (Color_pointer_fg), + const_iv (Color_pointer_bg), + const_iv (Color_border), + const_iv (NRS_COLORS), + const_iv (TOTAL_COLORS), + const_iv (CurrentTime), const_iv (ShiftMask), const_iv (LockMask), @@ -1179,6 +1214,13 @@ CODE: XrmPutStringResource (&THIS->option_db, specifier, value); +void +rxvt_term::_keysym_resources () + PPCODE: + PUTBACK; + _keysym_resources (THIS); + SPAGAIN; + int rxvt_term::grab_button (int button, U32 modifiers, Window window = THIS->vt) CODE: @@ -1802,6 +1844,7 @@ #endif case Opt_cursorUnderline: + THIS->cursor_type = set ? 1 : 0; THIS->want_refresh = 1; THIS->refresh_check (); break; @@ -1817,21 +1860,16 @@ RETVAL bool -rxvt_term::parse_keysym (char *keysym, char *str) +rxvt_term::bind_action (char *keysym, char *str) + ALIAS: + parse_keysym = 1 CODE: - RETVAL = 0 < THIS->parse_keysym (keysym, str); + RETVAL = 0 < THIS->bind_action (keysym, str); THIS->keyboard->register_done (); OUTPUT: RETVAL void -rxvt_term::register_command (int keysym, unsigned int state, SV *str) - CODE: - wchar_t *wstr = sv2wcs (str); - THIS->keyboard->register_user_translation (keysym, state, wstr); - free (wstr); - -void rxvt_term::screen_cur (...) PROTOTYPE: $;$$ ALIAS: @@ -1881,7 +1919,7 @@ { THIS->selection.screen = THIS->current_screen; - THIS->want_refresh = 1; + THIS->selection_changed (); THIS->refresh_check (); } } @@ -1897,6 +1935,9 @@ RETVAL void +rxvt_term::selection_request (Time tm, int selnum) + +void rxvt_term::selection_clear (bool clipboard = false) void @@ -1962,6 +2003,14 @@ } void +rxvt_term::tt_write_user_input (SV *octets) + INIT: + STRLEN len; + char *str = SvPVbyte (octets, len); + C_ARGS: + str, len + +void rxvt_term::tt_write (SV *octets) INIT: STRLEN len; @@ -2205,13 +2254,12 @@ #endif -#if HAVE_BG_PIXMAP - void rxvt_term::set_background (rxvt_img *img, bool border = false) CODE: - THIS->bg_destroy (); - THIS->bg_flags &= ~(rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER | rxvt_term::BG_IS_TRANSPARENT); + delete THIS->bg_img; + THIS->bg_img = 0; + THIS->bg_flags = 0; if (img) // TODO: cannot be false { @@ -2239,8 +2287,6 @@ #endif -#endif - ############################################################################# # urxvt::overlay ############################################################################# @@ -2392,6 +2438,9 @@ C_ARGS: cc rxvt_img * +rxvt_img::shade (rxvt_img::nv factor) + +rxvt_img * rxvt_img::filter (octet_string name, SV *params = &PL_sv_undef) CODE: rxvt_img::nv *vparams = 0; @@ -2399,20 +2448,18 @@ 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); + vparams = (rxvt_img::nv *)malloc (nparams * sizeof (rxvt_img::nv)); for (int i = 0; i < nparams; ++i) vparams [i] = SvNV (*av_fetch ((AV *)SvRV (params), i, 1)); } RETVAL = THIS->filter (name, nparams, vparams); + free (vparams); OUTPUT: RETVAL