]> Pileus Git - ~andy/gtk/blob - gdk/gdkwindow.h
gdk/gdkwindow.h Remove prototypes for renamed functions.
[~andy/gtk] / gdk / gdkwindow.h
1 #ifndef __GDK_WINDOW_H__
2 #define __GDK_WINDOW_H__
3
4 #include <gdk/gdkdrawable.h>
5 #include <gdk/gdktypes.h>
6 #include <gdk/gdkwindow.h>
7 #include <gdk/gdkevents.h>
8
9 #ifdef __cplusplus
10 extern "C" {
11 #endif /* __cplusplus */
12
13 typedef struct _GdkGeometry           GdkGeometry;
14 typedef struct _GdkWindowAttr         GdkWindowAttr;
15
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.
24  */
25 typedef enum
26 {
27   GDK_INPUT_OUTPUT,
28   GDK_INPUT_ONLY
29 } GdkWindowClass;
30
31
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.
39  */
40 typedef enum
41 {
42   GDK_WA_TITLE    = 1 << 1,
43   GDK_WA_X        = 1 << 2,
44   GDK_WA_Y        = 1 << 3,
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;
51
52 /* Size restriction enumeration.
53  */
54 typedef enum
55 {
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
62 } GdkWindowHints;
63
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.
68  */
69 typedef enum
70 {
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
78 } GdkWMDecoration;
79
80 typedef enum
81 {
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
88 } GdkWMFunction;
89
90 struct _GdkWindowAttr
91 {
92   gchar *title;
93   gint event_mask;
94   gint16 x, y;
95   gint16 width;
96   gint16 height;
97   GdkWindowClass wclass;
98   GdkVisual *visual;
99   GdkColormap *colormap;
100   GdkDrawableType window_type;
101   GdkCursor *cursor;
102   gchar *wmclass_name;
103   gchar *wmclass_class;
104   gboolean override_redirect;
105 };
106
107 struct _GdkGeometry {
108   gint min_width;
109   gint min_height;
110   gint max_width;
111   gint max_height;
112   gint base_width;
113   gint base_height;
114   gint width_inc;
115   gint height_inc;
116   gdouble min_aspect;
117   gdouble max_aspect;
118   /* GdkGravity gravity; */
119 };
120
121 /* Windows
122  */
123 GdkWindow*    gdk_window_new         (GdkWindow     *parent,
124                                       GdkWindowAttr *attributes,
125                                       gint           attributes_mask);
126
127 void          gdk_window_destroy     (GdkWindow     *window);
128
129 GdkWindow*    gdk_window_at_pointer  (gint         *win_x,
130                                       gint         *win_y);
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,
135                                       gint          x,
136                                       gint          y);
137 void          gdk_window_resize      (GdkWindow    *window,
138                                       gint          width,
139                                       gint          height);
140 void          gdk_window_move_resize (GdkWindow    *window,
141                                       gint          x,
142                                       gint          y,
143                                       gint          width,
144                                       gint          height);
145 void          gdk_window_reparent    (GdkWindow    *window,
146                                       GdkWindow    *new_parent,
147                                       gint          x,
148                                       gint          y);
149 void          gdk_window_clear       (GdkWindow    *window);
150 void          gdk_window_clear_area  (GdkWindow    *window,
151                                       gint          x,
152                                       gint          y,
153                                       gint          width,
154                                       gint          height);
155 void          gdk_window_clear_area_e(GdkWindow    *window,
156                                       gint          x,
157                                       gint          y,
158                                       gint          width,
159                                       gint          height);
160 void          gdk_window_raise       (GdkWindow    *window);
161 void          gdk_window_lower       (GdkWindow    *window);
162
163 void          gdk_window_set_user_data   (GdkWindow       *window,
164                                           gpointer         user_data);
165 void          gdk_window_set_override_redirect(GdkWindow  *window,
166                                                gboolean override_redirect);
167
168 void          gdk_window_add_filter     (GdkWindow     *window,
169                                          GdkFilterFunc  function,
170                                          gpointer       data);
171 void          gdk_window_remove_filter  (GdkWindow     *window,
172                                          GdkFilterFunc  function,
173                                          gpointer       data);
174
175 /* 
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
180  */
181 void gdk_window_shape_combine_mask (GdkWindow       *window,
182                                     GdkBitmap       *shape_mask,
183                                     gint             offset_x,
184                                     gint             offset_y);
185 /*
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
189  * 
190  * - Raster
191  */
192 void gdk_window_set_child_shapes (GdkWindow *window);
193
194 /*
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
197  * shapes to it.
198  * 
199  * - Raster
200  */
201 void gdk_window_merge_child_shapes (GdkWindow *window);
202
203 /*
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.
208  */
209 gboolean gdk_window_is_visible     (GdkWindow *window);
210 gboolean gdk_window_is_viewable    (GdkWindow *window);
211
212 /* Set static bit gravity on the parent, and static
213  * window gravity on all children.
214  */
215 gboolean gdk_window_set_static_gravities (GdkWindow *window,
216                                           gboolean   use_static);   
217
218 /* GdkWindow */
219
220 void          gdk_window_set_hints       (GdkWindow       *window,
221                                           gint             x,
222                                           gint             y,
223                                           gint             min_width,
224                                           gint             min_height,
225                                           gint             max_width,
226                                           gint             max_height,
227                                           gint             flags);
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);
232
233
234 void          gdk_window_set_title         (GdkWindow     *window,
235                                             const gchar   *title);
236 void          gdk_window_set_role          (GdkWindow       *window,
237                                             const gchar     *role);
238 void          gdk_window_set_transient_for (GdkWindow       *window, 
239                                             GdkWindow       *leader);
240 void          gdk_window_set_background  (GdkWindow       *window,
241                                           GdkColor        *color);
242 void          gdk_window_set_back_pixmap (GdkWindow       *window,
243                                           GdkPixmap       *pixmap,
244                                           gint             parent_relative);
245 void          gdk_window_set_cursor      (GdkWindow       *window,
246                                           GdkCursor       *cursor);
247 void          gdk_window_get_user_data   (GdkWindow       *window,
248                                           gpointer        *data);
249 void          gdk_window_get_geometry    (GdkWindow       *window,
250                                           gint            *x,
251                                           gint            *y,
252                                           gint            *width,
253                                           gint            *height,
254                                           gint            *depth);
255 void          gdk_window_get_position    (GdkWindow       *window,
256                                           gint            *x,
257                                           gint            *y);
258 gint          gdk_window_get_origin      (GdkWindow       *window,
259                                           gint            *x,
260                                           gint            *y);
261 gboolean      gdk_window_get_deskrelative_origin (GdkWindow       *window,
262                                           gint            *x,
263                                           gint            *y);
264 void          gdk_window_get_root_origin (GdkWindow       *window,
265                                           gint            *x,
266                                           gint            *y);
267 GdkWindow*    gdk_window_get_pointer     (GdkWindow       *window,
268                                           gint            *x,
269                                           gint            *y,
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);
277
278 void          gdk_window_set_icon        (GdkWindow       *window, 
279                                           GdkWindow       *icon_window,
280                                           GdkPixmap       *pixmap,
281                                           GdkBitmap       *mask);
282 void          gdk_window_set_icon_name   (GdkWindow       *window, 
283                                           gchar           *name);
284 void          gdk_window_set_group       (GdkWindow       *window, 
285                                           GdkWindow       *leader);
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);
291
292 void          gdk_window_register_dnd    (GdkWindow       *window);
293
294 #ifdef __cplusplus
295 }
296 #endif /* __cplusplus */
297
298 #endif /* __GDK_WINDOW_H__ */