--- rxvt-unicode/src/rxvtperl.xs 2006/01/18 08:33:34 1.72 +++ rxvt-unicode/src/rxvtperl.xs 2006/01/22 11:57:06 1.89 @@ -52,7 +52,7 @@ #undef ROW #define ROW(n) THIS->row_buf [LINENO (n)] -#define ENABLE_PERL_FRILLS 1 +typedef int CHAINED UNUSED; ///////////////////////////////////////////////////////////////////////////// @@ -120,13 +120,15 @@ ///////////////////////////////////////////////////////////////////////////// +#define SvWATCHER(sv) (perl_watcher *)SvPTR (sv, "urxvt::watcher") + struct perl_watcher { SV *cbsv; HV *self; perl_watcher () - : cbsv (newSV (0)) + : cbsv (0) { } @@ -137,7 +139,8 @@ void cb (SV *cb) { - sv_setsv (cbsv, cb); + SvREFCNT_dec (cbsv); + cbsv = newSVsv (cb); } void invoke (const char *type, SV *self, int arg = -1); @@ -171,9 +174,9 @@ } #define newSVtimer(timer) new_ref (timer->self, "urxvt::timer") -#define SvTIMER(sv) (timer *)SvPTR (sv, "urxvt::timer") +#define SvTIMER(sv) (timer *)(perl_watcher *)SvPTR (sv, "urxvt::timer") -struct timer : time_watcher, perl_watcher +struct timer : perl_watcher, time_watcher { tstamp interval; @@ -192,9 +195,9 @@ }; #define newSViow(iow) new_ref (iow->self, "urxvt::iow") -#define SvIOW(sv) (iow *)SvPTR (sv, "urxvt::iow") +#define SvIOW(sv) (iow *)(perl_watcher *)SvPTR (sv, "urxvt::iow") -struct iow : io_watcher, perl_watcher +struct iow : perl_watcher, io_watcher { iow () : io_watcher (this, &iow::execute) @@ -207,12 +210,45 @@ } }; +#define newSViw(iw) new_ref (iw->self, "urxvt::iw") +#define SvIW(sv) (iw *)(perl_watcher *)SvPTR (sv, "urxvt::iw") + +struct iw : perl_watcher, idle_watcher +{ + iw () + : idle_watcher (this, &iw::execute) + { + } + + void execute (idle_watcher &w) + { + invoke ("urxvt::iw", newSViw (this)); + } +}; + +#define newSVpw(pw) new_ref (pw->self, "urxvt::pw") +#define SvPW(sv) (pw *)(perl_watcher *)SvPTR (sv, "urxvt::pw") + +struct pw : perl_watcher, child_watcher +{ + pw () + : child_watcher (this, &pw::execute) + { + } + + void execute (child_watcher &w, int status) + { + invoke ("urxvt::pw", newSVpw (this), status); + } +}; + ///////////////////////////////////////////////////////////////////////////// #define SvOVERLAY(sv) (overlay *)SvPTR (sv, "urxvt::overlay") struct overlay { HV *self; + bool visible; rxvt_term *THIS; int x, y, w, h; int border; @@ -231,7 +267,7 @@ }; overlay::overlay (rxvt_term *THIS, int x_, int y_, int w_, int h_, rend_t rstyle, int border) -: THIS(THIS), x(x_), y(y_), w(w_), h(h_), border(border == 2) +: THIS(THIS), x(x_), y(y_), w(w_), h(h_), border(border == 2), visible(false) { if (border == 2) { @@ -302,24 +338,38 @@ void overlay::show () { - char key[33]; sprintf (key, "%32lx", (long)this); + if (visible) + return; - HV *hv = (HV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0)); - hv_store (hv, key, 32, newSViv ((long)this), 0); + visible = true; + + AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0)); + av_push (av, newSViv ((long)this)); } void overlay::hide () { - SV **ovs = hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0); + if (!visible) + return; - if (ovs) - { - char key[33]; sprintf (key, "%32lx", (long)this); + visible = false; - HV *hv = (HV *)SvRV (*ovs); - hv_delete (hv, key, 32, G_DISCARD); - } + AV *av = (AV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)THIS->perl.self), "_overlay", 8, 0)); + + int i; + + for (i = AvFILL (av); i >= 0; i--) + if (SvIV (*av_fetch (av, i, 1)) == (long)this) + { + av_delete (av, i, G_DISCARD); + break; + } + + for (; i < AvFILL (av); i++) + av_store (av, i, SvREFCNT_inc (*av_fetch (av, i + 1, 0))); + + av_pop (av); } void overlay::swap () @@ -369,7 +419,7 @@ AV *av = (AV *)SvRV (rend); - for (int col = min (av_len (av) + 1, w - x - border); col--; ) + for (int col = min (AvFILL (av) + 1, w - x - border); col--; ) this->rend [y][x + col] = SvIV (*av_fetch (av, col, 1)); } @@ -435,7 +485,7 @@ { // runs outside of perls ENV term->perl.self = (void *)newSVptr ((void *)term, "urxvt::term"); - hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newHV ()), 0); + hv_store ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, newRV_noinc ((SV *)newAV ()), 0); } } @@ -450,20 +500,6 @@ } } -static void -swap_overlays (rxvt_term *term) -{ - HV *hv = (HV *)SvRV (*hv_fetch ((HV *)SvRV ((SV *)term->perl.self), "_overlay", 8, 0)); - - if (HvKEYS (hv)) - { - hv_iterinit (hv); - - while (HE *he = hv_iternext (hv)) - ((overlay *)SvIV (hv_iterval (hv, he)))->swap (); - } -} - bool rxvt_perl_interp::invoke (rxvt_term *term, hook_type htype, ...) { @@ -472,7 +508,12 @@ // pre-handling of some events if (htype == HOOK_REFRESH_END) - swap_overlays (term); + { + 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 (); + } swap (perl_environ, environ); @@ -537,6 +578,7 @@ # define set(name, sv) hv_store (hv, # name, sizeof (# name) - 1, sv, 0) # define setiv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSViv (val), 0) +# define setuv(name, val) hv_store (hv, # name, sizeof (# name) - 1, newSVuv (val), 0) # undef set setiv (type, xe->type); @@ -550,31 +592,72 @@ case ButtonPress: case ButtonRelease: case MotionNotify: - setiv (time, xe->xmotion.time); - setiv (x, xe->xmotion.x); - setiv (y, xe->xmotion.y); - setiv (row, xe->xmotion.y / term->fheight); - setiv (col, xe->xmotion.x / term->fwidth); - setiv (x_root, xe->xmotion.x_root); - setiv (y_root, xe->xmotion.y_root); - setiv (state, xe->xmotion.state); + setuv (window, xe->xmotion.window); + setuv (root, xe->xmotion.root); + setuv (subwindow, xe->xmotion.subwindow); + setuv (time, xe->xmotion.time); + setiv (x, xe->xmotion.x); + setiv (y, xe->xmotion.y); + setiv (row, xe->xmotion.y / term->fheight + term->view_start); + setiv (col, xe->xmotion.x / term->fwidth); + setiv (x_root, xe->xmotion.x_root); + setiv (y_root, xe->xmotion.y_root); + setuv (state, xe->xmotion.state); + + switch (xe->type) + { + case KeyPress: + case KeyRelease: + setuv (keycode, xe->xkey.keycode); + break; + + case ButtonPress: + case ButtonRelease: + setuv (button, xe->xbutton.button); + break; + + case MotionNotify: + setiv (is_hint, xe->xmotion.is_hint); + break; + } + break; - } - switch (xe->type) - { - case KeyPress: - case KeyRelease: - setiv (keycode, xe->xkey.keycode); + case MapNotify: + case UnmapNotify: + case ConfigureNotify: + setuv (event, xe->xconfigure.event); + setuv (window, xe->xconfigure.window); + + switch (xe->type) + { + case ConfigureNotify: + setiv (x, xe->xconfigure.x); + setiv (y, xe->xconfigure.y); + setiv (width, xe->xconfigure.width); + setiv (height, xe->xconfigure.height); + setuv (above, xe->xconfigure.above); + break; + } + break; - case ButtonPress: - case ButtonRelease: - setiv (button, xe->xbutton.button); + case PropertyNotify: + setuv (window, xe->xproperty.window); + setuv (atom, xe->xproperty.atom); + setuv (time, xe->xproperty.time); + setiv (state, xe->xproperty.state); break; - case MotionNotify: - setiv (is_hint, xe->xmotion.is_hint); + case ClientMessage: + setuv (window, xe->xclient.window); + setuv (message_type, xe->xclient.message_type); + setuv (format, xe->xclient.format); + setuv (l0, xe->xclient.data.l[0]); + setuv (l1, xe->xclient.data.l[1]); + setuv (l2, xe->xclient.data.l[2]); + setuv (l3, xe->xclient.data.l[3]); + setuv (l4, xe->xclient.data.l[4]); break; } @@ -625,7 +708,12 @@ // post-handling of some events if (htype == HOOK_REFRESH_BEGIN) - swap_overlays (term); + { + 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 (); + } else if (htype == HOOK_DESTROY) { clearSVptr ((SV *)term->perl.self); @@ -842,23 +930,23 @@ rxvt_term *term = new rxvt_term; - term->argv = new stringvec; - term->envv = new stringvec; + stringvec *argv = new stringvec; + stringvec *envv = new stringvec; for (int i = 1; i < items; i++) - term->argv->push_back (strdup (SvPVbyte_nolen (ST (i)))); + argv->push_back (strdup (SvPVbyte_nolen (ST (i)))); - AV *envv = (AV *)SvRV (ST (0)); - for (int i = av_len (envv) + 1; i--; ) - term->envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (envv, i, 1)))); + AV *env = (AV *)SvRV (ST (0)); + for (int i = AvFILL (env) + 1; i--; ) + envv->push_back (strdup (SvPVbyte_nolen (*av_fetch (env, i, 1)))); - term->envv->push_back (0); + envv->push_back (0); bool success; try { - success = term->init (term->argv->size (), term->argv->begin ()); + success = term->init (argv, envv); } catch (const class rxvt_failure_exception &e) { @@ -880,95 +968,6 @@ void rxvt_term::destroy () -#if ENABLE_PERL_FRILLS - -void -rxvt_term::XListProperties (U32 window) - PPCODE: -{ - int count; - Atom *props = XListProperties (THIS->display->display, (Window)window, &count); - - EXTEND (SP, count); - while (count--) - PUSHs (newSVuv ((U32)props [count])); - - XFree (props); -} - -void -rxvt_term::XGetWindowProperty (U32 window, U32 property) - PPCODE: -{ - Atom type; - int format; - unsigned long nitems; - unsigned long bytes_after; - unsigned char *prop; - XGetWindowProperty (THIS->display->display, (Window)window, (Atom)property, - 0, 1<<30, 0, AnyPropertyType, - &type, &format, &nitems, &bytes_after, &prop); - if (type != None) - { - EXTEND (SP, 3); - PUSHs (newSVuv ((U32)type)); - PUSHs (newSViv (format)); - PUSHs (newSVpvn ((char *)prop, nitems * format / 8)); - XFree (prop); - } -} - -void -rxvt_term::XChangeWindowProperty (U32 window, U32 property, U32 type, int format, SV *data) - CODE: -{ - STRLEN len; - char *data_ = SvPVbyte (data, len); - - XChangeProperty (THIS->display->display, (Window)window, (Atom)property, - type, format, PropModeReplace, - (unsigned char *)data, len * 8 / format); -} - -void -rxvt_term::XDeleteProperty (U32 window, U32 property) - CODE: - XDeleteProperty (THIS->display->display, (Window)window, (Atom)property); - -U32 -rxvt_term::DefaultRootWindow () - CODE: - RETVAL = (U32)THIS->display->root; - OUTPUT: - RETVAL - -U32 -rxvt_term::XCreateSimpleWindow (U32 parent, int x, int y, unsigned int width, unsigned int height) - CODE: - RETVAL = XCreateSimpleWindow (THIS->display->display, (Window)parent, - x, y, width, height, 0, - THIS->pix_colors_focused[Color_border], - THIS->pix_colors_focused[Color_border]); - OUTPUT: - RETVAL - -void -rxvt_term::XReparentWindow (U32 window, U32 parent, int x = 0, int y = 0) - CODE: - XReparentWindow (THIS->display->display, (Window)window, (Window)parent, x, y); - -void -rxvt_term::XMapWindow (U32 window) - CODE: - XMapWindow (THIS->display->display, (Window)window); - -void -rxvt_term::XUnmapWindow (U32 window) - CODE: - XUnmapWindow (THIS->display->display, (Window)window); - -#endif - void rxvt_term::set_should_invoke (int htype, int inc) CODE: @@ -982,7 +981,7 @@ GrabModeSync, GrabModeSync, None, GRAB_CURSOR); bool -rxvt_term::grab (U32 eventtime, int sync = 0) +rxvt_term::grab (Time eventtime, int sync = 0) CODE: { int mode = sync ? GrabModeSync : GrabModeAsync; @@ -1084,6 +1083,9 @@ #define TERM_OFFSET_ncol TERM_OFFSET(ncol) #define TERM_OFFSET_focus TERM_OFFSET(focus) #define TERM_OFFSET_mapped TERM_OFFSET(mapped) +#define TERM_OFFSET_int_bwidth TERM_OFFSET(int_bwidth) +#define TERM_OFFSET_ext_bwidth TERM_OFFSET(ext_bwidth) +#define TERM_OFFSET_lineSpace TERM_OFFSET(lineSpace) #define TERM_OFFSET_saveLines TERM_OFFSET(saveLines) #define TERM_OFFSET_total_rows TERM_OFFSET(total_rows) #define TERM_OFFSET_top_row TERM_OFFSET(top_row) @@ -1100,6 +1102,9 @@ ncol = TERM_OFFSET_ncol focus = TERM_OFFSET_focus mapped = TERM_OFFSET_mapped + int_bwidth = TERM_OFFSET_int_bwidth + ext_bwidth = TERM_OFFSET_ext_bwidth + lineSpace = TERM_OFFSET_lineSpace saveLines = TERM_OFFSET_saveLines total_rows = TERM_OFFSET_total_rows top_row = TERM_OFFSET_top_row @@ -1114,12 +1119,16 @@ ModLevel3Mask = 0 ModMetaMask = 1 ModNumLockMask = 2 + current_screen = 3 + hidden_cursor = 4 CODE: switch (ix) { - case 0: RETVAL = THIS->ModLevel3Mask; break; - case 1: RETVAL = THIS->ModMetaMask; break; - case 2: RETVAL = THIS->ModNumLockMask; break; + case 0: RETVAL = THIS->ModLevel3Mask; break; + case 1: RETVAL = THIS->ModMetaMask; break; + case 2: RETVAL = THIS->ModNumLockMask; break; + case 3: RETVAL = THIS->current_screen; break; + case 4: RETVAL = THIS->hidden_cursor; break; } OUTPUT: RETVAL @@ -1167,17 +1176,17 @@ OUTPUT: RETVAL -U32 +Window rxvt_term::parent () CODE: - RETVAL = (U32)THIS->parent [0]; + RETVAL = THIS->parent [0]; OUTPUT: RETVAL -U32 +Window rxvt_term::vt () CODE: - RETVAL = (U32)THIS->vt; + RETVAL = THIS->vt; OUTPUT: RETVAL @@ -1209,6 +1218,12 @@ RETVAL void +rxvt_term::focus_in () + +void +rxvt_term::focus_out () + +void rxvt_term::want_refresh () CODE: THIS->want_refresh = 1; @@ -1240,7 +1255,7 @@ int len = min (wcslen (wstr) - start_ofs, max_len); - if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) + if (start_col < 0 || start_col + len > THIS->ncol) { free (wstr); croak ("new_text extends beyond horizontal margins"); @@ -1282,9 +1297,9 @@ croak ("new_rend must be arrayref"); AV *av = (AV *)SvRV (new_rend); - int len = min (av_len (av) + 1 - start_ofs, max_len); + int len = min (AvFILL (av) + 1 - start_ofs, max_len); - if (!IN_RANGE_INC (start_col, 0, THIS->ncol - len)) + if (start_col < 0 || start_col + len > THIS->ncol) croak ("new_rend array extends beyond horizontal margins"); for (int col = start_col; col < start_col + len; col++) @@ -1459,24 +1474,25 @@ else THIS->options &= ~optval; - switch (optval) - { - case Opt_skipBuiltinGlyphs: - THIS->set_fonts (); - THIS->scr_remap_chars (); - THIS->scr_touch (true); - THIS->want_refresh = 1; - break; - - case Opt_cursorUnderline: - THIS->want_refresh = 1; - break; + if (THIS->check_ev.is_active ()) // avoid doing this before START + switch (optval) + { + case Opt_skipBuiltinGlyphs: + THIS->set_fonts (); + THIS->scr_remap_chars (); + THIS->scr_touch (true); + THIS->want_refresh = 1; + break; + + case Opt_cursorUnderline: + THIS->want_refresh = 1; + break; # case Opt_scrollBar_floating: # case Opt_scrollBar_right: # THIS->resize_all_windows (THIS->width, THIS->height, 1); # break; - } + } } } OUTPUT: @@ -1514,8 +1530,27 @@ if (items == 3) { - rc.row = clamp (SvIV (ST (1)), THIS->top_row, THIS->nrow - 1); - rc.col = clamp (SvIV (ST (2)), 0, THIS->ncol - 1); + rc.row = SvIV (ST (1)); + rc.col = SvIV (ST (2)); + + if (ix == 2) + { + if (rc.col == 0) + { + // col == 0 means end of previous line + rc.row--; + rc.col = THIS->ncol; + } + else if (IN_RANGE_EXC (rc.row, THIS->top_row, THIS->nrow) + && rc.col > ROW(rc.row).l) + { + // col >= length means while line and add newline + rc.col = THIS->ncol; + } + } + + clamp_it (rc.col, 0, THIS->ncol); + clamp_it (rc.row, THIS->top_row, THIS->nrow - 1); if (ix) THIS->want_refresh = 1; @@ -1533,14 +1568,14 @@ #rxvt_term::selection_clear () void -rxvt_term::selection_make (U32 eventtime, bool rect = false) +rxvt_term::selection_make (Time eventtime, bool rect = false) CODE: THIS->selection.op = SELECTION_CONT; THIS->selection.rect = rect; THIS->selection_make (eventtime); int -rxvt_term::selection_grab (U32 eventtime) +rxvt_term::selection_grab (Time eventtime) void rxvt_term::selection (SV *newtext = 0) @@ -1570,6 +1605,9 @@ rxvt_term::scr_bell () void +rxvt_term::scr_change_screen (int screen) + +void rxvt_term::scr_add_lines (SV *string) CODE: { @@ -1618,6 +1656,146 @@ OUTPUT: RETVAL +############################################################################# +# Various X Utility Functions +############################################################################# + +void +rxvt_term::XListProperties (Window window) + PPCODE: +{ + int count; + Atom *props = XListProperties (THIS->display->display, window, &count); + + EXTEND (SP, count); + while (count--) + PUSHs (newSVuv ((U32)props [count])); + + XFree (props); +} + +void +rxvt_term::XGetWindowProperty (Window window, Atom property) + PPCODE: +{ + Atom type; + int format; + unsigned long nitems; + unsigned long bytes_after; + unsigned char *prop; + + XGetWindowProperty (THIS->display->display, window, property, + 0, 1<<24, 0, AnyPropertyType, + &type, &format, &nitems, &bytes_after, &prop); + + if (type != None) + { + int elemsize = format == 16 ? sizeof (short) + : format == 32 ? sizeof (long) + : 1; + + EXTEND (SP, 3); + PUSHs (newSVuv ((U32)type)); + PUSHs (newSViv (format)); + PUSHs (newSVpvn ((char *)prop, nitems * elemsize)); + XFree (prop); + } +} + +void +rxvt_term::XChangeWindowProperty (Window window, Atom property, Atom type, int format, SV *data) + CODE: +{ + STRLEN len; + char *data_ = SvPVbyte (data, len); + + int elemsize = format == 16 ? sizeof (short) + : format == 32 ? sizeof (long) + : 1; + + XChangeProperty (THIS->display->display, window, property, + type, format, PropModeReplace, + (unsigned char *)data_, len / elemsize); + XSync (THIS->display->display, 0); +} + +Atom +XInternAtom (rxvt_term *term, char *atom_name, int only_if_exists = FALSE) + C_ARGS: term->display->display, atom_name, only_if_exists + +char * +XGetAtomName (rxvt_term *term, Atom atom) + C_ARGS: term->display->display, atom + CLEANUP: + XFree (RETVAL); + +void +XDeleteProperty (rxvt_term *term, Window window, Atom property) + C_ARGS: term->display->display, window, property + +Window +rxvt_term::DefaultRootWindow () + CODE: + RETVAL = THIS->display->root; + OUTPUT: + RETVAL + +#if 0 + +Window +XCreateSimpleWindow (rxvt_term *term, Window parent, int x, int y, unsigned int width, unsigned int height) + C_ARGS: term->display->display, (Window)parent, + x, y, width, height, 0, + term->pix_colors_focused[Color_border], + term->pix_colors_focused[Color_border] + +#endif + +void +XReparentWindow (rxvt_term *term, Window window, Window parent, int x = 0, int y = 0) + C_ARGS: term->display->display, window, parent, x, y + +void +XMapWindow (rxvt_term *term, Window window) + C_ARGS: term->display->display, window + +void +XUnmapWindow (rxvt_term *term, Window window) + C_ARGS: term->display->display, window + +void +XMoveResizeWindow (rxvt_term *term, Window window, int x, int y, unsigned int width, unsigned int height) + C_ARGS: term->display->display, window, x, y, width, height + +void +rxvt_term::XChangeInput (Window window, U32 add_events, U32 del_events = 0) + CODE: +{ + XWindowAttributes attr; + XGetWindowAttributes (THIS->display->display, window, &attr); + XSelectInput (THIS->display->display, window, attr.your_event_mask | add_events & ~del_events); +} + +void +rxvt_term::XTranslateCoordinates (Window src, Window dst, int x, int y) + PPCODE: +{ + int dx, dy; + Window child; + + if (XTranslateCoordinates (THIS->display->display, src, dst, x, y, &dx, &dy, &child)) + { + EXTEND (SP, 3); + PUSHs (newSViv (dx)); + PUSHs (newSViv (dy)); + PUSHs (newSVuv (child)); + } +} + +############################################################################# +# urxvt::overlay +############################################################################# + MODULE = urxvt PACKAGE = urxvt::overlay void @@ -1632,6 +1810,23 @@ void overlay::DESTROY () +############################################################################# +# urxvt::watcher +############################################################################# + +MODULE = urxvt PACKAGE = urxvt::watcher + +CHAINED +perl_watcher::cb (SV *cb) + CODE: + THIS->cb (cb); + OUTPUT: + RETVAL + +############################################################################# +# urxvt::timer +############################################################################# + MODULE = urxvt PACKAGE = urxvt::timer SV * @@ -1639,19 +1834,11 @@ CODE: timer *w = new timer; w->start (NOW); - RETVAL = newSVptr ((void *)w, "urxvt::timer"); + RETVAL = newSVptr ((void *)(perl_watcher *)w, "urxvt::timer"); w->self = (HV *)SvRV (RETVAL); OUTPUT: RETVAL -timer * -timer::cb (SV *cb) - CODE: - THIS->cb (cb); - RETVAL = THIS; - OUTPUT: - RETVAL - NV timer::at () CODE: @@ -1659,93 +1846,152 @@ OUTPUT: RETVAL -timer * +CHAINED timer::interval (NV interval) CODE: THIS->interval = interval; - RETVAL = THIS; OUTPUT: RETVAL -timer * +CHAINED timer::set (NV tstamp) CODE: THIS->set (tstamp); - RETVAL = THIS; OUTPUT: RETVAL -timer * +CHAINED timer::start (NV tstamp = THIS->at) - CODE: + CODE: THIS->start (tstamp); - RETVAL = THIS; OUTPUT: RETVAL -timer * +CHAINED +timer::after (NV delay) + CODE: + THIS->start (NOW + delay); + OUTPUT: + RETVAL + +CHAINED timer::stop () CODE: THIS->stop (); - RETVAL = THIS; OUTPUT: RETVAL void timer::DESTROY () +############################################################################# +# urxvt::iow +############################################################################# + MODULE = urxvt PACKAGE = urxvt::iow SV * iow::new () CODE: iow *w = new iow; - RETVAL = newSVptr ((void *)w, "urxvt::iow"); + RETVAL = newSVptr ((void *)(perl_watcher *)w, "urxvt::iow"); w->self = (HV *)SvRV (RETVAL); OUTPUT: RETVAL -iow * -iow::cb (SV *cb) - CODE: - THIS->cb (cb); - RETVAL = THIS; - OUTPUT: - RETVAL - -iow * +CHAINED iow::fd (int fd) CODE: THIS->fd = fd; - RETVAL = THIS; OUTPUT: RETVAL -iow * +CHAINED iow::events (short events) CODE: THIS->events = events; - RETVAL = THIS; OUTPUT: RETVAL -iow * +CHAINED iow::start () - CODE: + CODE: THIS->start (); - RETVAL = THIS; OUTPUT: RETVAL -iow * +CHAINED iow::stop () CODE: THIS->stop (); - RETVAL = THIS; OUTPUT: RETVAL void iow::DESTROY () +############################################################################# +# urxvt::iw +############################################################################# + +MODULE = urxvt PACKAGE = urxvt::iw + +SV * +iw::new () + CODE: + iw *w = new iw; + RETVAL = newSVptr ((void *)(perl_watcher *)w, "urxvt::iw"); + w->self = (HV *)SvRV (RETVAL); + OUTPUT: + RETVAL + +CHAINED +iw::start () + CODE: + THIS->start (); + OUTPUT: + RETVAL + +CHAINED +iw::stop () + CODE: + THIS->stop (); + OUTPUT: + RETVAL + +void +iw::DESTROY () + +############################################################################# +# urxvt::pw +############################################################################# + +MODULE = urxvt PACKAGE = urxvt::pw + +SV * +pw::new () + CODE: + pw *w = new pw; + RETVAL = newSVptr ((void *)(perl_watcher *)w, "urxvt::pw"); + w->self = (HV *)SvRV (RETVAL); + OUTPUT: + RETVAL + +CHAINED +pw::start (int pid) + CODE: + THIS->start (pid); + OUTPUT: + RETVAL + +CHAINED +pw::stop () + CODE: + THIS->stop (); + OUTPUT: + RETVAL + +void +pw::DESTROY () +