{
#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;
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);
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))
/* 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])
#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))
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);
return true;
if (unicode >= 0x2500 && unicode <= 0x259f &&
- ! OPTION_R (Opt_skipBuiltinGlyphs))
+ !r->option (Opt_skipBuiltinGlyphs))
return true;
if (IS_COMPOSE (unicode))
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);
# 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 {
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;
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;
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);
}
}
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);
}
}
}