From 8516ba9afe0266423a1666b05d1032345a139457 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sat, 21 Sep 1996 03:31:53 +0000 Subject: [PATCH] (WINDOW_LEFT_MARGIN): New macro. (WINDOW_RIGHT_EDGE, WINDOW_RIGHT_MARGIN): New macros. (WINDOW_FULL_WIDTH_P, WINDOW_RIGHTMOST_P): New macros. --- src/window.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) 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 -- 2.39.2