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/.
30 #define __GDK_H_INSIDE__
32 #include <gdk/gdkapplaunchcontext.h>
33 #include <gdk/gdkcairo.h>
34 #include <gdk/gdkcolor.h>
35 #include <gdk/gdkcursor.h>
36 #include <gdk/gdkdisplay.h>
37 #include <gdk/gdkdisplaymanager.h>
38 #include <gdk/gdkdnd.h>
39 #include <gdk/gdkdrawable.h>
40 #include <gdk/gdkenumtypes.h>
41 #include <gdk/gdkevents.h>
42 #include <gdk/gdkfont.h>
43 #include <gdk/gdkgc.h>
44 #include <gdk/gdkimage.h>
45 #include <gdk/gdkinput.h>
46 #include <gdk/gdkkeys.h>
47 #include <gdk/gdkpango.h>
48 #include <gdk/gdkpixbuf.h>
49 #include <gdk/gdkpixmap.h>
50 #include <gdk/gdkproperty.h>
51 #include <gdk/gdkregion.h>
52 #include <gdk/gdkrgb.h>
53 #include <gdk/gdkscreen.h>
54 #include <gdk/gdkselection.h>
55 #include <gdk/gdkspawn.h>
56 #include <gdk/gdktestutils.h>
57 #include <gdk/gdktypes.h>
58 #include <gdk/gdkvisual.h>
59 #include <gdk/gdkwindow.h>
61 #undef __GDK_H_INSIDE__
66 /* Initialization, exit and events
68 #define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
69 void gdk_parse_args (gint *argc,
71 void gdk_init (gint *argc,
73 gboolean gdk_init_check (gint *argc,
75 void gdk_add_option_entries_libgtk_only (GOptionGroup *group);
76 void gdk_pre_parse_libgtk_only (void);
78 #ifndef GDK_DISABLE_DEPRECATED
79 void gdk_exit (gint error_code);
80 #endif /* GDK_DISABLE_DEPRECATED */
81 gchar* gdk_set_locale (void);
83 G_CONST_RETURN char *gdk_get_program_class (void);
84 void gdk_set_program_class (const char *program_class);
86 /* Push and pop error handlers for X errors
88 void gdk_error_trap_push (void);
89 gint gdk_error_trap_pop (void);
91 #ifndef GDK_DISABLE_DEPRECATED
92 void gdk_set_use_xshm (gboolean use_xshm);
93 gboolean gdk_get_use_xshm (void);
94 #endif /* GDK_DISABLE_DEPRECATED */
96 gchar* gdk_get_display (void);
97 G_CONST_RETURN gchar* gdk_get_display_arg_name (void);
99 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GTK_COMPILATION)
100 /* Used by gtk_input_add_full () */
101 gint gdk_input_add_full (gint source,
102 GdkInputCondition condition,
103 GdkInputFunction function,
105 GDestroyNotify destroy);
106 #endif /* !GDK_DISABLE_DEPRECATED || GTK_COMPILATION */
107 #ifndef GDK_DISABLE_DEPRECATED
108 gint gdk_input_add (gint source,
109 GdkInputCondition condition,
110 GdkInputFunction function,
112 void gdk_input_remove (gint tag);
113 #endif /* GDK_DISABLE_DEPRECATED */
115 GdkGrabStatus gdk_pointer_grab (GdkWindow *window,
116 gboolean owner_events,
117 GdkEventMask event_mask,
118 GdkWindow *confine_to,
121 GdkGrabStatus gdk_keyboard_grab (GdkWindow *window,
122 gboolean owner_events,
125 gboolean gdk_pointer_grab_info_libgtk_only (GdkDisplay *display,
126 GdkWindow **grab_window,
127 gboolean *owner_events);
128 gboolean gdk_keyboard_grab_info_libgtk_only (GdkDisplay *display,
129 GdkWindow **grab_window,
130 gboolean *owner_events);
132 #ifndef GDK_MULTIHEAD_SAFE
133 void gdk_pointer_ungrab (guint32 time_);
134 void gdk_keyboard_ungrab (guint32 time_);
135 gboolean gdk_pointer_is_grabbed (void);
137 gint gdk_screen_width (void) G_GNUC_CONST;
138 gint gdk_screen_height (void) G_GNUC_CONST;
140 gint gdk_screen_width_mm (void) G_GNUC_CONST;
141 gint gdk_screen_height_mm (void) G_GNUC_CONST;
143 void gdk_beep (void);
144 #endif /* GDK_MULTIHEAD_SAFE */
146 void gdk_flush (void);
148 #ifndef GDK_MULTIHEAD_SAFE
149 void gdk_set_double_click_time (guint msec);
152 /* Rectangle utilities
154 gboolean gdk_rectangle_intersect (const GdkRectangle *src1,
155 const GdkRectangle *src2,
157 void gdk_rectangle_union (const GdkRectangle *src1,
158 const GdkRectangle *src2,
161 GType gdk_rectangle_get_type (void) G_GNUC_CONST;
163 #define GDK_TYPE_RECTANGLE (gdk_rectangle_get_type ())
165 /* Conversion functions between wide char and multibyte strings.
167 #ifndef GDK_DISABLE_DEPRECATED
168 gchar *gdk_wcstombs (const GdkWChar *src);
169 gint gdk_mbstowcs (GdkWChar *dest,
175 #ifndef GDK_MULTIHEAD_SAFE
176 gboolean gdk_event_send_client_message (GdkEvent *event,
177 GdkNativeWindow winid);
178 void gdk_event_send_clientmessage_toall (GdkEvent *event);
180 gboolean gdk_event_send_client_message_for_display (GdkDisplay *display,
182 GdkNativeWindow winid);
184 void gdk_notify_startup_complete (void);
186 void gdk_notify_startup_complete_with_id (const gchar* startup_id);
191 #if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
192 GDKVAR GMutex *gdk_threads_mutex; /* private */
195 GDKVAR GCallback gdk_threads_lock;
196 GDKVAR GCallback gdk_threads_unlock;
198 void gdk_threads_enter (void);
199 void gdk_threads_leave (void);
200 void gdk_threads_init (void);
201 void gdk_threads_set_lock_functions (GCallback enter_fn,
204 guint gdk_threads_add_idle_full (gint priority,
205 GSourceFunc function,
207 GDestroyNotify notify);
208 guint gdk_threads_add_idle (GSourceFunc function,
210 guint gdk_threads_add_timeout_full (gint priority,
212 GSourceFunc function,
214 GDestroyNotify notify);
215 guint gdk_threads_add_timeout (guint interval,
216 GSourceFunc function,
218 guint gdk_threads_add_timeout_seconds_full (gint priority,
220 GSourceFunc function,
222 GDestroyNotify notify);
223 guint gdk_threads_add_timeout_seconds (guint interval,
224 GSourceFunc function,
227 #ifdef G_THREADS_ENABLED
228 # define GDK_THREADS_ENTER() G_STMT_START { \
229 if (gdk_threads_lock) \
230 (*gdk_threads_lock) (); \
232 # define GDK_THREADS_LEAVE() G_STMT_START { \
233 if (gdk_threads_unlock) \
234 (*gdk_threads_unlock) (); \
236 #else /* !G_THREADS_ENABLED */
237 # define GDK_THREADS_ENTER()
238 # define GDK_THREADS_LEAVE()
239 #endif /* !G_THREADS_ENABLED */
244 #endif /* __GDK_H__ */