--- rxvt-unicode/src/rxvtperl.xs 2007/05/01 21:10:04 1.113 +++ rxvt-unicode/src/rxvtperl.xs 2007/12/13 18:24:36 1.117 @@ -33,7 +33,7 @@ #include "unistd.h" -#include "iom.h" +#include "ev_cpp.h" #include "rxvt.h" #include "keyboard.h" #include "rxvtutil.h" @@ -75,12 +75,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 (); @@ -390,7 +384,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 (); } @@ -599,7 +593,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 (); } @@ -607,7 +601,7 @@ { clearSVptr ((SV *)term->perl.self); SvREFCNT_dec ((SV *)term->perl.self); - + // don't allow further calls term->perl.self = 0; } @@ -783,7 +777,7 @@ NV NOW () CODE: - RETVAL = NOW; + RETVAL = ev::now (); OUTPUT: RETVAL @@ -865,19 +859,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"); } @@ -1147,10 +1134,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 @@ -1403,7 +1390,6 @@ CODE: { wchar_t *wstr = sv2wcs (text); - int wlen = wcslen (wstr); int dlen = 0; // find length @@ -1485,7 +1471,7 @@ { THIS->set_option (optval, set); - if (THIS->check_ev.is_active ()) // avoid doing this before START + if (THIS->prepare_ev.is_active ()) // avoid doing this before START switch (optval) { case Opt_skipBuiltinGlyphs: @@ -1681,7 +1667,7 @@ EXTEND (SP, count); while (count--) PUSHs (newSVuv ((U32)props [count])); - + XFree (props); }