Commit 3963d5aa authored by Tor Lillqvist's avatar Tor Lillqvist

Remove variables from the platform-independent GDK API

gdk_threads_mutex, gdk_threads_lock and gdk_threads_unlock are removed
from public API. gdk_threads_mutex was deprecated already. Instead of
using gdk_threads_lock and _unlock one was presumably supposed to use
the GDK_THREADS_ENTER and _LEAVE macros, which now simply call the
corresponding gdk_threads_enter() and _leave() functions.

Remove he dllimport/dllexport ugliness for GDK for Windows.

There is still a gdk_display variable being exported by the X11
backend.
parent 319bc22c
......@@ -63,6 +63,11 @@ static int gdk_initialized = 0; /* 1 if the library is initialized,
static gchar *gdk_progclass = NULL;
static GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
static GCallback gdk_threads_lock = NULL;
static GCallback gdk_threads_unlock = NULL;
#ifdef G_ENABLE_DEBUG
static const GDebugKey gdk_debug_keys[] = {
{"events", GDK_DEBUG_EVENTS},
......@@ -384,13 +389,15 @@ gdk_init (int *argc, char ***argv)
void
gdk_threads_enter (void)
{
GDK_THREADS_ENTER ();
if (gdk_threads_lock)
(*gdk_threads_lock) ();
}
void
gdk_threads_leave (void)
{
GDK_THREADS_LEAVE ();
if (gdk_threads_unlock)
(*gdk_threads_unlock) ();
}
static void
......
......@@ -151,13 +151,6 @@ void gdk_notify_startup_complete_with_id (const gchar* startup_id);
/* Threading
*/
#if !defined (GDK_DISABLE_DEPRECATED) || defined (GDK_COMPILATION)
GDKVAR GMutex *gdk_threads_mutex; /* private */
#endif
GDKVAR GCallback gdk_threads_lock;
GDKVAR GCallback gdk_threads_unlock;
void gdk_threads_enter (void);
void gdk_threads_leave (void);
void gdk_threads_init (void);
......@@ -187,19 +180,8 @@ guint gdk_threads_add_timeout_seconds (guint interval,
GSourceFunc function,
gpointer data);
#ifdef G_THREADS_ENABLED
# define GDK_THREADS_ENTER() G_STMT_START { \
if (gdk_threads_lock) \
(*gdk_threads_lock) (); \
} G_STMT_END
# define GDK_THREADS_LEAVE() G_STMT_START { \
if (gdk_threads_unlock) \
(*gdk_threads_unlock) (); \
} G_STMT_END
#else /* !G_THREADS_ENABLED */
# define GDK_THREADS_ENTER()
# define GDK_THREADS_LEAVE()
#endif /* !G_THREADS_ENABLED */
#define GDK_THREADS_ENTER() gdk_threads_enter()
#define GDK_THREADS_LEAVE() gdk_threads_leave()
G_END_DECLS
......
......@@ -1093,12 +1093,6 @@ gdk_window_impl_get_type G_GNUC_CONST
#endif
#endif
#ifdef INCLUDE_VARIABLES
gdk_threads_mutex
gdk_threads_lock
gdk_threads_unlock
#endif
#ifdef GDK_WINDOWING_X11
#ifdef INCLUDE_VARIABLES
gdk_display
......
......@@ -43,7 +43,3 @@ gboolean _gdk_native_windows = FALSE;
gboolean _gdk_enable_multidevice = FALSE;
GSList *_gdk_displays = NULL;
GMutex *gdk_threads_mutex = NULL; /* Global GDK lock */
GCallback gdk_threads_lock = NULL;
GCallback gdk_threads_unlock = NULL;
......@@ -38,16 +38,6 @@
#include <glib-object.h>
#include <cairo.h>
#ifdef G_OS_WIN32
# ifdef GDK_COMPILATION
# define GDKVAR __declspec(dllexport)
# else
# define GDKVAR extern __declspec(dllimport)
# endif
#else
# define GDKVAR extern
#endif
/* The system specific file gdkconfig.h contains such configuration
* settings that are needed not only when compiling GDK (or GTK)
* itself, but also occasionally when compiling programs that use GDK
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment