[Xfce4-commits] <xfce4-notifyd:master> add spec_version OUT arg to GetServerInformation (bug 5602)
Brian J. Tarricone
noreply at xfce.org
Thu Oct 29 07:00:01 CET 2009
Updating branch refs/heads/master
to faeda9c473b612d0ad879e15f304673b595dc4fc (commit)
from 10ee27ea551da22de71321155c6a897d44692a07 (commit)
commit faeda9c473b612d0ad879e15f304673b595dc4fc
Author: Brian J. Tarricone <brian at tarricone.org>
Date: Wed Oct 28 22:46:33 2009 -0700
add spec_version OUT arg to GetServerInformation (bug 5602)
also add configure switch to bring back the old behavior
Makefile.am | 22 ++++++++++++++++------
configure.ac.in | 22 ++++++++++++++++++++--
xfce4-notifyd/notify-dbus.xml | 1 +
xfce4-notifyd/xfce-notify-daemon.c | 9 +++++++++
4 files changed, 46 insertions(+), 8 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 590be4d..e835800 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -101,10 +101,15 @@ dist_smoketheme_DATA = themes/Smoke/gtkrc
zomgponiesthemedir = $(theme_dir)/ZOMG-PONIES!/xfce-notify-4.0
dist_zomgponiestheme_DATA = themes/ZOMG-PONIES!/gtkrc
+built_xfce4_notifyd = \
+ xfce4-notifyd/notify-dbus.h
+
+clean_xfce4_notifyd = \
+ $(built_xfce4_notifyd)
+
if MAINTAINER_MODE
-built_xfce4_notifyd = \
- xfce4-notifyd/notify-dbus.h \
+built_xfce4_notifyd += \
xfce4-notifyd/xfce-notify-marshal.c \
xfce4-notifyd/xfce-notify-marshal.h \
xfce4-notifyd/xfce-notify-enum-types.c \
@@ -113,8 +118,7 @@ built_xfce4_notifyd = \
built_xfce4_notifyd_config = \
xfce4-notifyd-config/xfce4-notifyd-config.glade.h
-clean_xfce4_notifyd = \
- $(built_xfce4_notifyd) \
+clean_xfce4_notifyd += \
xfce4-notifyd/stamp-xfce-notify-enum-types.h \
xfce4-notifyd/stamp-xfce-notify-marshal.h
@@ -149,10 +153,16 @@ DISTCLEANFILES = \
$(distclean_intltool) \
$(distclean_service)
-if MAINTAINER_MODE
-
xfce4-notifyd/notify-dbus.h: $(srcdir)/xfce4-notifyd/notify-dbus.xml Makefile
+if USE_OLD_GET_SERVER_INFORMATION_SIGNATURE
+ sed -e 's,<arg direction="out" name="spec_version" type="s"/>,,' $< > $(<F).tmp
+ dbus-binding-tool --mode=glib-server --prefix=notify $(<F).tmp > $@
+ rm -f $(<F).tmp
+else
dbus-binding-tool --mode=glib-server --prefix=notify $< > $@
+endif
+
+if MAINTAINER_MODE
xfce4-notifyd/xfce-notify-marshal.h: xfce4-notifyd/stamp-xfce-notify-marshal.h
@true
diff --git a/configure.ac.in b/configure.ac.in
index f490f14..255ea2a 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -13,6 +13,8 @@ m4_define([xfce4_notifyd_version_build], [@REVISION@])
m4_define([xfce4_notifyd_version_tag], [git])
m4_define([xfce4_notifyd_version], [xfce4_notifyd_version_major().xfce4_notifyd_version_minor().xfce4_notifyd_version_micro()ifelse(xfce4_notifyd_version_tag(), [git], [xfce4_notifyd_version_tag()-xfce4_notifyd_version_build()], [xfce4_notifyd_version_tag()])])
+m4_define([notifications_spec_version], [0.9])
+
dnl init autoconf
AC_INIT([xfce4-notifyd], [xfce4_notifyd_version],
[http://bugzilla.xfce.org/enter_bug.cgi?product=Xfce4-notifyd],
@@ -69,14 +71,30 @@ AS_IF([test "x$USE_MAINTAINER_MODE" = "xyes"],
])
])
+dnl legacy support
AC_ARG_ENABLE([old-notification-closed-signature],
[AS_HELP_STRING([--enable-old-notification-closed-signature],
[Use the old NotificationClosed signal signature that leaves out the 'reason' parameter. You want to enable this if your system has libnotify 0.4.4 or earlier.])],
- [use_old_sig=$enableval], [use_old_sig=no])
-AS_IF([test "x$use_old_sig" = "xyes"],
+ [use_old_nc_sig=$enableval], [use_old_nc_sig=no])
+AS_IF([test "x$use_old_nc_sig" = "xyes"],
[AC_DEFINE([USE_OLD_NOTIFICATION_CHANGED_SIGNATURE], [1],
[Set if we should use the old NotificationClosed signal signature])])
+dnl legacy support
+AC_ARG_ENABLE([old-get-server-information-signature],
+ [AS_HELP_STRING([--enable-old-get-server-information-signature],
+ [Use the old GetServerInformation method signature that leaves out the 'spec_version' parameter. (default=no)])],
+ [use_old_gsi_sig=$enableval], [use_old_gsi_sig=no])
+AS_IF([test "x$use_old_gsi_sig" = "xyes"],
+ [AC_DEFINE([USE_OLD_GET_SERVER_INFORMATION_SIGNATURE], [1],
+ [Set if we should use the old GetServerInformation method signature])])
+AM_CONDITIONAL([USE_OLD_GET_SERVER_INFORMATION_SIGNATURE],
+ [test "x$use_old_gsi_sig" = "xyes"])
+
+dnl create #define for spec version
+AC_DEFINE_UNQUOTED([NOTIFICATIONS_SPEC_VERSION], ["notifications_spec_version"],
+ [Set to the version of the freedesktop.org notifications spec we support])
+
dnl check for debugging support
XDT_FEATURE_DEBUG
diff --git a/xfce4-notifyd/notify-dbus.xml b/xfce4-notifyd/notify-dbus.xml
index 832d7b9..98a82ef 100644
--- a/xfce4-notifyd/notify-dbus.xml
+++ b/xfce4-notifyd/notify-dbus.xml
@@ -27,6 +27,7 @@
<arg direction="out" name="name" type="s"/>
<arg direction="out" name="vendor" type="s"/>
<arg direction="out" name="version" type="s"/>
+ <arg direction="out" name="spec_version" type="s"/>
</method>
<signal name="NotificationClosed">
diff --git a/xfce4-notifyd/xfce-notify-daemon.c b/xfce4-notifyd/xfce-notify-daemon.c
index 660aa0a..5be3b1a 100644
--- a/xfce4-notifyd/xfce-notify-daemon.c
+++ b/xfce4-notifyd/xfce-notify-daemon.c
@@ -95,6 +95,9 @@ static gboolean notify_get_server_information(XfceNotifyDaemon *xndaemon,
gchar **OUT_name,
gchar **OUT_vendor,
gchar **OUT_version,
+#ifndef USE_OLD_GET_SERVER_INFORMATION_SIGNATURE
+ gchar **OUT_spec_version,
+#endif
GError **error);
static gboolean notify_quit(XfceNotifyDaemon *xndaemon,
@@ -422,11 +425,17 @@ notify_get_server_information(XfceNotifyDaemon *xndaemon,
gchar **OUT_name,
gchar **OUT_vendor,
gchar **OUT_version,
+#ifndef USE_OLD_GET_SERVER_INFORMATION_SIGNATURE
+ gchar **OUT_spec_version,
+#endif
GError **error)
{
*OUT_name = g_strdup("Xfce Notify Daemon");
*OUT_vendor = g_strdup("Xfce");
*OUT_version = g_strdup(VERSION);
+#ifndef USE_OLD_GET_SERVER_INFORMATION_SIGNATURE
+ *OUT_spec_version = g_strdup(NOTIFICATIONS_SPEC_VERSION);
+#endif
return TRUE;
}
More information about the Xfce4-commits
mailing list