]> Pileus Git - ~andy/gtk/blob - gdk/gdkwindowimpl.h
Merge branch 'master' into broadway
[~andy/gtk] / gdk / gdkwindowimpl.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 #ifndef __GDK_WINDOW_IMPL_H__
28 #define __GDK_WINDOW_IMPL_H__
29
30 #include <gdk/gdkwindow.h>
31 #include <gdk/gdkproperty.h>
32
33 G_BEGIN_DECLS
34
35 #define GDK_TYPE_WINDOW_IMPL           (gdk_window_impl_get_type ())
36 #define GDK_WINDOW_IMPL(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WINDOW_IMPL, GdkWindowImpl))
37 #define GDK_WINDOW_IMPL_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass))
38 #define GDK_IS_WINDOW_IMPL(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WINDOW_IMPL))
39 #define GDK_IS_WINDOW_IMPL_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_WINDOW_IMPL))
40 #define GDK_WINDOW_IMPL_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImplClass))
41
42 typedef struct _GdkWindowImpl       GdkWindowImpl;
43 typedef struct _GdkWindowImplClass  GdkWindowImplClass;
44
45 struct _GdkWindowImpl
46 {
47   GObject parent;
48 };
49
50 struct _GdkWindowImplClass
51 {
52   GObjectClass parent_class;
53
54   cairo_surface_t *
55                (* ref_cairo_surface)    (GdkWindow       *window);
56
57   void         (* show)                 (GdkWindow       *window,
58                                          gboolean         already_mapped);
59   void         (* hide)                 (GdkWindow       *window);
60   void         (* withdraw)             (GdkWindow       *window);
61   void         (* raise)                (GdkWindow       *window);
62   void         (* lower)                (GdkWindow       *window);
63   void         (* restack_under)        (GdkWindow       *window,
64                                          GList           *native_siblings);
65   void         (* restack_toplevel)     (GdkWindow       *window,
66                                          GdkWindow       *sibling,
67                                          gboolean        above);
68
69   void         (* move_resize)          (GdkWindow       *window,
70                                          gboolean         with_move,
71                                          gint             x,
72                                          gint             y,
73                                          gint             width,
74                                          gint             height);
75   void         (* set_background)       (GdkWindow       *window,
76                                          cairo_pattern_t *pattern);
77
78   GdkEventMask (* get_events)           (GdkWindow       *window);
79   void         (* set_events)           (GdkWindow       *window,
80                                          GdkEventMask     event_mask);
81   
82   gboolean     (* reparent)             (GdkWindow       *window,
83                                          GdkWindow       *new_parent,
84                                          gint             x,
85                                          gint             y);
86
87   void         (* set_device_cursor)    (GdkWindow       *window,
88                                          GdkDevice       *device,
89                                          GdkCursor       *cursor);
90
91   void         (* get_geometry)         (GdkWindow       *window,
92                                          gint            *x,
93                                          gint            *y,
94                                          gint            *width,
95                                          gint            *height);
96   gint         (* get_root_coords)      (GdkWindow       *window,
97                                          gint             x,
98                                          gint             y,
99                                          gint            *root_x,
100                                          gint            *root_y);
101   gboolean     (* get_device_state)     (GdkWindow       *window,
102                                          GdkDevice       *device,
103                                          gint            *x,
104                                          gint            *y,
105                                          GdkModifierType *mask);
106
107   cairo_region_t * (* get_shape)        (GdkWindow       *window);
108   cairo_region_t * (* get_input_shape)  (GdkWindow       *window);
109   void         (* shape_combine_region) (GdkWindow       *window,
110                                          const cairo_region_t *shape_region,
111                                          gint             offset_x,
112                                          gint             offset_y);
113   void         (* input_shape_combine_region) (GdkWindow       *window,
114                                                const cairo_region_t *shape_region,
115                                                gint             offset_x,
116                                                gint             offset_y);
117
118   gboolean     (* set_static_gravities) (GdkWindow       *window,
119                                          gboolean         use_static);
120
121   /* Called before processing updates for a window. This gives the windowing
122    * layer a chance to save the region for later use in avoiding duplicate
123    * exposes. The return value indicates whether the function has a saved
124    * the region; if the result is TRUE, then the windowing layer is responsible
125    * for destroying the region later.
126    */
127   gboolean     (* queue_antiexpose)     (GdkWindow       *window,
128                                          cairo_region_t  *update_area);
129
130   /* Called to move @area inside @window by @dx x @dy pixels. @area is 
131    * guaranteed to be inside @window. If part of @area is not invisible or
132    * invalid, it is this function's job to queue expose events in those 
133    * areas.
134    */
135   void         (* translate)            (GdkWindow       *window,
136                                          cairo_region_t  *area,
137                                          gint            dx,
138                                          gint            dy);
139
140 /* Called to do the windowing system specific part of gdk_window_destroy(),
141  *
142  * window: The window being destroyed
143  * recursing: If TRUE, then this is being called because a parent
144  *     was destroyed. This generally means that the call to the windowing
145  *     system to destroy the window can be omitted, since it will be
146  *     destroyed as a result of the parent being destroyed.
147  *     Unless @foreign_destroy
148  * foreign_destroy: If TRUE, the window or a parent was destroyed by some
149  *     external agency. The window has already been destroyed and no
150  *     windowing system calls should be made. (This may never happen
151  *     for some windowing systems.)
152  */
153   void         (* destroy)              (GdkWindow       *window,
154                                          gboolean         recursing,
155                                          gboolean         foreign_destroy);
156
157
158  /* Called when gdk_window_destroy() is called on a foreign window
159   * or an ancestor of the foreign window. It should generally reparent
160   * the window out of it's current heirarchy, hide it, and then
161   * send a message to the owner requesting that the window be destroyed.
162   */
163   void         (*destroy_foreign)       (GdkWindow       *window);
164
165   cairo_surface_t * (* resize_cairo_surface) (GdkWindow       *window,
166                                               cairo_surface_t *surface,
167                                               gint             width,
168                                               gint             height);
169
170   /* optional */
171   gboolean     (* beep)                 (GdkWindow       *window);
172
173   void         (* focus)                (GdkWindow       *window,
174                                          guint32          timestamp);
175   void         (* set_type_hint)        (GdkWindow       *window,
176                                          GdkWindowTypeHint hint);
177   GdkWindowTypeHint (* get_type_hint)   (GdkWindow       *window);
178   void         (* set_modal_hint)       (GdkWindow *window,
179                                          gboolean   modal);
180   void         (* set_skip_taskbar_hint) (GdkWindow *window,
181                                           gboolean   skips_taskbar);
182   void         (* set_skip_pager_hint)  (GdkWindow *window,
183                                          gboolean   skips_pager);
184   void         (* set_urgency_hint)     (GdkWindow *window,
185                                          gboolean   urgent);
186   void         (* set_geometry_hints)   (GdkWindow         *window,
187                                          const GdkGeometry *geometry,
188                                          GdkWindowHints     geom_mask);
189   void         (* set_title)            (GdkWindow   *window,
190                                          const gchar *title);
191   void         (* set_role)             (GdkWindow   *window,
192                                          const gchar *role);
193   void         (* set_startup_id)       (GdkWindow   *window,
194                                          const gchar *startup_id);
195   void         (* set_transient_for)    (GdkWindow *window,
196                                          GdkWindow *parent);
197   void         (* get_root_origin)      (GdkWindow *window,
198                                          gint      *x,
199                                          gint      *y);
200   void         (* get_frame_extents)    (GdkWindow    *window,
201                                          GdkRectangle *rect);
202   void         (* set_override_redirect) (GdkWindow *window,
203                                           gboolean override_redirect);
204   void         (* set_accept_focus)     (GdkWindow *window,
205                                          gboolean accept_focus);
206   void         (* set_focus_on_map)     (GdkWindow *window,
207                                          gboolean focus_on_map);
208   void         (* set_icon_list)        (GdkWindow *window,
209                                          GList     *pixbufs);
210   void         (* set_icon_name)        (GdkWindow   *window,
211                                          const gchar *name);
212   void         (* iconify)              (GdkWindow *window);
213   void         (* deiconify)            (GdkWindow *window);
214   void         (* stick)                (GdkWindow *window);
215   void         (* unstick)              (GdkWindow *window);
216   void         (* maximize)             (GdkWindow *window);
217   void         (* unmaximize)           (GdkWindow *window);
218   void         (* fullscreen)           (GdkWindow *window);
219   void         (* unfullscreen)         (GdkWindow *window);
220   void         (* set_keep_above)       (GdkWindow *window,
221                                          gboolean   setting);
222   void         (* set_keep_below)       (GdkWindow *window,
223                                          gboolean   setting);
224   GdkWindow *  (* get_group)            (GdkWindow *window);
225   void         (* set_group)            (GdkWindow *window,
226                                          GdkWindow *leader);
227   void         (* set_decorations)      (GdkWindow      *window,
228                                          GdkWMDecoration decorations);
229   gboolean     (* get_decorations)      (GdkWindow       *window,
230                                          GdkWMDecoration *decorations);
231   void         (* set_functions)        (GdkWindow    *window,
232                                          GdkWMFunction functions);
233   void         (* begin_resize_drag)    (GdkWindow     *window,
234                                          GdkWindowEdge  edge,
235                                          gint           button,
236                                          gint           root_x,
237                                          gint           root_y,
238                                          guint32        timestamp);
239   void         (* begin_move_drag)      (GdkWindow *window,
240                                          gint       button,
241                                          gint       root_x,
242                                          gint       root_y,
243                                          guint32    timestamp);
244   void         (* enable_synchronized_configure) (GdkWindow *window);
245   void         (* configure_finished)   (GdkWindow *window);
246   void         (* set_opacity)          (GdkWindow *window,
247                                          gdouble    opacity);
248   void         (* set_composited)       (GdkWindow *window,
249                                          gboolean   composited);
250   void         (* destroy_notify)       (GdkWindow *window);
251   GdkDragProtocol (* get_drag_protocol) (GdkWindow *window,
252                                          GdkWindow **target);
253   void         (* register_dnd)         (GdkWindow *window);
254   GdkDragContext * (*drag_begin)        (GdkWindow *window,
255                                          GdkDevice *device,
256                                          GList     *targets);
257
258   void         (*process_updates_recurse) (GdkWindow      *window,
259                                            cairo_region_t *region);
260
261   void         (*sync_rendering)          (GdkWindow      *window);
262   gboolean     (*simulate_key)            (GdkWindow      *window,
263                                            gint            x,
264                                            gint            y,
265                                            guint           keyval,
266                                            GdkModifierType modifiers,
267                                            GdkEventType    event_type);
268   gboolean     (*simulate_button)         (GdkWindow      *window,
269                                            gint            x,
270                                            gint            y,
271                                            guint           button,
272                                            GdkModifierType modifiers,
273                                            GdkEventType    event_type);
274
275   gboolean     (*get_property)            (GdkWindow      *window,
276                                            GdkAtom         property,
277                                            GdkAtom         type,
278                                            gulong          offset,
279                                            gulong          length,
280                                            gint            pdelete,
281                                            GdkAtom        *actual_type,
282                                            gint           *actual_format,
283                                            gint           *actual_length,
284                                            guchar        **data);
285   void         (*change_property)         (GdkWindow      *window,
286                                            GdkAtom         property,
287                                            GdkAtom         type,
288                                            gint            format,
289                                            GdkPropMode     mode,
290                                            const guchar   *data,
291                                            gint            n_elements);
292   void         (*delete_property)         (GdkWindow      *window,
293                                            GdkAtom         property);
294 };
295
296 /* Interface Functions */
297 GType gdk_window_impl_get_type (void) G_GNUC_CONST;
298
299
300 G_END_DECLS
301
302 #endif /* __GDK_WINDOW_IMPL_H__ */