--- rxvt-unicode/src/rxvt.h 2004/08/17 02:18:38 1.102 +++ rxvt-unicode/src/rxvt.h 2004/08/25 03:52:09 1.121 @@ -125,7 +125,7 @@ /* If we're using either the rxvt scrollbar or menu bars, keep the * scrollColor resource. */ -#if defined(RXVT_SCROLLBAR) || defined(MENUBAR) +#if defined(RXVT_SCROLLBAR) || defined(MENUBAR) || defined(PLAIN_SCROLLBAR) # define KEEP_SCROLLCOLOR 1 #else # undef KEEP_SCROLLCOLOR @@ -185,7 +185,7 @@ # define COLORTERMENVFULL COLORTERMENV #endif #ifndef TERMENV -# define TERMENV "rxvt" +# define TERMENV "rxvt-unicode" #endif #if defined (NO_MOUSE_REPORT) && !defined (NO_MOUSE_REPORT_SCROLLBAR) @@ -352,20 +352,36 @@ #define RS_None 0 /* Normal */ -#define RS_fgMask 0x000001FFUL /* 512 colors */ -#define RS_bgMask 0x0003FE00UL /* 512 colors */ -#define RS_Bold 0x00040000UL /* bold */ -#define RS_Italic 0x00080000UL -#define RS_Blink 0x00100000UL /* blink */ -#define RS_RVid 0x00200000UL /* reverse video */ -#define RS_Uline 0x00400000UL /* underline */ - -#define RS_fontCount 512 -#define RS_fontMask 0xff800000UL /* plenty(?) of fonts */ -#define RS_fontShift 23 +#define RS_fgMask 0x0000007fUL /* 128 colors */ +#define RS_bgMask 0x00003f80UL /* 128 colors */ -#define RS_baseattrMask (RS_Bold|RS_Blink|RS_RVid|RS_Uline) -#define RS_attrMask (RS_baseattrMask|RS_fontMask) +// font styles +#define RS_Bold 0x00004000UL // value 1 +#define RS_Italic 0x00008000UL // value 2 + +// fake styles +#define RS_Blink 0x00010000UL /* blink */ +#define RS_RVid 0x00020000UL /* reverse video */ +#define RS_Uline 0x00040000UL /* underline */ + +// 5 bits still to go + +// other flags +#define RS_Careful 0x80000000UL /* be careful when drawing these */ + +#define RS_styleCount 4 +#define RS_styleMask (RS_Bold | RS_Italic) +#define RS_styleShift 14 + +#define RS_baseattrMask (RS_Italic | RS_Bold | RS_Blink | RS_RVid | RS_Uline) +#define RS_attrMask (RS_baseattrMask | RS_fontMask) + +#define RS_fontCount 127 // not 127 or 256, see rxvtfont.h +#define RS_fontMask 0xff000000UL // plenty(?) of fonts, includes RS_Careful +#define RS_fontShift 24 + +#define DEFAULT_RSTYLE (RS_None | Color_fg | (Color_bg << Color_Bits)) +#define OVERLAY_RSTYLE (RS_None | Color_Black | (Color_Yellow << Color_Bits)) #define Sel_none 0 /* Not waiting */ #define Sel_normal 0x01 /* normal selection */ @@ -421,8 +437,14 @@ XTerm_restoreBG = 49, // change default bg color XTerm_dumpscreen = 55, // dump scrollback and all of screen XTerm_locale = 701, // change locale - XTerm_findfont = 702, // find font of given character (in decimal) XTerm_Menu = 703, // set menu item + XTerm_Color_IT = 704, // change actual 'Italic' colour + XTerm_Color_tint = 705, // change actual tint colour + + URxvt_font = 710, + URxvt_boldFont = 711, + URxvt_italicFont = 712, + URxvt_boldItalicFont = 713, }; /* Words starting with `Color_' are colours. Others are counts */ @@ -461,10 +483,8 @@ #else Color_White = maxCOLOR, #endif -#ifdef TTY_256COLOR - min256COLOR = Color_White + 1, - max256COLOR = minCOLOR + 255, -#endif + minTermCOLOR = Color_White + 1, + maxTermCOLOR = Color_White + 72, #ifndef NO_CURSORCOLOR Color_cursor, Color_cursor2, @@ -474,6 +494,7 @@ Color_border, #ifndef NO_BOLD_UNDERLINE_REVERSE Color_BD, + Color_IT, Color_UL, Color_RV, #endif @@ -491,18 +512,17 @@ #ifdef KEEP_SCROLLCOLOR Color_topShadow = NRS_COLORS, Color_bottomShadow, - TOTAL_COLORS /* upto 30 */ + TOTAL_COLORS #else - TOTAL_COLORS = NRS_COLORS /* */ + TOTAL_COLORS = NRS_COLORS #endif }; -#define Color_Bits 9 +#define Color_Bits 7 // 0 .. maxTermCOLOR + #define NPIXCLR_SETS ((TOTAL_COLORS + 31) / 32) #define NPIXCLR_BITS 32 -#define DEFAULT_RSTYLE (RS_None | (Color_fg) | (Color_bg<> RS_fontShift) -#define SET_FONT(x,fid) ((x) & ~RS_fontMask) | ((fid) << RS_fontShift) +#define SET_FONT(x,fid) (((x) & ~RS_fontMask) | ((fid) << RS_fontShift)) + +#define GET_STYLE(x) (((x) & RS_styleMask) >> RS_styleShift) +#define SET_STYLE(x,style) (((x) & ~RS_styleMask) | ((style) << RS_styleShift)) #define GET_ATTR(x) (((x) & RS_attrMask)) #define GET_BGATTR(x) \ (((x) & RS_RVid) ? (((x) & (RS_attrMask & ~RS_RVid)) \ | (((x) & RS_fgMask)<