--- rxvt-unicode/src/rxvt.h 2004/01/31 02:14:58 1.28 +++ rxvt-unicode/src/rxvt.h 2004/02/11 08:13:45 1.33 @@ -184,7 +184,7 @@ #define scrollBar_esc 30 #define menuBar_margin 2 /* margin below text */ -#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) +#if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) || defined(PLAIN_SCROLLBAR) # define HAVE_SCROLLBARS #endif @@ -202,9 +202,11 @@ #define R_SB_RXVT 0 #define R_SB_NEXT 1 #define R_SB_XTERM 2 +#define R_SB_PLAIN 4 #define SB_WIDTH_NEXT 19 -#define SB_WIDTH_XTERM 7 +#define SB_WIDTH_XTERM 15 +#define SB_WIDTH_PLAIN 7 #ifndef SB_WIDTH_RXVT # define SB_WIDTH_RXVT 10 #endif @@ -545,7 +547,7 @@ NUM_RESOURCES }; -// see init.C:xa_named, which must be kept in sync +// see init.C:xa_names, which must be kept in sync enum { XA_TEXT = 0, XA_COMPOUND_TEXT, @@ -606,9 +608,9 @@ (PrivMode_Autowrap|PrivMode_aplKP|PrivMode_ShiftKeys|PrivMode_VisibleCursor) #endif -#define XDEPTH Xdepth -#define XCMAP Xcmap -#define XVISUAL Xvisual +#define XDEPTH display->depth +#define XCMAP display->cmap +#define XVISUAL display->visual #define IMBUFSIZ 128 /* input modifier buffer sizes */ #ifndef BUFSIZ @@ -650,8 +652,6 @@ #define TermWin_TotalWidth() ((int32_t)TermWin.width + 2 * (int32_t)TermWin.int_bwidth) #define TermWin_TotalHeight() ((int32_t)TermWin.height + 2 * (int32_t)TermWin.int_bwidth) -#define Xroot DefaultRootWindow(Xdisplay) - /* how to build & extract colors and attributes */ #define GET_BASEFG(x) (((x) & RS_fgMask)) #define GET_BASEBG(x) (((x) & RS_bgMask)>>Color_Bits) @@ -950,6 +950,9 @@ GC xscrollbarGC, ShadowGC; #endif +#ifdef PLAIN_SCROLLBAR + GC pscrollbarGC; +#endif #ifdef NEXT_SCROLLBAR GC blackGC, whiteGC, @@ -991,6 +994,7 @@ KeySym ks_greekmodeswith; #endif #ifdef USE_XIM + rxvt_xim *input_method; XIC Input_Context; XIMStyle input_style; int event_type; @@ -1070,11 +1074,23 @@ void flush (); + void rootwin_cb (XEvent &xev); + xevent_watcher rootwin_ev; + + void x_cb (XEvent &xev); + xevent_watcher termwin_ev; + xevent_watcher vt_ev; +#ifdef HAVE_SCROLLBARS + xevent_watcher scrollbar_ev; +#endif +#ifdef MENUBAR + xevent_watcher menubar_ev; +#endif + void check_cb (check_watcher &w); check_watcher check_ev; void destroy_cb (time_watcher &w); time_watcher destroy_ev; void pty_cb (io_watcher &w, short revents); io_watcher pty_ev; - void x_cb (io_watcher &w, short revents); io_watcher x_ev; void incr_cb (time_watcher &w); time_watcher incr_ev; @@ -1106,7 +1122,6 @@ uint32_t next_char (); bool pty_fill (); - void process_x_events (); void *operator new (size_t s); void operator delete (void *p, size_t s); @@ -1125,12 +1140,19 @@ void create_windows (int argc, const char *const *argv); void resize_all_windows (unsigned int width, unsigned int height, int ignoreparent); void window_calc (unsigned int width, unsigned int height); - void set_preedit_area (XRectangle * preedit_rect, XRectangle * status_rect, XRectangle * needed_rect); #if USE_XIM - void set_size (XRectangle *size); - void set_position (XPoint *pos); - void set_color (unsigned long *fg, unsigned long *bg); + void im_destroy (); + void im_cb (); im_watcher im_ev; + void im_set_size (XRectangle *size); + void im_set_position (XPoint *pos); + void im_set_color (unsigned long *fg, unsigned long *bg); + void im_set_preedit_area (XRectangle * preedit_rect, XRectangle * status_rect, XRectangle * needed_rect); + + bool IMisRunning (); + void IMSendSpot (); + bool IM_get_IC (const char *modifiers); + void IMSetStatusPosition (); #endif void resize_scrollbar (); @@ -1158,13 +1180,12 @@ /* autoconvert */ // command.C - void lookup_key (XKeyEvent *ev); + void lookup_key (XKeyEvent &ev); unsigned int cmd_write (const unsigned char *str, unsigned int count); uint32_t cmd_getc (); - void mouse_report (const XButtonEvent *ev); - void process_x_event (XEvent *ev); - void button_press (XButtonEvent *ev); - void button_release (XButtonEvent *ev); + void mouse_report (const XButtonEvent &ev); + void button_press (const XButtonEvent &ev); + void button_release (const XButtonEvent &ev); int check_our_parents (); #ifdef PRINTPIPE FILE * popen_printer (); @@ -1202,10 +1223,6 @@ void set_colorfgbg (); int rXParseAllocColor (rxvt_color * screen_in_out, const char *colour); void set_widthheight (unsigned int width, unsigned int height); - bool IMisRunning (); - void IMSendSpot (); - bool IM_get_IC (); - void IMSetStatusPosition (); #ifdef MENUBAR // menubar.C @@ -1286,7 +1303,7 @@ void selection_delimit_word (enum page_dirn dirn, const row_col_t *mark, row_col_t *ret); void selection_extend_colrow (int32_t col, int32_t row, int button3, int buttonpress, int clickchange); void selection_remove_trailing_spaces (); - void selection_send (const XSelectionRequestEvent *rq); + void selection_send (const XSelectionRequestEvent &rq); #if defined(NEXT_SCROLLBAR) // scrollbar-next.C @@ -1307,6 +1324,11 @@ int scrollbar_show_xterm (int update, int last_top, int last_bot, int scrollbar_len); #endif +#if defined(PLAIN_SCROLLBAR) + // scrollbar-plain.C + int scrollbar_show_plain (int update, int last_top, int last_bot, int scrollbar_len); +#endif + // scrollbar.C int scrollbar_mapping (int map); int scrollbar_show (int update);