From 3e78324501c38e992b1748e79f5defc4d283e43a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 30 Jul 2012 10:37:32 +0200 Subject: [PATCH] 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. --- modules/input/Makefile.am | 1 + modules/input/gtkimcontextmultipress.c | 4 ++-- modules/printbackends/cups/Makefile.am | 1 + .../printbackends/cups/gtkprintbackendcups.c | 20 +++++++++---------- modules/printbackends/file/Makefile.am | 1 + .../printbackends/file/gtkprintbackendfile.c | 4 ++-- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/modules/input/Makefile.am b/modules/input/Makefile.am index 46e00fb43..317f4e24f 100644 --- a/modules/input/Makefile.am +++ b/modules/input/Makefile.am @@ -12,6 +12,7 @@ AM_CPPFLAGS = \ $(GTK_DEBUG_FLAGS) \ $(GTK_XIM_FLAGS) \ $(GTK_DEP_CFLAGS) \ + -DGTK_COMPILATION \ $(INCLUDED_IMMODULE_DEFINE) DEPS = \ diff --git a/modules/input/gtkimcontextmultipress.c b/modules/input/gtkimcontextmultipress.c index 57406cf35..7fb484a07 100644 --- a/modules/input/gtkimcontextmultipress.c +++ b/modules/input/gtkimcontextmultipress.c @@ -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 */ } diff --git a/modules/printbackends/cups/Makefile.am b/modules/printbackends/cups/Makefile.am index f90a28f73..e9d4c2fdd 100644 --- a/modules/printbackends/cups/Makefile.am +++ b/modules/printbackends/cups/Makefile.am @@ -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) diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c index cddb6b76c..d9110be15 100644 --- a/modules/printbackends/cups/gtkprintbackendcups.c +++ b/modules/printbackends/cups/gtkprintbackendcups.c @@ -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 diff --git a/modules/printbackends/file/Makefile.am b/modules/printbackends/file/Makefile.am index 9b25bc974..c0189f10a 100644 --- a/modules/printbackends/file/Makefile.am +++ b/modules/printbackends/file/Makefile.am @@ -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) diff --git a/modules/printbackends/file/gtkprintbackendfile.c b/modules/printbackends/file/gtkprintbackendfile.c index fdb36b6db..e9b75feda 100644 --- a/modules/printbackends/file/gtkprintbackendfile.c +++ b/modules/printbackends/file/gtkprintbackendfile.c @@ -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 -- 2.43.2