--- rxvt-unicode/src/rxvt.h 2010/04/01 16:34:41 1.399 +++ rxvt-unicode/src/rxvt.h 2010/12/07 19:05:35 1.420 @@ -249,11 +249,11 @@ # define COLORTERMENVFULL COLORTERMENV #endif #ifndef TERMENV -# ifdef USE_256_COLORS +# if USE_256_COLORS # define TERMENV "rxvt-unicode-256color" # else # define TERMENV "rxvt-unicode" -#endif +# endif #endif #if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR) @@ -325,12 +325,15 @@ // must have space for rxvt_fontset::fontCount * 2 + 2 values #define RS_fontShift (RS_fgShift + Color_Bits) #define RS_Careful (1UL << RS_fontShift) /* be careful when drawing these */ -#define RS_fontMask ((rxvt_fontset::fontCount << (RS_fontShift + 1)) | RS_Careful) // includes RS_Careful +#define RS_fontCount rxvt_fontset::fontCount +#define RS_fontMask ((RS_fontCount << (RS_fontShift + 1)) | RS_Careful) // includes RS_Careful // toggle this to force redraw, must be != RS_Careful and otherwise "pretty neutral" #define RS_redraw (2UL << RS_fontShift) -// 5 custom bits for extensions +#define RS_Sel (1UL << 22) + +// 4 custom bits for extensions #define RS_customCount 16UL #define RS_customShift 23 #define RS_customMask ((RS_customCount - 1UL) << RS_customShift) @@ -391,7 +394,8 @@ XTerm_Color_pointer_bg = 14, // change actual 'Pointer' bg color XTerm_Color05 = 15, // not implemented (tektronix fg) XTerm_Color06 = 16, // not implemented (tektronix bg) - XTerm_Color_RV = 17, // change actual 'Highlight' color + XTerm_Color_HC = 17, // change actual 'Highlight' bg color + XTerm_Color_HTC = 19, // change actual 'Highlight' fg color XTerm_logfile = 46, // not implemented XTerm_font = 50, @@ -403,8 +407,6 @@ */ // deprecated - Rxvt_Color_BD = 18, - Rxvt_Color_UL = 19, Rxvt_restoreFG = 39, Rxvt_restoreBG = 49, @@ -468,10 +470,10 @@ Color_White = maxCOLOR, #endif minTermCOLOR = Color_White + 1, -#ifndef USE_256_COLORS - maxTermCOLOR = Color_White + 72, -#else +#if USE_256_COLORS maxTermCOLOR = Color_White + 240, +#else + maxTermCOLOR = Color_White + 72, #endif #ifndef NO_CURSORCOLOR Color_cursor, @@ -491,6 +493,7 @@ #endif #ifdef OPTION_HC Color_HC, + Color_HTC, #endif Color_scroll, #ifdef RXVT_SCROLLBAR @@ -512,10 +515,10 @@ #endif }; -#ifndef USE_256_COLORS -#define Color_Bits 7 // 0 .. maxTermCOLOR +#if USE_256_COLORS +# define Color_Bits 9 // 0 .. maxTermCOLOR #else -#define Color_Bits 9 // 0 .. maxTermCOLOR +# define Color_Bits 7 // 0 .. maxTermCOLOR #endif /* @@ -554,6 +557,8 @@ #define PrivMode_MouseBtnEvent (1UL<<20) #define PrivMode_MouseAnyEvent (1UL<<21) #define PrivMode_BracketPaste (1UL<<22) +#define PrivMode_ExtModeMouse (1UL<<23) // xterm pseudo-utf-8 hack +#define PrivMode_ExtMouseRight (1UL<<24) // xterm pseudo-utf-8, but works in non-utf-8-locales #define PrivMode_mouse_report (PrivMode_MouseX10|PrivMode_MouseX11|PrivMode_MouseBtnEvent|PrivMode_MouseAnyEvent) @@ -614,6 +619,8 @@ * MACRO DEFINES ***************************************************************************** */ + +// speed hack, copy some member variable into a local variable of the same name #define dLocal(type,name) type const name = this->name // for speed reasons, we assume that all codepoints 32 to 126 are @@ -804,7 +811,7 @@ text_t **text; rend_t **rend; - // while tempting to add swap() etc. here, it effetcively only increases code size + // while tempting to add swap() etc. here, it effectively only increases code size }; /* ------------------------------------------------------------------------- */ @@ -946,12 +953,13 @@ /* rxvt_vars.options */ enum { -# define def(name,idx) Opt_ ## name = idx, -# define nodef(name) Opt_ ## name = 0, +# define def(name) Opt_ ## name, +# define nodef(name) Opt_prev_ ## name, Opt_ ## name = 0, Opt_next_ ## name = Opt_prev_ ## name - 1, + Opt_0, # include "optinc.h" # undef nodef # undef def -Opt_count + Opt_count }; /* ------------------------------------------------------------------------- */ @@ -963,7 +971,6 @@ XSizeHints szHint; rxvt_color *pix_colors; Cursor TermWin_cursor; /* cursor for vt window */ - int numlock_state; line_t *row_buf; // all lines, scrollback + terminal, circular, followed by temp_buf line_t *drawn_buf; // text on screen line_t *swap_buf; // lines for swap buffer @@ -1072,7 +1079,7 @@ /* ---------- */ struct mouse_event MEvent; XComposeStatus compose; - struct termios tio; + static struct termios def_tio; row_col_t oldcursor; #ifdef HAVE_BG_PIXMAP bgPixmap_t bgPixmap; @@ -1156,10 +1163,6 @@ #endif #ifdef HAVE_BG_PIXMAP void update_background (); -#if TRACE_PIXMAPS - void 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 @@ -1295,6 +1298,7 @@ void create_windows (int argc, const char *const *argv); void get_colours (); void get_ourmods (); + void set_icon (const char *file); // main.C void tt_winch (); rxvt_term (); @@ -1306,6 +1310,7 @@ void window_calc (unsigned int newwidth, unsigned int newheight); bool set_fonts (); void set_string_property (Atom prop, const char *str, int len = -1); + void set_mbstring_property (Atom prop, const char *str, int len = -1); void set_utf8_property (Atom prop, const char *str, int len = -1); void set_title (const char *str); void set_icon_name (const char *str); @@ -1377,10 +1382,6 @@ bool option (uint8_t opt) const NOTHROW { - if (!opt) - return 0; - - --opt; return options[opt >> 3] & (1 << (opt & 7)); } @@ -1389,11 +1390,10 @@ if (!opt) return; - --opt; - if (set) - options[opt >> 3] |= (1 << (opt & 7)); - else - options[opt >> 3] &= ~(1 << (opt & 7)); + uint8_t mask = 1 << (opt & 7); + uint8_t &val = options [opt >> 3]; + + val = val & ~mask | (set ? 0 : mask); } void set_privmode (unsigned bit, int set) NOTHROW @@ -1405,6 +1405,7 @@ } // modifies first argument(!) + void tt_paste (char *data, unsigned int len) NOTHROW; void paste (char *data, unsigned int len) NOTHROW; void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW; void scr_blank_screen_mem (line_t &l, rend_t efs) const NOTHROW; @@ -1473,7 +1474,6 @@ void selection_request (Time tm, int selnum = Sel_Primary) NOTHROW; int selection_request_other (Atom target, int selnum) NOTHROW; void selection_clear (bool clipboard = false) NOTHROW; - void clipboard_copy (Time tm); void selection_make (Time tm); bool selection_grab (Time tm, bool clipboard = false) NOTHROW; void selection_start_colrow (int col, int row) NOTHROW;