]> code.delx.au - gnu-emacs/blobdiff - src/frame.h
* cl-generic.el (cl-defmethod): Make docstring dynamic
[gnu-emacs] / src / frame.h
index f0cdcd4209661f894a42b3158ff7a142d5157d68..635a5ed7be4a5263b8e32d2ca991f41ccea288d5 100644 (file)
@@ -288,8 +288,9 @@ struct frame
      cleared.  */
   bool_bf explicit_name : 1;
 
-  /* True if size of some window on this frame has changed.  */
-  bool_bf window_sizes_changed : 1;
+  /* True if configuration of windows on this frame has changed since
+     last call of run_window_size_change_functions.  */
+  bool_bf window_configuration_changed : 1;
 
   /* True if the mouse has moved on this display device
      since the last time we checked.  */
@@ -308,6 +309,9 @@ struct frame
   ENUM_BF (output_method) output_method : 3;
 
 #ifdef HAVE_WINDOW_SYSTEM
+  /* True if this frame is a tooltip frame.  */
+  bool_bf tooltip : 1;
+
   /* See FULLSCREEN_ enum on top.  */
   ENUM_BF (fullscreen_type) want_fullscreen : 4;
 
@@ -828,10 +832,10 @@ default_pixels_per_inch_y (void)
    are frozen on frame F.  */
 #define FRAME_WINDOWS_FROZEN(f) (f)->frozen_window_starts
 
-/* True if a size change has been requested for frame F
-   but not yet really put into effect.  This can be true temporarily
-   when an X event comes in at a bad time.  */
-#define FRAME_WINDOW_SIZES_CHANGED(f) (f)->window_sizes_changed
+/* True if the frame's window configuration has changed since last call
+   of run_window_size_change_functions.  */
+#define FRAME_WINDOW_CONFIGURATION_CHANGED(f)  \
+  (f)->window_configuration_changed
 
 /* The minibuffer window of frame F, if it has one; otherwise nil.  */
 #define FRAME_MINIBUF_WINDOW(f) f->minibuffer_window
@@ -860,6 +864,9 @@ default_pixels_per_inch_y (void)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
   ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
 
+/* Whether F is a tooltip frame.  */
+#define FRAME_TOOLTIP_P(f) ((f)->tooltip)
+
 #else /* not HAVE_WINDOW_SYSTEM */
 
 /* If there is no window system, there are no scroll bars.  */
@@ -868,6 +875,9 @@ default_pixels_per_inch_y (void)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) ((void) f, 0)
 #define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) ((void) f, 0)
 
+/* If there is no window system, there are no tooltips.  */
+#define FRAME_TOOLTIP_P(f) ((void) f, 0)
+
 #endif /* HAVE_WINDOW_SYSTEM */
 
 /* Whether horizontal scroll bars are currently enabled for frame F.  */
@@ -1101,7 +1111,14 @@ extern Lisp_Object selected_frame;
 extern int frame_default_tool_bar_height;
 #endif
 
-extern struct frame *decode_window_system_frame (Lisp_Object);
+#ifdef HAVE_WINDOW_SYSTEM
+# define WINDOW_SYSTEM_RETURN
+#else
+# define WINDOW_SYSTEM_RETURN _Noreturn
+#endif
+
+extern WINDOW_SYSTEM_RETURN struct frame *
+  decode_window_system_frame (Lisp_Object);
 extern struct frame *decode_live_frame (Lisp_Object);
 extern struct frame *decode_any_frame (Lisp_Object);
 extern struct frame *make_initial_frame (void);
@@ -1111,11 +1128,20 @@ extern struct frame *make_minibuffer_frame (void);
 extern struct frame *make_frame_without_minibuffer (Lisp_Object,
                                                     struct kboard *,
                                                     Lisp_Object);
-extern bool window_system_available (struct frame *);
-#else /* not HAVE_WINDOW_SYSTEM */
-#define window_system_available(f) ((void) (f), false)
-#endif /* HAVE_WINDOW_SYSTEM */
-extern void check_window_system (struct frame *);
+extern bool display_available (void);
+#endif
+
+INLINE bool
+window_system_available (struct frame *f)
+{
+#ifdef HAVE_WINDOW_SYSTEM
+  return f ? FRAME_WINDOW_P (f) || FRAME_MSDOS_P (f) : display_available ();
+#else
+  return false;
+#endif
+}
+
+extern WINDOW_SYSTEM_RETURN void check_window_system (struct frame *);
 extern void frame_make_pointer_invisible (struct frame *);
 extern void frame_make_pointer_visible (struct frame *);
 extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object);
@@ -1149,46 +1175,68 @@ extern Lisp_Object Vframe_list;
    This value currently equals the average width of the default font of F.  */
 #define FRAME_COLUMN_WIDTH(F) ((F)->column_width)
 
-/* Pixel width of areas used to display truncation marks, continuation
-   marks, overlay arrows.  This is 0 for terminal frames.  */
+/* Get a frame's window system dimension.  If no window system, this is 0.  */
 
+INLINE int
+frame_dimension (int x)
+{
 #ifdef HAVE_WINDOW_SYSTEM
+  return x;
+#else
+  return 0;
+#endif
+}
 
 /* Total width of fringes reserved for drawing truncation bitmaps,
    continuation bitmaps and alike.  The width is in canonical char
    units of the frame.  This must currently be the case because window
    sizes aren't pixel values.  If it weren't the case, we wouldn't be
    able to split windows horizontally nicely.  */
-#define FRAME_FRINGE_COLS(F) ((F)->fringe_cols)
+INLINE int
+FRAME_FRINGE_COLS (struct frame *f)
+{
+  return frame_dimension (f->fringe_cols);
+}
 
 /* Pixel-width of the left and right fringe.  */
 
-#define FRAME_LEFT_FRINGE_WIDTH(F) ((F)->left_fringe_width)
-#define FRAME_RIGHT_FRINGE_WIDTH(F) ((F)->right_fringe_width)
+INLINE int
+FRAME_LEFT_FRINGE_WIDTH (struct frame *f)
+{
+  return frame_dimension (f->left_fringe_width);
+}
+INLINE int
+FRAME_RIGHT_FRINGE_WIDTH (struct frame *f)
+{
+  return frame_dimension (f->right_fringe_width);
+}
 
 /* Total width of fringes in pixels.  */
 
-#define FRAME_TOTAL_FRINGE_WIDTH(F) \
-  (FRAME_LEFT_FRINGE_WIDTH (F) + FRAME_RIGHT_FRINGE_WIDTH (F))
+INLINE int
+FRAME_TOTAL_FRINGE_WIDTH (struct frame *f)
+{
+  return FRAME_LEFT_FRINGE_WIDTH (f) + FRAME_RIGHT_FRINGE_WIDTH (f);
+}
 
 /* Pixel-width of internal border lines */
-#define FRAME_INTERNAL_BORDER_WIDTH(F) ((F)->internal_border_width)
+INLINE int
+FRAME_INTERNAL_BORDER_WIDTH (struct frame *f)
+{
+  return frame_dimension (f->internal_border_width);
+}
 
 /* Pixel-size of window border lines */
-#define FRAME_RIGHT_DIVIDER_WIDTH(F) ((F)->right_divider_width)
-#define FRAME_BOTTOM_DIVIDER_WIDTH(F) ((F)->bottom_divider_width)
-
-#else /* not HAVE_WINDOW_SYSTEM */
-
-#define FRAME_FRINGE_COLS(F)   0
-#define FRAME_TOTAL_FRINGE_WIDTH(F)    0
-#define FRAME_LEFT_FRINGE_WIDTH(F)  0
-#define FRAME_RIGHT_FRINGE_WIDTH(F) 0
-#define FRAME_INTERNAL_BORDER_WIDTH(F) 0
-#define FRAME_RIGHT_DIVIDER_WIDTH(F) 0
-#define FRAME_BOTTOM_DIVIDER_WIDTH(F) 0
-
-#endif /* not HAVE_WINDOW_SYSTEM */
+INLINE int
+FRAME_RIGHT_DIVIDER_WIDTH (struct frame *f)
+{
+  return frame_dimension (f->right_divider_width);
+}
+INLINE int
+FRAME_BOTTOM_DIVIDER_WIDTH (struct frame *f)
+{
+  return frame_dimension (f->bottom_divider_width);
+}
 \f
 /***********************************************************************
            Conversion between canonical units and pixels
@@ -1469,7 +1517,7 @@ INLINE_HEADER_END
 /* Suppress -Wsuggest-attribute=const if there are no scroll bars.
    This is for functions like x_set_horizontal_scroll_bars that have
    no effect in this case.  */
-#if ! USE_HORIZONTAL_SCROLL_BARS && 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+#if ! USE_HORIZONTAL_SCROLL_BARS && GNUC_PREREQ (4, 6, 0)
 # pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
 #endif