repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 8fe0bb178b57b13711546f203d490e1626a07599:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 8fe0bb178b57b13711546f203d490e1626a07599
Author: Marc Lehmann 
Date:   Mon Jun 21 22:24:07 2004 +0000

    *** empty log message ***

diff --git a/doc/yodl/rxvt-resources.yo b/doc/yodl/rxvt-resources.yo
index 2bfe44f65a003e445c4cd096bc73be2e354bbed7..
index ..e5be42c3662d6c76a25824793db385e071f70790 100644
--- a/doc/yodl/rxvt-resources.yo
+++ b/doc/yodl/rxvt-resources.yo
@@ -1,4 +1,4 @@
-COMMENT(-- $Id: rxvt-resources.yo,v 1.12 2004/04/02 19:15:57 pcg Exp $ --)
+COMMENT(-- $Id: rxvt-resources.yo,v 1.13 2004/06/21 22:24:07 root Exp $ --)
 COMMENT(----------------------------------------------------------------------)
 manpagesection(RESOURCES (available also as long-options))

@@ -109,7 +109,7 @@ startdit()
 	is xterm style with 2.20 old word selection, or anything else which
 	gives xterm style selection.
     dit(bf(scrollstyle:) em(mode))
-	Set scrollbar style to bf(RXVTNAME()), bf(next) or bf(xterm)
+	Set scrollbar style to bf(RXVTNAME()), bf(rxvt), bf(plain), bf(next) or bf(xterm)
     dit(bf(title:) em(string))
 	Set window title string, the default title is the command-line
 	specified after the bf(-e) option, if any, otherwise the application
diff --git a/src/init.C b/src/init.C
index a90f53a1495bde4f7d20262da227ef7a53f62902..
index ..5296c839a05bea70e6977a903865e79bb472eb33 100644
--- a/src/init.C
+++ b/src/init.C
@@ -326,14 +326,13 @@ const char *const def_colorName[] =
 #ifdef OPTION_HC
     NULL,
 #endif
-#if TINTING
-    NULL,
-#endif
 #ifdef KEEP_SCROLLCOLOR
     COLOR_SCROLLBAR,
     COLOR_SCROLLTROUGH,
 #endif                          /* KEEP_SCROLLCOLOR */
-
+#if TINTING
+    NULL,
+#endif
   };

 const char *const xa_names[NUM_XA] =
@@ -755,7 +754,16 @@ rxvt_term::set_locale (const char *locale)
 {
 #if HAVE_XSETLOCALE || HAVE_SETLOCALE
   free (this->locale);
-  this->locale = rxvt_strdup (setlocale (LC_CTYPE, locale));
+  this->locale = setlocale (LC_CTYPE, locale);
+
+  if (!this->locale)
+    {
+      rxvt_warn ("unable to set locale \"%s\", using default locale instead.\n", locale);
+      setlocale (LC_CTYPE, "");
+      this->locale = "";
+    }
+
+  this->locale = rxvt_strdup (this->locale);
   SET_LOCALE (this->locale);
   mbstate.reset ();
 #endif
@@ -828,11 +836,11 @@ rxvt_term::init_command (const char *const *argv)

   get_ourmods ();

-  if (! (Options & Opt_scrollTtyOutput))
+  if (!(Options & Opt_scrollTtyOutput))
     PrivateModes |= PrivMode_TtyOutputInh;
   if (Options & Opt_scrollTtyKeypress)
     PrivateModes |= PrivMode_Keypress;
-  if (! (Options & Opt_jumpScroll))
+  if (!(Options & Opt_jumpScroll))
     PrivateModes |= PrivMode_smoothScroll;

 #ifndef NO_BACKSPACE_KEY
@@ -932,13 +940,13 @@ rxvt_term::Get_Colours ()

   if (XDEPTH <= 2)
     {  /* Monochrome */
-      PixColors[Color_scroll] = PixColors[Color_fg];
-      PixColors[Color_topShadow] = PixColors[Color_bg];
+      PixColors[Color_scroll]       = PixColors[Color_fg];
+      PixColors[Color_topShadow]    = PixColors[Color_bg];
       PixColors[Color_bottomShadow] = PixColors[Color_bg];
     }
   else
     {
-      rxvt_color          xcol[3];
+      rxvt_color xcol[3];
       /* xcol[0] == white
        * xcol[1] == top shadow
        * xcol[2] == bot shadow */
@@ -1176,7 +1184,8 @@ rxvt_term::create_windows (int argc, const char *const *argv)

   /* the vt window */
   TermWin.vt = XCreateSimpleWindow (display->display, TermWin.parent[0],
-                                   window_vt_x, window_vt_y,
+                                   window_vt_x,
+                                   window_vt_y,
                                    TermWin_TotalWidth (),
                                    TermWin_TotalHeight (),
                                    0,
diff --git a/src/scrollbar-rxvt.C b/src/scrollbar-rxvt.C
index 8cce92b3803d70433c52d61d2f7bc9a4f0a8afc3..
index ..6bfc94e83c772728700731ba30537ddb8b08956e 100644
--- a/src/scrollbar-rxvt.C
+++ b/src/scrollbar-rxvt.C
@@ -67,18 +67,19 @@ rxvt_term::Draw_button (int x, int y, int state, int dirn)
       pt[0].y = pt[1].y = y;
       pt[2].y = y + sz - 1;
     }
+
   XFillPolygon (display->display, scrollBar.win, scrollbarGC,
-               pt, 3, Convex, CoordModeOrigin);
+                pt, 3, Convex, CoordModeOrigin);

   /* draw base */
   XDrawLine (display->display, scrollBar.win, (dirn == UP ? bot : top),
-            pt[0].x, pt[0].y, pt[1].x, pt[1].y);
+             pt[0].x, pt[0].y, pt[1].x, pt[1].y);

   /* draw shadow on left */
   pt[1].x = x + sz2 - 1;
   pt[1].y = y + (dirn == UP ? 0 : sz - 1);
   XDrawLine (display->display, scrollBar.win, top,
-            pt[0].x, pt[0].y, pt[1].x, pt[1].y);
+             pt[0].x, pt[0].y, pt[1].x, pt[1].y);

 #if (SHADOW > 1)
   /* doubled */
@@ -94,7 +95,7 @@ rxvt_term::Draw_button (int x, int y, int state, int dirn)
       pt[1].y--;
     }
   XDrawLine (display->display, scrollBar.win, top,
-            pt[0].x, pt[0].y, pt[1].x, pt[1].y);
+             pt[0].x, pt[0].y, pt[1].x, pt[1].y);
 #endif
   /* draw shadow on right */
   pt[1].x = x + sz - 1;
@@ -102,7 +103,7 @@ rxvt_term::Draw_button (int x, int y, int state, int dirn)
   pt[1].y = y + (dirn == UP ? sz - 1 : 0);
   pt[2].y = y + (dirn == UP ? 0 : sz - 1);
   XDrawLine (display->display, scrollBar.win, bot,
-            pt[2].x, pt[2].y, pt[1].x, pt[1].y);
+             pt[2].x, pt[2].y, pt[1].x, pt[1].y);
 #if (SHADOW > 1)
   /* doubled */
   pt[1].x--;
@@ -116,8 +117,9 @@ rxvt_term::Draw_button (int x, int y, int state, int dirn)
       pt[2].y--;
       pt[1].y++;
     }
+
   XDrawLine (display->display, scrollBar.win, bot,
-            pt[2].x, pt[2].y, pt[1].x, pt[1].y);
+             pt[2].x, pt[2].y, pt[1].x, pt[1].y);
 #endif
 }

@@ -129,14 +131,10 @@ rxvt_term::scrollbar_show_rxvt (int update __attribute__ ((unused)), int last_to

   if ((scrollBar.init & R_SB_RXVT) == 0)
     {
-      XGCValues       gcvalue;
-
       scrollBar.init |= R_SB_RXVT;
-      gcvalue.foreground = PixColors[Color_trough];
       if (sbshadow)
         {
-          XSetWindowBackground (display->display, scrollBar.win,
-                               gcvalue.foreground);
+          XSetWindowBackground (display->display, scrollBar.win, PixColors[Color_trough]);
           XClearWindow (display->display, scrollBar.win);
         }
     }
@@ -145,21 +143,21 @@ rxvt_term::scrollbar_show_rxvt (int update __attribute__ ((unused)), int last_to
       /* instead of XClearWindow (display->display, scrollBar.win); */
       if (last_top < scrollBar.top)
         XClearArea (display->display, scrollBar.win,
-                   sbshadow, last_top,
-                   sbwidth, (scrollBar.top - last_top),
-                   False);
+                    sbshadow, last_top,
+                    sbwidth, (scrollBar.top - last_top),
+                    False);

       if (scrollBar.bot < last_bot)
         XClearArea (display->display, scrollBar.win,
-                   sbshadow, scrollBar.bot,
-                   sbwidth, (last_bot - scrollBar.bot),
-                   False);
+                    sbshadow, scrollBar.bot,
+                    sbwidth, (last_bot - scrollBar.bot),
+                    False);
     }

   /* scrollbar slider */
 #ifdef SB_BORDER
   {
-    int             xofs;
+    int xofs;

     if (Options & Opt_scrollBar_right)
       xofs = 0;
@@ -167,12 +165,13 @@ rxvt_term::scrollbar_show_rxvt (int update __attribute__ ((unused)), int last_to
       xofs = sbshadow ? sbwidth : sbwidth - 1;

     XDrawLine (display->display, scrollBar.win, botShadowGC,
-              xofs, 0, xofs, scrollBar.end + sbwidth);
+               xofs, 0, xofs, scrollBar.end + sbwidth);
   }
 #endif
+
   XFillRectangle (display->display, scrollBar.win, scrollbarGC,
-                 sbshadow, scrollBar.top, sbwidth,
-                 scrollbar_len);
+                  sbshadow, scrollBar.top, sbwidth,
+                  scrollbar_len);

   if (sbshadow)
     /* trough shadow */
@@ -181,19 +180,17 @@ rxvt_term::scrollbar_show_rxvt (int update __attribute__ ((unused)), int last_to
                      0, 0,
                      sbwidth + 2 * sbshadow, /* scrollbar_TotalWidth () */
                      scrollBar.end + (sbwidth + 1) + sbshadow);
+
   /* shadow for scrollbar slider */
   rxvt_Draw_Shadow (display->display, scrollBar.win,
                    topShadowGC, botShadowGC,
                    sbshadow, scrollBar.top, sbwidth,
                    scrollbar_len);

-  /*
-   * Redraw scrollbar arrows
-   */
-  Draw_button (sbshadow, sbshadow,
-               (scrollbar_isUp () ? -1 : +1), UP);
-  Draw_button (sbshadow, (scrollBar.end + 1),
-               (scrollbar_isDn () ? -1 : +1), DN);
+  /* Redraw scrollbar arrows */
+  Draw_button (sbshadow, sbshadow,          (scrollbar_isUp () ? -1 : +1), UP);
+  Draw_button (sbshadow, scrollBar.end + 1, (scrollbar_isDn () ? -1 : +1), DN);
+
   return 1;
 }
 #endif				/* RXVT_SCROLLBAR */
diff --git a/src/scrollbar-xterm.C b/src/scrollbar-xterm.C
index fdd0d222a2bb8f856a62ce14456b9d126b77ff5e..
index ..14bf78b1fd1ce721ce916e5daa7080dfde0a2de6 100644
--- a/src/scrollbar-xterm.C
+++ b/src/scrollbar-xterm.C
@@ -54,8 +54,8 @@ rxvt_term::scrollbar_show_xterm (int update __attribute__ ((unused)), int last_t
       gcvalue.background = PixColors[Color_bg];

       xscrollbarGC = XCreateGC (display->display, scrollBar.win,
-                               GCForeground | GCBackground
-                               | GCFillStyle | GCStipple, &gcvalue);
+                                GCForeground | GCBackground
+                                | GCFillStyle | GCStipple, &gcvalue);
       gcvalue.foreground = PixColors[Color_border];
       ShadowGC = XCreateGC (display->display, scrollBar.win, GCForeground, &gcvalue);
     }

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