1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
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/.
27 #if !defined (__GDK_H_INSIDE__) && !defined (GDK_COMPILATION)
28 #error "Only <gdk/gdk.h> can be included directly."
31 #ifndef __GDK_WINDOW_H__
32 #define __GDK_WINDOW_H__
34 #include <gdk/gdktypes.h>
35 #include <gdk/gdkevents.h>
39 typedef struct _GdkGeometry GdkGeometry;
40 typedef struct _GdkWindowAttr GdkWindowAttr;
41 typedef struct _GdkPointerHooks GdkPointerHooks;
42 typedef struct _GdkWindowRedirect GdkWindowRedirect;
45 * GdkWindowWindowClass:
46 * @GDK_INPUT_OUTPUT: window for graphics and events
47 * @GDK_INPUT_ONLY: window for events only
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.
59 } GdkWindowWindowClass;
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
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
73 * Describes the kind of window.
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
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.
105 GDK_WA_TITLE = 1 << 1,
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;
115 /* Size restriction enumeration.
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
128 * @GDK_HINT_USER_SIZE: indicates that the window's size was explicitly set by
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.
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
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
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.
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.
182 * <ulink url="http://www.freedesktop.org/Standards/wm-spec">Extended
183 * Window Manager Hints</ulink> specification for more details about
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
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.
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.
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.
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
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.
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.
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
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()
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.
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.
283 GDK_GRAVITY_NORTH_WEST = 1,
285 GDK_GRAVITY_NORTH_EAST,
289 GDK_GRAVITY_SOUTH_WEST,
291 GDK_GRAVITY_SOUTH_EAST,
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.
307 * Determines a window edge or corner.
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
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
339 * Attributes to use for a newly-created window.
341 struct _GdkWindowAttr
348 GdkWindowWindowClass wclass;
350 GdkWindowType window_type;
353 gchar *wmclass_class;
354 gboolean override_redirect;
355 GdkWindowTypeHint type_hint;
360 * @min_width: minimum width of window (or -1 to use requisition, with
362 * @min_height: minimum height of window (or -1 to use requisition, with
364 * @max_width: maximum width of window (or -1 to use requisition, with
366 * @max_height: maximum height of window (or -1 to use requisition, with
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()
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.
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
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.
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":
409 * <informalexample><programlisting><![CDATA[
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;
419 * gtk_window_set_geometry_hints (GTK_WINDOW (toplevel),
420 * GTK_WIDGET (terminal),
422 * GDK_HINT_RESIZE_INC |
423 * GDK_HINT_MIN_SIZE |
424 * GDK_HINT_BASE_SIZE);
425 * ]]></programlisting></informalexample>
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
446 GdkGravity win_gravity;
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).
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().
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
466 struct _GdkPointerHooks
468 GdkWindow* (*get_pointer) (GdkWindow *window,
471 GdkModifierType *mask);
472 GdkWindow* (*window_at_pointer) (GdkScreen *screen, /* unused */
477 typedef struct _GdkWindowObject GdkWindowObject;
478 typedef struct _GdkWindowClass GdkWindowClass;
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, GdkWindowClass))
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, GdkWindowClass))
488 struct _GdkWindowClass
490 GObjectClass parent_class;
492 GdkWindow * (* pick_embedded_child) (GdkWindow *window,
496 /* the following 3 signals will only be emitted by offscreen windows */
497 void (* to_embedder) (GdkWindow *window,
501 gdouble *embedder_y);
502 void (* from_embedder) (GdkWindow *window,
505 gdouble *offscreen_x,
506 gdouble *offscreen_y);
507 cairo_surface_t * (* create_surface) (GdkWindow *window,
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);
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);
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,
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,
546 void gdk_window_resize (GdkWindow *window,
549 void gdk_window_move_resize (GdkWindow *window,
554 void gdk_window_reparent (GdkWindow *window,
555 GdkWindow *new_parent,
558 void gdk_window_raise (GdkWindow *window);
559 void gdk_window_lower (GdkWindow *window);
560 void gdk_window_restack (GdkWindow *window,
563 void gdk_window_focus (GdkWindow *window,
565 void gdk_window_set_user_data (GdkWindow *window,
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,
578 void gdk_window_remove_filter (GdkWindow *window,
579 GdkFilterFunc function,
581 void gdk_window_scroll (GdkWindow *window,
584 void gdk_window_move_region (GdkWindow *window,
585 const cairo_region_t *region,
588 gboolean gdk_window_ensure_native (GdkWindow *window);
591 * This allows for making shaped (partially transparent) windows
592 * - cool feature, needed for Drag and Drag for example.
594 void gdk_window_shape_combine_region (GdkWindow *window,
595 const cairo_region_t *shape_region,
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
606 void gdk_window_set_child_shapes (GdkWindow *window);
608 gboolean gdk_window_get_composited (GdkWindow *window);
609 void gdk_window_set_composited (GdkWindow *window,
610 gboolean composited);
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
619 void gdk_window_merge_child_shapes (GdkWindow *window);
621 void gdk_window_input_shape_combine_region (GdkWindow *window,
622 const cairo_region_t *shape_region,
625 void gdk_window_set_child_input_shapes (GdkWindow *window);
626 void gdk_window_merge_child_input_shapes (GdkWindow *window);
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.
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);
640 GdkWindowState gdk_window_get_state (GdkWindow *window);
642 /* Set static bit gravity on the parent, and static
643 * window gravity on all children.
645 gboolean gdk_window_set_static_gravities (GdkWindow *window,
646 gboolean use_static);
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);
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);
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);
666 gboolean gdk_window_get_modal_hint (GdkWindow *window);
667 void gdk_window_set_modal_hint (GdkWindow *window,
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,
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);
682 cairo_region_t *gdk_window_get_clip_region (GdkWindow *window);
683 cairo_region_t *gdk_window_get_visible_region(GdkWindow *window);
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);
693 void gdk_window_set_title (GdkWindow *window,
695 void gdk_window_set_role (GdkWindow *window,
697 void gdk_window_set_startup_id (GdkWindow *window,
698 const gchar *startup_id);
699 void gdk_window_set_transient_for (GdkWindow *window,
701 void gdk_window_set_background (GdkWindow *window,
702 const GdkColor *color);
703 void gdk_window_set_background_rgba (GdkWindow *window,
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);
709 void gdk_window_set_cursor (GdkWindow *window,
711 GdkCursor *gdk_window_get_cursor (GdkWindow *window);
712 void gdk_window_set_device_cursor (GdkWindow *window,
715 GdkCursor *gdk_window_get_device_cursor (GdkWindow *window,
717 void gdk_window_get_user_data (GdkWindow *window,
719 void gdk_window_get_geometry (GdkWindow *window,
725 int gdk_window_get_width (GdkWindow *window);
726 int gdk_window_get_height (GdkWindow *window);
727 void gdk_window_get_position (GdkWindow *window,
730 gint gdk_window_get_origin (GdkWindow *window,
733 void gdk_window_get_root_coords (GdkWindow *window,
738 void gdk_window_coords_to_parent (GdkWindow *window,
743 void gdk_window_coords_from_parent (GdkWindow *window,
749 void gdk_window_get_root_origin (GdkWindow *window,
752 void gdk_window_get_frame_extents (GdkWindow *window,
755 #ifndef GDK_MULTIDEVICE_SAFE
756 GdkWindow* gdk_window_get_pointer (GdkWindow *window,
759 GdkModifierType *mask);
760 #endif /* GDK_MULTIDEVICE_SAFE */
761 GdkWindow * gdk_window_get_device_position (GdkWindow *window,
765 GdkModifierType *mask);
766 GdkWindow * gdk_window_get_parent (GdkWindow *window);
767 GdkWindow * gdk_window_get_toplevel (GdkWindow *window);
769 GdkWindow * gdk_window_get_effective_parent (GdkWindow *window);
770 GdkWindow * gdk_window_get_effective_toplevel (GdkWindow *window);
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,
779 GdkEventMask event_mask);
780 GdkEventMask gdk_window_get_device_events (GdkWindow *window,
783 void gdk_window_set_icon_list (GdkWindow *window,
785 void gdk_window_set_icon_name (GdkWindow *window,
787 void gdk_window_set_group (GdkWindow *window,
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);
798 gdk_window_create_similar_surface (GdkWindow *window,
799 cairo_content_t content,
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,
814 void gdk_window_set_keep_below (GdkWindow *window,
816 void gdk_window_set_opacity (GdkWindow *window,
818 void gdk_window_register_dnd (GdkWindow *window);
820 void gdk_window_begin_resize_drag (GdkWindow *window,
826 void gdk_window_begin_move_drag (GdkWindow *window,
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);
841 * GdkWindowChildFunc:
842 * @window: a #GdkWindow
843 * @user_data: user data
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.
849 * Returns: %TRUE to invalidate @window recursively
851 typedef gboolean (*GdkWindowChildFunc) (GdkWindow *window,
854 void gdk_window_invalidate_maybe_recurse (GdkWindow *window,
855 const cairo_region_t *region,
856 GdkWindowChildFunc child_func,
858 cairo_region_t *gdk_window_get_update_area (GdkWindow *window);
860 void gdk_window_freeze_updates (GdkWindow *window);
861 void gdk_window_thaw_updates (GdkWindow *window);
863 void gdk_window_freeze_toplevel_updates_libgtk_only (GdkWindow *window);
864 void gdk_window_thaw_toplevel_updates_libgtk_only (GdkWindow *window);
866 void gdk_window_process_all_updates (void);
867 void gdk_window_process_updates (GdkWindow *window,
868 gboolean update_children);
870 /* Enable/disable flicker, so you can tell if your code is inefficient. */
871 void gdk_window_set_debug_updates (gboolean setting);
873 void gdk_window_constrain_size (GdkGeometry *geometry,
880 void gdk_window_enable_synchronized_configure (GdkWindow *window);
881 void gdk_window_configure_finished (GdkWindow *window);
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 */
887 GdkWindow *gdk_get_default_root_window (void);
889 /* Offscreen redirection */
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);
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);
904 #endif /* __GDK_WINDOW_H__ */