--- rxvt-unicode/src/rxvtperl.xs 2007/10/31 09:55:24 1.115 +++ rxvt-unicode/src/rxvtperl.xs 2008/08/22 15:36:45 1.125 @@ -3,7 +3,7 @@ *----------------------------------------------------------------------* * * All portions of code are copyright by their respective author/s. - * Copyright (c) 2005-2006 Marc Lehmann + * Copyright (c) 2005-2008 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 @@ -33,7 +33,7 @@ #include "unistd.h" -#include "iom.h" +#include "ev_cpp.h" #include "rxvt.h" #include "keyboard.h" #include "rxvtutil.h" @@ -41,11 +41,7 @@ #include "perlxsi.c" -#ifdef HAVE_SCROLLBARS -# define GRAB_CURSOR THIS->leftptr_cursor -#else -# define GRAB_CURSOR None -#endif +#define GRAB_CURSOR THIS->scrollBar.leftptr_cursor #undef LINENO #define LINENO(n) MOD (THIS->term_start + int(n), THIS->total_rows) @@ -216,6 +212,7 @@ av_push (overlay_av, newSViv ((long)this)); THIS->want_refresh = 1; + THIS->refresh_check (); } void @@ -239,6 +236,7 @@ overlay_av = 0; THIS->want_refresh = 1; + THIS->refresh_check (); } void overlay::swap () @@ -293,13 +291,14 @@ } THIS->want_refresh = 1; + THIS->refresh_check (); } ///////////////////////////////////////////////////////////////////////////// #define IOM_CLASS "urxvt" #define IOM_WARN rxvt_warn -#include +#include "iom_perl.h" ///////////////////////////////////////////////////////////////////////////// @@ -313,6 +312,7 @@ { perl_destruct (perl); perl_free (perl); + PERL_SYS_TERM (); } } @@ -326,7 +326,7 @@ perl_environ = rxvt_environ; swap (perl_environ, environ); - char *argv[] = { + char *args[] = { "", "-e" "BEGIN {" @@ -336,11 +336,14 @@ "" "use urxvt;" }; + int argc = sizeof (args) / sizeof (args[0]); + char **argv = args; + PERL_SYS_INIT3 (&argc, &argv, &environ); perl = perl_alloc (); perl_construct (perl); - if (perl_parse (perl, xs_init, 2, argv, (char **)NULL) + if (perl_parse (perl, xs_init, argc, argv, (char **)NULL) || perl_run (perl)) { rxvt_warn ("unable to initialize perl-interpreter, continuing without.\n"); @@ -642,6 +645,7 @@ IV iv; } *civ, const_iv[] = { # define const_iv(name) { # name, (IV)name } + const_iv (NUM_RESOURCES), const_iv (DEFAULT_RSTYLE), const_iv (OVERLAY_RSTYLE), const_iv (RS_Bold), @@ -777,7 +781,7 @@ NV NOW () CODE: - RETVAL = NOW; + RETVAL = ev::now (); OUTPUT: RETVAL @@ -859,19 +863,12 @@ envv->push_back (0); - bool success; - try { - success = term->init (argv, envv); + term->init (argv, envv); } catch (const class rxvt_failure_exception &e) { - success = false; - } - - if (!success) - { term->destroy (); croak ("error while initializing new terminal instance"); } @@ -1106,7 +1103,9 @@ case 1: RETVAL = THIS->ModMetaMask; break; case 2: RETVAL = THIS->ModNumLockMask; break; case 3: RETVAL = THIS->current_screen; break; +#ifdef CURSOR_BLINK case 4: RETVAL = THIS->hidden_cursor; break; +#endif } OUTPUT: RETVAL @@ -1141,10 +1140,10 @@ } int -rxvt_term::pty_ev_events (int events = EVENT_UNDEF) +rxvt_term::pty_ev_events (int events = ev::UNDEF) CODE: RETVAL = THIS->pty_ev.events; - if (events != EVENT_UNDEF) + if (events != ev::UNDEF) THIS->pty_ev.set (events); OUTPUT: RETVAL @@ -1233,6 +1232,7 @@ rxvt_term::want_refresh () CODE: THIS->want_refresh = 1; + THIS->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) @@ -1439,12 +1439,20 @@ rs = rslist + sizeof (rslist) / sizeof (rslist [0]); - do { - if (rs-- == rslist) - croak ("no such resource '%s', requested", name); - } while (strcmp (name, rs->name)); + if (*name) + { + do { + if (rs-- == rslist) + croak ("no such resource '%s', requested", name); + } while (strcmp (name, rs->name)); - index += rs->value; + index += rs->value; + } + else + { + --rs; + name = ""; + } if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES)) croak ("requested out-of-bound resource %s+%d,", name, index - rs->value); @@ -1478,7 +1486,7 @@ { THIS->set_option (optval, set); - if (THIS->check_ev.is_active ()) // avoid doing this before START + if (THIS->env_colorfgbg [0]) // avoid doing this before START switch (optval) { case Opt_skipBuiltinGlyphs: @@ -1486,10 +1494,12 @@ THIS->scr_remap_chars (); THIS->scr_touch (true); THIS->want_refresh = 1; + THIS->refresh_check (); break; case Opt_cursorUnderline: THIS->want_refresh = 1; + THIS->refresh_check (); break; # case Opt_scrollBar_floating: @@ -1557,7 +1567,10 @@ clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); if (ix) - THIS->want_refresh = 1; + { + THIS->want_refresh = 1; + THIS->refresh_check (); + } } } @@ -1707,7 +1720,7 @@ } void -rxvt_term::XChangeWindowProperty (Window window, Atom property, Atom type, int format, SV *data) +rxvt_term::XChangeProperty (Window window, Atom property, Atom type, int format, SV *data) CODE: { STRLEN len;