*** empty log message ***
authorroot <root>
Sat, 31 Dec 2005 16:40:28 +0000 (16:40 +0000)
committerroot <root>
Sat, 31 Dec 2005 16:40:28 +0000 (16:40 +0000)
src/command.C
src/rxvt.h
src/rxvtlib.h.in
src/screen.C

index ba1ece3a3b4838cf0a91187a8f476dcbd800f84b..4a7af1078bc565b4a3b464fa13011e6f3b5913a7 100644 (file)
@@ -191,7 +191,7 @@ rxvt_term::iso14755_51 (unicode_t ch, rend_t r, int x, int y)
 
   sprintf (attr, "%08x = fg %d bg %d%s%s%s%s%s%s",
            (int)r,
-           GET_FGCOLOR (r), GET_BGCOLOR (r),
+           fgcolor_of (r), bgcolor_of (r),
            r & RS_Bold    ? " bold"    : "",
            r & RS_Italic  ? " italic"  : "",
            r & RS_Blink   ? " blink"   : "",
index 432da3b385b6d1089ef819575f7fdb293051aeff..dfd106341753accbc114cdcd2d49b5232bbebd1d 100644 (file)
@@ -829,23 +829,6 @@ enum {
 /* how to build & extract colors and attributes */
 #define GET_BASEFG(x)           (((x) & RS_fgMask))
 #define GET_BASEBG(x)           (((x) & RS_bgMask)>>Color_Bits)
-#ifndef NO_BRIGHTCOLOR
-# define GET_FGCOLOR(x) (                                        \
-     !((x) & RS_Bold)                                            \
-     || (ENABLE_STYLES && !(options & Opt_intensityStyles))      \
-     || !IN_RANGE_INC (GET_BASEFG (x), minCOLOR, minBrightCOLOR) \
-       ? GET_BASEFG (x)                                          \
-       : (GET_BASEFG (x) + (minBrightCOLOR - minCOLOR)))
-# define GET_BGCOLOR(x) (                                        \
-     !((x) & RS_Blink)                                           \
-     || (ENABLE_STYLES && !(options & Opt_intensityStyles))      \
-     || !IN_RANGE_INC (GET_BASEBG (x), minCOLOR, minBrightCOLOR) \
-       ? GET_BASEBG (x)                                          \
-       : (GET_BASEBG (x) + (minBrightCOLOR - minCOLOR)))
-#else
-# define GET_FGCOLOR(x)         GET_BASEFG(x)
-# define GET_BGCOLOR(x)         GET_BASEBG(x)
-#endif
 
 #define GET_FONT(x)             (((x) & RS_fontMask) >> RS_fontShift)
 #define SET_FONT(x,fid)         (((x) & ~RS_fontMask) | ((fid) << RS_fontShift))
@@ -1497,6 +1480,30 @@ struct rxvt_term : zero_initialized, rxvt_vars {
       scr_blank_line (l, prev_ncol, ncol - prev_ncol, DEFAULT_RSTYLE);
   }
 
+  int fgcolor_of (rend_t r)
+  {
+    int base = GET_BASEFG (r);
+#ifndef NO_BRIGHTCOLOR
+    if (r & RS_Bold
+        && (!ENABLE_STYLES || options & Opt_intensityStyles)
+        && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
+      base += minBrightCOLOR - minCOLOR;
+#endif
+    return base;
+  }
+
+  int bgcolor_of (rend_t r)
+  {
+    int base = GET_BASEBG (r);
+#ifndef NO_BRIGHTCOLOR
+    if (r & RS_Blink
+        && (!ENABLE_STYLES || options & Opt_intensityStyles)
+        && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
+      base += minBrightCOLOR - minCOLOR;
+#endif
+    return base;
+  }
+
   void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs);
   void scr_blank_screen_mem (line_t &l, rend_t efs);
   int scr_scroll_text (int row1, int row2, int count);
index d395b59de6c8b28f3ada049fceaab6b49d5205cc..d5cb975bd1f2e02b759111201d4c99fe372f7492 100644 (file)
@@ -270,6 +270,7 @@ typedef struct {
 #define Opt_Reverse              (1UL<<30)
 #define Opt_Boolean              (1UL<<31)
 
+#define OPTION(opt)              (options && (opt))
 #define DEFAULT_OPTIONS          (Opt_scrollBar | Opt_scrollTtyOutput \
                                   | Opt_jumpScroll | Opt_secondaryScreen \
                                   | Opt_pastableTabs | Opt_intensityStyles)
index e876b2fea41dae3c6b348194f2de37c07541a2af..5b2d93dda84d7a61a3035a0471c96fbc7288dcf1 100644 (file)
@@ -1286,7 +1286,7 @@ rxvt_term::scr_erase_screen (int mode)
   else
     {
       ren = rstyle & (RS_fgMask | RS_bgMask);
-      gcvalue.foreground = pix_colors[GET_BGCOLOR (rstyle)];
+      gcvalue.foreground = pix_colors[bgcolor_of (rstyle)];
       XChangeGC (display->display, gc, GCForeground, &gcvalue);
       ERASE_ROWS (row, num);
       gcvalue.foreground = pix_colors[Color_fg];
@@ -1990,7 +1990,7 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
                   ccol1 = Color_cursor;
                 else
 #ifdef CURSOR_COLOR_IS_RENDITION_COLOR
-                  ccol1 = GET_FGCOLOR (rstyle);
+                  ccol1 = fgcolor_of (rstyle);
 #else
                   ccol1 = Color_fg;
 #endif
@@ -1998,7 +1998,7 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
                   ccol2 = Color_cursor2;
                 else
 #ifdef CURSOR_COLOR_IS_RENDITION_COLOR
-                  ccol2 = GET_BGCOLOR (rstyle);
+                  ccol2 = bgcolor_of (rstyle);
 #else
                   ccol2 = Color_bg;
 #endif
@@ -2189,8 +2189,8 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
           /*
            * Determine the attributes for the string
            */
-          int fore = GET_FGCOLOR (rend); // desired foreground
-          int back = GET_BGCOLOR (rend); // desired background
+          int fore = fgcolor_of (rend); // desired foreground
+          int back = bgcolor_of (rend); // desired background
 
           // only do special processing if any attributes are set, which is unlikely
           if (rend & (RS_Bold | RS_Italic | RS_Uline | RS_RVid | RS_Blink | RS_Careful))