]> Pileus Git - ~andy/gtk/blob - gdk/gdkwindow.h
API: Rename GdkWindowClass to GdkWindowWindowClass
[~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 _GdkPointerHooks      GdkPointerHooks;
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,
58   GDK_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 /**
450  * GdkPointerHooks:
451  * @get_pointer: Obtains the current pointer position and modifier state.
452  *  The position is given in coordinates relative to the window containing
453  *  the pointer, which is returned in @window.
454  * @window_at_pointer: Obtains the window underneath the mouse pointer,
455  *  returning the location of that window in @win_x, @win_y. Returns %NULL
456  *  if the window under the mouse pointer is not known to GDK (for example,
457  *  belongs to another application).
458  *
459  * A table of pointers to functions for getting quantities related to
460  * the current pointer position. GDK has one global table of this type,
461  * which can be set using gdk_set_pointer_hooks().
462  *
463  * This is only useful for such low-level tools as an event recorder.
464  * Applications should never have any reason to use this facility
465  */
466 struct _GdkPointerHooks 
467 {
468   GdkWindow* (*get_pointer)       (GdkWindow       *window,
469                                    gint            *x,
470                                    gint            *y,
471                                    GdkModifierType *mask);
472   GdkWindow* (*window_at_pointer) (GdkScreen       *screen, /* unused */
473                                    gint            *win_x,
474                                    gint            *win_y);
475 };
476
477 typedef struct _GdkWindowObject GdkWindowObject;
478 typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
479
480 #define GDK_TYPE_WINDOW              (gdk_window_get_type ())
481 #define GDK_WINDOW(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
482 #define GDK_WINDOW_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowObjectClass))
483 #define GDK_IS_WINDOW(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
484 #define GDK_IS_WINDOW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
485 #define GDK_WINDOW_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
486
487
488 struct _GdkWindowObjectClass
489 {
490   GObjectClass      parent_class;
491
492   GdkWindow       * (* pick_embedded_child) (GdkWindow *window,
493                                              gdouble    x,
494                                              gdouble    y);
495
496   /*  the following 3 signals will only be emitted by offscreen windows */
497   void              (* to_embedder)         (GdkWindow *window,
498                                              gdouble    offscreen_x,
499                                              gdouble    offscreen_y,
500                                              gdouble   *embedder_x,
501                                              gdouble   *embedder_y);
502   void              (* from_embedder)       (GdkWindow *window,
503                                              gdouble    embedder_x,
504                                              gdouble    embedder_y,
505                                              gdouble   *offscreen_x,
506                                              gdouble   *offscreen_y);
507   cairo_surface_t * (* create_surface)      (GdkWindow *window,
508                                              gint       width,
509                                              gint       height);
510
511   /* Padding for future expansion */
512   void (*_gdk_reserved1) (void);
513   void (*_gdk_reserved2) (void);
514   void (*_gdk_reserved3) (void);
515   void (*_gdk_reserved4) (void);
516   void (*_gdk_reserved5) (void);
517   void (*_gdk_reserved6) (void);
518   void (*_gdk_reserved7) (void);
519   void (*_gdk_reserved8) (void);
520 };
521
522 /* Windows
523  */
524 GType         gdk_window_get_type              (void) G_GNUC_CONST;
525 GdkWindow*    gdk_window_new                   (GdkWindow     *parent,
526                                                 GdkWindowAttr *attributes,
527                                                 gint           attributes_mask);
528 void          gdk_window_destroy               (GdkWindow     *window);
529 GdkWindowType gdk_window_get_window_type       (GdkWindow     *window);
530 gboolean      gdk_window_is_destroyed          (GdkWindow     *window);
531
532 GdkVisual *   gdk_window_get_visual            (GdkWindow     *window);
533 GdkScreen *   gdk_window_get_screen            (GdkWindow     *window);
534 GdkDisplay *  gdk_window_get_display           (GdkWindow     *window);
535 #ifndef GDK_MULTIDEVICE_SAFE
536 GdkWindow*    gdk_window_at_pointer            (gint          *win_x,
537                                                 gint          *win_y);
538 #endif /* GDK_MULTIDEVICE_SAFE */
539 void          gdk_window_show                  (GdkWindow     *window);
540 void          gdk_window_hide                  (GdkWindow     *window);
541 void          gdk_window_withdraw              (GdkWindow     *window);
542 void          gdk_window_show_unraised         (GdkWindow     *window);
543 void          gdk_window_move                  (GdkWindow     *window,
544                                                 gint           x,
545                                                 gint           y);
546 void          gdk_window_resize                (GdkWindow     *window,
547                                                 gint           width,
548                                                 gint           height);
549 void          gdk_window_move_resize           (GdkWindow     *window,
550                                                 gint           x,
551                                                 gint           y,
552                                                 gint           width,
553                                                 gint           height);
554 void          gdk_window_reparent              (GdkWindow     *window,
555                                                 GdkWindow     *new_parent,
556                                                 gint           x,
557                                                 gint           y);
558 void          gdk_window_raise                 (GdkWindow     *window);
559 void          gdk_window_lower                 (GdkWindow     *window);
560 void          gdk_window_restack               (GdkWindow     *window,
561                                                 GdkWindow     *sibling,
562                                                 gboolean       above);
563 void          gdk_window_focus                 (GdkWindow     *window,
564                                                 guint32        timestamp);
565 void          gdk_window_set_user_data         (GdkWindow     *window,
566                                                 gpointer       user_data);
567 void          gdk_window_set_override_redirect (GdkWindow     *window,
568                                                 gboolean       override_redirect);
569 gboolean      gdk_window_get_accept_focus      (GdkWindow     *window);
570 void          gdk_window_set_accept_focus      (GdkWindow     *window,
571                                                 gboolean       accept_focus);
572 gboolean      gdk_window_get_focus_on_map      (GdkWindow     *window);
573 void          gdk_window_set_focus_on_map      (GdkWindow     *window,
574                                                 gboolean       focus_on_map);
575 void          gdk_window_add_filter            (GdkWindow     *window,
576                                                 GdkFilterFunc  function,
577                                                 gpointer       data);
578 void          gdk_window_remove_filter         (GdkWindow     *window,
579                                                 GdkFilterFunc  function,
580                                                 gpointer       data);
581 void          gdk_window_scroll                (GdkWindow     *window,
582                                                 gint           dx,
583                                                 gint           dy);
584 void          gdk_window_move_region           (GdkWindow       *window,
585                                                 const cairo_region_t *region,
586                                                 gint             dx,
587                                                 gint             dy);
588 gboolean      gdk_window_ensure_native        (GdkWindow       *window);
589
590 /* 
591  * This allows for making shaped (partially transparent) windows
592  * - cool feature, needed for Drag and Drag for example.
593  */
594 void gdk_window_shape_combine_region (GdkWindow       *window,
595                                       const cairo_region_t *shape_region,
596                                       gint             offset_x,
597                                       gint             offset_y);
598
599 /*
600  * This routine allows you to quickly take the shapes of all the child windows
601  * of a window and use their shapes as the shape mask for this window - useful
602  * for container windows that dont want to look like a big box
603  * 
604  * - Raster
605  */
606 void gdk_window_set_child_shapes (GdkWindow *window);
607
608 gboolean gdk_window_get_composited (GdkWindow *window);
609 void gdk_window_set_composited   (GdkWindow *window,
610                                   gboolean   composited);
611
612 /*
613  * This routine allows you to merge (ie ADD) child shapes to your
614  * own window's shape keeping its current shape and ADDING the child
615  * shapes to it.
616  * 
617  * - Raster
618  */
619 void gdk_window_merge_child_shapes         (GdkWindow       *window);
620
621 void gdk_window_input_shape_combine_region (GdkWindow       *window,
622                                             const cairo_region_t *shape_region,
623                                             gint             offset_x,
624                                             gint             offset_y);
625 void gdk_window_set_child_input_shapes     (GdkWindow       *window);
626 void gdk_window_merge_child_input_shapes   (GdkWindow       *window);
627
628
629 /*
630  * Check if a window has been shown, and whether all its
631  * parents up to a toplevel have been shown, respectively.
632  * Note that a window that is_viewable below is not necessarily
633  * viewable in the X sense.
634  */
635 gboolean gdk_window_is_visible     (GdkWindow *window);
636 gboolean gdk_window_is_viewable    (GdkWindow *window);
637 gboolean gdk_window_is_input_only  (GdkWindow *window);
638 gboolean gdk_window_is_shaped      (GdkWindow *window);
639
640 GdkWindowState gdk_window_get_state (GdkWindow *window);
641
642 /* Set static bit gravity on the parent, and static
643  * window gravity on all children.
644  */
645 gboolean gdk_window_set_static_gravities (GdkWindow *window,
646                                           gboolean   use_static);   
647
648 /* Functions to create/lookup windows from their native equivalents */ 
649 #ifndef GDK_MULTIHEAD_SAFE
650 GdkWindow*    gdk_window_foreign_new (GdkNativeWindow anid);
651 GdkWindow*    gdk_window_lookup      (GdkNativeWindow anid);
652 #endif
653 GdkWindow    *gdk_window_foreign_new_for_display (GdkDisplay      *display,
654                                                   GdkNativeWindow  anid);
655 GdkWindow*    gdk_window_lookup_for_display (GdkDisplay      *display,
656                                              GdkNativeWindow  anid);
657
658
659 /* GdkWindow */
660
661 gboolean      gdk_window_has_native         (GdkWindow       *window);
662 void              gdk_window_set_type_hint (GdkWindow        *window,
663                                             GdkWindowTypeHint hint);
664 GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow        *window);
665
666 gboolean      gdk_window_get_modal_hint   (GdkWindow       *window);
667 void          gdk_window_set_modal_hint   (GdkWindow       *window,
668                                            gboolean         modal);
669
670 void gdk_window_set_skip_taskbar_hint (GdkWindow *window,
671                                        gboolean   skips_taskbar);
672 void gdk_window_set_skip_pager_hint   (GdkWindow *window,
673                                        gboolean   skips_pager);
674 void gdk_window_set_urgency_hint      (GdkWindow *window,
675                                        gboolean   urgent);
676
677 void          gdk_window_set_geometry_hints (GdkWindow          *window,
678                                              const GdkGeometry  *geometry,
679                                              GdkWindowHints      geom_mask);
680 void          gdk_set_sm_client_id          (const gchar        *sm_client_id);
681
682 cairo_region_t *gdk_window_get_clip_region  (GdkWindow          *window);
683 cairo_region_t *gdk_window_get_visible_region(GdkWindow         *window);
684
685
686 void          gdk_window_begin_paint_rect   (GdkWindow          *window,
687                                              const GdkRectangle *rectangle);
688 void          gdk_window_begin_paint_region (GdkWindow          *window,
689                                              const cairo_region_t    *region);
690 void          gdk_window_end_paint          (GdkWindow          *window);
691 void          gdk_window_flush             (GdkWindow          *window);
692
693 void          gdk_window_set_title         (GdkWindow     *window,
694                                             const gchar   *title);
695 void          gdk_window_set_role          (GdkWindow     *window,
696                                             const gchar   *role);
697 void          gdk_window_set_startup_id    (GdkWindow     *window,
698                                             const gchar   *startup_id);
699 void          gdk_window_set_transient_for (GdkWindow     *window,
700                                             GdkWindow     *parent);
701 void          gdk_window_set_background  (GdkWindow       *window,
702                                           const GdkColor  *color);
703 void          gdk_window_set_background_rgba (GdkWindow *window,
704                                               GdkRGBA   *rgba);
705 void          gdk_window_set_background_pattern (GdkWindow       *window,
706                                                  cairo_pattern_t *pattern);
707 cairo_pattern_t *gdk_window_get_background_pattern (GdkWindow     *window);
708
709 void          gdk_window_set_cursor      (GdkWindow       *window,
710                                           GdkCursor       *cursor);
711 GdkCursor    *gdk_window_get_cursor      (GdkWindow       *window);
712 void          gdk_window_set_device_cursor (GdkWindow     *window,
713                                             GdkDevice     *device,
714                                             GdkCursor     *cursor);
715 GdkCursor    *gdk_window_get_device_cursor (GdkWindow     *window,
716                                             GdkDevice     *device);
717 void          gdk_window_get_user_data   (GdkWindow       *window,
718                                           gpointer        *data);
719 void          gdk_window_get_geometry    (GdkWindow       *window,
720                                           gint            *x,
721                                           gint            *y,
722                                           gint            *width,
723                                           gint            *height,
724                                           gint            *depth);
725 int           gdk_window_get_width       (GdkWindow       *window);
726 int           gdk_window_get_height      (GdkWindow       *window);
727 void          gdk_window_get_position    (GdkWindow       *window,
728                                           gint            *x,
729                                           gint            *y);
730 gint          gdk_window_get_origin      (GdkWindow       *window,
731                                           gint            *x,
732                                           gint            *y);
733 void          gdk_window_get_root_coords (GdkWindow       *window,
734                                           gint             x,
735                                           gint             y,
736                                           gint            *root_x,
737                                           gint            *root_y);
738 void       gdk_window_coords_to_parent   (GdkWindow       *window,
739                                           gdouble          x,
740                                           gdouble          y,
741                                           gdouble         *parent_x,
742                                           gdouble         *parent_y);
743 void       gdk_window_coords_from_parent (GdkWindow       *window,
744                                           gdouble          parent_x,
745                                           gdouble          parent_y,
746                                           gdouble         *x,
747                                           gdouble         *y);
748
749 void          gdk_window_get_root_origin (GdkWindow       *window,
750                                           gint            *x,
751                                           gint            *y);
752 void          gdk_window_get_frame_extents (GdkWindow     *window,
753                                             GdkRectangle  *rect);
754
755 #ifndef GDK_MULTIDEVICE_SAFE
756 GdkWindow*    gdk_window_get_pointer     (GdkWindow       *window,
757                                           gint            *x,
758                                           gint            *y,
759                                           GdkModifierType *mask);
760 #endif /* GDK_MULTIDEVICE_SAFE */
761 GdkWindow *   gdk_window_get_device_position (GdkWindow       *window,
762                                               GdkDevice       *device,
763                                               gint            *x,
764                                               gint            *y,
765                                               GdkModifierType *mask);
766 GdkWindow *   gdk_window_get_parent      (GdkWindow       *window);
767 GdkWindow *   gdk_window_get_toplevel    (GdkWindow       *window);
768
769 GdkWindow *   gdk_window_get_effective_parent   (GdkWindow *window);
770 GdkWindow *   gdk_window_get_effective_toplevel (GdkWindow *window);
771
772 GList *       gdk_window_get_children    (GdkWindow       *window);
773 GList *       gdk_window_peek_children   (GdkWindow       *window);
774 GdkEventMask  gdk_window_get_events      (GdkWindow       *window);
775 void          gdk_window_set_events      (GdkWindow       *window,
776                                           GdkEventMask     event_mask);
777 void          gdk_window_set_device_events (GdkWindow    *window,
778                                             GdkDevice    *device,
779                                             GdkEventMask  event_mask);
780 GdkEventMask  gdk_window_get_device_events (GdkWindow    *window,
781                                             GdkDevice    *device);
782
783 void          gdk_window_set_icon_list   (GdkWindow       *window,
784                                           GList           *pixbufs);
785 void          gdk_window_set_icon_name   (GdkWindow       *window, 
786                                           const gchar     *name);
787 void          gdk_window_set_group       (GdkWindow       *window, 
788                                           GdkWindow       *leader);
789 GdkWindow*    gdk_window_get_group       (GdkWindow       *window);
790 void          gdk_window_set_decorations (GdkWindow       *window,
791                                           GdkWMDecoration  decorations);
792 gboolean      gdk_window_get_decorations (GdkWindow       *window,
793                                           GdkWMDecoration *decorations);
794 void          gdk_window_set_functions   (GdkWindow       *window,
795                                           GdkWMFunction    functions);
796
797 cairo_surface_t *
798               gdk_window_create_similar_surface (GdkWindow *window,
799                                           cairo_content_t  content,
800                                           int              width,
801                                           int              height);
802
803 void          gdk_window_beep            (GdkWindow       *window);
804 void          gdk_window_iconify         (GdkWindow       *window);
805 void          gdk_window_deiconify       (GdkWindow       *window);
806 void          gdk_window_stick           (GdkWindow       *window);
807 void          gdk_window_unstick         (GdkWindow       *window);
808 void          gdk_window_maximize        (GdkWindow       *window);
809 void          gdk_window_unmaximize      (GdkWindow       *window);
810 void          gdk_window_fullscreen      (GdkWindow       *window);
811 void          gdk_window_unfullscreen    (GdkWindow       *window);
812 void          gdk_window_set_keep_above  (GdkWindow       *window,
813                                           gboolean         setting);
814 void          gdk_window_set_keep_below  (GdkWindow       *window,
815                                           gboolean         setting);
816 void          gdk_window_set_opacity     (GdkWindow       *window,
817                                           gdouble          opacity);
818 void          gdk_window_register_dnd    (GdkWindow       *window);
819
820 void gdk_window_begin_resize_drag (GdkWindow     *window,
821                                    GdkWindowEdge  edge,
822                                    gint           button,
823                                    gint           root_x,
824                                    gint           root_y,
825                                    guint32        timestamp);
826 void gdk_window_begin_move_drag   (GdkWindow     *window,
827                                    gint           button,
828                                    gint           root_x,
829                                    gint           root_y,
830                                    guint32        timestamp);
831
832 /* Interface for dirty-region queueing */
833 void       gdk_window_invalidate_rect           (GdkWindow          *window,
834                                                  const GdkRectangle *rect,
835                                                  gboolean            invalidate_children);
836 void       gdk_window_invalidate_region         (GdkWindow          *window,
837                                                  const cairo_region_t    *region,
838                                                  gboolean            invalidate_children);
839
840 /**
841  * GdkWindowChildFunc:
842  * @window: a #GdkWindow
843  * @user_data: user data
844  *
845  * A function of this type is passed to gdk_window_invalidate_maybe_recurse().
846  * It gets called for each child of the window to determine whether to
847  * recursively invalidate it or now.
848  *
849  * Returns: %TRUE to invalidate @window recursively
850  */
851 typedef gboolean (*GdkWindowChildFunc)          (GdkWindow *window,
852                                                  gpointer   user_data);
853
854 void       gdk_window_invalidate_maybe_recurse  (GdkWindow            *window,
855                                                  const cairo_region_t *region,
856                                                  GdkWindowChildFunc    child_func,
857                                                  gpointer              user_data);
858 cairo_region_t *gdk_window_get_update_area      (GdkWindow            *window);
859
860 void       gdk_window_freeze_updates      (GdkWindow    *window);
861 void       gdk_window_thaw_updates        (GdkWindow    *window);
862
863 void       gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window);
864 void       gdk_window_thaw_toplevel_updates_libgtk_only   (GdkWindow *window);
865
866 void       gdk_window_process_all_updates (void);
867 void       gdk_window_process_updates     (GdkWindow    *window,
868                                            gboolean      update_children);
869
870 /* Enable/disable flicker, so you can tell if your code is inefficient. */
871 void       gdk_window_set_debug_updates   (gboolean      setting);
872
873 void       gdk_window_constrain_size      (GdkGeometry  *geometry,
874                                            guint         flags,
875                                            gint          width,
876                                            gint          height,
877                                            gint         *new_width,
878                                            gint         *new_height);
879
880 void gdk_window_enable_synchronized_configure (GdkWindow *window);
881 void gdk_window_configure_finished            (GdkWindow *window);
882
883 #if !defined (GDK_MULTIHEAD_SAFE) && !defined (GDK_MULTIDEVICE_SAFE)
884 GdkPointerHooks *gdk_set_pointer_hooks (const GdkPointerHooks *new_hooks);
885 #endif /* !GDK_MULTIHEAD_SAFE && !GDK_MULTIDEVICE_SAFE */
886
887 GdkWindow *gdk_get_default_root_window (void);
888
889 /* Offscreen redirection */
890 cairo_surface_t *
891            gdk_offscreen_window_get_surface    (GdkWindow     *window);
892 void       gdk_offscreen_window_set_embedder   (GdkWindow     *window,
893                                                 GdkWindow     *embedder);
894 GdkWindow *gdk_offscreen_window_get_embedder   (GdkWindow     *window);
895 void       gdk_window_geometry_changed         (GdkWindow     *window);
896
897 /* Multidevice support */
898 void       gdk_window_set_support_multidevice (GdkWindow *window,
899                                                gboolean   support_multidevice);
900 gboolean   gdk_window_get_support_multidevice (GdkWindow *window);
901
902 G_END_DECLS
903
904 #endif /* __GDK_WINDOW_H__ */