Debian Codegraph @

gdk/x11/gdkwindow-x11.h

raw
1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18 /*
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 */
24
25 #ifndef __GDK_WINDOW_X11_H__
26 #define __GDK_WINDOW_X11_H__
27
28 #include "gdk/x11/gdkprivate-x11.h"
29 #include "gdk/gdkwindowimpl.h"
30
31 #include <X11/Xlib.h>
32
33 #ifdef HAVE_XDAMAGE
34 #include <X11/extensions/Xdamage.h>
35 #endif
36
37 #ifdef HAVE_XSYNC
38 #include <X11/Xlib.h>
39 #include <X11/extensions/sync.h>
40 #endif
41
42 G_BEGIN_DECLS
43
44 typedef struct _GdkToplevelX11 GdkToplevelX11;
45 typedef struct _GdkWindowImplX11 GdkWindowImplX11;
46 typedef struct _GdkWindowImplX11Class GdkWindowImplX11Class;
47 typedef struct _GdkXPositionInfo GdkXPositionInfo;
48
49 /* Window implementation for X11
50 */
51
52 #define GDK_TYPE_WINDOW_IMPL_X11 (gdk_window_impl_x11_get_type ())
53 #define GDK_WINDOW_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11))
54 #define GDK_WINDOW_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11Class))
55 #define GDK_IS_WINDOW_IMPL_X11(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL_X11))
56 #define GDK_IS_WINDOW_IMPL_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL_X11))
57 #define GDK_WINDOW_IMPL_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL_X11, GdkWindowImplX11Class))
58
59 struct _GdkWindowImplX11
60 {
61 GdkWindowImpl parent_instance;
62
63 GdkWindow *wrapper;
64
65 Window xid;
66
67 GdkToplevelX11 *toplevel; /* Toplevel-specific information */
68 GdkCursor *cursor;
69 GHashTable *device_cursor;
70
71 guint no_bg : 1; /* Set when the window background is temporarily
72 * unset during resizing and scaling */
73 guint override_redirect : 1;
74 guint frame_clock_connected : 1;
75 guint frame_sync_enabled : 1;
76 guint tracking_damage: 1;
77
78 gint window_scale;
79
80 /* Width and height not divided by window_scale - this matters in the
81 * corner-case where the window manager assigns us a size that isn't
82 * a multiple of window_scale - for example for a maximized window
83 * with an odd-sized title-bar.
84 */
85 gint unscaled_width;
86 gint unscaled_height;
87
88 cairo_surface_t *cairo_surface;
89
90 #if defined (HAVE_XCOMPOSITE) && defined(HAVE_XDAMAGE) && defined (HAVE_XFIXES)
91 Damage damage;
92 #endif
93 };
94
95 struct _GdkWindowImplX11Class
96 {
97 GdkWindowImplClass parent_class;
98 };
99
100 struct _GdkToplevelX11
101 {
102
103 /* Set if the window, or any descendent of it, is the server's focus window
104 */
105 guint has_focus_window : 1;
106
107 /* Set if window->has_focus_window and the focus isn't grabbed elsewhere.
108 */
109 guint has_focus : 1;
110
111 /* Set if the pointer is inside this window. (This is needed for
112 * for focus tracking)
113 */
114 guint has_pointer : 1;
115
116 /* Set if the window is a descendent of the focus window and the pointer is
117 * inside it. (This is the case where the window will receive keystroke
118 * events even window->has_focus_window is FALSE)
119 */
120 guint has_pointer_focus : 1;
121
122 /* Set if we are requesting these hints */
123 guint skip_taskbar_hint : 1;
124 guint skip_pager_hint : 1;
125 guint urgency_hint : 1;
126
127 guint on_all_desktops : 1; /* _NET_WM_STICKY == 0xFFFFFFFF */
128
129 guint have_sticky : 1; /* _NET_WM_STATE_STICKY */
130 guint have_maxvert : 1; /* _NET_WM_STATE_MAXIMIZED_VERT */
131 guint have_maxhorz : 1; /* _NET_WM_STATE_MAXIMIZED_HORZ */
132 guint have_fullscreen : 1; /* _NET_WM_STATE_FULLSCREEN */
133 guint have_hidden : 1; /* _NET_WM_STATE_HIDDEN */
134
135 guint is_leader : 1;
136
137 /* Set if the WM is presenting us as focused, i.e. with active decorations
138 */
139 guint have_focused : 1;
140
141 guint in_frame : 1;
142
143 /* If we're expecting a response from the compositor after painting a frame */
144 guint frame_pending : 1;
145
146 /* Whether pending_counter_value/configure_counter_value are updates
147 * to the extended update counter */
148 guint pending_counter_value_is_extended : 1;
149 guint configure_counter_value_is_extended : 1;
150
151 gulong map_serial; /* Serial of last transition from unmapped */
152
153 cairo_surface_t *icon_pixmap;
154 cairo_surface_t *icon_mask;
155 GdkWindow *group_leader;
156
157 /* Time of most recent user interaction. */
158 gulong user_time;
159
160 /* We use an extra X window for toplevel windows that we XSetInputFocus()
161 * to in order to avoid getting keyboard events redirected to subwindows
162 * that might not even be part of this app
163 */
164 Window focus_window;
165
166 GdkWindowHints last_geometry_hints_mask;
167 GdkGeometry last_geometry_hints;
168
169 /* Constrained edge information */
170 guint edge_constraints;
171
172 #ifdef HAVE_XSYNC
173 XID update_counter;
174 XID extended_update_counter;
175 gint64 pending_counter_value; /* latest _NET_WM_SYNC_REQUEST value received */
176 gint64 configure_counter_value; /* Latest _NET_WM_SYNC_REQUEST value received
177 * where we have also seen the corresponding
178 * ConfigureNotify
179 */
180 gint64 current_counter_value;
181
182 /* After a _NET_WM_FRAME_DRAWN message, this is the soonest that we think
183 * frame after will be presented */
184 gint64 throttled_presentation_time;
185 #endif
186 };
187
188 GType gdk_window_impl_x11_get_type (void);
189
190 void gdk_x11_window_set_user_time (GdkWindow *window,
191 guint32 timestamp);
192 void gdk_x11_window_set_frame_sync_enabled (GdkWindow *window,
193 gboolean frame_sync_enabled);
194
195 GdkToplevelX11 *_gdk_x11_window_get_toplevel (GdkWindow *window);
196 void _gdk_x11_window_tmp_unset_bg (GdkWindow *window,
197 gboolean recurse);
198 void _gdk_x11_window_tmp_reset_bg (GdkWindow *window,
199 gboolean recurse);
200 void _gdk_x11_window_tmp_unset_parent_bg (GdkWindow *window);
201 void _gdk_x11_window_tmp_reset_parent_bg (GdkWindow *window);
202
203 GdkCursor *_gdk_x11_window_get_cursor (GdkWindow *window);
204
205 void _gdk_x11_window_update_size (GdkWindowImplX11 *impl);
206 void _gdk_x11_window_set_window_scale (GdkWindow *window,
207 int scale);
208
209 G_END_DECLS
210
211 #endif /* __GDK_WINDOW_X11_H__ */