MEvent.time = CurrentTime;
MEvent.button = AnyButton;
- options = DEFAULT_OPTIONS;
want_refresh = 1;
priv_modes = SavedModes = PrivMode_Default;
ncol = 80;
last_bot = last_state = -1;
+ set_option (Opt_scrollBar, 1);
+ set_option (Opt_scrollTtyOutput, 1);
+ set_option (Opt_jumpScroll, 1);
+ set_option (Opt_secondaryScreen, 1);
+ set_option (Opt_secondaryScroll, 1);
+ set_option (Opt_pastableTabs, 1);
+ set_option (Opt_intensityStyles, 1);
+
return true;
}
#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_secondaryScroll \
- | Opt_pastableTabs \
- | Opt_intensityStyles)
+#define OPTION(opt) option(opt)
// for m >= -n, ensure remainder lies between 0..n-1
#define MOD(m,n) (((m) + (n)) % (n))
return base;
}
- bool option (uint32_t opt) const NOTHROW
+ bool option (uint8_t opt) const NOTHROW
{
- return OPTION (opt);
+ return options[opt >> 3] & (1 << (opt & 7));
}
- void set_option (uint32_t opt, bool set) NOTHROW
+ void set_option (uint8_t opt, bool set) NOTHROW
{
if (set)
- options |= opt;
+ options[opt >> 3] |= (1 << (opt & 7));
else
- options &= ~opt;
+ options[opt >> 3] &= ~(1 << (opt & 7));
}
void scr_blank_line (line_t &l, unsigned int col, unsigned int width, rend_t efs) const NOTHROW;
/* rxvt_vars.options */
enum {
-# define def(name,idx) Opt_ ## name = 1UL << (idx), Opt_ ## name ## _idx = idx,
-# define nodef(name) Opt_ ## name = 0, Opt_ ## name ## _idx = 0,
+# define def(name,idx) Opt_ ## name = idx,
+# define nodef(name) Opt_ ## name = 0,
# include "optinc.h"
# undef nodef
# undef def
+Opt_count
};
/* ------------------------------------------------------------------------- */
struct rxvt_vars : TermWin_t {
scrollBar_t scrollBar;
- uint32_t options;
+ uint8_t options[(Opt_count + 7) >> 3];
XSizeHints szHint;
rxvt_color *pix_colors;
rxvt_color *pix_colors_focused;
rxvt_term::x_resource (const char *name)
bool
-rxvt_term::option (U32 optval, int set = -1)
+rxvt_term::option (U8 optval, int set = -1)
CODE:
{
- RETVAL = THIS->options & optval;
+ RETVAL = THIS->option (optval);
if (set >= 0)
{
- if (set)
- THIS->options |= optval;
- else
- THIS->options &= ~optval;
+ THIS->set_option (optval, set);
if (THIS->check_ev.is_active ()) // avoid doing this before START
switch (optval)
/* BOOL () - regular boolean `-/+' flag */
#define BOOL(rsp, kw, opt, option, flag, desc) \
- { option ## _idx, (Optflag_Boolean | (flag)), (rsp), (kw), (opt), NULL, (desc)}
+ { (option), (Optflag_Boolean | (flag)), (rsp), (kw), (opt), NULL, (desc)}
/* SWCH () - `-' flag */
#define SWCH(opt, option, flag, desc) \
- { option ## _idx, (flag), -1, NULL, (opt), NULL, (desc)}
+ { (option), (flag), -1, NULL, (opt), NULL, (desc)}
/* convenient macros */
#define optList_strlen(i) \
}
else
{ /* boolean value */
- set_option (1UL << optList[entry].index, flag == resval_on);
+ set_option (optList[entry].index, flag == resval_on);
if (optList[entry].doff != -1)
rs[optList[entry].doff] = flag;
if (optList_isReverse (entry))
s = !s;
- set_option (1UL << optList[entry].index, s);
+ set_option (optList[entry].index, s);
}
}
}