* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+
+/*
+ * Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
+ * file for a list of people on the GTK+ Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
#ifndef __GDK_H__
#define __GDK_H__
/* Initialization, exit and events
*/
-void gdk_init (int *argc,
- char ***argv);
-void gdk_exit (int error_code);
-gchar* gdk_set_locale (void);
+#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
+void gdk_init (gint *argc,
+ gchar ***argv);
+gboolean gdk_init_check (gint *argc,
+ gchar ***argv);
+void gdk_exit (gint error_code);
+gchar* gdk_set_locale (void);
+
+/* Push and pop error handlers for X errors
+ */
+void gdk_error_trap_push (void);
+gint gdk_error_trap_pop (void);
+
+
+gboolean gdk_events_pending (void);
+GdkEvent* gdk_event_get (void);
-gint gdk_events_pending (void);
-GdkEvent *gdk_event_get (void);
-GdkEvent *gdk_event_get_graphics_expose (GdkWindow *window);
-void gdk_event_put (GdkEvent *event);
+GdkEvent* gdk_event_peek (void);
+GdkEvent* gdk_event_get_graphics_expose (GdkWindow *window);
+void gdk_event_put (GdkEvent *event);
-GdkEvent *gdk_event_copy (GdkEvent *event);
-void gdk_event_free (GdkEvent *event);
-guint32 gdk_event_get_time (GdkEvent *event);
+GdkEvent* gdk_event_copy (GdkEvent *event);
+void gdk_event_free (GdkEvent *event);
+guint32 gdk_event_get_time (GdkEvent *event);
-void gdk_event_handler_set (GdkEventFunc func,
- gpointer data,
- GDestroyNotify notify);
+void gdk_event_handler_set (GdkEventFunc func,
+ gpointer data,
+ GDestroyNotify notify);
-void gdk_set_show_events (gint show_events);
-void gdk_set_use_xshm (gint use_xshm);
+void gdk_set_show_events (gint show_events);
+void gdk_set_use_xshm (gint use_xshm);
-gint gdk_get_show_events (void);
-gint gdk_get_use_xshm (void);
-gchar *gdk_get_display (void);
+gint gdk_get_show_events (void);
+gint gdk_get_use_xshm (void);
+gchar* gdk_get_display (void);
guint32 gdk_time_get (void);
guint32 gdk_timer_get (void);
GdkInputFunction function,
gpointer data,
GdkDestroyNotify destroy);
-#define gdk_input_add_interp gdk_input_add_full
gint gdk_input_add (gint source,
GdkInputCondition condition,
GdkInputFunction function,
*/
void gdk_window_merge_child_shapes (GdkWindow *window);
+/*
+ * Check if a window has been shown, and whether all it's
+ * parents up to a toplevel have been shown, respectively.
+ * Note that a window that is_viewable below is not necessarily
+ * viewable in the X sense.
+ */
+gboolean gdk_window_is_visible (GdkWindow *window);
+gboolean gdk_window_is_viewable (GdkWindow *window);
+
+/* Set static bit gravity on the parent, and static
+ * window gravity on all children.
+ */
+gboolean gdk_window_set_static_gravities (GdkWindow *window,
+ gboolean use_static);
/*
* The following function adds a global filter for all client
* messages of type message_type
/* Source side */
GdkDragContext * gdk_drag_begin (GdkWindow *window,
- GList *targets,
- GdkDragAction actions);
+ GList *targets);
guint32 gdk_drag_get_protocol (guint32 xid,
GdkDragProtocol *protocol);
void gdk_drag_find_window (GdkDragContext *context,
GdkDragProtocol protocol,
gint x_root,
gint y_root,
- GdkDragAction action,
+ GdkDragAction suggested_action,
+ GdkDragAction possible_actions,
guint32 time);
void gdk_drag_drop (GdkDragContext *context,
guint32 time);
gint *width,
gint *ascent,
gint *descent);
+void gdk_text_extents_wc (GdkFont *font,
+ const GdkWChar *text,
+ gint text_length,
+ gint *lbearing,
+ gint *rbearing,
+ gint *width,
+ gint *ascent,
+ gint *descent);
void gdk_string_extents (GdkFont *font,
const gchar *string,
gint *lbearing,
gboolean gdk_keyval_is_upper (guint keyval);
gboolean gdk_keyval_is_lower (guint keyval);
+/* Threading
+ */
+
+extern GMutex *gdk_threads_mutex;
+
+void gdk_threads_enter (void);
+void gdk_threads_leave (void);
+
+#ifdef G_THREADS_ENABLED
+# define GDK_THREADS_ENTER() G_STMT_START { \
+ if (gdk_threads_mutex) \
+ g_mutex_lock (gdk_threads_mutex); \
+ } G_STMT_END
+# define GDK_THREADS_LEAVE() G_STMT_START { \
+ if (gdk_threads_mutex) \
+ g_mutex_unlock (gdk_threads_mutex); \
+ } G_STMT_END
+#else /* !G_THREADS_ENABLED */
+# define GDK_THREADS_ENTER()
+# define GDK_THREADS_LEAVE()
+#endif /* !G_THREADS_ENABLED */
#include <gdk/gdkrgb.h>