*** empty log message ***
authorroot <root>
Sun, 8 Jan 2006 01:02:15 +0000 (01:02 +0000)
committerroot <root>
Sun, 8 Jan 2006 01:02:15 +0000 (01:02 +0000)
src/command.C
src/init.C
src/rxvt.h
src/rxvtfont.C
src/rxvtlib.h.in
src/xdefaults.C

index 7ee1f060b69982dbae08de5dca29fd323f09a760..f15a9b3a14138220ed164fdc146731cdd12b61ec 100644 (file)
@@ -4157,10 +4157,7 @@ rxvt_term::process_terminal_mode (int mode, int priv __attribute__ ((unused)), u
         {
 #if ENABLE_STYLES
           case 1021:
-            if (mode)
-              SET_OPTION (Opt_intensityStyles);
-            else
-              CLR_OPTION (Opt_intensityStyles);
+            set_option (Opt_intensityStyles, mode);
 
             scr_touch (true);
             break;
@@ -4192,10 +4189,7 @@ rxvt_term::process_terminal_mode (int mode, int priv __attribute__ ((unused)), u
                 set_widthheight (((state ? 132 : 80) * fwidth), height);
               break;
             case 4:                    /* smooth scrolling */
-              if (!state)
-                SET_OPTION (Opt_jumpScroll);
-              else
-                CLR_OPTION (Opt_jumpScroll);
+              set_option (Opt_jumpScroll, !state);
               break;
             case 5:                    /* reverse video */
               scr_rvideo_mode (state);
@@ -4246,16 +4240,10 @@ rxvt_term::process_terminal_mode (int mode, int priv __attribute__ ((unused)), u
               break;           /* X11 mouse highlighting */
 #endif
             case 1010:         /* scroll to bottom on TTY output inhibit */
-              if (!state)
-                SET_OPTION (Opt_scrollTtyOutput);
-              else
-                CLR_OPTION (Opt_scrollTtyOutput);
+              set_option (Opt_scrollTtyOutput, !state);
               break;
             case 1011:         /* scroll to bottom on key press */
-              if (state)
-                SET_OPTION (Opt_scrollTtyKeypress);
-              else
-                CLR_OPTION (Opt_scrollTtyKeypress);
+              set_option (Opt_scrollTtyKeypress, state);
               break;
             case 1047:         /* secondary screen w/ clearing last */
               if (OPTION (Opt_secondaryScreen))
index 7914658019e7aff5b1a4e203c0371addba348201..b4bf4dbc6ca506a112c9d62de355e03a0c07cd8b 100644 (file)
@@ -393,7 +393,7 @@ rxvt_term::init_resources (int argc, const char *const *argv)
 
   /* no point having a scrollbar without having any scrollback! */
   if (!saveLines)
-    CLR_OPTION (Opt_scrollBar);
+    set_option (Opt_scrollBar, 0);
 
 #ifdef PRINTPIPE
   if (!rs[Rs_print_pipe])
index 6348feaeda89b8a91c717d7d368ba593db821be5..aca610f8f7c7d5350f2706df3ae019f5e234f758 100644 (file)
@@ -701,6 +701,11 @@ enum {
 #define Width2Pixel(n)          ((int32_t)(n) * (int32_t)fwidth)
 #define Height2Pixel(n)         ((int32_t)(n) * (int32_t)fheight)
 
+#define OPTION(opt)              (options & (opt))
+#define DEFAULT_OPTIONS          (Opt_scrollBar | Opt_scrollTtyOutput \
+                                  | Opt_jumpScroll | Opt_secondaryScreen \
+                                  | Opt_pastableTabs | Opt_intensityStyles)
+
 // for m >= -n, ensure remainder lies between 0..n-1
 #define MOD(m,n) (((m) + (n)) % (n))
 
@@ -1443,6 +1448,19 @@ struct rxvt_term : zero_initialized, rxvt_vars {
     return base;
   }
 
+  bool option (uint32_t opt)
+  {
+    return OPTION (opt);
+  }
+
+  void set_option (uint32_t opt, bool set)
+  {
+    if (set)
+      options |= opt;
+    else
+      options &= ~opt;
+  }
+
   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 fa58592c689ab51db1e31e456e9deb8683e8e9d6..00d1beb73a60fa5e7e5a8b0058211862128b4fe0 100644 (file)
@@ -310,7 +310,7 @@ struct rxvt_font_default : rxvt_font {
       return true;
 
     if (unicode >= 0x2500 && unicode <= 0x259f &&
-        ! OPTION_R (Opt_skipBuiltinGlyphs))
+        !r->option (Opt_skipBuiltinGlyphs))
       return true;
 
     if (IS_COMPOSE (unicode))
@@ -356,8 +356,7 @@ rxvt_font_default::draw (rxvt_drawable &d, int x, int y,
       int width = text - tp;
       int fwidth = r->fwidth * width;
 
-      if (0x2500 <= t && t <= 0x259f &&
-          ! OPTION_R (Opt_skipBuiltinGlyphs))
+      if (0x2500 <= t && t <= 0x259f)
         {
           uint16_t offs = linedraw_offs[t - 0x2500];
           uint32_t *a = linedraw_command + (offs >> 4);
index de34634794a650575c0b8e75414008cf641776ce..567674ac1156c0a71a20610b3a01d8b30a5c06a4 100644 (file)
@@ -214,14 +214,6 @@ enum {
 # undef def
 };
 
-#define SET_OPTION(opt)                 (options |= (opt))
-#define CLR_OPTION(opt)                 (options &= ~(opt))
-#define OPTION(opt)              (options & (opt))
-#define OPTION_R(opt)            (r->options & (opt))
-#define DEFAULT_OPTIONS          (Opt_scrollBar | Opt_scrollTtyOutput \
-                                  | Opt_jumpScroll | Opt_secondaryScreen \
-                                  | Opt_pastableTabs | Opt_intensityStyles)
-
 /* ------------------------------------------------------------------------- */
 
 typedef struct {
@@ -251,7 +243,7 @@ typedef struct {
 struct rxvt_vars : TermWin_t {
   scrollBar_t     scrollBar;
   menuBar_t       menuBar;
-  unsigned long   options;
+  uint32_t        options;
   XSizeHints      szHint;
   rxvt_display   *display;
   rxvt_color     *pix_colors;
index 1bff3d2a41bceb4a7b7bfd607e45ac75c99538ae..76e57bd8e0b3825072612a2a8a336da680e91561 100644 (file)
@@ -575,10 +575,7 @@ rxvt_term::get_options (int argc, const char *const *argv)
               fprintf (stderr, "boolean (%s,%s) = %s\n",
                       optList[entry].opt, optList[entry].kw, flag);
 #endif
-              if (flag == On)
-                SET_OPTION (optList[entry].flag & Optflag_mask);
-              else
-                CLR_OPTION (optList[entry].flag & Optflag_mask);
+              set_option (optList[entry].flag & Optflag_mask, flag == On);
 
               if (optList[entry].doff != -1)
                 rs[optList[entry].doff] = flag;
@@ -869,10 +866,7 @@ rxvt_term::get_xdefaults (FILE *stream, const char *name)
                         if (optList_isReverse (entry))
                           s = !s;
 
-                        if (s)
-                          SET_OPTION (optList[entry].flag & Optflag_mask);
-                        else
-                          CLR_OPTION (optList[entry].flag & Optflag_mask);
+                        set_option (optList[entry].flag & Optflag_mask, s);
                       }
                   }
 
@@ -1041,10 +1035,7 @@ rxvt_term::extract_resources ()
               if (optList_isReverse (entry))
                 s = !s;
 
-              if (s)
-                SET_OPTION (optList[entry].flag & Optflag_mask);
-              else
-                CLR_OPTION (optList[entry].flag & Optflag_mask);
+              set_option (optList[entry].flag & Optflag_mask, s);
             }
         }
     }