modules: Don't use GDK_THREADS_ENTER/LEAVE macros internally

These are just wrappers for the functions, and we want to
deprecate them. Stopping to use them internally is a good
first step. Also define GTK_COMPILATION so we can keep using
gdk_threads_enter/leave without causing deprecation warnings.
This commit is contained in:
Matthias Clasen 2012-07-30 10:37:32 +02:00
parent 8d0e88bac7
commit 3e78324501
6 changed files with 17 additions and 14 deletions

View File

@ -12,6 +12,7 @@ AM_CPPFLAGS = \
$(GTK_DEBUG_FLAGS) \
$(GTK_XIM_FLAGS) \
$(GTK_DEP_CFLAGS) \
-DGTK_COMPILATION \
$(INCLUDED_IMMODULE_DEFINE)
DEPS = \

View File

@ -197,7 +197,7 @@ on_timeout (gpointer data)
{
GtkImContextMultipress *multipress_context;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
multipress_context = GTK_IM_CONTEXT_MULTIPRESS (data);
@ -207,7 +207,7 @@ on_timeout (gpointer data)
multipress_context->timeout_id = 0;
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
return G_SOURCE_REMOVE; /* don't call me again */
}

View File

@ -12,6 +12,7 @@ AM_CPPFLAGS = \
-I$(top_builddir)/gdk \
$(CUPS_CFLAGS) \
$(COLORD_CFLAGS) \
-DGTK_COMPILATION \
-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED \
$(GTK_DEP_CFLAGS) \
$(GTK_DEBUG_FLAGS)

View File

@ -469,7 +469,7 @@ cups_print_cb (GtkPrintBackendCups *print_backend,
GError *error = NULL;
CupsPrintStreamData *ps = user_data;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
@ -506,7 +506,7 @@ cups_print_cb (GtkPrintBackendCups *print_backend,
if (error)
g_error_free (error);
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
}
typedef struct {
@ -1494,7 +1494,7 @@ cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
int state;
gboolean done;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
if (data->job == NULL)
{
@ -1566,7 +1566,7 @@ cups_request_job_info_cb (GtkPrintBackendCups *print_backend,
cups_job_poll_data_free (data);
done:
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
}
static void
@ -1953,7 +1953,7 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
GList *removed_printer_checklist;
gchar *remote_default_printer = NULL;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
list_has_changed = FALSE;
@ -2235,7 +2235,7 @@ done:
}
}
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
}
static void
@ -2368,7 +2368,7 @@ cups_request_ppd_cb (GtkPrintBackendCups *print_backend,
{
GtkPrinter *printer;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
@ -2404,7 +2404,7 @@ cups_request_ppd_cb (GtkPrintBackendCups *print_backend,
g_signal_emit_by_name (printer, "details-acquired", TRUE);
done:
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
}
static gboolean
@ -2750,7 +2750,7 @@ cups_request_default_printer_cb (GtkPrintBackendCups *print_backend,
ipp_attribute_t *attr;
GtkPrinter *printer;
GDK_THREADS_ENTER ();
gdk_threads_enter ();
if (gtk_cups_result_is_error (result))
{
@ -2789,7 +2789,7 @@ cups_request_default_printer_cb (GtkPrintBackendCups *print_backend,
if (print_backend->list_printers_poll != 0)
cups_request_printer_list (print_backend);
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
}
static gboolean

View File

@ -17,6 +17,7 @@ libprintbackend_file_la_CPPFLAGS = \
-I$(top_builddir)/gtk \
-I$(top_srcdir)/gdk \
-I$(top_builddir)/gdk \
-DGTK_COMPILATION \
-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED \
$(AM_CPPFLAGS)

View File

@ -401,11 +401,11 @@ file_print_cb (GtkPrintBackendFile *print_backend,
GError *error,
gpointer user_data)
{
GDK_THREADS_ENTER ();
gdk_threads_enter ();
file_print_cb_locked (print_backend, error, user_data);
GDK_THREADS_LEAVE ();
gdk_threads_leave ();
}
static gboolean