[libnotify] Don't need to fuss with gtk symbols since we don't use gtk at all anymore



commit b6c1835fcf016b084a87f52f58b6e676d14f6c9c
Author: William Jon McCann <jmccann redhat com>
Date:   Sat Oct 9 00:19:05 2010 -0400

    Don't need to fuss with gtk symbols since we don't use gtk at all anymore

 configure.ac             |   16 +++-------
 libnotify.pc.in          |    2 +-
 libnotify/Makefile.am    |    2 +-
 libnotify/notification.c |    3 --
 libnotify/notification.h |    3 +-
 libnotify/notify.c       |   40 -------------------------
 tests/Makefile.am        |    6 +---
 tests/test-gtk3.c        |   74 ----------------------------------------------
 8 files changed, 10 insertions(+), 136 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0a12a4a..19079fc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,21 +92,15 @@ REQ_DBUS_VERSION=0.76
 REQ_GTK_VERSION=2.18
 REQ_GLIB_VERSION=2.6
 
-pkg_modules="gtk+-2.0 >= $REQ_GTK_VERSION, glib-2.0 >= $REQ_GLIB_VERSION, dbus-1 >= $REQ_DBUS_VERSION, dbus-glib-1 >= $REQ_DBUS_VERSION gmodule-2.0"
+pkg_modules="gdk-pixbuf-2.0 glib-2.0 >= $REQ_GLIB_VERSION, dbus-1 >= $REQ_DBUS_VERSION, dbus-glib-1 >= $REQ_DBUS_VERSION"
 PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
 AC_SUBST(PACKAGE_LIBS)
 AC_SUBST(PACKAGE_CFLAGS)
 
-dnl The libraries against which we'll actually link
-link_modules="glib-2.0 >= $REQ_GLIB_VERSION, dbus-1 >= $REQ_DBUS_VERSION, dbus-glib-1 >= $REQ_DBUS_VERSION, gmodule-2.0"
-AC_SUBST(link_modules)
-PKG_CHECK_MODULES(LINKS, [$link_modules])
-AC_SUBST(LINKS_LIBS)
-
-dnl The libraries to compile the gtk3 test against
-PKG_CHECK_MODULES(GTK3, gtk+-3.0)
-AC_SUBST(GTK3_CFLAGS)
-AC_SUBST(GTK3_LIBS)
+tests_modules="gtk+-2.0 >= $REQ_GTK_VERSION, glib-2.0 >= $REQ_GLIB_VERSION, dbus-1 >= $REQ_DBUS_VERSION, dbus-glib-1 >= $REQ_DBUS_VERSION"
+PKG_CHECK_MODULES(TEST, [$tests_modules])
+AC_SUBST(TESTS_LIBS)
+AC_SUBST(TESTS_CFLAGS)
 
 GLIB_GENMARSHAL=`pkg-config --variable=glib_genmarshal glib-2.0`
 AC_SUBST(GLIB_GENMARSHAL)
diff --git a/libnotify.pc.in b/libnotify.pc.in
index becce91..b586d74 100644
--- a/libnotify.pc.in
+++ b/libnotify.pc.in
@@ -6,7 +6,7 @@ includedir= includedir@
 Name: libnotify
 Description: Notifications Library
 Version: @VERSION@
-Requires: @link_modules@
+Requires: @pkg_modules@
 Libs: -L${libdir} -lnotify
 Cflags: -I${includedir}
 
diff --git a/libnotify/Makefile.am b/libnotify/Makefile.am
index 2abb61c..66abb80 100644
--- a/libnotify/Makefile.am
+++ b/libnotify/Makefile.am
@@ -32,7 +32,7 @@ libnotify_la_SOURCES = \
 	notify-marshal.c
 
 libnotify_la_LIBADD = \
-	$(LINKS_LIBS)
+	$(PACKAGE_LIBS)
 
 libnotify_la_LDFLAGS = \
 	-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
diff --git a/libnotify/notification.c b/libnotify/notification.c
index bdb69ad..2a42236 100644
--- a/libnotify/notification.c
+++ b/libnotify/notification.c
@@ -25,9 +25,6 @@
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib.h>
 
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-
 #include "notify.h"
 #include "internal.h"
 
diff --git a/libnotify/notification.h b/libnotify/notification.h
index 033720c..982bc2e 100644
--- a/libnotify/notification.h
+++ b/libnotify/notification.h
@@ -25,7 +25,8 @@
 
 #include <glib.h>
 #include <glib-object.h>
-#include <gtk/gtk.h>
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
 
 G_BEGIN_DECLS
 
diff --git a/libnotify/notify.c b/libnotify/notify.c
index 7272b3e..19138af 100644
--- a/libnotify/notify.c
+++ b/libnotify/notify.c
@@ -26,7 +26,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <unistd.h>
-#include <gmodule.h>
 
 #include "notify.h"
 #include "internal.h"
@@ -40,23 +39,6 @@ static GList           *_active_notifications = NULL;
 static int              _spec_version_major = 0;
 static int              _spec_version_minor = 0;
 
-/* For the GTK+ and gdk-pixbuf functions */
-static GModule *module = NULL;
-static struct GtkDlMapping {
-        const char *function_name;
-        gpointer function_ptr;
-} gtk_dl_mapping [] = {
-#define MAP(a) { #a, (gpointer *)&a }
-        MAP(gdk_screen_make_display_name),
-        MAP(gdk_window_get_origin),
-        MAP(gtk_widget_get_allocation),
-        MAP(gtk_widget_get_has_window),
-        MAP(gtk_widget_get_screen),
-        MAP(gtk_widget_get_window)
-#undef MAP
-};
-
-
 gboolean
 _notify_check_spec_version (int major,
                             int minor)
@@ -98,8 +80,6 @@ _notify_update_spec_version (void)
 gboolean
 notify_init (const char *app_name)
 {
-        guint i;
-
         g_return_val_if_fail (app_name != NULL, FALSE);
         g_return_val_if_fail (*app_name != '\0', FALSE);
 
@@ -111,26 +91,6 @@ notify_init (const char *app_name)
 
         g_type_init ();
 
-        /* Look up the symbols for the GTK+ and GDK
-         * functions we use */
-        module = g_module_open (NULL, G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
-        if (module == NULL) {
-                g_warning ("Failed to get our own symbols: '%s'",
-                           g_module_error ());
-                return FALSE;
-        }
-        for (i = 0; i < G_N_ELEMENTS (gtk_dl_mapping); i++) {
-                if (!g_module_symbol (module,
-                                      gtk_dl_mapping[i].function_name,
-                                      &gtk_dl_mapping[i].function_ptr)) {
-                        g_warning ("Missing symbol '%s'",
-                                   gtk_dl_mapping[i].function_name);
-                        g_module_close (module);
-                        module = NULL;
-                        return FALSE;
-                }
-        }
-
         _initted = TRUE;
 
         return TRUE;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index de86b90..fcd7b1b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -14,8 +14,7 @@ noinst_PROGRAMS = \
 	test-urgency \
 	test-xy \
 	test-xy-actions \
-	test-xy-stress \
-	test-gtk3
+	test-xy-stress
 
 common_ldflags = \
 	$(top_builddir)/libnotify/libnotify.la \
@@ -69,9 +68,6 @@ test_rtl_LDADD = $(common_ldflags)
 test_persistence_SOURCES = test-persistence.c
 test_persistence_LDADD = $(common_ldflags)
 
-test_gtk3_SOURCES = test-gtk3.c
-test_gtk3_LDADD = $(top_builddir)/libnotify/libnotify.la $(GTK3_LIBS)
-
 EXTRA_DIST = applet-critical.png
 
 INCLUDES = $(PACKAGE_CFLAGS)	\



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]