1 #ifndef __GDK_WINDOW_H__
2 #define __GDK_WINDOW_H__
4 #include <gdk/gdkdrawable.h>
5 #include <gdk/gdktypes.h>
6 #include <gdk/gdkwindow.h>
7 #include <gdk/gdkevents.h>
11 #endif /* __cplusplus */
13 typedef struct _GdkGeometry GdkGeometry;
14 typedef struct _GdkWindowAttr GdkWindowAttr;
16 /* Classes of windows.
17 * InputOutput: Almost every window should be of this type. Such windows
18 * receive events and are also displayed on screen.
19 * InputOnly: Used only in special circumstances when events need to be
20 * stolen from another window or windows. Input only windows
21 * have no visible output, so they are handy for placing over
22 * top of a group of windows in order to grab the events (or
23 * filter the events) from those windows.
32 * Root: There is only 1 root window and it is initialized
33 * at startup. Creating a window of type GDK_WINDOW_ROOT
35 * Toplevel: Windows which interact with the window manager.
36 * Child: Windows which are children of some other type of window.
37 * (Any other type of window). Most windows are child windows.
38 * Dialog: A special kind of toplevel window which interacts with
39 * the window manager slightly differently than a regular
40 * toplevel window. Dialog windows should be used for any
42 * Foreign: A window that actually belongs to another application
54 /* Window attribute mask values.
55 * GDK_WA_TITLE: The "title" field is valid.
56 * GDK_WA_X: The "x" field is valid.
57 * GDK_WA_Y: The "y" field is valid.
58 * GDK_WA_CURSOR: The "cursor" field is valid.
59 * GDK_WA_COLORMAP: The "colormap" field is valid.
60 * GDK_WA_VISUAL: The "visual" field is valid.
64 GDK_WA_TITLE = 1 << 1,
67 GDK_WA_CURSOR = 1 << 4,
68 GDK_WA_COLORMAP = 1 << 5,
69 GDK_WA_VISUAL = 1 << 6,
70 GDK_WA_WMCLASS = 1 << 7,
71 GDK_WA_NOREDIR = 1 << 8
72 } GdkWindowAttributesType;
74 /* Size restriction enumeration.
78 GDK_HINT_POS = 1 << 0,
79 GDK_HINT_MIN_SIZE = 1 << 1,
80 GDK_HINT_MAX_SIZE = 1 << 2,
81 GDK_HINT_BASE_SIZE = 1 << 3,
82 GDK_HINT_ASPECT = 1 << 4,
83 GDK_HINT_RESIZE_INC = 1 << 5,
84 GDK_HINT_WIN_GRAVITY = 1 << 6
87 /* The next two enumeration values current match the
88 * Motif constants. If this is changed, the implementation
89 * of gdk_window_set_decorations/gdk_window_set_functions
90 * will need to change as well.
94 GDK_DECOR_ALL = 1 << 0,
95 GDK_DECOR_BORDER = 1 << 1,
96 GDK_DECOR_RESIZEH = 1 << 2,
97 GDK_DECOR_TITLE = 1 << 3,
98 GDK_DECOR_MENU = 1 << 4,
99 GDK_DECOR_MINIMIZE = 1 << 5,
100 GDK_DECOR_MAXIMIZE = 1 << 6
105 GDK_FUNC_ALL = 1 << 0,
106 GDK_FUNC_RESIZE = 1 << 1,
107 GDK_FUNC_MOVE = 1 << 2,
108 GDK_FUNC_MINIMIZE = 1 << 3,
109 GDK_FUNC_MAXIMIZE = 1 << 4,
110 GDK_FUNC_CLOSE = 1 << 5
113 /* Currently, these are the same values numerically as in the
114 * X protocol. If you change that, gdkwindow-x11.c/gdk_window_set_geometry_hints()
119 GDK_GRAVITY_NORTH_WEST = 1,
121 GDK_GRAVITY_NORTH_EAST,
125 GDK_GRAVITY_SOUTH_WEST,
127 GDK_GRAVITY_SOUTH_EAST,
131 struct _GdkWindowAttr
138 GdkWindowClass wclass;
140 GdkColormap *colormap;
141 GdkWindowType window_type;
144 gchar *wmclass_class;
145 gboolean override_redirect;
148 struct _GdkGeometry {
159 GdkGravity win_gravity;
162 typedef struct _GdkWindowObject GdkWindowObject;
163 typedef struct _GdkWindowObjectClass GdkWindowObjectClass;
165 #define GDK_TYPE_WINDOW (gdk_window_object_get_type ())
166 #define GDK_WINDOW(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW, GdkWindow))
167 #define GDK_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW, GdkWindowObjectClass))
168 #define GDK_IS_WINDOW(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW))
169 #define GDK_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW))
170 #define GDK_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW, GdkWindowObjectClass))
171 #define GDK_WINDOW_OBJECT(object) ((GdkWindowObject *) GDK_WINDOW (object))
173 struct _GdkWindowObject
175 GdkDrawable parent_instance;
177 GdkDrawable *impl; /* window-system-specific delegate object */
179 GdkWindowObject *parent;
186 gint extension_events;
192 GdkPixmap *bg_pixmap;
196 GdkRegion *update_area;
197 guint update_freeze_count;
203 guint guffaw_gravity : 1;
204 guint input_only : 1;
209 struct _GdkWindowObjectClass
211 GdkDrawableClass parent_class;
218 GType gdk_window_object_get_type (void) G_GNUC_CONST;
219 GdkWindow* gdk_window_new (GdkWindow *parent,
220 GdkWindowAttr *attributes,
221 gint attributes_mask);
222 void gdk_window_destroy (GdkWindow *window);
223 GdkWindowType gdk_window_get_window_type (GdkWindow *window);
224 GdkWindow* gdk_window_at_pointer (gint *win_x,
226 void gdk_window_show (GdkWindow *window);
227 void gdk_window_hide (GdkWindow *window);
228 void gdk_window_withdraw (GdkWindow *window);
229 void gdk_window_move (GdkWindow *window,
232 void gdk_window_resize (GdkWindow *window,
235 void gdk_window_move_resize (GdkWindow *window,
240 void gdk_window_reparent (GdkWindow *window,
241 GdkWindow *new_parent,
244 void gdk_window_clear (GdkWindow *window);
245 void gdk_window_clear_area (GdkWindow *window,
250 void gdk_window_clear_area_e (GdkWindow *window,
255 void gdk_window_raise (GdkWindow *window);
256 void gdk_window_lower (GdkWindow *window);
257 void gdk_window_set_user_data (GdkWindow *window,
259 void gdk_window_set_override_redirect (GdkWindow *window,
260 gboolean override_redirect);
261 void gdk_window_add_filter (GdkWindow *window,
262 GdkFilterFunc function,
264 void gdk_window_remove_filter (GdkWindow *window,
265 GdkFilterFunc function,
267 void gdk_window_scroll (GdkWindow *window,
272 * This allows for making shaped (partially transparent) windows
273 * - cool feature, needed for Drag and Drag for example.
274 * The shape_mask can be the mask
275 * from gdk_pixmap_create_from_xpm. Stefan Wille
277 void gdk_window_shape_combine_mask (GdkWindow *window,
278 GdkBitmap *shape_mask,
282 * This routine allows you to quickly take the shapes of all the child windows
283 * of a window and use their shapes as the shape mask for this window - useful
284 * for container windows that dont want to look like a big box
288 void gdk_window_set_child_shapes (GdkWindow *window);
291 * This routine allows you to merge (ie ADD) child shapes to your
292 * own window's shape keeping its current shape and ADDING the child
297 void gdk_window_merge_child_shapes (GdkWindow *window);
300 * Check if a window has been shown, and whether all its
301 * parents up to a toplevel have been shown, respectively.
302 * Note that a window that is_viewable below is not necessarily
303 * viewable in the X sense.
305 gboolean gdk_window_is_visible (GdkWindow *window);
306 gboolean gdk_window_is_viewable (GdkWindow *window);
308 /* Set static bit gravity on the parent, and static
309 * window gravity on all children.
311 gboolean gdk_window_set_static_gravities (GdkWindow *window,
312 gboolean use_static);
316 void gdk_window_set_hints (GdkWindow *window,
324 void gdk_window_set_geometry_hints (GdkWindow *window,
325 GdkGeometry *geometry,
326 GdkWindowHints flags);
327 void gdk_set_sm_client_id (const gchar *sm_client_id);
329 void gdk_window_begin_paint_rect (GdkWindow *window,
330 GdkRectangle *rectangle);
331 void gdk_window_begin_paint_region (GdkWindow *window,
333 void gdk_window_end_paint (GdkWindow *window);
335 void gdk_window_set_title (GdkWindow *window,
337 void gdk_window_set_role (GdkWindow *window,
339 void gdk_window_set_transient_for (GdkWindow *window,
341 void gdk_window_set_background (GdkWindow *window,
343 void gdk_window_set_back_pixmap (GdkWindow *window,
345 gboolean parent_relative);
346 void gdk_window_set_cursor (GdkWindow *window,
348 void gdk_window_get_user_data (GdkWindow *window,
350 void gdk_window_get_geometry (GdkWindow *window,
356 void gdk_window_get_position (GdkWindow *window,
359 gint gdk_window_get_origin (GdkWindow *window,
362 gboolean gdk_window_get_deskrelative_origin (GdkWindow *window,
365 void gdk_window_get_root_origin (GdkWindow *window,
368 GdkWindow* gdk_window_get_pointer (GdkWindow *window,
371 GdkModifierType *mask);
372 GdkWindow * gdk_window_get_parent (GdkWindow *window);
373 GdkWindow * gdk_window_get_toplevel (GdkWindow *window);
375 GList * gdk_window_get_children (GdkWindow *window);
376 GList * gdk_window_peek_children (GdkWindow *window);
377 GdkEventMask gdk_window_get_events (GdkWindow *window);
378 void gdk_window_set_events (GdkWindow *window,
379 GdkEventMask event_mask);
381 void gdk_window_set_icon (GdkWindow *window,
382 GdkWindow *icon_window,
385 void gdk_window_set_icon_name (GdkWindow *window,
387 void gdk_window_set_group (GdkWindow *window,
389 void gdk_window_set_decorations (GdkWindow *window,
390 GdkWMDecoration decorations);
391 void gdk_window_set_functions (GdkWindow *window,
392 GdkWMFunction functions);
393 GList * gdk_window_get_toplevels (void);
394 void gdk_window_iconify (GdkWindow *window);
396 void gdk_window_register_dnd (GdkWindow *window);
398 /* Interface for dirty-region queueing */
399 void gdk_window_invalidate_rect (GdkWindow *window,
401 gboolean invalidate_children);
402 void gdk_window_invalidate_region (GdkWindow *window,
404 gboolean invalidate_children);
405 GdkRegion *gdk_window_get_update_area (GdkWindow *window);
407 void gdk_window_freeze_updates (GdkWindow *window);
408 void gdk_window_thaw_updates (GdkWindow *window);
410 void gdk_window_process_all_updates (void);
411 void gdk_window_process_updates (GdkWindow *window,
412 gboolean update_children);
418 #endif /* __cplusplus */
420 #endif /* __GDK_WINDOW_H__ */