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,
72 GDK_DEBUG_COLORMAP = 1 << 5,
73 GDK_DEBUG_GDKRGB = 1 << 6,
74 GDK_DEBUG_GC = 1 << 7,
75 GDK_DEBUG_PIXMAP = 1 << 8,
76 GDK_DEBUG_IMAGE = 1 << 9,
77 GDK_DEBUG_INPUT = 1 <<10,
78 GDK_DEBUG_CURSOR = 1 <<11
81 #ifndef GDK_DISABLE_DEPRECATED
83 typedef struct _GdkFontPrivate GdkFontPrivate;
85 struct _GdkFontPrivate
91 #endif /* GDK_DISABLE_DEPRECATED */
93 extern GList *_gdk_default_filters;
94 extern GdkWindow *_gdk_parent_root;
95 extern gint _gdk_error_code;
96 extern gint _gdk_error_warnings;
98 extern guint _gdk_debug_flags;
100 #ifdef G_ENABLE_DEBUG
102 #define GDK_NOTE(type,action) G_STMT_START { \
103 if (_gdk_debug_flags & GDK_DEBUG_##type) \
104 { action; }; } G_STMT_END
106 #else /* !G_ENABLE_DEBUG */
108 #define GDK_NOTE(type,action)
110 #endif /* G_ENABLE_DEBUG */
123 typedef struct _GdkArgContext GdkArgContext;
124 typedef struct _GdkArgDesc GdkArgDesc;
126 typedef void (*GdkArgFunc) (const char *name, const char *arg, gpointer data);
128 struct _GdkArgContext
144 extern GdkEventFunc _gdk_event_func; /* Callback for events */
145 extern gpointer _gdk_event_data;
146 extern GDestroyNotify _gdk_event_notify;
148 /* FIFO's for event queue, and for events put back using
151 extern GList *_gdk_queued_events;
152 extern GList *_gdk_queued_tail;
154 extern GdkDevice *_gdk_core_pointer;
156 GdkEvent* _gdk_event_new (void);
158 void _gdk_events_init (void);
159 void _gdk_events_queue (void);
160 GdkEvent* _gdk_event_unqueue (void);
162 GList* _gdk_event_queue_find_first (void);
163 void _gdk_event_queue_remove_link (GList *node);
164 void _gdk_event_queue_append (GdkEvent *event);
166 void _gdk_event_button_generate (GdkEvent *event);
168 #define GDK_SCRATCH_IMAGE_WIDTH 256
169 #define GDK_SCRATCH_IMAGE_HEIGHT 64
171 GdkImage* _gdk_image_new_for_depth (GdkImageType type,
176 GdkImage *_gdk_image_get_scratch (gint width,
182 /* Will most likely be exported in the future
184 void _gdk_draw_pixbuf (GdkDrawable *drawable,
196 GdkImage *_gdk_drawable_copy_to_image (GdkDrawable *drawable,
205 /*************************************
206 * Interfaces used by windowing code *
207 *************************************/
209 void _gdk_window_destroy (GdkWindow *window,
210 gboolean foreign_destroy);
211 void _gdk_window_clear_update_area (GdkWindow *window);
214 /*****************************************
215 * Interfaces provided by windowing code *
216 *****************************************/
218 /* Font/string functions implemented in module-specific code */
219 gint _gdk_font_strlen (GdkFont *font, const char *str);
220 void _gdk_font_destroy (GdkFont *font);
222 void _gdk_colormap_real_destroy (GdkColormap *colormap);
224 void _gdk_cursor_destroy (GdkCursor *cursor);
226 extern GdkArgDesc _gdk_windowing_args[];
227 gboolean _gdk_windowing_init_check (int argc,
229 void _gdk_windowing_window_get_offsets (GdkWindow *window,
232 void _gdk_windowing_window_clear_area (GdkWindow *window,
237 void _gdk_windowing_window_clear_area_e (GdkWindow *window,
243 GdkWindow* _gdk_windowing_window_at_pointer (GdkScreen *screen,
246 GdkWindow* _gdk_windowing_window_get_pointer (GdkWindow *window,
249 GdkModifierType *mask);
251 /* Return the number of bits-per-pixel for images of the specified depth.
252 * (Future: needs to be GdkDiplay specific.)
254 gint _gdk_windowing_get_bits_for_depth (gint depth);
256 #define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
258 /* Called before processing updates for a window. This gives the windowing
259 * layer a chance to save the region for later use in avoiding duplicate
260 * exposes. The return value indicates whether the function has a saved
261 * the region; if the result is TRUE, then the windowing layer is responsible
262 * for destroying the region later.
264 gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
267 /* Called to do the windowing system specific part of gdk_window_destroy(),
269 * window: The window being destroyed
270 * recursing: If TRUE, then this is being called because a parent
271 * was destroyed. This generally means that the call to the windowing system
272 * to destroy the window can be omitted, since it will be destroyed as a result
273 * of the parent being destroyed. Unless @foreign_destroy
275 * foreign_destroy: If TRUE, the window or a parent was destroyed by some external
276 * agency. The window has already been destroyed and no windowing
277 * system calls should be made. (This may never happen for some
278 * windowing systems.)
280 void _gdk_windowing_window_destroy (GdkWindow *window,
282 gboolean foreign_destroy);
284 /* Implementation types */
285 GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
286 GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
288 /************************************
289 * Initialization and exit routines *
290 ************************************/
292 void _gdk_windowing_window_init (void);
293 void _gdk_visual_init (void);
294 void _gdk_dnd_init (void);
296 void _gdk_windowing_image_init (void);
297 void _gdk_image_exit (void);
299 void _gdk_input_init (void);
300 void _gdk_input_exit (void);
302 void _gdk_windowing_exit (void);
306 #endif /* __cplusplus */
308 #endif /* __GDK_INTERNALS_H__ */