]> Pileus Git - ~andy/gtk/blob - gdk/gdkprivate.h
*** empty log message ***
[~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 #define GDK_DRAWABLE_P(d) ((GdkDrawablePrivate*)d)
53 #define GDK_WINDOW_P(d) ((GdkWindowPrivate*)d)
54 #define GDK_GC_P(d) ((GdkGCPrivate*)d)
55
56 typedef struct _GdkDrawablePrivate     GdkDrawablePrivate;
57 typedef struct _GdkWindowPrivate       GdkWindowPrivate;
58 typedef struct _GdkImageClass          GdkImageClass;
59 typedef struct _GdkImagePrivate        GdkImagePrivate;
60 typedef struct _GdkGCPrivate           GdkGCPrivate;
61 typedef struct _GdkColormapPrivate     GdkColormapPrivate;
62 typedef struct _GdkColorInfo           GdkColorInfo;
63 typedef struct _GdkFontPrivate         GdkFontPrivate;
64 typedef struct _GdkEventFilter         GdkEventFilter;
65 typedef struct _GdkClientFilter        GdkClientFilter;
66
67 struct _GdkDrawablePrivate
68 {
69   GdkDrawable drawable;
70   GdkDrawableClass *klass;
71   gpointer klass_data;
72
73   guint ref_count;
74
75   gint width;
76   gint height;
77
78   GdkColormap *colormap;
79
80   guint8 window_type;
81   guint8 depth;
82   
83   guint destroyed : 2;
84 };
85
86 struct _GdkWindowPrivate
87 {
88   GdkDrawablePrivate drawable;
89   
90   GdkWindow *parent;
91   gint x;
92   gint y;
93   guint8 resize_count;
94   guint mapped : 1;
95   guint guffaw_gravity : 1;
96   guint input_only : 1;
97
98   gint extension_events;
99
100   GList *filters;
101   GList *children;
102
103   GdkColor bg_color;
104   GdkPixmap *bg_pixmap;
105   
106   GSList *paint_stack;
107   
108   GdkRegion *update_area;
109   guint update_freeze_count;
110 };
111
112 struct _GdkImageClass 
113 {
114   void (*destroy)   (GdkImage    *image);
115   void (*image_put) (GdkImage    *image,
116                      GdkDrawable *window,
117                      GdkGC       *gc,
118                      gint         xsrc,
119                      gint         ysrc,
120                      gint         xdest,
121                      gint         ydest,
122                      gint         width,
123                      gint         height);
124 };
125
126 struct _GdkImagePrivate
127 {
128   GdkImage image;
129
130   guint ref_count;
131   GdkImageClass *klass;
132 };
133
134 struct _GdkFontPrivate
135 {
136   GdkFont font;
137   guint ref_count;
138 };
139
140 struct _GdkGCPrivate
141 {
142   guint ref_count;
143   GdkGCClass *klass;
144   gpointer klass_data;
145
146   gint clip_x_origin;
147   gint clip_y_origin;
148   gint ts_x_origin;
149   gint ts_y_origin;
150 };
151
152 typedef enum {
153   GDK_COLOR_WRITEABLE = 1 << 0
154 } GdkColorInfoFlags;
155
156 struct _GdkColorInfo
157 {
158   GdkColorInfoFlags flags;
159   guint ref_count;
160 };
161
162 struct _GdkColormapPrivate
163 {
164   GdkColormap colormap;
165   GdkVisual *visual;
166
167   guint ref_count;
168 };
169
170 struct _GdkEventFilter {
171   GdkFilterFunc function;
172   gpointer data;
173 };
174
175 struct _GdkClientFilter {
176   GdkAtom       type;
177   GdkFilterFunc function;
178   gpointer      data;
179 };
180
181 void gdk_window_destroy_notify       (GdkWindow *window);
182
183 GDKVAR GdkWindow        *gdk_parent_root;
184 GDKVAR gint              gdk_error_code;
185 GDKVAR gint              gdk_error_warnings;
186
187 #ifdef __cplusplus
188 }
189 #endif /* __cplusplus */
190
191
192 #endif /* __GDK_PRIVATE_H__ */
193
194
195
196
197