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