]> Pileus Git - ~andy/gtk/blob - gdk/gdkwindowimpl.h
Merge the xi2-for-master branch
[~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                                          GdkRegion       *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 GdkRegion *shape_region,
107                                          gint             offset_x,
108                                          gint             offset_y);
109   void         (* input_shape_combine_region) (GdkWindow       *window,
110                                                const GdkRegion *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                                          GdkRegion       *update_area);
125   void         (* queue_translation)    (GdkWindow       *window,
126                                          GdkGC           *gc,
127                                          GdkRegion       *area,
128                                          gint            dx,
129                                          gint            dy);
130
131 /* Called to do the windowing system specific part of gdk_window_destroy(),
132  *
133  * window: The window being destroyed
134  * recursing: If TRUE, then this is being called because a parent
135  *            was destroyed. This generally means that the call to the windowing system
136  *            to destroy the window can be omitted, since it will be destroyed as a result
137  *            of the parent being destroyed. Unless @foreign_destroy
138  *            
139  * foreign_destroy: If TRUE, the window or a parent was destroyed by some external 
140  *            agency. The window has already been destroyed and no windowing
141  *            system calls should be made. (This may never happen for some
142  *            windowing systems.)
143  */
144   void         (* destroy)              (GdkWindow       *window,
145                                          gboolean         recursing,
146                                          gboolean         foreign_destroy);
147   gboolean     supports_native_bg;
148 };
149
150 /* Interface Functions */
151 GType gdk_window_impl_get_type (void) G_GNUC_CONST;
152
153 /* private definitions from gdkwindow.h */
154
155 struct _GdkWindowRedirect
156 {
157   GdkWindowObject *redirected;
158   GdkDrawable *pixmap;
159
160   gint src_x;
161   gint src_y;
162   gint dest_x;
163   gint dest_y;
164   gint width;
165   gint height;
166
167   GdkRegion *damage;
168   guint damage_idle;
169 };
170
171 G_END_DECLS
172
173 #endif /* __GDK_WINDOW_IMPL_H__ */