]> 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
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            *depth);
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 system
145  *            to destroy the window can be omitted, since it will be destroyed as a result
146  *            of the parent being destroyed. Unless @foreign_destroy
147  *            
148  * foreign_destroy: If TRUE, the window or a parent was destroyed by some external 
149  *            agency. The window has already been destroyed and no windowing
150  *            system calls should be made. (This may never happen for some
151  *            windowing systems.)
152  */
153   void         (* destroy)              (GdkWindow       *window,
154                                          gboolean         recursing,
155                                          gboolean         foreign_destroy);
156
157   cairo_surface_t * (* resize_cairo_surface) (GdkWindow       *window,
158                                               cairo_surface_t *surface,
159                                               gint             width,
160                                               gint             height);
161
162   /* optional */
163   gboolean     (* beep)                 (GdkWindow       *window);
164 };
165
166 /* Interface Functions */
167 GType gdk_window_impl_get_type (void) G_GNUC_CONST;
168
169
170 G_END_DECLS
171
172 #endif /* __GDK_WINDOW_IMPL_H__ */