--- rxvt-unicode/src/xdefaults.C 2005/04/17 22:36:13 1.58 +++ rxvt-unicode/src/xdefaults.C 2006/01/02 20:40:20 1.67 @@ -37,6 +37,11 @@ #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])) @@ -98,7 +103,7 @@ BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, "login shell"), BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, "jump scrolling"), BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, "tab characters are pastable"), -#ifdef HAVE_SCROLLBARS +#if HAVE_SCROLLBARS RSTRG (Rs_scrollstyle, "scrollstyle", "mode"), BOOL (Rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, "scrollbar"), BOOL (Rs_scrollBar_right, "scrollBar_right", "sr", Opt_scrollBar_right, "scrollbar right"), @@ -107,21 +112,21 @@ 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"), -#ifdef TRANSPARENT +#if TRANSPARENT BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, "inherit parent pixmap"), - BOOL (Rs_transparent_all, "inheritPixmapforce", "ipf", Opt_transparent_all, "forcefully inherit root pixmap"), SWCH ("tr", Opt_transparent, NULL), -#if TINTING +# if TINTING STRG (Rs_color + Color_tint, "tintColor", "tint", "color", "tint color"), +# endif #endif +#if OFF_FOCUS_FADING + STRG (Rs_fade, "fading", "fade", "%", "fade colors x% percent when rxvt-unicode is losing focus"), + STRG (Rs_color + Color_fade, "fadeColor", "fadecolor", "color", "target color for off-focus fading"), #endif -#ifdef OFF_FOCUS_FADING - STRG (Rs_fade, "fading", "fade", "%", "make colors x% darker when rxvt-unicode is losing focus."), -#endif -#ifdef TINTING +#if TINTING STRG (Rs_shade, "shading", "sh", "%", "shade background by x% when tinting."), #endif BOOL (Rs_utmpInhibit, "utmpInhibit", "ut", Opt_utmpInhibit, "utmp inhibit"), @@ -207,6 +212,7 @@ STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"), STRG (Rs_italicFont, "italicFont", "fi", "fontname", "italic font"), STRG (Rs_boldItalicFont, "boldItalicFont", "fbi", "fontname", "bold italic font"), + BOOL (Rs_intensityStyles, "intensityStyles", "is", Opt_intensityStyles, "font styles imply intensity changes"), #endif #ifdef USE_XIM STRG (Rs_inputMethod, "inputMethod", "im", "name", "name of input method"), @@ -224,6 +230,7 @@ #endif #if ENABLE_FRILLS STRG (Rs_pty_fd, NULL, "pty-fd", "fileno", "file descriptor of pty to use"), + BOOL (Rs_hold, "hold", "hold", Opt_hold, "retain window after shell exit"), STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"), STRG (Rs_ext_bwidth, NULL, "bw", NULL, NULL), STRG (Rs_ext_bwidth, NULL, "borderwidth", NULL, NULL), @@ -253,6 +260,11 @@ BOOL (Rs_secondaryScreen, "secondaryScreen", "ssc", Opt_secondaryScreen, "enable secondary screen"), BOOL (Rs_secondaryScroll, "secondaryScroll", "ssr", Opt_secondaryScroll, "enable secondary screen scroll"), #endif +#if ENABLE_PERL + STRG (Rs_perl_lib, "perl-lib", 0, "string", "colon-separated directories with extension scripts"), + STRG (Rs_perl_eval, "perl-eval", 0, "string", "code to be evaluated after all extensions have been loaded"), + STRG (Rs_perl_ext, "perl-ext", "pe", "string", "colon-separated list of perl extensions to enable"), +#endif #if 0 && TODO #if !defined(NO_RESOURCES) && defined(USE_XGETDEFAULT) INFO ("xrm", "string", "X resource"), @@ -563,9 +575,9 @@ 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; @@ -857,9 +869,9 @@ 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); } } @@ -909,7 +921,6 @@ int entry; # ifdef XrmEnumOneLevel - int i; char *displayResource, *xe; XrmName name_prefix[3]; XrmClass class_prefix[3]; @@ -1030,9 +1041,9 @@ 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); } } }