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_H__
26#define __GDK_WINDOW_H__
27
28#if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
29#error "Only <gdk/gdk.h> can be included directly."
30#endif
31
32#include <gdk/gdkversionmacros.h>
33#include <gdk/gdktypes.h>
34#include <gdk/gdkdrawingcontext.h>
35#include <gdk/gdkevents.h>
36#include <gdk/gdkframeclock.h>
37
38G_BEGIN_DECLS
39
40typedef struct _GdkGeometry GdkGeometry;
41typedef struct _GdkWindowAttr GdkWindowAttr;
42typedef struct _GdkWindowRedirect GdkWindowRedirect;
43
44/**
45 * GdkWindowWindowClass:
46 * @GDK_INPUT_OUTPUT: window for graphics and events
47 * @GDK_INPUT_ONLY: window for events only
48 *
49 * @GDK_INPUT_OUTPUT windows are the standard kind of window you might expect.
50 * Such windows receive events and are also displayed on screen.
51 * @GDK_INPUT_ONLY windows are invisible; they are usually placed above other
52 * windows in order to trap or filter the events. You can’t draw on
53 * @GDK_INPUT_ONLY windows.
54 */
55typedef enum
56{
57 GDK_INPUT_OUTPUT, /*< nick=input-output >*/
58 GDK_INPUT_ONLY /*< nick=input-only >*/
59} GdkWindowWindowClass;
60
61/**
62 * GdkWindowType:
63 * @GDK_WINDOW_ROOT: root window; this window has no parent, covers the entire
64 * screen, and is created by the window system
65 * @GDK_WINDOW_TOPLEVEL: toplevel window (used to implement #GtkWindow)
66 * @GDK_WINDOW_CHILD: child window (used to implement e.g. #GtkEntry)
67 * @GDK_WINDOW_TEMP: override redirect temporary window (used to implement
68 * #GtkMenu)
69 * @GDK_WINDOW_FOREIGN: foreign window (see gdk_window_foreign_new())
70 * @GDK_WINDOW_OFFSCREEN: offscreen window (see
71 * [Offscreen Windows][OFFSCREEN-WINDOWS]). Since 2.18
72 * @GDK_WINDOW_SUBSURFACE: subsurface-based window; This window is visually
73 * tied to a toplevel, and is moved/stacked with it. Currently this window
74 * type is only implemented in Wayland. Since 3.14
75 *
76 * Describes the kind of window.
77 */
78typedef enum
79{
80 GDK_WINDOW_ROOT,
81 GDK_WINDOW_TOPLEVEL,
82 GDK_WINDOW_CHILD,
83 GDK_WINDOW_TEMP,
84 GDK_WINDOW_FOREIGN,
85 GDK_WINDOW_OFFSCREEN,
86 GDK_WINDOW_SUBSURFACE
87} GdkWindowType;
88
89/**
90 * GdkWindowAttributesType:
91 * @GDK_WA_TITLE: Honor the title field
92 * @GDK_WA_X: Honor the X coordinate field
93 * @GDK_WA_Y: Honor the Y coordinate field
94 * @GDK_WA_CURSOR: Honor the cursor field
95 * @GDK_WA_VISUAL: Honor the visual field
96 * @GDK_WA_WMCLASS: Honor the wmclass_class and wmclass_name fields
97 * @GDK_WA_NOREDIR: Honor the override_redirect field
98 * @GDK_WA_TYPE_HINT: Honor the type_hint field
99 *
100 * Used to indicate which fields in the #GdkWindowAttr struct should be honored.
101 * For example, if you filled in the “cursor” and “x” fields of #GdkWindowAttr,
102 * pass @GDK_WA_X | @GDK_WA_CURSOR” to gdk_window_new(). Fields in
103 * #GdkWindowAttr not covered by a bit in this enum are required; for example,
104 * the @width/@height, @wclass, and @window_type fields are required, they have
105 * no corresponding flag in #GdkWindowAttributesType.
106 */
107typedef enum
108{
109 GDK_WA_TITLE = 1 << 1,
110 GDK_WA_X = 1 << 2,
111 GDK_WA_Y = 1 << 3,
112 GDK_WA_CURSOR = 1 << 4,
113 GDK_WA_VISUAL = 1 << 5,
114 GDK_WA_WMCLASS = 1 << 6,
115 GDK_WA_NOREDIR = 1 << 7,
116 GDK_WA_TYPE_HINT = 1 << 8
117} GdkWindowAttributesType;
118
119/* Size restriction enumeration.
120 */
121/**
122 * GdkWindowHints:
123 * @GDK_HINT_POS: indicates that the program has positioned the window
124 * @GDK_HINT_MIN_SIZE: min size fields are set
125 * @GDK_HINT_MAX_SIZE: max size fields are set
126 * @GDK_HINT_BASE_SIZE: base size fields are set
127 * @GDK_HINT_ASPECT: aspect ratio fields are set
128 * @GDK_HINT_RESIZE_INC: resize increment fields are set
129 * @GDK_HINT_WIN_GRAVITY: window gravity field is set
130 * @GDK_HINT_USER_POS: indicates that the window’s position was explicitly set
131 * by the user
132 * @GDK_HINT_USER_SIZE: indicates that the window’s size was explicitly set by
133 * the user
134 *
135 * Used to indicate which fields of a #GdkGeometry struct should be paid
136 * attention to. Also, the presence/absence of @GDK_HINT_POS,
137 * @GDK_HINT_USER_POS, and @GDK_HINT_USER_SIZE is significant, though they don't
138 * directly refer to #GdkGeometry fields. @GDK_HINT_USER_POS will be set
139 * automatically by #GtkWindow if you call gtk_window_move().
140 * @GDK_HINT_USER_POS and @GDK_HINT_USER_SIZE should be set if the user
141 * specified a size/position using a --geometry command-line argument;
142 * gtk_window_parse_geometry() automatically sets these flags.
143 */
144typedef enum
145{
146 GDK_HINT_POS = 1 << 0,
147 GDK_HINT_MIN_SIZE = 1 << 1,
148 GDK_HINT_MAX_SIZE = 1 << 2,
149 GDK_HINT_BASE_SIZE = 1 << 3,
150 GDK_HINT_ASPECT = 1 << 4,
151 GDK_HINT_RESIZE_INC = 1 << 5,
152 GDK_HINT_WIN_GRAVITY = 1 << 6,
153 GDK_HINT_USER_POS = 1 << 7,
154 GDK_HINT_USER_SIZE = 1 << 8
155} GdkWindowHints;
156
157/* The next two enumeration values current match the
158 * Motif constants. If this is changed, the implementation
159 * of gdk_window_set_decorations/gdk_window_set_functions
160 * will need to change as well.
161 */
162/**
163 * GdkWMDecoration:
164 * @GDK_DECOR_ALL: all decorations should be applied.
165 * @GDK_DECOR_BORDER: a frame should be drawn around the window.
166 * @GDK_DECOR_RESIZEH: the frame should have resize handles.
167 * @GDK_DECOR_TITLE: a titlebar should be placed above the window.
168 * @GDK_DECOR_MENU: a button for opening a menu should be included.
169 * @GDK_DECOR_MINIMIZE: a minimize button should be included.
170 * @GDK_DECOR_MAXIMIZE: a maximize button should be included.
171 *
172 * These are hints originally defined by the Motif toolkit.
173 * The window manager can use them when determining how to decorate
174 * the window. The hint must be set before mapping the window.
175 */
176typedef enum
177{
178 GDK_DECOR_ALL = 1 << 0,
179 GDK_DECOR_BORDER = 1 << 1,
180 GDK_DECOR_RESIZEH = 1 << 2,
181 GDK_DECOR_TITLE = 1 << 3,
182 GDK_DECOR_MENU = 1 << 4,
183 GDK_DECOR_MINIMIZE = 1 << 5,
184 GDK_DECOR_MAXIMIZE = 1 << 6
185} GdkWMDecoration;
186
187/**
188 * GdkWMFunction:
189 * @GDK_FUNC_ALL: all functions should be offered.
190 * @GDK_FUNC_RESIZE: the window should be resizable.
191 * @GDK_FUNC_MOVE: the window should be movable.
192 * @GDK_FUNC_MINIMIZE: the window should be minimizable.
193 * @GDK_FUNC_MAXIMIZE: the window should be maximizable.
194 * @GDK_FUNC_CLOSE: the window should be closable.
195 *
196 * These are hints originally defined by the Motif toolkit. The window manager
197 * can use them when determining the functions to offer for the window. The
198 * hint must be set before mapping the window.
199 */
200typedef enum
201{
202 GDK_FUNC_ALL = 1 << 0,
203 GDK_FUNC_RESIZE = 1 << 1,
204 GDK_FUNC_MOVE = 1 << 2,
205 GDK_FUNC_MINIMIZE = 1 << 3,
206 GDK_FUNC_MAXIMIZE = 1 << 4,
207 GDK_FUNC_CLOSE = 1 << 5
208} GdkWMFunction;
209
210/* Currently, these are the same values numerically as in the
211 * X protocol. If you change that, gdkwindow-x11.c/gdk_window_set_geometry_hints()
212 * will need fixing.
213 */
214/**
215 * GdkGravity:
216 * @GDK_GRAVITY_NORTH_WEST: the reference point is at the top left corner.
217 * @GDK_GRAVITY_NORTH: the reference point is in the middle of the top edge.
218 * @GDK_GRAVITY_NORTH_EAST: the reference point is at the top right corner.
219 * @GDK_GRAVITY_WEST: the reference point is at the middle of the left edge.
220 * @GDK_GRAVITY_CENTER: the reference point is at the center of the window.
221 * @GDK_GRAVITY_EAST: the reference point is at the middle of the right edge.
222 * @GDK_GRAVITY_SOUTH_WEST: the reference point is at the lower left corner.
223 * @GDK_GRAVITY_SOUTH: the reference point is at the middle of the lower edge.
224 * @GDK_GRAVITY_SOUTH_EAST: the reference point is at the lower right corner.
225 * @GDK_GRAVITY_STATIC: the reference point is at the top left corner of the
226 * window itself, ignoring window manager decorations.
227 *
228 * Defines the reference point of a window and the meaning of coordinates
229 * passed to gtk_window_move(). See gtk_window_move() and the "implementation
230 * notes" section of the
231 * [Extended Window Manager Hints](http://www.freedesktop.org/Standards/wm-spec)
232 * specification for more details.
233 */
234typedef enum
235{
236 GDK_GRAVITY_NORTH_WEST = 1,
237 GDK_GRAVITY_NORTH,
238 GDK_GRAVITY_NORTH_EAST,
239 GDK_GRAVITY_WEST,
240 GDK_GRAVITY_CENTER,
241 GDK_GRAVITY_EAST,
242 GDK_GRAVITY_SOUTH_WEST,
243 GDK_GRAVITY_SOUTH,
244 GDK_GRAVITY_SOUTH_EAST,
245 GDK_GRAVITY_STATIC
246} GdkGravity;
247
248
249/**
250 * GdkWindowEdge:
251 * @GDK_WINDOW_EDGE_NORTH_WEST: the top left corner.
252 * @GDK_WINDOW_EDGE_NORTH: the top edge.
253 * @GDK_WINDOW_EDGE_NORTH_EAST: the top right corner.
254 * @GDK_WINDOW_EDGE_WEST: the left edge.
255 * @GDK_WINDOW_EDGE_EAST: the right edge.
256 * @GDK_WINDOW_EDGE_SOUTH_WEST: the lower left corner.
257 * @GDK_WINDOW_EDGE_SOUTH: the lower edge.
258 * @GDK_WINDOW_EDGE_SOUTH_EAST: the lower right corner.
259 *
260 * Determines a window edge or corner.
261 */
262typedef enum
263{
264 GDK_WINDOW_EDGE_NORTH_WEST,
265 GDK_WINDOW_EDGE_NORTH,
266 GDK_WINDOW_EDGE_NORTH_EAST,
267 GDK_WINDOW_EDGE_WEST,
268 GDK_WINDOW_EDGE_EAST,
269 GDK_WINDOW_EDGE_SOUTH_WEST,
270 GDK_WINDOW_EDGE_SOUTH,
271 GDK_WINDOW_EDGE_SOUTH_EAST
272} GdkWindowEdge;
273
274/**
275 * GdkFullscreenMode:
276 * @GDK_FULLSCREEN_ON_CURRENT_MONITOR: Fullscreen on current monitor only.
277 * @GDK_FULLSCREEN_ON_ALL_MONITORS: Span across all monitors when fullscreen.
278 *
279 * Indicates which monitor (in a multi-head setup) a window should span over
280 * when in fullscreen mode.
281 *
282 * Since: 3.8
283 **/
284typedef enum
285{
286 GDK_FULLSCREEN_ON_CURRENT_MONITOR,
287 GDK_FULLSCREEN_ON_ALL_MONITORS
288} GdkFullscreenMode;
289
290/**
291 * GdkWindowAttr:
292 * @title: title of the window (for toplevel windows)
293 * @event_mask: event mask (see gdk_window_set_events())
294 * @x: X coordinate relative to parent window (see gdk_window_move())
295 * @y: Y coordinate relative to parent window (see gdk_window_move())
296 * @width: width of window
297 * @height: height of window
298 * @wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible
299 * window that receives events)
300 * @visual: #GdkVisual for window
301 * @window_type: type of window
302 * @cursor: cursor for the window (see gdk_window_set_cursor())
303 * @wmclass_name: don’t use (see gtk_window_set_wmclass())
304 * @wmclass_class: don’t use (see gtk_window_set_wmclass())
305 * @override_redirect: %TRUE to bypass the window manager
306 * @type_hint: a hint of the function of the window
307 *
308 * Attributes to use for a newly-created window.
309 */
310struct _GdkWindowAttr
311{
312 gchar *title;
313 gint event_mask;
314 gint x, y;
315 gint width;
316 gint height;
317 GdkWindowWindowClass wclass;
318 GdkVisual *visual;
319 GdkWindowType window_type;
320 GdkCursor *cursor;
321 gchar *wmclass_name;
322 gchar *wmclass_class;
323 gboolean override_redirect;
324 GdkWindowTypeHint type_hint;
325};
326
327/**
328 * GdkGeometry:
329 * @min_width: minimum width of window (or -1 to use requisition, with
330 * #GtkWindow only)
331 * @min_height: minimum height of window (or -1 to use requisition, with
332 * #GtkWindow only)
333 * @max_width: maximum width of window (or -1 to use requisition, with
334 * #GtkWindow only)
335 * @max_height: maximum height of window (or -1 to use requisition, with
336 * #GtkWindow only)
337 * @base_width: allowed window widths are @base_width + @width_inc * N where N
338 * is any integer (-1 allowed with #GtkWindow)
339 * @base_height: allowed window widths are @base_height + @height_inc * N where
340 * N is any integer (-1 allowed with #GtkWindow)
341 * @width_inc: width resize increment
342 * @height_inc: height resize increment
343 * @min_aspect: minimum width/height ratio
344 * @max_aspect: maximum width/height ratio
345 * @win_gravity: window gravity, see gtk_window_set_gravity()
346 *
347 * The #GdkGeometry struct gives the window manager information about
348 * a window’s geometry constraints. Normally you would set these on
349 * the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow
350 * then sets the hints on the #GdkWindow it creates.
351 *
352 * gdk_window_set_geometry_hints() expects the hints to be fully valid already
353 * and simply passes them to the window manager; in contrast,
354 * gtk_window_set_geometry_hints() performs some interpretation. For example,
355 * #GtkWindow will apply the hints to the geometry widget instead of the
356 * toplevel window, if you set a geometry widget. Also, the
357 * @min_width/@min_height/@max_width/@max_height fields may be set to -1, and
358 * #GtkWindow will substitute the size request of the window or geometry widget.
359 * If the minimum size hint is not provided, #GtkWindow will use its requisition
360 * as the minimum size. If the minimum size is provided and a geometry widget is
361 * set, #GtkWindow will take the minimum size as the minimum size of the
362 * geometry widget rather than the entire window. The base size is treated
363 * similarly.
364 *
365 * The canonical use-case for gtk_window_set_geometry_hints() is to get a
366 * terminal widget to resize properly. Here, the terminal text area should be
367 * the geometry widget; #GtkWindow will then automatically set the base size to
368 * the size of other widgets in the terminal window, such as the menubar and
369 * scrollbar. Then, the @width_inc and @height_inc fields should be set to the
370 * size of one character in the terminal. Finally, the base size should be set
371 * to the size of one character. The net effect is that the minimum size of the
372 * terminal will have a 1x1 character terminal area, and only terminal sizes on
373 * the “character grid” will be allowed.
374 *
375 * Here’s an example of how the terminal example would be implemented, assuming
376 * a terminal area widget called “terminal” and a toplevel window “toplevel”:
377 *
378 * |[<!-- language="C" -->
379 * GdkGeometry hints;
380 *
381 * hints.base_width = terminal->char_width;
382 * hints.base_height = terminal->char_height;
383 * hints.min_width = terminal->char_width;
384 * hints.min_height = terminal->char_height;
385 * hints.width_inc = terminal->char_width;
386 * hints.height_inc = terminal->char_height;
387 *
388 * gtk_window_set_geometry_hints (GTK_WINDOW (toplevel),
389 * GTK_WIDGET (terminal),
390 * &hints,
391 * GDK_HINT_RESIZE_INC |
392 * GDK_HINT_MIN_SIZE |
393 * GDK_HINT_BASE_SIZE);
394 * ]|
395 *
396 * The other useful fields are the @min_aspect and @max_aspect fields; these
397 * contain a width/height ratio as a floating point number. If a geometry widget
398 * is set, the aspect applies to the geometry widget rather than the entire
399 * window. The most common use of these hints is probably to set @min_aspect and
400 * @max_aspect to the same value, thus forcing the window to keep a constant
401 * aspect ratio.
402 */
403struct _GdkGeometry
404{
405 gint min_width;
406 gint min_height;
407 gint max_width;
408 gint max_height;
409 gint base_width;
410 gint base_height;
411 gint width_inc;
412 gint height_inc;
413 gdouble min_aspect;
414 gdouble max_aspect;
415 GdkGravity win_gravity;
416};
417
418typedef struct _GdkWindowClass GdkWindowClass;
419
420#define GDK_TYPE_WINDOW (gdk_window_get_type ())
421#define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
422#define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowClass))
423#define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
424#define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
425#define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowClass))
426
427
428struct _GdkWindowClass
429{
430 GObjectClass parent_class;
431
432 GdkWindow * (* pick_embedded_child) (GdkWindow *window,
433 gdouble x,
434 gdouble y);
435
436 /* the following 3 signals will only be emitted by offscreen windows */
437 void (* to_embedder) (GdkWindow *window,
438 gdouble offscreen_x,
439 gdouble offscreen_y,
440 gdouble *embedder_x,
441 gdouble *embedder_y);
442 void (* from_embedder) (GdkWindow *window,
443 gdouble embedder_x,
444 gdouble embedder_y,
445 gdouble *offscreen_x,
446 gdouble *offscreen_y);
447 cairo_surface_t * (* create_surface) (GdkWindow *window,
448 gint width,
449 gint height);
450
451 /* Padding for future expansion */
452 void (*_gdk_reserved1) (void);
453 void (*_gdk_reserved2) (void);
454 void (*_gdk_reserved3) (void);
455 void (*_gdk_reserved4) (void);
456 void (*_gdk_reserved5) (void);
457 void (*_gdk_reserved6) (void);
458 void (*_gdk_reserved7) (void);
459 void (*_gdk_reserved8) (void);
460};
461
462/* Windows
463 */
464GDK_AVAILABLE_IN_ALL
465GType gdk_window_get_type (void) G_GNUC_CONST;
466GDK_AVAILABLE_IN_ALL
467GdkWindow* gdk_window_new (GdkWindow *parent,
468 GdkWindowAttr *attributes,
469 gint attributes_mask);
470GDK_AVAILABLE_IN_ALL
471void gdk_window_destroy (GdkWindow *window);
472GDK_AVAILABLE_IN_ALL
473GdkWindowType gdk_window_get_window_type (GdkWindow *window);
474GDK_AVAILABLE_IN_ALL
475gboolean gdk_window_is_destroyed (GdkWindow *window);
476
477GDK_AVAILABLE_IN_ALL
478GdkVisual * gdk_window_get_visual (GdkWindow *window);
479GDK_AVAILABLE_IN_ALL
480GdkScreen * gdk_window_get_screen (GdkWindow *window);
481GDK_AVAILABLE_IN_ALL
482GdkDisplay * gdk_window_get_display (GdkWindow *window);
483#ifndef GDK_MULTIDEVICE_SAFE
484GDK_DEPRECATED_IN_3_0_FOR(gdk_device_get_window_at_position)
485GdkWindow* gdk_window_at_pointer (gint *win_x,
486 gint *win_y);
487#endif /* GDK_MULTIDEVICE_SAFE */
488GDK_AVAILABLE_IN_ALL
489void gdk_window_show (GdkWindow *window);
490GDK_AVAILABLE_IN_ALL
491void gdk_window_hide (GdkWindow *window);
492GDK_AVAILABLE_IN_ALL
493void gdk_window_withdraw (GdkWindow *window);
494GDK_AVAILABLE_IN_ALL
495void gdk_window_show_unraised (GdkWindow *window);
496GDK_AVAILABLE_IN_ALL
497void gdk_window_move (GdkWindow *window,
498 gint x,
499 gint y);
500GDK_AVAILABLE_IN_ALL
501void gdk_window_resize (GdkWindow *window,
502 gint width,
503 gint height);
504GDK_AVAILABLE_IN_ALL
505void gdk_window_move_resize (GdkWindow *window,
506 gint x,
507 gint y,
508 gint width,
509 gint height);
510GDK_AVAILABLE_IN_ALL
511void gdk_window_reparent (GdkWindow *window,
512 GdkWindow *new_parent,
513 gint x,
514 gint y);
515GDK_AVAILABLE_IN_ALL
516void gdk_window_raise (GdkWindow *window);
517GDK_AVAILABLE_IN_ALL
518void gdk_window_lower (GdkWindow *window);
519GDK_AVAILABLE_IN_ALL
520void gdk_window_restack (GdkWindow *window,
521 GdkWindow *sibling,
522 gboolean above);
523GDK_AVAILABLE_IN_ALL
524void gdk_window_focus (GdkWindow *window,
525 guint32 timestamp);
526GDK_AVAILABLE_IN_ALL
527void gdk_window_set_user_data (GdkWindow *window,
528 gpointer user_data);
529GDK_AVAILABLE_IN_ALL
530void gdk_window_set_override_redirect (GdkWindow *window,
531 gboolean override_redirect);
532GDK_AVAILABLE_IN_ALL
533gboolean gdk_window_get_accept_focus (GdkWindow *window);
534GDK_AVAILABLE_IN_ALL
535void gdk_window_set_accept_focus (GdkWindow *window,
536 gboolean accept_focus);
537GDK_AVAILABLE_IN_ALL
538gboolean gdk_window_get_focus_on_map (GdkWindow *window);
539GDK_AVAILABLE_IN_ALL
540void gdk_window_set_focus_on_map (GdkWindow *window,
541 gboolean focus_on_map);
542GDK_AVAILABLE_IN_ALL
543void gdk_window_add_filter (GdkWindow *window,
544 GdkFilterFunc function,
545 gpointer data);
546GDK_AVAILABLE_IN_ALL
547void gdk_window_remove_filter (GdkWindow *window,
548 GdkFilterFunc function,
549 gpointer data);
550GDK_AVAILABLE_IN_ALL
551void gdk_window_scroll (GdkWindow *window,
552 gint dx,
553 gint dy);
554GDK_AVAILABLE_IN_ALL
555void gdk_window_move_region (GdkWindow *window,
556 const cairo_region_t *region,
557 gint dx,
558 gint dy);
559GDK_AVAILABLE_IN_ALL
560gboolean gdk_window_ensure_native (GdkWindow *window);
561
562/*
563 * This allows for making shaped (partially transparent) windows
564 * - cool feature, needed for Drag and Drag for example.
565 */
566GDK_AVAILABLE_IN_ALL
567void gdk_window_shape_combine_region (GdkWindow *window,
568 const cairo_region_t *shape_region,
569 gint offset_x,
570 gint offset_y);
571
572/*
573 * This routine allows you to quickly take the shapes of all the child windows
574 * of a window and use their shapes as the shape mask for this window - useful
575 * for container windows that dont want to look like a big box
576 *
577 * - Raster
578 */
579GDK_AVAILABLE_IN_ALL
580void gdk_window_set_child_shapes (GdkWindow *window);
581
582GDK_DEPRECATED_IN_3_16
583gboolean gdk_window_get_composited (GdkWindow *window);
584GDK_DEPRECATED_IN_3_16
585void gdk_window_set_composited (GdkWindow *window,
586 gboolean composited);
587
588/*
589 * This routine allows you to merge (ie ADD) child shapes to your
590 * own window’s shape keeping its current shape and ADDING the child
591 * shapes to it.
592 *
593 * - Raster
594 */
595GDK_AVAILABLE_IN_ALL
596void gdk_window_merge_child_shapes (GdkWindow *window);
597
598GDK_AVAILABLE_IN_ALL
599void gdk_window_input_shape_combine_region (GdkWindow *window,
600 const cairo_region_t *shape_region,
601 gint offset_x,
602 gint offset_y);
603GDK_AVAILABLE_IN_ALL
604void gdk_window_set_child_input_shapes (GdkWindow *window);
605GDK_AVAILABLE_IN_ALL
606void gdk_window_merge_child_input_shapes (GdkWindow *window);
607
608
609GDK_AVAILABLE_IN_3_18
610void gdk_window_set_pass_through (GdkWindow *window,
611 gboolean pass_through);
612GDK_AVAILABLE_IN_3_18
613gboolean gdk_window_get_pass_through (GdkWindow *window);
614
615/*
616 * Check if a window has been shown, and whether all its
617 * parents up to a toplevel have been shown, respectively.
618 * Note that a window that is_viewable below is not necessarily
619 * viewable in the X sense.
620 */
621GDK_AVAILABLE_IN_ALL
622gboolean gdk_window_is_visible (GdkWindow *window);
623GDK_AVAILABLE_IN_ALL
624gboolean gdk_window_is_viewable (GdkWindow *window);
625GDK_AVAILABLE_IN_ALL
626gboolean gdk_window_is_input_only (GdkWindow *window);
627GDK_AVAILABLE_IN_ALL
628gboolean gdk_window_is_shaped (GdkWindow *window);
629
630GDK_AVAILABLE_IN_ALL
631GdkWindowState gdk_window_get_state (GdkWindow *window);
632
633/* Set static bit gravity on the parent, and static
634 * window gravity on all children.
635 */
636GDK_DEPRECATED_IN_3_16
637gboolean gdk_window_set_static_gravities (GdkWindow *window,
638 gboolean use_static);
639
640/* GdkWindow */
641
642/**
643 * GdkWindowInvalidateHandlerFunc:
644 * @window: a #GdkWindow
645 * @region: a #cairo_region_t
646 *
647 * Whenever some area of the window is invalidated (directly in the
648 * window or in a child window) this gets called with @region in
649 * the coordinate space of @window. You can use @region to just
650 * keep track of the dirty region, or you can actually change
651 * @region in case you are doing display tricks like showing
652 * a child in multiple places.
653 *
654 * Since: 3.10
655 */
656typedef void (*GdkWindowInvalidateHandlerFunc) (GdkWindow *window,
657 cairo_region_t *region);
658GDK_AVAILABLE_IN_3_10
659void gdk_window_set_invalidate_handler (GdkWindow *window,
660 GdkWindowInvalidateHandlerFunc handler);
661
662GDK_AVAILABLE_IN_ALL
663gboolean gdk_window_has_native (GdkWindow *window);
664GDK_AVAILABLE_IN_ALL
665void gdk_window_set_type_hint (GdkWindow *window,
666 GdkWindowTypeHint hint);
667GDK_AVAILABLE_IN_ALL
668GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow *window);
669
670GDK_AVAILABLE_IN_ALL
671gboolean gdk_window_get_modal_hint (GdkWindow *window);
672GDK_AVAILABLE_IN_ALL
673void gdk_window_set_modal_hint (GdkWindow *window,
674 gboolean modal);
675
676GDK_AVAILABLE_IN_ALL
677void gdk_window_set_skip_taskbar_hint (GdkWindow *window,
678 gboolean skips_taskbar);
679GDK_AVAILABLE_IN_ALL
680void gdk_window_set_skip_pager_hint (GdkWindow *window,
681 gboolean skips_pager);
682GDK_AVAILABLE_IN_ALL
683void gdk_window_set_urgency_hint (GdkWindow *window,
684 gboolean urgent);
685
686GDK_AVAILABLE_IN_ALL
687void gdk_window_set_geometry_hints (GdkWindow *window,
688 const GdkGeometry *geometry,
689 GdkWindowHints geom_mask);
690
691GDK_AVAILABLE_IN_ALL
692cairo_region_t *gdk_window_get_clip_region (GdkWindow *window);
693GDK_AVAILABLE_IN_ALL
694cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
695
696
697GDK_DEPRECATED_IN_3_22_FOR(gdk_window_begin_draw_frame)
698void gdk_window_begin_paint_rect (GdkWindow *window,
699 const GdkRectangle *rectangle);
700GDK_AVAILABLE_IN_3_16
701void gdk_window_mark_paint_from_clip (GdkWindow *window,
702 cairo_t *cr);
703GDK_DEPRECATED_IN_3_22_FOR(gdk_window_begin_draw_frame)
704void gdk_window_begin_paint_region (GdkWindow *window,
705 const cairo_region_t *region);
706GDK_DEPRECATED_IN_3_22_FOR(gdk_window_end_draw_frame)
707void gdk_window_end_paint (GdkWindow *window);
708
709GDK_AVAILABLE_IN_3_22
710GdkDrawingContext *gdk_window_begin_draw_frame (GdkWindow *window,
711 const cairo_region_t *region);
712GDK_AVAILABLE_IN_3_22
713void gdk_window_end_draw_frame (GdkWindow *window,
714 GdkDrawingContext *context);
715
716GDK_DEPRECATED_IN_3_14
717void gdk_window_flush (GdkWindow *window);
718
719GDK_AVAILABLE_IN_ALL
720void gdk_window_set_title (GdkWindow *window,
721 const gchar *title);
722GDK_AVAILABLE_IN_ALL
723void gdk_window_set_role (GdkWindow *window,
724 const gchar *role);
725GDK_AVAILABLE_IN_ALL
726void gdk_window_set_startup_id (GdkWindow *window,
727 const gchar *startup_id);
728GDK_AVAILABLE_IN_ALL
729void gdk_window_set_transient_for (GdkWindow *window,
730 GdkWindow *parent);
731GDK_DEPRECATED_IN_3_4_FOR(gdk_window_set_background_rgba)
732void gdk_window_set_background (GdkWindow *window,
733 const GdkColor *color);
734GDK_AVAILABLE_IN_ALL
735void gdk_window_set_background_rgba (GdkWindow *window,
736 const GdkRGBA *rgba);
737GDK_AVAILABLE_IN_ALL
738void gdk_window_set_background_pattern (GdkWindow *window,
739 cairo_pattern_t *pattern);
740GDK_AVAILABLE_IN_ALL
741cairo_pattern_t *gdk_window_get_background_pattern (GdkWindow *window);
742
743GDK_AVAILABLE_IN_ALL
744void gdk_window_set_cursor (GdkWindow *window,
745 GdkCursor *cursor);
746GDK_AVAILABLE_IN_ALL
747GdkCursor *gdk_window_get_cursor (GdkWindow *window);
748GDK_AVAILABLE_IN_ALL
749void gdk_window_set_device_cursor (GdkWindow *window,
750 GdkDevice *device,
751 GdkCursor *cursor);
752GDK_AVAILABLE_IN_ALL
753GdkCursor *gdk_window_get_device_cursor (GdkWindow *window,
754 GdkDevice *device);
755GDK_AVAILABLE_IN_ALL
756void gdk_window_get_user_data (GdkWindow *window,
757 gpointer *data);
758GDK_AVAILABLE_IN_ALL
759void gdk_window_get_geometry (GdkWindow *window,
760 gint *x,
761 gint *y,
762 gint *width,
763 gint *height);
764GDK_AVAILABLE_IN_ALL
765int gdk_window_get_width (GdkWindow *window);
766GDK_AVAILABLE_IN_ALL
767int gdk_window_get_height (GdkWindow *window);
768GDK_AVAILABLE_IN_ALL
769void gdk_window_get_position (GdkWindow *window,
770 gint *x,
771 gint *y);
772GDK_AVAILABLE_IN_ALL
773gint gdk_window_get_origin (GdkWindow *window,
774 gint *x,
775 gint *y);
776GDK_AVAILABLE_IN_ALL
777void gdk_window_get_root_coords (GdkWindow *window,
778 gint x,
779 gint y,
780 gint *root_x,
781 gint *root_y);
782GDK_AVAILABLE_IN_ALL
783void gdk_window_coords_to_parent (GdkWindow *window,
784 gdouble x,
785 gdouble y,
786 gdouble *parent_x,
787 gdouble *parent_y);
788GDK_AVAILABLE_IN_ALL
789void gdk_window_coords_from_parent (GdkWindow *window,
790 gdouble parent_x,
791 gdouble parent_y,
792 gdouble *x,
793 gdouble *y);
794
795GDK_AVAILABLE_IN_ALL
796void gdk_window_get_root_origin (GdkWindow *window,
797 gint *x,
798 gint *y);
799GDK_AVAILABLE_IN_ALL
800void gdk_window_get_frame_extents (GdkWindow *window,
801 GdkRectangle *rect);
802
803GDK_AVAILABLE_IN_3_10
804gint gdk_window_get_scale_factor (GdkWindow *window);
805
806#ifndef GDK_MULTIDEVICE_SAFE
807GDK_DEPRECATED_IN_3_0_FOR(gdk_window_get_device_position)
808GdkWindow * gdk_window_get_pointer (GdkWindow *window,
809 gint *x,
810 gint *y,
811 GdkModifierType *mask);
812#endif /* GDK_MULTIDEVICE_SAFE */
813GDK_AVAILABLE_IN_ALL
814GdkWindow * gdk_window_get_device_position (GdkWindow *window,
815 GdkDevice *device,
816 gint *x,
817 gint *y,
818 GdkModifierType *mask);
819GDK_AVAILABLE_IN_3_10
820GdkWindow * gdk_window_get_device_position_double (GdkWindow *window,
821 GdkDevice *device,
822 gdouble *x,
823 gdouble *y,
824 GdkModifierType *mask);
825GDK_AVAILABLE_IN_ALL
826GdkWindow * gdk_window_get_parent (GdkWindow *window);
827GDK_AVAILABLE_IN_ALL
828GdkWindow * gdk_window_get_toplevel (GdkWindow *window);
829
830GDK_AVAILABLE_IN_ALL
831GdkWindow * gdk_window_get_effective_parent (GdkWindow *window);
832GDK_AVAILABLE_IN_ALL
833GdkWindow * gdk_window_get_effective_toplevel (GdkWindow *window);
834
835GDK_AVAILABLE_IN_ALL
836GList * gdk_window_get_children (GdkWindow *window);
837GDK_AVAILABLE_IN_ALL
838GList * gdk_window_peek_children (GdkWindow *window);
839GDK_AVAILABLE_IN_3_10
840GList * gdk_window_get_children_with_user_data (GdkWindow *window,
841 gpointer user_data);
842
843GDK_AVAILABLE_IN_ALL
844GdkEventMask gdk_window_get_events (GdkWindow *window);
845GDK_AVAILABLE_IN_ALL
846void gdk_window_set_events (GdkWindow *window,
847 GdkEventMask event_mask);
848GDK_AVAILABLE_IN_ALL
849void gdk_window_set_device_events (GdkWindow *window,
850 GdkDevice *device,
851 GdkEventMask event_mask);
852GDK_AVAILABLE_IN_ALL
853GdkEventMask gdk_window_get_device_events (GdkWindow *window,
854 GdkDevice *device);
855
856GDK_AVAILABLE_IN_ALL
857void gdk_window_set_source_events (GdkWindow *window,
858 GdkInputSource source,
859 GdkEventMask event_mask);
860GDK_AVAILABLE_IN_ALL
861GdkEventMask gdk_window_get_source_events (GdkWindow *window,
862 GdkInputSource source);
863
864GDK_AVAILABLE_IN_ALL
865void gdk_window_set_icon_list (GdkWindow *window,
866 GList *pixbufs);
867GDK_AVAILABLE_IN_ALL
868void gdk_window_set_icon_name (GdkWindow *window,
869 const gchar *name);
870GDK_AVAILABLE_IN_ALL
871void gdk_window_set_group (GdkWindow *window,
872 GdkWindow *leader);
873GDK_AVAILABLE_IN_ALL
874GdkWindow* gdk_window_get_group (GdkWindow *window);
875GDK_AVAILABLE_IN_ALL
876void gdk_window_set_decorations (GdkWindow *window,
877 GdkWMDecoration decorations);
878GDK_AVAILABLE_IN_ALL
879gboolean gdk_window_get_decorations (GdkWindow *window,
880 GdkWMDecoration *decorations);
881GDK_AVAILABLE_IN_ALL
882void gdk_window_set_functions (GdkWindow *window,
883 GdkWMFunction functions);
884
885GDK_AVAILABLE_IN_ALL
886cairo_surface_t *
887 gdk_window_create_similar_surface (GdkWindow *window,
888 cairo_content_t content,
889 int width,
890 int height);
891GDK_AVAILABLE_IN_3_10
892cairo_surface_t *
893 gdk_window_create_similar_image_surface (GdkWindow *window,
894 cairo_format_t format,
895 int width,
896 int height,
897 int scale);
898
899GDK_AVAILABLE_IN_ALL
900void gdk_window_beep (GdkWindow *window);
901GDK_AVAILABLE_IN_ALL
902void gdk_window_iconify (GdkWindow *window);
903GDK_AVAILABLE_IN_ALL
904void gdk_window_deiconify (GdkWindow *window);
905GDK_AVAILABLE_IN_ALL
906void gdk_window_stick (GdkWindow *window);
907GDK_AVAILABLE_IN_ALL
908void gdk_window_unstick (GdkWindow *window);
909GDK_AVAILABLE_IN_ALL
910void gdk_window_maximize (GdkWindow *window);
911GDK_AVAILABLE_IN_ALL
912void gdk_window_unmaximize (GdkWindow *window);
913GDK_AVAILABLE_IN_ALL
914void gdk_window_fullscreen (GdkWindow *window);
915GDK_AVAILABLE_IN_3_18
916void gdk_window_fullscreen_on_monitor (GdkWindow *window,
917 gint monitor);
918GDK_AVAILABLE_IN_3_8
919void gdk_window_set_fullscreen_mode (GdkWindow *window,
920 GdkFullscreenMode mode);
921GDK_AVAILABLE_IN_3_8
922GdkFullscreenMode
923 gdk_window_get_fullscreen_mode (GdkWindow *window);
924GDK_AVAILABLE_IN_ALL
925void gdk_window_unfullscreen (GdkWindow *window);
926GDK_AVAILABLE_IN_ALL
927void gdk_window_set_keep_above (GdkWindow *window,
928 gboolean setting);
929GDK_AVAILABLE_IN_ALL
930void gdk_window_set_keep_below (GdkWindow *window,
931 gboolean setting);
932GDK_AVAILABLE_IN_ALL
933void gdk_window_set_opacity (GdkWindow *window,
934 gdouble opacity);
935GDK_AVAILABLE_IN_ALL
936void gdk_window_register_dnd (GdkWindow *window);
937
938GDK_AVAILABLE_IN_ALL
939GdkDragProtocol
940 gdk_window_get_drag_protocol(GdkWindow *window,
941 GdkWindow **target);
942
943GDK_AVAILABLE_IN_ALL
944void gdk_window_begin_resize_drag (GdkWindow *window,
945 GdkWindowEdge edge,
946 gint button,
947 gint root_x,
948 gint root_y,
949 guint32 timestamp);
950GDK_AVAILABLE_IN_3_4
951void gdk_window_begin_resize_drag_for_device (GdkWindow *window,
952 GdkWindowEdge edge,
953 GdkDevice *device,
954 gint button,
955 gint root_x,
956 gint root_y,
957 guint32 timestamp);
958GDK_AVAILABLE_IN_ALL
959void gdk_window_begin_move_drag (GdkWindow *window,
960 gint button,
961 gint root_x,
962 gint root_y,
963 guint32 timestamp);
964GDK_AVAILABLE_IN_3_4
965void gdk_window_begin_move_drag_for_device (GdkWindow *window,
966 GdkDevice *device,
967 gint button,
968 gint root_x,
969 gint root_y,
970 guint32 timestamp);
971
972/* Interface for dirty-region queueing */
973GDK_AVAILABLE_IN_ALL
974void gdk_window_invalidate_rect (GdkWindow *window,
975 const GdkRectangle *rect,
976 gboolean invalidate_children);
977GDK_AVAILABLE_IN_ALL
978void gdk_window_invalidate_region (GdkWindow *window,
979 const cairo_region_t *region,
980 gboolean invalidate_children);
981
982/**
983 * GdkWindowChildFunc:
984 * @window: a #GdkWindow
985 * @user_data: user data
986 *
987 * A function of this type is passed to gdk_window_invalidate_maybe_recurse().
988 * It gets called for each child of the window to determine whether to
989 * recursively invalidate it or now.
990 *
991 * Returns: %TRUE to invalidate @window recursively
992 */
993typedef gboolean (*GdkWindowChildFunc) (GdkWindow *window,
994 gpointer user_data);
995
996GDK_AVAILABLE_IN_ALL
997void gdk_window_invalidate_maybe_recurse (GdkWindow *window,
998 const cairo_region_t *region,
999 GdkWindowChildFunc child_func,
1000 gpointer user_data);
1001GDK_AVAILABLE_IN_ALL
1002cairo_region_t *gdk_window_get_update_area (GdkWindow *window);
1003
1004GDK_AVAILABLE_IN_ALL
1005void gdk_window_freeze_updates (GdkWindow *window);
1006GDK_AVAILABLE_IN_ALL
1007void gdk_window_thaw_updates (GdkWindow *window);
1008
1009GDK_DEPRECATED_IN_3_16
1010void gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window);
1011GDK_DEPRECATED_IN_3_16
1012void gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window);
1013
1014GDK_AVAILABLE_IN_ALL
1015void gdk_window_process_all_updates (void);
1016GDK_AVAILABLE_IN_ALL
1017void gdk_window_process_updates (GdkWindow *window,
1018 gboolean update_children);
1019
1020/* Enable/disable flicker, so you can tell if your code is inefficient. */
1021GDK_AVAILABLE_IN_ALL
1022void gdk_window_set_debug_updates (gboolean setting);
1023
1024GDK_AVAILABLE_IN_ALL
1025void gdk_window_constrain_size (GdkGeometry *geometry,
1026 GdkWindowHints flags,
1027 gint width,
1028 gint height,
1029 gint *new_width,
1030 gint *new_height);
1031
1032GDK_DEPRECATED_IN_3_8
1033void gdk_window_enable_synchronized_configure (GdkWindow *window);
1034GDK_DEPRECATED_IN_3_8
1035void gdk_window_configure_finished (GdkWindow *window);
1036
1037GDK_AVAILABLE_IN_ALL
1038GdkWindow *gdk_get_default_root_window (void);
1039
1040/* Offscreen redirection */
1041GDK_AVAILABLE_IN_ALL
1042cairo_surface_t *
1043 gdk_offscreen_window_get_surface (GdkWindow *window);
1044GDK_AVAILABLE_IN_ALL
1045void gdk_offscreen_window_set_embedder (GdkWindow *window,
1046 GdkWindow *embedder);
1047GDK_AVAILABLE_IN_ALL
1048GdkWindow *gdk_offscreen_window_get_embedder (GdkWindow *window);
1049GDK_AVAILABLE_IN_ALL
1050void gdk_window_geometry_changed (GdkWindow *window);
1051
1052/* Multidevice support */
1053GDK_AVAILABLE_IN_ALL
1054void gdk_window_set_support_multidevice (GdkWindow *window,
1055 gboolean support_multidevice);
1056GDK_AVAILABLE_IN_ALL
1057gboolean gdk_window_get_support_multidevice (GdkWindow *window);
1058
1059/* Frame clock */
1060GDK_AVAILABLE_IN_3_8
1061GdkFrameClock* gdk_window_get_frame_clock (GdkWindow *window);
1062
1063GDK_AVAILABLE_IN_3_10
1064void gdk_window_set_opaque_region (GdkWindow *window,
1065 cairo_region_t *region);
1066
1067GDK_AVAILABLE_IN_3_12
1068void gdk_window_set_event_compression (GdkWindow *window,
1069 gboolean event_compression);
1070GDK_AVAILABLE_IN_3_12
1071gboolean gdk_window_get_event_compression (GdkWindow *window);
1072
1073GDK_AVAILABLE_IN_3_12
1074void gdk_window_set_shadow_width (GdkWindow *window,
1075 gint left,
1076 gint right,
1077 gint top,
1078 gint bottom);
1079GDK_AVAILABLE_IN_3_14
1080gboolean gdk_window_show_window_menu (GdkWindow *window,
1081 GdkEvent *event);
1082
1083GDK_AVAILABLE_IN_3_16
1084GdkGLContext * gdk_window_create_gl_context (GdkWindow *window,
1085 GError **error);
1086
1087G_END_DECLS
1088
1089#endif /* __GDK_WINDOW_H__ */
1090