/* Definitions and headers for communication with X protocol.
- Copyright (C) 1989, 1993-1994, 1998-2012 Free Software Foundation, Inc.
+ Copyright (C) 1989, 1993-1994, 1998-2013 Free Software Foundation,
+ Inc.
This file is part of GNU Emacs.
#ifndef XTERM_H
#define XTERM_H
+#include "dispextern.h"
+
#include <X11/Xlib.h>
#include <X11/cursorfont.h>
#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
#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. */
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;
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 *,
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 *);
GtkWidget *menubar_widget;
/* The tool bar in this frame */
GtkWidget *toolbar_widget;
- /* The handle box that makes the tool bar detachable. */
+#ifdef HAVE_GTK_HANDLE_BOX_NEW
+/* The handle box that makes the tool bar detachable. */
GtkWidget *handlebox_widget;
- /* Non-zero if the tool bar is detached. */
- int toolbar_detached;
+#endif
/* Non-zero if tool bar is packed into the hbox widget (i.e. vertical). */
- int toolbar_in_hbox;
+ bool toolbar_in_hbox;
+ bool toolbar_is_packed;
/* The last size hints set. */
GdkGeometry size_hints;
XIC xic;
XIMStyle xic_style;
XFontSet xic_xfs;
- char *xic_base_fontname;
#endif
/* Relief GCs, colors etc. */
#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. */
/* 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. */
/* From xfns.c. */
-struct frame *check_x_frame (Lisp_Object);
extern void x_free_gcs (struct frame *);
/* From xrdb.c. */
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);
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);
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 *);