]> Pileus Git - ~andy/gtk/blob - gdk/gdkwindow.h
Merge branch 'master' into broadway2
[~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/gdktypes.h>
35 #include <gdk/gdkevents.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,
57   GDK_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  * GdkWindowAttr:
322  * @title: title of the window (for toplevel windows)
323  * @event_mask: event mask (see gdk_window_set_events())
324  * @x: X coordinate relative to parent window (see gdk_window_move())
325  * @y: Y coordinate relative to parent window (see gdk_window_move())
326  * @width: width of window
327  * @height: height of window
328  * @wclass: #GDK_INPUT_OUTPUT (normal window) or #GDK_INPUT_ONLY (invisible
329  *  window that receives events)
330  * @visual: #GdkVisual for window
331  * @window_type: type of window
332  * @cursor: cursor for the window (see gdk_window_set_cursor())
333  * @wmclass_name: don't use (see gtk_window_set_wmclass())
334  * @wmclass_class: don't use (see gtk_window_set_wmclass())
335  * @override_redirect: %TRUE to bypass the window manager
336  * @type_hint: a hint of the function of the window
337  *
338  * Attributes to use for a newly-created window.
339  */
340 struct _GdkWindowAttr
341 {
342   gchar *title;
343   gint event_mask;
344   gint x, y;
345   gint width;
346   gint height;
347   GdkWindowWindowClass wclass;
348   GdkVisual *visual;
349   GdkWindowType window_type;
350   GdkCursor *cursor;
351   gchar *wmclass_name;
352   gchar *wmclass_class;
353   gboolean override_redirect;
354   GdkWindowTypeHint type_hint;
355 };
356
357 /**
358  * GdkGeometry:
359  * @min_width: minimum width of window (or -1 to use requisition, with
360  *  #GtkWindow only)
361  * @min_height: minimum height of window (or -1 to use requisition, with
362  *  #GtkWindow only)
363  * @max_width: maximum width of window (or -1 to use requisition, with
364  *  #GtkWindow only)
365  * @max_height: maximum height of window (or -1 to use requisition, with
366  *  #GtkWindow only)
367  * @base_width: allowed window widths are @base_width + @width_inc * N where N
368  *  is any integer (-1 allowed with #GtkWindow)
369  * @base_height: allowed window widths are @base_height + @height_inc * N where
370  *  N is any integer (-1 allowed with #GtkWindow)
371  * @width_inc: width resize increment
372  * @height_inc: height resize increment
373  * @min_aspect: minimum width/height ratio
374  * @max_aspect: maximum width/height ratio
375  * @win_gravity: window gravity, see gtk_window_set_gravity()
376  *
377  * The #GdkGeometry struct gives the window manager information about
378  * a window's geometry constraints. Normally you would set these on
379  * the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow
380  * then sets the hints on the #GdkWindow it creates.
381  *
382  * gdk_window_set_geometry_hints() expects the hints to be fully valid already
383  * and simply passes them to the window manager; in contrast,
384  * gtk_window_set_geometry_hints() performs some interpretation. For example,
385  * #GtkWindow will apply the hints to the geometry widget instead of the
386  * toplevel window, if you set a geometry widget. Also, the
387  * @min_width/@min_height/@max_width/@max_height fields may be set to -1, and
388  * #GtkWindow will substitute the size request of the window or geometry widget.
389  * If the minimum size hint is not provided, #GtkWindow will use its requisition
390  * as the minimum size. If the minimum size is provided and a geometry widget is
391  * set, #GtkWindow will take the minimum size as the minimum size of the
392  * geometry widget rather than the entire window. The base size is treated
393  * similarly.
394  *
395  * The canonical use-case for gtk_window_set_geometry_hints() is to get a
396  * terminal widget to resize properly. Here, the terminal text area should be
397  * the geometry widget; #GtkWindow will then automatically set the base size to
398  * the size of other widgets in the terminal window, such as the menubar and
399  * scrollbar. Then, the @width_inc and @height_inc fields should be set to the
400  * size of one character in the terminal. Finally, the base size should be set
401  * to the size of one character. The net effect is that the minimum size of the
402  * terminal will have a 1x1 character terminal area, and only terminal sizes on
403  * the "character grid" will be allowed.
404  *
405  * Here's an example of how the terminal example would be implemented, assuming
406  * a terminal area widget called "terminal" and a toplevel window "toplevel":
407  *
408  * <informalexample><programlisting><![CDATA[
409  *      GdkGeometry hints;
410  *
411  *      hints.base_width = terminal->char_width;
412  *         hints.base_height = terminal->char_height;
413  *         hints.min_width = terminal->char_width;
414  *         hints.min_height = terminal->char_height;
415  *         hints.width_inc = terminal->char_width;
416  *         hints.height_inc = terminal->char_height;
417  *
418  *  gtk_window_set_geometry_hints (GTK_WINDOW (toplevel),
419  *                                 GTK_WIDGET (terminal),
420  *                                 &hints,
421  *                                 GDK_HINT_RESIZE_INC |
422  *                                 GDK_HINT_MIN_SIZE |
423  *                                 GDK_HINT_BASE_SIZE);
424  * ]]></programlisting></informalexample>
425  *
426  * The other useful fields are the @min_aspect and @max_aspect fields; these
427  * contain a width/height ratio as a floating point number. If a geometry widget
428  * is set, the aspect applies to the geometry widget rather than the entire
429  * window. The most common use of these hints is probably to set @min_aspect and
430  * @max_aspect to the same value, thus forcing the window to keep a constant
431  * aspect ratio.
432  */
433 struct _GdkGeometry
434 {
435   gint min_width;
436   gint min_height;
437   gint max_width;
438   gint max_height;
439   gint base_width;
440   gint base_height;
441   gint width_inc;
442   gint height_inc;
443   gdouble min_aspect;
444   gdouble max_aspect;
445   GdkGravity win_gravity;
446 };
447
448 typedef struct _GdkWindowClass GdkWindowClass;
449
450 #define GDK_TYPE_WINDOW              (gdk_window_get_type ())
451 #define GDK_WINDOW(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
452 #define GDK_WINDOW_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowClass))
453 #define GDK_IS_WINDOW(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
454 #define GDK_IS_WINDOW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
455 #define GDK_WINDOW_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowClass))
456
457
458 struct _GdkWindowClass
459 {
460   GObjectClass      parent_class;
461
462   GdkWindow       * (* pick_embedded_child) (GdkWindow *window,
463                                              gdouble    x,
464                                              gdouble    y);
465
466   /*  the following 3 signals will only be emitted by offscreen windows */
467   void              (* to_embedder)         (GdkWindow *window,
468                                              gdouble    offscreen_x,
469                                              gdouble    offscreen_y,
470                                              gdouble   *embedder_x,
471                                              gdouble   *embedder_y);
472   void              (* from_embedder)       (GdkWindow *window,
473                                              gdouble    embedder_x,
474                                              gdouble    embedder_y,
475                                              gdouble   *offscreen_x,
476                                              gdouble   *offscreen_y);
477   cairo_surface_t * (* create_surface)      (GdkWindow *window,
478                                              gint       width,
479                                              gint       height);
480
481   /* Padding for future expansion */
482   void (*_gdk_reserved1) (void);
483   void (*_gdk_reserved2) (void);
484   void (*_gdk_reserved3) (void);
485   void (*_gdk_reserved4) (void);
486   void (*_gdk_reserved5) (void);
487   void (*_gdk_reserved6) (void);
488   void (*_gdk_reserved7) (void);
489   void (*_gdk_reserved8) (void);
490 };
491
492 /* Windows
493  */
494 GType         gdk_window_get_type              (void) G_GNUC_CONST;
495 GdkWindow*    gdk_window_new                   (GdkWindow     *parent,
496                                                 GdkWindowAttr *attributes,
497                                                 gint           attributes_mask);
498 void          gdk_window_destroy               (GdkWindow     *window);
499 GdkWindowType gdk_window_get_window_type       (GdkWindow     *window);
500 gboolean      gdk_window_is_destroyed          (GdkWindow     *window);
501
502 GdkVisual *   gdk_window_get_visual            (GdkWindow     *window);
503 GdkScreen *   gdk_window_get_screen            (GdkWindow     *window);
504 GdkDisplay *  gdk_window_get_display           (GdkWindow     *window);
505 #ifndef GDK_MULTIDEVICE_SAFE
506 GdkWindow*    gdk_window_at_pointer            (gint          *win_x,
507                                                 gint          *win_y);
508 #endif /* GDK_MULTIDEVICE_SAFE */
509 void          gdk_window_show                  (GdkWindow     *window);
510 void          gdk_window_hide                  (GdkWindow     *window);
511 void          gdk_window_withdraw              (GdkWindow     *window);
512 void          gdk_window_show_unraised         (GdkWindow     *window);
513 void          gdk_window_move                  (GdkWindow     *window,
514                                                 gint           x,
515                                                 gint           y);
516 void          gdk_window_resize                (GdkWindow     *window,
517                                                 gint           width,
518                                                 gint           height);
519 void          gdk_window_move_resize           (GdkWindow     *window,
520                                                 gint           x,
521                                                 gint           y,
522                                                 gint           width,
523                                                 gint           height);
524 void          gdk_window_reparent              (GdkWindow     *window,
525                                                 GdkWindow     *new_parent,
526                                                 gint           x,
527                                                 gint           y);
528 void          gdk_window_raise                 (GdkWindow     *window);
529 void          gdk_window_lower                 (GdkWindow     *window);
530 void          gdk_window_restack               (GdkWindow     *window,
531                                                 GdkWindow     *sibling,
532                                                 gboolean       above);
533 void          gdk_window_focus                 (GdkWindow     *window,
534                                                 guint32        timestamp);
535 void          gdk_window_set_user_data         (GdkWindow     *window,
536                                                 gpointer       user_data);
537 void          gdk_window_set_override_redirect (GdkWindow     *window,
538                                                 gboolean       override_redirect);
539 gboolean      gdk_window_get_accept_focus      (GdkWindow     *window);
540 void          gdk_window_set_accept_focus      (GdkWindow     *window,
541                                                 gboolean       accept_focus);
542 gboolean      gdk_window_get_focus_on_map      (GdkWindow     *window);
543 void          gdk_window_set_focus_on_map      (GdkWindow     *window,
544                                                 gboolean       focus_on_map);
545 void          gdk_window_add_filter            (GdkWindow     *window,
546                                                 GdkFilterFunc  function,
547                                                 gpointer       data);
548 void          gdk_window_remove_filter         (GdkWindow     *window,
549                                                 GdkFilterFunc  function,
550                                                 gpointer       data);
551 void          gdk_window_scroll                (GdkWindow     *window,
552                                                 gint           dx,
553                                                 gint           dy);
554 void          gdk_window_move_region           (GdkWindow       *window,
555                                                 const cairo_region_t *region,
556                                                 gint             dx,
557                                                 gint             dy);
558 gboolean      gdk_window_ensure_native        (GdkWindow       *window);
559
560 /* 
561  * This allows for making shaped (partially transparent) windows
562  * - cool feature, needed for Drag and Drag for example.
563  */
564 void gdk_window_shape_combine_region (GdkWindow       *window,
565                                       const cairo_region_t *shape_region,
566                                       gint             offset_x,
567                                       gint             offset_y);
568
569 /*
570  * This routine allows you to quickly take the shapes of all the child windows
571  * of a window and use their shapes as the shape mask for this window - useful
572  * for container windows that dont want to look like a big box
573  * 
574  * - Raster
575  */
576 void gdk_window_set_child_shapes (GdkWindow *window);
577
578 gboolean gdk_window_get_composited (GdkWindow *window);
579 void gdk_window_set_composited   (GdkWindow *window,
580                                   gboolean   composited);
581
582 /*
583  * This routine allows you to merge (ie ADD) child shapes to your
584  * own window's shape keeping its current shape and ADDING the child
585  * shapes to it.
586  * 
587  * - Raster
588  */
589 void gdk_window_merge_child_shapes         (GdkWindow       *window);
590
591 void gdk_window_input_shape_combine_region (GdkWindow       *window,
592                                             const cairo_region_t *shape_region,
593                                             gint             offset_x,
594                                             gint             offset_y);
595 void gdk_window_set_child_input_shapes     (GdkWindow       *window);
596 void gdk_window_merge_child_input_shapes   (GdkWindow       *window);
597
598
599 /*
600  * Check if a window has been shown, and whether all its
601  * parents up to a toplevel have been shown, respectively.
602  * Note that a window that is_viewable below is not necessarily
603  * viewable in the X sense.
604  */
605 gboolean gdk_window_is_visible     (GdkWindow *window);
606 gboolean gdk_window_is_viewable    (GdkWindow *window);
607 gboolean gdk_window_is_input_only  (GdkWindow *window);
608 gboolean gdk_window_is_shaped      (GdkWindow *window);
609
610 GdkWindowState gdk_window_get_state (GdkWindow *window);
611
612 /* Set static bit gravity on the parent, and static
613  * window gravity on all children.
614  */
615 gboolean gdk_window_set_static_gravities (GdkWindow *window,
616                                           gboolean   use_static);
617
618 /* GdkWindow */
619
620 gboolean      gdk_window_has_native         (GdkWindow       *window);
621 void              gdk_window_set_type_hint (GdkWindow        *window,
622                                             GdkWindowTypeHint hint);
623 GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow        *window);
624
625 gboolean      gdk_window_get_modal_hint   (GdkWindow       *window);
626 void          gdk_window_set_modal_hint   (GdkWindow       *window,
627                                            gboolean         modal);
628
629 void gdk_window_set_skip_taskbar_hint (GdkWindow *window,
630                                        gboolean   skips_taskbar);
631 void gdk_window_set_skip_pager_hint   (GdkWindow *window,
632                                        gboolean   skips_pager);
633 void gdk_window_set_urgency_hint      (GdkWindow *window,
634                                        gboolean   urgent);
635
636 void          gdk_window_set_geometry_hints (GdkWindow          *window,
637                                              const GdkGeometry  *geometry,
638                                              GdkWindowHints      geom_mask);
639
640 cairo_region_t *gdk_window_get_clip_region  (GdkWindow          *window);
641 cairo_region_t *gdk_window_get_visible_region(GdkWindow         *window);
642
643
644 void          gdk_window_begin_paint_rect   (GdkWindow          *window,
645                                              const GdkRectangle *rectangle);
646 void          gdk_window_begin_paint_region (GdkWindow          *window,
647                                              const cairo_region_t    *region);
648 void          gdk_window_end_paint          (GdkWindow          *window);
649 void          gdk_window_flush             (GdkWindow          *window);
650
651 void          gdk_window_set_title         (GdkWindow     *window,
652                                             const gchar   *title);
653 void          gdk_window_set_role          (GdkWindow     *window,
654                                             const gchar   *role);
655 void          gdk_window_set_startup_id    (GdkWindow     *window,
656                                             const gchar   *startup_id);
657 void          gdk_window_set_transient_for (GdkWindow     *window,
658                                             GdkWindow     *parent);
659 void          gdk_window_set_background  (GdkWindow       *window,
660                                           const GdkColor  *color);
661 void          gdk_window_set_background_rgba (GdkWindow *window,
662                                               GdkRGBA   *rgba);
663 void          gdk_window_set_background_pattern (GdkWindow       *window,
664                                                  cairo_pattern_t *pattern);
665 cairo_pattern_t *gdk_window_get_background_pattern (GdkWindow     *window);
666
667 void          gdk_window_set_cursor      (GdkWindow       *window,
668                                           GdkCursor       *cursor);
669 GdkCursor    *gdk_window_get_cursor      (GdkWindow       *window);
670 void          gdk_window_set_device_cursor (GdkWindow     *window,
671                                             GdkDevice     *device,
672                                             GdkCursor     *cursor);
673 GdkCursor    *gdk_window_get_device_cursor (GdkWindow     *window,
674                                             GdkDevice     *device);
675 void          gdk_window_get_user_data   (GdkWindow       *window,
676                                           gpointer        *data);
677 void          gdk_window_get_geometry    (GdkWindow       *window,
678                                           gint            *x,
679                                           gint            *y,
680                                           gint            *width,
681                                           gint            *height);
682 int           gdk_window_get_width       (GdkWindow       *window);
683 int           gdk_window_get_height      (GdkWindow       *window);
684 void          gdk_window_get_position    (GdkWindow       *window,
685                                           gint            *x,
686                                           gint            *y);
687 gint          gdk_window_get_origin      (GdkWindow       *window,
688                                           gint            *x,
689                                           gint            *y);
690 void          gdk_window_get_root_coords (GdkWindow       *window,
691                                           gint             x,
692                                           gint             y,
693                                           gint            *root_x,
694                                           gint            *root_y);
695 void       gdk_window_coords_to_parent   (GdkWindow       *window,
696                                           gdouble          x,
697                                           gdouble          y,
698                                           gdouble         *parent_x,
699                                           gdouble         *parent_y);
700 void       gdk_window_coords_from_parent (GdkWindow       *window,
701                                           gdouble          parent_x,
702                                           gdouble          parent_y,
703                                           gdouble         *x,
704                                           gdouble         *y);
705
706 void          gdk_window_get_root_origin (GdkWindow       *window,
707                                           gint            *x,
708                                           gint            *y);
709 void          gdk_window_get_frame_extents (GdkWindow     *window,
710                                             GdkRectangle  *rect);
711
712 #ifndef GDK_MULTIDEVICE_SAFE
713 GdkWindow*    gdk_window_get_pointer     (GdkWindow       *window,
714                                           gint            *x,
715                                           gint            *y,
716                                           GdkModifierType *mask);
717 #endif /* GDK_MULTIDEVICE_SAFE */
718 GdkWindow *   gdk_window_get_device_position (GdkWindow       *window,
719                                               GdkDevice       *device,
720                                               gint            *x,
721                                               gint            *y,
722                                               GdkModifierType *mask);
723 GdkWindow *   gdk_window_get_parent      (GdkWindow       *window);
724 GdkWindow *   gdk_window_get_toplevel    (GdkWindow       *window);
725
726 GdkWindow *   gdk_window_get_effective_parent   (GdkWindow *window);
727 GdkWindow *   gdk_window_get_effective_toplevel (GdkWindow *window);
728
729 GList *       gdk_window_get_children    (GdkWindow       *window);
730 GList *       gdk_window_peek_children   (GdkWindow       *window);
731 GdkEventMask  gdk_window_get_events      (GdkWindow       *window);
732 void          gdk_window_set_events      (GdkWindow       *window,
733                                           GdkEventMask     event_mask);
734 void          gdk_window_set_device_events (GdkWindow    *window,
735                                             GdkDevice    *device,
736                                             GdkEventMask  event_mask);
737 GdkEventMask  gdk_window_get_device_events (GdkWindow    *window,
738                                             GdkDevice    *device);
739
740 void          gdk_window_set_source_events (GdkWindow      *window,
741                                             GdkInputSource  source,
742                                             GdkEventMask    event_mask);
743 GdkEventMask  gdk_window_get_source_events (GdkWindow      *window,
744                                             GdkInputSource  source);
745
746 void          gdk_window_set_icon_list   (GdkWindow       *window,
747                                           GList           *pixbufs);
748 void          gdk_window_set_icon_name   (GdkWindow       *window, 
749                                           const gchar     *name);
750 void          gdk_window_set_group       (GdkWindow       *window, 
751                                           GdkWindow       *leader);
752 GdkWindow*    gdk_window_get_group       (GdkWindow       *window);
753 void          gdk_window_set_decorations (GdkWindow       *window,
754                                           GdkWMDecoration  decorations);
755 gboolean      gdk_window_get_decorations (GdkWindow       *window,
756                                           GdkWMDecoration *decorations);
757 void          gdk_window_set_functions   (GdkWindow       *window,
758                                           GdkWMFunction    functions);
759
760 cairo_surface_t *
761               gdk_window_create_similar_surface (GdkWindow *window,
762                                           cairo_content_t  content,
763                                           int              width,
764                                           int              height);
765
766 void          gdk_window_beep            (GdkWindow       *window);
767 void          gdk_window_iconify         (GdkWindow       *window);
768 void          gdk_window_deiconify       (GdkWindow       *window);
769 void          gdk_window_stick           (GdkWindow       *window);
770 void          gdk_window_unstick         (GdkWindow       *window);
771 void          gdk_window_maximize        (GdkWindow       *window);
772 void          gdk_window_unmaximize      (GdkWindow       *window);
773 void          gdk_window_fullscreen      (GdkWindow       *window);
774 void          gdk_window_unfullscreen    (GdkWindow       *window);
775 void          gdk_window_set_keep_above  (GdkWindow       *window,
776                                           gboolean         setting);
777 void          gdk_window_set_keep_below  (GdkWindow       *window,
778                                           gboolean         setting);
779 void          gdk_window_set_opacity     (GdkWindow       *window,
780                                           gdouble          opacity);
781 void          gdk_window_register_dnd    (GdkWindow       *window);
782
783 void gdk_window_begin_resize_drag (GdkWindow     *window,
784                                    GdkWindowEdge  edge,
785                                    gint           button,
786                                    gint           root_x,
787                                    gint           root_y,
788                                    guint32        timestamp);
789 void gdk_window_begin_move_drag   (GdkWindow     *window,
790                                    gint           button,
791                                    gint           root_x,
792                                    gint           root_y,
793                                    guint32        timestamp);
794
795 /* Interface for dirty-region queueing */
796 void       gdk_window_invalidate_rect           (GdkWindow          *window,
797                                                  const GdkRectangle *rect,
798                                                  gboolean            invalidate_children);
799 void       gdk_window_invalidate_region         (GdkWindow          *window,
800                                                  const cairo_region_t    *region,
801                                                  gboolean            invalidate_children);
802
803 /**
804  * GdkWindowChildFunc:
805  * @window: a #GdkWindow
806  * @user_data: user data
807  *
808  * A function of this type is passed to gdk_window_invalidate_maybe_recurse().
809  * It gets called for each child of the window to determine whether to
810  * recursively invalidate it or now.
811  *
812  * Returns: %TRUE to invalidate @window recursively
813  */
814 typedef gboolean (*GdkWindowChildFunc)          (GdkWindow *window,
815                                                  gpointer   user_data);
816
817 void       gdk_window_invalidate_maybe_recurse  (GdkWindow            *window,
818                                                  const cairo_region_t *region,
819                                                  GdkWindowChildFunc    child_func,
820                                                  gpointer              user_data);
821 cairo_region_t *gdk_window_get_update_area      (GdkWindow            *window);
822
823 void       gdk_window_freeze_updates      (GdkWindow    *window);
824 void       gdk_window_thaw_updates        (GdkWindow    *window);
825
826 void       gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window);
827 void       gdk_window_thaw_toplevel_updates_libgtk_only   (GdkWindow *window);
828
829 void       gdk_window_process_all_updates (void);
830 void       gdk_window_process_updates     (GdkWindow    *window,
831                                            gboolean      update_children);
832
833 /* Enable/disable flicker, so you can tell if your code is inefficient. */
834 void       gdk_window_set_debug_updates   (gboolean      setting);
835
836 void       gdk_window_constrain_size      (GdkGeometry  *geometry,
837                                            guint         flags,
838                                            gint          width,
839                                            gint          height,
840                                            gint         *new_width,
841                                            gint         *new_height);
842
843 void gdk_window_enable_synchronized_configure (GdkWindow *window);
844 void gdk_window_configure_finished            (GdkWindow *window);
845
846 GdkWindow *gdk_get_default_root_window (void);
847
848 /* Offscreen redirection */
849 cairo_surface_t *
850            gdk_offscreen_window_get_surface    (GdkWindow     *window);
851 void       gdk_offscreen_window_set_embedder   (GdkWindow     *window,
852                                                 GdkWindow     *embedder);
853 GdkWindow *gdk_offscreen_window_get_embedder   (GdkWindow     *window);
854 void       gdk_window_geometry_changed         (GdkWindow     *window);
855
856 /* Multidevice support */
857 void       gdk_window_set_support_multidevice (GdkWindow *window,
858                                                gboolean   support_multidevice);
859 gboolean   gdk_window_get_support_multidevice (GdkWindow *window);
860
861 G_END_DECLS
862
863 #endif /* __GDK_WINDOW_H__ */