changeset 51206:22a5614b558f

Make (few) 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:07:03 +0000
parents e53316f7017e
children 7e176ef34c10
files src/indent.c src/macmenu.c src/sysdep.c src/w32console.c src/w32menu.c src/widget.c
diffstat 6 files changed, 62 insertions(+), 68 deletions(-) [+]
line wrap: on
line diff
--- a/src/indent.c	Sat May 24 22:06:40 2003 +0000
+++ b/src/indent.c	Sat May 24 22:07:03 2003 +0000
@@ -1159,18 +1159,18 @@
 
 	window_width - 1
 	 - (has_vertical_scroll_bars
-	    ? FRAME_SCROLL_BAR_COLS (XFRAME (window->frame))
-	    : (window_width + window_left != frame_width))
+	    ? WINDOW_CONFIG_SCROLL_BAR_COLS (window)
+	    : (window_width + window_left != frame_cols))
 
 	where
-	  window_width is XFASTINT (w->width),
-	  window_left is XFASTINT (w->left),
+	  window_width is XFASTINT (w->total_cols),
+	  window_left is XFASTINT (w->left_col),
 	  has_vertical_scroll_bars is
-	    FRAME_HAS_VERTICAL_SCROLL_BARS (XFRAME (WINDOW_FRAME (window)))
-	  and frame_width = FRAME_WIDTH (XFRAME (window->frame))
+	    WINDOW_HAS_VERTICAL_SCROLL_BAR (window)
+	  and frame_cols = FRAME_COLS (XFRAME (window->frame))
 
-   Or you can let window_internal_width do this all for you, and write:
-	window_internal_width (w) - 1
+   Or you can let window_box_text_cols do this all for you, and write:
+	window_box_text_cols (w) - 1
 
    The `-1' accounts for the continuation-line backslashes; the rest
    accounts for window borders if the window is split horizontally, and
@@ -1366,7 +1366,7 @@
 	{
 	  if (hscroll
 	      || (truncate_partial_width_windows
-		  && width + 1 < FRAME_WIDTH (XFRAME (WINDOW_FRAME (win))))
+		  && width + 1 < FRAME_COLS (XFRAME (WINDOW_FRAME (win))))
 	      || !NILP (current_buffer->truncate_lines))
 	    {
 	      /* Truncating: skip to newline, unless we are already past
@@ -1834,7 +1834,9 @@
      register int from, vtarget;
      struct window *w;
 {
-  int width = window_internal_width (w) - 1;
+  /* We don't need to make room for continuation marks (we have fringes now),
+     so hould we really subtract 1 here if FRAME_WINDOW_P ?  ++KFS  */
+  int width = window_box_text_cols (w) - 1;
   int hscroll = XINT (w->hscroll);
   struct position pos;
   /* vpos is cumulative vertical position, changed as from is changed */
--- a/src/macmenu.c	Sat May 24 22:06:40 2003 +0000
+++ b/src/macmenu.c	Sat May 24 22:07:03 2003 +0000
@@ -732,10 +732,8 @@
 	  CHECK_LIVE_WINDOW (window);
 	  f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
 
-	  xpos = (FONT_WIDTH (FRAME_FONT (f))
-		  * XFASTINT (XWINDOW (window)->left));
-	  ypos = (FRAME_LINE_HEIGHT (f)
-		  * XFASTINT (XWINDOW (window)->top));
+	  xpos = WINDOW_LEFT_EDGE_X (XWINDOW (window));
+	  ypos = WINDOW_TOP_EDGE_Y (XWINDOW (window));
 	}
       else
 	/* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME,
--- a/src/sysdep.c	Sat May 24 22:06:40 2003 +0000
+++ b/src/sysdep.c	Sat May 24 22:07:03 2003 +0000
@@ -1814,10 +1814,10 @@
     return;
 #endif
   sf = SELECTED_FRAME ();
-  cursor_to (FRAME_HEIGHT (sf) - 1, 0);
-  clear_end_of_line (FRAME_WIDTH (sf));
+  cursor_to (FRAME_LINES (sf) - 1, 0);
+  clear_end_of_line (FRAME_COLS (sf));
   /* clear_end_of_line may move the cursor */
-  cursor_to (FRAME_HEIGHT (sf) - 1, 0);
+  cursor_to (FRAME_LINES (sf) - 1, 0);
 #if defined (IBMR2AIX) && defined (AIXHFT)
   {
     /* HFT devices normally use ^J as a LF/CR.  We forced it to
--- a/src/w32console.c	Sat May 24 22:06:40 2003 +0000
+++ b/src/w32console.c	Sat May 24 22:07:03 2003 +0000
@@ -121,8 +121,8 @@
 {
   struct frame * f = PICK_FRAME ();
 
-  clear_end_of_line (FRAME_WIDTH (f) - 1);
-  ins_del_lines (cursor_coords.Y, FRAME_HEIGHT (f) - cursor_coords.Y - 1);
+  clear_end_of_line (FRAME_COLS (f) - 1);
+  ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1);
 }
 
 /* Clear the frame.  */
@@ -138,7 +138,7 @@
   GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info);
 
   /* Remember that the screen buffer might be wider than the window.  */
-  n = FRAME_HEIGHT (f) * info.dwSize.X;
+  n = FRAME_LINES (f) * info.dwSize.X;
   dest.X = dest.Y = 0;
 
   FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r);
@@ -180,17 +180,17 @@
   if (n < 0)
     {
       scroll.Top = vpos - n;
-      scroll.Bottom = FRAME_HEIGHT (f);
+      scroll.Bottom = FRAME_LINES (f);
       dest.Y = vpos;
     }
   else
     {
       scroll.Top = vpos;
-      scroll.Bottom = FRAME_HEIGHT (f) - n;
+      scroll.Bottom = FRAME_LINES (f) - n;
       dest.Y = vpos + n;
     }
   scroll.Left = 0;
-  scroll.Right = FRAME_WIDTH (f);
+  scroll.Right = FRAME_COLS (f);
 
   dest.X = 0;
 
@@ -213,7 +213,7 @@
 	  for (i = scroll.Bottom; i < dest.Y; i++)
             {
 	      move_cursor (i, 0);
-	      clear_end_of_line (FRAME_WIDTH (f));
+	      clear_end_of_line (FRAME_COLS (f));
             }
         }
     }
@@ -226,7 +226,7 @@
 	  for (i = nb; i < scroll.Top; i++)
             {
 	      move_cursor (i, 0);
-	      clear_end_of_line (FRAME_WIDTH (f));
+	      clear_end_of_line (FRAME_COLS (f));
             }
         }
     }
@@ -256,12 +256,12 @@
   if (direction == LEFT)
     {
       scroll.Left = cursor_coords.X + dist;
-      scroll.Right = FRAME_WIDTH (f) - 1;
+      scroll.Right = FRAME_COLS (f) - 1;
     }
   else
     {
       scroll.Left = cursor_coords.X;
-      scroll.Right = FRAME_WIDTH (f) - dist - 1;
+      scroll.Right = FRAME_COLS (f) - dist - 1;
     }
 
   dest.X = cursor_coords.X;
@@ -661,16 +661,16 @@
 
   if (w32_use_full_screen_buffer)
     {
-      FRAME_HEIGHT (SELECTED_FRAME ()) = info.dwSize.Y;	/* lines per page */
-      SET_FRAME_WIDTH (SELECTED_FRAME (), info.dwSize.X);  /* characters per line */
+      FRAME_LINES (SELECTED_FRAME ()) = info.dwSize.Y;	/* lines per page */
+      SET_FRAME_COLS (SELECTED_FRAME (), info.dwSize.X);  /* characters per line */
     }
   else
     {
       /* Lines per page.  Use buffer coords instead of buffer size.  */
-      FRAME_HEIGHT (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom -
+      FRAME_LINES (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom -
 	info.srWindow.Top;
       /* Characters per line.  Use buffer coords instead of buffer size.  */
-      SET_FRAME_WIDTH (SELECTED_FRAME (), 1 + info.srWindow.Right -
+      SET_FRAME_COLS (SELECTED_FRAME (), 1 + info.srWindow.Right -
 		       info.srWindow.Left);
     }
 
--- a/src/w32menu.c	Sat May 24 22:06:40 2003 +0000
+++ b/src/w32menu.c	Sat May 24 22:07:03 2003 +0000
@@ -725,10 +725,8 @@
 	  CHECK_LIVE_WINDOW (window);
 	  f = XFRAME (WINDOW_FRAME (XWINDOW (window)));
 
-	  xpos = (FONT_WIDTH (FRAME_FONT (f))
-		  * XFASTINT (XWINDOW (window)->left));
-	  ypos = (FRAME_LINE_HEIGHT (f)
-		  * XFASTINT (XWINDOW (window)->top));
+	  xpos = WINDOW_LEFT_EDGE_X (XWINDOW (window));
+	  ypos = WINDOW_TOP_EDGE_Y (XWINDOW (window));
 	}
       else
 	/* ??? Not really clean; should be CHECK_WINDOW_OR_FRAME,
@@ -1601,7 +1599,7 @@
     /* Force the window size to be recomputed so that the frame's text
        area remains the same, if menubar has just been created.  */
     if (old_widget == NULL)
-      x_set_window_size (f, 0, FRAME_WIDTH (f), FRAME_HEIGHT (f));
+      x_set_window_size (f, 0, FRAME_COLS (f), FRAME_LINES (f));
   }
 
   UNBLOCK_INPUT;
--- a/src/widget.c	Sat May 24 22:06:40 2003 +0000
+++ b/src/widget.c	Sat May 24 22:07:03 2003 +0000
@@ -183,8 +183,8 @@
      int* pixel_height;
 {
   struct frame* f = ew->emacs_frame.frame;
-  *pixel_width = FONT_WIDTH (f->output_data.x->font);
-  *pixel_height = f->output_data.x->line_height;
+  *pixel_width = FRAME_COLUMN_WIDTH (f);
+  *pixel_height = FRAME_LINE_HEIGHT (f);
 }
 
 static void
@@ -196,8 +196,8 @@
      int* char_height;
 {
   struct frame* f = ew->emacs_frame.frame;
-  *char_width = PIXEL_TO_CHAR_WIDTH (f, (int) pixel_width);
-  *char_height = PIXEL_TO_CHAR_HEIGHT (f, (int) pixel_height);
+  *char_width = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, (int) pixel_width);
+  *char_height = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, (int) pixel_height);
 }
 
 static void
@@ -209,8 +209,8 @@
      Dimension* pixel_height;
 {
   struct frame* f = ew->emacs_frame.frame;
-  *pixel_width = CHAR_TO_PIXEL_WIDTH (f, char_width);
-  *pixel_height = CHAR_TO_PIXEL_HEIGHT (f, char_height);
+  *pixel_width = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, char_width);
+  *pixel_height = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, char_height);
 }
 
 static void
@@ -305,8 +305,8 @@
    */
 
   /* Hairily merged geometry */
-  unsigned int w = ew->emacs_frame.frame->width;
-  unsigned int h = ew->emacs_frame.frame->height;
+  unsigned int w = FRAME_COLS (ew->emacs_frame.frame);
+  unsigned int h = FRAME_LINES (ew->emacs_frame.frame);
 
   Widget wmshell = get_wm_shell ((Widget) ew);
   /* Each Emacs shell is now independent and top-level.  */
@@ -420,7 +420,7 @@
     }
 #endif /* 0 */
   {
-    struct frame* frame = ew->emacs_frame.frame;
+    struct frame *f = ew->emacs_frame.frame;
     Dimension pixel_width, pixel_height;
 
     /* Take into account the size of the scrollbar.  Always use the
@@ -428,18 +428,15 @@
        might end up with a frame width that is not a multiple of the
        frame's character width which is bad for vertically split
        windows.  */
-    frame->output_data.x->vertical_scroll_bar_extra
-      = (!FRAME_HAS_VERTICAL_SCROLL_BARS (frame)
-	 ? 0
-	 : (FRAME_SCROLL_BAR_COLS (frame)
-	    * FONT_WIDTH (frame->output_data.x->font)));
+    f->scroll_bar_actual_width
+      = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
 
-    compute_fringe_widths (frame, 0);
+    compute_fringe_widths (f, 0);
 
 #if 0 /* This can run Lisp code, and it is dangerous to give
 	 out the frame to Lisp code before it officially exists.
 	 This is handled in Fx_create_frame so not needed here.  */
-    change_frame_size (frame, h, w, 1, 0, 0);
+    change_frame_size (f, h, w, 1, 0, 0);
 #endif
     char_to_pixel_size (ew, w, h, &pixel_width, &pixel_height);
     ew->core.width = pixel_width;
@@ -645,10 +642,11 @@
 update_various_frame_slots (ew)
      EmacsFrame ew;
 {
-  struct x_output *x = ew->emacs_frame.frame->output_data.x;
-  x->pixel_height = ew->core.height + x->menubar_height;
-  x->pixel_width = ew->core.width;
-  x->internal_border_width = ew->emacs_frame.internal_border_width;
+  struct frame *f = ew->emacs_frame.frame;
+  struct x_output *x = f->output_data.x;
+  FRAME_PIXEL_HEIGHT (f) = ew->core.height + x->menubar_height;
+  FRAME_PIXEL_WIDTH (f) = ew->core.width;
+  f->internal_border_width = ew->emacs_frame.internal_border_width;
 
 }
 
@@ -656,11 +654,12 @@
 update_from_various_frame_slots (ew)
      EmacsFrame ew;
 {
-  struct x_output *x = ew->emacs_frame.frame->output_data.x;
-  ew->core.height = x->pixel_height - x->menubar_height;
-  ew->core.width = x->pixel_width;
+  struct frame *f = ew->emacs_frame.frame;
+  struct x_output *x = f->output_data.x;
+  ew->core.height = FRAME_PIXEL_HEIGHT (f) - x->menubar_height;
+  ew->core.width = FRAME_PIXEL_WIDTH (f);
   ew->core.background_pixel = x->background_pixel;
-  ew->emacs_frame.internal_border_width = x->internal_border_width;
+  ew->emacs_frame.internal_border_width = f->internal_border_width;
   ew->emacs_frame.font = x->font;
   ew->emacs_frame.foreground_pixel = x->foreground_pixel;
   ew->emacs_frame.cursor_color = x->cursor_pixel;
@@ -717,7 +716,7 @@
   }
 
 /* Update the font field in frame */
-  ew->emacs_frame.frame->output_data.x->font = ew->emacs_frame.font;
+  FRAME_FONT (ew->emacs_frame.frame) = ew->emacs_frame.font;
 #endif
 
   update_from_various_frame_slots (ew);
@@ -910,10 +909,8 @@
   if (columns < 3) columns = 3;  /* no way buddy */
 
   check_frame_size (f, &rows, &columns);
-  f->output_data.x->vertical_scroll_bar_extra
-    = (!FRAME_HAS_VERTICAL_SCROLL_BARS (f)
-       ? 0
-       : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.x->font)));
+  f->scroll_bar_actual_width
+    = FRAME_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f);
 
   compute_fringe_widths (f, 0);
 
@@ -923,7 +920,7 @@
   /* Something is really strange here wrt to the border width:
      Apparently, XtNwidth and XtNheight include the border, so we have
      to add it here.  But the XtNborderWidth set for the widgets has
-     no similarity to what f->output_data.x->border_width is set to.  */
+     no similarity to what f->border_width is set to.  */
   XtVaGetValues (widget, XtNborderWidth, &border_width, NULL);
   pixel_height += 2 * border_width;
   pixel_width += 2 * border_width;
@@ -1017,6 +1014,5 @@
   EmacsFrame ew = (EmacsFrame) widget;
   FRAME_PTR f = ew->emacs_frame.frame;
 
-  ew->emacs_frame.internal_border_width
-    = f->output_data.x->internal_border_width;
+  ew->emacs_frame.internal_border_width = f->internal_border_width;
 }