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