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