new macros in dispextern.h, frame.h and window.h.
#include <gdk/gdkkeysyms.h>
#define FRAME_TOTAL_PIXEL_HEIGHT(f) \
- (PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
+ (FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
\f
xg_set_geometry (f)
FRAME_PTR f;
{
- if (f->output_data.x->size_hint_flags & USPosition)
+ if (f->size_hint_flags & USPosition)
{
- int left = f->output_data.x->left_pos;
- int xneg = f->output_data.x->size_hint_flags & XNegative;
- int top = f->output_data.x->top_pos;
- int yneg = f->output_data.x->size_hint_flags & YNegative;
+ int left = f->left_pos;
+ int xneg = f->size_hint_flags & XNegative;
+ int top = f->top_pos;
+ int yneg = f->size_hint_flags & YNegative;
char geom_str[32];
if (xneg)
top = -top;
sprintf (geom_str, "=%dx%d%c%d%c%d",
- PIXEL_WIDTH (f),
+ FRAME_PIXEL_WIDTH (f),
FRAME_TOTAL_PIXEL_HEIGHT (f),
(xneg ? '-' : '+'), left,
(yneg ? '-' : '+'), top);
int rows;
{
gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
- PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
+ FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
/* base_height is now changed. */
x_wm_set_size_hint (f, 0, 0);
{
int mbheight = FRAME_MENUBAR_HEIGHT (f);
int tbheight = FRAME_TOOLBAR_HEIGHT (f);
- int rows = PIXEL_TO_CHAR_HEIGHT (f, pixelheight - mbheight - tbheight);
- int columns = PIXEL_TO_CHAR_WIDTH (f, pixelwidth);
+ int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (pixelheight
+ - mbheight - tbheight));
+ int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
if (FRAME_GTK_WIDGET (f)
- && (columns != FRAME_WIDTH (f) || rows != FRAME_HEIGHT (f)
- || pixelwidth != PIXEL_WIDTH (f) || pixelheight != PIXEL_HEIGHT (f)))
+ && (columns != FRAME_COLS (f) || rows != FRAME_LINES (f)
+ || pixelwidth != FRAME_PIXEL_WIDTH (f) || pixelheight != FRAME_PIXEL_HEIGHT (f)))
{
struct x_output *x = f->output_data.x;
GtkAllocation all;
int cols;
int rows;
{
- int pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows)
+ int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
int pixelwidth;
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. */
- 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);
- /* CHAR_TO_PIXEL_WIDTH uses vertical_scroll_bar_extra, so call it
+ /* FRAME_TEXT_COLS_TO_PIXEL_WIDTH uses scroll_bar_actual_width, so call it
after calculating that value. */
- pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols);
+ pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
/* Must resize our top level widget. Font size may have changed,
but not rows/cols. */
gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE);
- gtk_widget_set_size_request (wfixed,
- PIXEL_WIDTH (f),
- PIXEL_HEIGHT (f));
+ gtk_widget_set_size_request (wfixed, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
gtk_container_add (GTK_CONTAINER (wtop), wvbox);
gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0);
gtk_widget_modify_style (wfixed, style);
/* GTK does not set any border, and they look bad with GTK. */
- f->output_data.x->border_width = 0;
- f->output_data.x->internal_border_width = 0;
+ f->border_width = 0;
+ f->internal_border_width = 0;
UNBLOCK_INPUT;
gint hint_flags = 0;
int base_width, base_height;
int min_rows = 0, min_cols = 0;
- int win_gravity = f->output_data.x->win_gravity;
+ int win_gravity = f->win_gravity;
if (flags)
{
f->output_data.x->hint_flags = hint_flags;
}
else
- flags = f->output_data.x->size_hint_flags;
+ flags = f->size_hint_flags;
size_hints = f->output_data.x->size_hints;
hint_flags = f->output_data.x->hint_flags;
hint_flags |= GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE;
- size_hints.width_inc = FONT_WIDTH (f->output_data.x->font);
- size_hints.height_inc = f->output_data.x->line_height;
+ size_hints.width_inc = FRAME_COLUMN_WIDTH (f);
+ size_hints.height_inc = FRAME_LINE_HEIGHT (f);
hint_flags |= GDK_HINT_BASE_SIZE;
- base_width = CHAR_TO_PIXEL_WIDTH (f, 0);
- base_height = CHAR_TO_PIXEL_HEIGHT (f, 0)
+ base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
+ base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0)
+ FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
check_frame_size (f, &min_rows, &min_cols);
/* The height has changed, resize outer widget and set columns
rows to what we had before adding the menu bar. */
- xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+ xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
/* The height has changed, resize outer widget and set columns
rows to what we had before removing the menu bar. */
- xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+ xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
/* We do the same as for MOTIF in xterm.c, assume 30 chars per line
rather than the real portion value. This makes the thumb less likely
to resize and that looks better. */
- portion = XFASTINT (XWINDOW (bar->window)->height) * 30;
+ portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
/* When the thumb is at the bottom, position == whole.
So we need to increase `whole' to make space for the thumb. */
whole += portion;
value = max (value, XG_SB_MIN);
/* Assume all lines are of equal size. */
- new_step = size / max (1, FRAME_HEIGHT (f));
+ new_step = size / max (1, FRAME_LINES (f));
if ((int) adj->page_size != size
|| (int) adj->step_increment != new_step)
/* The height has changed, resize outer widget and set columns
rows to what we had before detaching the tool bar. */
- xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+ xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
}
}
/* The height has changed, resize outer widget and set columns
rows to what we had before detaching the tool bar. */
- xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+ xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
}
}
/* The height has changed, resize outer widget and set columns
rows to what we had before adding the tool bar. */
- xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+ xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
}
if (old_req.height != new_req.height)
{
FRAME_TOOLBAR_HEIGHT (f) = new_req.height;
- xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+ xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
}
if (icon_list) g_list_free (icon_list);
/* The height has changed, resize outer widget and set columns
rows to what we had before removing the tool bar. */
- xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+ xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
SET_FRAME_GARBAGED (f);
UNBLOCK_INPUT;
ClientToScreen (FRAME_W32_WINDOW(f), &pt);
/* Remember x_pixels_diff and y_pixels_diff. */
- f->output_data.w32->x_pixels_diff = pt.x - rect.left;
- f->output_data.w32->y_pixels_diff = pt.y - rect.top;
+ f->x_pixels_diff = pt.x - rect.left;
+ f->y_pixels_diff = pt.y - rect.top;
*xptr = pt.x;
*yptr = pt.y;
f->output_data.w32->border_pixel = pix;
- if (FRAME_W32_WINDOW (f) != 0 && f->output_data.w32->border_width > 0)
+ if (FRAME_W32_WINDOW (f) != 0 && f->border_width > 0)
{
if (FRAME_VISIBLE_P (f))
redraw_frame (f);
/* Adjust the frame size so that the client (text) dimensions
remain the same. This depends on FRAME_EXTERNAL_MENU_BAR being
set correctly. */
- x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+ x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
do_pending_window_change (0);
}
adjust_glyphs (f);
/* Don't resize the tool-bar to more than we have room for. */
root_window = FRAME_ROOT_WINDOW (f);
- root_height = XINT (XWINDOW (root_window)->height);
+ root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window));
if (root_height - delta < 1)
{
delta = root_height - 1;
if (delta < 0)
{
int height = FRAME_INTERNAL_BORDER_WIDTH (f);
- int width = PIXEL_WIDTH (f);
- int y = nlines * CANON_Y_UNIT (f);
+ int width = FRAME_PIXEL_WIDTH (f);
+ int y = nlines * FRAME_LINE_HEIGHT (f);
BLOCK_INPUT;
{
void x_set_scroll_bar_default_width (f)
struct frame *f;
{
- int wid = FONT_WIDTH (f->output_data.w32->font);
+ int wid = FRAME_COLUMN_WIDTH (f);
- FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
- FRAME_SCROLL_BAR_COLS (f) = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) +
- wid - 1) / wid;
+ FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
+ FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) +
+ wid - 1) / wid;
}
\f
RECT rect;
rect.left = rect.top = 0;
- rect.right = PIXEL_WIDTH (f);
- rect.bottom = PIXEL_HEIGHT (f);
+ rect.right = FRAME_PIXEL_WIDTH (f);
+ rect.bottom = FRAME_PIXEL_HEIGHT (f);
AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
FRAME_EXTERNAL_MENU_BAR (f));
= CreateWindow (EMACS_CLASS,
f->namebuf,
f->output_data.w32->dwStyle | WS_CLIPCHILDREN,
- f->output_data.w32->left_pos,
- f->output_data.w32->top_pos,
+ f->left_pos,
+ f->top_pos,
rect.right - rect.left,
rect.bottom - rect.top,
NULL,
if (hwnd)
{
- SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font));
- SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height);
- SetWindowLong (hwnd, WND_BORDER_INDEX, f->output_data.w32->internal_border_width);
- SetWindowLong (hwnd, WND_SCROLLBAR_INDEX, f->output_data.w32->vertical_scroll_bar_extra);
+ SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
+ SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
+ SetWindowLong (hwnd, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
+ SetWindowLong (hwnd, WND_SCROLLBAR_INDEX, f->scroll_bar_actual_width);
SetWindowLong (hwnd, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
/* Enable drag-n-drop. */
RECT rect;
rect.left = rect.top = 0;
- rect.right = PIXEL_WIDTH (f);
- rect.bottom = PIXEL_HEIGHT (f);
+ rect.right = FRAME_PIXEL_WIDTH (f);
+ rect.bottom = FRAME_PIXEL_HEIGHT (f);
AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
FRAME_EXTERNAL_MENU_BAR (f));
= CreateWindow (EMACS_CLASS,
f->namebuf,
f->output_data.w32->dwStyle,
- f->output_data.w32->left_pos,
- f->output_data.w32->top_pos,
+ f->left_pos,
+ f->top_pos,
rect.right - rect.left,
rect.bottom - rect.top,
FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */
if (tip_window)
{
- SetWindowLong (tip_window, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font));
- SetWindowLong (tip_window, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height);
- SetWindowLong (tip_window, WND_BORDER_INDEX, f->output_data.w32->internal_border_width);
+ SetWindowLong (tip_window, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
+ SetWindowLong (tip_window, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
+ SetWindowLong (tip_window, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
SetWindowLong (tip_window, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
/* Tip frames have no scrollbars. */
Note that many default values are used. */
/* Normal video */
- gc_values.font = f->output_data.w32->font;
+ gc_values.font = FRAME_FONT (f);
/* Cursor has cursor-color background, background-color foreground. */
gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
/* By default, make scrollbars the system standard width. */
- f->scroll_bar_pixel_width = GetSystemMetrics (SM_CXVSCROLL);
+ FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
f->output_method = output_w32;
f->output_data.w32 =
x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
"scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER);
- /* Dimensions, especially f->height, must be done via change_frame_size.
+ /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
Change will not be effected unless different from the current
- f->height. */
- width = f->width;
- height = f->height;
+ FRAME_LINES (f). */
+ width = FRAME_COLS (f);
+ height = FRAME_LINES (f);
- f->height = 0;
- SET_FRAME_WIDTH (f, 0);
+ FRAME_LINES (f) = 0;
+ SET_FRAME_COLS (f, 0);
change_frame_size (f, height, width, 1, 0, 0);
/* Tell the server what size and position, etc, we want, and how
x_pixel_width (f)
register struct frame *f;
{
- return PIXEL_WIDTH (f);
+ return FRAME_PIXEL_WIDTH (f);
}
int
x_pixel_height (f)
register struct frame *f;
{
- return PIXEL_HEIGHT (f);
+ return FRAME_PIXEL_HEIGHT (f);
}
int
x_char_width (f)
register struct frame *f;
{
- return FONT_WIDTH (f->output_data.w32->font);
+ return FRAME_COLUMN_WIDTH (f);
}
int
x_char_height (f)
register struct frame *f;
{
- return f->output_data.w32->line_height;
+ return FRAME_LINE_HEIGHT (f);
}
int
int height = img->height + 2 * img->vmargin;
if (NILP (pixels))
- size = Fcons (make_float ((double) width / CANON_X_UNIT (f)),
- make_float ((double) height / CANON_Y_UNIT (f)));
+ size = Fcons (make_float ((double) width / FRAME_COLUMN_WIDTH (f)),
+ make_float ((double) height / FRAME_LINE_HEIGHT (f)));
else
size = Fcons (make_number (width), make_number (height));
}
XSETFRAME (frame, f);
buffer = Fget_buffer_create (build_string (" *tip*"));
- Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer);
+ Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (buffer));
current_buffer->truncate_lines = Qnil;
window_prompting = x_figure_window_size (f, parms, 0);
/* No fringes on tip frame. */
- f->output_data.w32->fringes_extra = 0;
- f->output_data.w32->fringe_cols = 0;
- f->output_data.w32->left_fringe_width = 0;
- f->output_data.w32->right_fringe_width = 0;
+ f->fringe_cols = 0;
+ f->left_fringe_width = 0;
+ f->right_fringe_width = 0;
BLOCK_INPUT;
my_create_tip_window (f);
x_default_parameter (f, parms, Qcursor_type, Qbox,
"cursorType", "CursorType", RES_TYPE_SYMBOL);
- /* Dimensions, especially f->height, must be done via change_frame_size.
+ /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
Change will not be effected unless different from the current
- f->height. */
- width = f->width;
- height = f->height;
- f->height = 0;
- SET_FRAME_WIDTH (f, 0);
+ FRAME_LINES (f). */
+ width = FRAME_COLS (f);
+ height = FRAME_LINES (f);
+ FRAME_LINES (f) = 0;
+ SET_FRAME_COLS (f, 0);
change_frame_size (f, height, width, 1, 0, 0);
/* Add `tooltip' frame parameter's default value. */
}
BLOCK_INPUT;
- compute_tip_xy (f, parms, dx, dy, PIXEL_WIDTH (f),
- PIXEL_HEIGHT (f), &root_x, &root_y);
+ compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f),
+ FRAME_PIXEL_HEIGHT (f), &root_x, &root_y);
/* Put tooltip in topmost group and in position. */
SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
/* Set up the frame's root window. */
w = XWINDOW (FRAME_ROOT_WINDOW (f));
- w->left = w->top = make_number (0);
+ w->left_col = w->top_line = make_number (0);
if (CONSP (Vx_max_tooltip_size)
&& INTEGERP (XCAR (Vx_max_tooltip_size))
&& INTEGERP (XCDR (Vx_max_tooltip_size))
&& XINT (XCDR (Vx_max_tooltip_size)) > 0)
{
- w->width = XCAR (Vx_max_tooltip_size);
- w->height = XCDR (Vx_max_tooltip_size);
+ w->total_cols = XCAR (Vx_max_tooltip_size);
+ w->total_lines = XCDR (Vx_max_tooltip_size);
}
else
{
- w->width = make_number (80);
- w->height = make_number (40);
+ w->total_cols = make_number (80);
+ w->total_lines = make_number (40);
}
- f->window_width = XINT (w->width);
+ FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
adjust_glyphs (f);
w->pseudo_window_p = 1;
/* Child of win. */
&child);
- }
+ }
had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
}
if (had_errors) return;
- f->output_data.x->x_pixels_diff = -win_x;
- f->output_data.x->y_pixels_diff = -win_y;
- f->output_data.x->x_pixels_outer_diff = -outer_x;
- f->output_data.x->y_pixels_outer_diff = -outer_y;
+ f->x_pixels_diff = -win_x;
+ f->y_pixels_diff = -win_y;
+
+ FRAME_X_OUTPUT (f)->x_pixels_outer_diff = -outer_x;
+ FRAME_X_OUTPUT (f)->y_pixels_outer_diff = -outer_y;
*xptr = real_x;
*yptr = real_y;
unload_color (f, f->output_data.x->border_pixel);
f->output_data.x->border_pixel = pix;
- if (FRAME_X_WINDOW (f) != 0 && f->output_data.x->border_width > 0)
+ if (FRAME_X_WINDOW (f) != 0 && f->border_width > 0)
{
BLOCK_INPUT;
XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
/* Don't resize the tool-bar to more than we have room for. */
root_window = FRAME_ROOT_WINDOW (f);
- root_height = XINT (XWINDOW (root_window)->height);
+ root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window));
if (root_height - delta < 1)
{
delta = root_height - 1;
if (delta < 0)
{
int height = FRAME_INTERNAL_BORDER_WIDTH (f);
- int width = PIXEL_WIDTH (f);
- int y = nlines * CANON_Y_UNIT (f);
+ int width = FRAME_PIXEL_WIDTH (f);
+ int y = nlines * FRAME_LINE_HEIGHT (f);
BLOCK_INPUT;
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
x_set_scroll_bar_default_width (f)
struct frame *f;
{
- int wid = FONT_WIDTH (f->output_data.x->font);
+ int wid = FRAME_COLUMN_WIDTH (f);
#ifdef USE_TOOLKIT_SCROLL_BARS
/* A minimum width of 14 doesn't look good for toolkit scroll bars. */
int width = 16 + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM;
- FRAME_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid;
- FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = width;
+ FRAME_CONFIG_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid;
+ FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = width;
#else
/* Make the actual width at least 14 pixels and a multiple of a
character width. */
- FRAME_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
+ FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
/* Use all of that space (aside from required margins) for the
scroll bar. */
- FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0;
+ FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 0;
#endif
}
area.width = needed->width;
area.height = needed->height;
- area.x = PIXEL_WIDTH (f) - area.width - FRAME_INTERNAL_BORDER_WIDTH (f);
- area.y = (PIXEL_HEIGHT (f) - area.height
+ area.x = FRAME_PIXEL_WIDTH (f) - area.width - FRAME_INTERNAL_BORDER_WIDTH (f);
+ area.y = (FRAME_PIXEL_HEIGHT (f) - area.height
- FRAME_MENUBAR_HEIGHT (f)
- FRAME_TOOLBAR_HEIGHT (f)
- FRAME_INTERNAL_BORDER_WIDTH (f));
XtSetArg (al[ac], XtNallowShellResize, 1); ac++;
XtSetArg (al[ac], XtNinput, 1); ac++;
XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
- XtSetArg (al[ac], XtNborderWidth, f->output_data.x->border_width); ac++;
+ XtSetArg (al[ac], XtNborderWidth, f->border_width); ac++;
XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++;
XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
is a user-specified or program-specified one.
We pass that information later, in x_wm_set_size_hints. */
{
- int left = f->output_data.x->left_pos;
+ int left = f->left_pos;
int xneg = window_prompting & XNegative;
- int top = f->output_data.x->top_pos;
+ int top = f->top_pos;
int yneg = window_prompting & YNegative;
if (xneg)
left = -left;
if (window_prompting & USPosition)
sprintf (shell_position, "=%dx%d%c%d%c%d",
- PIXEL_WIDTH (f) + extra_borders,
- PIXEL_HEIGHT (f) + menubar_size + extra_borders,
+ FRAME_PIXEL_WIDTH (f) + extra_borders,
+ FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders,
(xneg ? '-' : '+'), left,
(yneg ? '-' : '+'), top);
else
sprintf (shell_position, "=%dx%d",
- PIXEL_WIDTH (f) + extra_borders,
- PIXEL_HEIGHT (f) + menubar_size + extra_borders);
+ FRAME_PIXEL_WIDTH (f) + extra_borders,
+ FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders);
}
len = strlen (shell_position) + 1;
FRAME_X_WINDOW (f)
= XCreateWindow (FRAME_X_DISPLAY (f),
f->output_data.x->parent_desc,
- f->output_data.x->left_pos,
- f->output_data.x->top_pos,
- PIXEL_WIDTH (f), PIXEL_HEIGHT (f),
- f->output_data.x->border_width,
+ f->left_pos,
+ f->top_pos,
+ FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f),
+ f->border_width,
CopyFromParent, /* depth */
InputOutput, /* class */
FRAME_X_VISUAL (f),
Note that many default values are used. */
/* Normal video */
- gc_values.font = f->output_data.x->font->fid;
+ gc_values.font = FRAME_FONT (f)->fid;
gc_values.foreground = f->output_data.x->foreground_pixel;
gc_values.background = f->output_data.x->background_pixel;
gc_values.line_width = 0; /* Means 1 using fast algorithm. */
f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
bzero (f->output_data.x, sizeof (struct x_output));
f->output_data.x->icon_bitmap = -1;
- f->output_data.x->fontset = -1;
+ FRAME_FONTSET (f) = -1;
f->output_data.x->scroll_bar_foreground_pixel = -1;
f->output_data.x->scroll_bar_background_pixel = -1;
#ifdef USE_TOOLKIT_SCROLL_BARS
#ifdef USE_LUCID
/* Prevent lwlib/xlwmenu.c from crashing because of a bug
whereby it fails to get any font. */
- xlwmenu_default_font = f->output_data.x->font;
+ xlwmenu_default_font = FRAME_FONT (f);
#endif
x_default_parameter (f, parms, Qborder_width, make_number (2),
"scrollBarWidth", "ScrollBarWidth",
RES_TYPE_NUMBER);
- /* Dimensions, especially f->height, must be done via change_frame_size.
+ /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
Change will not be effected unless different from the current
- f->height. */
- width = f->width;
- height = f->height;
+ FRAME_LINES (f). */
+ width = FRAME_COLS (f);
+ height = FRAME_LINES (f);
- f->height = 0;
- SET_FRAME_WIDTH (f, 0);
+ SET_FRAME_COLS (f, 0);
+ FRAME_LINES (f) = 0;
change_frame_size (f, height, width, 1, 0, 0);
/* Set up faces after all frame parameters are known. This call
x_pixel_width (f)
register struct frame *f;
{
- return PIXEL_WIDTH (f);
+ return FRAME_PIXEL_WIDTH (f);
}
int
x_pixel_height (f)
register struct frame *f;
{
- return PIXEL_HEIGHT (f);
+ return FRAME_PIXEL_HEIGHT (f);
}
int
x_char_width (f)
register struct frame *f;
{
- return FONT_WIDTH (f->output_data.x->font);
+ return FRAME_COLUMN_WIDTH (f);
}
int
x_char_height (f)
register struct frame *f;
{
- return f->output_data.x->line_height;
+ return FRAME_LINE_HEIGHT (f);
}
int
int height = img->height + 2 * img->vmargin;
if (NILP (pixels))
- size = Fcons (make_float ((double) width / CANON_X_UNIT (f)),
- make_float ((double) height / CANON_Y_UNIT (f)));
+ size = Fcons (make_float ((double) width / FRAME_COLUMN_WIDTH (f)),
+ make_float ((double) height / FRAME_LINE_HEIGHT (f)));
else
size = Fcons (make_number (width), make_number (height));
}
XSETFRAME (frame, f);
buffer = Fget_buffer_create (build_string (" *tip*"));
- Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer);
+ Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
old_buffer = current_buffer;
set_buffer_internal_1 (XBUFFER (buffer));
current_buffer->truncate_lines = Qnil;
f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
bzero (f->output_data.x, sizeof (struct x_output));
f->output_data.x->icon_bitmap = -1;
- f->output_data.x->fontset = -1;
+ FRAME_FONTSET (f) = -1;
f->output_data.x->scroll_bar_foreground_pixel = -1;
f->output_data.x->scroll_bar_background_pixel = -1;
#ifdef USE_TOOLKIT_SCROLL_BARS
x_default_parameter (f, parms, Qcursor_type, Qbox,
"cursorType", "CursorType", RES_TYPE_SYMBOL);
- /* Dimensions, especially f->height, must be done via change_frame_size.
+ /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
Change will not be effected unless different from the current
- f->height. */
- width = f->width;
- height = f->height;
- f->height = 0;
- SET_FRAME_WIDTH (f, 0);
+ FRAME_LINES (f). */
+ width = FRAME_COLS (f);
+ height = FRAME_LINES (f);
+ SET_FRAME_COLS (f, 0);
+ FRAME_LINES (f) = 0;
change_frame_size (f, height, width, 1, 0, 0);
/* Add `tooltip' frame parameter's default value. */
}
BLOCK_INPUT;
- compute_tip_xy (f, parms, dx, dy, PIXEL_WIDTH (f),
- PIXEL_HEIGHT (f), &root_x, &root_y);
+ compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f),
+ FRAME_PIXEL_HEIGHT (f), &root_x, &root_y);
XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
root_x, root_y);
UNBLOCK_INPUT;
/* Set up the frame's root window. */
w = XWINDOW (FRAME_ROOT_WINDOW (f));
- w->left = w->top = make_number (0);
+ w->left_col = w->top_line = make_number (0);
if (CONSP (Vx_max_tooltip_size)
&& INTEGERP (XCAR (Vx_max_tooltip_size))
&& INTEGERP (XCDR (Vx_max_tooltip_size))
&& XINT (XCDR (Vx_max_tooltip_size)) > 0)
{
- w->width = XCAR (Vx_max_tooltip_size);
- w->height = XCDR (Vx_max_tooltip_size);
+ w->total_cols = XCAR (Vx_max_tooltip_size);
+ w->total_lines = XCDR (Vx_max_tooltip_size);
}
else
{
- w->width = make_number (80);
- w->height = make_number (40);
+ w->total_cols = make_number (80);
+ w->total_lines = make_number (40);
}
- f->window_width = XINT (w->width);
+ FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
adjust_glyphs (f);
w->pseudo_window_p = 1;