--- configure.in.orig Mon Jan 2 22:21:37 2006 +++ configure.in Wed Feb 8 20:56:06 2006 @@ -197,6 +197,24 @@ AC_SUBST(XMMS_LIBS) AC_SUBST(XMMS_CFLAGS) +BMPX_LIBS= +BMPX_CFLAGS= + +AC_ARG_WITH(bmpx, + AC_HELP_STRING([--with-bmpx], [build BMPx helper (default autodetect)]), + , [with_bmpx=yes]) + +if test "$with_bmpx" = "yes"; then + PKG_CHECK_MODULES([BMPX], [dbus-1 >= 0.35 dbus-glib-1 >= 0.35],[], [with_bmpx=no]) + AC_CHECK_HEADERS([bmpx/dbus.h], [], [with_bmpx=no]) + + if test "$with_bmpx" = "no"; then + AC_MSG_WARN([BMPx support disabled.]) + fi +fi +AC_SUBST(BMPX_LIBS) +AC_SUBST(BMPX_CFLAGS) + dnl liblivejournal dependencies. MODULES="glib-2.0 gobject-2.0 libxml-2.0" PKG_CHECK_MODULES(LIVEJOURNAL, $MODULES) @@ -205,6 +223,7 @@ dnl end liblivejournal dependencies. AM_CONDITIONAL(WITH_XMMS, test "$with_xmms" = "yes") +AM_CONDITIONAL(WITH_BMPX, test "$with_bmpx" = "yes") AM_CONDITIONAL(WITH_HTML, test "$with_gtkhtml" != "no") AM_CONDITIONAL(WITH_RSVG, test "$with_librsvg" = "yes") AM_CONDITIONAL(WITH_SQLITE3, test "$with_sqlite3" = "yes") @@ -216,6 +235,7 @@ AC_CONFIG_FILES([Makefile po/Makefile.in doc/Makefile data/Makefile images/Makefile util/Makefile util/xmmsclient/Makefile +util/bmpxclient/Makefile protocol/Makefile src/Makefile]) AC_OUTPUT @@ -240,6 +260,7 @@ echo " If you need these features, you must build with Curl." fi echo " - XMMS helper: ${with_xmms}" +echo " - BMPx helper: ${with_bmpx}" echo " - SQLite3: ${with_sqlite3}" echo "" --- util/Makefile.am.orig Mon Feb 21 17:46:10 2005 +++ util/Makefile.am Wed Feb 8 10:16:03 2006 @@ -5,3 +5,6 @@ SUBDIRS += xmmsclient endif +if WITH_BMPX +SUBDIRS += bmpxclient +endif --- util/bmpxclient/Makefile.am.orig Wed Feb 8 10:16:03 2006 +++ util/bmpxclient/Makefile.am Wed Feb 8 21:04:55 2006 @@ -0,0 +1,6 @@ +bin_PROGRAMS = logjam-bmpx-client + +AM_CFLAGS = @BMPX_CFLAGS@ + +logjam_bmpx_client_SOURCES = logjam-bmpx-client.c +logjam_bmpx_client_LDADD = @BMPX_LIBS@ @INTLLIBS@ --- util/bmpxclient/logjam-bmpx-client.c.orig Wed Feb 8 10:16:03 2006 +++ util/bmpxclient/logjam-bmpx-client.c Wed Feb 8 21:04:04 2006 @@ -0,0 +1,43 @@ +#include +#include +#include + +#define DBUS_TYPE_G_STRING_VALUE_HASHTABLE \ + (dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE)) + +int +main(int argc, char **argv) +{ + DBusGConnection *bus = NULL; + DBusGProxy *remote_object = NULL; + GError *error = NULL; + gchar *title; + + g_type_init(); + dbus_g_type_specialized_init(); + + bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + if (bus == NULL) { + fprintf(stderr, "Error: %s\n", error->message); + return -1; + } + + remote_object = dbus_g_proxy_new_for_name(bus, + BMP_DBUS_SERVICE, + BMP_DBUS_PATH_SYSTEMCONTROL, + BMP_DBUS_INTERFACE); + if (remote_object == NULL) { + fprintf(stderr, "Error: %s\n", error->message); + return -1; + } + + if (dbus_g_proxy_call(remote_object, "GetCurrentTitle", &error, + G_TYPE_INVALID, G_TYPE_STRING, + &title, G_TYPE_INVALID)) { + printf("%s\n", title); + return 0; + } else { + fprintf(stderr, "BMPx is not running or something else is wrong :(\n"); + return -1; + } +}