]> Pileus Git - ~andy/gtk/blob - gdk/gdkwindowimpl.h
Implement gdk_window_clear_area natively for foreign windows
[~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
55   void         (* move_resize)          (GdkWindow       *window,
56                                          gboolean         with_move,
57                                          gint             x,
58                                          gint             y,
59                                          gint             width,
60                                          gint             height);
61   void         (* set_background)       (GdkWindow       *window,
62                                          const GdkColor  *color);
63   void         (* set_back_pixmap)      (GdkWindow       *window,
64                                          GdkPixmap       *pixmap);
65
66   GdkEventMask (* get_events)           (GdkWindow       *window);
67   void         (* set_events)           (GdkWindow       *window,
68                                          GdkEventMask     event_mask);
69   
70   gboolean     (* reparent)             (GdkWindow       *window,
71                                          GdkWindow       *new_parent,
72                                          gint             x,
73                                          gint             y);
74   void         (* clear_area)           (GdkWindow       *window,
75                                          gint             x,
76                                          gint             y,
77                                          gint             width,
78                                          gint             height,
79                                          gboolean         send_expose);
80   
81   void         (* set_cursor)           (GdkWindow       *window,
82                                          GdkCursor       *cursor);
83
84   void         (* get_geometry)         (GdkWindow       *window,
85                                          gint            *x,
86                                          gint            *y,
87                                          gint            *width,
88                                          gint            *height,
89                                          gint            *depth);
90   gint         (* get_root_coords)      (GdkWindow       *window,
91                                          gint             x,
92                                          gint             y,
93                                          gint            *root_x,
94                                          gint            *root_y);
95   gint         (* get_deskrelative_origin) (GdkWindow       *window,
96                                          gint            *x,
97                                          gint            *y);
98   gboolean     (* get_pointer)          (GdkWindow       *window,
99                                          gint            *x,
100                                          gint            *y,
101                                          GdkModifierType  *mask);
102
103   void         (* shape_combine_region) (GdkWindow       *window,
104                                          const GdkRegion *shape_region,
105                                          gint             offset_x,
106                                          gint             offset_y);
107   void         (* input_shape_combine_region) (GdkWindow       *window,
108                                                const GdkRegion *shape_region,
109                                                gint             offset_x,
110                                                gint             offset_y);
111
112   gboolean     (* set_static_gravities) (GdkWindow       *window,
113                                          gboolean         use_static);
114
115   /* Called before processing updates for a window. This gives the windowing
116    * layer a chance to save the region for later use in avoiding duplicate
117    * exposes. The return value indicates whether the function has a saved
118    * the region; if the result is TRUE, then the windowing layer is responsible
119    * for destroying the region later.
120    */
121   gboolean     (* queue_antiexpose)     (GdkWindow       *window,
122                                          GdkRegion       *update_area);
123   void         (* queue_translation)    (GdkWindow       *window,
124                                          GdkRegion       *area,
125                                          gint            dx,
126                                          gint            dy);
127
128 /* Called to do the windowing system specific part of gdk_window_destroy(),
129  *
130  * window: The window being destroyed
131  * recursing: If TRUE, then this is being called because a parent
132  *            was destroyed. This generally means that the call to the windowing system
133  *            to destroy the window can be omitted, since it will be destroyed as a result
134  *            of the parent being destroyed. Unless @foreign_destroy
135  *            
136  * foreign_destroy: If TRUE, the window or a parent was destroyed by some external 
137  *            agency. The window has already been destroyed and no windowing
138  *            system calls should be made. (This may never happen for some
139  *            windowing systems.)
140  */
141   void         (* destroy)              (GdkWindow       *window,
142                                          gboolean         recursing,
143                                          gboolean         foreign_destroy);
144
145   void         (* input_window_destroy) (GdkWindow       *window);
146   void         (* input_window_crossing)(GdkWindow       *window,
147                                          gboolean         enter);
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__ */