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/gdkwindow.h>
31 #include <gdk/gdkprivate.h>
33 #ifndef __GDK_INTERNALS_H__
34 #define __GDK_INTERNALS_H__
36 /**********************
37 * General Facilities *
38 **********************/
40 /* Debugging support */
42 typedef struct _GdkColorInfo GdkColorInfo;
43 typedef struct _GdkEventFilter GdkEventFilter;
44 typedef struct _GdkClientFilter GdkClientFilter;
47 GDK_COLOR_WRITEABLE = 1 << 0
52 GdkColorInfoFlags flags;
56 struct _GdkEventFilter {
57 GdkFilterFunc function;
61 struct _GdkClientFilter {
63 GdkFilterFunc function;
68 GDK_DEBUG_MISC = 1 << 0,
69 GDK_DEBUG_EVENTS = 1 << 1,
70 GDK_DEBUG_DND = 1 << 2,
71 GDK_DEBUG_XIM = 1 << 3,
72 GDK_DEBUG_NOGRABS = 1 << 4,
73 GDK_DEBUG_COLORMAP = 1 << 5,
74 GDK_DEBUG_GDKRGB = 1 << 6,
75 GDK_DEBUG_GC = 1 << 7,
76 GDK_DEBUG_PIXMAP = 1 << 8,
77 GDK_DEBUG_IMAGE = 1 << 9,
78 GDK_DEBUG_INPUT = 1 <<10,
79 GDK_DEBUG_CURSOR = 1 <<11,
80 GDK_DEBUG_MULTIHEAD = 1 <<12,
81 GDK_DEBUG_XINERAMA = 1 <<13
84 #ifndef GDK_DISABLE_DEPRECATED
86 typedef struct _GdkFontPrivate GdkFontPrivate;
88 struct _GdkFontPrivate
94 #endif /* GDK_DISABLE_DEPRECATED */
96 extern GList *_gdk_default_filters;
97 extern GdkWindow *_gdk_parent_root;
98 extern gint _gdk_error_code;
99 extern gint _gdk_error_warnings;
101 extern guint _gdk_debug_flags;
103 #ifdef G_ENABLE_DEBUG
105 #define GDK_NOTE(type,action) G_STMT_START { \
106 if (_gdk_debug_flags & GDK_DEBUG_##type) \
107 { action; }; } G_STMT_END
109 #else /* !G_ENABLE_DEBUG */
111 #define GDK_NOTE(type,action)
113 #endif /* G_ENABLE_DEBUG */
126 typedef struct _GdkArgContext GdkArgContext;
127 typedef struct _GdkArgDesc GdkArgDesc;
129 typedef void (*GdkArgFunc) (const char *name, const char *arg, gpointer data);
131 struct _GdkArgContext
147 typedef struct _GdkEventPrivate GdkEventPrivate;
151 /* Following flag is set for events on the event queue during
152 * translation and cleared afterwards.
154 GDK_EVENT_PENDING = 1 << 0
157 struct _GdkEventPrivate
164 extern GdkEventFunc _gdk_event_func; /* Callback for events */
165 extern gpointer _gdk_event_data;
166 extern GDestroyNotify _gdk_event_notify;
168 extern GSList *_gdk_displays;
169 extern gchar *_gdk_display_name;
170 extern gint _gdk_screen_number;
171 extern gchar *_gdk_display_arg_name;
173 void _gdk_events_queue (GdkDisplay *display);
174 GdkEvent* _gdk_event_unqueue (GdkDisplay *display);
176 GList* _gdk_event_queue_find_first (GdkDisplay *display);
177 void _gdk_event_queue_remove_link (GdkDisplay *display,
179 GList* _gdk_event_queue_append (GdkDisplay *display,
181 void _gdk_event_button_generate (GdkDisplay *display,
184 void gdk_synthesize_window_state (GdkWindow *window,
185 GdkWindowState unset_flags,
186 GdkWindowState set_flags);
188 #define GDK_SCRATCH_IMAGE_WIDTH 256
189 #define GDK_SCRATCH_IMAGE_HEIGHT 64
191 GdkImage* _gdk_image_new_for_depth (GdkScreen *screen,
197 GdkImage *_gdk_image_get_scratch (GdkScreen *screen,
204 GdkImage *_gdk_drawable_copy_to_image (GdkDrawable *drawable,
214 GdkGC *_gdk_drawable_get_scratch_gc (GdkDrawable *drawable,
215 gboolean graphics_exposures);
217 /*************************************
218 * Interfaces used by windowing code *
219 *************************************/
221 void _gdk_window_destroy (GdkWindow *window,
222 gboolean foreign_destroy);
223 void _gdk_window_clear_update_area (GdkWindow *window);
225 void _gdk_screen_close (GdkScreen *screen);
227 const char *_gdk_get_sm_client_id (void);
229 /*****************************************
230 * Interfaces provided by windowing code *
231 *****************************************/
233 /* Font/string functions implemented in module-specific code */
234 gint _gdk_font_strlen (GdkFont *font, const char *str);
235 void _gdk_font_destroy (GdkFont *font);
237 void _gdk_colormap_real_destroy (GdkColormap *colormap);
239 void _gdk_cursor_destroy (GdkCursor *cursor);
241 void _gdk_windowing_init (void);
243 extern GOptionEntry _gdk_windowing_args[];
244 void _gdk_windowing_set_default_display (GdkDisplay *display);
246 gchar *_gdk_windowing_substitute_screen_number (const gchar *display_name,
249 void _gdk_windowing_window_get_offsets (GdkWindow *window,
252 void _gdk_windowing_window_clear_area (GdkWindow *window,
257 void _gdk_windowing_window_clear_area_e (GdkWindow *window,
263 void _gdk_windowing_get_pointer (GdkDisplay *display,
267 GdkModifierType *mask);
268 GdkWindow* _gdk_windowing_window_get_pointer (GdkDisplay *display,
272 GdkModifierType *mask);
273 GdkWindow* _gdk_windowing_window_at_pointer (GdkDisplay *display,
277 /* Return the number of bits-per-pixel for images of the specified depth. */
278 gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
281 #define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
283 /* Called before processing updates for a window. This gives the windowing
284 * layer a chance to save the region for later use in avoiding duplicate
285 * exposes. The return value indicates whether the function has a saved
286 * the region; if the result is TRUE, then the windowing layer is responsible
287 * for destroying the region later.
289 gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow *window,
292 /* Called to do the windowing system specific part of gdk_window_destroy(),
294 * window: The window being destroyed
295 * recursing: If TRUE, then this is being called because a parent
296 * was destroyed. This generally means that the call to the windowing system
297 * to destroy the window can be omitted, since it will be destroyed as a result
298 * of the parent being destroyed. Unless @foreign_destroy
300 * foreign_destroy: If TRUE, the window or a parent was destroyed by some external
301 * agency. The window has already been destroyed and no windowing
302 * system calls should be made. (This may never happen for some
303 * windowing systems.)
305 void _gdk_windowing_window_destroy (GdkWindow *window,
307 gboolean foreign_destroy);
309 /* Called when gdk_window_destroy() is called on a foreign window
310 * or an ancestor of the foreign window. It should generally reparent
311 * the window out of it's current heirarchy, hide it, and then
312 * send a message to the owner requesting that the window be destroyed.
314 void _gdk_windowing_window_destroy_foreign (GdkWindow *window);
316 void _gdk_windowing_display_set_sm_client_id (GdkDisplay *display,
317 const gchar *sm_client_id);
319 /* Implementation types */
320 GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
321 GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
324 /* Queries the current foreground color of a GdkGC */
325 void _gdk_windowing_gc_get_foreground (GdkGC *gc,
328 /************************************
329 * Initialization and exit routines *
330 ************************************/
332 void _gdk_image_exit (void);
333 void _gdk_windowing_exit (void);
337 #endif /* __cplusplus */
339 #endif /* __GDK_INTERNALS_H__ */