summaryrefslogtreecommitdiff
path: root/src/window.h
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2013-03-20 15:29:37 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2013-03-20 15:29:37 +0400
commit5f24fa51a07664e81d4c710fe310d2c2fbea8bb5 (patch)
tree4d5681a0ae85865f263f6a29ea41dcf3e4ed41e8 /src/window.h
parent96061a21804d6f7ac3b1371470a288344f5f62cd (diff)
downloademacs-5f24fa51a07664e81d4c710fe310d2c2fbea8bb5.tar.gz
* window.h (struct window): Convert left_col, top_line, total_lines
and total_cols from Lisp_Objects to integers. Adjust comments. (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines): Remove. (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL) (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion. * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c: Adjust users where appropriate.
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h57
1 files changed, 18 insertions, 39 deletions
diff --git a/src/window.h b/src/window.h
index 4af8dbf1591..4f6374b9d3e 100644
--- a/src/window.h
+++ b/src/window.h
@@ -112,20 +112,14 @@ struct window
/* The window this one is a child of. */
Lisp_Object parent;
- /* The upper left corner coordinates of this window, as integers
- relative to upper left corner of frame = 0, 0. */
- Lisp_Object left_col;
- Lisp_Object top_line;
-
- /* The size of the window. */
- Lisp_Object total_lines;
- Lisp_Object total_cols;
-
- /* The normal size of the window. */
+ /* The normal size of the window. These are fractions, but we do
+ not use C doubles to avoid creating new Lisp_Float objects while
+ interfacing Lisp in Fwindow_normal_size. */
Lisp_Object normal_lines;
Lisp_Object normal_cols;
- /* New sizes of the window. */
+ /* New sizes of the window. Note that Lisp code may set new_normal
+ to something beyond an integer, so C int can't be used here. */
Lisp_Object new_total;
Lisp_Object new_normal;
@@ -221,6 +215,15 @@ struct window
/* Number saying how recently window was selected. */
int use_time;
+ /* The upper left corner coordinates of this window,
+ relative to upper left corner of frame = 0, 0. */
+ int left_col;
+ int top_line;
+
+ /* The size of the window. */
+ int total_lines;
+ int total_cols;
+
/* Number of columns display within the window is scrolled to the left. */
ptrdiff_t hscroll;
@@ -354,11 +357,6 @@ wset_frame (struct window *w, Lisp_Object val)
w->frame = val;
}
WINDOW_INLINE void
-wset_left_col (struct window *w, Lisp_Object val)
-{
- w->left_col = val;
-}
-WINDOW_INLINE void
wset_next (struct window *w, Lisp_Object val)
{
w->next = val;
@@ -374,21 +372,6 @@ wset_redisplay_end_trigger (struct window *w, Lisp_Object val)
w->redisplay_end_trigger = val;
}
WINDOW_INLINE void
-wset_top_line (struct window *w, Lisp_Object val)
-{
- w->top_line = val;
-}
-WINDOW_INLINE void
-wset_total_cols (struct window *w, Lisp_Object val)
-{
- w->total_cols = val;
-}
-WINDOW_INLINE void
-wset_total_lines (struct window *w, Lisp_Object val)
-{
- w->total_lines = val;
-}
-WINDOW_INLINE void
wset_vertical_scroll_bar (struct window *w, Lisp_Object val)
{
w->vertical_scroll_bar = val;
@@ -461,14 +444,12 @@ wset_next_buffers (struct window *w, Lisp_Object val)
/* Return the width of window W in canonical column units.
This includes scroll bars and fringes. */
-#define WINDOW_TOTAL_COLS(W) \
- (XFASTINT (W->total_cols))
+#define WINDOW_TOTAL_COLS(W) (W)->total_cols
/* Return the height of window W in canonical line units.
This includes header and mode lines, if any. */
-#define WINDOW_TOTAL_LINES(W) \
- (XFASTINT (W->total_lines))
+#define WINDOW_TOTAL_LINES(W) (W)->total_lines
/* Return the total pixel width of window W. */
@@ -495,8 +476,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
/* Return the canonical frame column at which window W starts.
This includes a left-hand scroll bar, if any. */
-#define WINDOW_LEFT_EDGE_COL(W) \
- (XFASTINT (W->left_col))
+#define WINDOW_LEFT_EDGE_COL(W) (W)->left_col
/* Return the canonical frame column before which window W ends.
This includes a right-hand scroll bar, if any. */
@@ -507,8 +487,7 @@ wset_next_buffers (struct window *w, Lisp_Object val)
/* Return the canonical frame line at which window W starts.
This includes a header line, if any. */
-#define WINDOW_TOP_EDGE_LINE(W) \
- (XFASTINT (W->top_line))
+#define WINDOW_TOP_EDGE_LINE(W) (W)->top_line
/* Return the canonical frame line before which window W ends.
This includes a mode line, if any. */