]> Pileus Git - ~andy/gtk/blob - gdk/gdkwindowimpl.h
fcb8ba235e92644719b0cf75a829c5d37ec7445e
[~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(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImpl))
36 #define GDK_IS_WINDOW_IMPL(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_WINDOW_IMPL))
37 #define GDK_WINDOW_IMPL_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GDK_TYPE_WINDOW_IMPL, GdkWindowImplIface))
38
39 typedef struct _GdkWindowImpl       GdkWindowImpl;      /* dummy */
40 typedef struct _GdkWindowImplIface  GdkWindowImplIface;
41
42 struct _GdkWindowImplIface
43 {
44   GTypeInterface g_iface;
45
46   void         (* show)                 (GdkWindow       *window,
47                                          gboolean         already_mapped);
48   void         (* hide)                 (GdkWindow       *window);
49   void         (* withdraw)             (GdkWindow       *window);
50   void         (* raise)                (GdkWindow       *window);
51   void         (* lower)                (GdkWindow       *window);
52   void         (* restack_under)        (GdkWindow       *window,
53                                          GList           *native_siblings);
54   void         (* restack_toplevel)     (GdkWindow       *window,
55                                          GdkWindow       *sibling,
56                                          gboolean        above);
57
58   void         (* move_resize)          (GdkWindow       *window,
59                                          gboolean         with_move,
60                                          gint             x,
61                                          gint             y,
62                                          gint             width,
63                                          gint             height);
64   void         (* set_background)       (GdkWindow       *window,
65                                          const GdkColor  *color);
66   void         (* set_back_pixmap)      (GdkWindow       *window,
67                                          GdkPixmap       *pixmap);
68
69   GdkEventMask (* get_events)           (GdkWindow       *window);
70   void         (* set_events)           (GdkWindow       *window,
71                                          GdkEventMask     event_mask);
72   
73   gboolean     (* reparent)             (GdkWindow       *window,
74                                          GdkWindow       *new_parent,
75                                          gint             x,
76                                          gint             y);
77
78   void         (* set_device_cursor)    (GdkWindow       *window,
79                                          GdkDevice       *device,
80                                          GdkCursor       *cursor);
81
82   void         (* get_geometry)         (GdkWindow       *window,
83                                          gint            *x,
84                                          gint            *y,
85                                          gint            *width,
86                                          gint            *height,
87                                          gint            *depth);
88   gint         (* get_root_coords)      (GdkWindow       *window,
89                                          gint             x,
90                                          gint             y,
91                                          gint            *root_x,
92                                          gint            *root_y);
93   gboolean     (* get_device_state)     (GdkWindow       *window,
94                                          GdkDevice       *device,
95                                          gint            *x,
96                                          gint            *y,
97                                          GdkModifierType *mask);
98
99   void         (* shape_combine_region) (GdkWindow       *window,
100                                          const cairo_region_t *shape_region,
101                                          gint             offset_x,
102                                          gint             offset_y);
103   void         (* input_shape_combine_region) (GdkWindow       *window,
104                                                const cairo_region_t *shape_region,
105                                                gint             offset_x,
106                                                gint             offset_y);
107
108   gboolean     (* set_static_gravities) (GdkWindow       *window,
109                                          gboolean         use_static);
110
111   /* Called before processing updates for a window. This gives the windowing
112    * layer a chance to save the region for later use in avoiding duplicate
113    * exposes. The return value indicates whether the function has a saved
114    * the region; if the result is TRUE, then the windowing layer is responsible
115    * for destroying the region later.
116    */
117   gboolean     (* queue_antiexpose)     (GdkWindow       *window,
118                                          cairo_region_t  *update_area);
119
120   /* Called to move @area inside @window by @dx x @dy pixels. @area is 
121    * guaranteed to be inside @window. If part of @area is not invisible or
122    * invalid, it is this function's job to queue expose events in those 
123    * areas.
124    */
125   void         (* translate)            (GdkWindow       *window,
126                                          cairo_region_t  *area,
127                                          gint            dx,
128                                          gint            dy);
129
130 /* Called to do the windowing system specific part of gdk_window_destroy(),
131  *
132  * window: The window being destroyed
133  * recursing: If TRUE, then this is being called because a parent
134  *            was destroyed. This generally means that the call to the windowing system
135  *            to destroy the window can be omitted, since it will be destroyed as a result
136  *            of the parent being destroyed. Unless @foreign_destroy
137  *            
138  * foreign_destroy: If TRUE, the window or a parent was destroyed by some external 
139  *            agency. The window has already been destroyed and no windowing
140  *            system calls should be made. (This may never happen for some
141  *            windowing systems.)
142  */
143   void         (* destroy)              (GdkWindow       *window,
144                                          gboolean         recursing,
145                                          gboolean         foreign_destroy);
146   gboolean     supports_native_bg;
147 };
148
149 /* Interface Functions */
150 GType gdk_window_impl_get_type (void) G_GNUC_CONST;
151
152 /* private definitions from gdkwindow.h */
153
154 struct _GdkWindowRedirect
155 {
156   GdkWindowObject *redirected;
157   GdkDrawable *pixmap;
158
159   gint src_x;
160   gint src_y;
161   gint dest_x;
162   gint dest_y;
163   gint width;
164   gint height;
165
166   cairo_region_t *damage;
167   guint damage_idle;
168 };
169
170 G_END_DECLS
171
172 #endif /* __GDK_WINDOW_IMPL_H__ */