ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/xdefaults.C
(Generate patch)

Comparing rxvt-unicode/src/xdefaults.C (file contents):
Revision 1.63 by root, Sat Dec 31 16:06:48 2005 UTC vs.
Revision 1.69 by root, Wed Jan 4 04:42:45 2006 UTC

35 35
36#ifdef KEYSYM_RESOURCE 36#ifdef KEYSYM_RESOURCE
37#include "keyboard.h" 37#include "keyboard.h"
38#endif 38#endif
39 39
40/* place holders used for parsing command-line options */
41#define Optflag_Reverse 0x40000000UL
42#define Optflag_Boolean 0x80000000UL
43#define Optflag_mask 0x3fffffffUL
44
40/* #define DEBUG_RESOURCES */ 45/* #define DEBUG_RESOURCES */
41 46
42/*{{{ monolithic option/resource structure: */ 47/*{{{ monolithic option/resource structure: */
43/* 48/*
44 * `string' options MUST have a usage argument 49 * `string' options MUST have a usage argument
58#define RSTRG(rsp, kw, arg) \ 63#define RSTRG(rsp, kw, arg) \
59 {0, (rsp), (kw), NULL, (arg), NULL} 64 {0, (rsp), (kw), NULL, (arg), NULL}
60 65
61/* BOOL () - regular boolean `-/+' flag */ 66/* BOOL () - regular boolean `-/+' flag */
62#define BOOL(rsp, kw, opt, flag, desc) \ 67#define BOOL(rsp, kw, opt, flag, desc) \
63 { (Opt_Boolean| (flag)), (rsp), (kw), (opt), NULL, (desc)} 68 { (Optflag_Boolean | (flag)), (rsp), (kw), (opt), NULL, (desc)}
64 69
65/* SWCH () - `-' flag */ 70/* SWCH () - `-' flag */
66#define SWCH(opt, flag, desc) \ 71#define SWCH(opt, flag, desc) \
67 { (flag), -1, NULL, (opt), NULL, (desc)} 72 { (flag), -1, NULL, (opt), NULL, (desc)}
68 73
69/* convenient macros */ 74/* convenient macros */
70#define optList_strlen(i) \ 75#define optList_strlen(i) \
71 (optList[i].flag ? 0 : (optList[i].arg ? strlen (optList[i].arg) : 1)) 76 (optList[i].flag ? 0 : (optList[i].arg ? strlen (optList[i].arg) : 1))
72#define optList_isBool(i) \ 77#define optList_isBool(i) \
73 (optList[i].flag & Opt_Boolean) 78 (optList[i].flag & Optflag_Boolean)
74#define optList_isReverse(i) \ 79#define optList_isReverse(i) \
75 (optList[i].flag & Opt_Reverse) 80 (optList[i].flag & Optflag_Reverse)
76#define optList_size \ 81#define optList_size \
77 (sizeof (optList) / sizeof (optList[0])) 82 (sizeof (optList) / sizeof (optList[0]))
78 83
79static const struct 84static const struct
80 { 85 {
105 BOOL (Rs_scrollBar_floating, "scrollBar_floating", "st", Opt_scrollBar_floating, "scrollbar without a trough"), 110 BOOL (Rs_scrollBar_floating, "scrollBar_floating", "st", Opt_scrollBar_floating, "scrollbar without a trough"),
106 RSTRG (Rs_scrollBar_align, "scrollBar_align", "mode"), 111 RSTRG (Rs_scrollBar_align, "scrollBar_align", "mode"),
107 STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"), 112 STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"),
108#endif 113#endif
109 BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, NULL), 114 BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, NULL),
110 BOOL (Rs_scrollTtyOutput, NULL, "si", Opt_Reverse | Opt_scrollTtyOutput, "scroll-on-tty-output inhibit"), 115 BOOL (Rs_scrollTtyOutput, NULL, "si", Optflag_Reverse | Opt_scrollTtyOutput, "scroll-on-tty-output inhibit"),
111 BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, "scroll-on-keypress"), 116 BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, "scroll-on-keypress"),
112 BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, "scroll-with-buffer"), 117 BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, "scroll-with-buffer"),
113#if TRANSPARENT 118#if TRANSPARENT
114 BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, "inherit parent pixmap"), 119 BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, "inherit parent pixmap"),
115 SWCH ("tr", Opt_transparent, NULL), 120 SWCH ("tr", Opt_transparent, NULL),
253 RSTRG (Rs_answerbackstring, "answerbackString", "string"), 258 RSTRG (Rs_answerbackstring, "answerbackString", "string"),
254#ifndef NO_SECONDARY_SCREEN 259#ifndef NO_SECONDARY_SCREEN
255 BOOL (Rs_secondaryScreen, "secondaryScreen", "ssc", Opt_secondaryScreen, "enable secondary screen"), 260 BOOL (Rs_secondaryScreen, "secondaryScreen", "ssc", Opt_secondaryScreen, "enable secondary screen"),
256 BOOL (Rs_secondaryScroll, "secondaryScroll", "ssr", Opt_secondaryScroll, "enable secondary screen scroll"), 261 BOOL (Rs_secondaryScroll, "secondaryScroll", "ssr", Opt_secondaryScroll, "enable secondary screen scroll"),
257#endif 262#endif
263#if ENABLE_PERL
264 RSTRG (Rs_perl_lib, "perl-lib", "string"), //, "colon-separated directories with extension scripts"),
265 RSTRG (Rs_perl_eval, "perl-eval", "perl-eval"), // "string", "code to be evaluated after all extensions have been loaded"),
266 STRG (Rs_perl_ext, "perl-ext", "pe", "string", "colon-separated list of perl extensions to enable"),
267#endif
258#if 0 && TODO 268#if 0 && TODO
259#if !defined(NO_RESOURCES) && defined(USE_XGETDEFAULT) 269#if !defined(NO_RESOURCES) && defined(USE_XGETDEFAULT)
260 INFO ("xrm", "string", "X resource"), 270 INFO ("xrm", "string", "X resource"),
261#endif 271#endif
262#endif 272#endif
563#ifdef DEBUG_RESOURCES 573#ifdef DEBUG_RESOURCES
564 fprintf (stderr, "boolean (%s,%s) = %s\n", 574 fprintf (stderr, "boolean (%s,%s) = %s\n",
565 optList[entry].opt, optList[entry].kw, flag); 575 optList[entry].opt, optList[entry].kw, flag);
566#endif 576#endif
567 if (flag == On) 577 if (flag == On)
568 options |= optList[entry].flag; 578 SET_OPTION (optList[entry].flag & Optflag_mask);
569 else 579 else
570 options &= ~optList[entry].flag; 580 CLR_OPTION (optList[entry].flag & Optflag_mask);
571 581
572 if (optList[entry].doff != -1) 582 if (optList[entry].doff != -1)
573 rs[optList[entry].doff] = flag; 583 rs[optList[entry].doff] = flag;
574 } 584 }
575 } 585 }
857 867
858 if (optList_isReverse (entry)) 868 if (optList_isReverse (entry))
859 s = !s; 869 s = !s;
860 870
861 if (s) 871 if (s)
862 options |= optList[entry].flag; 872 SET_OPTION (optList[entry].flag & Optflag_mask);
863 else 873 else
864 options &= ~optList[entry].flag; 874 CLR_OPTION (optList[entry].flag & Optflag_mask);
865 } 875 }
866 } 876 }
867 877
868 break; 878 break;
869 } 879 }
1029 1039
1030 if (optList_isReverse (entry)) 1040 if (optList_isReverse (entry))
1031 s = !s; 1041 s = !s;
1032 1042
1033 if (s) 1043 if (s)
1034 options |= optList[entry].flag; 1044 SET_OPTION (optList[entry].flag & Optflag_mask);
1035 else 1045 else
1036 options &= ~optList[entry].flag; 1046 CLR_OPTION (optList[entry].flag & Optflag_mask);
1037 } 1047 }
1038 } 1048 }
1039 } 1049 }
1040 1050
1041 /* 1051 /*

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines