]> Pileus Git - ~andy/gtk/blob - gdk/gdkprivate.h
Large changes to the Win32 backend, partially made necessary by the
[~andy/gtk] / gdk / gdkprivate.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 Library 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  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library 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-1999.  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_PRIVATE_H__
28 #define __GDK_PRIVATE_H__
29
30 #include <gdk/gdktypes.h>
31 #include <gdk/gdkevents.h>
32 #include <gdk/gdkfont.h>
33 #include <gdk/gdkgc.h>
34 #include <gdk/gdkim.h>
35 #include <gdk/gdkimage.h>
36 #include <gdk/gdkregion.h>
37 #include <gdk/gdkvisual.h>
38 #include <gdk/gdkwindow.h>
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif /* __cplusplus */
43
44 #define GDK_PARENT_RELATIVE_BG ((GdkPixmap *)1L)
45 #define GDK_NO_BG ((GdkPixmap *)2L)
46
47 #define GDK_DRAWABLE_TYPE(d) (((GdkDrawablePrivate *)d)->window_type)
48 #define GDK_IS_WINDOW(d) (GDK_DRAWABLE_TYPE(d) <= GDK_WINDOW_TEMP || \
49                           GDK_DRAWABLE_TYPE(d) == GDK_WINDOW_FOREIGN)
50 #define GDK_IS_PIXMAP(d) (GDK_DRAWABLE_TYPE(d) == GDK_DRAWABLE_PIXMAP)
51 #define GDK_DRAWABLE_DESTROYED(d) (((GdkDrawablePrivate *)d)->destroyed)
52
53 #define gdk_window_lookup(xid)     ((GdkWindow*) gdk_xid_table_lookup (xid))
54 #define gdk_pixmap_lookup(xid)     ((GdkPixmap*) gdk_xid_table_lookup (xid))
55 #define gdk_font_lookup(xid)       ((GdkFont*) gdk_xid_table_lookup (xid))
56
57 typedef struct _GdkDrawablePrivate     GdkDrawablePrivate;
58 typedef struct _GdkWindowPrivate       GdkWindowPrivate;
59 typedef struct _GdkImageClass          GdkImageClass;
60 typedef struct _GdkImagePrivate        GdkImagePrivate;
61 typedef struct _GdkGCPrivate           GdkGCPrivate;
62 typedef struct _GdkColormapPrivate     GdkColormapPrivate;
63 typedef struct _GdkColorInfo           GdkColorInfo;
64 typedef struct _GdkFontPrivate         GdkFontPrivate;
65 typedef struct _GdkEventFilter         GdkEventFilter;
66 typedef struct _GdkClientFilter        GdkClientFilter;
67
68 struct _GdkDrawablePrivate
69 {
70   GdkDrawable drawable;
71   GdkDrawableClass *klass;
72   gpointer klass_data;
73
74   guint ref_count;
75
76   gint width;
77   gint height;
78
79   GdkColormap *colormap;
80
81   guint8 window_type;
82   guint8 depth;
83   
84   guint destroyed : 2;
85 };
86
87 struct _GdkWindowPrivate
88 {
89   GdkDrawablePrivate drawable;
90   
91   GdkWindow *parent;
92   gint x;
93   gint y;
94   guint8 resize_count;
95   guint mapped : 1;
96   guint guffaw_gravity : 1;
97   guint input_only : 1;
98
99   gint extension_events;
100
101   GList *filters;
102   GList *children;
103
104   GdkColor bg_color;
105   GdkPixmap *bg_pixmap;
106   
107   GSList *paint_stack;
108   
109   GdkRegion *update_area;
110   guint update_freeze_count;
111 };
112
113 struct _GdkImageClass 
114 {
115   void (*destroy)   (GdkImage    *image);
116   void (*image_put) (GdkImage    *image,
117                      GdkDrawable *window,
118                      GdkGC       *gc,
119                      gint         xsrc,
120                      gint         ysrc,
121                      gint         xdest,
122                      gint         ydest,
123                      gint         width,
124                      gint         height);
125 };
126
127 struct _GdkImagePrivate
128 {
129   GdkImage image;
130
131   guint ref_count;
132   GdkImageClass *klass;
133 };
134
135 struct _GdkFontPrivate
136 {
137   GdkFont font;
138   guint ref_count;
139 };
140
141 struct _GdkGCPrivate
142 {
143   guint ref_count;
144   GdkGCClass *klass;
145   gpointer klass_data;
146
147   gint clip_x_origin;
148   gint clip_y_origin;
149   gint ts_x_origin;
150   gint ts_y_origin;
151 };
152
153 typedef enum {
154   GDK_COLOR_WRITEABLE = 1 << 0
155 } GdkColorInfoFlags;
156
157 struct _GdkColorInfo
158 {
159   GdkColorInfoFlags flags;
160   guint ref_count;
161 };
162
163 struct _GdkColormapPrivate
164 {
165   GdkColormap colormap;
166   GdkVisual *visual;
167
168   guint ref_count;
169 };
170
171 struct _GdkEventFilter {
172   GdkFilterFunc function;
173   gpointer data;
174 };
175
176 struct _GdkClientFilter {
177   GdkAtom       type;
178   GdkFilterFunc function;
179   gpointer      data;
180 };
181
182 void gdk_window_destroy_notify       (GdkWindow *window);
183
184 GDKVAR GdkWindow        *gdk_parent_root;
185 GDKVAR gint              gdk_error_code;
186 GDKVAR gint              gdk_error_warnings;
187
188 #ifdef __cplusplus
189 }
190 #endif /* __cplusplus */
191
192
193 #endif /* __GDK_PRIVATE_H__ */
194
195
196
197
198