*** empty log message ***
authorroot <root>
Sat, 31 Dec 2005 17:16:17 +0000 (17:16 +0000)
committerroot <root>
Sat, 31 Dec 2005 17:16:17 +0000 (17:16 +0000)
15 files changed:
Changes
doc/rxvt.7.pod
src/command.C
src/init.C
src/logging.C
src/main.C
src/rxvt.h
src/rxvtlib.h.in
src/screen.C
src/scrollbar-plain.C
src/scrollbar-rxvt.C
src/scrollbar-xterm.C
src/scrollbar.C
src/xdefaults.C
src/xpm.C

diff --git a/Changes b/Changes
index 222771411e65fb98f461b7324e8498c3e3a0891c..1272ea5b1ad7329fcb06f638c759a42f49f95417 100644 (file)
--- a/Changes
+++ b/Changes
@@ -26,6 +26,7 @@ WISH: just for fun, do shade and tint with XRender.
        - replaced callback.h by a fixed version from gvpe that correctly
           returns the callback result (affects new -pty-fd semantics in urxvtc
           on a few architectures). Reported by darix.
+        - further minor cleanups.
 
 6.1  Tue Dec 27 13:23:40 CET 2005
        - update iso8859-7 table (euro and drachma round-trip et al.).
index 2a7ee6e8b9736d672b89065d6f5969c9e47ec284..ab1dbf075571fafed81077f3d63e7f1d8a6ff9aa 100644 (file)
@@ -1535,6 +1535,15 @@ X<Priv66>
 
 =end table
 
+=item B<< C<Ps = 1021> >> (B<rxvt>)
+
+=begin table
+
+       B<< C<h> >>     Bold/italic implies high intensity (see option B<-is>)
+       B<< C<l> >>     Font styles have no effect on intensity.
+
+=end table
+
 =item B<< C<Ps = 1047> >>
 
 =begin table
index 4a7af1078bc565b4a3b464fa13011e6f3b5913a7..c2b66f76ffe502ea16628edb6328e1c9b07cda22 100644 (file)
@@ -868,7 +868,7 @@ rxvt_term::lookup_key (XKeyEvent &ev)
   if (len <= 0)
     return;                    /* not mapped */
 
-  if (options & Opt_scrollTtyKeypress)
+  if (OPTION (Opt_scrollTtyKeypress))
     if (view_start)
       {
         view_start = 0;
@@ -1095,7 +1095,7 @@ rxvt_term::pty_fill ()
     {
       pty_ev.stop ();
 
-      if (!(options & Opt_hold))
+      if (!OPTION (Opt_hold))
         destroy ();
     }
   
@@ -1127,7 +1127,7 @@ rxvt_term::pointer_unblank ()
 #ifdef POINTER_BLANK
   hidden_pointer = 0;
 
-  if (options & Opt_pointerBlank)
+  if (OPTION (Opt_pointerBlank))
     pointer_ev.start (NOW + pointerBlankDelay);
 #endif
 }
@@ -1136,7 +1136,7 @@ rxvt_term::pointer_unblank ()
 void
 rxvt_term::pointer_blank ()
 {
-  if (! (options & Opt_pointerBlank))
+  if (! OPTION (Opt_pointerBlank))
     return;
 
   XDefineCursor (display->display, vt, display->blank_cursor);
@@ -1244,7 +1244,7 @@ rxvt_term::x_cb (XEvent &ev)
   SET_LOCALE (locale);
 
 #if defined(CURSOR_BLINK)
-  if ((options & Opt_cursorBlink) && ev.type == KeyPress)
+  if (OPTION (Opt_cursorBlink) && ev.type == KeyPress)
     {
       if (hidden_cursor)
         {
@@ -1257,7 +1257,7 @@ rxvt_term::x_cb (XEvent &ev)
 #endif
 
 #if defined(POINTER_BLANK)
-  if ((options & Opt_pointerBlank) && pointerBlankDelay > 0)
+  if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0)
     {
       if (ev.type == MotionNotify
           || ev.type == ButtonPress
@@ -1463,7 +1463,7 @@ rxvt_term::x_cb (XEvent &ev)
               }
 
 #ifdef TRANSPARENT             /* XXX: maybe not needed - leave in for now */
-            if (options & Opt_transparent)
+            if (OPTION (Opt_transparent))
               check_our_parents ();
 #endif
           }
@@ -1682,7 +1682,7 @@ rxvt_term::focus_in ()
         }
 #endif
 #if CURSOR_BLINK
-      if (options & Opt_cursorBlink)
+      if (OPTION (Opt_cursorBlink))
         cursor_blink_ev.start (NOW + BLINK_INTERVAL);
 #endif
 #if OFF_FOCUS_FADING
@@ -1714,7 +1714,7 @@ rxvt_term::focus_out ()
         XUnsetICFocus (Input_Context);
 #endif
 #if CURSOR_BLINK
-      if (options & Opt_cursorBlink)
+      if (OPTION (Opt_cursorBlink))
         cursor_blink_ev.stop ();
       hidden_cursor = 0;
 #endif
@@ -1748,7 +1748,7 @@ rxvt_term::rootwin_cb (XEvent &ev)
 
         /* FALLTHROUGH */
       case ReparentNotify:
-        if ((options & Opt_transparent) && check_our_parents () && am_transparent)
+        if (OPTION (Opt_transparent) && check_our_parents () && am_transparent)
           want_refresh = want_full_refresh = 1;
         break;
     }
@@ -2100,7 +2100,7 @@ rxvt_term::button_release (XButtonEvent &ev)
 
               if (ev.state & ShiftMask)
                 i = 1;
-              else if (options & Opt_mouseWheelScrollPage)
+              else if (OPTION (Opt_mouseWheelScrollPage))
                 i = nrow - 1;
               else
                 i = 5;
@@ -2396,7 +2396,7 @@ rxvt_term::check_our_parents ()
 
   pchanged = 0;
 
-  if (!(options & Opt_transparent))
+  if (!OPTION (Opt_transparent))
     return pchanged;   /* Don't try any more */
 
   XGetWindowAttributes (disp, display->root, &wrootattr);
@@ -2684,7 +2684,7 @@ rxvt_term::cmd_parse ()
 
                   refresh_count++;
 
-                  if (!(options & Opt_jumpScroll)
+                  if (!OPTION (Opt_jumpScroll)
                       || (refresh_count >= refresh_limit * (nrow - 1)))
                     {
                       refreshnow = true;
@@ -2728,7 +2728,7 @@ rxvt_term::cmd_parse ()
            */
           if (refreshnow)
             {
-              if ((options & Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
+              if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
                 refresh_limit++;
               else
                 {
@@ -3402,7 +3402,7 @@ rxvt_term::process_csi_seq ()
               scr_report_position ();
               break;
             case 7:                    /* unofficial extension */
-              if (options & Opt_insecure)
+              if (OPTION (Opt_insecure))
                 tt_printf ("%-.250s\012", rs[Rs_display_name]);
               break;
             case 8:                    /* unofficial extension */
@@ -3576,7 +3576,7 @@ rxvt_term::process_window_ops (const int *args, unsigned int nargs)
         {
           char *s;
           XGetIconName (disp, parent[0], &s);
-          tt_printf ("\033]L%-.250s\234", (options & Opt_insecure) && s ? s : "");     /* 8bit ST */
+          tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : "");        /* 8bit ST */
           XFree (s);
         }
         break;
@@ -3584,7 +3584,7 @@ rxvt_term::process_window_ops (const int *args, unsigned int nargs)
         {
           char *s;
           XFetchName (disp, parent[0], &s);
-          tt_printf ("\033]l%-.250s\234", (options & Opt_insecure) && s ? s : "");     /* 8bit ST */
+          tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : "");        /* 8bit ST */
           XFree (s);
         }
         break;
@@ -3870,7 +3870,7 @@ rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp)
 
 #ifdef MENUBAR
      case URxvt_Menu:
-       if (options & Opt_insecure)
+       if (OPTION (Opt_insecure))
          menubar_dispatch (const_cast<char *>(str)); // casting away constness is checked
        break;
 #endif
@@ -3896,7 +3896,7 @@ rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp)
 #endif
         if (query)
           tt_printf ("\33]%d;%-.250s%c", saveop,
-                     (options & Opt_insecure) && fontset[op - URxvt_font]->fontdesc
+                     OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc
                        ? fontset[op - URxvt_font]->fontdesc : "",
                      resp);
         else
@@ -3912,7 +3912,7 @@ rxvt_term::process_xterm_seq (int op, const char *str, unsigned char resp)
 #if ENABLE_FRILLS
       case URxvt_locale:
         if (query)
-          tt_printf ("\33]%d;%-.250s%c", URxvt_locale, (options & Opt_insecure) ? locale : "", resp);
+          tt_printf ("\33]%d;%-.250s%c", URxvt_locale, OPTION (Opt_insecure) ? locale : "", resp);
         else
           {
             set_locale (str);
@@ -4052,7 +4052,7 @@ rxvt_term::process_terminal_mode (int mode, int priv __attribute__ ((unused)), u
         {
           case 1048:           /* alternative cursor save */
           case 1049:
-            if (options & Opt_secondaryScreen)
+            if (OPTION (Opt_secondaryScreen))
               if (mode == 0)
                 scr_cursor (RESTORE);
               else if (mode == 1)
@@ -4077,10 +4077,10 @@ 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)
-                options &= ~Opt_jumpScroll;
+              if (!state)
+                SET_OPTION (Opt_jumpScroll);
               else
-                options |= Opt_jumpScroll;
+                CLR_OPTION (Opt_jumpScroll);
               break;
             case 5:                    /* reverse video */
               scr_rvideo_mode (state);
@@ -4131,26 +4131,33 @@ 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)
-                options &= ~Opt_scrollTtyOutput;
+              if (!state)
+                SET_OPTION (Opt_scrollTtyOutput);
               else
-                options |= Opt_scrollTtyOutput;
+                CLR_OPTION (Opt_scrollTtyOutput);
               break;
             case 1011:         /* scroll to bottom on key press */
               if (state)
-                options |= Opt_scrollTtyKeypress;
+                SET_OPTION (Opt_scrollTtyKeypress);
               else
-                options &= ~Opt_scrollTtyKeypress;
+                CLR_OPTION (Opt_scrollTtyKeypress);
               break;
+#if ENABLE_STYLES
+            case 1021:
+              if (state)
+                SET_OPTION (Opt_intensityStyles);
+              else
+                CLR_OPTION (Opt_intensityStyles);
+#endif
             case 1047:         /* secondary screen w/ clearing last */
-              if (options & Opt_secondaryScreen)
+              if (OPTION (Opt_secondaryScreen))
                 if (current_screen != PRIMARY)
                   scr_erase_screen (2);
               scr_change_screen (state);
               break;
             case 1049:         /* secondary screen w/ clearing first */
               scr_change_screen (state);
-              if (options & Opt_secondaryScreen)
+              if (OPTION (Opt_secondaryScreen))
                 if (current_screen != PRIMARY)
                   scr_erase_screen (2);
               break;
index 70e1b905e95680892ef9d945e53fc784d168ead6..4d757577b90ddc4cb844eec6047b7d5b693ba125 100644 (file)
@@ -395,7 +395,7 @@ rxvt_term::init_resources (int argc, const char *const *argv)
 
   /* no point having a scrollbar without having any scrollback! */
   if (!saveLines)
-    options &= ~Opt_scrollBar;
+    CLR_OPTION (Opt_scrollBar);
 
 #ifdef PRINTPIPE
   if (!rs[Rs_print_pipe])
@@ -448,7 +448,7 @@ rxvt_term::init_resources (int argc, const char *const *argv)
 
 #ifdef XTERM_REVERSE_VIDEO
   /* this is how xterm implements reverseVideo */
-  if (options & Opt_reverseVideo)
+  if (OPTION (Opt_reverseVideo))
     {
       if (!rs[Rs_color + Color_fg])
         rs[Rs_color + Color_fg] = def_colorName[Color_bg];
@@ -463,7 +463,7 @@ rxvt_term::init_resources (int argc, const char *const *argv)
 
 #ifndef XTERM_REVERSE_VIDEO
   /* this is how we implement reverseVideo */
-  if (options & Opt_reverseVideo)
+  if (OPTION (Opt_reverseVideo))
     ::swap (rs[Rs_color + Color_fg], rs[Rs_color + Color_bg]);
 #endif
 
@@ -650,16 +650,16 @@ rxvt_term::init_command (const char *const *argv)
    */
 
 #ifdef META8_OPTION
-  meta_char = (options & Opt_meta8 ? 0x80 : C0_ESC);
+  meta_char = OPTION ((Opt_meta8) ? 0x80 : C0_ESC);
 #endif
 
   get_ourmods ();
 
-  if (!(options & Opt_scrollTtyOutput))
+  if (!OPTION (Opt_scrollTtyOutput))
     priv_modes |= PrivMode_TtyOutputInh;
-  if (options & Opt_scrollTtyKeypress)
+  if (OPTION (Opt_scrollTtyKeypress))
     priv_modes |= PrivMode_Keypress;
-  if (!(options & Opt_jumpScroll))
+  if (!OPTION (Opt_jumpScroll))
     priv_modes |= PrivMode_smoothScroll;
 
 #ifndef NO_BACKSPACE_KEY
@@ -681,7 +681,7 @@ rxvt_term::init_command (const char *const *argv)
     }
 
 #ifdef CURSOR_BLINK
-  if (options & Opt_cursorBlink)
+  if (OPTION (Opt_cursorBlink))
     (void)gettimeofday (&lastcursorchange, NULL);
 #endif
 
@@ -708,7 +708,7 @@ rxvt_term::Get_Colours ()
       if (!rXParseAllocColor (&xcol, rs[Rs_color + i]))
         {
 #ifndef XTERM_REVERSE_VIDEO
-          if (i < 2 && (options & Opt_reverseVideo))
+          if (i < 2 && OPTION (Opt_reverseVideo))
             rs[Rs_color + i] = def_colorName[!i];
           else
 #endif
@@ -941,14 +941,14 @@ rxvt_term::create_windows (int argc, const char *const *argv)
   assert (sizeof (xa_names) / sizeof (char *) == NUM_XA);
   XInternAtoms (disp, (char **)xa_names, NUM_XA, False, xa);
 
-  if (options & Opt_transparent)
+  if (OPTION (Opt_transparent))
     {
       XGetWindowAttributes (disp, RootWindow (disp, display->screen), &gattr);
       display->depth = gattr.depth; // doh //TODO, per-term not per-display?
     }
 
 #if ENABLE_FRILLS
-  if (options & Opt_borderLess)
+  if (OPTION (Opt_borderLess))
     {
       prop = XInternAtom(disp, "_MOTIF_WM_INFO", True);
 
@@ -1028,7 +1028,7 @@ rxvt_term::create_windows (int argc, const char *const *argv)
 
   wmHint.flags = InputHint | StateHint | WindowGroupHint;
   wmHint.input = True;
-  wmHint.initial_state = options & Opt_iconic ? IconicState : NormalState;
+  wmHint.initial_state = OPTION (Opt_iconic) ? IconicState : NormalState;
   wmHint.window_group = top;
 
   XmbSetWMProperties (disp, top, NULL, NULL, (char **)argv, argc,
@@ -1096,7 +1096,7 @@ rxvt_term::create_windows (int argc, const char *const *argv)
   vt_emask = ExposureMask | ButtonPressMask | ButtonReleaseMask | PropertyChangeMask;
 
 #ifdef POINTER_BLANK
-  if (options & Opt_pointerBlank)
+  if (OPTION (Opt_pointerBlank))
     vt_emask |= PointerMotionMask;
   else
 #endif
@@ -1133,7 +1133,7 @@ rxvt_term::create_windows (int argc, const char *const *argv)
 
 #ifdef XPM_BACKGROUND
   if (rs[Rs_backgroundPixmap] != NULL
-      && ! (options & Opt_transparent))
+      && ! OPTION (Opt_transparent))
     {
       const char *p = rs[Rs_backgroundPixmap];
 
@@ -1528,7 +1528,7 @@ rxvt_term::run_child (const char *const *argv)
 
   SET_TTYMODE (STDIN_FILENO, &tio);       /* init terminal attributes */
 
-  if (options & Opt_console)
+  if (OPTION (Opt_console))
     {     /* be virtual console, fail silently */
 #ifdef TIOCCONS
       unsigned int on = 1;
@@ -1588,7 +1588,7 @@ rxvt_term::run_child (const char *const *argv)
 
       argv0 = (const char *)rxvt_r_basename (shell);
 
-      if (options & Opt_loginShell)
+      if (OPTION (Opt_loginShell))
         {
           login = (char *)rxvt_malloc ((strlen (argv0) + 2) * sizeof (char));
 
@@ -1633,7 +1633,7 @@ rxvt_term::run_child (const char *const *argv)
 
       arg_a[0] = my_basename (command);
 
-      if (options & Opt_loginShell)
+      if (OPTION (Opt_loginShell))
         {
           login = rxvt_malloc ((strlen (arg_a[0]) + 2) * sizeof (char));
 
index a5276da435b775ed7b849c1de7edf6831bebc640..ca280b4ec410144ab7890daea87ab8ae6a1497f0 100644 (file)
@@ -204,7 +204,7 @@ rxvt_term::makeutent (const char *pty, const char *hostname)
 
 #ifdef WTMP_SUPPORT
 # ifdef WTMP_ONLY_ON_LOGIN
-  if (options & Opt_loginShell)
+  if (OPTION (Opt_loginShell))
 # endif
     {
 # ifdef HAVE_STRUCT_UTMP
@@ -224,7 +224,7 @@ rxvt_term::makeutent (const char *pty, const char *hostname)
     }
 #endif
 #if defined(LASTLOG_SUPPORT) && defined(RXVT_LASTLOG_FILE)
-  if (options & Opt_loginShell)
+  if (OPTION (Opt_loginShell))
     rxvt_update_lastlog (RXVT_LASTLOG_FILE, pty, hostname);
 #endif
 }
@@ -285,7 +285,7 @@ rxvt_term::cleanutent ()
    */
 #ifdef WTMP_SUPPORT
 # ifdef WTMP_ONLY_ON_LOGIN
-  if (options & Opt_loginShell)
+  if (OPTION (Opt_loginShell))
 # endif
     {
 # ifdef HAVE_STRUCT_UTMP
index 8e3b184f31198ada6e2ffe90f6b5a235401ced3e..c6c445485ec1aa60284a0861f3d38b50c52a2010 100644 (file)
@@ -295,7 +295,7 @@ rxvt_term::child_exit ()
 {
   cmd_pid = 0;
 
-  if (!(options & Opt_hold))
+  if (!OPTION (Opt_hold))
     destroy ();
 }
 
@@ -471,7 +471,7 @@ rxvt_term::init (int argc, const char *const *argv)
   menubar_read (rs[Rs_menu]);
 #endif
 #ifdef HAVE_SCROLLBARS
-  if (options & Opt_scrollBar)
+  if (OPTION (Opt_scrollBar))
     scrollBar.setIdle ();    /* set existence for size calculations */
 #endif
 
@@ -488,7 +488,7 @@ rxvt_term::init (int argc, const char *const *argv)
 #endif
 
 #ifdef HAVE_SCROLLBARS
-  if (options & Opt_scrollBar)
+  if (OPTION (Opt_scrollBar))
     resize_scrollbar ();      /* create and map scrollbar */
 #endif
 #if (MENUBAR_MAX)
@@ -496,7 +496,7 @@ rxvt_term::init (int argc, const char *const *argv)
     XMapWindow (disp, menuBar.win);
 #endif
 #ifdef TRANSPARENT
-  if (options & Opt_transparent)
+  if (OPTION (Opt_transparent))
     {
       XSelectInput (disp, display->root, PropertyChangeMask);
       check_our_parents ();
@@ -683,7 +683,7 @@ rxvt_privileges (rxvt_privaction action)
 void
 rxvt_term::privileged_utmp (rxvt_privaction action)
 {
-  if ((options & Opt_utmpInhibit)
+  if (OPTION (Opt_utmpInhibit)
       || !pty.name || !*pty.name)
     return;
 
@@ -785,7 +785,7 @@ rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight)
     {
       sb_w = scrollbar_TotalWidth ();
       szHint.base_width += sb_w;
-      if (!(options & Opt_scrollBar_right))
+      if (!OPTION (Opt_scrollBar_right))
         window_vt_x += sb_w;
     }
 
@@ -823,7 +823,7 @@ rxvt_term::window_calc (unsigned int newwidth, unsigned int newheight)
       szHint.height = szHint.base_height + height;
     }
 
-  if (scrollbar_visible () && (options & Opt_scrollBar_right))
+  if (scrollbar_visible () && OPTION (Opt_scrollBar_right))
     window_sb_x = szHint.width - sb_w;
 
   if (recalc_x)
index dfd106341753accbc114cdcd2d49b5232bbebd1d..ccce3fce4697f51ad27fc0a137574f33cb71b75d 100644 (file)
@@ -1485,7 +1485,7 @@ struct rxvt_term : zero_initialized, rxvt_vars {
     int base = GET_BASEFG (r);
 #ifndef NO_BRIGHTCOLOR
     if (r & RS_Bold
-        && (!ENABLE_STYLES || options & Opt_intensityStyles)
+        && (!ENABLE_STYLES || OPTION (Opt_intensityStyles))
         && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
       base += minBrightCOLOR - minCOLOR;
 #endif
@@ -1497,7 +1497,7 @@ struct rxvt_term : zero_initialized, rxvt_vars {
     int base = GET_BASEBG (r);
 #ifndef NO_BRIGHTCOLOR
     if (r & RS_Blink
-        && (!ENABLE_STYLES || options & Opt_intensityStyles)
+        && (!ENABLE_STYLES || OPTION (Opt_intensityStyles))
         && IN_RANGE_INC (base, minCOLOR, minBrightCOLOR))
       base += minBrightCOLOR - minCOLOR;
 #endif
index d5cb975bd1f2e02b759111201d4c99fe372f7492..7e3d03228f367055d1eaca906504576f5db42f07 100644 (file)
@@ -266,11 +266,10 @@ typedef struct {
 #else
 # define Opt_intensityStyles    0
 #endif
-/* place holder used for parsing command-line options */
-#define Opt_Reverse              (1UL<<30)
-#define Opt_Boolean              (1UL<<31)
 
-#define OPTION(opt)              (options && (opt))
+#define SET_OPTION(opt)                 (options |= (opt))
+#define CLR_OPTION(opt)                 (options &= ~(opt))
+#define OPTION(opt)              (options & (opt))
 #define DEFAULT_OPTIONS          (Opt_scrollBar | Opt_scrollTtyOutput \
                                   | Opt_jumpScroll | Opt_secondaryScreen \
                                   | Opt_pastableTabs | Opt_intensityStyles)
index 5b2d93dda84d7a61a3035a0471c96fbc7288dcf1..25c8c26cf097471f0e889e12ccaaa3a0d39fc23c 100644 (file)
@@ -48,7 +48,7 @@ inline void fill_text (text_t *start, text_t value, int len)
  *             GENERAL SCREEN AND SELECTION UPDATE ROUTINES                  *
  * ------------------------------------------------------------------------- */
 #define ZERO_SCROLLBACK()                                              \
-    if (options & Opt_scrollTtyOutput)                                 \
+    if (OPTION (Opt_scrollTtyOutput))                                  \
         view_start = 0
 #define CLEAR_SELECTION()                                              \
     selection.beg.row = selection.beg.col                              \
@@ -532,7 +532,7 @@ rxvt_term::scr_change_screen (int scrn)
   screen.cur.col = clamp (screen.cur.col, 0, prev_ncol - 1);
 
 #if NSCREENS
-  if (options & Opt_secondaryScreen)
+  if (OPTION (Opt_secondaryScreen))
     {
       num_scr = 0;
 
@@ -546,7 +546,7 @@ rxvt_term::scr_change_screen (int scrn)
     }
   else
 #endif
-    if (options & Opt_secondaryScroll)
+    if (OPTION (Opt_secondaryScroll))
       scr_scroll_text (0, prev_nrow - 1, prev_nrow);
 
   return scrn;
@@ -618,7 +618,7 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count)
   if (count > 0
       && row1 == 0
       && row2 == nrow - 1
-      && (current_screen == PRIMARY || options & Opt_secondaryScroll))
+      && (current_screen == PRIMARY || OPTION (Opt_secondaryScroll)))
     {
       nsaved = min (nsaved + count, saveLines);
       term_start = (term_start + count) % total_rows;
@@ -644,7 +644,7 @@ rxvt_term::scr_scroll_text (int row1, int row2, int count)
           scr_blank_screen_mem (ROW(row2 - i), rstyle);
         }
       
-      if ((options & Opt_scrollWithBuffer)
+      if (OPTION (Opt_scrollWithBuffer)
           && view_start != 0
           && view_start != saveLines)
         scr_page (UP, count);
@@ -1020,7 +1020,7 @@ rxvt_term::scr_tab (int count, bool ht)
 
       // store horizontal tab commands as characters inside the text
       // buffer so they can be selected and pasted.
-      if (ht && options & Opt_pastableTabs)
+      if (ht && OPTION (Opt_pastableTabs))
         {
           base_rend = SET_FONT (base_rend, 0);
 
@@ -1595,7 +1595,7 @@ rxvt_term::scr_rvideo_mode (int mode)
       if (bgPixmap.pixmap == None)
 #endif
 #if TRANSPARENT
-        if (! (options & Opt_transparent) || am_transparent == 0)
+        if (! OPTION (Opt_transparent) || am_transparent == 0)
 #endif
           XSetWindowBackground (display->display, vt,
                                pix_colors[Color_bg]);
@@ -1838,12 +1838,12 @@ rxvt_term::scr_bell ()
 
 # ifndef NO_MAPALERT
 #  ifdef MAPALERT_OPTION
-  if (options & Opt_mapAlert)
+  if (OPTION (Opt_mapAlert))
 #  endif
     XMapWindow (display->display, parent[0]);
 # endif
 
-  if (options & Opt_visualBell)
+  if (OPTION (Opt_visualBell))
     {
       scr_rvideo_mode (!rvideo); /* refresh also done */
       rxvt_usleep (VISUAL_BELL_DURATION);
@@ -1944,7 +1944,7 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
   must_clear |= bgPixmap.pixmap != None;
 #endif
 #if TRANSPARENT
-  must_clear |= (options & Opt_transparent) && am_transparent;
+  must_clear |= OPTION (Opt_transparent) && am_transparent;
 #endif
   ocrow = oldcursor.row; /* is there an old outline cursor on screen? */
 
@@ -1978,7 +1978,7 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
 
         if (showcursor && focus)
           {
-            if (options & Opt_cursorUnderline)
+            if (OPTION (Opt_cursorUnderline))
               *crp ^= RS_Uline;
             else
               {
@@ -2321,7 +2321,7 @@ rxvt_term::scr_refresh (unsigned char refresh_type)
     {
       if (focus)
         {
-          if (options & Opt_cursorUnderline)
+          if (OPTION (Opt_cursorUnderline))
             *crp ^= RS_Uline;
           else
             {
@@ -3303,7 +3303,7 @@ rxvt_term::selection_extend_colrow (int32_t col, int32_t row, int button3, int b
   else if (selection.clicks == 3)
     {
 #if ENABLE_FRILLS
-      if (options & Opt_tripleclickwords)
+      if (OPTION (Opt_tripleclickwords))
         {
           selection_delimit_word (UP, &selection.beg, &selection.beg);
 
index d76427e1ac2952dcd9902b43bbe9dc78ab63383c..c12df58a059269ed76e6e2b98834fc3e15ad1d9e 100644 (file)
@@ -44,7 +44,7 @@ rxvt_term::scrollbar_show_plain (int update, int last_top, int last_bot, int scr
                                 GCForeground, &gcvalue);
     }
 
-  xsb = (options & Opt_scrollBar_right) ? 1 : 0;
+  xsb = OPTION (Opt_scrollBar_right) ? 1 : 0;
 
   if (update)
     {
index 04a701d564ad5d19f90d0c4c413e61cefa7cfe24..a693842d32d8e352d2b94ee4478b5fe8dc5da90b 100644 (file)
@@ -166,7 +166,7 @@ rxvt_term::scrollbar_show_rxvt (int update, int last_top, int last_bot, int scro
   {
     int xofs;
 
-    if (options & Opt_scrollBar_right)
+    if (OPTION (Opt_scrollBar_right))
       xofs = 0;
     else
       xofs = sbshadow ? sbwidth : sbwidth - 1;
index ae63e805099858325814bb5dca3d57d8066cfbaa..3ecaa6d4dab90b54faa345f6e697d6e20e028b66 100644 (file)
@@ -61,7 +61,7 @@ rxvt_term::scrollbar_show_xterm (int update, int last_top, int last_bot, int scr
 
   if (update)
     {
-      xsb = (options & Opt_scrollBar_right) ? 1 : 0;
+      xsb = OPTION (Opt_scrollBar_right) ? 1 : 0;
       if (last_top < scrollBar.top)
         XClearArea (display->display, scrollBar.win,
                    sb_shadow + xsb, last_top,
index 7a6a6f49a0d19eb9b41f4be9154969b65b70f318..4fad2b46a4cc04e696eec675c321fe6c3d64291c 100644 (file)
@@ -232,7 +232,7 @@ rxvt_term::setup_scrollbar (const char *scrollalign, const char *scrollstyle, co
       width = min (i, SB_WIDTH_MAXIMUM);
 
 # if defined(RXVT_SCROLLBAR)
-  if (! (options & Opt_scrollBar_floating) && style == R_SB_RXVT)
+  if (! OPTION (Opt_scrollBar_floating) && style == R_SB_RXVT)
     sb_shadow = SHADOW;
 # endif
 
index be0dc439b22539f673163fac1942f14972d19c45..a161b738761f0eba523bb5833f1b8c4d2a05a285 100644 (file)
 #include "keyboard.h"
 #endif
 
+/* place holders used for parsing command-line options */
+#define Optflag_Reverse              0x40000000UL
+#define Optflag_Boolean              0x80000000UL
+#define Optflag_mask                 0x3fffffffUL
+
 /* #define DEBUG_RESOURCES */
 
 /*{{{ monolithic option/resource structure: */
@@ -60,7 +65,7 @@
 
 /* BOOL () - regular boolean `-/+' flag */
 #define BOOL(rsp, kw, opt, flag, desc)                         \
-    { (Opt_Boolean| (flag)), (rsp), (kw), (opt), NULL, (desc)}
+    { (Optflag_Boolean | (flag)), (rsp), (kw), (opt), NULL, (desc)}
 
 /* SWCH () - `-' flag */
 #define SWCH(opt, flag, desc)                                  \
@@ -70,9 +75,9 @@
 #define optList_strlen(i)                                              \
     (optList[i].flag ? 0 : (optList[i].arg ? strlen (optList[i].arg) : 1))
 #define optList_isBool(i)                                              \
-    (optList[i].flag & Opt_Boolean)
+    (optList[i].flag & Optflag_Boolean)
 #define optList_isReverse(i)                                           \
-    (optList[i].flag & Opt_Reverse)
+    (optList[i].flag & Optflag_Reverse)
 #define optList_size                                                   \
     (sizeof (optList) / sizeof (optList[0]))
 
@@ -107,7 +112,7 @@ optList[] = {
               STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"),
 #endif
               BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, NULL),
-              BOOL (Rs_scrollTtyOutput, NULL, "si", Opt_Reverse | Opt_scrollTtyOutput, "scroll-on-tty-output inhibit"),
+              BOOL (Rs_scrollTtyOutput, NULL, "si", Optflag_Reverse | Opt_scrollTtyOutput, "scroll-on-tty-output inhibit"),
               BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, "scroll-on-keypress"),
               BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, "scroll-with-buffer"),
 #if TRANSPARENT
@@ -565,9 +570,9 @@ rxvt_term::get_options (int argc, const char *const *argv)
                       optList[entry].opt, optList[entry].kw, flag);
 #endif
               if (flag == On)
-                options |= optList[entry].flag;
+                SET_OPTION (optList[entry].flag & Optflag_mask);
               else
-                options &= ~optList[entry].flag;
+                CLR_OPTION (optList[entry].flag & Optflag_mask);
 
               if (optList[entry].doff != -1)
                 rs[optList[entry].doff] = flag;
@@ -859,9 +864,9 @@ rxvt_term::get_xdefaults (FILE *stream, const char *name)
                           s = !s;
 
                         if (s)
-                          options |= optList[entry].flag;
+                          SET_OPTION (optList[entry].flag & Optflag_mask);
                         else
-                          options &= ~optList[entry].flag;
+                          CLR_OPTION (optList[entry].flag & Optflag_mask);
                       }
                   }
 
@@ -1031,9 +1036,9 @@ rxvt_term::extract_resources ()
                 s = !s;
 
               if (s)
-                options |= optList[entry].flag;
+                SET_OPTION (optList[entry].flag & Optflag_mask);
               else
-                options &= ~optList[entry].flag;
+                CLR_OPTION (optList[entry].flag & Optflag_mask);
             }
         }
     }
index b9f881569818444efd527cad32fbe433dafdc2c3..9e4aabfbf000888c0ffaa53b55745ddd6fa31e51 100644 (file)
--- a/src/xpm.C
+++ b/src/xpm.C
@@ -173,7 +173,7 @@ rxvt_term::resize_pixmap ()
     { /* So be it: I'm not using pixmaps */
       pixmap = None;
 
-      if (!(options & Opt_transparent) || !am_transparent)
+      if (!OPTION (Opt_transparent) || !am_transparent)
         XSetWindowBackground (disp, vt,
                               pix_colors[Color_bg]);