--- rxvt-unicode/src/xdefaults.C 2006/01/21 22:38:06 1.83 +++ rxvt-unicode/src/xdefaults.C 2006/01/31 19:55:05 1.92 @@ -23,8 +23,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *----------------------------------------------------------------------*/ -#include "../config.h" /* NECESSARY */ -#include "rxvt.h" /* NECESSARY */ +#include "../config.h" +#include "rxvt.h" #include "version.h" #ifdef KEYSYM_RESOURCE @@ -36,8 +36,6 @@ #define Optflag_Boolean 0x80000000UL #define Optflag_mask 0x3fffffffUL -/* #define DEBUG_RESOURCES */ - /*{{{ monolithic option/resource structure: */ /* * `string' options MUST have a usage argument @@ -215,6 +213,9 @@ #if ENABLE_XEMBED STRG (Rs_embed, NULL, "embed", "windowid", "window id to embed terminal in"), #endif +#if XFT + STRG (Rs_depth, "depth", "depth", "number", "depth of visual to request"), +#endif #if ENABLE_FRILLS RSTRG (Rs_transient_for, "transient-for", "windowid"), BOOL (Rs_override_redirect, "override-redirect", "override-redirect", Opt_override_redirect, "set override-redirect on the terminal window"), @@ -324,33 +325,6 @@ #if defined(USE_XIM) "XIM," #endif - "scrollbars=" -#if !defined(HAVE_SCROLLBARS) - "NONE" -#else -# if defined(PLAIN_SCROLLBAR) - "plain" -# if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) - "+" -# endif -# endif -# if defined(RXVT_SCROLLBAR) - "rxvt" -# if defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) - "+" -# endif -# endif -# if defined(NEXT_SCROLLBAR) - "NeXT" -# if defined(XTERM_SCROLLBAR) - "+" -# endif -# endif -# if defined(XTERM_SCROLLBAR) - "xterm" -# endif -#endif - "," #if defined(NO_BACKSPACE_KEY) "no_backspace," #endif @@ -363,9 +337,6 @@ #if defined(ENABLE_FRILLS) "frills," #endif -#if defined(PREFER_24BIT) - "24bit," -#endif #if defined(SELECTION_SCROLLING) "selectionscrolling," #endif @@ -385,12 +356,42 @@ "pointerBlank," #endif #if defined(NO_RESOURCES) - "NoResources" + "NoResources," +#endif + "scrollbars=" +#if !defined(HAVE_SCROLLBARS) + "NONE" +#else +# if defined(PLAIN_SCROLLBAR) + "plain" +# if defined(RXVT_SCROLLBAR) || defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) + "+" +# endif +# endif +# if defined(RXVT_SCROLLBAR) + "rxvt" +# if defined(NEXT_SCROLLBAR) || defined(XTERM_SCROLLBAR) + "+" +# endif +# endif +# if defined(NEXT_SCROLLBAR) + "NeXT" +# if defined(XTERM_SCROLLBAR) + "+" +# endif +# endif +# if defined(XTERM_SCROLLBAR) + "xterm" +# endif #endif "\nUsage: "; /* Usage */ #define INDENT 18 +const char rxvt_term::resval_undef [] = ""; +const char rxvt_term::resval_on [] = "on"; +const char rxvt_term::resval_off [] = "off"; + /*{{{ usage: */ /*----------------------------------------------------------------------*/ static void @@ -408,7 +409,7 @@ for (col = 1, i = 0; i < optList_size; i++) if (optList[i].desc != NULL) { - int len = 0; + int len = 0; if (!optList_isBool (i)) { @@ -486,7 +487,6 @@ rxvt_term::get_options (int argc, const char *const *argv) { int i, bad_option = 0; - static const char On[3] = "ON", Off[4] = "OFF"; for (i = 1; i < argc; i++) { @@ -494,18 +494,18 @@ const char *flag, *opt; opt = argv[i]; -#ifdef DEBUG_RESOURCES - fprintf (stderr, "argv[%d] = %s: ", i, opt); -#endif + if (*opt == '-') { - flag = On; + flag = resval_on; + if (*++opt == '-') longopt = *opt++; /* long option */ } else if (*opt == '+') { - flag = Off; + flag = resval_off; + if (*++opt == '+') longopt = *opt++; /* long option */ } @@ -518,6 +518,7 @@ if (!strcmp (opt, "help")) rxvt_usage (longopt ? 2 : 1); + if (!strcmp (opt, "h")) rxvt_usage (0); @@ -531,7 +532,7 @@ if (entry < optList_size) { if (optList_isReverse (entry)) - flag = flag == On ? Off : On; + flag = flag == resval_on ? resval_off : resval_on; if (optList_strlen (entry)) { @@ -542,16 +543,12 @@ */ if (optList[entry].doff != -1) - rs[optList[entry].doff] = flag == On && argv[i+1] - ? argv[++i] : 0; + rs[optList[entry].doff] = flag == resval_on && argv[i+1] + ? argv[++i] : resval_undef; } else { /* boolean value */ -#ifdef DEBUG_RESOURCES - fprintf (stderr, "boolean (%s,%s) = %s\n", - optList[entry].opt, optList[entry].kw, flag); -#endif - set_option (optList[entry].flag & Optflag_mask, flag == On); + set_option (optList[entry].flag & Optflag_mask, flag == resval_on); if (optList[entry].doff != -1) rs[optList[entry].doff] = flag; @@ -776,7 +773,7 @@ const char * rxvt_term::x_resource (const char *name) { - XrmDatabase database = XrmGetDatabase (display->display); + XrmDatabase database = XrmGetDatabase (xdisp); const char *p = get_res (database, rs[Rs_name], name); const char *p0 = get_res (database, "!INVALIDPROGRAMMENAMEDONTMATCH!", name); @@ -838,7 +835,7 @@ * [R5 or later]: enumerate the resource database */ # ifdef KEYSYM_RESOURCE - XrmDatabase database = XrmGetDatabase (display->display); + XrmDatabase database = XrmGetDatabase (xdisp); XrmName name_prefix[3]; XrmClass class_prefix[3];