changeset 16270:4547dae187e9

(vertical_scroll_bar_type): Add enumerated none/left/right type for identifying vertical scroll bars. (struct frame): Use vertical_scroll_bar_type. (FRAME_HAS_VERTICAL_SCROLL_BARS): Use vertical scroll bar type. (FRAME_VERTICAL_SCROLL_BAR_TYPE): New macro. (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT): New macros. (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT): New macros. (FRAME_SCROLL_BAR_WIDTH, FRAME_LEFT_SCROLL_BAR_WIDTH): New macros. (FRAME_WINDOW_WIDTH, FRAME_WINDOW_WIDTH_ARG): New macros. (SET_FRAME_WIDTH): New macro. (WINDOW_VERTICAL_SCROLL_BAR_COLUMN): Modify to handle left-side croll bars too.
author Richard M. Stallman <rms@gnu.org>
date Sat, 21 Sep 1996 22:31:58 +0000
parents 79e6c47054c5
children 00bece0cd6c2
files src/frame.h
diffstat 1 files changed, 30 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/frame.h	Sat Sep 21 18:42:26 1996 +0000
+++ b/src/frame.h	Sat Sep 21 22:31:58 1996 +0000
@@ -35,6 +35,9 @@
 enum output_method
 { output_termcap, output_x_window, output_msdos_raw, output_win32 };
 
+enum vertical_scroll_bar_type
+{ vertical_scroll_bar_none, vertical_scroll_bar_left, vertical_scroll_bar_right };
+
 struct frame
 {
   EMACS_INT size;
@@ -247,7 +250,7 @@
 
   /* If can_have_scroll_bars is non-zero, this is non-zero if we should
      actually display them on this frame.  */
-  char has_vertical_scroll_bars;
+  enum vertical_scroll_bar_type vertical_scroll_bar_type;
 
   /* Non-0 means raise this frame to the top of the heap when selected.  */
   char auto_raise;
@@ -359,9 +362,27 @@
 #define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos
 #define FRAME_FOCUS_FRAME(f) (f)->focus_frame
 #define FRAME_CAN_HAVE_SCROLL_BARS(f) ((f)->can_have_scroll_bars)
-#define FRAME_HAS_VERTICAL_SCROLL_BARS(f) ((f)->has_vertical_scroll_bars)
+#define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
+#define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
+     ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
+#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
+     ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
+#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
+     ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
 #define FRAME_SCROLL_BAR_PIXEL_WIDTH(f) ((f)->scroll_bar_pixel_width)
 #define FRAME_SCROLL_BAR_COLS(f) ((f)->scroll_bar_cols)
+#define FRAME_LEFT_SCROLL_BAR_WIDTH(f) \
+     (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
+      ? FRAME_SCROLL_BAR_COLS (f) \
+      : 0)
+#define FRAME_SCROLL_BAR_WIDTH(f) \
+     (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
+      ? FRAME_SCROLL_BAR_COLS (f) \
+      : 0)
+#define FRAME_WINDOW_WIDTH_ARG(f, width) \
+     ((width) + FRAME_SCROLL_BAR_WIDTH (f))
+#define FRAME_WINDOW_WIDTH(f) ((f)->width + FRAME_SCROLL_BAR_WIDTH (f))
+#define SET_FRAME_WIDTH(f,val) ((f)->width = (val))
 #define FRAME_SCROLL_BARS(f) ((f)->scroll_bars)
 #define FRAME_CONDEMNED_SCROLL_BARS(f) ((f)->condemned_scroll_bars)
 #define FRAME_MENU_BAR_ITEMS(f) ((f)->menu_bar_items)
@@ -448,11 +469,13 @@
    we have extra space allocated for it.  Otherwise, the scroll bar
    takes over the window's rightmost columns.  */
 #define WINDOW_VERTICAL_SCROLL_BAR_COLUMN(w) \
-  (((XINT ((w)->left) + XINT ((w)->width)) \
-    < FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \
-   ? (XINT ((w)->left) + XINT ((w)->width) \
-      - FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (w)))) \
-   : FRAME_WIDTH (XFRAME (WINDOW_FRAME (w))))
+  (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (XFRAME (WINDOW_FRAME (w))) ? \
+    (((XINT ((w)->left) + XINT ((w)->width)) \
+      < FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \
+     ? (XINT ((w)->left) + XINT ((w)->width) \
+       - FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (w)))) \
+     : FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \
+  : XINT ((w)->left))
 
 /* Return the height in lines of the vertical scroll bar in w.  If the
    window has a mode line, don't make the scroll bar extend that far.  */