]> code.delx.au - gnu-emacs/blobdiff - src/frame.h
(print): Generate a backslash in \2e10.
[gnu-emacs] / src / frame.h
index 551696489b2922dd7fb862b0b1396abf740f6d16..532e1f2b85b586a9599947b809705568afd94bbf 100644 (file)
@@ -33,7 +33,10 @@ extern int message_buf_print;
 /* The structure representing a frame.  */
 
 enum output_method
-{ output_termcap, output_x_window, output_msdos_raw, output_win32 };
+{ output_termcap, output_x_window, output_msdos_raw, output_w32 };
+
+enum vertical_scroll_bar_type
+{ vertical_scroll_bar_none, vertical_scroll_bar_left, vertical_scroll_bar_right };
 
 struct frame
 {
@@ -121,7 +124,10 @@ struct frame
   /* Predicate for selecting buffers for other-buffer.  */
   Lisp_Object buffer_predicate;
 
-  /* Beyond here, there should be no more Lisp_Object components.  */
+  /* List of buffers viewed in this frame, for other-buffer.  */
+  Lisp_Object buffer_list;
+
+  /* beyond here, there should be no more Lisp_Object components.  */
 
 
   /* A buffer to hold the frame's name.  We can't use the Lisp string's
@@ -160,10 +166,13 @@ struct frame
   /* This is handy for undrawing the cursor, because current_glyphs is
      not always accurate when in do_scrolling.  */
   GLYPH phys_cursor_glyph;
+  /* Nonzero means the cursor is displayed.  */
+  int phys_cursor_on;
 
   /* Size of this frame, in units of characters.  */
   EMACS_INT height;
   EMACS_INT width;
+  EMACS_INT window_width;
 
   /* New height and width for pending size change.  0 if no change pending.  */
   int new_height, new_width;
@@ -175,9 +184,9 @@ struct frame
   /* A structure of auxiliary data used for displaying the contents.
      struct x_output is used for X window frames;
      it is defined in xterm.h.  
-     struct win32_output is used for Win32 window frames;
+     struct w32_output is used for W32 window frames;
      it is defined in w32term.h.  */
-  union output_data { struct x_output *x; struct win32_output *win32; int nothing; } output_data;
+  union output_data { struct x_output *x; struct w32_output *w32; int nothing; } output_data;
 
 #ifdef MULTI_KBOARD
   /* A pointer to the kboard structure associated with this frame.
@@ -247,7 +256,7 @@ struct frame
 
   /* If can_have_scroll_bars is non-zero, this is non-zero if we should
      actually display them on this frame.  */
-  char has_vertical_scroll_bars;
+  enum vertical_scroll_bar_type vertical_scroll_bar_type;
 
   /* Non-0 means raise this frame to the top of the heap when selected.  */
   char auto_raise;
@@ -284,6 +293,11 @@ struct frame
   /* The baud rate that was used to calculate costs for this frame.  */
   int cost_calculation_baud_rate;
 
+  /* A pointer to the data structure containing all information of
+     fontsets associated with this frame.  See the comments in
+     fontset.h for more detail.  */
+  struct fontset_data *fontset_data;
+
   /* Nonzero if the mouse has moved on this display
      since the last time we checked.  */
   char mouse_moved;
@@ -303,7 +317,7 @@ typedef struct frame *FRAME_PTR;
 #define WINDOW_FRAME(w) (w)->frame
 
 #define FRAME_X_P(f) ((f)->output_method == output_x_window)
-#define FRAME_WIN32_P(f) ((f)->output_method == output_win32)
+#define FRAME_W32_P(f) ((f)->output_method == output_w32)
 #define FRAME_MSDOS_P(f) ((f)->output_method == output_msdos_raw)
 
 /* FRAME_WINDOW_P tests whether the frame is a window, and is
@@ -312,7 +326,7 @@ typedef struct frame *FRAME_PTR;
 #define FRAME_WINDOW_P(f) FRAME_X_P (f)
 #endif
 #ifdef HAVE_NTGUI
-#define FRAME_WINDOW_P(f) FRAME_WIN32_P (f)
+#define FRAME_WINDOW_P(f) FRAME_W32_P (f)
 #endif
 #ifndef FRAME_WINDOW_P
 #define FRAME_WINDOW_P(f) (0)
@@ -359,13 +373,37 @@ typedef struct frame *FRAME_PTR;
 #define FRAME_SCROLL_BOTTOM_VPOS(f) (f)->scroll_bottom_vpos
 #define FRAME_FOCUS_FRAME(f) (f)->focus_frame
 #define FRAME_CAN_HAVE_SCROLL_BARS(f) ((f)->can_have_scroll_bars)
-#define FRAME_HAS_VERTICAL_SCROLL_BARS(f) ((f)->has_vertical_scroll_bars)
+#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)
+#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT(f) \
+     ((f)->vertical_scroll_bar_type == vertical_scroll_bar_left)
+#define FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT(f) \
+     ((f)->vertical_scroll_bar_type == vertical_scroll_bar_right)
 #define FRAME_SCROLL_BAR_PIXEL_WIDTH(f) ((f)->scroll_bar_pixel_width)
 #define FRAME_SCROLL_BAR_COLS(f) ((f)->scroll_bar_cols)
+#define FRAME_LEFT_SCROLL_BAR_WIDTH(f) \
+     (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_LEFT (f) \
+      ? FRAME_SCROLL_BAR_COLS (f) \
+      : 0)
+#define FRAME_SCROLL_BAR_WIDTH(f) \
+     (FRAME_HAS_VERTICAL_SCROLL_BARS (f) \
+      ? FRAME_SCROLL_BAR_COLS (f) \
+      : 0)
+#define FRAME_WINDOW_WIDTH_ARG(f, width) \
+     ((width) + FRAME_SCROLL_BAR_WIDTH (f))
+#define FRAME_WINDOW_WIDTH(f) ((f)->window_width)
+#define SET_FRAME_WIDTH(f,val) ((f)->width = (val), (f)->window_width = FRAME_WINDOW_WIDTH_ARG (f, (f)->width))
 #define FRAME_SCROLL_BARS(f) ((f)->scroll_bars)
 #define FRAME_CONDEMNED_SCROLL_BARS(f) ((f)->condemned_scroll_bars)
 #define FRAME_MENU_BAR_ITEMS(f) ((f)->menu_bar_items)
 #define FRAME_COST_BAUD_RATE(f) ((f)->cost_calculation_baud_rate)
+#define FRAME_FONTSET_DATA(f) ((f)->fontset_data)
+
+/* Return the size of message_buf of the frame F.  We multiply the
+   width of the frame by 4 because multi-byte form may require at most
+   4-byte for a character.  */
+#define FRAME_MESSAGE_BUF_SIZE(f) (((int) (f)->width) * 4)
 
 /* Emacs's redisplay code could become confused if a frame's
    visibility changes at arbitrary times.  For example, if a frame is
@@ -448,11 +486,13 @@ extern Lisp_Object Vterminal_frame;
    we have extra space allocated for it.  Otherwise, the scroll bar
    takes over the window's rightmost columns.  */
 #define WINDOW_VERTICAL_SCROLL_BAR_COLUMN(w) \
-  (((XINT ((w)->left) + XINT ((w)->width)) \
-    < FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \
-   ? (XINT ((w)->left) + XINT ((w)->width) \
-      - FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (w)))) \
-   : FRAME_WIDTH (XFRAME (WINDOW_FRAME (w))))
+  (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (XFRAME (WINDOW_FRAME (w))) ? \
+    (((XINT ((w)->left) + XINT ((w)->width)) \
+      < FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \
+     ? (XINT ((w)->left) + XINT ((w)->width) \
+       - FRAME_SCROLL_BAR_COLS (XFRAME (WINDOW_FRAME (w)))) \
+     : FRAME_WIDTH (XFRAME (WINDOW_FRAME (w)))) \
+  : XINT ((w)->left))
 
 /* Return the height in lines of the vertical scroll bar in w.  If the
    window has a mode line, don't make the scroll bar extend that far.  */