summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2010-10-09 00:19:05 -0400
committerWilliam Jon McCann <jmccann@redhat.com>2010-10-09 00:32:31 -0400
commitb6c1835fcf016b084a87f52f58b6e676d14f6c9c (patch)
tree68bd60cff32019a963e499b6a8d47bd00febb88b
parent7acabe0741bed09518c1f8b5a094043c3a6ab80d (diff)
downloadlibnotify-b6c1835fcf016b084a87f52f58b6e676d14f6c9c.tar.gz
Don't need to fuss with gtk symbols since we don't use gtk at all anymore
-rw-r--r--configure.ac16
-rw-r--r--libnotify.pc.in2
-rw-r--r--libnotify/Makefile.am2
-rw-r--r--libnotify/notification.c3
-rw-r--r--libnotify/notification.h3
-rw-r--r--libnotify/notify.c40
-rw-r--r--tests/Makefile.am6
-rw-r--r--tests/test-gtk3.c74
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) \
diff --git a/tests/test-gtk3.c b/tests/test-gtk3.c
deleted file mode 100644
index 1cc8757..0000000
--- a/tests/test-gtk3.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
- *
- * @file tests/test-gtk3.c Unit test: gtk3 symbols
- *
- * @Copyright (C) 2004 Mike Hearn <mike@navi.cx>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#include <libnotify/notify.h>
-#include <stdio.h>
-#include <unistd.h>
-
-int
-main ()
-{
- NotifyNotification *n;
-
- notify_init ("Basics");
-
- /* Long summary */
- n = notify_notification_new ("Summary that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
- "Content",
- NULL);
- notify_notification_set_timeout (n, 3000); //3 seconds
-
- if (!notify_notification_show (n, NULL)) {
- fprintf (stderr, "failed to send notification\n");
- return 1;
- }
-
- g_object_unref (G_OBJECT (n));
-
- /* Long message */
- n = notify_notification_new ("Summary",
- "Content that is very long 8374983278r32j4 rhjjfh dw8f 43jhf 8ds7 ur2389f jdbjkt h8924yf jkdbjkt 892hjfiHER98HEJIF BDSJHF hjdhF JKLH 890YRHEJHFU 89HRJKSHdd dddd ddddd dddd ddddd dddd ddddd dddd dddd ddd ddd dddd Fdd d ddddd dddddddd ddddddddhjkewdkjsjfjk sdhkjf hdkj dadasdadsa adsd asd sd saasd fadskfkhsjf hsdkhfkshfjkhsd kjfhsjdkhfj ksdhfkjshkjfsd sadhfjkhaskd jfhsdajkfhkjs dhfkjsdhfkjs adhjkfhasdkj fhdsakjhfjk asdhkjkfhd akfjshjfsk afhjkasdhf jkhsdaj hf kjsdfahkfh sakjhfksdah kfdashkjf ksdahfj shdjdh",
- NULL);
- notify_notification_set_timeout (n, 3000); //3 seconds
-
- if (!notify_notification_show (n, NULL)) {
- fprintf (stderr, "failed to send notification\n");
- return 1;
- }
-
- g_object_unref (G_OBJECT (n));
-
- /* Summary only */
- n = notify_notification_new ("Summary only there is no message content",
- NULL,
- NULL);
- notify_notification_set_timeout (n, 3000); //3 seconds
-
- if (!notify_notification_show (n, NULL)) {
- fprintf (stderr, "failed to send notification\n");
- return 1;
- }
-
- g_object_unref (G_OBJECT (n));
-
- return 0;
-}