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/*
26 * Private uninstalled header defining things local to X windowing code
27 */
28
29#ifndef __GDK_PRIVATE_X11_H__
30#define __GDK_PRIVATE_X11_H__
31
32#include "gdkcursor.h"
33#include "gdkx.h"
34#include "gdksurface-x11.h"
35#include "gdkscreen-x11.h"
36
37#include "gdk/gdkdeviceprivate.h"
38#include "gdk/gdkkeysprivate.h"
39
40#include <X11/Xlib.h>
41#include <X11/Xutil.h>
42#include <X11/extensions/XInput2.h>
43
44#include <cairo-xlib.h>
45
46typedef enum {
47 GDK_FILTER_CONTINUE,
48 GDK_FILTER_TRANSLATE,
49 GDK_FILTER_REMOVE
50} GdkFilterReturn;
51
52typedef GdkFilterReturn (*GdkFilterFunc) (const XEvent *xevent,
53 GdkEvent *event,
54 gpointer data);
55
56
57void _gdk_x11_error_handler_push (void);
58void _gdk_x11_error_handler_pop (void);
59
60int gdk_x11_display_get_window_depth (GdkX11Display *display);
61Visual * gdk_x11_display_get_window_visual (GdkX11Display *display);
62Colormap gdk_x11_display_get_window_colormap (GdkX11Display *display);
63
64void _gdk_x11_display_add_window (GdkDisplay *display,
65 XID *xid,
66 GdkSurface *window);
67void _gdk_x11_display_remove_window (GdkDisplay *display,
68 XID xid);
69
70int _gdk_x11_display_send_xevent (GdkDisplay *display,
71 Window window,
72 gboolean propagate,
73 glong event_mask,
74 XEvent *event_send);
75
76cairo_region_t* _gdk_x11_xwindow_get_shape (Display *xdisplay,
77 Window window,
78 int scale,
79 int shape_type);
80
81void _gdk_x11_region_get_xrectangles (const cairo_region_t *region,
82 int x_offset,
83 int y_offset,
84 int scale,
85 XRectangle **rects,
86 int *n_rects);
87
88gboolean _gdk_x11_moveresize_handle_event (const XEvent *event);
89gboolean _gdk_x11_moveresize_configure_done (GdkDisplay *display,
90 GdkSurface *window);
91
92void _gdk_x11_keymap_state_changed (GdkDisplay *display,
93 const XEvent *event);
94void _gdk_x11_keymap_keys_changed (GdkDisplay *display);
95void _gdk_x11_keymap_add_virt_mods (GdkKeymap *keymap,
96 GdkModifierType *modifiers);
97
98void _gdk_x11_surfaceing_init (void);
99
100void _gdk_x11_surface_grab_check_unmap (GdkSurface *window,
101 gulong serial);
102void _gdk_x11_surface_grab_check_destroy (GdkSurface *window);
103
104#ifdef HAVE_XDAMAGE
105void _gdk_x11_surface_set_frame_still_painting (GdkSurface *surface,
106 gboolean painting);
107#endif
108
109gboolean _gdk_x11_display_is_root_window (GdkDisplay *display,
110 Window xroot_window);
111
112void _gdk_x11_display_update_grab_info (GdkDisplay *display,
113 GdkDevice *device,
114 int status);
115void _gdk_x11_display_update_grab_info_ungrab (GdkDisplay *display,
116 GdkDevice *device,
117 guint32 time,
118 gulong serial);
119void _gdk_x11_display_queue_events (GdkDisplay *display);
120
121
122GdkAppLaunchContext *_gdk_x11_display_get_app_launch_context (GdkDisplay *display);
123
124int _gdk_x11_display_text_property_to_utf8_list (GdkDisplay *display,
125 const char *encoding,
126 int format,
127 const guchar *text,
128 int length,
129 char ***list);
130char * gdk_x11_utf8_to_string_target (const char *utf8_str,
131 gboolean return_latin1);
132
133void _gdk_x11_device_check_extension_events (GdkDevice *device);
134
135GdkX11DeviceManagerXI2 *_gdk_x11_device_manager_new (GdkDisplay *display);
136
137guchar * _gdk_x11_device_xi2_translate_event_mask (GdkX11DeviceManagerXI2 *device_manager_xi2,
138 GdkEventMask event_mask,
139 int *len);
140guint _gdk_x11_device_xi2_translate_state (XIModifierState *mods_state,
141 XIButtonState *buttons_state,
142 XIGroupState *group_state);
143guint _gdk_x11_device_xi2_gesture_type_to_phase (int evtype, int flags);
144int _gdk_x11_device_xi2_get_id (GdkX11DeviceXI2 *device);
145void _gdk_device_xi2_unset_scroll_valuators (GdkX11DeviceXI2 *device);
146
147
148GdkDevice * _gdk_x11_device_manager_xi2_lookup (GdkX11DeviceManagerXI2 *device_manager_xi2,
149 int device_id);
150void _gdk_x11_device_xi2_add_scroll_valuator (GdkX11DeviceXI2 *device,
151 guint n_valuator,
152 GdkScrollDirection direction,
153 double increment);
154gboolean _gdk_x11_device_xi2_get_scroll_delta (GdkX11DeviceXI2 *device,
155 guint n_valuator,
156 double valuator_value,
157 GdkScrollDirection *direction_ret,
158 double *delta_ret);
159void _gdk_device_xi2_reset_scroll_valuators (GdkX11DeviceXI2 *device);
160
161double gdk_x11_device_xi2_get_last_axis_value (GdkX11DeviceXI2 *device,
162 int n_axis);
163
164void gdk_x11_device_xi2_store_axes (GdkX11DeviceXI2 *device,
165 double *axes,
166 int n_axes);
167
168gboolean _gdk_x11_display_supports_cursor_alpha (GdkDisplay *display);
169gboolean _gdk_x11_display_supports_cursor_color (GdkDisplay *display);
170void _gdk_x11_display_get_default_cursor_size (GdkDisplay *display,
171 guint *width,
172 guint *height);
173void _gdk_x11_display_get_maximal_cursor_size (GdkDisplay *display,
174 guint *width,
175 guint *height);
176
177GdkSurface * _gdk_x11_display_create_surface (GdkDisplay *display,
178 GdkSurfaceType surface_type,
179 GdkSurface *parent,
180 int x,
181 int y,
182 int width,
183 int height);
184GList * gdk_x11_display_get_toplevel_windows (GdkDisplay *display);
185
186void _gdk_x11_precache_atoms (GdkDisplay *display,
187 const char * const *atom_names,
188 int n_atoms);
189
190Atom _gdk_x11_get_xatom_for_display_printf (GdkDisplay *display,
191 const char *format,
192 ...) G_GNUC_PRINTF (2, 3);
193
194GdkDrag *gdk_x11_drag_find (GdkDisplay *display,
195 Window source_xid,
196 Window dest_xid);
197void gdk_x11_drag_handle_status (GdkDisplay *display,
198 const XEvent *xevent);
199void gdk_x11_drag_handle_finished (GdkDisplay *display,
200 const XEvent *xevent);
201void gdk_x11_drop_read_actions (GdkDrop *drop);
202gboolean gdk_x11_drop_filter (GdkSurface *surface,
203 const XEvent *xevent);
204
205typedef struct _GdkSurfaceCache GdkSurfaceCache;
206
207GdkSurfaceCache *
208gdk_surface_cache_get (GdkDisplay *display);
209
210GdkFilterReturn
211gdk_surface_cache_filter (const XEvent *xevent,
212 gpointer data);
213GdkFilterReturn
214gdk_surface_cache_shape_filter (const XEvent *xevent,
215 gpointer data);
216
217void _gdk_x11_cursor_display_finalize (GdkDisplay *display);
218
219void _gdk_x11_surface_register_dnd (GdkSurface *window);
220
221void gdk_x11_surface_update_popups (GdkSurface *surface);
222
223void gdk_x11_surface_enter_leave_monitors (GdkSurface *surface);
224
225GdkDrag * _gdk_x11_surface_drag_begin (GdkSurface *window,
226 GdkDevice *device,
227 GdkContentProvider *content,
228 GdkDragAction actions,
229 double dx,
230 double dy);
231
232void gdk_x11_surface_get_root_coords (GdkSurface *surface,
233 int x,
234 int y,
235 int *root_x,
236 int *root_y);
237
238void gdk_x11_surface_show (GdkSurface *surface,
239 gboolean already_mapped);
240void gdk_x11_surface_raise (GdkSurface *surface);
241void gdk_x11_surface_set_opacity (GdkSurface *surface,
242 double opacity);
243gboolean gdk_x11_surface_supports_edge_constraints (GdkSurface *surface);
244
245cairo_surface_t * _gdk_x11_display_create_bitmap_surface (GdkDisplay *display,
246 int width,
247 int height);
248
249extern const int _gdk_x11_event_mask_table[];
250extern const int _gdk_x11_event_mask_table_size;
251
252#define GDK_SCREEN_DISPLAY(screen) (GDK_X11_SCREEN (screen)->display)
253#define GDK_SCREEN_XROOTWIN(screen) (GDK_X11_SCREEN (screen)->xroot_window)
254#define GDK_DISPLAY_XROOTWIN(display) (GDK_SCREEN_XROOTWIN (GDK_X11_DISPLAY (display)->screen))
255#define GDK_SURFACE_SCREEN(win) (GDK_X11_DISPLAY (gdk_surface_get_display (win))->screen)
256#define GDK_SURFACE_DISPLAY(win) (gdk_surface_get_display (win))
257#define GDK_SURFACE_XROOTWIN(win) (GDK_X11_SCREEN (GDK_SURFACE_SCREEN (win))->xroot_window)
258
259/* override some macros from gdkx.h with direct-access variants */
260#undef GDK_DISPLAY_XDISPLAY
261#undef GDK_SURFACE_XDISPLAY
262#undef GDK_SURFACE_XID
263#undef GDK_SCREEN_XDISPLAY
264
265#define GDK_DISPLAY_XDISPLAY(display) (GDK_X11_DISPLAY(display)->xdisplay)
266#define GDK_SURFACE_XDISPLAY(win) (GDK_X11_SCREEN (GDK_SURFACE_SCREEN (win))->xdisplay)
267#define GDK_SURFACE_XID(win) (GDK_X11_SURFACE (win)->xid)
268#define GDK_SCREEN_XDISPLAY(screen) (GDK_X11_SCREEN (screen)->xdisplay)
269
270#endif /* __GDK_PRIVATE_X11_H__ */
271

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