]> Pileus Git - ~andy/gtk/blob - gdk/gdkwindowimpl.h
gdk: Make window moves a custom vfunc
[~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   void         (* clear_region)         (GdkWindow       *window,
78                                          cairo_region_t       *region,
79                                          gboolean         send_expose);
80
81   void         (* set_device_cursor)    (GdkWindow       *window,
82                                          GdkDevice       *device,
83                                          GdkCursor       *cursor);
84
85   void         (* get_geometry)         (GdkWindow       *window,
86                                          gint            *x,
87                                          gint            *y,
88                                          gint            *width,
89                                          gint            *height,
90                                          gint            *depth);
91   gint         (* get_root_coords)      (GdkWindow       *window,
92                                          gint             x,
93                                          gint             y,
94                                          gint            *root_x,
95                                          gint            *root_y);
96   gint         (* get_deskrelative_origin) (GdkWindow       *window,
97                                          gint            *x,
98                                          gint            *y);
99   gboolean     (* get_device_state)     (GdkWindow       *window,
100                                          GdkDevice       *device,
101                                          gint            *x,
102                                          gint            *y,
103                                          GdkModifierType *mask);
104
105   void         (* shape_combine_region) (GdkWindow       *window,
106                                          const cairo_region_t *shape_region,
107                                          gint             offset_x,
108                                          gint             offset_y);
109   void         (* input_shape_combine_region) (GdkWindow       *window,
110                                                const cairo_region_t *shape_region,
111                                                gint             offset_x,
112                                                gint             offset_y);
113
114   gboolean     (* set_static_gravities) (GdkWindow       *window,
115                                          gboolean         use_static);
116
117   /* Called before processing updates for a window. This gives the windowing
118    * layer a chance to save the region for later use in avoiding duplicate
119    * exposes. The return value indicates whether the function has a saved
120    * the region; if the result is TRUE, then the windowing layer is responsible
121    * for destroying the region later.
122    */
123   gboolean     (* queue_antiexpose)     (GdkWindow       *window,
124                                          cairo_region_t  *update_area);
125
126   /* Called to move @area inside @window by @dx x @dy pixels. @area is 
127    * guaranteed to be inside @window. If part of @area is not invisible or
128    * invalid, it is this function's job to queue expose events in those 
129    * areas.
130    */
131   void         (* translate)            (GdkWindow       *window,
132                                          cairo_region_t  *area,
133                                          gint            dx,
134                                          gint            dy);
135
136 /* Called to do the windowing system specific part of gdk_window_destroy(),
137  *
138  * window: The window being destroyed
139  * recursing: If TRUE, then this is being called because a parent
140  *            was destroyed. This generally means that the call to the windowing system
141  *            to destroy the window can be omitted, since it will be destroyed as a result
142  *            of the parent being destroyed. Unless @foreign_destroy
143  *            
144  * foreign_destroy: If TRUE, the window or a parent was destroyed by some external 
145  *            agency. The window has already been destroyed and no windowing
146  *            system calls should be made. (This may never happen for some
147  *            windowing systems.)
148  */
149   void         (* destroy)              (GdkWindow       *window,
150                                          gboolean         recursing,
151                                          gboolean         foreign_destroy);
152   gboolean     supports_native_bg;
153 };
154
155 /* Interface Functions */
156 GType gdk_window_impl_get_type (void) G_GNUC_CONST;
157
158 /* private definitions from gdkwindow.h */
159
160 struct _GdkWindowRedirect
161 {
162   GdkWindowObject *redirected;
163   GdkDrawable *pixmap;
164
165   gint src_x;
166   gint src_y;
167   gint dest_x;
168   gint dest_y;
169   gint width;
170   gint height;
171
172   cairo_region_t *damage;
173   guint damage_idle;
174 };
175
176 G_END_DECLS
177
178 #endif /* __GDK_WINDOW_IMPL_H__ */