if (!(display = displays.get (rs[Rs_display_name])))
rxvt_fatal ("can't open display %s, aborting.\n", rs[Rs_display_name]);
+ // using a local pointer decreases code size a lot
xa = display->xa;
#if XFT
extract_resources ();
+ for (int i = NUM_RESOURCES; i--; )
+ if (rs [i] == resval_undef)
+ rs [i] = 0;
+
free (r_argv);
#if ENABLE_PERL
for (i = 0; i < (depth <= 2 ? 2 : NRS_COLORS); i++)
{
rgba c;
- pix_colors[Color_fade].get (this, c);
+ pix_colors[Color_fade].get (c);
pix_colors_focused[i].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused[i],c);
}
#endif
rgba c0, c1;
- xcol[0].get (this, c0);
- xcol[1].get (this, c1);
+ xcol[0].get (c0);
+ xcol[1].get (c1);
xcol[1].fade (this, 50, pix_colors[Color_bottomShadow]);
* 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
#define INDENT 18
+const char rxvt_term::resval_undef [] = "<undef>";
+const char rxvt_term::resval_on [] = "on";
+const char rxvt_term::resval_off [] = "off";
+
/*{{{ usage: */
/*----------------------------------------------------------------------*/
static void
for (col = 1, i = 0; i < optList_size; i++)
if (optList[i].desc != NULL)
{
- int len = 0;
+ int len = 0;
if (!optList_isBool (i))
{
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++)
{
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 */
}
if (!strcmp (opt, "help"))
rxvt_usage (longopt ? 2 : 1);
+
if (!strcmp (opt, "h"))
rxvt_usage (0);
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))
{
*/
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 */
- 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;