diff src/frame.h @ 412:697ef44129c6 r21-2-14

Import from CVS: tag r21-2-14
author cvs
date Mon, 13 Aug 2007 11:20:41 +0200
parents 501cfd01ee6d
children 95016f13131a
line wrap: on
line diff
--- a/src/frame.h	Mon Aug 13 11:19:22 2007 +0200
+++ b/src/frame.h	Mon Aug 13 11:20:41 2007 +0200
@@ -20,8 +20,8 @@
 
 /* Synched up with: FSF 19.30. */
 
-#ifndef INCLUDED_frame_h_
-#define INCLUDED_frame_h_
+#ifndef _XEMACS_FRAME_H_
+#define _XEMACS_FRAME_H_
 
 #ifdef HAVE_SCROLLBARS
 #include "scrollbar.h"
@@ -33,7 +33,6 @@
 
 #include "device.h"
 #include "glyphs.h"
-#include "redisplay.h"
 
 #define FRAME_TYPE_NAME(f) ((f)->framemeths->name)
 #define FRAME_TYPE(f) ((f)->framemeths->symbol)
@@ -78,9 +77,6 @@
   int order_count;
 #endif
 
-  /* Current page number for a printer frame. */
-  int page_number;
-
   /* Width of the internal border.  This is a line of background color
      just inside the window's border.  It is normally only non-zero on
      X frames, but we put it here to avoid introducing window system
@@ -94,8 +90,8 @@
 
   int modiff;
 
-  struct expose_ignore* subwindow_exposures;
-  struct expose_ignore* subwindow_exposures_tail;
+  /* subwindow cache elements for this frame */
+  subwindow_cachel_dynarr *subwindow_cachels;
 
 #ifdef HAVE_SCROLLBARS
   /* frame-local scrollbar information.  See scrollbar.c. */
@@ -113,15 +109,6 @@
   unsigned int current_toolbar_size[4];
 #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. */
-  unsigned int current_gutter_bounds[4];
-
-  /* Dynamic arrays of display lines for gutters */
-  display_line_dynarr *current_display_lines[4];
-  display_line_dynarr *desired_display_lines[4];
-
   /* A structure of auxiliary data specific to the device type.
      struct x_frame is used for X window frames; defined in console-x.h */
   void *frame_data;
@@ -173,11 +160,6 @@
   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;
@@ -186,7 +168,6 @@
   unsigned int faces_changed :1;
   unsigned int frame_changed :1;
   unsigned int subwindows_changed :1;
-  unsigned int subwindows_state_changed :1;
   unsigned int glyphs_changed :1;
   unsigned int icon_changed :1;
   unsigned int menubar_changed :1;
@@ -194,7 +175,6 @@
   unsigned int point_changed :1;
   unsigned int size_changed :1;
   unsigned int toolbar_changed :1;
-  unsigned int gutter_changed :1;
   unsigned int windows_changed :1;
   unsigned int windows_structure_changed :1;
   unsigned int window_face_cache_reset :1;	/* used by expose handler */
@@ -218,7 +198,6 @@
 EXFUN (Fselect_frame, 1);
 EXFUN (Fset_frame_pointer, 2);
 EXFUN (Fset_frame_position, 3);
-EXFUN (Fset_frame_properties, 2);
 EXFUN (Fset_frame_size, 4);
 
 extern Lisp_Object Qbackground_toolbar_color, Qbell_volume, Qborder_color;
@@ -243,6 +222,7 @@
 #define XFRAME(x) XRECORD (x, frame, struct frame)
 #define XSETFRAME(x, p) XSETRECORD (x, p, frame)
 #define FRAMEP(x) RECORDP (x, frame)
+#define GC_FRAMEP(x) GC_RECORDP (x, frame)
 #define CHECK_FRAME(x) CHECK_RECORD (x, frame)
 #define CONCHECK_FRAME(x) CONCHECK_RECORD (x, frame)
 
@@ -260,16 +240,16 @@
 #define FRAME_TYPE_P(f, type)	EQ (FRAME_TYPE (f), Q##type)
 
 #ifdef ERROR_CHECK_TYPECHECK
-INLINE_HEADER struct frame *
+INLINE struct frame *
 error_check_frame_type (struct frame * f, Lisp_Object sym);
-INLINE_HEADER struct frame *
+INLINE struct frame *
 error_check_frame_type (struct frame * f, Lisp_Object sym)
 {
   assert (EQ (FRAME_TYPE (f), sym));
   return f;
 }
 # define FRAME_TYPE_DATA(f, type)			\
- ((struct type##_frame *) error_check_frame_type (f, Q##type)->frame_data)
+ ((struct type##_frame *) (error_check_frame_type (f, Q##type))->frame_data)
 #else
 # define FRAME_TYPE_DATA(f, type)			\
   ((struct type##_frame *) (f)->frame_data)
@@ -290,40 +270,6 @@
 	(type##_console_methods->predicate_symbol, x);	\
   } while (0)
 
-#define FRAME_DISPLAY_P(frm)				\
-  (DEVICE_DISPLAY_P (XDEVICE (FRAME_DEVICE (frm))))
-
-#define CHECK_DISPLAY_FRAME(frm)			\
-  do {							\
-    CHECK_FRAME (frm);					\
-    CHECK_LIVE_FRAME (frm);				\
-    CHECK_DISPLAY_DEVICE (FRAME_DEVICE (XFRAME (frm)));	\
-  } while (0)
-
-#define CONCHECK_DISPLAY_FRAME(frm)			\
-  do {							\
-    CONCHECK_FRAME (frm);				\
-    CONCHECK_LIVE_FRAME (frm);				\
-    CONCHECK_DISPLAY_DEVICE (FRAME_DEVICE (XFRAME (frm))); \
-  } while (0)
-
-#define FRAME_PRINTER_P(frm)				\
-  (DEVICE_PRINTER_P (XDEVICE (FRAME_DEVICE (frm))))
-
-#define CHECK_PRINTER_FRAME(frm)			\
-  do {							\
-    CHECK_FRAME (frm);					\
-    CHECK_LIVE_FRAME (frm);				\
-    CHECK_PRINTER_DEVICE (FRAME_DEVICE (XFRAME (frm)));	\
-  } while (0)
-
-#define CONCHECK_PRINTER_FRAME(frm)			\
-  do {							\
-    CONCHECK_FRAME (frm);				\
-    CONCHECK_LIVE_FRAME (frm);				\
-    CONCHECK_PRINTER_DEVICE (FRAME_DEVICE (XFRAME (frm))); \
-  } while (0)
-
 /* #### These should be in the frame-*.h files but there are
    too many places where the abstraction is broken.  Need to
    fix. */
@@ -372,7 +318,7 @@
 
 #define MARK_FRAME_SUBWINDOWS_CHANGED(f) do {		\
   struct frame *mfgc_f = (f);				\
-  mfgc_f->subwindows_changed = 1;			\
+  mfgc_f->subwindows_changed = 1;				\
   mfgc_f->modiff++;					\
   if (!NILP (mfgc_f->device))				\
     {							\
@@ -380,20 +326,7 @@
       MARK_DEVICE_SUBWINDOWS_CHANGED (mfgc_d);		\
     }							\
   else							\
-    subwindows_changed = 1;				\
-} while (0)
-
-#define MARK_FRAME_SUBWINDOWS_STATE_CHANGED(f) do {	\
-  struct frame *mfgc_f = (f);				\
-  mfgc_f->subwindows_state_changed = 1;			\
-  mfgc_f->modiff++;					\
-  if (!NILP (mfgc_f->device))				\
-    {							\
-      struct device *mfgc_d = XDEVICE (mfgc_f->device);	\
-      MARK_DEVICE_SUBWINDOWS_STATE_CHANGED (mfgc_d);	\
-    }							\
-  else							\
-    subwindows_state_changed = 1;			\
+    subwindows_changed = 1;					\
 } while (0)
 
 #define MARK_FRAME_TOOLBARS_CHANGED(f) do {		\
@@ -409,19 +342,6 @@
     toolbar_changed = 1;				\
 } while (0)
 
-#define MARK_FRAME_GUTTERS_CHANGED(f) do {		\
-  struct frame *mftc_f = (f);				\
-  mftc_f->gutter_changed = 1;				\
-  mftc_f->modiff++;					\
-  if (!NILP (mftc_f->device))				\
-    {							\
-      struct device *mftc_d = XDEVICE (mftc_f->device);	\
-      MARK_DEVICE_GUTTERS_CHANGED (mftc_d);		\
-    }							\
-  else							\
-    gutter_changed = 1;					\
-} while (0)
-
 #define MARK_FRAME_SIZE_CHANGED(f) do {			\
   struct frame *mfsc_f = (f);				\
   mfsc_f->size_changed = 1;				\
@@ -501,15 +421,13 @@
 
 #define FRAME_MINIBUF_ONLY_P(f) \
   EQ (FRAME_ROOT_WINDOW (f), FRAME_MINIBUF_WINDOW (f))
-#define FRAME_HAS_MINIBUF_P(f)  ((f)->has_minibuffer)
-#define FRAME_HEIGHT(f)         ((f)->height)
-#define FRAME_WIDTH(f)          ((f)->width)
-#define FRAME_CHARHEIGHT(f)     ((f)->char_height)
-#define FRAME_CHARWIDTH(f)      ((f)->char_width)
-#define FRAME_PIXHEIGHT(f)      ((f)->pixheight)
-#define FRAME_PIXWIDTH(f)       ((f)->pixwidth)
-#define FRAME_PAGENUMBER(f)     ((f)->page_number + 0)
-#define FRAME_SET_PAGENUMBER(f,x) (f)->page_number = (x);
+#define FRAME_HAS_MINIBUF_P(f) ((f)->has_minibuffer)
+#define FRAME_HEIGHT(f) ((f)->height)
+#define FRAME_WIDTH(f) ((f)->width)
+#define FRAME_CHARHEIGHT(f) ((f)->char_height)
+#define FRAME_CHARWIDTH(f) ((f)->char_width)
+#define FRAME_PIXHEIGHT(f) ((f)->pixheight)
+#define FRAME_PIXWIDTH(f) ((f)->pixwidth)
 #ifdef HAVE_SCROLLBARS
 #define FRAME_SCROLLBAR_WIDTH(f)		\
   (NILP ((f)->vertical_scrollbar_visible_p) ?	\
@@ -524,8 +442,8 @@
 
 #define FW_FRAME(obj)					\
    (WINDOWP (obj) ? WINDOW_FRAME (XWINDOW (obj))	\
-    : (FRAMEP  (obj) ? obj				\
-       : Qnil))
+ : (FRAMEP  (obj) ? obj						\
+ : Qnil))
 
 #define FRAME_NEW_HEIGHT(f) ((f)->new_height)
 #define FRAME_NEW_WIDTH(f) ((f)->new_width)
@@ -544,7 +462,7 @@
   NON_LVALUE ((f)->last_nonminibuf_window)
 #define FRAME_SB_VCACHE(f) ((f)->sb_vcache)
 #define FRAME_SB_HCACHE(f) ((f)->sb_hcache)
-#define FRAME_SUBWINDOW_CACHE(f) ((f)->subwindow_instance_cache)
+#define FRAME_SUBWINDOW_CACHE(f) ((f)->subwindow_cachels)
 
 #if 0 /* FSFmacs */
 
@@ -621,7 +539,7 @@
   FRAME_THEORETICAL_TOOLBAR_SIZE (f, RIGHT_TOOLBAR)
 
 #define FRAME_THEORETICAL_TOOLBAR_BORDER_WIDTH(f, pos)		\
-  (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos)		\
+  (FRAME_RAW_THEORETICAL_TOOLBAR_VISIBLE (f, pos)	\
    ? FRAME_RAW_THEORETICAL_TOOLBAR_BORDER_WIDTH (f, pos)	\
    : 0)
 
@@ -680,18 +598,18 @@
    if you encounter some odd toolbar behavior, you might want
    to look into this. --ben */
 
-#define FRAME_REAL_TOOLBAR_VISIBLE(f, pos)		\
-  ((!NILP (FRAME_REAL_TOOLBAR (f, pos))			\
-  && FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0)		\
-   ? FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)		\
+#define FRAME_REAL_TOOLBAR_VISIBLE(f, pos)	\
+  ((!NILP (FRAME_REAL_TOOLBAR (f, pos))	        \
+  && FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos) > 0)	\
+   ? FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos)	\
    : 0)
-#define FRAME_REAL_TOOLBAR_SIZE(f, pos)			\
-  ((!NILP (FRAME_REAL_TOOLBAR (f, pos))	        	\
-  && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos))		\
-   ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos)		\
+#define FRAME_REAL_TOOLBAR_SIZE(f, pos)		\
+  ((!NILP (FRAME_REAL_TOOLBAR (f, pos))	        \
+  && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos))	\
+   ? FRAME_RAW_REAL_TOOLBAR_SIZE (f, pos)	\
    : 0)
 #define FRAME_REAL_TOOLBAR_BORDER_WIDTH(f, pos)		\
-  ((!NILP (FRAME_REAL_TOOLBAR (f, pos))			\
+  ((!NILP (FRAME_REAL_TOOLBAR (f, pos))		\
   && FRAME_RAW_REAL_TOOLBAR_VISIBLE (f, pos))		\
    ? FRAME_RAW_REAL_TOOLBAR_BORDER_WIDTH (f, pos)	\
    : 0)
@@ -723,32 +641,32 @@
 #define FRAME_REAL_RIGHT_TOOLBAR_VISIBLE(f) \
   FRAME_REAL_TOOLBAR_VISIBLE (f, RIGHT_TOOLBAR)
 
-#define FRAME_TOP_BORDER_START(f)				\
-  (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) +				\
+#define FRAME_TOP_BORDER_START(f)					\
+  (FRAME_REAL_TOP_TOOLBAR_HEIGHT (f) +					\
    2 * FRAME_REAL_TOP_TOOLBAR_BORDER_WIDTH (f))
-#define FRAME_TOP_BORDER_END(f)					\
+#define FRAME_TOP_BORDER_END(f)						\
   (FRAME_TOP_BORDER_START (f) + FRAME_BORDER_HEIGHT (f))
 
-#define FRAME_BOTTOM_BORDER_START(f)				\
-  (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) -		\
-   FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) -			\
+#define FRAME_BOTTOM_BORDER_START(f)					\
+  (FRAME_PIXHEIGHT (f) - FRAME_BORDER_HEIGHT (f) -			\
+   FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) -				\
    2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f))
-#define FRAME_BOTTOM_BORDER_END(f)				\
-  (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) -	\
+#define FRAME_BOTTOM_BORDER_END(f)					\
+  (FRAME_PIXHEIGHT (f) - FRAME_REAL_BOTTOM_TOOLBAR_HEIGHT (f) -		\
    2 * FRAME_REAL_BOTTOM_TOOLBAR_BORDER_WIDTH (f))
 
-#define FRAME_LEFT_BORDER_START(f)				\
-  (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) +				\
+#define FRAME_LEFT_BORDER_START(f)					\
+  (FRAME_REAL_LEFT_TOOLBAR_WIDTH (f) +					\
    2 * FRAME_REAL_LEFT_TOOLBAR_BORDER_WIDTH (f))
-#define FRAME_LEFT_BORDER_END(f)				\
+#define FRAME_LEFT_BORDER_END(f)					\
   (FRAME_LEFT_BORDER_START (f) + FRAME_BORDER_WIDTH (f))
 
-#define FRAME_RIGHT_BORDER_START(f)				\
-  (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) -		\
-   FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) -                          \
+#define FRAME_RIGHT_BORDER_START(f)					\
+  (FRAME_PIXWIDTH (f) - FRAME_BORDER_WIDTH (f) -			\
+   FRAME_REAL_RIGHT_TOOLBAR_WIDTH(f) -                                                           \
    2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH (f))
-#define FRAME_RIGHT_BORDER_END(f)				\
-  (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) -	\
+#define FRAME_RIGHT_BORDER_END(f)					\
+  (FRAME_PIXWIDTH (f) - FRAME_REAL_RIGHT_TOOLBAR_WIDTH (f) -		\
    2 * FRAME_REAL_RIGHT_TOOLBAR_BORDER_WIDTH(f))
 
 /* Equivalent in FSF Emacs:
@@ -772,6 +690,9 @@
 			Lisp_Object console);
 Lisp_Object prev_frame (Lisp_Object f, Lisp_Object frametype,
 			Lisp_Object console);
+void store_in_alist (Lisp_Object *alistptr,
+		     CONST char *propname,
+		     Lisp_Object val);
 void pixel_to_char_size (struct frame *f, int pixel_width, int pixel_height,
 			 int *char_width, int *char_height);
 void char_to_pixel_size (struct frame *f, int char_width, int char_height,
@@ -816,6 +737,4 @@
 void update_frame_icon (struct frame *f);
 void invalidate_vertical_divider_cache_in_frame (struct frame *f);
 
-void init_frame (void);
-
-#endif /* INCLUDED_frame_h_ */
+#endif /* _XEMACS_FRAME_H_ */