-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: 671d6b6f632834d80fbef44a19f1f3606eb2a762:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit 671d6b6f632834d80fbef44a19f1f3606eb2a762
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Sat Dec 29 14:25:43 2007 +0000

    Move sb_shadow from rxvt_vars to scrollBar_t.

diff --git a/src/rxvt.h b/src/rxvt.h

index 066fc910823281f35609f48024bdcfd2c11d4519..

index ..750b527bd0fb74d47f9c872651a3f148a327c0f5 100644

--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -661,12 +661,6 @@ typedef struct _mwmhints {
 # define FONTSET(style) fontset[0]
 #endif

-#ifdef HAVE_SCROLLBARS
-# define scrollbar_TotalWidth() (scrollBar.width + sb_shadow * 2)
-#else
-# define scrollbar_TotalWidth() (0)
-#endif
-
 typedef callback<void (const char *)> log_callback;
 typedef callback<int (int)> getfd_callback;

@@ -934,7 +928,6 @@ struct rxvt_vars : TermWin_t {
   XSizeHints      szHint;
   rxvt_color     *pix_colors;
   Cursor          TermWin_cursor;       /* cursor for vt window */
-  int             sb_shadow;    /* scrollbar shadow width                    */
   int             numlock_state;
   line_t         *row_buf;      // all lines, scrollback + terminal, circular, followed by temp_buf
   line_t         *drawn_buf;    // text on screen
diff --git a/src/scrollbar-plain.C b/src/scrollbar-plain.C

index dc94249a0ff71f98523ea3923082d97c359e77c9..

index ..fc42e09207387e5dbf06a85d9f49651d736f3d6e 100644

--- a/src/scrollbar-plain.C
+++ b/src/scrollbar-plain.C
@@ -49,12 +49,12 @@ rxvt_term::scrollbar_show_plain (int update, int last_top, int last_bot, int scr
     {
       if (last_top < scrollBar.top)
         XClearArea (dpy, scrollBar.win,
-                    sb_shadow, last_top,
+                    scrollBar.sb_shadow, last_top,
                     sbwidth + 1, scrollBar.top - last_top, False);

       if (scrollBar.bot < last_bot)
         XClearArea (dpy, scrollBar.win,
-                    sb_shadow, scrollBar.bot,
+                    scrollBar.sb_shadow, scrollBar.bot,
                     sbwidth + 1, last_bot - scrollBar.bot, False);
     }
   else
diff --git a/src/scrollbar-rxvt.C b/src/scrollbar-rxvt.C

index 2b2f285539c12112f62c751b7a0c7b297fa93726..

index ..2de6741d2d6feeacad5f4ccb985d3b3dba08f60f 100644

--- a/src/scrollbar-rxvt.C
+++ b/src/scrollbar-rxvt.C
@@ -149,7 +149,7 @@ draw_button (rxvt_term *term, int x, int y, int state, int dirn)
 int
 rxvt_term::scrollbar_show_rxvt (int update, int last_top, int last_bot, int scrollbar_len)
 {
-  int sbshadow = sb_shadow;
+  int sbshadow = scrollBar.sb_shadow;
   int sbwidth = (int)scrollBar.width;

   if ((scrollBar.init & R_SB_RXVT) == 0)
diff --git a/src/scrollbar-xterm.C b/src/scrollbar-xterm.C

index 3bd315b5137d6d9148e25a4acd3c2d38619dffeb..

index ..161f55546ff4625ffe8bf933c49b6d2778e70c4a 100644

--- a/src/scrollbar-xterm.C
+++ b/src/scrollbar-xterm.C
@@ -65,12 +65,12 @@ rxvt_term::scrollbar_show_xterm (int update, int last_top, int last_bot, int scr
     {
       if (last_top < scrollBar.top)
         XClearArea (dpy, scrollBar.win,
-                   sb_shadow + xsb, last_top,
+                   scrollBar.sb_shadow + xsb, last_top,
                    sbwidth, (scrollBar.top - last_top), False);

       if (scrollBar.bot < last_bot)
         XClearArea (dpy, scrollBar.win,
-                   sb_shadow + xsb, scrollBar.bot,
+                   scrollBar.sb_shadow + xsb, scrollBar.bot,
                    sbwidth, (last_bot - scrollBar.bot), False);
     }
   else
diff --git a/src/scrollbar.C b/src/scrollbar.C

index 2daaa485eec630957743a2c4696e4f79e159a5e8..

index ..0ff57d4a778368c454433b9f4a10f311cd3da362 100644

--- a/src/scrollbar.C
+++ b/src/scrollbar.C
@@ -72,9 +72,9 @@ rxvt_term::resize_scrollbar ()
 #define R_SCROLLBEG_NEXT	0
 #define R_SCROLLEND_NEXT	szHint.height - (SB_BUTTON_TOTAL_HEIGHT + \
                                                     SB_PADDING)
-#define R_SCROLLBEG_RXVT	(scrollBar.width + 1) + sb_shadow
+#define R_SCROLLBEG_RXVT	(scrollBar.width + 1) + scrollBar.sb_shadow
 #define R_SCROLLEND_RXVT	szHint.height - R_SCROLLBEG_RXVT - \
-                                    (2 * sb_shadow)
+                                    (2 * scrollBar.sb_shadow)

 #if defined(PLAIN_SCROLLBAR)
   if (scrollBar.style == R_SB_PLAIN)
@@ -231,7 +231,7 @@ rxvt_term::setup_scrollbar (const char *scrollalign, const char *scrollstyle, co

 # ifdef RXVT_SCROLLBAR
   if (! option (Opt_scrollBar_floating) && style == R_SB_RXVT)
-    sb_shadow = SHADOW_WIDTH;
+    scrollBar.sb_shadow = SHADOW_WIDTH;
 # endif

   scrollBar.style = style;
diff --git a/src/scrollbar.h b/src/scrollbar.h

index dd775a1d17b23d4dd9a27ce688ca59fa9b14473e..

index ..92a35bb21424f0fed392f7a178c86ed6bd55ebea 100644

--- a/src/scrollbar.h
+++ b/src/scrollbar.h
@@ -14,6 +14,7 @@ typedef struct {
   unsigned int    bot;          /* slider bottom position                   */
   unsigned int    style;        /* style: rxvt, xterm, next                 */
   unsigned int    width;        /* scrollbar width                          */
+  int             sb_shadow;    /* scrollbar shadow width                   */
   Window          win;
   int             (rxvt_term::*update)(int, int, int, int);

@@ -23,6 +24,7 @@ typedef struct {
   void setDn()     { state = 'D'; }
 } scrollBar_t;

+#define scrollbar_TotalWidth()  (scrollBar.width + scrollBar.sb_shadow * 2)
 #define scrollbar_isMotion()    (scrollBar.state == 'm')
 #define scrollbar_isUp()        (scrollBar.state == 'U')
 #define scrollbar_isDn()        (scrollBar.state == 'D')

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

-- Response ended

-- Page fetched on Sun Jun 2 10:18:21 2024