From 19e6cdf1a9c84bf5ae429ac2dbfc4f6d78cd091b Mon Sep 17 00:00:00 2001 From: Jason Conti Date: Sat, 25 Feb 2012 13:08:27 -0500 Subject: * Drop old dbus service file. * Clean up configure.ac * Drop gtk2 build --- configure.ac | 199 ++++++-------------------------- data/Makefile.am | 11 -- data/indicator-notifications.service.in | 3 - src/Makefile.am | 3 +- src/indicator-notifications.c | 18 +-- 5 files changed, 39 insertions(+), 195 deletions(-) delete mode 100644 data/indicator-notifications.service.in diff --git a/configure.ac b/configure.ac index 7c2c4de..93f9570 100644 --- a/configure.ac +++ b/configure.ac @@ -1,14 +1,10 @@ +AC_INIT([indicator-notifications], [0.1.4], [jason.conti@gmail.com]) -AC_INIT(indicator-notifications, 0.1.4, jason.conti@gmail.com) +AM_INIT_AUTOMAKE([-Wall -Werror]) -AC_PREREQ(2.53) +AM_SILENT_RULES([yes]) -AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-notifications, 0.1.4) - -AM_MAINTAINER_MODE - -IT_PROG_INTLTOOL([0.35.0]) +# Required compilers AC_ISC_POSIX AC_PROG_CC @@ -17,186 +13,61 @@ AC_STDC_HEADERS AC_DISABLE_STATIC AC_PROG_LIBTOOL -AC_SUBST(VERSION) -AC_CONFIG_MACRO_DIR([m4]) - -#m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) - -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"] -) - -AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums]) -AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal]) - -PKG_PROG_PKG_CONFIG +# Setup gettext with intltool -########################### -# GTK+ version option -########################### +IT_PROG_INTLTOOL +GETTEXT_PACKAGE=$PACKAGE +AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE], ["$GETTEXT_PACKAGE"], [Gettext package]) +AC_SUBST(GETTEXT_PACKAGE) -AC_ARG_WITH([gtk], - [AS_HELP_STRING([--with-gtk], - [Which version of gtk to use @<:@default=3@:>@])], - [], - [with_gtk=3]) +# Helpers for GSettings -GTK_VERSION=$with_gtk -AC_SUBST(GTK_VERSION) +GLIB_GSETTINGS -########################### -# Dependencies -########################### +# Required libraries from pkg-config INDICATOR_REQUIRED_VERSION=0.3.19 -DBUSMENUGLIB_REQUIRED_VERSION=0.1.1 -DBUSMENUGTK_REQUIRED_VERSION=0.3.94 -GIO_REQUIRED_VERSION=2.25.11 -# Note: the GIO check below also ensures the proper glib with gsettings support is present -#GDK_REQUIRED_VERSION=2.22 -GDK_PIXBUF_REQUIRED_VERSION=2.22 -GLIB_REQUIRED_VERSION=2.26 -GTK_REQUIRED_VERSION=2.12 GTK3_REQUIRED_VERSION=3.0 -INDICATOR_PKG_NAME=indicator-0.4 INDICATOR3_PKG_NAME=indicator3-0.4 -AS_IF([test "x$with_gtk" = x3], - [PKG_CHECK_MODULES(INDICATOR, $INDICATOR3_PKG_NAME >= $INDICATOR_REQUIRED_VERSION - glib-2.0 >= $GLIB_REQUIRED_VERSION - dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION - dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION - gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED_VERSION) - ], - [test "x$with_gtk" = x2], - [PKG_CHECK_MODULES(INDICATOR, $INDICATOR_PKG_NAME >= $INDICATOR_REQUIRED_VERSION - glib-2.0 >= $GLIB_REQUIRED_VERSION - dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION - dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION - gdk-pixbuf-2.0 >= $GDK_PIXBUF_REQUIRED_VERSION) - ], - [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])] -) - -AS_IF([test "x$with_gtk" = x3], - [PKG_CHECK_MODULES(SERVICE, $INDICATOR3_PKG_NAME >= $INDICATOR_REQUIRED_VERSION - glib-2.0 >= $GLIB_REQUIRED_VERSION - dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION - dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION - gio-2.0 >= $GIO_REQUIRED_VERSION) - ], - [test "x$with_gtk" = x2], - [PKG_CHECK_MODULES(SERVICE, $INDICATOR_PKG_NAME >= $INDICATOR_REQUIRED_VERSION - glib-2.0 >= $GLIB_REQUIRED_VERSION - dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION - dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION - gio-2.0 >= $GIO_REQUIRED_VERSION) - ], - [AC_MSG_FAILURE([Value for --with-gtk was neither 2 nor 3])] -) +[PKG_CHECK_MODULES(INDICATOR, $INDICATOR3_PKG_NAME >= $INDICATOR_REQUIRED_VERSION + gtk+-3.0 >= GTK3_REQUIRED_VERSION) +] AC_SUBST(INDICATOR_CFLAGS) AC_SUBST(INDICATOR_LIBS) -AC_SUBST(SERVICE_CFLAGS) -AC_SUBST(SERVICE_LIBS) - -########################### -# Grab the GSettings Macros -########################### - -GLIB_GSETTINGS - -########################### -# Check to see if we're local -########################### +# Library directories from pkg-config with_localinstall="no" -AC_ARG_ENABLE(localinstall, AS_HELP_STRING([--enable-localinstall], [install all of the files localy instead of system directories (for distcheck)]), with_localinstall=$enableval, with_localinstall=no) - -########################### -# Indicator Info -########################### - -AS_IF([test "x$with_localinstall" = "xyes"], - [ - INDICATORDIR="${libdir}/indicators/2/" - INDICATORICONSDIR="${datadir}/libindicate/icons/" - ], - [AS_IF([test "x$with_gtk" = "x2"], - [ - INDICATORDIR=`$PKG_CONFIG --variable=indicatordir $INDICATOR_PKG_NAME` - INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir $INDICATOR_PKG_NAME` - ], - [ - INDICATORDIR=`$PKG_CONFIG --variable=indicatordir $INDICATOR3_PKG_NAME` - INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir $INDICATOR3_PKG_NAME` - ])]) - -AC_SUBST(INDICATORDIR) -AC_SUBST(INDICATORICONSDIR) - -########################### -# DBus Service Info -########################### +AC_ARG_ENABLE([localinstall], + [AS_HELP_STRING([--enable-localinstall], + [set default library directories instead of asking pkg-config (default is no)])], + [with_localinstall="yes"], + [with_localinstall="no"]) if test "x$with_localinstall" = "xyes"; then - DBUSSERVICEDIR="${datadir}/dbus-1/services/" + INDICATORDIR="${libdir}/indicators/2/" + INDICATORICONSDIR="${datadir}/libindicate/icons/" else - DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1` + INDICATORDIR=`$PKG_CONFIG --variable=indicatordir $INDICATOR3_PKG_NAME` + INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir $INDICATOR3_PKG_NAME` fi -AC_SUBST(DBUSSERVICEDIR) - -############################## -# Custom Junk -############################## - -AC_DEFUN([AC_DEFINE_PATH], [ - test "x$prefix" = xNONE && prefix="$ac_default_prefix" - test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - ac_define_path=`eval echo [$]$2` - ac_define_path=`eval echo [$]ac_define_path` - $1="$ac_define_path" - AC_SUBST($1) - ifelse($3, , - AC_DEFINE_UNQUOTED($1, "$ac_define_path"), - AC_DEFINE_UNQUOTED($1, "$ac_define_path", $3)) -]) -########################### -# Internationalization -########################### +AC_SUBST(INDICATORDIR) +AC_SUBST(INDICATORICONSDIR) -GETTEXT_PACKAGE=indicator-notifications -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the default get text domain]) -AC_DEFINE_PATH(GNOMELOCALEDIR, "${datadir}/locale", [locale directory]) - -AM_GLIB_GNU_GETTEXT - -########################### -# Files -########################### - -AC_OUTPUT([ -Makefile -src/Makefile -data/Makefile -data/icons/Makefile -tests/Makefile -po/Makefile.in +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([ + Makefile + src/Makefile + data/Makefile + data/icons/Makefile + po/Makefile.in + tests/Makefile ]) -########################### -# Results -########################### - AC_MSG_NOTICE([ Recent Notifications Indicator Configuration: diff --git a/data/Makefile.am b/data/Makefile.am index b631c1e..61a1a63 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,12 +1 @@ SUBDIRS = icons - -dbus_servicesdir = $(DBUSSERVICEDIR) -dbus_services_DATA = indicator-notifications.service - -%.service: %.service.in - sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ - -EXTRA_DIST = \ - indicator-notifications.service.in - -CLEANFILES = indicator-notifications.service diff --git a/data/indicator-notifications.service.in b/data/indicator-notifications.service.in deleted file mode 100644 index 63373a4..0000000 --- a/data/indicator-notifications.service.in +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=com.launchpad.RecentNotifications.indicator -Exec=@libexecdir@/indicator-notifications-service diff --git a/src/Makefile.am b/src/Makefile.am index 803402a..a648233 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,4 @@ -AM_CPPFLAGS = -DICONS_DIR='"$(INDICATORICONSDIR)"' \ - -DWITH_GTK='$(GTK_VERSION)' +AM_CPPFLAGS = -DICONS_DIR='"$(INDICATORICONSDIR)"' notificationslibdir = $(INDICATORDIR) notificationslib_LTLIBRARIES = libnotifications.la diff --git a/src/indicator-notifications.c b/src/indicator-notifications.c index 1d94f59..ef83c73 100644 --- a/src/indicator-notifications.c +++ b/src/indicator-notifications.c @@ -28,10 +28,12 @@ with this program. If not, see . /* GStuff */ #include +/* #include #include +*/ #include -#include +/*#include */ #include /* Indicator Stuff */ @@ -95,10 +97,8 @@ static const gchar *get_accessible_desc(IndicatorObject *io); static GdkPixbuf *load_icon(const gchar *name, gint size); static void menu_visible_notify_cb(GtkWidget *menu, GParamSpec *pspec, gpointer user_data); -#if WITH_GTK == 3 static void calculate_size_cb(GtkWidget *item, gpointer user_data); static void resize_menu(GtkWidget *menu); -#endif static void message_received_cb(DBusSpy *spy, Notification *note, gpointer user_data); static GtkWidget *new_notification_menuitem(Notification *note); @@ -144,7 +144,6 @@ menu_visible_notify_cb(GtkWidget *menu, G_GNUC_UNUSED GParamSpec *pspec, gpointe } } -#if WITH_GTK == 3 /* In GTK3 labels can now automatically wrap to fit the size of their parent, * however, it seems to take several tries for GtkMenu to resize properly. * @@ -185,7 +184,6 @@ resize_menu(GtkWidget *menu) g_debug("RESIZE_MENU: W: %d H: %d -> W: %d H: %d", alloc.width, alloc.height, child_alloc.width, child_alloc.height); } -#endif static void message_received_cb(DBusSpy *spy, Notification *note, gpointer user_data) @@ -204,9 +202,7 @@ message_received_cb(DBusSpy *spy, Notification *note, gpointer user_data) self->priv->have_unread = TRUE; gtk_image_set_from_pixbuf(self->priv->image, self->priv->pixbuf_unread); } -#if WITH_GTK == 3 //resize_menu(GTK_WIDGET(self->priv->menu)); -#endif } static void @@ -293,11 +289,7 @@ new_notification_menuitem(Notification *note) g_free(unescaped_timestamp_string); g_free(timestamp_string); -#if WITH_GTK == 3 GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); -#else - GtkWidget *hbox = gtk_hbox_new(FALSE, 0); -#endif GtkWidget *label = gtk_label_new(NULL); gtk_misc_set_alignment(GTK_MISC(label), 0, 0); @@ -306,11 +298,7 @@ new_notification_menuitem(Notification *note) gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); gtk_label_set_line_wrap_mode(GTK_LABEL(label), PANGO_WRAP_WORD_CHAR); -#if WITH_GTK == 3 gtk_label_set_max_width_chars(GTK_LABEL(label), 42); -#else - gtk_widget_set_size_request(label, 300, -1); -#endif gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0); gtk_widget_show(label); -- cgit v1.2.3