-- 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: ecbc64c88ba825aa5147944861f38a254699c883:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

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

commit ecbc64c88ba825aa5147944861f38a254699c883
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Tue Jan 29 14:45:55 2008 +0000

    Make setup_scrollbar a method of scrollBar_t.

diff --git a/src/init.C b/src/init.C

index 0e0413b84870cd1c62a3b81fe05bb6bb6021acf1..

index ..364878512dee97733ff28fdcda63f006f3006564 100644

--- a/src/init.C
+++ b/src/init.C
@@ -487,7 +487,7 @@ rxvt_term::init_resources (int argc, const char *const *argv)
 # endif
 #endif

-  setup_scrollbar (rs[Rs_scrollBar_align], rs[Rs_scrollstyle], rs[Rs_scrollBar_thickness]);
+    scrollBar.setup (this);

 #ifdef XTERM_REVERSE_VIDEO
   /* this is how xterm implements reverseVideo */
diff --git a/src/rxvt.h b/src/rxvt.h

index 289af5ece6d07d7be742387a94cd1d454246719e..

index ..cf19e463def6e2435d50b973a31c2d0767724e89 100644

--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -1481,7 +1481,6 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen {
   void resize_scrollbar ();
   int scrollbar_mapping (int map);
   int scrollbar_show (int update);
-  void setup_scrollbar (const char *scrollalign, const char *scrollstyle, const char *thickness);

   // xdefaults.C
   void get_options (int argc, const char *const *argv);
diff --git a/src/scrollbar.C b/src/scrollbar.C

index ab1c48696de69e0697e8efdc7ae5b17314570f7b..

index ..a55c1d668704e14ea0d2c1e1081875f5fbcac208 100644

--- a/src/scrollbar.C
+++ b/src/scrollbar.C
@@ -175,10 +175,16 @@ rxvt_term::scrollbar_show (int update)
 }

 void
-rxvt_term::setup_scrollbar (const char *scrollalign, const char *scrollstyle, const char *thickness)
+scrollBar_t::setup (rxvt_term *term)
 {
   int             i;
   short           style, width;
+  const char *scrollalign, *scrollstyle, *thickness;
+
+  this->term = term;
+  scrollalign = term->rs[Rs_scrollBar_align];
+  scrollstyle = term->rs[Rs_scrollstyle];
+  thickness = term->rs[Rs_scrollBar_thickness];

 # if defined(RXVT_SCROLLBAR)
   style = R_SB_RXVT;
@@ -224,24 +230,24 @@ rxvt_term::setup_scrollbar (const char *scrollalign, const char *scrollstyle, co
       width = min (i, SB_WIDTH_MAXIMUM);

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

-  scrollBar.style = style;
-  scrollBar.width = width;
+  this->style = style;
+  this->width = width;

   /* scrollBar.align = R_SB_ALIGN_CENTRE; */
   if (scrollalign)
     {
       if (strncasecmp (scrollalign, "top", 3) == 0)
-        scrollBar.align = R_SB_ALIGN_TOP;
+        align = R_SB_ALIGN_TOP;
       else if (strncasecmp (scrollalign, "bottom", 6) == 0)
-        scrollBar.align = R_SB_ALIGN_BOTTOM;
+        align = R_SB_ALIGN_BOTTOM;
     }
-  scrollBar.last_bot = scrollBar.last_state = -1;
+  last_bot = last_state = -1;
   /* cursor scrollBar: Black-on-White */
-  scrollBar.leftptr_cursor = XCreateFontCursor (dpy, XC_left_ptr);
+  leftptr_cursor = XCreateFontCursor (term->dpy, XC_left_ptr);
 }

 /*----------------------- end-of-file (C source) -----------------------*/
diff --git a/src/scrollbar.h b/src/scrollbar.h

index f78fb803fa471dcbeb67731f2abb67f13d3c63d5..

index ..386d879cf348714a303e786cb6749bdd57461acc 100644

--- a/src/scrollbar.h
+++ b/src/scrollbar.h
@@ -18,6 +18,7 @@ enum sb_state {
 };

 struct scrollBar_t {
+  rxvt_term *term;
   char            state;        /* scrollbar state                          */
   char            init;         /* scrollbar has been initialised           */
   unsigned int    beg;          /* slider sub-window begin height           */
@@ -35,6 +36,7 @@ struct scrollBar_t {
   Window          win;
   Cursor          leftptr_cursor;
   int             (rxvt_term::*update)(int, int, int, int);
+  void setup (rxvt_term *);

   bool upButton (int y)
   {

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

-- Response ended

-- Page fetched on Sun Jun 2 12:18:30 2024