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