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