From 59b738bce8ad3b94f468f01486b503bfd4470920 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Thu, 12 Jan 2012 11:17:14 +0100 Subject: Make use of deprecated API non-fatal. --- configure.ac | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/configure.ac b/configure.ac index ba5cd4b..13efd3c 100644 --- a/configure.ac +++ b/configure.ac @@ -23,14 +23,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums]) -AC_ARG_ENABLE([deprecations], - [AS_HELP_STRING([--enable-deprecations], - [allow deprecated API usage @<:@default=yes@:>@])], - [], - [enable_deprecations=yes]) -AS_IF([test "x$enable_deprecations" = xno], - [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES"] -) +CFLAGS="$CFLAGS -Wno-error=deprecated-declarations" ########################### # GTK Doc -- cgit v1.2.3 From 248e0c0f0ce3883579caa56369e7e92340ae9c64 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Thu, 12 Jan 2012 11:35:50 +0100 Subject: in gtk3, use stock signals instead of Ubuntu-specific ones --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/parser.c | 35 +++++++++++++++++++++++------------ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index b4564d1..9e0967f 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -76,7 +76,7 @@ libdbusmenu_gtk3includedir = $(libdbusmenu_gtkincludedir) libdbusmenu_gtk3include_HEADERS = $(libdbusmenu_gtkinclude_HEADERS) libdbusmenu_gtk3_la_SOURCES = $(libdbusmenu_gtk_la_SOURCES) libdbusmenu_gtk3_la_LDFLAGS = $(libdbusmenu_gtk_la_LDFLAGS) -libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) +libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) -DWITH_GTK3 libdbusmenu_gtk3_la_LIBADD = $(libdbusmenu_gtk_la_LIBADD) pkgconfig_DATA = dbusmenu-gtk$(VER)-0.4.pc diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 92932c5..5f50dc6 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -66,10 +66,13 @@ static void image_notify_cb (GtkWidget * widget, static void action_notify_cb (GtkAction * action, GParamSpec * pspec, gpointer data); -static void child_added_cb (GtkContainer * menu, +static void item_inserted_cb (GtkContainer * menu, GtkWidget * widget, +#ifdef WITH_GTK3 + gint position, +#endif gpointer data); -static void child_removed_cb (GtkContainer * menu, +static void item_removed_cb (GtkContainer * menu, GtkWidget * widget, gpointer data); static void theme_changed_cb (GtkIconTheme * theme, @@ -184,9 +187,9 @@ parse_data_free (gpointer data) if (pdata != NULL && pdata->shell != NULL) { g_signal_handlers_disconnect_matched(pdata->shell, (GSignalMatchType)G_SIGNAL_MATCH_FUNC, - 0, 0, NULL, G_CALLBACK(child_added_cb), NULL); + 0, 0, NULL, G_CALLBACK(item_inserted_cb), NULL); g_signal_handlers_disconnect_matched(pdata->shell, (GSignalMatchType)G_SIGNAL_MATCH_FUNC, - 0, 0, NULL, G_CALLBACK(child_removed_cb), NULL); + 0, 0, NULL, G_CALLBACK(item_removed_cb), NULL); g_object_remove_weak_pointer(G_OBJECT(pdata->shell), (gpointer*)&pdata->shell); } @@ -290,12 +293,16 @@ watch_submenu(DbusmenuMenuitem * mi, GtkWidget * menu) pdata->shell = menu; g_signal_connect (G_OBJECT (menu), - "child-added", - G_CALLBACK (child_added_cb), +#ifdef WITH_GTK3 + "insert", +#else + "child-added" +#endif + G_CALLBACK (item_inserted_cb), mi); g_signal_connect (G_OBJECT (menu), - "child-removed", - G_CALLBACK (child_removed_cb), + "remove", + G_CALLBACK (item_removed_cb), mi); g_object_add_weak_pointer(G_OBJECT (menu), (gpointer*)&pdata->shell); @@ -1137,7 +1144,12 @@ widget_add_cb (GtkWidget *widget, /* A child item was added to a menu we're watching. Let's try to integrate it. */ static void -child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) +item_inserted_cb (GtkContainer *menu, + GtkWidget *widget, +#ifdef WITH_GTK3 + gint position, +#endif + gpointer data) { DbusmenuMenuitem *menuitem = (DbusmenuMenuitem *)data; @@ -1152,9 +1164,9 @@ child_added_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) parse_menu_structure_helper(widget, &recurse); } -/* A child item was added to a menu we're watching. Let's try to integrate it. */ +/* A child item was removed from a menu we're watching. */ static void -child_removed_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) +item_removed_cb (GtkContainer *menu, GtkWidget *widget, gpointer data) { gpointer pmi = g_object_get_data(G_OBJECT(widget), CACHED_MENUITEM); if (pmi == NULL) { @@ -1216,4 +1228,3 @@ should_show_image (GtkImage *image) return FALSE; } - -- cgit v1.2.3 From d0065933d25307a95644e3ab984de0f4f848d6ad Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:33:24 -0600 Subject: Remove custom WITH_GTK3 and use the HAVE_GTK3 --- libdbusmenu-gtk/Makefile.am | 2 +- libdbusmenu-gtk/parser.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index 9e0967f..b4564d1 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -76,7 +76,7 @@ libdbusmenu_gtk3includedir = $(libdbusmenu_gtkincludedir) libdbusmenu_gtk3include_HEADERS = $(libdbusmenu_gtkinclude_HEADERS) libdbusmenu_gtk3_la_SOURCES = $(libdbusmenu_gtk_la_SOURCES) libdbusmenu_gtk3_la_LDFLAGS = $(libdbusmenu_gtk_la_LDFLAGS) -libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) -DWITH_GTK3 +libdbusmenu_gtk3_la_CFLAGS = $(libdbusmenu_gtk_la_CFLAGS) libdbusmenu_gtk3_la_LIBADD = $(libdbusmenu_gtk_la_LIBADD) pkgconfig_DATA = dbusmenu-gtk$(VER)-0.4.pc diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c index 5f50dc6..d222f10 100644 --- a/libdbusmenu-gtk/parser.c +++ b/libdbusmenu-gtk/parser.c @@ -68,7 +68,7 @@ static void action_notify_cb (GtkAction * action, gpointer data); static void item_inserted_cb (GtkContainer * menu, GtkWidget * widget, -#ifdef WITH_GTK3 +#ifdef HAVE_GTK3 gint position, #endif gpointer data); @@ -293,7 +293,7 @@ watch_submenu(DbusmenuMenuitem * mi, GtkWidget * menu) pdata->shell = menu; g_signal_connect (G_OBJECT (menu), -#ifdef WITH_GTK3 +#ifdef HAVE_GTK3 "insert", #else "child-added" @@ -1146,7 +1146,7 @@ widget_add_cb (GtkWidget *widget, static void item_inserted_cb (GtkContainer *menu, GtkWidget *widget, -#ifdef WITH_GTK3 +#ifdef HAVE_GTK3 gint position, #endif gpointer data) -- cgit v1.2.3 From 4eae3efbe5c3aa84035b2ade9ceedd68b7b3e895 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 26 Jan 2012 13:36:57 -0600 Subject: Move the no-error on deprications into the Makefiles so it's always after the -Wall --- configure.ac | 2 -- libdbusmenu-glib/Makefile.am | 4 +++- libdbusmenu-gtk/Makefile.am | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 13efd3c..fd69595 100644 --- a/configure.ac +++ b/configure.ac @@ -23,8 +23,6 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums]) -CFLAGS="$CFLAGS -Wno-error=deprecated-declarations" - ########################### # GTK Doc ########################### diff --git a/libdbusmenu-glib/Makefile.am b/libdbusmenu-glib/Makefile.am index 591bf30..83b2e7b 100644 --- a/libdbusmenu-glib/Makefile.am +++ b/libdbusmenu-glib/Makefile.am @@ -62,7 +62,9 @@ libdbusmenu_glib_la_LDFLAGS = \ -export-symbols-regex "^[^_].*" libdbusmenu_glib_la_CFLAGS = \ - $(DBUSMENUGLIB_CFLAGS) -Wall -Werror -DG_DISABLE_DEPRECATED -DG_LOG_DOMAIN="\"LIBDBUSMENU-GLIB\"" + $(DBUSMENUGLIB_CFLAGS) \ + -Wall -Werror -Wno-error=deprecated-declarations \ + -DG_LOG_DOMAIN="\"LIBDBUSMENU-GLIB\"" libdbusmenu_glib_la_LIBADD = \ $(DBUSMENUGLIB_LIBS) diff --git a/libdbusmenu-gtk/Makefile.am b/libdbusmenu-gtk/Makefile.am index b4564d1..9f297f5 100644 --- a/libdbusmenu-gtk/Makefile.am +++ b/libdbusmenu-gtk/Makefile.am @@ -62,7 +62,10 @@ libdbusmenu_gtk_la_LDFLAGS = \ -export-symbols-regex "^[^_].*" libdbusmenu_gtk_la_CFLAGS = \ - $(DBUSMENUGTK_CFLAGS) -I$(top_srcdir) -Wall -Werror -DG_DISABLE_DEPRECATED -DG_LOG_DOMAIN="\"LIBDBUSMENU-GTK\"" + $(DBUSMENUGTK_CFLAGS) \ + -I$(top_srcdir) \ + -Wall -Werror -Wno-error=deprecated-declarations \ + -DG_LOG_DOMAIN="\"LIBDBUSMENU-GTK\"" libdbusmenu_gtk_la_LIBADD = \ ../libdbusmenu-glib/libdbusmenu-glib.la \ -- cgit v1.2.3