+/* Return the inside height of a horizontal scroll bar, given the outside
+ height. */
+#define HORIZONTAL_SCROLL_BAR_INSIDE_HEIGHT(f, height) \
+ ((height) \
+ - HORIZONTAL_SCROLL_BAR_TOP_BORDER \
+ - HORIZONTAL_SCROLL_BAR_BOTTOM_BORDER)
+
+/* Return the length of the rectangle within which the left part of the
+ handle must stay. This isn't equivalent to the inside width, because
+ the scroll bar handle has a minimum width.
+
+ This is the real range of motion for the scroll bar, so when we're
+ scaling buffer positions to scroll bar positions, we use this, not
+ HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH. */
+#define HORIZONTAL_SCROLL_BAR_LEFT_RANGE(f, width) \
+ (HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH (f, width) - HORIZONTAL_SCROLL_BAR_MIN_HANDLE)
+
+/* Return the inside width of horizontal scroll bar, given the outside
+ width. See HORIZONTAL_SCROLL_BAR_LEFT_RANGE too. */
+#define HORIZONTAL_SCROLL_BAR_INSIDE_WIDTH(f, width) \
+ ((width) - HORIZONTAL_SCROLL_BAR_LEFT_BORDER - HORIZONTAL_SCROLL_BAR_LEFT_BORDER)
+