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