Add a header for D-Bus interface definitions

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
Sebastian Ramacher 2014-01-15 17:55:54 +01:00
parent 2eeaef341c
commit 5a9f53b2b7
3 changed files with 12 additions and 5 deletions

View file

@ -68,9 +68,10 @@ version.h: version.h.in config.mk
$(QUIET)mv version.h.tmp version.h
dbus-interface-definitions.c: data/org.pwmt.zathura.xml
$(QUIET)echo "const char* DBUS_INTERFACE_XML =" > dbus-interface-definitions.c.tmp
$(QUIET)echo '#include "dbus-interface-definitions.h"' > dbus-interface-definitions.c.tmp
$(QUIET)echo 'const char* DBUS_INTERFACE_XML =' >> dbus-interface-definitions.c.tmp
$(QUIET)sed 's/^\(.*\)$$/"\1\\n"/' data/org.pwmt.zathura.xml >> dbus-interface-definitions.c.tmp
$(QUIET)echo ";" >> dbus-interface-definitions.c.tmp
$(QUIET)echo ';' >> dbus-interface-definitions.c.tmp
$(QUIET)mv dbus-interface-definitions.c.tmp dbus-interface-definitions.c
%.o: %.c

View file

@ -0,0 +1,8 @@
/* See LICENSE file for license and copyright information */
#ifndef ZATHURA_DBUS_INTERFACE_DEFINITIONS
#define ZATHURA_DBUS_INTERFACE_DEFINITIONS
const char* DBUS_INTERFACE_XML;
#endif

View file

@ -6,6 +6,7 @@
#include "zathura.h"
#include "document.h"
#include "utils.h"
#include "dbus-interface-definitions.h"
#include <girara/utils.h>
#include <gio/gio.h>
@ -34,9 +35,6 @@ typedef struct private_s {
(G_TYPE_INSTANCE_GET_PRIVATE((obj), ZATHURA_TYPE_DBUS, \
private_t))
/* in dbus-interface-definitions.c */
extern const char* DBUS_INTERFACE_XML;
static const GDBusInterfaceVTable interface_vtable;
static void