changeset 51211:28ea05de2dc5

Make (many) trivial substitutions for renamed and new macros in dispextern.h, frame.h and window.h.
author Kim F. Storm <storm@cua.dk>
date Sat, 24 May 2003 22:09:34 +0000
parents 491ca5acf5b3
children 332134065648
files src/gtkutil.c src/w32fns.c src/xfns.c
diffstat 3 files changed, 163 insertions(+), 167 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkutil.c	Sat May 24 22:09:13 2003 +0000
+++ b/src/gtkutil.c	Sat May 24 22:09:34 2003 +0000
@@ -34,7 +34,7 @@
 #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))
 
 
 
@@ -237,12 +237,12 @@
 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)
@@ -251,7 +251,7 @@
       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);
@@ -273,7 +273,7 @@
      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);
@@ -317,12 +317,13 @@
 {
   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;
@@ -349,7 +350,7 @@
      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;
 
@@ -358,17 +359,14 @@
      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.  */
@@ -511,9 +509,7 @@
 
   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);
@@ -594,8 +590,8 @@
   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;
 
@@ -621,7 +617,7 @@
     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)
       {
@@ -630,18 +626,18 @@
         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);
@@ -2298,7 +2294,7 @@
 
   /* 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;
@@ -2327,7 +2323,7 @@
 
       /* 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;
@@ -2735,7 +2731,7 @@
       /* 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;
@@ -2757,7 +2753,7 @@
       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)
@@ -2857,7 +2853,7 @@
 
       /* 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));
     }
 }
 
@@ -2884,7 +2880,7 @@
 
       /* 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));
     }
 }
 
@@ -3029,7 +3025,7 @@
 
   /* 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);
 }
@@ -3202,7 +3198,7 @@
   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);
@@ -3227,7 +3223,7 @@
 
       /* 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;
--- a/src/w32fns.c	Sat May 24 22:09:13 2003 +0000
+++ b/src/w32fns.c	Sat May 24 22:09:34 2003 +0000
@@ -655,8 +655,8 @@
   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;
@@ -1769,7 +1769,7 @@
 
   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);
@@ -1918,7 +1918,7 @@
       /* 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);
@@ -1956,7 +1956,7 @@
 
   /* 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;
@@ -1987,8 +1987,8 @@
   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;
       {
@@ -2134,11 +2134,11 @@
 void x_set_scroll_bar_default_width (f)
      struct frame *f;
 {
-  int wid = FONT_WIDTH (f->output_data.w32->font);
-
-  FRAME_SCROLL_BAR_PIXEL_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
-  FRAME_SCROLL_BAR_COLS (f) = (FRAME_SCROLL_BAR_PIXEL_WIDTH (f) +
-			       wid - 1) / wid;
+  int wid = FRAME_COLUMN_WIDTH (f);
+
+  FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = GetSystemMetrics (SM_CXVSCROLL);
+  FRAME_CONFIG_SCROLL_BAR_COLS (f) = (FRAME_CONFIG_SCROLL_BAR_WIDTH (f) +
+				      wid - 1) / wid;
 }
 
 
@@ -2231,8 +2231,8 @@
   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));
@@ -2248,8 +2248,8 @@
     = 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,
@@ -2259,10 +2259,10 @@
 
   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.  */
@@ -4014,8 +4014,8 @@
   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));
@@ -4024,8 +4024,8 @@
     = 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 */
@@ -4035,9 +4035,9 @@
 
   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.  */
@@ -4154,7 +4154,7 @@
      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);
@@ -4286,7 +4286,7 @@
   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 =
@@ -4466,14 +4466,14 @@
   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;
-
-  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);
 
   /* Tell the server what size and position, etc, we want, and how
@@ -6658,28 +6658,28 @@
 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
@@ -7244,8 +7244,8 @@
       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));
     }
@@ -12731,7 +12731,7 @@
   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;
@@ -12858,10 +12858,9 @@
   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);
@@ -12876,13 +12875,13 @@
   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. */
@@ -13071,8 +13070,8 @@
 	    }
 
 	  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,
@@ -13120,7 +13119,7 @@
 
   /* 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))
@@ -13128,16 +13127,16 @@
       && 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);
-    }
-  else
-    {
-      w->width = make_number (80);
-      w->height = make_number (40);
-    }
-
-  f->window_width = XINT (w->width);
+      w->total_cols = XCAR (Vx_max_tooltip_size);
+      w->total_lines = XCDR (Vx_max_tooltip_size);
+    }
+  else
+    {
+      w->total_cols = make_number (80);
+      w->total_lines = make_number (40);
+    }
+
+  FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
   adjust_glyphs (f);
   w->pseudo_window_p = 1;
 
--- a/src/xfns.c	Sat May 24 22:09:13 2003 +0000
+++ b/src/xfns.c	Sat May 24 22:09:34 2003 +0000
@@ -859,7 +859,7 @@
 
                                  /* Child of win.  */
                                  &child);
-    }
+	}
 
       had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
     }
@@ -870,10 +870,11 @@
 
   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;
@@ -1296,7 +1297,7 @@
   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),
@@ -1519,7 +1520,7 @@
 
   /* 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;
@@ -1550,8 +1551,8 @@
   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),
@@ -1956,21 +1957,21 @@
 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
 }
 
@@ -2369,8 +2370,8 @@
 
   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));
@@ -2448,7 +2449,7 @@
   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++;
@@ -2533,9 +2534,9 @@
        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;
@@ -2544,14 +2545,14 @@
 
       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;
@@ -2711,10 +2712,10 @@
   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),
@@ -2859,7 +2860,7 @@
      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.  */
@@ -3065,7 +3066,7 @@
   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
@@ -3193,7 +3194,7 @@
 #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),
@@ -3305,14 +3306,14 @@
 		       "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;
-
-  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);
 
   /* Set up faces after all frame parameters are known.  This call
@@ -3763,28 +3764,28 @@
 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
@@ -4475,8 +4476,8 @@
       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));
     }
@@ -9632,7 +9633,7 @@
   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;
@@ -9651,7 +9652,7 @@
   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
@@ -9832,13 +9833,13 @@
   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. */
@@ -10027,8 +10028,8 @@
 	    }
 
 	  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;
@@ -10063,7 +10064,7 @@
 
   /* 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))
@@ -10071,16 +10072,16 @@
       && 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);
-    }
-
-  f->window_width = XINT (w->width);
+      w->total_cols = make_number (80);
+      w->total_lines = make_number (40);
+    }
+
+  FRAME_TOTAL_COLS (f) = XINT (w->total_cols);
   adjust_glyphs (f);
   w->pseudo_window_p = 1;