--- rxvt-unicode/src/main.C 2007/12/04 14:50:42 1.269 +++ rxvt-unicode/src/main.C 2007/12/11 15:42:51 1.275 @@ -40,9 +40,7 @@ #include #include -#ifdef HAVE_TERMIOS_H # include -#endif #ifdef HAVE_XSETLOCALE # define X_LOCALE @@ -154,49 +152,48 @@ #endif rxvt_term::rxvt_term () - : +{ #if HAVE_BG_PIXMAP - update_background_ev(this, &rxvt_term::update_background_cb), + update_background_ev.set (this); #endif #ifdef CURSOR_BLINK - cursor_blink_ev (this, &rxvt_term::cursor_blink_cb), + cursor_blink_ev.set (this); #endif #ifdef TEXT_BLINK - text_blink_ev (this, &rxvt_term::text_blink_cb), + text_blink_ev.set (this); text_blink_ev.set (0., TEXT_BLINK_INTERVAL); #endif #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING - cont_scroll_ev (this, &rxvt_term::cont_scroll_cb), + cont_scroll_ev.set (this); #endif #ifdef SELECTION_SCROLLING - sel_scroll_ev (this, &rxvt_term::sel_scroll_cb), + sel_scroll_ev.set (this); #endif #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) - slip_wheel_ev (this, &rxvt_term::slip_wheel_cb), + slip_wheel_ev.set (this); #endif -#ifdef POINTER_BLANK - pointer_ev (this, &rxvt_term::pointer_cb), -#endif -#ifndef NO_BELL - bell_ev (this, &rxvt_term::bell_cb), -#endif - child_ev (this, &rxvt_term::child_cb), - prepare_ev (this, &rxvt_term::prepare_cb), - flush_ev (this, &rxvt_term::flush_cb), - destroy_ev (this, &rxvt_term::destroy_cb), - pty_ev (this, &rxvt_term::pty_cb), - incr_ev (this, &rxvt_term::incr_cb) -{ #if ENABLE_TRANSPARENCY || ENABLE_PERL - callback_set (rootwin_ev , this, rxvt_term, rootwin_cb); + rootwin_ev.set (this), #endif #ifdef HAVE_SCROLLBARS - callback_set (scrollbar_ev, this, rxvt_term, x_cb); + scrollbar_ev.set (this), #endif #ifdef USE_XIM - callback_set (im_ev , this, rxvt_term, im_cb); + im_ev.set (this), +#endif +#ifdef POINTER_BLANK + pointer_ev.set (this); #endif - callback_set (termwin_ev , this, rxvt_term, x_cb); - callback_set (vt_ev , this, rxvt_term, x_cb); +#ifndef NO_BELL + bell_ev.set (this); +#endif + child_ev.set (this); + prepare_ev.set (this); + flush_ev.set (this); flush_ev.set (0., 1. / 60.); // refresh at max. 60 Hz normally + destroy_ev.set (this); + pty_ev.set (this); + incr_ev.set (this); + termwin_ev.set (this); + vt_ev.set (this); cmdbuf_ptr = cmdbuf_endp = cmdbuf_base; @@ -332,7 +329,7 @@ void rxvt_term::destroy () { - if (destroy_ev.active) + if (ev_is_active (&destroy_ev)) return; HOOK_INVOKE ((this, HOOK_DESTROY, DT_END)); @@ -603,21 +600,23 @@ /* * Catch a fatal signal and tidy up before quitting */ - void - sig_term (ev::sig &w, int revents) - { - rxvt_emergency_cleanup (); - w.stop (); - kill (getpid (), w.signum); - } + void sig_term (ev::sig &w, int revents); sig_handlers () - : sw_term (this, &sig_handlers::sig_term), - sw_int (this, &sig_handlers::sig_term) { + sw_term.set (this); + sw_int .set (this); } } sig_handlers; +void +sig_handlers::sig_term (ev::sig &w, int revents) +{ + rxvt_emergency_cleanup (); + w.stop (); + kill (getpid (), w.signum); +} + char **rxvt_environ; // startup environment void @@ -830,7 +829,7 @@ (void)ioctl (pty->pty, TIOCSWINSZ, &ws); #if 0 - // TIOCSWINSZ⎈ is supposed to do this automatically and correctly + // TIOCSWINSZ is supposed to do this automatically and correctly if (cmd_pid) /* force through to the command */ kill (-cmd_pid, SIGWINCH); #endif