--- rxvt-unicode/src/rxvtperl.xs 2014/10/13 17:05:32 1.229 +++ rxvt-unicode/src/rxvtperl.xs 2019/09/17 20:38:14 1.245 @@ -3,7 +3,7 @@ *----------------------------------------------------------------------* * * All portions of code are copyright by their respective author/s. - * Copyright (c) 2005-2014,2011 Marc Lehmann + * Copyright (c) 2005-2014 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 @@ -293,7 +293,7 @@ for (; i < AvFILL (overlay_av); i++) av_store (overlay_av, i, SvREFCNT_inc (*av_fetch (overlay_av, i + 1, 0))); - av_pop (overlay_av); + SvREFCNT_dec (av_pop (overlay_av)); SvREFCNT_dec (overlay_av); overlay_av = 0; @@ -393,7 +393,7 @@ perl_environ = rxvt_environ; localise_env set_environ (perl_environ); - char *args[] = { + const char *args[] = { "", "-e" "BEGIN {" @@ -401,10 +401,11 @@ " unshift @INC, '" LIBDIR "';" "}" "" - "use urxvt;" + "use urxvt;", + 0 }; - int argc = ecb_array_length (args); - char **argv = args; + int argc = ecb_array_length (args) - 1; + char **argv = (char **)args; PERL_SYS_INIT3 (&argc, &argv, &environ); perl = perl_alloc (); @@ -1022,6 +1023,36 @@ const_iv (XIMDontChange), # endif # endif + + /* DEC private modes */ + const_iv (PrivMode_132), + const_iv (PrivMode_132OK), + const_iv (PrivMode_rVideo), + const_iv (PrivMode_relOrigin), + const_iv (PrivMode_Screen), + const_iv (PrivMode_Autowrap), + const_iv (PrivMode_aplCUR), + const_iv (PrivMode_aplKP), + const_iv (PrivMode_HaveBackSpace), + const_iv (PrivMode_BackSpace), + const_iv (PrivMode_ShiftKeys), + const_iv (PrivMode_VisibleCursor), + const_iv (PrivMode_MouseX10), + const_iv (PrivMode_MouseX11), + const_iv (PrivMode_scrollBar), + const_iv (PrivMode_TtyOutputInh), + const_iv (PrivMode_Keypress), + const_iv (PrivMode_smoothScroll), + const_iv (PrivMode_vt52), + const_iv (PrivMode_LFNL), + const_iv (PrivMode_MouseBtnEvent), + const_iv (PrivMode_MouseAnyEvent), + const_iv (PrivMode_BracketPaste), + const_iv (PrivMode_ExtModeMouse), + const_iv (PrivMode_ExtMouseRight), + const_iv (PrivMode_BlinkingCursor), + const_iv (PrivMode_mouse_report), + const_iv (PrivMode_Default), }; for (civ = const_iv + ecb_array_length (const_iv); civ > const_iv; civ--) @@ -1029,17 +1060,17 @@ } void -log (const char *msg) +log (utf8_string msg) CODE: rxvt_log ("%s", msg); void -warn (const char *msg) +warn (utf8_string msg) CODE: rxvt_warn ("%s", msg); void -fatal (const char *msg) +fatal (utf8_string msg) CODE: rxvt_fatal ("%s", msg); @@ -1289,7 +1320,7 @@ ungrab (THIS); int -rxvt_term::XStringToKeysym (char *string) +rxvt_term::XStringToKeysym (octet_string string) CODE: RETVAL = XStringToKeysym (string); OUTPUT: RETVAL @@ -1389,7 +1420,7 @@ #define TERM_OFFSET_top_row TERM_OFFSET(top_row) int -rxvt_term::width () +rxvt_term::width (int new_value = NO_INIT) ALIAS: width = TERM_OFFSET_width height = TERM_OFFSET_height @@ -1409,6 +1440,8 @@ top_row = TERM_OFFSET_top_row CODE: RETVAL = *(int *)((char *)THIS + ix); + if (items > 1) + *(int *)((char *)THIS + ix) = new_value; OUTPUT: RETVAL @@ -1420,6 +1453,7 @@ ModNumLockMask = 2 current_screen = 3 hidden_cursor = 4 + priv_modes = 5 CODE: switch (ix) { @@ -1429,7 +1463,10 @@ case 3: RETVAL = THIS->current_screen; break; #ifdef CURSOR_BLINK case 4: RETVAL = THIS->hidden_cursor; break; +#else + case 4: RETVAL = 0; break; #endif + case 5: RETVAL = THIS->priv_modes; break; } OUTPUT: RETVAL @@ -1576,6 +1613,9 @@ THIS->refresh_check (); void +rxvt_term::refresh_check () + +void rxvt_term::ROW_t (int row_number, SV *new_text = 0, int start_col = 0, int start_ofs = 0, int max_len = MAX_COLS) PPCODE: { @@ -1728,6 +1768,7 @@ rxvt_pop_locale (); + free (wstr); RETVAL = wcs2sv (rstr, r - rstr); } OUTPUT: @@ -1761,13 +1802,14 @@ else *r++ = *s; + free (wstr); RETVAL = wcs2sv (rstr, r - rstr); } OUTPUT: RETVAL void -rxvt_term::_resource (char *name, int index, SV *newval = 0) +rxvt_term::_resource (octet_string name, int index, SV *newval = 0) PPCODE: { static const struct resval { const char *name; int value; } *rs, rslist [] = { @@ -1792,7 +1834,7 @@ else { --rs; - name = ""; + name = (octet_string)""; } if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES)) @@ -1815,7 +1857,7 @@ } const char * -rxvt_term::x_resource (const char *name) +rxvt_term::x_resource (octet_string name) bool rxvt_term::option (U8 optval, int set = -1) @@ -1859,12 +1901,22 @@ OUTPUT: RETVAL +SV * +rxvt_term::lookup_keysym (int keysym, unsigned int state) + CODE: +{ + keysym_t *key = THIS->keyboard->lookup_keysym (THIS, keysym, state); + RETVAL = key ? sv_2mortal (newSVpv (key->str, 0)) : &PL_sv_undef; +} + OUTPUT: + RETVAL + bool -rxvt_term::bind_action (char *keysym, char *str) +rxvt_term::bind_action (octet_string keysym, octet_string action) ALIAS: parse_keysym = 1 CODE: - RETVAL = 0 < THIS->bind_action (keysym, str); + RETVAL = 0 < THIS->bind_action (keysym, action); THIS->keyboard->register_done (); OUTPUT: RETVAL @@ -1995,7 +2047,7 @@ rxvt_term::scr_bell () void -rxvt_term::scr_recolour (bool refresh = true); +rxvt_term::scr_recolor (bool refresh = true); void rxvt_term::scr_change_screen (int screen) @@ -2262,13 +2314,20 @@ #endif void +rxvt_term::clr_background () + CODE: + delete THIS->bg_img; + THIS->bg_img = 0; + THIS->bg_flags = rxvt_term::BG_NEEDS_REFRESH; + +void rxvt_term::set_background (rxvt_img *img, bool border = false) CODE: delete THIS->bg_img; THIS->bg_img = 0; - THIS->bg_flags = 0; + THIS->bg_flags = rxvt_term::BG_NEEDS_REFRESH; - if (img) // TODO: cannot be false + //if (img) // TODO: cannot be false, maybe allow and get rid of clr_background? { img = img->clone (); // own the img @@ -2286,7 +2345,6 @@ ->replace (img); THIS->bg_img = img; - THIS->bg_flags |= rxvt_term::BG_NEEDS_REFRESH | rxvt_term::BG_INHIBIT_RENDER; if (!border) THIS->bg_flags |= rxvt_term::BG_IS_TRANSPARENT; @@ -2373,7 +2431,9 @@ 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); + rxvt_screen screen; + screen.set (THIS->d); + rgba cc = parse_rgba (c, &screen); C_ARGS: cc, x, y, w, h void @@ -2441,7 +2501,9 @@ rxvt_img * rxvt_img::tint (SV *c) INIT: - rgba cc = parse_rgba (c, THIS->s); + rxvt_screen screen; + screen.set (THIS->d); + rgba cc = parse_rgba (c, &screen); C_ARGS: cc rxvt_img *