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 Library 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 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library 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-1999. 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 #include <gdk/gdkcc.h>
31 #include <gdk/gdkcolor.h>
32 #include <gdk/gdkcursor.h>
33 #include <gdk/gdkdnd.h>
34 #include <gdk/gdkdrawable.h>
35 #include <gdk/gdkevents.h>
36 #include <gdk/gdkfont.h>
37 #include <gdk/gdkgc.h>
38 #include <gdk/gdkim.h>
39 #include <gdk/gdkimage.h>
40 #include <gdk/gdkinput.h>
41 #include <gdk/gdkpango.h>
42 #include <gdk/gdkpixmap.h>
43 #include <gdk/gdkproperty.h>
44 #include <gdk/gdkregion.h>
45 #include <gdk/gdkrgb.h>
46 #include <gdk/gdkselection.h>
47 #include <gdk/gdktypes.h>
48 #include <gdk/gdkvisual.h>
49 #include <gdk/gdkwindow.h>
51 #include <gdk/gdkcompat.h>
55 #endif /* __cplusplus */
58 /* Initialization, exit and events
60 #define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
61 void gdk_init (gint *argc,
63 gboolean gdk_init_check (gint *argc,
65 void gdk_exit (gint error_code);
66 gchar* gdk_set_locale (void);
68 /* Push and pop error handlers for X errors
70 void gdk_error_trap_push (void);
71 gint gdk_error_trap_pop (void);
74 void gdk_set_use_xshm (gboolean use_xshm);
76 gboolean gdk_get_use_xshm (void);
77 gchar* gdk_get_display (void);
79 gint gdk_input_add_full (gint source,
80 GdkInputCondition condition,
81 GdkInputFunction function,
83 GdkDestroyNotify destroy);
84 gint gdk_input_add (gint source,
85 GdkInputCondition condition,
86 GdkInputFunction function,
88 void gdk_input_remove (gint tag);
90 gint gdk_pointer_grab (GdkWindow *window,
91 gboolean owner_events,
92 GdkEventMask event_mask,
93 GdkWindow *confine_to,
96 void gdk_pointer_ungrab (guint32 time);
97 gint gdk_keyboard_grab (GdkWindow *window,
98 gboolean owner_events,
100 void gdk_keyboard_ungrab (guint32 time);
101 gboolean gdk_pointer_is_grabbed (void);
103 gint gdk_screen_width (void);
104 gint gdk_screen_height (void);
106 gint gdk_screen_width_mm (void);
107 gint gdk_screen_height_mm (void);
109 void gdk_flush (void);
110 void gdk_beep (void);
112 void gdk_key_repeat_disable (void);
113 void gdk_key_repeat_restore (void);
115 /* Rectangle utilities
117 gboolean gdk_rectangle_intersect (GdkRectangle *src1,
120 void gdk_rectangle_union (GdkRectangle *src1,
124 /* Conversion functions between wide char and multibyte strings.
126 gchar *gdk_wcstombs (const GdkWChar *src);
127 gint gdk_mbstowcs (GdkWChar *dest,
132 void gdk_event_send_clientmessage_toall (GdkEvent *event);
133 gboolean gdk_event_send_client_message (GdkEvent *event,
138 gchar* gdk_keyval_name (guint keyval);
139 guint gdk_keyval_from_name (const gchar *keyval_name);
140 void gdk_keyval_convert_case (guint symbol,
143 guint gdk_keyval_to_upper (guint keyval);
144 guint gdk_keyval_to_lower (guint keyval);
145 gboolean gdk_keyval_is_upper (guint keyval);
146 gboolean gdk_keyval_is_lower (guint keyval);
148 guint32 gdk_keyval_to_unicode (guint keyval);
149 guint gdk_unicode_to_keyval (guint32 wc);
154 GDKVAR GMutex *gdk_threads_mutex;
156 void gdk_threads_enter (void);
157 void gdk_threads_leave (void);
159 #ifdef G_THREADS_ENABLED
160 # define GDK_THREADS_ENTER() G_STMT_START { \
161 if (gdk_threads_mutex) \
162 g_mutex_lock (gdk_threads_mutex); \
164 # define GDK_THREADS_LEAVE() G_STMT_START { \
165 if (gdk_threads_mutex) \
166 g_mutex_unlock (gdk_threads_mutex); \
168 #else /* !G_THREADS_ENABLED */
169 # define GDK_THREADS_ENTER()
170 # define GDK_THREADS_LEAVE()
171 #endif /* !G_THREADS_ENABLED */
175 #endif /* __cplusplus */
178 #endif /* __GDK_H__ */