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 /* Window attribute mask values.
33 * GDK_WA_TITLE: The "title" field is valid.
34 * GDK_WA_X: The "x" field is valid.
35 * GDK_WA_Y: The "y" field is valid.
36 * GDK_WA_CURSOR: The "cursor" field is valid.
37 * GDK_WA_COLORMAP: The "colormap" field is valid.
38 * GDK_WA_VISUAL: The "visual" field is valid.
42 GDK_WA_TITLE = 1 << 1,
45 GDK_WA_CURSOR = 1 << 4,
46 GDK_WA_COLORMAP = 1 << 5,
47 GDK_WA_VISUAL = 1 << 6,
48 GDK_WA_WMCLASS = 1 << 7,
49 GDK_WA_NOREDIR = 1 << 8
50 } GdkWindowAttributesType;
52 /* Size restriction enumeration.
56 GDK_HINT_POS = 1 << 0,
57 GDK_HINT_MIN_SIZE = 1 << 1,
58 GDK_HINT_MAX_SIZE = 1 << 2,
59 GDK_HINT_BASE_SIZE = 1 << 3,
60 GDK_HINT_ASPECT = 1 << 4,
61 GDK_HINT_RESIZE_INC = 1 << 5
64 /* The next two enumeration values current match the
65 * Motif constants. If this is changed, the implementation
66 * of gdk_window_set_decorations/gdk_window_set_functions
67 * will need to change as well.
71 GDK_DECOR_ALL = 1 << 0,
72 GDK_DECOR_BORDER = 1 << 1,
73 GDK_DECOR_RESIZEH = 1 << 2,
74 GDK_DECOR_TITLE = 1 << 3,
75 GDK_DECOR_MENU = 1 << 4,
76 GDK_DECOR_MINIMIZE = 1 << 5,
77 GDK_DECOR_MAXIMIZE = 1 << 6
82 GDK_FUNC_ALL = 1 << 0,
83 GDK_FUNC_RESIZE = 1 << 1,
84 GDK_FUNC_MOVE = 1 << 2,
85 GDK_FUNC_MINIMIZE = 1 << 3,
86 GDK_FUNC_MAXIMIZE = 1 << 4,
87 GDK_FUNC_CLOSE = 1 << 5
97 GdkWindowClass wclass;
99 GdkColormap *colormap;
100 GdkDrawableType window_type;
103 gchar *wmclass_class;
104 gboolean override_redirect;
107 struct _GdkGeometry {
118 /* GdkGravity gravity; */
123 GdkWindow* gdk_window_new (GdkWindow *parent,
124 GdkWindowAttr *attributes,
125 gint attributes_mask);
127 void gdk_window_destroy (GdkWindow *window);
129 GdkWindow* gdk_window_at_pointer (gint *win_x,
131 void gdk_window_show (GdkWindow *window);
132 void gdk_window_hide (GdkWindow *window);
133 void gdk_window_withdraw (GdkWindow *window);
134 void gdk_window_move (GdkWindow *window,
137 void gdk_window_resize (GdkWindow *window,
140 void gdk_window_move_resize (GdkWindow *window,
145 void gdk_window_reparent (GdkWindow *window,
146 GdkWindow *new_parent,
149 void gdk_window_clear (GdkWindow *window);
150 void gdk_window_clear_area (GdkWindow *window,
155 void gdk_window_clear_area_e(GdkWindow *window,
160 void gdk_window_raise (GdkWindow *window);
161 void gdk_window_lower (GdkWindow *window);
163 void gdk_window_set_user_data (GdkWindow *window,
165 void gdk_window_set_override_redirect(GdkWindow *window,
166 gboolean override_redirect);
168 void gdk_window_add_filter (GdkWindow *window,
169 GdkFilterFunc function,
171 void gdk_window_remove_filter (GdkWindow *window,
172 GdkFilterFunc function,
176 * This allows for making shaped (partially transparent) windows
177 * - cool feature, needed for Drag and Drag for example.
178 * The shape_mask can be the mask
179 * from gdk_pixmap_create_from_xpm. Stefan Wille
181 void gdk_window_shape_combine_mask (GdkWindow *window,
182 GdkBitmap *shape_mask,
186 * This routine allows you to quickly take the shapes of all the child windows
187 * of a window and use their shapes as the shape mask for this window - useful
188 * for container windows that dont want to look like a big box
192 void gdk_window_set_child_shapes (GdkWindow *window);
195 * This routine allows you to merge (ie ADD) child shapes to your
196 * own window's shape keeping its current shape and ADDING the child
201 void gdk_window_merge_child_shapes (GdkWindow *window);
204 * Check if a window has been shown, and whether all it's
205 * parents up to a toplevel have been shown, respectively.
206 * Note that a window that is_viewable below is not necessarily
207 * viewable in the X sense.
209 gboolean gdk_window_is_visible (GdkWindow *window);
210 gboolean gdk_window_is_viewable (GdkWindow *window);
212 /* Set static bit gravity on the parent, and static
213 * window gravity on all children.
215 gboolean gdk_window_set_static_gravities (GdkWindow *window,
216 gboolean use_static);
220 void gdk_window_set_hints (GdkWindow *window,
228 void gdk_window_set_geometry_hints (GdkWindow *window,
229 GdkGeometry *geometry,
230 GdkWindowHints flags);
231 void gdk_set_sm_client_id (const gchar *sm_client_id);
234 void gdk_window_set_title (GdkWindow *window,
236 void gdk_window_set_role (GdkWindow *window,
238 void gdk_window_set_transient_for (GdkWindow *window,
240 void gdk_window_set_background (GdkWindow *window,
242 void gdk_window_set_back_pixmap (GdkWindow *window,
244 gint parent_relative);
245 void gdk_window_set_cursor (GdkWindow *window,
247 void gdk_window_get_user_data (GdkWindow *window,
249 void gdk_window_get_geometry (GdkWindow *window,
255 void gdk_window_get_position (GdkWindow *window,
258 gint gdk_window_get_origin (GdkWindow *window,
261 gboolean gdk_window_get_deskrelative_origin (GdkWindow *window,
264 void gdk_window_get_root_origin (GdkWindow *window,
267 GdkWindow* gdk_window_get_pointer (GdkWindow *window,
270 GdkModifierType *mask);
271 GdkWindow* gdk_window_get_parent (GdkWindow *window);
272 GdkWindow* gdk_window_get_toplevel (GdkWindow *window);
273 GList* gdk_window_get_children (GdkWindow *window);
274 GdkEventMask gdk_window_get_events (GdkWindow *window);
275 void gdk_window_set_events (GdkWindow *window,
276 GdkEventMask event_mask);
278 void gdk_window_set_icon (GdkWindow *window,
279 GdkWindow *icon_window,
282 void gdk_window_set_icon_name (GdkWindow *window,
284 void gdk_window_set_group (GdkWindow *window,
286 void gdk_window_set_decorations (GdkWindow *window,
287 GdkWMDecoration decorations);
288 void gdk_window_set_functions (GdkWindow *window,
289 GdkWMFunction functions);
290 GList * gdk_window_get_toplevels (void);
292 void gdk_window_register_dnd (GdkWindow *window);
296 #endif /* __cplusplus */
298 #endif /* __GDK_WINDOW_H__ */