summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1996-09-21 03:31:53 +0000
committerRichard M. Stallman <rms@gnu.org>1996-09-21 03:31:53 +0000
commit015f2868fc2526292a7108d66875d80c7ad7423f (patch)
tree2e18d0d885a85f90a437e8078417824241672dcd
parentd2b2c3d74d76bc2da71109639d2a65a98544f1b9 (diff)
downloademacs-015f2868fc2526292a7108d66875d80c7ad7423f.tar.gz
(WINDOW_LEFT_MARGIN): New macro.
(WINDOW_RIGHT_EDGE, WINDOW_RIGHT_MARGIN): New macros. (WINDOW_FULL_WIDTH_P, WINDOW_RIGHTMOST_P): New macros.
-rw-r--r--src/window.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/window.h b/src/window.h
index 0b0e0aa256d..ba2f81e53d2 100644
--- a/src/window.h
+++ b/src/window.h
@@ -188,6 +188,40 @@ struct window
#define MINI_WINDOW_P(W) (!EQ ((W)->mini_p, Qnil))
+/* Return the frame column at which the text in window W starts.
+ This is different from the `left' field because it does not include
+ a left-hand scroll bar if any. */
+
+#define WINDOW_LEFT_MARGIN(W) \
+ (XFASTINT ((W)->left) \
+ + FRAME_LEFT_SCROLL_BAR_WIDTH (XFRAME (WINDOW_FRAME (W))))
+
+/* Return the frame column before window W ends.
+ This includes a right-hand scroll bar, if any. */
+
+#define WINDOW_RIGHT_EDGE(W) \
+ (XFASTINT ((W)->left) + XFASTINT ((W)->width))
+
+/* Return the frame column before which the text in window W ends.
+ This is different from WINDOW_RIGHT_EDGE because it does not include
+ a right-hand scroll bar if any. */
+
+#define WINDOW_RIGHT_MARGIN(W) \
+ (WINDOW_RIGHT_EDGE (W) \
+ - (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (XFRAME (WINDOW_FRAME (W))) \
+ ? FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (W))) \
+ : 0))
+
+/* 1 if window W takes up the full width of its frame. */
+
+#define WINDOW_FULL_WIDTH_P(W) \
+ (XFASTINT ((W)->width) == FRAME_WINDOW_WIDTH (XFRAME (WINDOW_FRAME (W))))
+
+/* 1 if window W's has no other windows to its right in its frame. */
+
+#define WINDOW_RIGHTMOST_P(W) \
+ (WINDOW_RIGHT_EDGE (W) == FRAME_WINDOW_WIDTH (XFRAME (WINDOW_FRAME (W))))
+
/* This is the window in which the terminal's cursor should
be left when nothing is being done with it. This must
always be a leaf window, and its buffer is selected by