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 */
42 GDK_DEBUG_MISC = 1 << 0,
43 GDK_DEBUG_EVENTS = 1 << 1,
44 GDK_DEBUG_DND = 1 << 2,
45 GDK_DEBUG_COLOR_CONTEXT = 1 << 3,
46 GDK_DEBUG_XIM = 1 << 4
49 extern gint gdk_debug_level;
50 extern gboolean gdk_show_events;
51 extern GList *gdk_default_filters;
53 GDKVAR guint gdk_debug_flags;
57 #define GDK_NOTE(type,action) G_STMT_START { \
58 if (gdk_debug_flags & GDK_DEBUG_##type) \
59 { action; }; } G_STMT_END
61 #else /* !G_ENABLE_DEBUG */
63 #define GDK_NOTE(type,action)
65 #endif /* G_ENABLE_DEBUG */
78 typedef struct _GdkArgContext GdkArgContext;
79 typedef struct _GdkArgDesc GdkArgDesc;
81 typedef void (*GdkArgFunc) (const char *name, const char *arg, gpointer data);
99 extern GdkEventFunc gdk_event_func; /* Callback for events */
100 extern gpointer gdk_event_data;
101 extern GDestroyNotify gdk_event_notify;
103 /* FIFO's for event queue, and for events put back using
106 extern GList *gdk_queued_events;
107 extern GList *gdk_queued_tail;
109 GdkEvent* gdk_event_new (void);
111 void gdk_events_init (void);
112 void gdk_events_queue (void);
113 GdkEvent* gdk_event_unqueue (void);
115 GList* gdk_event_queue_find_first (void);
116 void gdk_event_queue_remove_link (GList *node);
117 void gdk_event_queue_append (GdkEvent *event);
119 void gdk_event_button_generate (GdkEvent *event);
121 /*************************************
122 * Interfaces used by windowing code *
123 *************************************/
127 gint gdk_im_open (void);
128 void gdk_im_close (void);
129 void gdk_ic_cleanup (void);
132 void _gdk_window_destroy (GdkWindow *window,
133 gboolean foreign_destroy);
134 void _gdk_window_clear_update_area (GdkWindow *window);
137 /*****************************************
138 * Interfaces provided by windowing code *
139 *****************************************/
141 /* Font/string functions implemented in module-specific code */
142 gint _gdk_font_strlen (GdkFont *font, const char *str);
143 void _gdk_font_destroy (GdkFont *font);
145 void _gdk_colormap_real_destroy (GdkColormap *colormap);
147 void _gdk_cursor_destroy (GdkCursor *cursor);
149 extern GdkArgDesc _gdk_windowing_args[];
150 gboolean _gdk_windowing_init_check (int argc,
152 void _gdk_windowing_window_get_offsets (GdkWindow *window,
155 void _gdk_windowing_window_clear_area (GdkWindow *window,
160 void _gdk_windowing_window_clear_area_e (GdkWindow *window,
166 /* Called before processing updates for a window. This gives the windowing
167 * layer a chance to save the region for later use in avoiding duplicate
168 * exposes. The return value indicates whether the function has a saved
169 * the region; if the result is TRUE, then the windowing layer is responsible
170 * for destroying the region later.
172 gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
175 /* Called to do the windowing system specific part of gdk_window_destroy(),
177 * window: The window being destroyed
178 * recursing: If TRUE, then this is being called because a parent
179 * was destroyed. This generally means that the call to the windowing system
180 * to destroy the window can be omitted, since it will be destroyed as a result
181 * of the parent being destroyed. Unless @foreign_destroy
183 * foreign_destroy: If TRUE, the window or a parent was destroyed by some external
184 * agency. The window has already been destroyed and no windowing
185 * system calls should be made. (This may never happen for some
186 * windowing systems.)
188 void _gdk_windowing_window_destroy (GdkWindow *window,
190 gboolean foreign_destroy);
192 /* Implementation types */
193 GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
194 GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
196 /************************************
197 * Initialization and exit routines *
198 ************************************/
200 void _gdk_windowing_window_init (void);
201 void gdk_visual_init (void);
202 void gdk_dnd_init (void);
204 void _gdk_windowing_image_init (void);
205 void gdk_image_exit (void);
207 void gdk_input_init (void);
208 void gdk_input_exit (void);
210 void gdk_windowing_exit (void);
214 #endif /* __cplusplus */
216 #endif /* __GDK_INTERNALS_H__ */