Commit 5f24fa51 authored by Dmitry Antipov's avatar Dmitry Antipov

* 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.
parent 96061a21
2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
* 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.
2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
* frame.h (struct frame): Drop resx and resy because the same data is
......
......@@ -363,7 +363,7 @@ margin_glyphs_to_reserve (struct window *w, int total_glyphs, Lisp_Object margin
if (NUMBERP (margin))
{
int width = XFASTINT (w->total_cols);
int width = w->total_cols;
double d = max (0, XFLOATINT (margin));
d = min (width / 2 - 1, d);
n = (int) ((double) total_glyphs / width * d);
......@@ -1776,7 +1776,7 @@ required_matrix_width (struct window *w)
}
#endif /* HAVE_WINDOW_SYSTEM */
return XINT (w->total_cols);
return w->total_cols;
}
......@@ -2114,10 +2114,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
/* Set window dimensions to frame dimensions and allocate or
adjust glyph matrices of W. */
wset_top_line (w, make_number (0));
wset_left_col (w, make_number (0));
wset_total_lines (w, make_number (FRAME_MENU_BAR_LINES (f)));
wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f)));
w->top_line = 0;
w->left_col = 0;
w->total_lines = FRAME_MENU_BAR_LINES (f);
w->total_cols = FRAME_TOTAL_COLS (f);
allocate_matrices_for_window_redisplay (w);
}
#endif /* not USE_X_TOOLKIT && not USE_GTK */
......@@ -2140,10 +2140,10 @@ adjust_frame_glyphs_for_window_redisplay (struct frame *f)
else
w = XWINDOW (f->tool_bar_window);
wset_top_line (w, make_number (FRAME_MENU_BAR_LINES (f)));
wset_left_col (w, make_number (0));
wset_total_lines (w, make_number (FRAME_TOOL_BAR_LINES (f)));
wset_total_cols (w, make_number (FRAME_TOTAL_COLS (f)));
w->top_line = FRAME_MENU_BAR_LINES (f);
w->left_col = 0;
w->total_lines = FRAME_TOOL_BAR_LINES (f);
w->total_cols = FRAME_TOTAL_COLS (f);
allocate_matrices_for_window_redisplay (w);
}
#endif
......@@ -5583,7 +5583,7 @@ change_frame_size_1 (struct frame *f, int newheight, int newwidth,
FrameCols (FRAME_TTY (f)) = newwidth;
if (WINDOWP (f->tool_bar_window))
wset_total_cols (XWINDOW (f->tool_bar_window), make_number (newwidth));
XWINDOW (f->tool_bar_window)->total_cols = newwidth;
}
FRAME_LINES (f) = newheight;
......
......@@ -155,8 +155,8 @@ set_menu_bar_lines_1 (Lisp_Object window, int n)
struct window *w = XWINDOW (window);
w->last_modified = 0;
wset_top_line (w, make_number (XFASTINT (w->top_line) + n));
wset_total_lines (w, make_number (XFASTINT (w->total_lines) - n));
w->top_line += n;
w->total_lines -= n;
/* Handle just the top child in a vertical split. */
if (!NILP (w->vchild))
......@@ -332,14 +332,14 @@ make_frame (int mini_p)
SET_FRAME_COLS (f, 10);
FRAME_LINES (f) = 10;
wset_total_cols (XWINDOW (root_window), make_number (10));
wset_total_lines (XWINDOW (root_window), make_number (mini_p ? 9 : 10));
XWINDOW (root_window)->total_cols = 10;
XWINDOW (root_window)->total_lines = mini_p ? 9 : 10;
if (mini_p)
{
wset_total_cols (XWINDOW (mini_window), make_number (10));
wset_top_line (XWINDOW (mini_window), make_number (9));
wset_total_lines (XWINDOW (mini_window), make_number (1));
XWINDOW (mini_window)->total_cols = 10;
XWINDOW (mini_window)->top_line = 9;
XWINDOW (mini_window)->total_lines = 1;
}
/* Choose a buffer for the frame's root window. */
......
......@@ -5774,8 +5774,8 @@ Text larger than the specified size is clipped. */)
/* Set up the frame's root window. */
w = XWINDOW (FRAME_ROOT_WINDOW (f));
wset_left_col (w, make_number (0));
wset_top_line (w, make_number (0));
w->left_col = 0;
w->top_line = 0;
if (CONSP (Vx_max_tooltip_size)
&& INTEGERP (XCAR (Vx_max_tooltip_size))
......@@ -5783,13 +5783,13 @@ Text larger than the specified size is clipped. */)
&& INTEGERP (XCDR (Vx_max_tooltip_size))
&& XINT (XCDR (Vx_max_tooltip_size)) > 0)
{
wset_total_cols (w, XCAR (Vx_max_tooltip_size));
wset_total_lines (w, XCDR (Vx_max_tooltip_size));
w->total_cols = XFASTINT (XCAR (Vx_max_tooltip_size));
w->total_lines = XFASTINT (XCDR (Vx_max_tooltip_size));
}
else
{
wset_total_cols (w, make_number (80));
wset_total_lines (w, make_number (40));
w->total_cols = 80;
w->total_lines = 40;
}
FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
......@@ -5860,7 +5860,7 @@ Text larger than the specified size is clipped. */)
/* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
not in pixels. */
width /= WINDOW_FRAME_COLUMN_WIDTH (w);
wset_total_cols (w, make_number (width));
w->total_cols = width;
FRAME_TOTAL_COLS (f) = width;
adjust_glyphs (f);
w->pseudo_window_p = 1;
......
This diff is collapsed.
......@@ -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. */
......
......@@ -979,7 +979,7 @@ window_text_bottom_y (struct window *w)
int
window_box_width (struct window *w, int area)
{
int cols = XFASTINT (w->total_cols);
int cols = w->total_cols;
int pixels = 0;
if (!w->pseudo_window_p)
......@@ -29218,13 +29218,13 @@ init_xdisp (void)
echo_area_window = minibuf_window;
wset_top_line (r, make_number (FRAME_TOP_MARGIN (f)));
wset_total_lines
(r, make_number (FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f)));
wset_total_cols (r, make_number (FRAME_COLS (f)));
wset_top_line (m, make_number (FRAME_LINES (f) - 1));
wset_total_lines (m, make_number (1));
wset_total_cols (m, make_number (FRAME_COLS (f)));
r->top_line = FRAME_TOP_MARGIN (f);
r->total_lines = FRAME_LINES (f) - 1 - FRAME_TOP_MARGIN (f);
r->total_cols = FRAME_COLS (f);
m->top_line = FRAME_LINES (f) - 1;
m->total_lines = 1;
m->total_cols = FRAME_COLS (f);
scratch_glyph_row.glyphs[TEXT_AREA] = scratch_glyphs;
scratch_glyph_row.glyphs[TEXT_AREA + 1]
......
......@@ -5021,23 +5021,23 @@ Text larger than the specified size is clipped. */)
/* Set up the frame's root window. */
w = XWINDOW (FRAME_ROOT_WINDOW (f));
wset_left_col (w, make_number (0));
wset_top_line (w, make_number (0));
w->left_col = 0;
w->top_line = 0;
if (CONSP (Vx_max_tooltip_size)
&& RANGED_INTEGERP (1, XCAR (Vx_max_tooltip_size), INT_MAX)
&& RANGED_INTEGERP (1, XCDR (Vx_max_tooltip_size), INT_MAX))
{
wset_total_cols (w, XCAR (Vx_max_tooltip_size));
wset_total_lines (w, XCDR (Vx_max_tooltip_size));
w->total_cols = XFASTINT (XCAR (Vx_max_tooltip_size));
w->total_lines = XFASTINT (XCDR (Vx_max_tooltip_size));
}
else
{
wset_total_cols (w, make_number (80));
wset_total_lines (w, make_number (40));
w->total_cols = 80;
w->total_lines = 40;
}
FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
FRAME_TOTAL_COLS (f) = w->total_cols;
adjust_glyphs (f);
w->pseudo_window_p = 1;
......@@ -5104,7 +5104,7 @@ Text larger than the specified size is clipped. */)
/* w->total_cols and FRAME_TOTAL_COLS want the width in columns,
not in pixels. */
width /= WINDOW_FRAME_COLUMN_WIDTH (w);
wset_total_cols (w, make_number (width));
w->total_cols = width;
FRAME_TOTAL_COLS (f) = width;
adjust_glyphs (f);
clear_glyph_matrix (w->desired_matrix);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment