1 /* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
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/.
27 #ifndef __GDK_PRIVATE_H__
28 #define __GDK_PRIVATE_H__
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>
42 #endif /* __cplusplus */
44 #define GDK_DRAWABLE_TYPE(d) (((GdkDrawablePrivate *)d)->window_type)
45 #define GDK_IS_WINDOW(d) (GDK_DRAWABLE_TYPE(d) <= GDK_WINDOW_TEMP || \
46 GDK_DRAWABLE_TYPE(d) == GDK_WINDOW_FOREIGN)
47 #define GDK_IS_PIXMAP(d) (GDK_DRAWABLE_TYPE(d) == GDK_DRAWABLE_PIXMAP)
48 #define GDK_DRAWABLE_DESTROYED(d) (((GdkDrawablePrivate *)d)->destroyed)
50 #define gdk_window_lookup(xid) ((GdkWindow*) gdk_xid_table_lookup (xid))
51 #define gdk_pixmap_lookup(xid) ((GdkPixmap*) gdk_xid_table_lookup (xid))
52 #define gdk_font_lookup(xid) ((GdkFont*) gdk_xid_table_lookup (xid))
54 typedef struct _GdkDrawablePrivate GdkDrawablePrivate;
55 /* typedef struct _GdkDrawablePrivate GdkPixmapPrivate; */
56 typedef struct _GdkWindowPrivate GdkWindowPrivate;
57 typedef struct _GdkImageClass GdkImageClass;
58 typedef struct _GdkImagePrivate GdkImagePrivate;
59 typedef struct _GdkGCPrivate GdkGCPrivate;
60 typedef struct _GdkColormapPrivate GdkColormapPrivate;
61 typedef struct _GdkColorInfo GdkColorInfo;
62 typedef struct _GdkFontPrivate GdkFontPrivate;
63 typedef struct _GdkEventFilter GdkEventFilter;
64 typedef struct _GdkClientFilter GdkClientFilter;
66 struct _GdkDrawablePrivate
69 GdkDrawableClass *klass;
78 GdkColormap *colormap;
83 struct _GdkWindowPrivate
85 GdkDrawablePrivate drawable;
92 guint guffaw_gravity : 1;
94 gint extension_events;
100 struct _GdkImageClass
102 void (*destroy) (GdkImage *image);
103 void (*image_put) (GdkImage *image,
114 struct _GdkImagePrivate
119 GdkImageClass *klass;
122 struct _GdkFontPrivate
136 GDK_COLOR_WRITEABLE = 1 << 0
141 GdkColorInfoFlags flags;
145 struct _GdkColormapPrivate
147 GdkColormap colormap;
153 struct _GdkEventFilter {
154 GdkFilterFunc function;
158 struct _GdkClientFilter {
160 GdkFilterFunc function;
174 typedef struct _GdkArgContext GdkArgContext;
175 typedef struct _GdkArgDesc GdkArgDesc;
177 typedef void (*GdkArgFunc) (const char *name, const char *arg, gpointer data);
179 struct _GdkArgContext
195 GDK_DEBUG_MISC = 1 << 0,
196 GDK_DEBUG_EVENTS = 1 << 1,
197 GDK_DEBUG_DND = 1 << 2,
198 GDK_DEBUG_COLOR_CONTEXT = 1 << 3,
199 GDK_DEBUG_XIM = 1 << 4
202 void gdk_event_button_generate (GdkEvent *event);
204 /* FIFO's for event queue, and for events put back using
207 extern GList *gdk_queued_events;
208 extern GList *gdk_queued_tail;
210 extern GdkEventFunc gdk_event_func; /* Callback for events */
211 extern gpointer gdk_event_data;
212 extern GDestroyNotify gdk_event_notify;
214 GdkEvent* gdk_event_new (void);
216 void gdk_events_init (void);
217 void gdk_events_queue (void);
218 GdkEvent* gdk_event_unqueue (void);
220 GList* gdk_event_queue_find_first (void);
221 void gdk_event_queue_remove_link (GList *node);
222 void gdk_event_queue_append (GdkEvent *event);
224 void gdk_window_init (void);
225 void gdk_visual_init (void);
226 void gdk_dnd_init (void);
228 void gdk_image_init (void);
229 void gdk_image_exit (void);
231 void gdk_input_init (void);
232 void gdk_input_exit (void);
234 void gdk_windowing_exit (void);
236 void gdk_window_add_colormap_windows (GdkWindow *window);
237 void gdk_window_destroy_notify (GdkWindow *window);
239 /* If you pass x = y = -1, it queries the pointer
240 to find out where it currently is.
241 If you pass x = y = -2, it does anything necessary
242 to know that the drag is ending.
244 void gdk_dnd_display_drag_cursor(gint x,
247 gboolean change_made);
249 extern gint gdk_debug_level;
250 extern gboolean gdk_show_events;
251 extern gint gdk_screen;
252 GDKVAR GdkWindow *gdk_parent_root;
253 GDKVAR gint gdk_error_code;
254 GDKVAR gint gdk_error_warnings;
255 extern GList *gdk_default_filters;
257 GdkWindow* _gdk_window_alloc (void);
259 /* Font/string functions implemented in module-specific code */
260 gint _gdk_font_strlen (GdkFont *font, const char *str);
261 void _gdk_font_destroy (GdkFont *font);
263 void _gdk_colormap_real_destroy (GdkColormap *colormap);
265 void _gdk_cursor_destroy (GdkCursor *cursor);
269 extern GdkArgDesc _gdk_windowing_args[];
270 gboolean _gdk_windowing_init_check (int argc, char **argv);
274 gint gdk_im_open (void);
275 void gdk_im_close (void);
276 void gdk_ic_cleanup (void);
279 /* Debugging support */
281 #ifdef G_ENABLE_DEBUG
283 #define GDK_NOTE(type,action) G_STMT_START { \
284 if (gdk_debug_flags & GDK_DEBUG_##type) \
285 { action; }; } G_STMT_END
287 #else /* !G_ENABLE_DEBUG */
289 #define GDK_NOTE(type,action)
291 #endif /* G_ENABLE_DEBUG */
293 GDKVAR guint gdk_debug_flags;
298 #endif /* __cplusplus */
301 #endif /* __GDK_PRIVATE_H__ */