*** empty log message ***
[bpt/emacs.git] / src / xterm.h
index a1f0e38..c1d69ca 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions and headers for communication with X protocol.
-   Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000, 2001
+   Copyright (C) 1989, 1993, 1994, 1998, 1999, 2000, 2001, 2001
    Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -157,7 +157,7 @@ struct x_display_info
   /* The Visual being used for this display.  */
   Visual *visual;
 
-  /* THe colormap being used.  */
+  /* The colormap being used.  */
   Colormap cmap;
   
   /* Number of panes on this screen.  */
@@ -209,6 +209,7 @@ struct x_display_info
   int mouse_face_past_end;
   Lisp_Object mouse_face_window;
   int mouse_face_face_id;
+  Lisp_Object mouse_face_overlay;
 
   /* 1 if a mouse motion event came and we didn't handle it right away because
      gc was in progress.  */
@@ -222,6 +223,9 @@ struct x_display_info
   /* Nonzero means defer mouse-motion highlighting.  */
   int mouse_face_defer;
 
+  /* Nonzero means that the mouse highlight should not be shown.  */
+  int mouse_face_hidden;
+
   int mouse_face_image_state;
 
   char *x_id_name;
@@ -482,20 +486,25 @@ struct x_output
      bars).  */
   unsigned long scroll_bar_background_pixel;
 
+  /* Top and bottom shadow colors for 3d toolkit scrollbars.  -1 means
+     let the scroll compute them itself.  */
+  unsigned long scroll_bar_top_shadow_pixel;
+  unsigned long scroll_bar_bottom_shadow_pixel;
+
   /* Descriptor for the cursor in use for this window.  */
   Cursor text_cursor;
   Cursor nontext_cursor;
   Cursor modeline_cursor;
   Cursor cross_cursor;
-  Cursor busy_cursor;
+  Cursor hourglass_cursor;
   Cursor horizontal_drag_cursor;
 
-  /* Window whose cursor is busy_cursor.  This window is temporarily
-     mapped to display a busy-cursor.  */
-  Window busy_window;
+  /* Window whose cursor is hourglass_cursor.  This window is temporarily
+     mapped to display an hourglass cursor.  */
+  Window hourglass_window;
   
-  /* Non-zero means busy cursor is currently displayed.  */
-  unsigned busy_p : 1;
+  /* Non-zero means hourglass cursor is currently displayed.  */
+  unsigned hourglass_p : 1;
 
   /* Flag to set when the X window needs to be completely repainted.  */
   int needs_exposure;
@@ -531,7 +540,8 @@ struct x_output
   /* The extra width currently allotted for the areas in which
      truncation marks, continuation marks, and overlay arrows are
      displayed.  */
-  int flags_areas_extra;
+  int left_fringe_width, right_fringe_width;
+  int fringe_cols, fringes_extra;
 
   /* This is the gravity value for the specified window position.  */
   int win_gravity;
@@ -580,6 +590,44 @@ struct x_output
   /* The background for which the above relief GCs were set up.
      They are changed only when a different background is involved.  */
   unsigned long relief_background;
+
+  /* Xt waits for a ConfigureNotify event from the window manager in
+     EmacsFrameSetCharSize when the shell widget is resized.  For some
+     window managers like fvwm2 2.2.5 and KDE 2.1 this event doesn't
+     arrive for an unknown reason and Emacs hangs in Xt.  If this is
+     zero, tell Xt not to wait.  */
+  int wait_for_wm;
+
+  /* See enum below */
+  int want_fullscreen;
+
+  /* This many pixels are the difference between the outer window (i.e. the
+     left of the window manager decoration) and FRAME_X_WINDOW. */
+  int x_pixels_diff;
+
+  /* This many pixels are the difference between the outer window (i.e. the
+     top of the window manager titlebar) and FRAME_X_WINDOW. */
+  int y_pixels_diff;
+
+  /* As x_pixels_diff, but to FRAME_OUTER_WINDOW.  For some reason the
+     two might differ by a pixel, depending on WM */
+  int x_pixels_outer_diff;
+  
+  /* As y_pixels_diff, but to FRAME_OUTER_WINDOW.  In the toolkit version,
+     these may differ because this does not take into account possible
+     menubar.  y_pixels_diff is with menubar height included */
+  int y_pixels_outer_diff;
+};
+
+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,
+  FULLSCREEN_MOVE_WAIT  = 8,
 };
 
 /* Return the X window used for displaying data in frame F.  */
@@ -587,7 +635,9 @@ struct x_output
 
 /* Return the outermost X window associated with the frame F.  */
 #ifdef USE_X_TOOLKIT
-#define FRAME_OUTER_WINDOW(f) (XtWindow ((f)->output_data.x->widget))
+#define FRAME_OUTER_WINDOW(f) ((f)->output_data.x->widget ?             \
+                               XtWindow ((f)->output_data.x->widget) :  \
+                               FRAME_X_WINDOW (f))
 #else
 #define FRAME_OUTER_WINDOW(f) (FRAME_X_WINDOW (f))
 #endif
@@ -610,6 +660,7 @@ struct x_output
 
 /* This is the `Screen *' which frame F is on.  */
 #define FRAME_X_SCREEN(f) (FRAME_X_DISPLAY_INFO (f)->screen)
+#define FRAME_X_SCREEN_NUMBER(f) XScreenNumberOfScreen (FRAME_X_SCREEN (f))
 
 /* This is the Visual which frame F is on.  */
 #define FRAME_X_VISUAL(f) FRAME_X_DISPLAY_INFO (f)->visual
@@ -647,38 +698,22 @@ struct x_output
 #define FRAME_X_IMAGE_CACHE(F) FRAME_X_DISPLAY_INFO ((F))->image_cache
 
 \f
-/* Pixel width of the bitmaps drawn to indicate truncation,
-   continuation etc.  */
-
-#define FRAME_FLAGS_BITMAP_WIDTH(f)    8
-#define FRAME_FLAGS_BITMAP_HEIGHT(f)   8
-
-/* Total width of a areas reserved for drawing truncation bitmaps,
+/* 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_X_FLAGS_AREA_COLS(F)                                     \
-     ((2 * FRAME_FLAGS_BITMAP_WIDTH ((F)) + CANON_X_UNIT ((F)) - 1)    \
-      / CANON_X_UNIT ((F)))
-
-/* Total width of flags areas in pixels.  */
+#define FRAME_X_FRINGE_COLS(F) ((F)->output_data.x->fringe_cols)
 
-#define FRAME_X_FLAGS_AREA_WIDTH(F) \
-     (FRAME_X_FLAGS_AREA_COLS ((F)) * CANON_X_UNIT ((F)))
+/* Total width of fringes in pixels.  */
 
-/* Pixel-width of the left flags area.  */
+#define FRAME_X_FRINGE_WIDTH(F) ((F)->output_data.x->fringes_extra)
 
-#define FRAME_X_LEFT_FLAGS_AREA_WIDTH(F) \
-     (FRAME_X_FLAGS_AREA_WIDTH (F) / 2)
+/* Pixel-width of the left and right fringe.  */
 
-/* Pixel-width of the right flags area.  Note that we are doing
-   integer arithmetic here, so don't loose a pixel if the total
-   width is an odd number.  */
-
-#define FRAME_X_RIGHT_FLAGS_AREA_WIDTH(F)      \
-     (FRAME_X_FLAGS_AREA_WIDTH (F) - FRAME_X_FLAGS_AREA_WIDTH (F) / 2)
+#define FRAME_X_LEFT_FRINGE_WIDTH(F) ((F)->output_data.x->left_fringe_width)
+#define FRAME_X_RIGHT_FRINGE_WIDTH(F) ((F)->output_data.x->right_fringe_width)
 
 
 \f
@@ -841,7 +876,7 @@ struct scroll_bar
 #define CHAR_TO_PIXEL_WIDTH(f, width) \
   (CHAR_TO_PIXEL_COL (f, width) \
    + (f)->output_data.x->vertical_scroll_bar_extra \
-   + (f)->output_data.x->flags_areas_extra \
+   + (f)->output_data.x->fringes_extra \
    + (f)->output_data.x->internal_border_width)
 #define CHAR_TO_PIXEL_HEIGHT(f, height) \
   (CHAR_TO_PIXEL_ROW (f, height) \
@@ -862,7 +897,7 @@ struct scroll_bar
 #define PIXEL_TO_CHAR_WIDTH(f, width) \
   (PIXEL_TO_CHAR_COL (f, ((width) \
                          - (f)->output_data.x->internal_border_width \
-                         - (f)->output_data.x->flags_areas_extra \
+                         - (f)->output_data.x->fringes_extra \
                          - (f)->output_data.x->vertical_scroll_bar_extra)))
 #define PIXEL_TO_CHAR_HEIGHT(f, height) \
   (PIXEL_TO_CHAR_ROW (f, ((height) \
@@ -954,7 +989,6 @@ extern void pixel_to_glyph_coords P_ ((struct frame *, int, int,
 
 /* Defined in xterm.c */
 
-extern void clear_mouse_face P_ ((struct x_display_info *));
 extern void cancel_mouse_face P_ ((struct frame *));
 extern void x_scroll_bar_clear P_ ((struct frame *));
 extern void x_start_queuing_selection_requests P_ ((Display *));
@@ -968,6 +1002,7 @@ extern int x_had_errors_p P_ ((Display *));
 extern void x_uncatch_errors P_ ((Display *, int));
 extern Lisp_Object x_new_font P_ ((struct frame *, char *));
 extern Lisp_Object x_new_fontset P_ ((struct frame *, char *));
+extern void x_compute_fringe_widths P_ ((struct frame *, int));
 extern void x_set_offset P_ ((struct frame *, int, int, int));
 extern void x_set_window_size P_ ((struct frame *, int, int, int));
 extern void x_set_mouse_position P_ ((struct frame *, int, int));
@@ -986,7 +1021,6 @@ extern void x_wm_set_icon_position P_ ((struct frame *, int, int));
 extern void x_delete_display P_ ((struct x_display_info *));
 extern void x_initialize P_ ((void));
 extern void x_display_cursor P_ ((struct window *, int, int, int, int, int));
-extern void x_update_cursor P_ ((struct frame *, int));
 extern unsigned long x_copy_color P_ ((struct frame *, unsigned long));
 #ifdef USE_X_TOOLKIT
 extern XtAppContext Xt_app_con;
@@ -995,6 +1029,10 @@ extern void x_query_colors P_ ((struct frame *f, XColor *, int));
 extern void x_query_color P_ ((struct frame *f, XColor *));
 extern void x_clear_area P_ ((Display *, Window, int, int, int, int, int));
 
+extern void x_fullscreen_adjust P_ ((struct frame *f, int *, int *,
+                                     int *, int *));
+
+
 /* Defined in xselect.c */
 
 extern void x_handle_property_notify P_ ((XPropertyEvent *));
@@ -1020,7 +1058,7 @@ extern void x_report_frame_params P_ ((struct frame *, Lisp_Object *));
 extern int defined_color P_ ((struct frame *, char *, XColor *, int));
 extern void x_set_border_pixel P_ ((struct frame *, int));
 extern void x_set_menu_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object));
-extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object,
+extern unsigned char * x_encode_text P_ ((Lisp_Object, Lisp_Object, int,
                                          int *, int *));
 extern void x_implicitly_set_name P_ ((struct frame *, Lisp_Object, Lisp_Object));
 extern void create_frame_xic P_ ((struct frame *));
@@ -1046,6 +1084,8 @@ extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object))
 extern int frame_update_line_height P_ ((struct frame *));
 extern int compute_glyph_face P_ ((struct frame *, int, int));
 extern int compute_glyph_face_1 P_ ((struct frame *, Lisp_Object, int));
+extern void x_free_dpy_colors P_ ((Display *, Screen *, Colormap,
+                                  unsigned long *, int));
 
 /* Defined in xmenu.c */