Minor cleanup to avoid forward declarations.
[bpt/emacs.git] / src / xterm.h
index b241ff2..39e4000 100644 (file)
@@ -38,8 +38,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <X11/CoreP.h>         /* foul, but we need this to use our own
                                   window inside a widget instead of one
                                   that Xt creates... */
-#include <X11/StringDefs.h>
-
 typedef Widget xt_or_gtk_widget;
 #endif
 
@@ -53,22 +51,33 @@ typedef GtkWidget *xt_or_gtk_widget;
 #undef XSync
 #define XSync(d, b) do { gdk_window_process_all_updates (); \
                          XSync (d, b);  } while (0)
+#endif /* USE_GTK */
+
+/* True iff GTK's version is at least I.J.K.  */
+#ifndef GTK_CHECK_VERSION
+# ifdef USE_GTK
+#  define GTK_CHECK_VERSION(i, j, k) \
+     ((i) \
+      < GTK_MAJOR_VERSION + ((j) \
+                            < GTK_MINOR_VERSION + ((k) \
+                                                   <= GTK_MICRO_VERSION)))
+# else
+#  define GTK_CHECK_VERSION(i, j, k) 0
+# endif
+#endif
 
 /* The GtkTooltip API came in 2.12, but gtk-enable-tooltips in 2.14. */
-#if GTK_MAJOR_VERSION > 2 || GTK_MINOR_VERSION > 13
+#if GTK_CHECK_VERSION (2, 14, 0)
 #define USE_GTK_TOOLTIP
 #endif
 
-#endif /* USE_GTK */
-
-\f
-/* Bookkeeping to distinguish X versions.  */
-
-
 #ifdef HAVE_X_I18N
 #include <X11/Xlocale.h>
 #endif
-\f
+
+#include "dispextern.h"
+#include "termhooks.h"
+
 #define BLACK_PIX_DEFAULT(f) BlackPixel (FRAME_X_DISPLAY (f), \
                                         XScreenNumberOfScreen (FRAME_X_SCREEN (f)))
 #define WHITE_PIX_DEFAULT(f) WhitePixel (FRAME_X_DISPLAY (f), \
@@ -346,7 +355,8 @@ struct x_display_info
   Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen,
     Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert,
     Xatom_net_wm_state_sticky, Xatom_net_wm_state_hidden,
-    Xatom_net_frame_extents;
+    Xatom_net_frame_extents,
+    Xatom_net_current_desktop, Xatom_net_workarea;
 
   /* XSettings atoms and windows.  */
   Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr;
@@ -366,10 +376,6 @@ struct x_display_info
 extern int use_xim;
 #endif
 
-/* This checks to make sure we have a display.  */
-
-extern void check_x (void);
-
 extern struct frame *x_window_to_frame (struct x_display_info *, int);
 extern struct frame *x_any_window_to_frame (struct x_display_info *, int);
 extern struct frame *x_menubar_window_to_frame (struct x_display_info *,
@@ -396,13 +402,10 @@ extern Lisp_Object x_display_name_list;
 extern struct x_display_info *x_display_info_for_display (Display *);
 
 extern struct x_display_info *x_term_init (Lisp_Object, char *, char *);
-extern int x_display_ok  (const char *);
+extern bool x_display_ok (const char *);
 
 extern void select_visual (struct x_display_info *);
 
-\f
-struct font;
-
 /* Each X frame object points to its own struct x_output object
    in the output_data.x field.  The x_output structure contains
    the information that is specific to X windows.  */
@@ -583,7 +586,6 @@ struct x_output
   XIC xic;
   XIMStyle xic_style;
   XFontSet xic_xfs;
-  char *xic_base_fontname;
 #endif
 
   /* Relief GCs, colors etc.  */
@@ -747,7 +749,6 @@ enum
 #define FRAME_X_XIM_STYLES(f) (FRAME_X_DISPLAY_INFO (f)->xim_styles)
 #define FRAME_XIC_STYLE(f) ((f)->output_data.x->xic_style)
 #define FRAME_XIC_FONTSET(f) ((f)->output_data.x->xic_xfs)
-#define FRAME_XIC_BASE_FONTNAME(f) ((f)->output_data.x->xic_base_fontname)
 
 /* Value is the smallest width of any character in any font on frame F.  */
 
@@ -810,7 +811,7 @@ struct scroll_bar
 
   /* 1 if the background of the fringe that is adjacent to a scroll
      bar is extended to the gap between the fringe and the bar.  */
-  unsigned int fringe_extended_p : 1;
+  unsigned fringe_extended_p : 1;
 };
 
 /* Turning a lisp vector value into a pointer to a struct scroll_bar.  */
@@ -912,14 +913,6 @@ struct selection_input_event
 #define SELECTION_EVENT_TIME(eventp)   \
   (((struct selection_input_event *) (eventp))->time)
 
-\f
-struct window;
-struct glyph_matrix;
-struct frame;
-struct input_event;
-struct face;
-struct image;
-
 /* From xselect.c.  */
 
 void x_handle_selection_notify (XSelectionEvent *);
@@ -927,7 +920,6 @@ void x_handle_property_notify (XPropertyEvent *);
 
 /* From xfns.c.  */
 
-struct frame *check_x_frame (Lisp_Object);
 extern void x_free_gcs (struct frame *);
 
 /* From xrdb.c.  */
@@ -941,7 +933,7 @@ extern int x_text_icon (struct frame *, const char *);
 extern void x_catch_errors (Display *);
 extern void x_check_errors (Display *, const char *)
   ATTRIBUTE_FORMAT_PRINTF (2, 0);
-extern int x_had_errors_p (Display *);
+extern bool x_had_errors_p (Display *);
 extern void x_uncatch_errors (void);
 extern void x_clear_errors (Display *);
 extern void x_set_window_size (struct frame *, int, int, int);
@@ -962,7 +954,7 @@ extern bool x_alloc_lighter_color_for_widget (Widget, Display *, Colormap,
 #endif
 extern bool x_alloc_nearest_color (struct frame *, Colormap, XColor *);
 extern void x_query_color (struct frame *f, XColor *);
-extern void x_clear_area (Display *, Window, int, int, int, int, int);
+extern void x_clear_area (Display *, Window, int, int, int, int);
 #if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK
 extern void x_mouse_leave (struct x_display_info *);
 #endif
@@ -1012,7 +1004,6 @@ extern void x_clipboard_manager_save_all (void);
 
 extern struct x_display_info * check_x_display_info (Lisp_Object);
 extern Lisp_Object x_get_focus_frame (struct frame *);
-extern int x_in_use;
 
 #ifdef USE_GTK
 extern int xg_set_icon (struct frame *, Lisp_Object);
@@ -1026,8 +1017,6 @@ extern void destroy_frame_xic (struct frame *);
 extern void xic_set_preeditarea (struct window *, int, int);
 extern void xic_set_statusarea (struct frame *);
 extern void xic_set_xfontset (struct frame *, const char *);
-extern int x_pixel_width (struct frame *);
-extern int x_pixel_height (struct frame *);
 extern bool x_defined_color (struct frame *, const char *, XColor *, bool);
 #ifdef HAVE_X_I18N
 extern void free_frame_xic (struct frame *);
@@ -1075,10 +1064,6 @@ extern Lisp_Object Qx_gtk_map_stock;
 
 #define FRAME_X_EMBEDDED_P(f) (FRAME_X_OUTPUT(f)->explicit_parent != 0)
 
-
-#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
-#define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0
-
 #define STORE_XCHAR2B(chp, b1, b2) \
   ((chp)->byte1 = (b1), (chp)->byte2 = (b2))
 
@@ -1088,7 +1073,6 @@ extern Lisp_Object Qx_gtk_map_stock;
 #define XCHAR2B_BYTE2(chp) \
   ((chp)->byte2)
 
-
 #define STORE_NATIVE_RECT(nr,rx,ry,rwidth,rheight)     \
   ((nr).x = (rx),                                      \
    (nr).y = (ry),                                      \