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

This commit is contained in:
William Jon McCann 2010-10-09 00:19:05 -04:00
parent 7acabe0741
commit b6c1835fcf
8 changed files with 10 additions and 136 deletions

View File

@ -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)

View File

@ -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}

View File

@ -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)

View File

@ -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"

View File

@ -25,7 +25,8 @@
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
G_BEGIN_DECLS

View File

@ -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;

View File

@ -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) \

View File

@ -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;
}