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_IMPL_H__ |
26 | #define __GDK_WINDOW_IMPL_H__ |
27 | |
28 | #include <gdk/gdkwindow.h> |
29 | #include <gdk/gdkproperty.h> |
30 | |
31 | G_BEGIN_DECLS |
32 | |
33 | #define GDK_TYPE_WINDOW_IMPL (gdk_window_impl_get_type ()) |
34 | #define GDK_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL, GdkWindowImpl)) |
35 | #define GDK_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass)) |
36 | #define GDK_IS_WINDOW_IMPL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL)) |
37 | #define GDK_IS_WINDOW_IMPL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL)) |
38 | #define GDK_WINDOW_IMPL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass)) |
39 | |
40 | typedef struct _GdkWindowImpl GdkWindowImpl; |
41 | typedef struct _GdkWindowImplClass GdkWindowImplClass; |
42 | |
43 | struct _GdkWindowImpl |
44 | { |
45 | GObject parent; |
46 | }; |
47 | |
48 | struct _GdkWindowImplClass |
49 | { |
50 | GObjectClass parent_class; |
51 | |
52 | cairo_surface_t * |
53 | (* ref_cairo_surface) (GdkWindow *window); |
54 | cairo_surface_t * |
55 | (* create_similar_image_surface) (GdkWindow * window, |
56 | cairo_format_t format, |
57 | int width, |
58 | int height); |
59 | |
60 | void (* show) (GdkWindow *window, |
61 | gboolean already_mapped); |
62 | void (* hide) (GdkWindow *window); |
63 | void (* withdraw) (GdkWindow *window); |
64 | void (* raise) (GdkWindow *window); |
65 | void (* lower) (GdkWindow *window); |
66 | void (* restack_under) (GdkWindow *window, |
67 | GList *native_siblings); |
68 | void (* restack_toplevel) (GdkWindow *window, |
69 | GdkWindow *sibling, |
70 | gboolean above); |
71 | |
72 | void (* move_resize) (GdkWindow *window, |
73 | gboolean with_move, |
74 | gint x, |
75 | gint y, |
76 | gint width, |
77 | gint height); |
78 | void (* set_background) (GdkWindow *window, |
79 | cairo_pattern_t *pattern); |
80 | |
81 | GdkEventMask (* get_events) (GdkWindow *window); |
82 | void (* set_events) (GdkWindow *window, |
83 | GdkEventMask event_mask); |
84 | |
85 | gboolean (* reparent) (GdkWindow *window, |
86 | GdkWindow *new_parent, |
87 | gint x, |
88 | gint y); |
89 | |
90 | void (* set_device_cursor) (GdkWindow *window, |
91 | GdkDevice *device, |
92 | GdkCursor *cursor); |
93 | |
94 | void (* get_geometry) (GdkWindow *window, |
95 | gint *x, |
96 | gint *y, |
97 | gint *width, |
98 | gint *height); |
99 | void (* get_root_coords) (GdkWindow *window, |
100 | gint x, |
101 | gint y, |
102 | gint *root_x, |
103 | gint *root_y); |
104 | gboolean (* get_device_state) (GdkWindow *window, |
105 | GdkDevice *device, |
106 | gdouble *x, |
107 | gdouble *y, |
108 | GdkModifierType *mask); |
109 | gboolean (* begin_paint) (GdkWindow *window); |
110 | void (* end_paint) (GdkWindow *window); |
111 | |
112 | cairo_region_t * (* get_shape) (GdkWindow *window); |
113 | cairo_region_t * (* get_input_shape) (GdkWindow *window); |
114 | void (* shape_combine_region) (GdkWindow *window, |
115 | const cairo_region_t *shape_region, |
116 | gint offset_x, |
117 | gint offset_y); |
118 | void (* input_shape_combine_region) (GdkWindow *window, |
119 | const cairo_region_t *shape_region, |
120 | gint offset_x, |
121 | gint offset_y); |
122 | |
123 | /* Called before processing updates for a window. This gives the windowing |
124 | * layer a chance to save the region for later use in avoiding duplicate |
125 | * exposes. |
126 | */ |
127 | void (* queue_antiexpose) (GdkWindow *window, |
128 | cairo_region_t *update_area); |
129 | |
130 | /* Called to do the windowing system specific part of gdk_window_destroy(), |
131 | * |
132 | * window: The window being destroyed |
133 | * recursing: If TRUE, then this is being called because a parent |
134 | * was destroyed. This generally means that the call to the windowing |
135 | * system to destroy the window can be omitted, since it will be |
136 | * destroyed as a result of the parent being destroyed. |
137 | * Unless @foreign_destroy |
138 | * foreign_destroy: If TRUE, the window or a parent was destroyed by some |
139 | * external agency. The window has already been destroyed and no |
140 | * windowing system calls should be made. (This may never happen |
141 | * for some windowing systems.) |
142 | */ |
143 | void (* destroy) (GdkWindow *window, |
144 | gboolean recursing, |
145 | gboolean foreign_destroy); |
146 | |
147 | |
148 | /* Called when gdk_window_destroy() is called on a foreign window |
149 | * or an ancestor of the foreign window. It should generally reparent |
150 | * the window out of it's current heirarchy, hide it, and then |
151 | * send a message to the owner requesting that the window be destroyed. |
152 | */ |
153 | void (*destroy_foreign) (GdkWindow *window); |
154 | |
155 | /* optional */ |
156 | gboolean (* beep) (GdkWindow *window); |
157 | |
158 | void (* focus) (GdkWindow *window, |
159 | guint32 timestamp); |
160 | void (* set_type_hint) (GdkWindow *window, |
161 | GdkWindowTypeHint hint); |
162 | GdkWindowTypeHint (* get_type_hint) (GdkWindow *window); |
163 | void (* set_modal_hint) (GdkWindow *window, |
164 | gboolean modal); |
165 | void (* set_skip_taskbar_hint) (GdkWindow *window, |
166 | gboolean skips_taskbar); |
167 | void (* ) (GdkWindow *window, |
168 | gboolean ); |
169 | void (* set_urgency_hint) (GdkWindow *window, |
170 | gboolean urgent); |
171 | void (* set_geometry_hints) (GdkWindow *window, |
172 | const GdkGeometry *geometry, |
173 | GdkWindowHints geom_mask); |
174 | void (* set_title) (GdkWindow *window, |
175 | const gchar *title); |
176 | void (* set_role) (GdkWindow *window, |
177 | const gchar *role); |
178 | void (* set_startup_id) (GdkWindow *window, |
179 | const gchar *startup_id); |
180 | void (* set_transient_for) (GdkWindow *window, |
181 | GdkWindow *parent); |
182 | void (* get_frame_extents) (GdkWindow *window, |
183 | GdkRectangle *rect); |
184 | void (* set_override_redirect) (GdkWindow *window, |
185 | gboolean override_redirect); |
186 | void (* set_accept_focus) (GdkWindow *window, |
187 | gboolean accept_focus); |
188 | void (* set_focus_on_map) (GdkWindow *window, |
189 | gboolean focus_on_map); |
190 | void (* set_icon_list) (GdkWindow *window, |
191 | GList *pixbufs); |
192 | void (* set_icon_name) (GdkWindow *window, |
193 | const gchar *name); |
194 | void (* iconify) (GdkWindow *window); |
195 | void (* deiconify) (GdkWindow *window); |
196 | void (* stick) (GdkWindow *window); |
197 | void (* unstick) (GdkWindow *window); |
198 | void (* maximize) (GdkWindow *window); |
199 | void (* unmaximize) (GdkWindow *window); |
200 | void (* fullscreen) (GdkWindow *window); |
201 | void (* fullscreen_on_monitor) (GdkWindow *window, gint monitor); |
202 | void (* apply_fullscreen_mode) (GdkWindow *window); |
203 | void (* unfullscreen) (GdkWindow *window); |
204 | void (* set_keep_above) (GdkWindow *window, |
205 | gboolean setting); |
206 | void (* set_keep_below) (GdkWindow *window, |
207 | gboolean setting); |
208 | GdkWindow * (* get_group) (GdkWindow *window); |
209 | void (* set_group) (GdkWindow *window, |
210 | GdkWindow *leader); |
211 | void (* set_decorations) (GdkWindow *window, |
212 | GdkWMDecoration decorations); |
213 | gboolean (* get_decorations) (GdkWindow *window, |
214 | GdkWMDecoration *decorations); |
215 | void (* set_functions) (GdkWindow *window, |
216 | GdkWMFunction functions); |
217 | void (* begin_resize_drag) (GdkWindow *window, |
218 | GdkWindowEdge edge, |
219 | GdkDevice *device, |
220 | gint button, |
221 | gint root_x, |
222 | gint root_y, |
223 | guint32 timestamp); |
224 | void (* begin_move_drag) (GdkWindow *window, |
225 | GdkDevice *device, |
226 | gint button, |
227 | gint root_x, |
228 | gint root_y, |
229 | guint32 timestamp); |
230 | void (* enable_synchronized_configure) (GdkWindow *window); |
231 | void (* configure_finished) (GdkWindow *window); |
232 | void (* set_opacity) (GdkWindow *window, |
233 | gdouble opacity); |
234 | void (* set_composited) (GdkWindow *window, |
235 | gboolean composited); |
236 | void (* destroy_notify) (GdkWindow *window); |
237 | GdkDragProtocol (* get_drag_protocol) (GdkWindow *window, |
238 | GdkWindow **target); |
239 | void (* register_dnd) (GdkWindow *window); |
240 | GdkDragContext * (*drag_begin) (GdkWindow *window, |
241 | GdkDevice *device, |
242 | GList *targets, |
243 | gint x_root, |
244 | gint y_root); |
245 | |
246 | void (*process_updates_recurse) (GdkWindow *window, |
247 | cairo_region_t *region); |
248 | |
249 | void (*sync_rendering) (GdkWindow *window); |
250 | gboolean (*simulate_key) (GdkWindow *window, |
251 | gint x, |
252 | gint y, |
253 | guint keyval, |
254 | GdkModifierType modifiers, |
255 | GdkEventType event_type); |
256 | gboolean (*simulate_button) (GdkWindow *window, |
257 | gint x, |
258 | gint y, |
259 | guint button, |
260 | GdkModifierType modifiers, |
261 | GdkEventType event_type); |
262 | |
263 | gboolean (*get_property) (GdkWindow *window, |
264 | GdkAtom property, |
265 | GdkAtom type, |
266 | gulong offset, |
267 | gulong length, |
268 | gint pdelete, |
269 | GdkAtom *actual_type, |
270 | gint *actual_format, |
271 | gint *actual_length, |
272 | guchar **data); |
273 | void (*change_property) (GdkWindow *window, |
274 | GdkAtom property, |
275 | GdkAtom type, |
276 | gint format, |
277 | GdkPropMode mode, |
278 | const guchar *data, |
279 | gint n_elements); |
280 | void (*delete_property) (GdkWindow *window, |
281 | GdkAtom property); |
282 | |
283 | gint (* get_scale_factor) (GdkWindow *window); |
284 | void (* get_unscaled_size) (GdkWindow *window, |
285 | int *unscaled_width, |
286 | int *unscaled_height); |
287 | |
288 | void (* set_opaque_region) (GdkWindow *window, |
289 | cairo_region_t *region); |
290 | void (* set_shadow_width) (GdkWindow *window, |
291 | gint left, |
292 | gint right, |
293 | gint top, |
294 | gint bottom); |
295 | gboolean (* ) (GdkWindow *window, |
296 | GdkEvent *event); |
297 | GdkGLContext *(*create_gl_context) (GdkWindow *window, |
298 | gboolean attached, |
299 | GdkGLContext *share, |
300 | GError **error); |
301 | gboolean (* realize_gl_context) (GdkWindow *window, |
302 | GdkGLContext *context, |
303 | GError **error); |
304 | void (*invalidate_for_new_frame)(GdkWindow *window, |
305 | cairo_region_t *update_area); |
306 | |
307 | GdkDrawingContext *(* create_draw_context) (GdkWindow *window, |
308 | const cairo_region_t *region); |
309 | void (* destroy_draw_context) (GdkWindow *window, |
310 | GdkDrawingContext *context); |
311 | }; |
312 | |
313 | /* Interface Functions */ |
314 | GType gdk_window_impl_get_type (void) G_GNUC_CONST; |
315 | |
316 | G_END_DECLS |
317 | |
318 | #endif /* __GDK_WINDOW_IMPL_H__ */ |
319 | |