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 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.
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.
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.
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/.
27 /* Uninstalled header defining types and functions internal to GDK */
29 #include <gdk/gdktypes.h>
30 #include <gdk/gdkprivate.h>
32 #ifndef __GDK_INTERNALS_H__
33 #define __GDK_INTERNALS_H__
35 /**********************
36 * General Facilities *
37 **********************/
39 /* Debugging support */
41 typedef struct _GdkColorInfo GdkColorInfo;
42 typedef struct _GdkEventFilter GdkEventFilter;
43 typedef struct _GdkClientFilter GdkClientFilter;
46 GDK_COLOR_WRITEABLE = 1 << 0
51 GdkColorInfoFlags flags;
55 struct _GdkEventFilter {
56 GdkFilterFunc function;
60 struct _GdkClientFilter {
62 GdkFilterFunc function;
67 GDK_DEBUG_MISC = 1 << 0,
68 GDK_DEBUG_EVENTS = 1 << 1,
69 GDK_DEBUG_DND = 1 << 2,
70 GDK_DEBUG_XIM = 1 << 3,
71 GDK_DEBUG_NOGRABS = 1 << 4,
74 #ifndef GDK_DISABLE_DEPRECATED
76 typedef struct _GdkFontPrivate GdkFontPrivate;
78 struct _GdkFontPrivate
84 #endif /* GDK_DISABLE_DEPRECATED */
86 extern GList *_gdk_default_filters;
87 extern GdkWindow *_gdk_parent_root;
88 extern gint _gdk_error_code;
89 extern gint _gdk_error_warnings;
91 extern guint _gdk_debug_flags;
95 #define GDK_NOTE(type,action) G_STMT_START { \
96 if (_gdk_debug_flags & GDK_DEBUG_##type) \
97 { action; }; } G_STMT_END
99 #else /* !G_ENABLE_DEBUG */
101 #define GDK_NOTE(type,action)
103 #endif /* G_ENABLE_DEBUG */
116 typedef struct _GdkArgContext GdkArgContext;
117 typedef struct _GdkArgDesc GdkArgDesc;
119 typedef void (*GdkArgFunc) (const char *name, const char *arg, gpointer data);
121 struct _GdkArgContext
137 extern GdkEventFunc _gdk_event_func; /* Callback for events */
138 extern gpointer _gdk_event_data;
139 extern GDestroyNotify _gdk_event_notify;
141 /* FIFO's for event queue, and for events put back using
144 extern GList *_gdk_queued_events;
145 extern GList *_gdk_queued_tail;
147 extern GdkDevice *_gdk_core_pointer;
149 GdkEvent* _gdk_event_new (void);
151 void _gdk_events_init (void);
152 void _gdk_events_queue (void);
153 GdkEvent* _gdk_event_unqueue (void);
155 GList* _gdk_event_queue_find_first (void);
156 void _gdk_event_queue_remove_link (GList *node);
157 void _gdk_event_queue_append (GdkEvent *event);
159 void _gdk_event_button_generate (GdkEvent *event);
161 #define GDK_SCRATCH_IMAGE_WIDTH 256
162 #define GDK_SCRATCH_IMAGE_HEIGHT 64
164 GdkImage* _gdk_image_new_for_depth (GdkImageType type,
169 GdkImage *_gdk_image_get_scratch (gint width,
175 /* Will most likely be exported in the future
177 void _gdk_draw_pixbuf (GdkDrawable *drawable,
189 GdkImage *_gdk_drawable_copy_to_image (GdkDrawable *drawable,
198 /*************************************
199 * Interfaces used by windowing code *
200 *************************************/
202 void _gdk_window_destroy (GdkWindow *window,
203 gboolean foreign_destroy);
204 void _gdk_window_clear_update_area (GdkWindow *window);
207 /*****************************************
208 * Interfaces provided by windowing code *
209 *****************************************/
211 /* Font/string functions implemented in module-specific code */
212 gint _gdk_font_strlen (GdkFont *font, const char *str);
213 void _gdk_font_destroy (GdkFont *font);
215 void _gdk_colormap_real_destroy (GdkColormap *colormap);
217 void _gdk_cursor_destroy (GdkCursor *cursor);
219 extern GdkArgDesc _gdk_windowing_args[];
220 gboolean _gdk_windowing_init_check (int argc,
222 void _gdk_windowing_window_get_offsets (GdkWindow *window,
225 void _gdk_windowing_window_clear_area (GdkWindow *window,
230 void _gdk_windowing_window_clear_area_e (GdkWindow *window,
236 GdkWindow* _gdk_windowing_window_at_pointer (GdkScreen *screen,
239 GdkWindow* _gdk_windowing_window_get_pointer (GdkWindow *window,
242 GdkModifierType *mask);
244 /* Return the number of bits-per-pixel for images of the specified depth.
245 * (Future: needs to be GdkDiplay specific.)
247 gint _gdk_windowing_get_bits_for_depth (gint depth);
249 #define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
251 /* Called before processing updates for a window. This gives the windowing
252 * layer a chance to save the region for later use in avoiding duplicate
253 * exposes. The return value indicates whether the function has a saved
254 * the region; if the result is TRUE, then the windowing layer is responsible
255 * for destroying the region later.
257 gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
260 /* Called to do the windowing system specific part of gdk_window_destroy(),
262 * window: The window being destroyed
263 * recursing: If TRUE, then this is being called because a parent
264 * was destroyed. This generally means that the call to the windowing system
265 * to destroy the window can be omitted, since it will be destroyed as a result
266 * of the parent being destroyed. Unless @foreign_destroy
268 * foreign_destroy: If TRUE, the window or a parent was destroyed by some external
269 * agency. The window has already been destroyed and no windowing
270 * system calls should be made. (This may never happen for some
271 * windowing systems.)
273 void _gdk_windowing_window_destroy (GdkWindow *window,
275 gboolean foreign_destroy);
277 /* Implementation types */
278 GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
279 GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
281 /************************************
282 * Initialization and exit routines *
283 ************************************/
285 void _gdk_windowing_window_init (void);
286 void _gdk_visual_init (void);
287 void _gdk_dnd_init (void);
289 void _gdk_windowing_image_init (void);
290 void _gdk_image_exit (void);
292 void _gdk_input_init (void);
293 void _gdk_input_exit (void);
295 void _gdk_windowing_exit (void);
299 #endif /* __cplusplus */
301 #endif /* __GDK_INTERNALS_H__ */