]> Pileus Git - ~andy/gtk/blob - gdk/x11/gdkdisplay-x11.h
gdk/fallback-c89.c: Add fallback for round()
[~andy/gtk] / gdk / x11 / gdkdisplay-x11.h
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 "gdkwindow.h"
28 #include "gdkinternals.h"
29 #include "gdkmain.h"
30
31 #include <X11/X.h>
32 #include <X11/Xlib.h>
33
34 G_BEGIN_DECLS
35
36
37 struct _GdkX11Display
38 {
39   GdkDisplay parent_instance;
40   Display *xdisplay;
41   GdkScreen *default_screen;
42   GdkScreen **screens;
43
44   GSource *event_source;
45
46   gint grab_count;
47
48   /* Keyboard related information */
49   gint xkb_event_type;
50   gboolean use_xkb;
51
52   /* Whether we were able to turn on detectable-autorepeat using
53    * XkbSetDetectableAutorepeat. If FALSE, we'll fall back
54    * to checking the next event with XPending().
55    */
56   gboolean have_xkb_autorepeat;
57
58   GdkKeymap *keymap;
59   guint      keymap_serial;
60
61   gboolean have_xfixes;
62   gint xfixes_event_base;
63
64   gboolean have_xcomposite;
65   gboolean have_xdamage;
66   gint xdamage_event_base;
67
68   gboolean have_randr12;
69   gboolean have_randr13;
70   gint xrandr_event_base;
71
72   /* If the SECURITY extension is in place, whether this client holds
73    * a trusted authorization and so is allowed to make various requests
74    * (grabs, properties etc.) Otherwise always TRUE.
75    */
76   gboolean trusted_client;
77
78   /* drag and drop information */
79   GdkDragContext *current_dest_drag;
80
81   /* data needed for MOTIF DnD */
82   Window motif_drag_window;
83   GdkWindow *motif_drag_gdk_window;
84   GList **motif_target_lists;
85   gint motif_n_target_lists;
86
87   /* Mapping to/from virtual atoms */
88   GHashTable *atom_from_virtual;
89   GHashTable *atom_to_virtual;
90
91   /* Session Management leader window see ICCCM */
92   Window leader_window;
93   GdkWindow *leader_gdk_window;
94   gboolean leader_window_title_set;
95
96   /* List of functions to go from extension event => X window */
97   GSList *event_types;
98
99   /* X ID hashtable */
100   GHashTable *xid_ht;
101
102   /* translation queue */
103   GQueue *translate_queue;
104
105   /* Input device */
106   /* input GdkDevice list */
107   GList *input_devices;
108
109   /* input GdkWindow list */
110   GList *input_windows;
111
112   /* Startup notification */
113   gchar *startup_notification_id;
114
115   /* Time of most recent user interaction. */
116   gulong user_time;
117
118   /* Sets of atoms for DND */
119   guint base_dnd_atoms_precached : 1;
120   guint xdnd_atoms_precached : 1;
121   guint motif_atoms_precached : 1;
122   guint use_sync : 1;
123
124   guint have_shapes : 1;
125   guint have_input_shapes : 1;
126   gint shape_event_base;
127
128   /* The offscreen window that has the pointer in it (if any) */
129   GdkWindow *active_offscreen_window;
130
131   GSList *error_traps;
132
133   gint wm_moveresize_button;
134 };
135
136 struct _GdkX11DisplayClass
137 {
138   GdkDisplayClass parent_class;
139 };
140
141 GdkScreen *_gdk_x11_display_screen_for_xrootwin (GdkDisplay  *display,
142                                                  Window       xrootwin);
143 void       _gdk_x11_display_error_event         (GdkDisplay  *display,
144                                                  XErrorEvent *error);
145
146 GdkFilterReturn _gdk_wm_protocols_filter        (GdkXEvent   *xev,
147                                                  GdkEvent    *event,
148                                                  gpointer     data);
149
150 G_END_DECLS
151
152 #endif  /* __GDK_X11_DISPLAY__ */