new macros in dispextern.h, frame.h and window.h.
window_width - 1
- (has_vertical_scroll_bars
- ? FRAME_SCROLL_BAR_COLS (XFRAME (window->frame))
- : (window_width + window_left != frame_width))
+ ? WINDOW_CONFIG_SCROLL_BAR_COLS (window)
+ : (window_width + window_left != frame_cols))
where
- window_width is XFASTINT (w->width),
- window_left is XFASTINT (w->left),
+ window_width is XFASTINT (w->total_cols),
+ window_left is XFASTINT (w->left_col),
has_vertical_scroll_bars is
- FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WINDOW_FRAME (window)))
- and frame_width = FRAME_WIDTH (XFRAME (window->frame))
+ WINDOW_HAS_VERTICAL_SCROLL_BAR (window)
+ and frame_cols = FRAME_COLS (XFRAME (window->frame))
- Or you can let window_internal_width do this all for you, and write:
- window_internal_width (w) - 1
+ Or you can let window_box_text_cols do this all for you, and write:
+ window_box_text_cols (w) - 1
The `-1' accounts for the continuation-line backslashes; the rest
accounts for window borders if the window is split horizontally, and
{
if (hscroll
|| (truncate_partial_width_windows
- && width + 1 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (win))))
+ && width + 1 < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))
|| !NILP (current_buffer->truncate_lines))
{
/* Truncating: skip to newline, unless we are already past
register int from, vtarget;
struct window *w;
{
- int width = window_internal_width (w) - 1;
+ /* We don't need to make room for continuation marks (we have fringes now),
+ so hould we really subtract 1 here if FRAME_WINDOW_P ? ++KFS */
+ int width = window_box_text_cols (w) - 1;
int hscroll = XINT (w->hscroll);
struct position pos;
/* vpos is cumulative vertical position, changed as from is changed */
CHECK_LIVE_WINDOW (window);
f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
- xpos = (FONT_WIDTH (FRAME_FONT (f))
- * XFASTINT (XWINDOW (window)->left));
- ypos = (FRAME_LINE_HEIGHT (f)
- * XFASTINT (XWINDOW (window)->top));
+ xpos = WINDOW_LEFT_EDGE_X (XWINDOW (window));
+ ypos = WINDOW_TOP_EDGE_Y (XWINDOW (window));
}
else
/* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME,
return;
#endif
sf = SELECTED_FRAME ();
- cursor_to (FRAME_HEIGHT (sf) - 1, 0);
- clear_end_of_line (FRAME_WIDTH (sf));
+ cursor_to (FRAME_LINES (sf) - 1, 0);
+ clear_end_of_line (FRAME_COLS (sf));
/* clear_end_of_line may move the cursor */
- cursor_to (FRAME_HEIGHT (sf) - 1, 0);
+ cursor_to (FRAME_LINES (sf) - 1, 0);
#if defined (IBMR2AIX) && defined (AIXHFT)
{
/* HFT devices normally use ^J as a LF/CR. We forced it to
{
struct frame * f = PICK_FRAME ();
- clear_end_of_line (FRAME_WIDTH (f) - 1);
- ins_del_lines (cursor_coords.Y, FRAME_HEIGHT (f) - cursor_coords.Y - 1);
+ clear_end_of_line (FRAME_COLS (f) - 1);
+ ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1);
}
/* Clear the frame. */
GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info);
/* Remember that the screen buffer might be wider than the window. */
- n = FRAME_HEIGHT (f) * info.dwSize.X;
+ n = FRAME_LINES (f) * info.dwSize.X;
dest.X = dest.Y = 0;
FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r);
if (n < 0)
{
scroll.Top = vpos - n;
- scroll.Bottom = FRAME_HEIGHT (f);
+ scroll.Bottom = FRAME_LINES (f);
dest.Y = vpos;
}
else
{
scroll.Top = vpos;
- scroll.Bottom = FRAME_HEIGHT (f) - n;
+ scroll.Bottom = FRAME_LINES (f) - n;
dest.Y = vpos + n;
}
scroll.Left = 0;
- scroll.Right = FRAME_WIDTH (f);
+ scroll.Right = FRAME_COLS (f);
dest.X = 0;
for (i = scroll.Bottom; i < dest.Y; i++)
{
move_cursor (i, 0);
- clear_end_of_line (FRAME_WIDTH (f));
+ clear_end_of_line (FRAME_COLS (f));
}
}
}
for (i = nb; i < scroll.Top; i++)
{
move_cursor (i, 0);
- clear_end_of_line (FRAME_WIDTH (f));
+ clear_end_of_line (FRAME_COLS (f));
}
}
}
if (direction == LEFT)
{
scroll.Left = cursor_coords.X + dist;
- scroll.Right = FRAME_WIDTH (f) - 1;
+ scroll.Right = FRAME_COLS (f) - 1;
}
else
{
scroll.Left = cursor_coords.X;
- scroll.Right = FRAME_WIDTH (f) - dist - 1;
+ scroll.Right = FRAME_COLS (f) - dist - 1;
}
dest.X = cursor_coords.X;
if (w32_use_full_screen_buffer)
{
- FRAME_HEIGHT (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */
- SET_FRAME_WIDTH (SELECTED_FRAME (), info.dwSize.X); /* characters per line */
+ FRAME_LINES (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */
+ SET_FRAME_COLS (SELECTED_FRAME (), info.dwSize.X); /* characters per line */
}
else
{
/* Lines per page. Use buffer coords instead of buffer size. */
- FRAME_HEIGHT (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom -
+ FRAME_LINES (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom -
info.srWindow.Top;
/* Characters per line. Use buffer coords instead of buffer size. */
- SET_FRAME_WIDTH (SELECTED_FRAME (), 1 + info.srWindow.Right -
+ SET_FRAME_COLS (SELECTED_FRAME (), 1 + info.srWindow.Right -
info.srWindow.Left);
}
CHECK_LIVE_WINDOW (window);
f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
- xpos = (FONT_WIDTH (FRAME_FONT (f))
- * XFASTINT (XWINDOW (window)->left));
- ypos = (FRAME_LINE_HEIGHT (f)
- * XFASTINT (XWINDOW (window)->top));
+ xpos = WINDOW_LEFT_EDGE_X (XWINDOW (window));
+ ypos = WINDOW_TOP_EDGE_Y (XWINDOW (window));
}
else
/* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME,
/* Force the window size to be recomputed so that the frame's text
area remains the same, if menubar has just been created. */
if (old_widget == NULL)
- x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+ x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
}
UNBLOCK_INPUT;
int* pixel_height;
{
struct frame* f = ew->emacs_frame.frame;
- *pixel_width = FONT_WIDTH (f->output_data.x->font);
- *pixel_height = f->output_data.x->line_height;
+ *pixel_width = FRAME_COLUMN_WIDTH (f);
+ *pixel_height = FRAME_LINE_HEIGHT (f);
}
static void
int* char_height;
{
struct frame* f = ew->emacs_frame.frame;
- *char_width = PIXEL_TO_CHAR_WIDTH (f, (int) pixel_width);
- *char_height = PIXEL_TO_CHAR_HEIGHT (f, (int) pixel_height);
+ *char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width);
+ *char_height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (int) pixel_height);
}
static void
Dimension* pixel_height;
{
struct frame* f = ew->emacs_frame.frame;
- *pixel_width = CHAR_TO_PIXEL_WIDTH (f, char_width);
- *pixel_height = CHAR_TO_PIXEL_HEIGHT (f, char_height);
+ *pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width);
+ *pixel_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, char_height);
}
static void
*/
/* Hairily merged geometry */
- unsigned int w = ew->emacs_frame.frame->width;
- unsigned int h = ew->emacs_frame.frame->height;
+ unsigned int w = FRAME_COLS (ew->emacs_frame.frame);
+ unsigned int h = FRAME_LINES (ew->emacs_frame.frame);
Widget wmshell = get_wm_shell ((Widget) ew);
/* Each Emacs shell is now independent and top-level. */
}
#endif /* 0 */
{
- struct frame* frame = ew->emacs_frame.frame;
+ struct frame *f = ew->emacs_frame.frame;
Dimension pixel_width, pixel_height;
/* Take into account the size of the scrollbar. Always use the
might end up with a frame width that is not a multiple of the
frame's character width which is bad for vertically split
windows. */
- frame->output_data.x->vertical_scroll_bar_extra
- = (!FRAME_HAS_VERTICAL_SCROLL_BARS (frame)
- ? 0
- : (FRAME_SCROLL_BAR_COLS (frame)
- * FONT_WIDTH (frame->output_data.x->font)));
+ f->scroll_bar_actual_width
+ = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
- compute_fringe_widths (frame, 0);
+ compute_fringe_widths (f, 0);
#if 0 /* This can run Lisp code, and it is dangerous to give
out the frame to Lisp code before it officially exists.
This is handled in Fx_create_frame so not needed here. */
- change_frame_size (frame, h, w, 1, 0, 0);
+ change_frame_size (f, h, w, 1, 0, 0);
#endif
char_to_pixel_size (ew, w, h, &pixel_width, &pixel_height);
ew->core.width = pixel_width;
update_various_frame_slots (ew)
EmacsFrame ew;
{
- struct x_output *x = ew->emacs_frame.frame->output_data.x;
- x->pixel_height = ew->core.height + x->menubar_height;
- x->pixel_width = ew->core.width;
- x->internal_border_width = ew->emacs_frame.internal_border_width;
+ struct frame *f = ew->emacs_frame.frame;
+ struct x_output *x = f->output_data.x;
+ FRAME_PIXEL_HEIGHT (f) = ew->core.height + x->menubar_height;
+ FRAME_PIXEL_WIDTH (f) = ew->core.width;
+ f->internal_border_width = ew->emacs_frame.internal_border_width;
}
update_from_various_frame_slots (ew)
EmacsFrame ew;
{
- struct x_output *x = ew->emacs_frame.frame->output_data.x;
- ew->core.height = x->pixel_height - x->menubar_height;
- ew->core.width = x->pixel_width;
+ struct frame *f = ew->emacs_frame.frame;
+ struct x_output *x = f->output_data.x;
+ ew->core.height = FRAME_PIXEL_HEIGHT (f) - x->menubar_height;
+ ew->core.width = FRAME_PIXEL_WIDTH (f);
ew->core.background_pixel = x->background_pixel;
- ew->emacs_frame.internal_border_width = x->internal_border_width;
+ ew->emacs_frame.internal_border_width = f->internal_border_width;
ew->emacs_frame.font = x->font;
ew->emacs_frame.foreground_pixel = x->foreground_pixel;
ew->emacs_frame.cursor_color = x->cursor_pixel;
}
/* Update the font field in frame */
- ew->emacs_frame.frame->output_data.x->font = ew->emacs_frame.font;
+ FRAME_FONT (ew->emacs_frame.frame) = ew->emacs_frame.font;
#endif
update_from_various_frame_slots (ew);
if (columns < 3) columns = 3; /* no way buddy */
check_frame_size (f, &rows, &columns);
- f->output_data.x->vertical_scroll_bar_extra
- = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
- ? 0
- : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font)));
+ f->scroll_bar_actual_width
+ = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
compute_fringe_widths (f, 0);
/* Something is really strange here wrt to the border width:
Apparently, XtNwidth and XtNheight include the border, so we have
to add it here. But the XtNborderWidth set for the widgets has
- no similarity to what f->output_data.x->border_width is set to. */
+ no similarity to what f->border_width is set to. */
XtVaGetValues (widget, XtNborderWidth, &border_width, NULL);
pixel_height += 2 * border_width;
pixel_width += 2 * border_width;
EmacsFrame ew = (EmacsFrame) widget;
FRAME_PTR f = ew->emacs_frame.frame;
- ew->emacs_frame.internal_border_width
- = f->output_data.x->internal_border_width;
+ ew->emacs_frame.internal_border_width = f->internal_border_width;
}