1/*
2 * gdkdisplay-x11.h
3 *
4 * Copyright 2001 Sun Microsystems Inc.
5 *
6 * Erwann Chenede <erwann.chenede@sun.com>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef __GDK_X11_DISPLAY__
23#define __GDK_X11_DISPLAY__
24
25#include "gdkdisplayprivate.h"
26#include "gdkkeys.h"
27#include "gdksurface.h"
28#include "gdkx11devicemanager.h"
29#include "gdkx11display.h"
30#include "gdkx11screen.h"
31#include "gdkprivate-x11.h"
32
33#include <X11/X.h>
34#include <X11/Xlib.h>
35
36G_BEGIN_DECLS
37
38
39struct _GdkX11Display
40{
41 GdkDisplay parent_instance;
42 Display *xdisplay;
43 GdkX11Screen *screen;
44 GList *toplevels;
45 GdkX11DeviceManagerXI2 *device_manager;
46
47 GSource *event_source;
48
49 int grab_count;
50
51 /* Visual infos for creating Windows */
52 int window_depth;
53 Visual *window_visual;
54 Colormap window_colormap;
55
56 /* Keyboard related information */
57 int xkb_event_type;
58 gboolean use_xkb;
59
60 /* Whether we were able to turn on detectable-autorepeat using
61 * XkbSetDetectableAutorepeat. If FALSE, we'll fall back
62 * to checking the next event with XPending().
63 */
64 gboolean have_xkb_autorepeat;
65
66 GdkKeymap *keymap;
67 guint keymap_serial;
68
69 gboolean have_xfixes;
70 int xfixes_event_base;
71
72 gboolean have_randr12;
73 gboolean have_randr13;
74 gboolean have_randr15;
75 int xrandr_event_base;
76
77 /* If the SECURITY extension is in place, whether this client holds
78 * a trusted authorization and so is allowed to make various requests
79 * (grabs, properties etc.) Otherwise always TRUE.
80 */
81 gboolean trusted_client;
82
83 /* drag and drop information */
84 GdkDrop *current_drop;
85
86 /* Mapping to/from virtual atoms */
87 GHashTable *atom_from_string;
88 GHashTable *atom_to_string;
89
90 /* Session Management leader window see ICCCM */
91 char *program_class;
92 Window leader_window;
93 GdkSurface *leader_gdk_surface;
94 gboolean leader_window_title_set;
95
96 /* X ID hashtable */
97 GHashTable *xid_ht;
98
99 /* streams reading selections */
100 GSList *streams;
101
102 /* GdkCursor => XCursor */
103 GHashTable *cursors;
104
105 GListStore *monitors;
106 int primary_monitor;
107
108 /* Startup notification */
109 char *startup_notification_id;
110
111 /* Time of most recent user interaction. */
112 gulong user_time;
113
114 /* Sets of atoms for DND */
115 guint use_sync : 1;
116
117 guint have_shapes : 1;
118 guint have_input_shapes : 1;
119 int shape_event_base;
120
121 GSList *error_traps;
122
123 int wm_moveresize_button;
124
125#ifdef HAVE_XDAMAGE
126 int damage_event_base;
127 int damage_error_base;
128 guint have_damage;
129#endif
130
131 /* If GL is not supported, store the error here */
132 GError *gl_error;
133
134 /* GLX information */
135 /* GLXFBConfig */ gpointer glx_config;
136 int glx_version;
137
138 /* EGL information */
139 int egl_version;
140
141 /* Translation between X server time and system-local monotonic time */
142 gint64 server_time_query_time;
143 gint64 server_time_offset;
144
145 guint server_time_is_monotonic_time : 1;
146
147 /* GLX extensions we check */
148 guint has_glx_swap_interval : 1;
149 guint has_glx_create_context : 1;
150 guint has_glx_texture_from_pixmap : 1;
151 guint has_glx_video_sync : 1;
152 guint has_glx_buffer_age : 1;
153 guint has_glx_sync_control : 1;
154 guint has_glx_multisample : 1;
155 guint has_glx_visual_rating : 1;
156 guint has_glx_create_es2_context : 1;
157 guint has_async_glx_swap_buffers : 1;
158};
159
160struct _GdkX11DisplayClass
161{
162 GdkDisplayClass parent_class;
163
164 gboolean (* xevent) (GdkX11Display *display,
165 const XEvent *event);
166};
167
168void _gdk_x11_display_error_event (GdkDisplay *display,
169 XErrorEvent *error);
170gsize gdk_x11_display_get_max_request_size (GdkDisplay *display);
171gboolean gdk_x11_display_request_selection_notification (GdkDisplay *display,
172 const char *selection);
173
174GdkFilterReturn _gdk_wm_protocols_filter (const XEvent *xevent,
175 GdkSurface *win,
176 GdkEvent **event,
177 gpointer data);
178
179G_END_DECLS
180
181#endif /* __GDK_X11_DISPLAY__ */
182

source code of gtk/gdk/x11/gdkdisplay-x11.h