--- rxvt-unicode/src/xdefaults.C 2007/05/01 21:10:04 1.99 +++ rxvt-unicode/src/xdefaults.C 2007/11/15 11:36:15 1.120 @@ -34,6 +34,7 @@ /* place holders used for parsing command-line options */ #define Optflag_Reverse 1 #define Optflag_Boolean 2 +#define Optflag_Switch 4 /* monolithic option/resource structure: */ /* @@ -60,7 +61,7 @@ /* SWCH () - `-' flag */ #define SWCH(opt, option, flag, desc) \ - { (option), (flag), -1, NULL, (opt), NULL, (desc)} + { (option), (Optflag_Switch | (flag)), -1, NULL, (opt), NULL, (desc)} /* convenient macros */ #define optList_strlen(i) \ @@ -94,6 +95,7 @@ BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, 0, "reverse video"), BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, 0, "login shell"), BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, 0, "jump scrolling"), + BOOL (Rs_skipScroll, "skipScroll", "ss", Opt_skipScroll, 0, "skip scrolling"), BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, 0, "tab characters are pastable"), #if HAVE_SCROLLBARS RSTRG (Rs_scrollstyle, "scrollstyle", "mode"), @@ -107,22 +109,21 @@ BOOL (Rs_scrollTtyOutput, NULL, "si", Opt_scrollTtyOutput, Optflag_Reverse, "scroll-on-tty-output inhibit"), BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, 0, "scroll-on-keypress"), BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, 0, "scroll-with-buffer"), -#if TRANSPARENT +#if ENABLE_TRANSPARENCY BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, 0, "inherit parent pixmap"), - SWCH ("tr", Opt_transparent, 0, NULL), -# if TINTING + BOOL (Rs_transparent, "transparent", "tr", Opt_transparent, 0, "inherit parent pixmap"), STRG (Rs_color + Color_tint, "tintColor", "tint", "color", "tint color"), -# endif + STRG (Rs_shade, "shading", "sh", "%", "shade background by x %."), #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 -#if TINTING - STRG (Rs_shade, "shading", "sh", "%", "shade background by x % when tinting."), -#endif BOOL (Rs_utmpInhibit, "utmpInhibit", "ut", Opt_utmpInhibit, 0, "utmp inhibit"), #ifndef NO_BELL +# if ENABLE_FRILLS + BOOL (Rs_urgentOnBell, "urgentOnBell", NULL, Opt_urgentOnBell, 0, NULL), +# endif BOOL (Rs_visualBell, "visualBell", "vb", Opt_visualBell, 0, "visual bell"), # if ! defined(NO_MAPALERT) && defined(MAPALERT_OPTION) BOOL (Rs_mapAlert, "mapAlert", NULL, Opt_mapAlert, 0, NULL), @@ -168,14 +169,14 @@ RSTRG (Rs_color + Color_IT, "colorIT", "color"), RSTRG (Rs_color + Color_UL, "colorUL", "color"), RSTRG (Rs_color + Color_RV, "colorRV", "color"), -#endif /* ! NO_BOLD_UNDERLINE_REVERSE */ +#endif /* ! NO_BOLD_UNDERLINE_REVERSE */ #if ENABLE_FRILLS RSTRG (Rs_color + Color_underline, "underlineColor", "color"), #endif #ifdef KEEP_SCROLLCOLOR RSTRG (Rs_color + Color_scroll, "scrollColor", "color"), RSTRG (Rs_color + Color_trough, "troughColor", "color"), -#endif /* KEEP_SCROLLCOLOR */ +#endif /* KEEP_SCROLLCOLOR */ #ifdef OPTION_HC STRG (Rs_color + Color_HC, "highlightColor", "hc", "color", "highlight color"), #endif @@ -183,11 +184,11 @@ STRG (Rs_color + Color_cursor, "cursorColor", "cr", "color", "cursor color"), /* command-line option = resource name */ RSTRG (Rs_color + Color_cursor2, "cursorColor2", "color"), -#endif /* NO_CURSORCOLOR */ +#endif /* NO_CURSORCOLOR */ STRG (Rs_color + Color_pointer_fg, "pointerColor", "pr", "color", "pointer color"), STRG (Rs_color + Color_pointer_bg, "pointerColor2", "pr2", "color", "pointer bg color"), STRG (Rs_color + Color_border, "borderColor", "bd", "color", "border color"), -#ifdef XPM_BACKGROUND +#ifdef BG_IMAGE_FROM_FILE RSTRG (Rs_path, "path", "search path"), STRG (Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"), #endif @@ -204,7 +205,7 @@ STRG (Rs_preeditType, "preeditType", "pt", "style", "input style: style = OverTheSpot|OffTheSpot|Root"), STRG (Rs_imLocale, "imLocale", "imlocale", "string", "locale to use for input method"), STRG (Rs_imFont, "imFont", "imfont", "fontname", "fontset for styles OverTheSpot and OffTheSpot"), -#endif /* USE_XIM */ +#endif /* USE_XIM */ STRG (Rs_name, NULL, "name", "string", "client instance, icon, and title strings"), STRG (Rs_title, "title", "title", "string", "title name for window"), STRG (Rs_title, NULL, "T", NULL, NULL), /* short form */ @@ -245,7 +246,7 @@ STRG (Rs_modifier, "modifier", "mod", "modifier", "meta modifier = alt|meta|hyper|super|mod1|...|mod5"), #ifdef CUTCHAR_RESOURCE RSTRG (Rs_cutchars, "cutchars", "string"), -#endif /* CUTCHAR_RESOURCE */ +#endif /* CUTCHAR_RESOURCE */ RSTRG (Rs_answerbackstring, "answerbackString", "string"), #ifndef NO_SECONDARY_SCREEN BOOL (Rs_secondaryScreen, "secondaryScreen", "ssc", Opt_secondaryScreen, 0, "enable secondary screen"), @@ -257,6 +258,13 @@ RSTRG (Rs_perl_ext_1, "perl-ext-common", "string"), //, "colon-separated list of perl extensions to enable"),TODO STRG (Rs_perl_ext_2, "perl-ext", "pe", "string", "colon-separated list of perl extensions to enable for this instance"), #endif +#if ISO_14755 + BOOL (Rs_iso14755_52, "iso14755_52", NULL, Opt_iso14755_52, 0, NULL), +#endif +#ifdef HAVE_AFTERIMAGE + STRG (Rs_blendtype, "blendType", "blt", "string", "background image blending type - alpha, tint, etc..."), + STRG (Rs_blurradius, "blurRadius", "blr", "HxV", "Gaussian Blur radii to apply to the root background"), +#endif #ifndef NO_RESOURCES INFO ("xrm", "string", "X resource"), #endif @@ -312,15 +320,13 @@ #if OFF_FOCUS_FADING "fade," #endif -#if defined(XPM_BACKGROUND) - "XPM," -#endif -#if defined(TRANSPARENT) +#if defined(ENABLE_TRANSPARENCY) "transparent," -#endif -#if TINTING "tint," #endif +#if HAVE_AFTERIMAGE + "afterimage," +#endif #if defined(USE_XIM) "XIM," #endif @@ -543,8 +549,8 @@ if (optList[entry].doff != -1) { - if (flag == resval_on && !argv [i+1]) - rxvt_fatal ("option '%s' needs an argument, aborting.\n", argv [i]); + if (flag == resval_on && i+1 == argc) + rxvt_fatal ("option '%s' requires an argument, aborting.\n", argv [i]); rs[optList[entry].doff] = flag == resval_on ? argv[++i] : resval_undef; } @@ -559,13 +565,10 @@ } else #ifdef KEYSYM_RESOURCE - /* if (!strncmp (opt, "keysym.", sizeof ("keysym.") - 1)) */ - if (rxvt_Str_match (opt, "keysym.")) + if (!strncmp (opt, "keysym.", sizeof ("keysym.") - 1)) { - const char *str = argv[++i]; - - if (str != NULL) - parse_keysym (opt + sizeof ("keysym.") - 1, str); + if (i+1 < argc) + parse_keysym (opt + sizeof ("keysym.") - 1, argv[++i]); } else #endif @@ -666,7 +669,8 @@ if (arg == NULL) { - if ((n = rxvt_Str_match (str, "keysym.")) == 0) + n = sizeof ("keysym.") - 1; + if (strncmp (str, "keysym.", n)) return 0; str += n; /* skip `keysym.' */ @@ -749,16 +753,15 @@ newarg = newargstr; } - rxvt_Str_trim (newarg); - if (*newarg == '\0' || (n = rxvt_Str_escaped (newarg)) == 0) + if (*newarg == '\0') return -1; keyboard->register_user_translation (sym, state, newarg); return 1; } -# endif /* KEYSYM_RESOURCE */ -#endif /* NO_RESOURCES */ +# endif /* KEYSYM_RESOURCE */ +#endif /* NO_RESOURCES */ static char * get_res (XrmDatabase database, const char *program, const char *option) @@ -862,7 +865,7 @@ # endif # endif -#endif /* NO_RESOURCES */ +#endif /* NO_RESOURCES */ } /*----------------------- end-of-file (C source) -----------------------*/