diff src/frame-impl.h @ 5128:7be849cb8828 ben-lisp-object

merge
author Ben Wing <ben@xemacs.org>
date Sun, 07 Mar 2010 02:09:59 -0600
parents a9c41067dd88 0ca81354c4c7
children 308d34e9f07d
line wrap: on
line diff
--- a/src/frame-impl.h	Fri Mar 05 04:08:17 2010 -0600
+++ b/src/frame-impl.h	Sun Mar 07 02:09:59 2010 -0600
@@ -100,17 +100,23 @@
   /* Size of toolbars as seen by redisplay. This is used to determine
      whether to re-layout windows by a call to change_frame_size early
      in redisplay_frame. */
-  int current_toolbar_size[4];
+  int current_toolbar_size[NUM_EDGES];
 #endif
 
   /* Size of gutters as seen by redisplay. This is used to determine
      whether to re-layout windows by a call to change_frame_size early
      in redisplay_frame. */
-  int current_gutter_bounds[4];
+  int current_gutter_bounds[NUM_EDGES];
+
+  /* Toolbar visibility */
+  int toolbar_was_visible[NUM_EDGES];
+
+  /* gutter visibility */
+  int gutter_was_visible[NUM_EDGES];
 
   /* Dynamic arrays of display lines for gutters */
-  display_line_dynarr *current_display_lines[4];
-  display_line_dynarr *desired_display_lines[4];
+  display_line_dynarr *current_display_lines[NUM_EDGES];
+  display_line_dynarr *desired_display_lines[NUM_EDGES];
 
   /* A structure of auxiliary data specific to the device type.  For
      example, struct x_frame is for X window frames; defined in
@@ -160,16 +166,6 @@
   /* True if frame's root window can't be split.  */
   unsigned int no_split :1;
 
-  unsigned int top_toolbar_was_visible :1;
-  unsigned int bottom_toolbar_was_visible :1;
-  unsigned int left_toolbar_was_visible :1;
-  unsigned int right_toolbar_was_visible :1;
-  /* gutter visibility */
-  unsigned int top_gutter_was_visible :1;
-  unsigned int bottom_gutter_was_visible :1;
-  unsigned int left_gutter_was_visible :1;
-  unsigned int right_gutter_was_visible :1;
-
   /* redisplay flags */
   unsigned int buffers_changed :1;
   unsigned int clip_changed :1;
@@ -581,13 +577,13 @@
    : 0)
 
 #define FRAME_THEORETICAL_TOP_TOOLBAR_HEIGHT(f) \
-  FRAME_THEORETICAL_TOOLBAR_SIZE (f, TOP_TOOLBAR)
+  FRAME_THEORETICAL_TOOLBAR_SIZE (f, TOP_EDGE)
 #define FRAME_THEORETICAL_BOTTOM_TOOLBAR_HEIGHT(f) \
-  FRAME_THEORETICAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR)
+  FRAME_THEORETICAL_TOOLBAR_SIZE (f, BOTTOM_EDGE)
 #define FRAME_THEORETICAL_LEFT_TOOLBAR_WIDTH(f) \
-  FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR)
+  FRAME_THEORETICAL_TOOLBAR_SIZE (f, LEFT_EDGE)
 #define FRAME_THEORETICAL_RIGHT_TOOLBAR_WIDTH(f) \
-  FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR)
+  FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_EDGE)
 
 #define FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos)		\
   (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos)		\
@@ -595,13 +591,13 @@
    : 0)
 
 #define FRAME_THEORETICAL_TOP_TOOLBAR_BORDER_WIDTH(f) \
-  FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR)
+  FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, TOP_EDGE)
 #define FRAME_THEORETICAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \
-  FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR)
+  FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_EDGE)
 #define FRAME_THEORETICAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \
-  FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR)
+  FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, LEFT_EDGE)
 #define FRAME_THEORETICAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \
-  FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR)
+  FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_EDGE)
 
 /* This returns the window-local value rather than the frame-local value;
    that tells you about what's actually visible rather than what should
@@ -670,65 +666,122 @@
    2 * FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, pos))
 
 #define FRAME_REAL_TOP_TOOLBAR_HEIGHT(f) \
-  FRAME_REAL_TOOLBAR_SIZE (f, TOP_TOOLBAR)
+  FRAME_REAL_TOOLBAR_SIZE (f, TOP_EDGE)
 #define FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT(f) \
-  FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_TOOLBAR)
+  FRAME_REAL_TOOLBAR_SIZE (f, BOTTOM_EDGE)
 #define FRAME_REAL_LEFT_TOOLBAR_WIDTH(f) \
-  FRAME_REAL_TOOLBAR_SIZE (f, LEFT_TOOLBAR)
+  FRAME_REAL_TOOLBAR_SIZE (f, LEFT_EDGE)
 #define FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) \
-  FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR)
+  FRAME_REAL_TOOLBAR_SIZE (f, RIGHT_EDGE)
 
 #define FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH(f) \
-  FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, TOP_TOOLBAR)
+  FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, TOP_EDGE)
 #define FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH(f) \
-  FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_TOOLBAR)
+  FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, BOTTOM_EDGE)
 #define FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH(f) \
-  FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, LEFT_TOOLBAR)
+  FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, LEFT_EDGE)
 #define FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f) \
-  FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_TOOLBAR)
+  FRAME_REAL_TOOLBAR_BORDER_WIDTH (f, RIGHT_EDGE)
 
 #define FRAME_REAL_TOP_TOOLBAR_VISIBLE(f) \
-  FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_TOOLBAR)
+  FRAME_REAL_TOOLBAR_VISIBLE (f, TOP_EDGE)
 #define FRAME_REAL_BOTTOM_TOOLBAR_VISIBLE(f) \
-  FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_TOOLBAR)
+  FRAME_REAL_TOOLBAR_VISIBLE (f, BOTTOM_EDGE)
 #define FRAME_REAL_LEFT_TOOLBAR_VISIBLE(f) \
-  FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_TOOLBAR)
+  FRAME_REAL_TOOLBAR_VISIBLE (f, LEFT_EDGE)
 #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \
-  FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR)
+  FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_EDGE)
 
 #define FRAME_REAL_TOP_TOOLBAR_BOUNDS(f) \
-  FRAME_REAL_TOOLBAR_BOUNDS (f, TOP_TOOLBAR)
+  FRAME_REAL_TOOLBAR_BOUNDS (f, TOP_EDGE)
 #define FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS(f) \
-  FRAME_REAL_TOOLBAR_BOUNDS (f, BOTTOM_TOOLBAR)
+  FRAME_REAL_TOOLBAR_BOUNDS (f, BOTTOM_EDGE)
 #define FRAME_REAL_LEFT_TOOLBAR_BOUNDS(f) \
-  FRAME_REAL_TOOLBAR_BOUNDS (f, LEFT_TOOLBAR)
+  FRAME_REAL_TOOLBAR_BOUNDS (f, LEFT_EDGE)
 #define FRAME_REAL_RIGHT_TOOLBAR_BOUNDS(f) \
-  FRAME_REAL_TOOLBAR_BOUNDS (f, RIGHT_TOOLBAR)
+  FRAME_REAL_TOOLBAR_BOUNDS (f, RIGHT_EDGE)
 
 /************************************************************************/
 /*         frame dimensions defined using toolbars and gutters          */
 /************************************************************************/
 
-/* #### These should be using the gutter sizes, but aren't yet */
+/* Bounds of the area framed by the toolbars is the client area --
+   (0, 0) - (FRAME_PIXWIDTH, FRAME_PIXHEIGHT). */
 
-#define FRAME_TOP_BORDER_START(f)				\
+/* Bounds of the area framed by the internal border width -- inside of the
+   toolbars, outside of everything else. */
+
+#define FRAME_TOP_INTERNAL_BORDER_START(f)				\
   FRAME_REAL_TOP_TOOLBAR_BOUNDS (f)
-#define FRAME_TOP_BORDER_END(f)					\
-  (FRAME_TOP_BORDER_START (f) + FRAME_INTERNAL_BORDER_HEIGHT (f))
+#define FRAME_TOP_INTERNAL_BORDER_END(f)				\
+  (FRAME_TOP_INTERNAL_BORDER_START (f) + FRAME_INTERNAL_BORDER_HEIGHT (f))
 
-#define FRAME_BOTTOM_BORDER_START(f)				\
-  (FRAME_BOTTOM_BORDER_END (f) - FRAME_INTERNAL_BORDER_HEIGHT (f))
-#define FRAME_BOTTOM_BORDER_END(f)				\
+#define FRAME_BOTTOM_INTERNAL_BORDER_START(f)				\
+  (FRAME_BOTTOM_INTERNAL_BORDER_END (f) - FRAME_INTERNAL_BORDER_HEIGHT (f))
+#define FRAME_BOTTOM_INTERNAL_BORDER_END(f)				\
   (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_BOUNDS (f))
 
-#define FRAME_LEFT_BORDER_START(f)				\
+#define FRAME_LEFT_INTERNAL_BORDER_START(f)				\
   FRAME_REAL_LEFT_TOOLBAR_BOUNDS (f)
-#define FRAME_LEFT_BORDER_END(f)				\
-  (FRAME_LEFT_BORDER_START (f) + FRAME_INTERNAL_BORDER_WIDTH (f))
+#define FRAME_LEFT_INTERNAL_BORDER_END(f)				\
+  (FRAME_LEFT_INTERNAL_BORDER_START (f) + FRAME_INTERNAL_BORDER_WIDTH (f))
 
-#define FRAME_RIGHT_BORDER_START(f)				\
-  (FRAME_RIGHT_BORDER_END (f) - FRAME_INTERNAL_BORDER_WIDTH (f))
-#define FRAME_RIGHT_BORDER_END(f)				\
+#define FRAME_RIGHT_INTERNAL_BORDER_START(f)				\
+  (FRAME_RIGHT_INTERNAL_BORDER_END (f) - FRAME_INTERNAL_BORDER_WIDTH (f))
+#define FRAME_RIGHT_INTERNAL_BORDER_END(f)				\
   (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_BOUNDS (f))
 
+/* Bounds of the area framed by the gutter -- inside of the
+   toolbars and internal border width. */
+
+#define FRAME_TOP_GUTTER_START(f)					\
+  FRAME_TOP_INTERNAL_BORDER_END (f)
+#define FRAME_TOP_GUTTER_END(f)						\
+  (FRAME_TOP_GUTTER_START (f) + FRAME_TOP_GUTTER_BOUNDS (f))
+
+#ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER
+#define FRAME_BOTTOM_GUTTER_START(f)					\
+  (FRAME_BOTTOM_GUTTER_END (f) - FRAME_BOTTOM_GUTTER_BOUNDS (f))
+#define FRAME_BOTTOM_GUTTER_END(f)					\
+  FRAME_BOTTOM_INTERNAL_BORDER_START (f)
+#endif /* BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER */
+
+#define FRAME_LEFT_GUTTER_START(f)					\
+  FRAME_LEFT_INTERNAL_BORDER_END (f)
+#define FRAME_LEFT_GUTTER_END(f)					\
+  (FRAME_LEFT_GUTTER_START (f) + FRAME_LEFT_GUTTER_BOUNDS (f))
+
+#define FRAME_RIGHT_GUTTER_START(f)					\
+  (FRAME_RIGHT_GUTTER_END (f) - FRAME_RIGHT_GUTTER_BOUNDS (f))
+#define FRAME_RIGHT_GUTTER_END(f)					\
+  FRAME_RIGHT_INTERNAL_BORDER_START (f)
+
+/* These are the bounds of the paned area -- inside of the toolbars,
+   gutters, and internal border width.  The paned area is the same as the
+   area occupied by windows, including the minibuffer.  See long comment in
+   frame.c. */
+
+#define FRAME_PANED_TOP_EDGE(f) FRAME_TOP_GUTTER_END (f)
+#ifdef BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER
+#define FRAME_PANED_BOTTOM_EDGE(f) FRAME_BOTTOM_GUTTER_START (f)
+#endif /* BOTTOM_GUTTER_IS_OUTSIDE_MINIBUFFER */
+#define FRAME_PANED_LEFT_EDGE(f) FRAME_LEFT_GUTTER_END (f)
+#define FRAME_PANED_RIGHT_EDGE(f) FRAME_RIGHT_GUTTER_START (f)
+
+/* Thickness of non-paned area at edge of frame;
+   
+   FRAME_PANED_TOP_EDGE (f) == FRAME_NONPANED_SIZE (f, TOP_EDGE)
+   FRAME_PANED_LEFT_EDGE (f) == FRAME_NONPANED_SIZE (f, LEFT_EDGE)
+   FRAME_PANED_BOTTOM_EDGE (f) ==
+     FRAME_PIXHEIGHT (f) - FRAME_NONPANED_SIZE (f, BOTTOM_EDGE)
+   FRAME_PANED_RIGHT_EDGE (f) ==
+     FRAME_PIXWIDTH (f) - FRAME_NONPANED_SIZE (f, RIGHT_EDGE)
+   
+*/
+#define FRAME_NONPANED_SIZE(f, pos)					\
+  (FRAME_REAL_TOOLBAR_BOUNDS (f, pos) + FRAME_INTERNAL_BORDER_SIZE (f, pos) + \
+   FRAME_GUTTER_BOUNDS (f, pos))
+
+
+
 #endif /* INCLUDED_frame_impl_h_ */