--- rxvt-unicode/src/rxvt.h 2007/10/24 10:39:58 1.313 +++ rxvt-unicode/src/rxvt.h 2007/11/30 10:57:04 1.328 @@ -20,6 +20,7 @@ # define ENABLE_XIM_ONTHESPOT 1 # define CURSOR_BLINK 1 # define OPTION_HC 1 +# define BUILTIN_GLYPHS 1 #else # define ENABLE_MINIMAL 1 #endif @@ -30,15 +31,12 @@ #include #include #include -#if ENABLE_FRILLS -# include -#endif #include "encoding.h" #include "rxvtutil.h" #include "rxvtfont.h" #include "rxvttoolkit.h" -#include "iom.h" +#include "ev_cpp.h" #include "salloc.h" #include "libptytty.h" @@ -75,12 +73,6 @@ #include typedef struct termios ttymode_t; -#ifdef HAVE_AFTERIMAGE -# include -#undef min -#undef max -#endif - #include "background.h" #ifndef STDIN_FILENO @@ -99,7 +91,7 @@ /* ***************************************************************************** - * PROTOTYPES + * PROTOTYPES ***************************************************************************** */ // main.C @@ -113,8 +105,6 @@ char * rxvt_wcstoutf8 (const wchar_t *str, int len = -1); wchar_t * rxvt_utf8towcs (const char *str, int len = -1); -#define rxvt_strdup(s) ((s) ? strdup(s) : 0) - char * rxvt_basename (const char *str) NOTHROW; void rxvt_vlog (const char *fmt, va_list arg_ptr) NOTHROW; void rxvt_log (const char *fmt,...) NOTHROW; @@ -179,36 +169,26 @@ unsigned int button; /* detail */ }; -#if ENABLE_FRILLS -typedef struct _mwmhints { - CARD32 flags; - CARD32 functions; - CARD32 decorations; - INT32 input_mode; - CARD32 status; -} MWMHints; -#endif - #if ENABLE_XEMBED // XEMBED messages -# define XEMBED_EMBEDDED_NOTIFY 0 -# define XEMBED_WINDOW_ACTIVATE 1 -# define XEMBED_WINDOW_DEACTIVATE 2 -# define XEMBED_REQUEST_FOCUS 3 -# define XEMBED_FOCUS_IN 4 -# define XEMBED_FOCUS_OUT 5 -# define XEMBED_FOCUS_NEXT 6 +# define XEMBED_EMBEDDED_NOTIFY 0 +# define XEMBED_WINDOW_ACTIVATE 1 +# define XEMBED_WINDOW_DEACTIVATE 2 +# define XEMBED_REQUEST_FOCUS 3 +# define XEMBED_FOCUS_IN 4 +# define XEMBED_FOCUS_OUT 5 +# define XEMBED_FOCUS_NEXT 6 # define XEMBED_FOCUS_PREV 7 -# define XEMBED_MODALITY_ON 10 -# define XEMBED_MODALITY_OFF 11 -# define XEMBED_REGISTER_ACCELERATOR 12 -# define XEMBED_UNREGISTER_ACCELERATOR 13 +# define XEMBED_MODALITY_ON 10 +# define XEMBED_MODALITY_OFF 11 +# define XEMBED_REGISTER_ACCELERATOR 12 +# define XEMBED_UNREGISTER_ACCELERATOR 13 # define XEMBED_ACTIVATE_ACCELERATOR 14 // XEMBED detail code -# define XEMBED_FOCUS_CURRENT 0 -# define XEMBED_FOCUS_FIRST 1 +# define XEMBED_FOCUS_CURRENT 0 +# define XEMBED_FOCUS_FIRST 1 # define XEMBED_FOCUS_LAST 2 # define XEMBED_MAPPED (1 << 0) @@ -431,7 +411,7 @@ C0_BS , C0_HT , C0_LF , C0_VT , C0_FF , C0_CR , C0_SO , C0_SI , C0_DLE, C0_DC1, C0_DC2, D0_DC3, C0_DC4, C0_NAK, C0_SYN, C0_ETB, C0_CAN, C0_EM , C0_SUB, C0_ESC, C0_IS4, C0_IS3, C0_IS2, C0_IS1, -}; +}; #define CHAR_ST 0x9c /* 0234 */ /* @@ -602,8 +582,6 @@ #define PrivMode_LFNL (1UL<<19) #define PrivMode_MouseBtnEvent (1UL<<20) #define PrivMode_MouseAnyEvent (1UL<<21) -/* too annoying to implement X11 highlight tracking */ -/* #define PrivMode_MouseX11Track (1LU<<20) */ #define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent) @@ -623,6 +601,17 @@ # define PATH_MAX 16384 #endif +#if ENABLE_FRILLS +# include +typedef struct _mwmhints { + CARD32 flags; + CARD32 functions; + CARD32 decorations; + INT32 input_mode; + CARD32 status; +} MWMHints; +#endif + /* Motif window hints */ #define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_DECORATIONS (1L << 1) @@ -796,7 +785,7 @@ /****************************************************************************/ -// primivite wrapper around mbstate_t to ensure initialisation +// primitive wrapper around mbstate_t to ensure initialisation struct mbstate { mbstate_t mbs; @@ -863,7 +852,7 @@ static const char resval_undef []; // options specifically unset static const char resval_on []; // boolean options switched on static const char resval_off []; // or off - + log_callback *log_hook; // log error messages through this hook, if != 0 getfd_callback *getfd_hook; // convert remote to local fd, if != 0 #if ENABLE_PERL @@ -1021,6 +1010,9 @@ #ifdef KEYSYM_RESOURCE keyboard_manager *keyboard; #endif +#ifndef NO_RESOURCES + XrmDatabase option_db; +#endif const char *rs[NUM_RESOURCES]; /* command input buffering */ @@ -1058,8 +1050,12 @@ #endif #ifdef HAVE_BG_PIXMAP int update_background (); - void update_background_cb (time_watcher &w); - time_watcher update_background_ev; +#if TRACE_PIXMAPS + int trace_update_background (const char *file, int line); +# define update_background() trace_update_background (__FILE__, __LINE__) +#endif + void update_background_cb (ev::timer &w, int revents); + ev::timer update_background_ev; #endif void x_cb (XEvent &xev); @@ -1069,37 +1065,37 @@ xevent_watcher scrollbar_ev; #endif - void child_cb (child_watcher &w, int status); child_watcher child_ev; - void check_cb (check_watcher &w); check_watcher check_ev; - void destroy_cb (time_watcher &w); time_watcher destroy_ev; + void child_cb (ev::child &w, int revents); ev::child child_ev; + void prepare_cb (ev::prepare &w, int revents); ev::prepare prepare_ev; + void destroy_cb (ev::idle &w, int revents); ev::idle destroy_ev; void flush (); - void flush_cb (time_watcher &w); time_watcher flush_ev; + void flush_cb (ev::timer &w, int revents); ev::timer flush_ev; bool pty_fill (); - void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; - void incr_cb (time_watcher &w) NOTHROW; time_watcher incr_ev; + void pty_cb (ev::io &w, int revents); ev::io pty_ev; + void incr_cb (ev::timer &w, int revents) NOTHROW; ev::timer incr_ev; #ifdef CURSOR_BLINK - void cursor_blink_cb (time_watcher &w); time_watcher cursor_blink_ev; + void cursor_blink_cb (ev::timer &w, int revents); ev::timer cursor_blink_ev; #endif #ifdef TEXT_BLINK - void text_blink_cb (time_watcher &w); time_watcher text_blink_ev; + void text_blink_cb (ev::timer &w, int revents); ev::timer text_blink_ev; #endif -#ifndef NO_BELL - void bell_cb (time_watcher &w); time_watcher bell_ev; +#ifndef NO_BELL + void bell_cb (ev::timer &w, int revents); ev::timer bell_ev; #endif #ifndef NO_SCROLLBAR_BUTTON_CONTINUAL_SCROLLING - void cont_scroll_cb (time_watcher &w); time_watcher cont_scroll_ev; + void cont_scroll_cb (ev::timer &w, int revents); ev::timer cont_scroll_ev; #endif #ifdef SELECTION_SCROLLING - void sel_scroll_cb (time_watcher &w); time_watcher sel_scroll_ev; + void sel_scroll_cb (ev::timer &w, int revents); ev::timer sel_scroll_ev; #endif #if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) - void slip_wheel_cb (time_watcher &w); time_watcher slip_wheel_ev; + void slip_wheel_cb (ev::timer &w, int revents); ev::timer slip_wheel_ev; #endif #ifdef POINTER_BLANK - void pointer_cb (time_watcher &w); time_watcher pointer_ev; + void pointer_cb (ev::timer &w, int revents); ev::timer pointer_ev; void pointer_blank (); #endif void pointer_unblank (); @@ -1273,11 +1269,19 @@ bool option (uint8_t opt) const NOTHROW { + if (!opt) + return 0; + + --opt; return options[opt >> 3] & (1 << (opt & 7)); } void set_option (uint8_t opt, bool set = true) NOTHROW { + if (!opt) + return; + + --opt; if (set) options[opt >> 3] |= (1 << (opt & 7)); else @@ -1406,5 +1410,5 @@ void extract_resources (); }; -#endif /* _RXVT_H_ */ +#endif /* _RXVT_H_ */