(syms_of_ntproc) <w32-get-true-file-attributes>: Doc fix.
[bpt/emacs.git] / src / frame.h
index 73a3458..d18f5ae 100644 (file)
@@ -1,6 +1,6 @@
 /* Define frame-object for GNU Emacs.
    Copyright (C) 1993, 1994, 1999, 2000, 2001, 2002, 2003, 2004,
-                 2005, 2006, 2007 Free Software Foundation, Inc.
+                 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -37,6 +37,11 @@ extern int frame_garbaged;
 
 extern int message_buf_print;
 
+/* Nonzero means window system changes focus when moving the
+   mouse.  */
+
+extern int focus_follows_mouse;
+
 \f
 /* The structure representing a frame.  */
 
@@ -67,18 +72,30 @@ enum text_cursor_kinds
   HBAR_CURSOR
 };
 
+enum fullscreen_type
+{
+  /* Values used as a bit mask, BOTH == WIDTH | HEIGHT.  */
+  FULLSCREEN_NONE       = 0,
+  FULLSCREEN_WIDTH      = 1,
+  FULLSCREEN_HEIGHT     = 2,
+  FULLSCREEN_BOTH       = 3,
+  FULLSCREEN_WAIT       = 4
+};
+
+
 #define FRAME_FOREGROUND_PIXEL(f) ((f)->foreground_pixel)
 #define FRAME_BACKGROUND_PIXEL(f) ((f)->background_pixel)
 
 struct terminal;
 
+struct font_driver_list;
+
 struct frame
 {
-  EMACS_INT size;
+  EMACS_UINT size;
   struct Lisp_Vector *next;
 
   /* All Lisp_Object components must come first.
-     Only EMACS_INT values can be intermixed with them.
      That ensures they are all aligned normally.  */
 
   /* Name of this frame: a Lisp string.  It is used for looking up resources,
@@ -152,8 +169,6 @@ struct frame
      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.  */
-  EMACS_INT menu_bar_items_used;
 
   /* Predicate for selecting buffers for other-buffer.  */
   Lisp_Object buffer_predicate;
@@ -164,7 +179,7 @@ struct frame
   /* List of buffers that were viewed, then buried in this frame.  The
      most recently buried buffer is first.  For last-buffer.  */
   Lisp_Object buried_buffer_list;
-  
+
   /* A dummy window used to display menu bars under X when no X
      toolkit support is available.  */
   Lisp_Object menu_bar_window;
@@ -178,11 +193,14 @@ struct frame
   /* Desired and current contents displayed in tool_bar_window.  */
   Lisp_Object desired_tool_bar_string, current_tool_bar_string;
 
-  /* beyond here, there should be no more Lisp_Object components.  */
+  /* Beyond here, there should be no more Lisp_Object components.  */
 
   /* Cache of realized faces.  */
   struct face_cache *face_cache;
 
+  /* Number of elements in `menu_bar_vector' that have meaningful data.  */
+  EMACS_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.  */
   char *namebuf;
@@ -197,6 +215,30 @@ struct frame
      be used for output.  */
   unsigned glyphs_initialized_p : 1;
 
+  /* Set to non-zero in change_frame_size when size of frame changed
+     Clear the frame in clear_garbaged_frames if set.  */
+  unsigned resized_p : 1;
+
+  /* Set to non-zero in when we want for force a flush_display in
+     update_frame, usually after resizing the frame.  */
+  unsigned force_flush_display_p : 1;
+
+  /* Set to non-zero if the default face for the frame has been
+     realized.  Reset to zero whenever the default face changes.
+     Used to see the difference between a font change and face change.  */
+  unsigned default_face_done_p : 1;
+
+  /* Set to non-zero if this frame has already been hscrolled during
+     current redisplay.  */
+  unsigned already_hscrolled_p : 1;
+
+  /* Set to non-zero when current redisplay has updated frame.  */
+  unsigned updated_p : 1;
+
+  /* Set to non-zero to minimize tool-bar height even when
+     auto-resize-tool-bar is set to grow-only.  */
+  unsigned minimize_tool_bar_window_p : 1;
+
 #if defined (USE_GTK) || defined (MAC_OS)
   /* Nonzero means using a tool bar that comes from the toolkit.  */
   int external_tool_bar;
@@ -239,6 +281,9 @@ struct frame
   /* Size of the frame window in pixels.  */
   int pixel_height, pixel_width;
 
+  /* Dots per inch of the screen the frame is on.  */
+  double resx, resy;
+
   /* These many pixels are the difference between the outer window (i.e. the
      left and top of the window manager decoration) and FRAME_X_WINDOW. */
   int x_pixels_diff, y_pixels_diff;
@@ -274,7 +319,7 @@ struct frame
   /* The terminal device that this frame uses.  If this is NULL, then
      the frame has been deleted. */
   struct terminal *terminal;
-  
+
   /* Device-dependent, frame-local auxiliary data used for displaying
      the contents.  When the frame is deleted, this data is deleted as
      well. */
@@ -288,6 +333,12 @@ struct frame
   }
   output_data;
 
+  /* List of font-drivers available on the frame. */
+  struct font_driver_list *font_driver_list;
+  /* List of data specific to font-driver and frame, but common to
+     faces.  */
+  struct font_data_list *font_data_list;
+
   /* 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
@@ -299,7 +350,7 @@ struct frame
   int left_fringe_width, right_fringe_width;
 
   /* See FULLSCREEN_ enum below */
-  int want_fullscreen;
+  enum fullscreen_type want_fullscreen;
 
   /* Number of lines of menu bar.  */
   int menu_bar_lines;
@@ -307,11 +358,11 @@ struct frame
 #if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined (MAC_OS) \
     || defined (USE_GTK)
   /* Nonzero means using a menu bar that comes from the X toolkit.  */
-  int external_menu_bar;
+  unsigned int external_menu_bar : 1;
 #endif
 
   /* Nonzero if last attempt at redisplay on this frame was preempted.  */
-  char display_preempted;
+  unsigned char display_preempted : 1;
 
   /* visible is nonzero if the frame is currently displayed; we check
      it to see if we should bother updating the frame's contents.
@@ -341,7 +392,10 @@ struct frame
 
      These two are mutually exclusive.  They might both be zero, if the
      frame has been made invisible without an icon.  */
-  char visible, iconified;
+  unsigned char visible : 2;
+  unsigned char iconified : 1;
+
+  /* Let's not use bitfields for volatile variables.  */
 
   /* Asynchronous input handlers change these, and
      FRAME_SAMPLE_VISIBILITY copies them into visible and iconified.
@@ -353,16 +407,38 @@ struct frame
 
   /* True if frame actually has a minibuffer window on it.
      0 if using a minibuffer window that isn't on this frame.  */
-  char has_minibuffer;
+  unsigned char has_minibuffer : 1;
 
   /* 0 means, if this frame has just one window,
      show no modeline for that window.  */
-  char wants_modeline;
+  unsigned char wants_modeline : 1;
 
   /* Non-zero if the hardware device this frame is displaying on can
      support scroll bars.  */
   char can_have_scroll_bars;
 
+  /* Non-0 means raise this frame to the top of the heap when selected.  */
+  unsigned char auto_raise : 1;
+
+  /* Non-0 means lower this frame to the bottom of the stack when left.  */
+  unsigned char auto_lower : 1;
+
+  /* True if frame's root window can't be split.  */
+  unsigned char no_split : 1;
+
+  /* If this is set, then Emacs won't change the frame name to indicate
+     the current buffer, etcetera.  If the user explicitly sets the frame
+     name, this gets set.  If the user sets the name to Qnil, this is
+     cleared.  */
+  unsigned char explicit_name : 1;
+
+  /* Nonzero if size of some window on this frame has changed.  */
+  unsigned char window_sizes_changed : 1;
+
+  /* Nonzero if the mouse has moved on this display device
+     since the last time we checked.  */
+  unsigned char mouse_moved :1;
+
   /* If can_have_scroll_bars is non-zero, this is non-zero if we should
      actually display them on this frame.  */
   enum vertical_scroll_bar_type vertical_scroll_bar_type;
@@ -381,24 +457,6 @@ struct frame
   /* Width of bar cursor (if we are using that) for blink-off state.  */
   int blink_off_cursor_width;
 
-  /* Non-0 means raise this frame to the top of the heap when selected.  */
-  char auto_raise;
-
-  /* Non-0 means lower this frame to the bottom of the stack when left.  */
-  char auto_lower;
-
-  /* True if frame's root window can't be split.  */
-  char no_split;
-
-  /* If this is set, then Emacs won't change the frame name to indicate
-     the current buffer, etcetera.  If the user explicitly sets the frame
-     name, this gets set.  If the user sets the name to Qnil, this is
-     cleared.  */
-  char explicit_name;
-
-  /* Nonzero if size of some window on this frame has changed.  */
-  char window_sizes_changed;
-
   /* Storage for messages to this frame. */
   char *message_buf;
 
@@ -421,10 +479,6 @@ struct frame
   /* The baud rate that was used to calculate costs for this frame.  */
   int cost_calculation_baud_rate;
 
-  /* Nonzero if the mouse has moved on this display device
-     since the last time we checked.  */
-  char mouse_moved;
-
   /* Exponent for gamma correction of colors.  1/(VIEWING_GAMMA *
      SCREEN_GAMMA) where viewing_gamma is 0.4545 and SCREEN_GAMMA is a
      frame parameter.  0 means don't do gamma correction.  */
@@ -433,33 +487,9 @@ struct frame
   /* Additional space to put between text lines on this frame.  */
   int extra_line_spacing;
 
-  /* Set to non-zero in change_frame_size when size of frame changed
-     Clear the frame in clear_garbaged_frames if set.  */
-  unsigned resized_p : 1;
-
-  /* Set to non-zero in when we want for force a flush_display in
-     update_frame, usually after resizing the frame.  */
-  unsigned force_flush_display_p : 1;
-  
   /* All display backends seem to need these two pixel values. */
   unsigned long background_pixel;
   unsigned long foreground_pixel;
-  
-  /* Set to non-zero if the default face for the frame has been
-     realized.  Reset to zero whenever the default face changes.
-     Used to see the difference between a font change and face change.  */
-  unsigned default_face_done_p : 1;
-
-  /* Set to non-zero if this frame has already been hscrolled during
-     current redisplay.  */
-  unsigned already_hscrolled_p : 1;
-
-  /* Set to non-zero when current redisplay has updated frame.  */
-  unsigned updated_p : 1;
-
-  /* Set to non-zero to minimize tool-bar height even when
-     auto-resize-tool-bar is set to grow-only.  */
-  unsigned minimize_tool_bar_window_p : 1;
 };
 
 #ifdef MULTI_KBOARD
@@ -468,9 +498,12 @@ struct frame
 #define FRAME_KBOARD(f) (&the_only_kboard)
 #endif
 
+/* Return a pointer to the image cache of frame F.  */
+#define FRAME_IMAGE_CACHE(F) ((F)->terminal->image_cache)
+
 typedef struct frame *FRAME_PTR;
 
-#define XFRAME(p) (eassert (GC_FRAMEP(p)),(struct frame *) XPNTR (p))
+#define XFRAME(p) (eassert (FRAMEP(p)),(struct frame *) XPNTR (p))
 #define XSETFRAME(a, b) (XSETPSEUDOVECTOR (a, b, PVEC_FRAME))
 
 /* Given a window, return its frame as a Lisp_Object.  */
@@ -779,8 +812,7 @@ typedef struct frame *FRAME_PTR;
 extern Lisp_Object Qframep, Qframe_live_p;
 extern Lisp_Object Qtty, Qtty_type;
 extern Lisp_Object Qterminal, Qterminal_live_p;
-extern Lisp_Object Qenvironment;
-extern Lisp_Object Qdisplay_environment_variable;
+extern Lisp_Object Qnoelisp;
 
 extern struct frame *last_nonminibuf_frame;
 
@@ -1002,6 +1034,7 @@ extern Lisp_Object Qscreen_gamma;
 extern Lisp_Object Qline_spacing;
 extern Lisp_Object Qwait_for_wm;
 extern Lisp_Object Qfullscreen;
+extern Lisp_Object Qfont_backend;
 
 extern Lisp_Object Qleft_fringe, Qright_fringe;
 extern Lisp_Object Qheight, Qwidth;
@@ -1017,24 +1050,11 @@ extern Lisp_Object Qx_resource_name;
 extern Lisp_Object Qleft, Qright, Qtop, Qbox;
 extern Lisp_Object Qdisplay;
 
-extern Lisp_Object Qwindow_system;
-
 #ifdef HAVE_WINDOW_SYSTEM
 
 /* The class of this X application.  */
 #define EMACS_CLASS "Emacs"
 
-enum
-{
-  /* Values used as a bit mask, BOTH == WIDTH | HEIGHT.  */
-  FULLSCREEN_NONE       = 0,
-  FULLSCREEN_WIDTH      = 1,
-  FULLSCREEN_HEIGHT     = 2,
-  FULLSCREEN_BOTH       = 3,
-  FULLSCREEN_WAIT       = 4,
-};
-
-
 /* These are in xterm.c, w32term.c, etc.  */
 
 extern void x_set_scroll_bar_default_width P_ ((struct frame *));
@@ -1042,8 +1062,10 @@ extern void x_set_offset P_ ((struct frame *, int, int, int));
 extern void x_wm_set_icon_position P_ ((struct frame *, int, int));
 
 extern Lisp_Object x_new_font P_ ((struct frame *, char *));
-extern Lisp_Object x_new_fontset P_ ((struct frame *, char *));
-
+extern Lisp_Object x_new_fontset P_ ((struct frame *, Lisp_Object));
+#ifdef USE_FONT_BACKEND
+extern Lisp_Object x_new_fontset2 P_ ((struct frame *, int, Lisp_Object));
+#endif /* USE_FONT_BACKEND */
 
 /* These are in frame.c  */
 
@@ -1063,6 +1085,7 @@ extern void x_set_fullscreen P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void x_set_line_spacing P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void x_set_screen_gamma P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void x_set_font P_ ((struct frame *, Lisp_Object, Lisp_Object));
+extern void x_set_font_backend P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void x_set_fringe_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void x_set_border_width P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void x_set_internal_border_width P_ ((struct frame *, Lisp_Object,