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);
120 void gdk_synthesize_window_state (GdkWindow *window,
121 GdkWindowState unset_flags,
122 GdkWindowState set_flags);
124 /*************************************
125 * Interfaces used by windowing code *
126 *************************************/
130 gint gdk_im_open (void);
131 void gdk_im_close (void);
132 void gdk_ic_cleanup (void);
135 void _gdk_window_destroy (GdkWindow *window,
136 gboolean foreign_destroy);
137 void _gdk_window_clear_update_area (GdkWindow *window);
140 /*****************************************
141 * Interfaces provided by windowing code *
142 *****************************************/
144 /* Font/string functions implemented in module-specific code */
145 gint _gdk_font_strlen (GdkFont *font, const char *str);
146 void _gdk_font_destroy (GdkFont *font);
148 void _gdk_colormap_real_destroy (GdkColormap *colormap);
150 void _gdk_cursor_destroy (GdkCursor *cursor);
152 extern GdkArgDesc _gdk_windowing_args[];
153 gboolean _gdk_windowing_init_check (int argc,
155 void _gdk_windowing_window_get_offsets (GdkWindow *window,
158 void _gdk_windowing_window_clear_area (GdkWindow *window,
163 void _gdk_windowing_window_clear_area_e (GdkWindow *window,
169 #define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
171 /* Called before processing updates for a window. This gives the windowing
172 * layer a chance to save the region for later use in avoiding duplicate
173 * exposes. The return value indicates whether the function has a saved
174 * the region; if the result is TRUE, then the windowing layer is responsible
175 * for destroying the region later.
177 gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
180 /* Called to do the windowing system specific part of gdk_window_destroy(),
182 * window: The window being destroyed
183 * recursing: If TRUE, then this is being called because a parent
184 * was destroyed. This generally means that the call to the windowing system
185 * to destroy the window can be omitted, since it will be destroyed as a result
186 * of the parent being destroyed. Unless @foreign_destroy
188 * foreign_destroy: If TRUE, the window or a parent was destroyed by some external
189 * agency. The window has already been destroyed and no windowing
190 * system calls should be made. (This may never happen for some
191 * windowing systems.)
193 void _gdk_windowing_window_destroy (GdkWindow *window,
195 gboolean foreign_destroy);
197 /* Implementation types */
198 GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
199 GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
201 /************************************
202 * Initialization and exit routines *
203 ************************************/
205 void _gdk_windowing_window_init (void);
206 void gdk_visual_init (void);
207 void gdk_dnd_init (void);
209 void _gdk_windowing_image_init (void);
210 void gdk_image_exit (void);
212 void gdk_input_init (void);
213 void gdk_input_exit (void);
215 void gdk_windowing_exit (void);
219 #endif /* __cplusplus */
221 #endif /* __GDK_INTERNALS_H__ */