ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvt.h
(Generate patch)

Comparing rxvt-unicode/src/rxvt.h (file contents):
Revision 1.387 by root, Wed Mar 31 23:19:06 2010 UTC vs.
Revision 1.397 by root, Thu Apr 1 01:01:44 2010 UTC

306 SECONDARY, 306 SECONDARY,
307}; 307};
308 308
309#define RS_None 0 309#define RS_None 0
310 310
311#define RS_colorMask 0x0000007fUL // 128 colors 311// GET_BGATTR depends on RS_fgShift > RS_bgShift
312#define RS_colorMask ((1UL << Color_Bits) - 1UL)
312#define RS_fgShift 0 313#define RS_bgShift 0
313#define RS_bgShift Color_Bits 314#define RS_fgShift (RS_bgShift + Color_Bits)
315#define RS_bgMask (RS_colorMask << RS_bgShift)
314#define RS_fgMask (RS_colorMask << RS_fgShift) 316#define RS_fgMask (RS_colorMask << RS_fgShift)
315#define RS_bgMask (RS_colorMask << RS_bgShift) 317
318// must have space for rxvt_fontset::fontCount * 2 + 2 values
319#define RS_fontShift (RS_fgShift + Color_Bits)
320#define RS_Careful (1UL << RS_fontShift) /* be careful when drawing these */
321#define RS_fontMask ((rxvt_fontset::fontCount << (RS_fontShift + 1)) | RS_Careful) // includes RS_Careful
322
323// toggle this to force redraw, must be != RS_Careful and otherwise "pretty neutral"
324#define RS_redraw (2UL << RS_fontShift)
325
326// 5 custom bits for extensions
327#define RS_customCount 16UL
328#define RS_customShift 23
329#define RS_customMask ((RS_customCount - 1UL) << RS_customShift)
316 330
317// font styles 331// font styles
318#define RS_Bold 0x00004000UL // value 1 332#define RS_Bold (1UL << RS_styleShift)
319#define RS_Italic 0x00008000UL // value 2 333#define RS_Italic (2UL << RS_styleShift)
334
335#define RS_styleCount 4
336#define RS_styleShift 27
337#define RS_styleMask (RS_Bold | RS_Italic)
320 338
321// fake styles 339// fake styles
322#define RS_Blink 0x00010000UL // blink 340#define RS_Blink (1UL << 29)
323#define RS_RVid 0x00020000UL // reverse video 341#define RS_RVid (1UL << 30) // reverse video
324#define RS_Uline 0x00040000UL // underline 342#define RS_Uline (1UL << 31) // underline
325
326// 5 custom bits for extensions
327#define RS_customCount 16
328#define RS_customMask 0x00780000UL
329#define RS_customShift 19
330
331// must have space for rxvt_fontset::fontCount * 2 + 2 values
332#define RS_fontMask 0xf8000000UL // includes RS_Careful
333#define RS_fontShift 27
334#define RS_Careful 0x08000000UL /* be careful when drawing these */
335
336// toggle this to force redraw, must be != RS_Careful and otherwise "pretty neutral"
337#define RS_redraw 0x02000000UL
338
339#define RS_styleCount 4
340#define RS_styleMask (RS_Bold | RS_Italic)
341#define RS_styleShift 14
342 343
343#define RS_baseattrMask (RS_Italic | RS_Bold | RS_Blink | RS_RVid | RS_Uline) 344#define RS_baseattrMask (RS_Italic | RS_Bold | RS_Blink | RS_RVid | RS_Uline)
344#define RS_attrMask (RS_baseattrMask | RS_fontMask) 345#define RS_attrMask (RS_baseattrMask | RS_fontMask)
345 346
346#define DEFAULT_RSTYLE (RS_None | (Color_fg << RS_fgShift) | (Color_bg << RS_bgShift)) 347#define DEFAULT_RSTYLE (RS_None | (Color_fg << RS_fgShift) | (Color_bg << RS_bgShift))
458 Color_White = maxBrightCOLOR, 459 Color_White = maxBrightCOLOR,
459#else 460#else
460 Color_White = maxCOLOR, 461 Color_White = maxCOLOR,
461#endif 462#endif
462 minTermCOLOR = Color_White + 1, 463 minTermCOLOR = Color_White + 1,
464#ifndef USE_256_COLORS
463 maxTermCOLOR = Color_White + 72, 465 maxTermCOLOR = Color_White + 72,
466#else
467 maxTermCOLOR = Color_White + 240,
468#endif
464#ifndef NO_CURSORCOLOR 469#ifndef NO_CURSORCOLOR
465 Color_cursor, 470 Color_cursor,
466 Color_cursor2, 471 Color_cursor2,
467#endif 472#endif
468 Color_pointer_fg, 473 Color_pointer_fg,
498#else 503#else
499 TOTAL_COLORS = NRS_COLORS 504 TOTAL_COLORS = NRS_COLORS
500#endif 505#endif
501}; 506};
502 507
508#ifndef USE_256_COLORS
503#define Color_Bits 7 // 0 .. maxTermCOLOR 509#define Color_Bits 7 // 0 .. maxTermCOLOR
510#else
511#define Color_Bits 9 // 0 .. maxTermCOLOR
512#endif
504 513
505/* 514/*
506 * Resource list 515 * Resource list
507 */ 516 */
508enum { 517enum {
629 638
630#define GET_STYLE(x) (((x) & RS_styleMask) >> RS_styleShift) 639#define GET_STYLE(x) (((x) & RS_styleMask) >> RS_styleShift)
631#define SET_STYLE(x,style) (((x) & ~RS_styleMask) | ((style) << RS_styleShift)) 640#define SET_STYLE(x,style) (((x) & ~RS_styleMask) | ((style) << RS_styleShift))
632 641
633#define GET_ATTR(x) (((x) & RS_attrMask)) 642#define GET_ATTR(x) (((x) & RS_attrMask))
643// return attributes defining the background, encoding doesn't matter
644// depends on RS_fgShift > RS_bgShift
634#define GET_BGATTR(x) \ 645#define GET_BGATTR(x) \
646 (expect_false ((x) & RS_RVid) \
635 (((x) & RS_RVid) ? (((x) & (RS_attrMask & ~RS_RVid)) \ 647 ? (((x) & (RS_attrMask & ~RS_RVid)) \
636 | (((x) & RS_colorMask) << RS_bgShift)) \ 648 | (((x) & RS_fgMask) >> (RS_fgShift - RS_bgShift))) \
637 : ((x) & (RS_attrMask | RS_bgMask))) 649 : ((x) & (RS_attrMask | RS_bgMask)))
638#define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | ((fg) << RS_fgShift)) 650#define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | ((fg) << RS_fgShift))
639#define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg) << RS_bgShift)) 651#define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg) << RS_bgShift))
640#define SET_ATTR(x,a) (((x) & ~RS_attrMask) | (a)) 652#define SET_ATTR(x,a) (((x) & ~RS_attrMask) | (a))
641 653
642#define RS_SAME(a,b) (!(((a) ^ (b)) & ~RS_Careful)) 654#define RS_SAME(a,b) (!(((a) ^ (b)) & ~RS_Careful))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines