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