repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 5ba9e280e819cc01ed4db8b5e0297052761fdcce:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 5ba9e280e819cc01ed4db8b5e0297052761fdcce
Author: Marc Lehmann 
Date:   Tue Jan 31 19:53:31 2006 +0000

    *** empty log message ***

diff --git a/src/command.C b/src/command.C
index 993f8e7f75b0649ab1064fe12a5501380c9d62d5..
index ..ace499a51d934680340b2183a99fef347648b810 100644
--- a/src/command.C
+++ b/src/command.C
@@ -2543,7 +2543,7 @@ rxvt_term::check_our_parents ()
               int shade = rs[Rs_shade] ? atoi (rs[Rs_shade]) : 100;

               rgba c;
-              pix_colors_focused [Color_tint].get (this, c);
+              pix_colors_focused [Color_tint].get (c);

               ShadeXImage (this, image, shade, c.r, c.g, c.b);
             }
@@ -3721,7 +3721,7 @@ rxvt_term::process_color_seq (int report, int color, const char *str, char resp)
   if (str[0] == '?' && !str[1])
     {
       rgba c;
-      pix_colors_focused[color].get (this, c);
+      pix_colors_focused[color].get (c);

 #if XFT
       if (c.a != rgba::MAX_CC)
diff --git a/src/init.C b/src/init.C
index ec436b911de71fbd1f198897dbd2abce1a09c990..
index ..9140de27b03ad51cdcd6cb0fb89e9d954531313f 100644
--- a/src/init.C
+++ b/src/init.C
@@ -299,6 +299,7 @@ rxvt_term::init_resources (int argc, const char *const *argv)
   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
@@ -310,6 +311,10 @@ rxvt_term::init_resources (int argc, const char *const *argv)

   extract_resources ();

+  for (int i = NUM_RESOURCES; i--; )
+    if (rs [i] == resval_undef)
+      rs [i] = 0;
+
   free (r_argv);

 #if ENABLE_PERL
@@ -710,7 +715,7 @@ rxvt_term::Get_Colours ()
     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
@@ -749,8 +754,8 @@ rxvt_term::Get_Colours ()

       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]);

diff --git a/src/main.C b/src/main.C
index 6de57b8216df0cf0aa6f28c61d56dfd691fa6bde..
index ..996562ee43a0c00550afa68bcd60cea486e7132f 100644
--- a/src/main.C
+++ b/src/main.C
@@ -934,7 +934,7 @@ done:
   if (rs[Rs_fade])
     {
       rgba c;
-      pix_colors [Color_fade].get (this, c);
+      pix_colors [Color_fade].get (c);
       pix_colors_focused [idx].fade (this, atoi (rs[Rs_fade]), pix_colors_unfocused [idx], c);
     }
 #endif
diff --git a/src/rxvt.h b/src/rxvt.h
index 11ee312a85b687de317f56a6e658efaf9fe057c1..
index ..35747b5edb934bd1f99aebd4e64f6d6645e0b22b 100644
--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -890,11 +890,17 @@ extern class rxvt_composite_vec rxvt_composite;
 /****************************************************************************/

 #ifdef KEYSYM_RESOURCE
-  class keyboard_manager;
+class keyboard_manager;
 #endif

 struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen {
-  log_callback   *log_hook;               // log error messages through this hook, if != 0
+
+  // special markers with magic addresses
+  static const char resval_undef [];    // options specifically unset
+  static const char resval_on [];       // boolean options switched on
+  static const char resval_off [];      // or off
+  
+  log_callback   *log_hook;             // log error messages through this hook, if != 0
   getfd_callback *getfd_hook;           // convert remote to local fd, if != 0
 #if ENABLE_PERL
   rxvt_perl_term  perl;
diff --git a/src/rxvttoolkit.C b/src/rxvttoolkit.C
index 16c7ab565786387dc2f0f196fbda279a968c98c7..
index ..01c9dde666c1000f0300579a7adecf7148cf2570 100644
--- a/src/rxvttoolkit.C
+++ b/src/rxvttoolkit.C
@@ -721,7 +721,7 @@ rxvt_color::set (rxvt_screen *screen, const rgba &color)
 }

 void
-rxvt_color::get (rxvt_screen *screen, rgba &color)
+rxvt_color::get (rgba &color)
 {
 #if XFT
   color.r = c.color.red;
@@ -750,7 +750,7 @@ void
 rxvt_color::fade (rxvt_screen *screen, int percent, rxvt_color &result, const rgba &to)
 {
   rgba c;
-  get (screen, c);
+  get (c);

   result.set (
     screen,
diff --git a/src/rxvttoolkit.h b/src/rxvttoolkit.h
index f358dcae96f5852a1c9b537653a92f623f18b809..
index ..879c0316a210923acd0f496b1e05d7feff78fc30 100644
--- a/src/rxvttoolkit.h
+++ b/src/rxvttoolkit.h
@@ -252,7 +252,7 @@ struct rxvt_color {
   bool alloc (rxvt_screen *screen, const rgba &color);
   void free (rxvt_screen *screen);

-  void get (rxvt_screen *screen, rgba &color);
+  void get (rgba &color);

   bool set (rxvt_screen *screen, const char *name);
   bool set (rxvt_screen *screen, const rgba &color);
diff --git a/src/scrollbar-plain.C b/src/scrollbar-plain.C
index 262b8569f08f83626f54089287da770b7b8d2904..
index ..c236212b29d1ce62de2ba05afb5144c983a15bcc 100644
--- a/src/scrollbar-plain.C
+++ b/src/scrollbar-plain.C
@@ -50,12 +50,12 @@ rxvt_term::scrollbar_show_plain (int update, int last_top, int last_bot, int scr
       if (last_top < scrollBar.top)
         XClearArea (xdisp, scrollBar.win,
                     sb_shadow, last_top,
-                    sbwidth + 1, (scrollBar.top - last_top), False);
+                    sbwidth + 1, scrollBar.top - last_top, False);

       if (scrollBar.bot < last_bot)
         XClearArea (xdisp, scrollBar.win,
                     sb_shadow, scrollBar.bot,
-                    sbwidth + 1, (last_bot - scrollBar.bot), False);
+                    sbwidth + 1, last_bot - scrollBar.bot, False);
     }
   else
     XClearWindow (xdisp, scrollBar.win);
diff --git a/src/xdefaults.C b/src/xdefaults.C
index 36fe7c10e0daa8bb2f26f71a392db3dc7f72e1da..
index ..6ed82f9250e8c4ecf58e4b5ae192290223a4eef6 100644
--- a/src/xdefaults.C
+++ b/src/xdefaults.C
@@ -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
@@ -388,6 +388,10 @@ static const char optionsstring[] = "options: "

 #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
@@ -483,7 +487,6 @@ void
 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,13 +497,15 @@ rxvt_term::get_options (int argc, const char *const *argv)

       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 */
         }
@@ -513,6 +518,7 @@ rxvt_term::get_options (int argc, const char *const *argv)

       if (!strcmp (opt, "help"))
         rxvt_usage (longopt ? 2 : 1);
+
       if (!strcmp (opt, "h"))
         rxvt_usage (0);

@@ -526,7 +532,7 @@ rxvt_term::get_options (int argc, const char *const *argv)
       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))
             {
@@ -537,12 +543,14 @@ rxvt_term::get_options (int argc, const char *const *argv)
                */

               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;
+
+              if (optList[entry].doff == Rs_color + Color_tint) printf ("doff %d is %s\n",optList[entry].doff,rs[optList[entry].doff]);//D
             }
           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;

-----END OF PAGE-----