Untag more efficiently if USE_LSB_TAG.
[bpt/emacs.git] / src / frame.h
index 1f176f6..9779f4a 100644 (file)
@@ -1,5 +1,5 @@
 /* Define frame-object for GNU Emacs.
 /* Define frame-object for GNU Emacs.
-   Copyright (C) 1993-1994, 1999-2011 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 1999-2012 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 
 This file is part of GNU Emacs.
 
@@ -82,8 +82,7 @@ struct font_driver_list;
 
 struct frame
 {
 
 struct frame
 {
-  EMACS_UINT size;
-  struct Lisp_Vector *next;
+  struct vectorlike_header header;
 
   /* All Lisp_Object components must come first.
      That ensures they are all aligned normally.  */
 
   /* All Lisp_Object components must come first.
      That ensures they are all aligned normally.  */
@@ -193,7 +192,7 @@ struct frame
   struct face_cache *face_cache;
 
   /* Number of elements in `menu_bar_vector' that have meaningful data.  */
   struct face_cache *face_cache;
 
   /* Number of elements in `menu_bar_vector' that have meaningful data.  */
-  EMACS_INT menu_bar_items_used;
+  int menu_bar_items_used;
 
   /* A buffer to hold the frame's name.  We can't use the Lisp
      string's pointer (`name', above) because it might get relocated.  */
 
   /* A buffer to hold the frame's name.  We can't use the Lisp
      string's pointer (`name', above) because it might get relocated.  */
@@ -259,11 +258,11 @@ struct frame
 
   /* Size of this frame, excluding fringes, scroll bars etc.,
      in units of canonical characters.  */
 
   /* Size of this frame, excluding fringes, scroll bars etc.,
      in units of canonical characters.  */
-  EMACS_INT text_lines, text_cols;
+  int text_lines, text_cols;
 
   /* Total size of this frame (i.e. its native window), in units of
      canonical characters.  */
 
   /* Total size of this frame (i.e. its native window), in units of
      canonical characters.  */
-  EMACS_INT total_lines, total_cols;
+  int total_lines, total_cols;
 
   /* New text height and width for pending size change.
      0 if no change pending.  */
 
   /* New text height and width for pending size change.
      0 if no change pending.  */
@@ -372,7 +371,7 @@ struct frame
      if greater than 1, then the frame is obscured - we still consider
      it to be "visible" as seen from lisp, but we don't bother
      updating it.  We must take care to garbage the frame when it
      if greater than 1, then the frame is obscured - we still consider
      it to be "visible" as seen from lisp, but we don't bother
      updating it.  We must take care to garbage the frame when it
-     ceaces to be obscured though.
+     ceases to be obscured though.
 
      iconified is nonzero if the frame is currently iconified.
 
 
      iconified is nonzero if the frame is currently iconified.
 
@@ -502,7 +501,8 @@ struct frame
 
 typedef struct frame *FRAME_PTR;
 
 
 typedef struct frame *FRAME_PTR;
 
-#define XFRAME(p) (eassert (FRAMEP(p)),(struct frame *) XPNTR (p))
+#define XFRAME(p) \
+  (eassert (FRAMEP (p)), (struct frame *) XUNTAG (p, Lisp_Vectorlike))
 #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
 
 /* Given a window, return its frame as a Lisp_Object.  */
 #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
 
 /* Given a window, return its frame as a Lisp_Object.  */
@@ -539,12 +539,12 @@ typedef struct frame *FRAME_PTR;
    does not have FRAME_X_DISPLAY_INFO.  */
 #ifdef HAVE_WINDOW_SYSTEM
 # define MOUSE_HL_INFO(F)                                      \
    does not have FRAME_X_DISPLAY_INFO.  */
 #ifdef HAVE_WINDOW_SYSTEM
 # define MOUSE_HL_INFO(F)                                      \
-   (FRAME_WINDOW_P(F)                                          \
-    ? &(FRAME_X_DISPLAY_INFO(F)->mouse_highlight)              \
-    : &(((F)->output_data.tty->display_info)->mouse_highlight))
+  (FRAME_WINDOW_P(F)                                           \
+   ? &FRAME_X_DISPLAY_INFO(F)->mouse_highlight                 \
+   : &(F)->output_data.tty->display_info->mouse_highlight)
 #else
 # define MOUSE_HL_INFO(F)                                      \
 #else
 # define MOUSE_HL_INFO(F)                                      \
-    (&(((F)->output_data.tty->display_info)->mouse_highlight))
+  (&(F)->output_data.tty->display_info->mouse_highlight)
 #endif
 
 /* Nonzero if frame F is still alive (not deleted).  */
 #endif
 
 /* Nonzero if frame F is still alive (not deleted).  */
@@ -595,7 +595,7 @@ typedef struct frame *FRAME_PTR;
 /* Lines above the top-most window in frame F.  */
 
 #define FRAME_TOP_MARGIN(F) \
 /* Lines above the top-most window in frame F.  */
 
 #define FRAME_TOP_MARGIN(F) \
-     (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F))
+  (FRAME_MENU_BAR_LINES (F) + FRAME_TOOL_BAR_LINES (F))
 
 /* Pixel height of the top margin above.  */
 
 
 /* Pixel height of the top margin above.  */
 
@@ -660,11 +660,11 @@ typedef struct frame *FRAME_PTR;
    and which side they are on.  */
 #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
    and which side they are on.  */
 #define FRAME_VERTICAL_SCROLL_BAR_TYPE(f) ((f)->vertical_scroll_bar_type)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS(f) \
-     ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
+  ((f)->vertical_scroll_bar_type != vertical_scroll_bar_none)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
-     ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
+  ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
-     ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
+  ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
 
 /* Width that a scroll bar in frame F should have, if there is one.
    Measured in pixels.
 
 /* Width that a scroll bar in frame F should have, if there is one.
    Measured in pixels.
@@ -681,13 +681,13 @@ typedef struct frame *FRAME_PTR;
    the right in this frame, or there are no scroll bars, value is 0.  */
 
 #define FRAME_LEFT_SCROLL_BAR_COLS(f)                  \
    the right in this frame, or there are no scroll bars, value is 0.  */
 
 #define FRAME_LEFT_SCROLL_BAR_COLS(f)                  \
-     (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)       \
-      ? FRAME_CONFIG_SCROLL_BAR_COLS (f)               \
-      : 0)
+  (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)          \
+   ? FRAME_CONFIG_SCROLL_BAR_COLS (f)                  \
+   : 0)
 
 /* Width of a left scroll bar in frame F, measured in pixels */
 
 
 /* Width of a left scroll bar in frame F, measured in pixels */
 
-#define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f)                                    \
+#define FRAME_LEFT_SCROLL_BAR_AREA_WIDTH(f)                            \
   (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)                          \
    ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f))       \
    : 0)
   (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f)                          \
    ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f))       \
    : 0)
@@ -697,13 +697,13 @@ typedef struct frame *FRAME_PTR;
    the left in this frame, or there are no scroll bars, value is 0.  */
 
 #define FRAME_RIGHT_SCROLL_BAR_COLS(f)                 \
    the left in this frame, or there are no scroll bars, value is 0.  */
 
 #define FRAME_RIGHT_SCROLL_BAR_COLS(f)                 \
-     (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)      \
-      ? FRAME_CONFIG_SCROLL_BAR_COLS (f)               \
-      : 0)
+  (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)         \
+   ? FRAME_CONFIG_SCROLL_BAR_COLS (f)                  \
+   : 0)
 
 /* Width of a right scroll bar area in frame F, measured in pixels */
 
 
 /* Width of a right scroll bar area in frame F, measured in pixels */
 
-#define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f)                                   \
+#define FRAME_RIGHT_SCROLL_BAR_AREA_WIDTH(f)                           \
   (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)                         \
    ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f))       \
    : 0)
   (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (f)                         \
    ? (FRAME_CONFIG_SCROLL_BAR_COLS (f) * FRAME_COLUMN_WIDTH (f))       \
    : 0)
@@ -711,9 +711,9 @@ typedef struct frame *FRAME_PTR;
 /* Actual width of a scroll bar in frame F, measured in columns.  */
 
 #define FRAME_SCROLL_BAR_COLS(f)                       \
 /* Actual width of a scroll bar in frame F, measured in columns.  */
 
 #define FRAME_SCROLL_BAR_COLS(f)                       \
-     (FRAME_HAS_VERTICAL_SCROLL_BARS (f)               \
-      ? FRAME_CONFIG_SCROLL_BAR_COLS (f)               \
-      : 0)
+  (FRAME_HAS_VERTICAL_SCROLL_BARS (f)                  \
+   ? FRAME_CONFIG_SCROLL_BAR_COLS (f)                  \
+   : 0)
 
 /* Actual width of a scroll bar area in frame F, measured in pixels.  */
 
 
 /* Actual width of a scroll bar area in frame F, measured in pixels.  */
 
@@ -732,21 +732,21 @@ typedef struct frame *FRAME_PTR;
    not including scroll bars and fringes.  */
 
 #define SET_FRAME_COLS(f, val)                                         \
    not including scroll bars and fringes.  */
 
 #define SET_FRAME_COLS(f, val)                                         \
-     (FRAME_COLS (f) = (val),                                          \
-      (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f)))
+  (FRAME_COLS (f) = (val),                                             \
+   (f)->total_cols = FRAME_TOTAL_COLS_ARG (f, FRAME_COLS (f)))
 
 /* Given a value WIDTH for frame F's nominal width,
    return the value that FRAME_TOTAL_COLS should have.  */
 
 #define FRAME_TOTAL_COLS_ARG(f, width)         \
 
 /* Given a value WIDTH for frame F's nominal width,
    return the value that FRAME_TOTAL_COLS should have.  */
 
 #define FRAME_TOTAL_COLS_ARG(f, width)         \
-     ((width)                                  \
-      + FRAME_SCROLL_BAR_COLS (f)              \
-      + FRAME_FRINGE_COLS (f))
+  ((width)                                     \
+   + FRAME_SCROLL_BAR_COLS (f)                 \
+   + FRAME_FRINGE_COLS (f))
 
 /* Maximum + 1 legitimate value for FRAME_CURSOR_X.  */
 
 #define FRAME_CURSOR_X_LIMIT(f) \
 
 /* Maximum + 1 legitimate value for FRAME_CURSOR_X.  */
 
 #define FRAME_CURSOR_X_LIMIT(f) \
-     (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f))
+  (FRAME_COLS (f) + FRAME_LEFT_SCROLL_BAR_COLS (f))
 
 /* Nonzero if frame F has scroll bars.  */
 
 
 /* Nonzero if frame F has scroll bars.  */
 
@@ -845,7 +845,6 @@ extern struct frame *make_frame_without_minibuffer (Lisp_Object,
                                                     struct kboard *,
                                                     Lisp_Object);
 #endif /* HAVE_WINDOW_SYSTEM */
                                                     struct kboard *,
                                                     Lisp_Object);
 #endif /* HAVE_WINDOW_SYSTEM */
-extern int other_visible_frames (struct frame *);
 extern void frame_make_pointer_invisible (void);
 extern void frame_make_pointer_visible (void);
 extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
 extern void frame_make_pointer_invisible (void);
 extern void frame_make_pointer_visible (void);
 extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
@@ -940,18 +939,18 @@ extern Lisp_Object selected_frame;
    float.  Value is a C integer.  */
 
 #define FRAME_PIXEL_X_FROM_CANON_X(F, X)               \
    float.  Value is a C integer.  */
 
 #define FRAME_PIXEL_X_FROM_CANON_X(F, X)               \
-     (INTEGERP (X)                                     \
-      ? XINT (X) * FRAME_COLUMN_WIDTH (F)              \
-      : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F)))
+  (INTEGERP (X)                                                \
+   ? XINT (X) * FRAME_COLUMN_WIDTH (F)                 \
+   : (int) (XFLOAT_DATA (X) * FRAME_COLUMN_WIDTH (F)))
 
 /* Convert canonical value Y to pixels.  F is the frame whose
    canonical character height is to be used.  X must be a Lisp integer
    or float.  Value is a C integer.  */
 
 #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y)               \
 
 /* Convert canonical value Y to pixels.  F is the frame whose
    canonical character height is to be used.  X must be a Lisp integer
    or float.  Value is a C integer.  */
 
 #define FRAME_PIXEL_Y_FROM_CANON_Y(F, Y)               \
-     (INTEGERP (Y)                                     \
-      ? XINT (Y) * FRAME_LINE_HEIGHT (F)               \
-      : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F)))
+  (INTEGERP (Y)                                                \
+   ? XINT (Y) * FRAME_LINE_HEIGHT (F)                  \
+   : (int) (XFLOAT_DATA (Y) * FRAME_LINE_HEIGHT (F)))
 
 /* Convert pixel-value X to canonical units.  F is the frame whose
    canonical character width is to be used.  X is a C integer.  Result
 
 /* Convert pixel-value X to canonical units.  F is the frame whose
    canonical character width is to be used.  X is a C integer.  Result
@@ -959,9 +958,9 @@ extern Lisp_Object selected_frame;
    otherwise it's a Lisp integer.  */
 
 #define FRAME_CANON_X_FROM_PIXEL_X(F, X)                       \
    otherwise it's a Lisp integer.  */
 
 #define FRAME_CANON_X_FROM_PIXEL_X(F, X)                       \
-     ((X) % FRAME_COLUMN_WIDTH (F) != 0                                \
-      ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F))     \
-      : make_number ((X) / FRAME_COLUMN_WIDTH (F)))
+  ((X) % FRAME_COLUMN_WIDTH (F) != 0                           \
+   ? make_float ((double) (X) / FRAME_COLUMN_WIDTH (F))                \
+   : make_number ((X) / FRAME_COLUMN_WIDTH (F)))
 
 /* Convert pixel-value Y to canonical units.  F is the frame whose
    canonical character height is to be used.  Y is a C integer.
 
 /* Convert pixel-value Y to canonical units.  F is the frame whose
    canonical character height is to be used.  Y is a C integer.
@@ -969,9 +968,9 @@ extern Lisp_Object selected_frame;
    otherwise it's a Lisp integer.  */
 
 #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y)                       \
    otherwise it's a Lisp integer.  */
 
 #define FRAME_CANON_Y_FROM_PIXEL_Y(F, Y)                       \
-     ((Y) % FRAME_LINE_HEIGHT (F)                              \
-      ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F))      \
-      : make_number ((Y) / FRAME_LINE_HEIGHT (F)))
+  ((Y) % FRAME_LINE_HEIGHT (F)                                 \
+   ? make_float ((double) (Y) / FRAME_LINE_HEIGHT (F))         \
+   : make_number ((Y) / FRAME_LINE_HEIGHT (F)))
 
 
 \f
 
 
 \f
@@ -1133,6 +1132,10 @@ extern Lisp_Object display_x_get_resource (Display_Info *,
                                           Lisp_Object component,
                                           Lisp_Object subclass);
 
                                           Lisp_Object component,
                                           Lisp_Object subclass);
 
+#if defined HAVE_X_WINDOWS && !defined USE_X_TOOLKIT
+extern char *x_get_resource_string (const char *, const char *);
+#endif
+
 /* In xmenu.c */
 extern void set_frame_menubar (FRAME_PTR, int, int);
 
 /* In xmenu.c */
 extern void set_frame_menubar (FRAME_PTR, int, int);