aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gtkutil.c76
-rw-r--r--src/w32fns.c117
-rw-r--r--src/xfns.c117
3 files changed, 153 insertions, 157 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 49ca3860645..f2690635f53 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -34,7 +34,7 @@ Boston, MA 02111-1307, USA. */
34#include <gdk/gdkkeysyms.h> 34#include <gdk/gdkkeysyms.h>
35 35
36#define FRAME_TOTAL_PIXEL_HEIGHT(f) \ 36#define FRAME_TOTAL_PIXEL_HEIGHT(f) \
37 (PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f)) 37 (FRAME_PIXEL_HEIGHT (f) + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f))
38 38
39 39
40 40
@@ -237,12 +237,12 @@ static void
237xg_set_geometry (f) 237xg_set_geometry (f)
238 FRAME_PTR f; 238 FRAME_PTR f;
239{ 239{
240 if (f->output_data.x->size_hint_flags & USPosition) 240 if (f->size_hint_flags & USPosition)
241 { 241 {
242 int left = f->output_data.x->left_pos; 242 int left = f->left_pos;
243 int xneg = f->output_data.x->size_hint_flags & XNegative; 243 int xneg = f->size_hint_flags & XNegative;
244 int top = f->output_data.x->top_pos; 244 int top = f->top_pos;
245 int yneg = f->output_data.x->size_hint_flags & YNegative; 245 int yneg = f->size_hint_flags & YNegative;
246 char geom_str[32]; 246 char geom_str[32];
247 247
248 if (xneg) 248 if (xneg)
@@ -251,7 +251,7 @@ xg_set_geometry (f)
251 top = -top; 251 top = -top;
252 252
253 sprintf (geom_str, "=%dx%d%c%d%c%d", 253 sprintf (geom_str, "=%dx%d%c%d%c%d",
254 PIXEL_WIDTH (f), 254 FRAME_PIXEL_WIDTH (f),
255 FRAME_TOTAL_PIXEL_HEIGHT (f), 255 FRAME_TOTAL_PIXEL_HEIGHT (f),
256 (xneg ? '-' : '+'), left, 256 (xneg ? '-' : '+'), left,
257 (yneg ? '-' : '+'), top); 257 (yneg ? '-' : '+'), top);
@@ -273,7 +273,7 @@ xg_resize_outer_widget (f, columns, rows)
273 int rows; 273 int rows;
274{ 274{
275 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 275 gtk_window_resize (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
276 PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f)); 276 FRAME_PIXEL_WIDTH (f), FRAME_TOTAL_PIXEL_HEIGHT (f));
277 277
278 /* base_height is now changed. */ 278 /* base_height is now changed. */
279 x_wm_set_size_hint (f, 0, 0); 279 x_wm_set_size_hint (f, 0, 0);
@@ -317,12 +317,13 @@ xg_resize_widgets (f, pixelwidth, pixelheight)
317{ 317{
318 int mbheight = FRAME_MENUBAR_HEIGHT (f); 318 int mbheight = FRAME_MENUBAR_HEIGHT (f);
319 int tbheight = FRAME_TOOLBAR_HEIGHT (f); 319 int tbheight = FRAME_TOOLBAR_HEIGHT (f);
320 int rows = PIXEL_TO_CHAR_HEIGHT (f, pixelheight - mbheight - tbheight); 320 int rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (pixelheight
321 int columns = PIXEL_TO_CHAR_WIDTH (f, pixelwidth); 321 - mbheight - tbheight));
322 int columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
322 323
323 if (FRAME_GTK_WIDGET (f) 324 if (FRAME_GTK_WIDGET (f)
324 && (columns != FRAME_WIDTH (f) || rows != FRAME_HEIGHT (f) 325 && (columns != FRAME_COLS (f) || rows != FRAME_LINES (f)
325 || pixelwidth != PIXEL_WIDTH (f) || pixelheight != PIXEL_HEIGHT (f))) 326 || pixelwidth != FRAME_PIXEL_WIDTH (f) || pixelheight != FRAME_PIXEL_HEIGHT (f)))
326 { 327 {
327 struct x_output *x = f->output_data.x; 328 struct x_output *x = f->output_data.x;
328 GtkAllocation all; 329 GtkAllocation all;
@@ -349,7 +350,7 @@ xg_frame_set_char_size (f, cols, rows)
349 int cols; 350 int cols;
350 int rows; 351 int rows;
351{ 352{
352 int pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows) 353 int pixelheight = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows)
353 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); 354 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
354 int pixelwidth; 355 int pixelwidth;
355 356
@@ -358,17 +359,14 @@ xg_frame_set_char_size (f, cols, rows)
358 might end up with a frame width that is not a multiple of the 359 might end up with a frame width that is not a multiple of the
359 frame's character width which is bad for vertically split 360 frame's character width which is bad for vertically split
360 windows. */ 361 windows. */
361 f->output_data.x->vertical_scroll_bar_extra 362 f->scroll_bar_actual_width
362 = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) 363 = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
363 ? 0
364 : (FRAME_SCROLL_BAR_COLS (f)
365 * FONT_WIDTH (f->output_data.x->font)));
366 364
367 compute_fringe_widths (f, 0); 365 compute_fringe_widths (f, 0);
368 366
369 /* CHAR_TO_PIXEL_WIDTH uses vertical_scroll_bar_extra, so call it 367 /* FRAME_TEXT_COLS_TO_PIXEL_WIDTH uses scroll_bar_actual_width, so call it
370 after calculating that value. */ 368 after calculating that value. */
371 pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); 369 pixelwidth = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, cols);
372 370
373 /* Must resize our top level widget. Font size may have changed, 371 /* Must resize our top level widget. Font size may have changed,
374 but not rows/cols. */ 372 but not rows/cols. */
@@ -511,9 +509,7 @@ xg_create_frame_widgets (f)
511 509
512 gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE); 510 gtk_fixed_set_has_window (GTK_FIXED (wfixed), TRUE);
513 511
514 gtk_widget_set_size_request (wfixed, 512 gtk_widget_set_size_request (wfixed, FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f));
515 PIXEL_WIDTH (f),
516 PIXEL_HEIGHT (f));
517 513
518 gtk_container_add (GTK_CONTAINER (wtop), wvbox); 514 gtk_container_add (GTK_CONTAINER (wtop), wvbox);
519 gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0); 515 gtk_box_pack_end (GTK_BOX (wvbox), wfixed, TRUE, TRUE, 0);
@@ -594,8 +590,8 @@ xg_create_frame_widgets (f)
594 gtk_widget_modify_style (wfixed, style); 590 gtk_widget_modify_style (wfixed, style);
595 591
596 /* GTK does not set any border, and they look bad with GTK. */ 592 /* GTK does not set any border, and they look bad with GTK. */
597 f->output_data.x->border_width = 0; 593 f->border_width = 0;
598 f->output_data.x->internal_border_width = 0; 594 f->internal_border_width = 0;
599 595
600 UNBLOCK_INPUT; 596 UNBLOCK_INPUT;
601 597
@@ -621,7 +617,7 @@ x_wm_set_size_hint (f, flags, user_position)
621 gint hint_flags = 0; 617 gint hint_flags = 0;
622 int base_width, base_height; 618 int base_width, base_height;
623 int min_rows = 0, min_cols = 0; 619 int min_rows = 0, min_cols = 0;
624 int win_gravity = f->output_data.x->win_gravity; 620 int win_gravity = f->win_gravity;
625 621
626 if (flags) 622 if (flags)
627 { 623 {
@@ -630,18 +626,18 @@ x_wm_set_size_hint (f, flags, user_position)
630 f->output_data.x->hint_flags = hint_flags; 626 f->output_data.x->hint_flags = hint_flags;
631 } 627 }
632 else 628 else
633 flags = f->output_data.x->size_hint_flags; 629 flags = f->size_hint_flags;
634 630
635 size_hints = f->output_data.x->size_hints; 631 size_hints = f->output_data.x->size_hints;
636 hint_flags = f->output_data.x->hint_flags; 632 hint_flags = f->output_data.x->hint_flags;
637 633
638 hint_flags |= GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE; 634 hint_flags |= GDK_HINT_RESIZE_INC | GDK_HINT_MIN_SIZE;
639 size_hints.width_inc = FONT_WIDTH (f->output_data.x->font); 635 size_hints.width_inc = FRAME_COLUMN_WIDTH (f);
640 size_hints.height_inc = f->output_data.x->line_height; 636 size_hints.height_inc = FRAME_LINE_HEIGHT (f);
641 637
642 hint_flags |= GDK_HINT_BASE_SIZE; 638 hint_flags |= GDK_HINT_BASE_SIZE;
643 base_width = CHAR_TO_PIXEL_WIDTH (f, 0); 639 base_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, 0);
644 base_height = CHAR_TO_PIXEL_HEIGHT (f, 0) 640 base_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, 0)
645 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f); 641 + FRAME_MENUBAR_HEIGHT (f) + FRAME_TOOLBAR_HEIGHT (f);
646 642
647 check_frame_size (f, &min_rows, &min_cols); 643 check_frame_size (f, &min_rows, &min_cols);
@@ -2298,7 +2294,7 @@ xg_update_frame_menubar (f)
2298 2294
2299 /* The height has changed, resize outer widget and set columns 2295 /* The height has changed, resize outer widget and set columns
2300 rows to what we had before adding the menu bar. */ 2296 rows to what we had before adding the menu bar. */
2301 xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 2297 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
2302 2298
2303 SET_FRAME_GARBAGED (f); 2299 SET_FRAME_GARBAGED (f);
2304 UNBLOCK_INPUT; 2300 UNBLOCK_INPUT;
@@ -2327,7 +2323,7 @@ free_frame_menubar (f)
2327 2323
2328 /* The height has changed, resize outer widget and set columns 2324 /* The height has changed, resize outer widget and set columns
2329 rows to what we had before removing the menu bar. */ 2325 rows to what we had before removing the menu bar. */
2330 xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 2326 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
2331 2327
2332 SET_FRAME_GARBAGED (f); 2328 SET_FRAME_GARBAGED (f);
2333 UNBLOCK_INPUT; 2329 UNBLOCK_INPUT;
@@ -2735,7 +2731,7 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
2735 /* We do the same as for MOTIF in xterm.c, assume 30 chars per line 2731 /* We do the same as for MOTIF in xterm.c, assume 30 chars per line
2736 rather than the real portion value. This makes the thumb less likely 2732 rather than the real portion value. This makes the thumb less likely
2737 to resize and that looks better. */ 2733 to resize and that looks better. */
2738 portion = XFASTINT (XWINDOW (bar->window)->height) * 30; 2734 portion = WINDOW_TOTAL_LINES (XWINDOW (bar->window)) * 30;
2739 /* When the thumb is at the bottom, position == whole. 2735 /* When the thumb is at the bottom, position == whole.
2740 So we need to increase `whole' to make space for the thumb. */ 2736 So we need to increase `whole' to make space for the thumb. */
2741 whole += portion; 2737 whole += portion;
@@ -2757,7 +2753,7 @@ xg_set_toolkit_scroll_bar_thumb (bar, portion, position, whole)
2757 value = max (value, XG_SB_MIN); 2753 value = max (value, XG_SB_MIN);
2758 2754
2759 /* Assume all lines are of equal size. */ 2755 /* Assume all lines are of equal size. */
2760 new_step = size / max (1, FRAME_HEIGHT (f)); 2756 new_step = size / max (1, FRAME_LINES (f));
2761 2757
2762 if ((int) adj->page_size != size 2758 if ((int) adj->page_size != size
2763 || (int) adj->step_increment != new_step) 2759 || (int) adj->step_increment != new_step)
@@ -2857,7 +2853,7 @@ xg_tool_bar_detach_callback (wbox, w, client_data)
2857 2853
2858 /* The height has changed, resize outer widget and set columns 2854 /* The height has changed, resize outer widget and set columns
2859 rows to what we had before detaching the tool bar. */ 2855 rows to what we had before detaching the tool bar. */
2860 xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 2856 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
2861 } 2857 }
2862} 2858}
2863 2859
@@ -2884,7 +2880,7 @@ xg_tool_bar_attach_callback (wbox, w, client_data)
2884 2880
2885 /* The height has changed, resize outer widget and set columns 2881 /* The height has changed, resize outer widget and set columns
2886 rows to what we had before detaching the tool bar. */ 2882 rows to what we had before detaching the tool bar. */
2887 xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 2883 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
2888 } 2884 }
2889} 2885}
2890 2886
@@ -3029,7 +3025,7 @@ xg_create_tool_bar (f)
3029 3025
3030 /* The height has changed, resize outer widget and set columns 3026 /* The height has changed, resize outer widget and set columns
3031 rows to what we had before adding the tool bar. */ 3027 rows to what we had before adding the tool bar. */
3032 xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 3028 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
3033 3029
3034 SET_FRAME_GARBAGED (f); 3030 SET_FRAME_GARBAGED (f);
3035} 3031}
@@ -3202,7 +3198,7 @@ update_frame_tool_bar (f)
3202 if (old_req.height != new_req.height) 3198 if (old_req.height != new_req.height)
3203 { 3199 {
3204 FRAME_TOOLBAR_HEIGHT (f) = new_req.height; 3200 FRAME_TOOLBAR_HEIGHT (f) = new_req.height;
3205 xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 3201 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
3206 } 3202 }
3207 3203
3208 if (icon_list) g_list_free (icon_list); 3204 if (icon_list) g_list_free (icon_list);
@@ -3227,7 +3223,7 @@ free_frame_tool_bar (f)
3227 3223
3228 /* The height has changed, resize outer widget and set columns 3224 /* The height has changed, resize outer widget and set columns
3229 rows to what we had before removing the tool bar. */ 3225 rows to what we had before removing the tool bar. */
3230 xg_resize_outer_widget (f, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 3226 xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f));
3231 3227
3232 SET_FRAME_GARBAGED (f); 3228 SET_FRAME_GARBAGED (f);
3233 UNBLOCK_INPUT; 3229 UNBLOCK_INPUT;
diff --git a/src/w32fns.c b/src/w32fns.c
index deff9d85d86..1d53740e961 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -655,8 +655,8 @@ x_real_positions (f, xptr, yptr)
655 ClientToScreen (FRAME_W32_WINDOW(f), &pt); 655 ClientToScreen (FRAME_W32_WINDOW(f), &pt);
656 656
657 /* Remember x_pixels_diff and y_pixels_diff. */ 657 /* Remember x_pixels_diff and y_pixels_diff. */
658 f->output_data.w32->x_pixels_diff = pt.x - rect.left; 658 f->x_pixels_diff = pt.x - rect.left;
659 f->output_data.w32->y_pixels_diff = pt.y - rect.top; 659 f->y_pixels_diff = pt.y - rect.top;
660 660
661 *xptr = pt.x; 661 *xptr = pt.x;
662 *yptr = pt.y; 662 *yptr = pt.y;
@@ -1769,7 +1769,7 @@ x_set_border_pixel (f, pix)
1769 1769
1770 f->output_data.w32->border_pixel = pix; 1770 f->output_data.w32->border_pixel = pix;
1771 1771
1772 if (FRAME_W32_WINDOW (f) != 0 && f->output_data.w32->border_width > 0) 1772 if (FRAME_W32_WINDOW (f) != 0 && f->border_width > 0)
1773 { 1773 {
1774 if (FRAME_VISIBLE_P (f)) 1774 if (FRAME_VISIBLE_P (f))
1775 redraw_frame (f); 1775 redraw_frame (f);
@@ -1918,7 +1918,7 @@ x_set_menu_bar_lines (f, value, oldval)
1918 /* Adjust the frame size so that the client (text) dimensions 1918 /* Adjust the frame size so that the client (text) dimensions
1919 remain the same. This depends on FRAME_EXTERNAL_MENU_BAR being 1919 remain the same. This depends on FRAME_EXTERNAL_MENU_BAR being
1920 set correctly. */ 1920 set correctly. */
1921 x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f)); 1921 x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
1922 do_pending_window_change (0); 1922 do_pending_window_change (0);
1923 } 1923 }
1924 adjust_glyphs (f); 1924 adjust_glyphs (f);
@@ -1956,7 +1956,7 @@ x_set_tool_bar_lines (f, value, oldval)
1956 1956
1957 /* Don't resize the tool-bar to more than we have room for. */ 1957 /* Don't resize the tool-bar to more than we have room for. */
1958 root_window = FRAME_ROOT_WINDOW (f); 1958 root_window = FRAME_ROOT_WINDOW (f);
1959 root_height = XINT (XWINDOW (root_window)->height); 1959 root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window));
1960 if (root_height - delta < 1) 1960 if (root_height - delta < 1)
1961 { 1961 {
1962 delta = root_height - 1; 1962 delta = root_height - 1;
@@ -1987,8 +1987,8 @@ x_set_tool_bar_lines (f, value, oldval)
1987 if (delta < 0) 1987 if (delta < 0)
1988 { 1988 {
1989 int height = FRAME_INTERNAL_BORDER_WIDTH (f); 1989 int height = FRAME_INTERNAL_BORDER_WIDTH (f);
1990 int width = PIXEL_WIDTH (f); 1990 int width = FRAME_PIXEL_WIDTH (f);
1991 int y = nlines * CANON_Y_UNIT (f); 1991 int y = nlines * FRAME_LINE_HEIGHT (f);
1992 1992
1993 BLOCK_INPUT; 1993 BLOCK_INPUT;
1994 { 1994 {
@@ -2134,11 +2134,11 @@ x_set_title (f, name, old_name)
2134void x_set_scroll_bar_default_width (f) 2134void x_set_scroll_bar_default_width (f)
2135 struct frame *f; 2135 struct frame *f;
2136{ 2136{
2137 int wid = FONT_WIDTH (f->output_data.w32->font); 2137 int wid = FRAME_COLUMN_WIDTH (f);
2138 2138
2139 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL); 2139 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
2140 FRAME_SCROLL_BAR_COLS (f) = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) + 2140 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) +
2141 wid - 1) / wid; 2141 wid - 1) / wid;
2142} 2142}
2143 2143
2144 2144
@@ -2231,8 +2231,8 @@ w32_createwindow (f)
2231 RECT rect; 2231 RECT rect;
2232 2232
2233 rect.left = rect.top = 0; 2233 rect.left = rect.top = 0;
2234 rect.right = PIXEL_WIDTH (f); 2234 rect.right = FRAME_PIXEL_WIDTH (f);
2235 rect.bottom = PIXEL_HEIGHT (f); 2235 rect.bottom = FRAME_PIXEL_HEIGHT (f);
2236 2236
2237 AdjustWindowRect (&rect, f->output_data.w32->dwStyle, 2237 AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
2238 FRAME_EXTERNAL_MENU_BAR (f)); 2238 FRAME_EXTERNAL_MENU_BAR (f));
@@ -2248,8 +2248,8 @@ w32_createwindow (f)
2248 = CreateWindow (EMACS_CLASS, 2248 = CreateWindow (EMACS_CLASS,
2249 f->namebuf, 2249 f->namebuf,
2250 f->output_data.w32->dwStyle | WS_CLIPCHILDREN, 2250 f->output_data.w32->dwStyle | WS_CLIPCHILDREN,
2251 f->output_data.w32->left_pos, 2251 f->left_pos,
2252 f->output_data.w32->top_pos, 2252 f->top_pos,
2253 rect.right - rect.left, 2253 rect.right - rect.left,
2254 rect.bottom - rect.top, 2254 rect.bottom - rect.top,
2255 NULL, 2255 NULL,
@@ -2259,10 +2259,10 @@ w32_createwindow (f)
2259 2259
2260 if (hwnd) 2260 if (hwnd)
2261 { 2261 {
2262 SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font)); 2262 SetWindowLong (hwnd, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
2263 SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height); 2263 SetWindowLong (hwnd, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
2264 SetWindowLong (hwnd, WND_BORDER_INDEX, f->output_data.w32->internal_border_width); 2264 SetWindowLong (hwnd, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
2265 SetWindowLong (hwnd, WND_SCROLLBAR_INDEX, f->output_data.w32->vertical_scroll_bar_extra); 2265 SetWindowLong (hwnd, WND_SCROLLBAR_INDEX, f->scroll_bar_actual_width);
2266 SetWindowLong (hwnd, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f)); 2266 SetWindowLong (hwnd, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
2267 2267
2268 /* Enable drag-n-drop. */ 2268 /* Enable drag-n-drop. */
@@ -4014,8 +4014,8 @@ my_create_tip_window (f)
4014 RECT rect; 4014 RECT rect;
4015 4015
4016 rect.left = rect.top = 0; 4016 rect.left = rect.top = 0;
4017 rect.right = PIXEL_WIDTH (f); 4017 rect.right = FRAME_PIXEL_WIDTH (f);
4018 rect.bottom = PIXEL_HEIGHT (f); 4018 rect.bottom = FRAME_PIXEL_HEIGHT (f);
4019 4019
4020 AdjustWindowRect (&rect, f->output_data.w32->dwStyle, 4020 AdjustWindowRect (&rect, f->output_data.w32->dwStyle,
4021 FRAME_EXTERNAL_MENU_BAR (f)); 4021 FRAME_EXTERNAL_MENU_BAR (f));
@@ -4024,8 +4024,8 @@ my_create_tip_window (f)
4024 = CreateWindow (EMACS_CLASS, 4024 = CreateWindow (EMACS_CLASS,
4025 f->namebuf, 4025 f->namebuf,
4026 f->output_data.w32->dwStyle, 4026 f->output_data.w32->dwStyle,
4027 f->output_data.w32->left_pos, 4027 f->left_pos,
4028 f->output_data.w32->top_pos, 4028 f->top_pos,
4029 rect.right - rect.left, 4029 rect.right - rect.left,
4030 rect.bottom - rect.top, 4030 rect.bottom - rect.top,
4031 FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */ 4031 FRAME_W32_WINDOW (SELECTED_FRAME ()), /* owner */
@@ -4035,9 +4035,9 @@ my_create_tip_window (f)
4035 4035
4036 if (tip_window) 4036 if (tip_window)
4037 { 4037 {
4038 SetWindowLong (tip_window, WND_FONTWIDTH_INDEX, FONT_WIDTH (f->output_data.w32->font)); 4038 SetWindowLong (tip_window, WND_FONTWIDTH_INDEX, FRAME_COLUMN_WIDTH (f));
4039 SetWindowLong (tip_window, WND_LINEHEIGHT_INDEX, f->output_data.w32->line_height); 4039 SetWindowLong (tip_window, WND_LINEHEIGHT_INDEX, FRAME_LINE_HEIGHT (f));
4040 SetWindowLong (tip_window, WND_BORDER_INDEX, f->output_data.w32->internal_border_width); 4040 SetWindowLong (tip_window, WND_BORDER_INDEX, FRAME_INTERNAL_BORDER_WIDTH (f));
4041 SetWindowLong (tip_window, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f)); 4041 SetWindowLong (tip_window, WND_BACKGROUND_INDEX, FRAME_BACKGROUND_PIXEL (f));
4042 4042
4043 /* Tip frames have no scrollbars. */ 4043 /* Tip frames have no scrollbars. */
@@ -4154,7 +4154,7 @@ x_make_gc (f)
4154 Note that many default values are used. */ 4154 Note that many default values are used. */
4155 4155
4156 /* Normal video */ 4156 /* Normal video */
4157 gc_values.font = f->output_data.w32->font; 4157 gc_values.font = FRAME_FONT (f);
4158 4158
4159 /* Cursor has cursor-color background, background-color foreground. */ 4159 /* Cursor has cursor-color background, background-color foreground. */
4160 gc_values.foreground = FRAME_BACKGROUND_PIXEL (f); 4160 gc_values.foreground = FRAME_BACKGROUND_PIXEL (f);
@@ -4286,7 +4286,7 @@ This function is an internal primitive--use `make-frame' instead. */)
4286 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1; 4286 FRAME_CAN_HAVE_SCROLL_BARS (f) = 1;
4287 4287
4288 /* By default, make scrollbars the system standard width. */ 4288 /* By default, make scrollbars the system standard width. */
4289 f->scroll_bar_pixel_width = GetSystemMetrics (SM_CXVSCROLL); 4289 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
4290 4290
4291 f->output_method = output_w32; 4291 f->output_method = output_w32;
4292 f->output_data.w32 = 4292 f->output_data.w32 =
@@ -4466,14 +4466,14 @@ This function is an internal primitive--use `make-frame' instead. */)
4466 x_default_parameter (f, parms, Qscroll_bar_width, Qnil, 4466 x_default_parameter (f, parms, Qscroll_bar_width, Qnil,
4467 "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER); 4467 "scrollBarWidth", "ScrollBarWidth", RES_TYPE_NUMBER);
4468 4468
4469 /* Dimensions, especially f->height, must be done via change_frame_size. 4469 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
4470 Change will not be effected unless different from the current 4470 Change will not be effected unless different from the current
4471 f->height. */ 4471 FRAME_LINES (f). */
4472 width = f->width; 4472 width = FRAME_COLS (f);
4473 height = f->height; 4473 height = FRAME_LINES (f);
4474 4474
4475 f->height = 0; 4475 FRAME_LINES (f) = 0;
4476 SET_FRAME_WIDTH (f, 0); 4476 SET_FRAME_COLS (f, 0);
4477 change_frame_size (f, height, width, 1, 0, 0); 4477 change_frame_size (f, height, width, 1, 0, 0);
4478 4478
4479 /* Tell the server what size and position, etc, we want, and how 4479 /* Tell the server what size and position, etc, we want, and how
@@ -6658,28 +6658,28 @@ int
6658x_pixel_width (f) 6658x_pixel_width (f)
6659 register struct frame *f; 6659 register struct frame *f;
6660{ 6660{
6661 return PIXEL_WIDTH (f); 6661 return FRAME_PIXEL_WIDTH (f);
6662} 6662}
6663 6663
6664int 6664int
6665x_pixel_height (f) 6665x_pixel_height (f)
6666 register struct frame *f; 6666 register struct frame *f;
6667{ 6667{
6668 return PIXEL_HEIGHT (f); 6668 return FRAME_PIXEL_HEIGHT (f);
6669} 6669}
6670 6670
6671int 6671int
6672x_char_width (f) 6672x_char_width (f)
6673 register struct frame *f; 6673 register struct frame *f;
6674{ 6674{
6675 return FONT_WIDTH (f->output_data.w32->font); 6675 return FRAME_COLUMN_WIDTH (f);
6676} 6676}
6677 6677
6678int 6678int
6679x_char_height (f) 6679x_char_height (f)
6680 register struct frame *f; 6680 register struct frame *f;
6681{ 6681{
6682 return f->output_data.w32->line_height; 6682 return FRAME_LINE_HEIGHT (f);
6683} 6683}
6684 6684
6685int 6685int
@@ -7244,8 +7244,8 @@ or omitted means use the selected frame. */)
7244 int height = img->height + 2 * img->vmargin; 7244 int height = img->height + 2 * img->vmargin;
7245 7245
7246 if (NILP (pixels)) 7246 if (NILP (pixels))
7247 size = Fcons (make_float ((double) width / CANON_X_UNIT (f)), 7247 size = Fcons (make_float ((double) width / FRAME_COLUMN_WIDTH (f)),
7248 make_float ((double) height / CANON_Y_UNIT (f))); 7248 make_float ((double) height / FRAME_LINE_HEIGHT (f)));
7249 else 7249 else
7250 size = Fcons (make_number (width), make_number (height)); 7250 size = Fcons (make_number (width), make_number (height));
7251 } 7251 }
@@ -12731,7 +12731,7 @@ x_create_tip_frame (dpyinfo, parms, text)
12731 XSETFRAME (frame, f); 12731 XSETFRAME (frame, f);
12732 12732
12733 buffer = Fget_buffer_create (build_string (" *tip*")); 12733 buffer = Fget_buffer_create (build_string (" *tip*"));
12734 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer); 12734 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
12735 old_buffer = current_buffer; 12735 old_buffer = current_buffer;
12736 set_buffer_internal_1 (XBUFFER (buffer)); 12736 set_buffer_internal_1 (XBUFFER (buffer));
12737 current_buffer->truncate_lines = Qnil; 12737 current_buffer->truncate_lines = Qnil;
@@ -12858,10 +12858,9 @@ x_create_tip_frame (dpyinfo, parms, text)
12858 window_prompting = x_figure_window_size (f, parms, 0); 12858 window_prompting = x_figure_window_size (f, parms, 0);
12859 12859
12860 /* No fringes on tip frame. */ 12860 /* No fringes on tip frame. */
12861 f->output_data.w32->fringes_extra = 0; 12861 f->fringe_cols = 0;
12862 f->output_data.w32->fringe_cols = 0; 12862 f->left_fringe_width = 0;
12863 f->output_data.w32->left_fringe_width = 0; 12863 f->right_fringe_width = 0;
12864 f->output_data.w32->right_fringe_width = 0;
12865 12864
12866 BLOCK_INPUT; 12865 BLOCK_INPUT;
12867 my_create_tip_window (f); 12866 my_create_tip_window (f);
@@ -12876,13 +12875,13 @@ x_create_tip_frame (dpyinfo, parms, text)
12876 x_default_parameter (f, parms, Qcursor_type, Qbox, 12875 x_default_parameter (f, parms, Qcursor_type, Qbox,
12877 "cursorType", "CursorType", RES_TYPE_SYMBOL); 12876 "cursorType", "CursorType", RES_TYPE_SYMBOL);
12878 12877
12879 /* Dimensions, especially f->height, must be done via change_frame_size. 12878 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
12880 Change will not be effected unless different from the current 12879 Change will not be effected unless different from the current
12881 f->height. */ 12880 FRAME_LINES (f). */
12882 width = f->width; 12881 width = FRAME_COLS (f);
12883 height = f->height; 12882 height = FRAME_LINES (f);
12884 f->height = 0; 12883 FRAME_LINES (f) = 0;
12885 SET_FRAME_WIDTH (f, 0); 12884 SET_FRAME_COLS (f, 0);
12886 change_frame_size (f, height, width, 1, 0, 0); 12885 change_frame_size (f, height, width, 1, 0, 0);
12887 12886
12888 /* Add `tooltip' frame parameter's default value. */ 12887 /* Add `tooltip' frame parameter's default value. */
@@ -13071,8 +13070,8 @@ Text larger than the specified size is clipped. */)
13071 } 13070 }
13072 13071
13073 BLOCK_INPUT; 13072 BLOCK_INPUT;
13074 compute_tip_xy (f, parms, dx, dy, PIXEL_WIDTH (f), 13073 compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f),
13075 PIXEL_HEIGHT (f), &root_x, &root_y); 13074 FRAME_PIXEL_HEIGHT (f), &root_x, &root_y);
13076 13075
13077 /* Put tooltip in topmost group and in position. */ 13076 /* Put tooltip in topmost group and in position. */
13078 SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST, 13077 SetWindowPos (FRAME_W32_WINDOW (f), HWND_TOPMOST,
@@ -13120,7 +13119,7 @@ Text larger than the specified size is clipped. */)
13120 13119
13121 /* Set up the frame's root window. */ 13120 /* Set up the frame's root window. */
13122 w = XWINDOW (FRAME_ROOT_WINDOW (f)); 13121 w = XWINDOW (FRAME_ROOT_WINDOW (f));
13123 w->left = w->top = make_number (0); 13122 w->left_col = w->top_line = make_number (0);
13124 13123
13125 if (CONSP (Vx_max_tooltip_size) 13124 if (CONSP (Vx_max_tooltip_size)
13126 && INTEGERP (XCAR (Vx_max_tooltip_size)) 13125 && INTEGERP (XCAR (Vx_max_tooltip_size))
@@ -13128,16 +13127,16 @@ Text larger than the specified size is clipped. */)
13128 && INTEGERP (XCDR (Vx_max_tooltip_size)) 13127 && INTEGERP (XCDR (Vx_max_tooltip_size))
13129 && XINT (XCDR (Vx_max_tooltip_size)) > 0) 13128 && XINT (XCDR (Vx_max_tooltip_size)) > 0)
13130 { 13129 {
13131 w->width = XCAR (Vx_max_tooltip_size); 13130 w->total_cols = XCAR (Vx_max_tooltip_size);
13132 w->height = XCDR (Vx_max_tooltip_size); 13131 w->total_lines = XCDR (Vx_max_tooltip_size);
13133 } 13132 }
13134 else 13133 else
13135 { 13134 {
13136 w->width = make_number (80); 13135 w->total_cols = make_number (80);
13137 w->height = make_number (40); 13136 w->total_lines = make_number (40);
13138 } 13137 }
13139 13138
13140 f->window_width = XINT (w->width); 13139 FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
13141 adjust_glyphs (f); 13140 adjust_glyphs (f);
13142 w->pseudo_window_p = 1; 13141 w->pseudo_window_p = 1;
13143 13142
diff --git a/src/xfns.c b/src/xfns.c
index 9784d0f0439..107ed6dd3a8 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -859,7 +859,7 @@ x_real_positions (f, xptr, yptr)
859 859
860 /* Child of win. */ 860 /* Child of win. */
861 &child); 861 &child);
862 } 862 }
863 863
864 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); 864 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
865 } 865 }
@@ -870,10 +870,11 @@ x_real_positions (f, xptr, yptr)
870 870
871 if (had_errors) return; 871 if (had_errors) return;
872 872
873 f->output_data.x->x_pixels_diff = -win_x; 873 f->x_pixels_diff = -win_x;
874 f->output_data.x->y_pixels_diff = -win_y; 874 f->y_pixels_diff = -win_y;
875 f->output_data.x->x_pixels_outer_diff = -outer_x; 875
876 f->output_data.x->y_pixels_outer_diff = -outer_y; 876 FRAME_X_OUTPUT (f)->x_pixels_outer_diff = -outer_x;
877 FRAME_X_OUTPUT (f)->y_pixels_outer_diff = -outer_y;
877 878
878 *xptr = real_x; 879 *xptr = real_x;
879 *yptr = real_y; 880 *yptr = real_y;
@@ -1296,7 +1297,7 @@ x_set_border_pixel (f, pix)
1296 unload_color (f, f->output_data.x->border_pixel); 1297 unload_color (f, f->output_data.x->border_pixel);
1297 f->output_data.x->border_pixel = pix; 1298 f->output_data.x->border_pixel = pix;
1298 1299
1299 if (FRAME_X_WINDOW (f) != 0 && f->output_data.x->border_width > 0) 1300 if (FRAME_X_WINDOW (f) != 0 && f->border_width > 0)
1300 { 1301 {
1301 BLOCK_INPUT; 1302 BLOCK_INPUT;
1302 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 1303 XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
@@ -1519,7 +1520,7 @@ x_set_tool_bar_lines (f, value, oldval)
1519 1520
1520 /* Don't resize the tool-bar to more than we have room for. */ 1521 /* Don't resize the tool-bar to more than we have room for. */
1521 root_window = FRAME_ROOT_WINDOW (f); 1522 root_window = FRAME_ROOT_WINDOW (f);
1522 root_height = XINT (XWINDOW (root_window)->height); 1523 root_height = WINDOW_TOTAL_LINES (XWINDOW (root_window));
1523 if (root_height - delta < 1) 1524 if (root_height - delta < 1)
1524 { 1525 {
1525 delta = root_height - 1; 1526 delta = root_height - 1;
@@ -1550,8 +1551,8 @@ x_set_tool_bar_lines (f, value, oldval)
1550 if (delta < 0) 1551 if (delta < 0)
1551 { 1552 {
1552 int height = FRAME_INTERNAL_BORDER_WIDTH (f); 1553 int height = FRAME_INTERNAL_BORDER_WIDTH (f);
1553 int width = PIXEL_WIDTH (f); 1554 int width = FRAME_PIXEL_WIDTH (f);
1554 int y = nlines * CANON_Y_UNIT (f); 1555 int y = nlines * FRAME_LINE_HEIGHT (f);
1555 1556
1556 BLOCK_INPUT; 1557 BLOCK_INPUT;
1557 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 1558 x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
@@ -1956,21 +1957,21 @@ void
1956x_set_scroll_bar_default_width (f) 1957x_set_scroll_bar_default_width (f)
1957 struct frame *f; 1958 struct frame *f;
1958{ 1959{
1959 int wid = FONT_WIDTH (f->output_data.x->font); 1960 int wid = FRAME_COLUMN_WIDTH (f);
1960 1961
1961#ifdef USE_TOOLKIT_SCROLL_BARS 1962#ifdef USE_TOOLKIT_SCROLL_BARS
1962 /* A minimum width of 14 doesn't look good for toolkit scroll bars. */ 1963 /* A minimum width of 14 doesn't look good for toolkit scroll bars. */
1963 int width = 16 + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM; 1964 int width = 16 + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM;
1964 FRAME_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid; 1965 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid;
1965 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = width; 1966 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = width;
1966#else 1967#else
1967 /* Make the actual width at least 14 pixels and a multiple of a 1968 /* Make the actual width at least 14 pixels and a multiple of a
1968 character width. */ 1969 character width. */
1969 FRAME_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid; 1970 FRAME_CONFIG_SCROLL_BAR_COLS (f) = (14 + wid - 1) / wid;
1970 1971
1971 /* Use all of that space (aside from required margins) for the 1972 /* Use all of that space (aside from required margins) for the
1972 scroll bar. */ 1973 scroll bar. */
1973 FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = 0; 1974 FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = 0;
1974#endif 1975#endif
1975} 1976}
1976 1977
@@ -2369,8 +2370,8 @@ xic_set_statusarea (f)
2369 2370
2370 area.width = needed->width; 2371 area.width = needed->width;
2371 area.height = needed->height; 2372 area.height = needed->height;
2372 area.x = PIXEL_WIDTH (f) - area.width - FRAME_INTERNAL_BORDER_WIDTH (f); 2373 area.x = FRAME_PIXEL_WIDTH (f) - area.width - FRAME_INTERNAL_BORDER_WIDTH (f);
2373 area.y = (PIXEL_HEIGHT (f) - area.height 2374 area.y = (FRAME_PIXEL_HEIGHT (f) - area.height
2374 - FRAME_MENUBAR_HEIGHT (f) 2375 - FRAME_MENUBAR_HEIGHT (f)
2375 - FRAME_TOOLBAR_HEIGHT (f) 2376 - FRAME_TOOLBAR_HEIGHT (f)
2376 - FRAME_INTERNAL_BORDER_WIDTH (f)); 2377 - FRAME_INTERNAL_BORDER_WIDTH (f));
@@ -2448,7 +2449,7 @@ x_window (f, window_prompting, minibuffer_only)
2448 XtSetArg (al[ac], XtNallowShellResize, 1); ac++; 2449 XtSetArg (al[ac], XtNallowShellResize, 1); ac++;
2449 XtSetArg (al[ac], XtNinput, 1); ac++; 2450 XtSetArg (al[ac], XtNinput, 1); ac++;
2450 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++; 2451 XtSetArg (al[ac], XtNmappedWhenManaged, 0); ac++;
2451 XtSetArg (al[ac], XtNborderWidth, f->output_data.x->border_width); ac++; 2452 XtSetArg (al[ac], XtNborderWidth, f->border_width); ac++;
2452 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; 2453 XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++;
2453 XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++; 2454 XtSetArg (al[ac], XtNdepth, FRAME_X_DISPLAY_INFO (f)->n_planes); ac++;
2454 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++; 2455 XtSetArg (al[ac], XtNcolormap, FRAME_X_COLORMAP (f)); ac++;
@@ -2533,9 +2534,9 @@ x_window (f, window_prompting, minibuffer_only)
2533 is a user-specified or program-specified one. 2534 is a user-specified or program-specified one.
2534 We pass that information later, in x_wm_set_size_hints. */ 2535 We pass that information later, in x_wm_set_size_hints. */
2535 { 2536 {
2536 int left = f->output_data.x->left_pos; 2537 int left = f->left_pos;
2537 int xneg = window_prompting & XNegative; 2538 int xneg = window_prompting & XNegative;
2538 int top = f->output_data.x->top_pos; 2539 int top = f->top_pos;
2539 int yneg = window_prompting & YNegative; 2540 int yneg = window_prompting & YNegative;
2540 if (xneg) 2541 if (xneg)
2541 left = -left; 2542 left = -left;
@@ -2544,14 +2545,14 @@ x_window (f, window_prompting, minibuffer_only)
2544 2545
2545 if (window_prompting & USPosition) 2546 if (window_prompting & USPosition)
2546 sprintf (shell_position, "=%dx%d%c%d%c%d", 2547 sprintf (shell_position, "=%dx%d%c%d%c%d",
2547 PIXEL_WIDTH (f) + extra_borders, 2548 FRAME_PIXEL_WIDTH (f) + extra_borders,
2548 PIXEL_HEIGHT (f) + menubar_size + extra_borders, 2549 FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders,
2549 (xneg ? '-' : '+'), left, 2550 (xneg ? '-' : '+'), left,
2550 (yneg ? '-' : '+'), top); 2551 (yneg ? '-' : '+'), top);
2551 else 2552 else
2552 sprintf (shell_position, "=%dx%d", 2553 sprintf (shell_position, "=%dx%d",
2553 PIXEL_WIDTH (f) + extra_borders, 2554 FRAME_PIXEL_WIDTH (f) + extra_borders,
2554 PIXEL_HEIGHT (f) + menubar_size + extra_borders); 2555 FRAME_PIXEL_HEIGHT (f) + menubar_size + extra_borders);
2555 } 2556 }
2556 2557
2557 len = strlen (shell_position) + 1; 2558 len = strlen (shell_position) + 1;
@@ -2711,10 +2712,10 @@ x_window (f)
2711 FRAME_X_WINDOW (f) 2712 FRAME_X_WINDOW (f)
2712 = XCreateWindow (FRAME_X_DISPLAY (f), 2713 = XCreateWindow (FRAME_X_DISPLAY (f),
2713 f->output_data.x->parent_desc, 2714 f->output_data.x->parent_desc,
2714 f->output_data.x->left_pos, 2715 f->left_pos,
2715 f->output_data.x->top_pos, 2716 f->top_pos,
2716 PIXEL_WIDTH (f), PIXEL_HEIGHT (f), 2717 FRAME_PIXEL_WIDTH (f), FRAME_PIXEL_HEIGHT (f),
2717 f->output_data.x->border_width, 2718 f->border_width,
2718 CopyFromParent, /* depth */ 2719 CopyFromParent, /* depth */
2719 InputOutput, /* class */ 2720 InputOutput, /* class */
2720 FRAME_X_VISUAL (f), 2721 FRAME_X_VISUAL (f),
@@ -2859,7 +2860,7 @@ x_make_gc (f)
2859 Note that many default values are used. */ 2860 Note that many default values are used. */
2860 2861
2861 /* Normal video */ 2862 /* Normal video */
2862 gc_values.font = f->output_data.x->font->fid; 2863 gc_values.font = FRAME_FONT (f)->fid;
2863 gc_values.foreground = f->output_data.x->foreground_pixel; 2864 gc_values.foreground = f->output_data.x->foreground_pixel;
2864 gc_values.background = f->output_data.x->background_pixel; 2865 gc_values.background = f->output_data.x->background_pixel;
2865 gc_values.line_width = 0; /* Means 1 using fast algorithm. */ 2866 gc_values.line_width = 0; /* Means 1 using fast algorithm. */
@@ -3065,7 +3066,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3065 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); 3066 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
3066 bzero (f->output_data.x, sizeof (struct x_output)); 3067 bzero (f->output_data.x, sizeof (struct x_output));
3067 f->output_data.x->icon_bitmap = -1; 3068 f->output_data.x->icon_bitmap = -1;
3068 f->output_data.x->fontset = -1; 3069 FRAME_FONTSET (f) = -1;
3069 f->output_data.x->scroll_bar_foreground_pixel = -1; 3070 f->output_data.x->scroll_bar_foreground_pixel = -1;
3070 f->output_data.x->scroll_bar_background_pixel = -1; 3071 f->output_data.x->scroll_bar_background_pixel = -1;
3071#ifdef USE_TOOLKIT_SCROLL_BARS 3072#ifdef USE_TOOLKIT_SCROLL_BARS
@@ -3193,7 +3194,7 @@ This function is an internal primitive--use `make-frame' instead. */)
3193#ifdef USE_LUCID 3194#ifdef USE_LUCID
3194 /* Prevent lwlib/xlwmenu.c from crashing because of a bug 3195 /* Prevent lwlib/xlwmenu.c from crashing because of a bug
3195 whereby it fails to get any font. */ 3196 whereby it fails to get any font. */
3196 xlwmenu_default_font = f->output_data.x->font; 3197 xlwmenu_default_font = FRAME_FONT (f);
3197#endif 3198#endif
3198 3199
3199 x_default_parameter (f, parms, Qborder_width, make_number (2), 3200 x_default_parameter (f, parms, Qborder_width, make_number (2),
@@ -3305,14 +3306,14 @@ This function is an internal primitive--use `make-frame' instead. */)
3305 "scrollBarWidth", "ScrollBarWidth", 3306 "scrollBarWidth", "ScrollBarWidth",
3306 RES_TYPE_NUMBER); 3307 RES_TYPE_NUMBER);
3307 3308
3308 /* Dimensions, especially f->height, must be done via change_frame_size. 3309 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
3309 Change will not be effected unless different from the current 3310 Change will not be effected unless different from the current
3310 f->height. */ 3311 FRAME_LINES (f). */
3311 width = f->width; 3312 width = FRAME_COLS (f);
3312 height = f->height; 3313 height = FRAME_LINES (f);
3313 3314
3314 f->height = 0; 3315 SET_FRAME_COLS (f, 0);
3315 SET_FRAME_WIDTH (f, 0); 3316 FRAME_LINES (f) = 0;
3316 change_frame_size (f, height, width, 1, 0, 0); 3317 change_frame_size (f, height, width, 1, 0, 0);
3317 3318
3318 /* Set up faces after all frame parameters are known. This call 3319 /* Set up faces after all frame parameters are known. This call
@@ -3763,28 +3764,28 @@ int
3763x_pixel_width (f) 3764x_pixel_width (f)
3764 register struct frame *f; 3765 register struct frame *f;
3765{ 3766{
3766 return PIXEL_WIDTH (f); 3767 return FRAME_PIXEL_WIDTH (f);
3767} 3768}
3768 3769
3769int 3770int
3770x_pixel_height (f) 3771x_pixel_height (f)
3771 register struct frame *f; 3772 register struct frame *f;
3772{ 3773{
3773 return PIXEL_HEIGHT (f); 3774 return FRAME_PIXEL_HEIGHT (f);
3774} 3775}
3775 3776
3776int 3777int
3777x_char_width (f) 3778x_char_width (f)
3778 register struct frame *f; 3779 register struct frame *f;
3779{ 3780{
3780 return FONT_WIDTH (f->output_data.x->font); 3781 return FRAME_COLUMN_WIDTH (f);
3781} 3782}
3782 3783
3783int 3784int
3784x_char_height (f) 3785x_char_height (f)
3785 register struct frame *f; 3786 register struct frame *f;
3786{ 3787{
3787 return f->output_data.x->line_height; 3788 return FRAME_LINE_HEIGHT (f);
3788} 3789}
3789 3790
3790int 3791int
@@ -4475,8 +4476,8 @@ or omitted means use the selected frame. */)
4475 int height = img->height + 2 * img->vmargin; 4476 int height = img->height + 2 * img->vmargin;
4476 4477
4477 if (NILP (pixels)) 4478 if (NILP (pixels))
4478 size = Fcons (make_float ((double) width / CANON_X_UNIT (f)), 4479 size = Fcons (make_float ((double) width / FRAME_COLUMN_WIDTH (f)),
4479 make_float ((double) height / CANON_Y_UNIT (f))); 4480 make_float ((double) height / FRAME_LINE_HEIGHT (f)));
4480 else 4481 else
4481 size = Fcons (make_number (width), make_number (height)); 4482 size = Fcons (make_number (width), make_number (height));
4482 } 4483 }
@@ -9632,7 +9633,7 @@ x_create_tip_frame (dpyinfo, parms, text)
9632 XSETFRAME (frame, f); 9633 XSETFRAME (frame, f);
9633 9634
9634 buffer = Fget_buffer_create (build_string (" *tip*")); 9635 buffer = Fget_buffer_create (build_string (" *tip*"));
9635 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer); 9636 Fset_window_buffer (FRAME_ROOT_WINDOW (f), buffer, Qnil);
9636 old_buffer = current_buffer; 9637 old_buffer = current_buffer;
9637 set_buffer_internal_1 (XBUFFER (buffer)); 9638 set_buffer_internal_1 (XBUFFER (buffer));
9638 current_buffer->truncate_lines = Qnil; 9639 current_buffer->truncate_lines = Qnil;
@@ -9651,7 +9652,7 @@ x_create_tip_frame (dpyinfo, parms, text)
9651 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output)); 9652 f->output_data.x = (struct x_output *) xmalloc (sizeof (struct x_output));
9652 bzero (f->output_data.x, sizeof (struct x_output)); 9653 bzero (f->output_data.x, sizeof (struct x_output));
9653 f->output_data.x->icon_bitmap = -1; 9654 f->output_data.x->icon_bitmap = -1;
9654 f->output_data.x->fontset = -1; 9655 FRAME_FONTSET (f) = -1;
9655 f->output_data.x->scroll_bar_foreground_pixel = -1; 9656 f->output_data.x->scroll_bar_foreground_pixel = -1;
9656 f->output_data.x->scroll_bar_background_pixel = -1; 9657 f->output_data.x->scroll_bar_background_pixel = -1;
9657#ifdef USE_TOOLKIT_SCROLL_BARS 9658#ifdef USE_TOOLKIT_SCROLL_BARS
@@ -9832,13 +9833,13 @@ x_create_tip_frame (dpyinfo, parms, text)
9832 x_default_parameter (f, parms, Qcursor_type, Qbox, 9833 x_default_parameter (f, parms, Qcursor_type, Qbox,
9833 "cursorType", "CursorType", RES_TYPE_SYMBOL); 9834 "cursorType", "CursorType", RES_TYPE_SYMBOL);
9834 9835
9835 /* Dimensions, especially f->height, must be done via change_frame_size. 9836 /* Dimensions, especially FRAME_LINES (f), must be done via change_frame_size.
9836 Change will not be effected unless different from the current 9837 Change will not be effected unless different from the current
9837 f->height. */ 9838 FRAME_LINES (f). */
9838 width = f->width; 9839 width = FRAME_COLS (f);
9839 height = f->height; 9840 height = FRAME_LINES (f);
9840 f->height = 0; 9841 SET_FRAME_COLS (f, 0);
9841 SET_FRAME_WIDTH (f, 0); 9842 FRAME_LINES (f) = 0;
9842 change_frame_size (f, height, width, 1, 0, 0); 9843 change_frame_size (f, height, width, 1, 0, 0);
9843 9844
9844 /* Add `tooltip' frame parameter's default value. */ 9845 /* Add `tooltip' frame parameter's default value. */
@@ -10027,8 +10028,8 @@ Text larger than the specified size is clipped. */)
10027 } 10028 }
10028 10029
10029 BLOCK_INPUT; 10030 BLOCK_INPUT;
10030 compute_tip_xy (f, parms, dx, dy, PIXEL_WIDTH (f), 10031 compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f),
10031 PIXEL_HEIGHT (f), &root_x, &root_y); 10032 FRAME_PIXEL_HEIGHT (f), &root_x, &root_y);
10032 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), 10033 XMoveWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
10033 root_x, root_y); 10034 root_x, root_y);
10034 UNBLOCK_INPUT; 10035 UNBLOCK_INPUT;
@@ -10063,7 +10064,7 @@ Text larger than the specified size is clipped. */)
10063 10064
10064 /* Set up the frame's root window. */ 10065 /* Set up the frame's root window. */
10065 w = XWINDOW (FRAME_ROOT_WINDOW (f)); 10066 w = XWINDOW (FRAME_ROOT_WINDOW (f));
10066 w->left = w->top = make_number (0); 10067 w->left_col = w->top_line = make_number (0);
10067 10068
10068 if (CONSP (Vx_max_tooltip_size) 10069 if (CONSP (Vx_max_tooltip_size)
10069 && INTEGERP (XCAR (Vx_max_tooltip_size)) 10070 && INTEGERP (XCAR (Vx_max_tooltip_size))
@@ -10071,16 +10072,16 @@ Text larger than the specified size is clipped. */)
10071 && INTEGERP (XCDR (Vx_max_tooltip_size)) 10072 && INTEGERP (XCDR (Vx_max_tooltip_size))
10072 && XINT (XCDR (Vx_max_tooltip_size)) > 0) 10073 && XINT (XCDR (Vx_max_tooltip_size)) > 0)
10073 { 10074 {
10074 w->width = XCAR (Vx_max_tooltip_size); 10075 w->total_cols = XCAR (Vx_max_tooltip_size);
10075 w->height = XCDR (Vx_max_tooltip_size); 10076 w->total_lines = XCDR (Vx_max_tooltip_size);
10076 } 10077 }
10077 else 10078 else
10078 { 10079 {
10079 w->width = make_number (80); 10080 w->total_cols = make_number (80);
10080 w->height = make_number (40); 10081 w->total_lines = make_number (40);
10081 } 10082 }
10082 10083
10083 f->window_width = XINT (w->width); 10084 FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
10084 adjust_glyphs (f); 10085 adjust_glyphs (f);
10085 w->pseudo_window_p = 1; 10086 w->pseudo_window_p = 1;
10086 10087