-- 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: 85f972b15db884250a43ac78bc6d92d02fe6ac15:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

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

commit 85f972b15db884250a43ac78bc6d92d02fe6ac15
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Mon Aug 22 17:23:56 2011 +0000

    Convert scrollbar macros to inline functions.

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

index 2abe41b440116de7e3caf0e32a8ea43f5e494832..

index ..bfff709afdde9206247fac29f1f472b207372b47 100644

--- a/src/command.C
+++ b/src/command.C
@@ -1668,7 +1668,7 @@ rxvt_term::x_cb (XEvent &ev)
                           &unused_root_x, &unused_root_y,
                           &ev.xbutton.x, &ev.xbutton.y,
                           &unused_mask);
-            scr_move_to (scrollbar_position (ev.xbutton.y) - csrO,
+            scr_move_to (scrollBar.position (ev.xbutton.y) - csrO,
                          scrollBar.size ());
             want_refresh = 1;
             scrollBar.show (1);
@@ -2046,9 +2046,9 @@ rxvt_term::button_press (XButtonEvent &ev)
                     }

                   if (scrollBar.style == R_SB_XTERM
-                      || scrollbar_above_slider (ev.y)
-                      || scrollbar_below_slider (ev.y))
-                    scr_move_to (scrollbar_position (ev.y) - csrO, scrollBar.size ());
+                      || scrollBar.above_slider (ev.y)
+                      || scrollBar.below_slider (ev.y))
+                    scr_move_to (scrollBar.position (ev.y) - csrO, scrollBar.size ());

                   scrollBar.state = STATE_MOTION;
                   break;
@@ -2061,13 +2061,13 @@ rxvt_term::button_press (XButtonEvent &ev)
                 case Button3:
                   if (scrollBar.style != R_SB_XTERM)
                     {
-                      if (scrollbar_above_slider (ev.y))
+                      if (scrollBar.above_slider (ev.y))
 # ifdef RXVT_SCROLL_FULL
                         scr_page (UP, nrow - 1);
 # else
                         scr_page (UP, nrow / 4);
 # endif
-                      else if (scrollbar_below_slider (ev.y))
+                      else if (scrollBar.below_slider (ev.y))
 # ifdef RXVT_SCROLL_FULL
                         scr_page (DN, nrow - 1);
 # else
@@ -2080,7 +2080,7 @@ rxvt_term::button_press (XButtonEvent &ev)
                     {
                       scr_page ((ev.button == Button1 ? DN : UP),
                                 (nrow
-                                 * scrollbar_position (ev.y)
+                                 * scrollBar.position (ev.y)
                                  / scrollBar.size ()));
                     }

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

index 7dea0d407daf93ffe682deebf8f35c04205413aa..

index ..6aaff70491eff58fa6a9736ec81f89ec26c0f921 100644

--- a/src/scrollbar.h
+++ b/src/scrollbar.h
@@ -104,6 +104,19 @@ struct scrollBar_t
   {
     return width + shadow * 2;
   }
+  bool above_slider (int y)
+  {
+    return y < top;
+  }
+  bool below_slider (int y)
+  {
+    return y > bot;
+  }
+  int position (int y)
+  {
+    return y - beg;
+  }
+

 #if defined(NEXT_SCROLLBAR)
   GC              blackGC,
@@ -149,10 +162,6 @@ private:
   void init_next ();
 };

-#define scrollbar_above_slider(y)       ((y) < scrollBar.top)
-#define scrollbar_below_slider(y)       ((y) > scrollBar.bot)
-#define scrollbar_position(y)           ((y) - scrollBar.beg)
-
  /*
   *    +-------------+
   *    |             | <---< SB_PADDING

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

-- Response ended

-- Page fetched on Sun Jun 2 09:17:45 2024