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.392 by root, Thu Apr 1 00:13:04 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// GET_BGATTR depends on RS_fgShift > RS_bgShift
311#define RS_colorMask ((1UL << Color_Bits) - 1UL) 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 0x08000000UL // value 1 332#define RS_Bold (1UL << RS_styleShift)
319#define RS_Italic 0x10000000UL // 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 0x20000000UL // blink 340#define RS_Blink (1UL << 29)
323#define RS_RVid 0x40000000UL // reverse video 341#define RS_RVid (1UL << 30) // reverse video
324#define RS_Uline 0x80000000UL // underline 342#define RS_Uline (1UL << 31) // underline
325
326// 5 custom bits for extensions
327#define RS_customCount 16
328#define RS_customMask 0x07800000UL
329#define RS_customShift 23
330
331// must have space for rxvt_fontset::fontCount * 2 + 2 values
332#define RS_fontMask 0x007c0000UL // includes RS_Careful
333#define RS_fontShift 18
334#define RS_Careful 0x00010000UL /* be careful when drawing these */
335
336// toggle this to force redraw, must be != RS_Careful and otherwise "pretty neutral"
337#define RS_redraw 0x00020000UL
338
339#define RS_styleCount 4
340#define RS_styleMask (RS_Bold | RS_Italic)
341#define RS_styleShift 27
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))
637 638
638#define GET_STYLE(x) (((x) & RS_styleMask) >> RS_styleShift) 639#define GET_STYLE(x) (((x) & RS_styleMask) >> RS_styleShift)
639#define SET_STYLE(x,style) (((x) & ~RS_styleMask) | ((style) << RS_styleShift)) 640#define SET_STYLE(x,style) (((x) & ~RS_styleMask) | ((style) << RS_styleShift))
640 641
641#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
642#define GET_BGATTR(x) \ 645#define GET_BGATTR(x) \
646 (expect_false ((x) & RS_RVid) \
643 (((x) & RS_RVid) ? (((x) & (RS_attrMask & ~RS_RVid)) \ 647 ? (((x) & (RS_attrMask & ~RS_RVid)) \
644 | (((x) & RS_colorMask) << RS_bgShift)) \ 648 | (((x) & RS_fgMask) >> (RS_fgShift - RS_bgShift))) \
645 : ((x) & (RS_attrMask | RS_bgMask))) 649 : ((x) & (RS_attrMask | RS_bgMask)))
646#define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | ((fg) << RS_fgShift)) 650#define SET_FGCOLOR(x,fg) (((x) & ~RS_fgMask) | ((fg) << RS_fgShift))
647#define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg) << RS_bgShift)) 651#define SET_BGCOLOR(x,bg) (((x) & ~RS_bgMask) | ((bg) << RS_bgShift))
648#define SET_ATTR(x,a) (((x) & ~RS_attrMask) | (a)) 652#define SET_ATTR(x,a) (((x) & ~RS_attrMask) | (a))
649 653
650#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