]> Pileus Git - ~andy/gtk/blob - gdk/gdkinternals.h
Updated Azeri and Walloon files
[~andy/gtk] / gdk / gdkinternals.h
1 /* GDK - The GIMP Drawing Kit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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.
18  */
19
20 /*
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/. 
25  */
26
27 /* Uninstalled header defining types and functions internal to GDK */
28
29 #include <gdk/gdktypes.h>
30 #include <gdk/gdkprivate.h>
31
32 #ifndef __GDK_INTERNALS_H__
33 #define __GDK_INTERNALS_H__
34
35 /**********************
36  * General Facilities * 
37  **********************/
38
39 /* Debugging support */
40
41 typedef enum {
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
47 } GdkDebugFlag;
48
49 extern gint              gdk_debug_level;
50 extern gboolean          gdk_show_events;
51 extern GList            *gdk_default_filters;
52
53 GDKVAR guint gdk_debug_flags;
54
55 #ifdef G_ENABLE_DEBUG
56
57 #define GDK_NOTE(type,action)                G_STMT_START { \
58     if (gdk_debug_flags & GDK_DEBUG_##type)                 \
59        { action; };                          } G_STMT_END
60
61 #else /* !G_ENABLE_DEBUG */
62
63 #define GDK_NOTE(type,action)
64
65 #endif /* G_ENABLE_DEBUG */
66
67 /* Arg parsing */
68
69 typedef enum 
70 {
71   GDK_ARG_STRING,
72   GDK_ARG_INT,
73   GDK_ARG_BOOL,
74   GDK_ARG_NOBOOL,
75   GDK_ARG_CALLBACK
76 } GdkArgType;
77
78 typedef struct _GdkArgContext GdkArgContext;
79 typedef struct _GdkArgDesc GdkArgDesc;
80
81 typedef void (*GdkArgFunc) (const char *name, const char *arg, gpointer data);
82
83 struct _GdkArgContext
84 {
85   GPtrArray *tables;
86   gpointer cb_data;
87 };
88
89 struct _GdkArgDesc
90 {
91   const char *name;
92   GdkArgType type;
93   gpointer location;
94   GdkArgFunc callback;
95 };
96
97 /* Event handling */
98
99 extern GdkEventFunc   gdk_event_func;    /* Callback for events */
100 extern gpointer       gdk_event_data;
101 extern GDestroyNotify gdk_event_notify;
102
103 /* FIFO's for event queue, and for events put back using
104  * gdk_event_put().
105  */
106 extern GList *gdk_queued_events;
107 extern GList *gdk_queued_tail;
108
109 GdkEvent* gdk_event_new (void);
110
111 void      gdk_events_init   (void);
112 void      gdk_events_queue  (void);
113 GdkEvent* gdk_event_unqueue (void);
114
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);
118
119 void gdk_event_button_generate (GdkEvent *event);
120 void gdk_synthesize_window_state (GdkWindow     *window,
121                                   GdkWindowState unset_flags,
122                                   GdkWindowState set_flags);
123
124 /*************************************
125  * Interfaces used by windowing code *
126  *************************************/
127
128 void       _gdk_window_destroy           (GdkWindow   *window,
129                                           gboolean     foreign_destroy);
130 void       _gdk_window_clear_update_area (GdkWindow   *window);
131       
132
133 /*****************************************
134  * Interfaces provided by windowing code *
135  *****************************************/
136
137 /* Font/string functions implemented in module-specific code */
138 gint _gdk_font_strlen (GdkFont *font, const char *str);
139 void _gdk_font_destroy (GdkFont *font);
140
141 void _gdk_colormap_real_destroy (GdkColormap *colormap);
142
143 void _gdk_cursor_destroy (GdkCursor *cursor);
144
145 extern GdkArgDesc _gdk_windowing_args[];
146 gboolean _gdk_windowing_init_check              (int         argc,
147                                                  char      **argv);
148 void     _gdk_windowing_window_get_offsets      (GdkWindow  *window,
149                                                  gint       *x_offset,
150                                                  gint       *y_offset);
151 void     _gdk_windowing_window_clear_area       (GdkWindow  *window,
152                                                  gint        x,
153                                                  gint        y,
154                                                  gint        width,
155                                                  gint        height);
156 void     _gdk_windowing_window_clear_area_e     (GdkWindow  *window,
157                                                  gint        x,
158                                                  gint        y,
159                                                  gint        width,
160                                                  gint        height);
161
162 #define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
163
164 /* Called before processing updates for a window. This gives the windowing
165  * layer a chance to save the region for later use in avoiding duplicate
166  * exposes. The return value indicates whether the function has a saved
167  * the region; if the result is TRUE, then the windowing layer is responsible
168  * for destroying the region later.
169  */
170 gboolean _gdk_windowing_window_queue_antiexpose (GdkWindow  *window,
171                                                  GdkRegion  *area);
172
173 /* Called to do the windowing system specific part of gdk_window_destroy(),
174  *
175  * window: The window being destroyed
176  * recursing: If TRUE, then this is being called because a parent
177  *            was destroyed. This generally means that the call to the windowing system
178  *            to destroy the window can be omitted, since it will be destroyed as a result
179  *            of the parent being destroyed. Unless @foreign_destroy
180  *            
181  * foreign_destroy: If TRUE, the window or a parent was destroyed by some external 
182  *            agency. The window has already been destroyed and no windowing
183  *            system calls should be made. (This may never happen for some
184  *            windowing systems.)
185  */
186 void _gdk_windowing_window_destroy (GdkWindow *window,
187                                     gboolean   recursing,
188                                     gboolean   foreign_destroy);
189
190 /* Implementation types */
191 GType _gdk_window_impl_get_type (void) G_GNUC_CONST;
192 GType _gdk_pixmap_impl_get_type (void) G_GNUC_CONST;
193
194 /************************************
195  * Initialization and exit routines *
196  ************************************/
197
198 void _gdk_windowing_window_init (void);
199 void gdk_visual_init (void);
200 void gdk_dnd_init    (void);
201
202 void _gdk_windowing_image_init  (void);
203 void gdk_image_exit  (void);
204
205 void gdk_input_init  (void);
206 void gdk_input_exit  (void);
207
208 void gdk_windowing_exit (void);
209
210 #ifdef __cplusplus
211 }
212 #endif /* __cplusplus */
213
214 #endif /* __GDK_INTERNALS_H__ */