[!MULTI_FRAME] (FOR_EACH_FRAME): Fix Lisp_Object vs. int problems.
[bpt/emacs.git] / src / frame.h
index 0ec2811..a2d2e0e 100644 (file)
@@ -1,5 +1,5 @@
 /* Define frame-object for GNU Emacs.
-   Copyright (C) 1988, 1992, 1993 Free Software Foundation, Inc.
+   Copyright (C) 1993, 1994 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -41,7 +41,7 @@ enum output_method
 
 struct frame
 {
-  int size;
+  EMACS_INT size;
   struct Lisp_Vector *next;
 
   /* glyphs as they appear on the frame */
@@ -78,8 +78,8 @@ struct frame
   GLYPH phys_cursor_glyph;
 
   /* Size of this frame, in units of characters.  */
-  int height;
-  int width;
+  EMACS_INT height;
+  EMACS_INT width;
 
   /* New height and width for pending size change.  0 if no change pending.  */
   int new_height, new_width;
@@ -87,7 +87,7 @@ struct frame
   /* Name of this frame: a Lisp string.  See also `explicit_name'.  */
   Lisp_Object name;
 
-  /* The frame which should recieve keystrokes that occur in this
+  /* The frame which should receive keystrokes that occur in this
      frame, or nil if they should go to the frame itself.  This is
      usually nil, but if the frame is minibufferless, we can use this
      to redirect keystrokes to a surrogate minibuffer frame when
@@ -152,6 +152,11 @@ struct frame
   /* Number of lines of menu bar.  */
   int menu_bar_lines;
 
+#ifdef USE_X_TOOLKIT
+  /* Nonzero means using a menu bar that comes from the X toolkit.  */
+  int external_menu_bar;
+#endif
+
   /* Nonzero if last attempt at redisplay on this frame was preempted.  */
   char display_preempted;
 
@@ -173,7 +178,7 @@ struct frame
      These should probably be considered read-only by everyone except
      FRAME_SAMPLE_VISIBILITY.
 
-     This two are mutually exclusive.  They might both be zero, if the
+     These two are mutually exclusive.  They might both be zero, if the
      frame has been made invisible without an icon.  */
   char visible, iconified;
 
@@ -228,6 +233,13 @@ struct frame
   /* Nonnegative if current redisplay should not do scroll computation
      for lines beyond a certain vpos.  This is the vpos.  */
   int scroll_bottom_vpos;
+
+  /* A vector that records the entire structure of this frame's menu bar.
+     For the format of the data, see extensive comments in xmenu.c.
+     Only the X toolkit version uses this.  */
+  Lisp_Object menu_bar_vector;
+  /* Number of elements in the vector that have meaningful data.  */
+  int menu_bar_items_used;
 };
 
 #ifdef MULTI_FRAME
@@ -253,6 +265,11 @@ typedef struct frame *FRAME_PTR;
 #define FRAME_NEW_HEIGHT(f) (f)->new_height
 #define FRAME_NEW_WIDTH(f) (f)->new_width
 #define FRAME_MENU_BAR_LINES(f) (f)->menu_bar_lines
+#ifdef USE_X_TOOLKIT
+#define FRAME_EXTERNAL_MENU_BAR(f) (f)->external_menu_bar
+#else
+#define FRAME_EXTERNAL_MENU_BAR(f) 0
+#endif
 #define FRAME_CURSOR_X(f) (f)->cursor_x
 #define FRAME_CURSOR_Y(f) (f)->cursor_y
 #define FRAME_VISIBLE_P(f) ((f)->visible != 0)
@@ -337,7 +354,7 @@ typedef struct frame *FRAME_PTR;
        list_var = XCONS (list_var)->cdr)
 
 
-extern Lisp_Object Qframep, Qframe_live_p;
+extern Lisp_Object Qframep, Qframe_live_p, Qicon;
 
 extern struct frame *selected_frame;
 extern struct frame *last_nonminibuf_frame;
@@ -364,8 +381,8 @@ extern Lisp_Object Vterminal_frame;
    element explicitly.  */
 extern struct frame the_only_frame;
 
-extern int selected_frame;
-extern int last_nonminibuf_frame;
+extern EMACS_INT selected_frame;
+extern EMACS_INT last_nonminibuf_frame;
 
 #define XFRAME(f) selected_frame
 #define WINDOW_FRAME(w) selected_frame
@@ -392,7 +409,7 @@ extern int last_nonminibuf_frame;
 #define FRAME_NO_SPLIT_P(f) 0
 #define FRAME_WANTS_MODELINE_P(f) 1
 #define FRAME_ICONIFIED_P(f) 0
-#define FRAME_MINIBUF_WINDOW(f) (the_only_frame.root_window)
+#define FRAME_MINIBUF_WINDOW(f) (minibuf_window)
 #define FRAME_ROOT_WINDOW(f) (the_only_frame.root_window)
 #define FRAME_SELECTED_WINDOW(f) (selected_window)
 #define SET_GLYPHS_FRAME(glyphs,frame) do ; while (0)
@@ -427,7 +444,7 @@ extern int last_nonminibuf_frame;
    `for' loop which traverses Vframe_list using LIST_VAR and
    FRAME_VAR.  */
 #define FOR_EACH_FRAME(list_var, frame_var)                    \
-  for (list_var = Qt; frame_var = selected_frame, ! NILP (list_var); list_var = Qnil)
+  for (list_var = Qt; XFASTINT (frame_var) = selected_frame, ! NILP (list_var); list_var = Qnil)
 
 #endif /* not MULTI_FRAME */