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