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