--- rxvt-unicode/src/rxvtperl.xs 2006/12/14 17:33:53 1.111 +++ rxvt-unicode/src/rxvtperl.xs 2008/06/15 14:07:58 1.122 @@ -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) @@ -75,12 +71,6 @@ } static SV * -new_ref (HV *hv, const char *klass) -{ - return sv_bless (newRV ((SV *)hv), gv_stashpv (klass, 1)); -} - -static SV * newSVptr (void *ptr, const char *klass) { HV *hv = newHV (); @@ -222,6 +212,7 @@ av_push (overlay_av, newSViv ((long)this)); THIS->want_refresh = 1; + THIS->refresh_check (); } void @@ -245,6 +236,7 @@ overlay_av = 0; THIS->want_refresh = 1; + THIS->refresh_check (); } void overlay::swap () @@ -299,12 +291,14 @@ } THIS->want_refresh = 1; + THIS->refresh_check (); } ///////////////////////////////////////////////////////////////////////////// #define IOM_CLASS "urxvt" -#include +#define IOM_WARN rxvt_warn +#include "iom_perl.h" ///////////////////////////////////////////////////////////////////////////// @@ -389,7 +383,7 @@ if (htype == HOOK_REFRESH_END) { AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); - + for (int i = 0; i <= AvFILL (av); i++) ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); } @@ -598,7 +592,7 @@ if (htype == HOOK_REFRESH_BEGIN) { AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); - + for (int i = AvFILL (av); i >= 0; i--) ((overlay *)SvIV (*av_fetch (av, i, 0)))->swap (); } @@ -606,7 +600,7 @@ { clearSVptr ((SV *)term->perl.self); SvREFCNT_dec ((SV *)term->perl.self); - + // don't allow further calls term->perl.self = 0; } @@ -782,7 +776,7 @@ NV NOW () CODE: - RETVAL = NOW; + RETVAL = ev::now (); OUTPUT: RETVAL @@ -864,19 +858,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"); } @@ -1146,10 +1133,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 @@ -1238,6 +1225,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) @@ -1402,7 +1390,6 @@ CODE: { wchar_t *wstr = sv2wcs (text); - int wlen = wcslen (wstr); int dlen = 0; // find length @@ -1475,19 +1462,16 @@ rxvt_term::x_resource (const char *name) bool -rxvt_term::option (U32 optval, int set = -1) +rxvt_term::option (U8 optval, int set = -1) CODE: { - RETVAL = THIS->options & optval; + RETVAL = THIS->option (optval); if (set >= 0) { - if (set) - THIS->options |= optval; - else - THIS->options &= ~optval; + 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: @@ -1495,10 +1479,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: @@ -1566,7 +1552,10 @@ clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); if (ix) - THIS->want_refresh = 1; + { + THIS->want_refresh = 1; + THIS->refresh_check (); + } } } @@ -1683,7 +1672,7 @@ EXTEND (SP, count); while (count--) PUSHs (newSVuv ((U32)props [count])); - + XFree (props); } @@ -1716,7 +1705,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;