From: root Date: Sun, 8 Jan 2006 01:02:15 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=942721a4054308045d48753baf474084bc90ffe5;p=dana%2Furxvt.git *** empty log message *** --- diff --git a/src/command.C b/src/command.C index 7ee1f060..f15a9b3a 100644 --- a/src/command.C +++ b/src/command.C @@ -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)) diff --git a/src/init.C b/src/init.C index 79146580..b4bf4dbc 100644 --- a/src/init.C +++ b/src/init.C @@ -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]) diff --git a/src/rxvt.h b/src/rxvt.h index 6348feae..aca610f8 100644 --- a/src/rxvt.h +++ b/src/rxvt.h @@ -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); diff --git a/src/rxvtfont.C b/src/rxvtfont.C index fa58592c..00d1beb7 100644 --- a/src/rxvtfont.C +++ b/src/rxvtfont.C @@ -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); diff --git a/src/rxvtlib.h.in b/src/rxvtlib.h.in index de346347..567674ac 100644 --- a/src/rxvtlib.h.in +++ b/src/rxvtlib.h.in @@ -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; diff --git a/src/xdefaults.C b/src/xdefaults.C index 1bff3d2a..76e57bd8 100644 --- a/src/xdefaults.C +++ b/src/xdefaults.C @@ -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); } } }