(check_frame_size): Fix minimum height calculation.
[bpt/emacs.git] / src / frame.h
index d1c1670..4d40ad9 100644 (file)
@@ -1,10 +1,5 @@
-/* Don't multiply include: dispextern.h includes macterm.h which includes frame.h 
-   some emacs source includes both dispextern.h and frame.h */
-#ifndef _XFRAME_H_
-#define _XFRAME_H_
-
 /* Define frame-object for GNU Emacs.
-   Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994, 1999, 2000, 2001 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -23,6 +18,13 @@ along with GNU Emacs; see the file COPYING.  If not, write to
 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
+/* Don't multiply include: dispextern.h includes macterm.h which
+   includes frame.h some emacs source includes both dispextern.h and
+   frame.h */
+
+#ifndef EMACS_FRAME_H
+#define EMACS_FRAME_H
+
 \f
 /* Miscellanea.  */
 
@@ -69,6 +71,8 @@ struct x_output
   PIX_TYPE foreground_pixel;
 };
 
+#define FRAME_INTERNAL_BORDER_WIDTH(f) 0
+
 #endif /* ! HAVE_X_WINDOWS */
 
 
@@ -177,7 +181,7 @@ struct frame
   Lisp_Object tool_bar_window;
 
   /* Desired and current tool-bar items.  */
-  Lisp_Object desired_tool_bar_items, current_tool_bar_items;
+  Lisp_Object tool_bar_items;
 
   /* Desired and current contents displayed in tool_bar_window.  */
   Lisp_Object desired_tool_bar_string, current_tool_bar_string;
@@ -204,8 +208,7 @@ struct frame
   /* Margin at the top of the frame.  Used to display the tool-bar.  */
   int tool_bar_lines;
 
-  int n_desired_tool_bar_items;
-  int n_current_tool_bar_items;
+  int n_tool_bar_items;
   
   /* A buffer for decode_mode_line. */
   char *decode_mode_spec_buffer;
@@ -243,7 +246,7 @@ struct frame
     struct x_output *x;
     struct w32_output *w32;
     struct mac_output *mac;
-    int nothing;
+    EMACS_INT nothing;
   }
   output_data;
 
@@ -257,7 +260,7 @@ struct frame
   /* Number of lines of menu bar.  */
   int menu_bar_lines;
 
-#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)
+#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (macintosh)
   /* Nonzero means using a menu bar that comes from the X toolkit.  */
   int external_menu_bar;
 #endif
@@ -298,16 +301,10 @@ struct frame
   /* Asynchronous input handlers change these, and
      FRAME_SAMPLE_VISIBILITY copies them into visible and iconified.
      See FRAME_SAMPLE_VISIBILITY, below.  */
-#ifdef __STDC__
-  volatile
-#endif
-  char async_visible, async_iconified;
+  volatile char async_visible, async_iconified;
 
   /* Nonzero if this frame should be redrawn.  */
-#ifdef __STDC__
-  volatile
-#endif
-  char garbaged;
+  volatile char garbaged;
 
   /* True if frame actually has a minibuffer window on it.
      0 if using a minibuffer window that isn't on this frame.  */
@@ -357,17 +354,9 @@ struct frame
   int scroll_bar_pixel_width;
   int scroll_bar_cols;
 
-  /* Width of area for drawing truncation marks and overlay arrow.  */
-  int trunc_area_pixel_width, trunc_area_cols;
-
   /* The baud rate that was used to calculate costs for this frame.  */
   int cost_calculation_baud_rate;
 
-  /* A pointer to the data structure containing all information of
-     fontsets associated with this frame.  See the comments in
-     fontset.h for more detail.  */
-  struct fontset_data *fontset_data;
-
   /* Nonzero if the mouse has moved on this display
      since the last time we checked.  */
   char mouse_moved;
@@ -376,6 +365,13 @@ struct frame
      SCREEN_GAMMA) where viewing_gamma is 0.4545 and SCREEN_GAMMA is a
      frame parameter.  0 means don't do gamma correction.  */
   double gamma;
+
+  /* Additional space to put between text lines on this frame.  */
+  int extra_line_spacing;
+
+  /* Set to non-zero in change_frame_size when size of frame changed
+     Clear the frame in clear_garbaged_frames if set.  */
+  unsigned resized_p : 1;
 };
 
 #ifdef MULTI_KBOARD
@@ -386,7 +382,7 @@ struct frame
 
 typedef struct frame *FRAME_PTR;
 
-#define XFRAME(p) ((struct frame *) XPNTR (p))
+#define XFRAME(p) (eassert (GC_FRAMEP(p)),(struct frame *) XPNTR (p))
 #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
 
 /* Given a window, return its frame as a Lisp_Object.  */
@@ -448,7 +444,7 @@ typedef struct frame *FRAME_PTR;
 
 /* Nonzero if this frame should display a menu bar
    in a way that does not use any text lines.  */
-#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI)
+#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (macintosh)
 #define FRAME_EXTERNAL_MENU_BAR(f) (f)->external_menu_bar
 #else
 #define FRAME_EXTERNAL_MENU_BAR(f) 0
@@ -523,11 +519,21 @@ typedef struct frame *FRAME_PTR;
 #define FRAME_SCROLL_BAR_COLS(f) ((f)->scroll_bar_cols)
 
 /* Width of a scroll bar in frame F, measured in columns (characters),
-   but only if scroll bars are on the left.
-   If scroll bars are on the right in this frame, it is 0.  */
-#define FRAME_LEFT_SCROLL_BAR_WIDTH(f) \
-     (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
-      ? FRAME_SCROLL_BAR_COLS (f) \
+   but only if scroll bars are on the left.  If scroll bars are on
+   the right in this frame, or there are no scroll bars, value is 0.  */
+
+#define FRAME_LEFT_SCROLL_BAR_WIDTH(f)                 \
+     (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)       \
+      ? FRAME_SCROLL_BAR_COLS (f)                      \
+      : 0)
+
+/* Width of a scroll bar in frame F, measured in columns (characters),
+   but only if scroll bars are on the right.  If scroll bars are on
+   the left in this frame, or there are no scroll bars, value is 0.  */
+
+#define FRAME_RIGHT_SCROLL_BAR_WIDTH(f)                        \
+     (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)      \
+      ? FRAME_SCROLL_BAR_COLS (f)                      \
       : 0)
 
 /* Width of a scroll bar in frame F, measured in columns (characters).  */
@@ -552,7 +558,7 @@ typedef struct frame *FRAME_PTR;
 #define FRAME_WINDOW_WIDTH_ARG(f, width)       \
      ((width)                                  \
       + FRAME_SCROLL_BAR_WIDTH (f)             \
-      + FRAME_FLAGS_AREA_COLS (f))
+      + FRAME_FRINGE_COLS (f))
 
 /* Maximum + 1 legitimate value for FRAME_CURSOR_X.  */
 #define FRAME_CURSOR_X_LIMIT(f) \
@@ -564,7 +570,6 @@ typedef struct frame *FRAME_PTR;
 #define FRAME_CONDEMNED_SCROLL_BARS(f) ((f)->condemned_scroll_bars)
 #define FRAME_MENU_BAR_ITEMS(f) ((f)->menu_bar_items)
 #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate)
-#define FRAME_FONTSET_DATA(f) ((f)->fontset_data)
 
 /* Return a pointer to the face cache of frame F.  */
 
@@ -606,13 +611,13 @@ typedef struct frame *FRAME_PTR;
    (f)->visible = (f)->async_visible, \
    (f)->iconified = (f)->async_iconified)
 
-#define CHECK_FRAME(x, i)                              \
+#define CHECK_FRAME(x)                                 \
      do {                                              \
        if (! FRAMEP (x))                               \
          x = wrong_type_argument (Qframep, (x));       \
      } while (0)
 
-#define CHECK_LIVE_FRAME(x, i)                         \
+#define CHECK_LIVE_FRAME(x)                            \
      do {                                              \
        if (! FRAMEP (x)                                        \
           || ! FRAME_LIVE_P (XFRAME (x)))              \
@@ -638,6 +643,7 @@ typedef struct frame *FRAME_PTR;
 
 
 extern Lisp_Object Qframep, Qframe_live_p, Qicon;
+extern Lisp_Object Qleft_fringe, Qright_fringe;
 
 extern struct frame *last_nonminibuf_frame;
 
@@ -683,13 +689,13 @@ extern Lisp_Object Vterminal_frame;
 extern Lisp_Object selected_frame;
 
 /* Value is a pointer to the selected frame.  If the selected frame
-   isn't life, abort.  */
+   isn't live, abort.  */
 
 #define SELECTED_FRAME()                               \
      ((FRAMEP (selected_frame)                         \
        && FRAME_LIVE_P (XFRAME (selected_frame)))      \
       ? XFRAME (selected_frame)                                \
-      : (struct frame *) (abort (), 0))
+      : (abort (), (struct frame *) 0))
 
 \f
 /***********************************************************************
@@ -714,16 +720,24 @@ extern Lisp_Object selected_frame;
    marks, overlay arrows.  This is 0 for terminal frames.  */
 
 #ifdef HAVE_WINDOW_SYSTEM
-#define FRAME_FLAGS_AREA_COLS(F) \
-     (FRAME_WINDOW_P ((F)) ? FRAME_X_FLAGS_AREA_COLS ((F)) : 0)
-#define FRAME_FLAGS_AREA_WIDTH(F) FRAME_X_FLAGS_AREA_WIDTH (F)
-#define FRAME_LEFT_FLAGS_AREA_WIDTH(F) FRAME_X_LEFT_FLAGS_AREA_WIDTH (F)
+
+#define FRAME_FRINGE_COLS(F) \
+     (FRAME_WINDOW_P (F) ? FRAME_X_FRINGE_COLS (F) : 0)
+#define FRAME_FRINGE_WIDTH(F) \
+     (FRAME_WINDOW_P (F) ? FRAME_X_FRINGE_WIDTH (F) : 0)
+#define FRAME_LEFT_FRINGE_WIDTH(F) \
+     (FRAME_WINDOW_P (F) ? FRAME_X_LEFT_FRINGE_WIDTH (F) : 0)
+#define FRAME_RIGHT_FRINGE_WIDTH(F) \
+     (FRAME_WINDOW_P (F) ? FRAME_X_RIGHT_FRINGE_WIDTH (F) : 0)
      
-#else
-#define FRAME_FLAGS_AREA_WIDTH(F)      0
-#define FRAME_FLAGS_AREA_COLS(F)       0
-#define FRAME_LEFT_FLAGS_AREA_WIDTH(F)  0
-#endif
+#else /* not HAVE_WINDOW_SYSTEM */
+
+#define FRAME_FRINGE_WIDTH(F)  0
+#define FRAME_FRINGE_COLS(F)   0
+#define FRAME_LEFT_FRINGE_WIDTH(F)  0
+#define FRAME_RIGHT_FRINGE_WIDTH(F) 0
+
+#endif /* not HAVE_WINDOW_SYSTEM */
      
 
 
@@ -774,4 +788,4 @@ extern Lisp_Object selected_frame;
       ? make_float ((double) (Y) / CANON_Y_UNIT (F))   \
       : make_number ((Y) / CANON_Y_UNIT (F)))  
                             
-#endif /* not defined _FRAME_H_ */
+#endif /* not EMACS_FRAME_H */