mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-13 09:23:45 +01:00
Install D-Bus interface definitions
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
b36c078710
commit
fb000b9607
8
Makefile
8
Makefile
@ -128,6 +128,7 @@ dist: clean build-manpages
|
|||||||
${PROJECT}.1.rst ${PROJECT}rc.5.rst ${OSOURCE} ${HEADER} ${PROJECT}.pc.in \
|
${PROJECT}.1.rst ${PROJECT}rc.5.rst ${OSOURCE} ${HEADER} ${PROJECT}.pc.in \
|
||||||
${PROJECT}.desktop version.h.in \
|
${PROJECT}.desktop version.h.in \
|
||||||
${PROJECT}.1 ${PROJECT}rc.5 \
|
${PROJECT}.1 ${PROJECT}rc.5 \
|
||||||
|
org.pwmt.zathura.synxtex.xml \
|
||||||
${PROJECT}-${VERSION}
|
${PROJECT}-${VERSION}
|
||||||
$(QUIET)cp tests/Makefile tests/config.mk tests/*.c \
|
$(QUIET)cp tests/Makefile tests/config.mk tests/*.c \
|
||||||
${PROJECT}-${VERSION}/tests
|
${PROJECT}-${VERSION}/tests
|
||||||
@ -184,7 +185,12 @@ install-headers: ${PROJECT}.pc
|
|||||||
$(QUIET)mkdir -m 755 -p ${DESTDIR}${LIBDIR}/pkgconfig
|
$(QUIET)mkdir -m 755 -p ${DESTDIR}${LIBDIR}/pkgconfig
|
||||||
$(QUIET)install -m 644 ${PROJECT}.pc ${DESTDIR}${LIBDIR}/pkgconfig
|
$(QUIET)install -m 644 ${PROJECT}.pc ${DESTDIR}${LIBDIR}/pkgconfig
|
||||||
|
|
||||||
install: all install-headers install-manpages
|
install-dbus:
|
||||||
|
$(ECHO) installing D-Bus interface definitions
|
||||||
|
$(QUIET)mkdir -m 755 -p $(DESTDIR)$(DBUSINTERFACEDIR)
|
||||||
|
$(QUIET)install -m 644 org.pwmt.zathura.synxtex.xml $(DESTDIR)$(DBUSINTERFACEDIR)
|
||||||
|
|
||||||
|
install: all install-headers install-manpages install-dbus
|
||||||
$(ECHO) installing executable file
|
$(ECHO) installing executable file
|
||||||
$(QUIET)mkdir -m 755 -p ${DESTDIR}${PREFIX}/bin
|
$(QUIET)mkdir -m 755 -p ${DESTDIR}${PREFIX}/bin
|
||||||
$(QUIET)install -m 755 ${PROJECT} ${DESTDIR}${PREFIX}/bin
|
$(QUIET)install -m 755 ${PROJECT} ${DESTDIR}${PREFIX}/bin
|
||||||
|
@ -43,6 +43,7 @@ MANPREFIX ?= ${PREFIX}/share/man
|
|||||||
DESKTOPPREFIX ?= ${PREFIX}/share/applications
|
DESKTOPPREFIX ?= ${PREFIX}/share/applications
|
||||||
LIBDIR ?= ${PREFIX}/lib
|
LIBDIR ?= ${PREFIX}/lib
|
||||||
INCLUDEDIR ?= ${PREFIX}/include
|
INCLUDEDIR ?= ${PREFIX}/include
|
||||||
|
DBUSINTERFACEDIR =? ${PREFIX}/share/dbus-1/interfaces
|
||||||
|
|
||||||
# plugin directory
|
# plugin directory
|
||||||
PLUGINDIR ?= ${LIBDIR}/zathura
|
PLUGINDIR ?= ${LIBDIR}/zathura
|
||||||
|
@ -14,8 +14,10 @@ G_DEFINE_TYPE(ZathuraSynctexDbus, zathura_synctex_dbus, G_TYPE_OBJECT)
|
|||||||
|
|
||||||
/* template for bus name */
|
/* template for bus name */
|
||||||
static const char DBUS_NAME_TEMPLATE[] = "org.pwmt.zathura.PID-%d";
|
static const char DBUS_NAME_TEMPLATE[] = "org.pwmt.zathura.PID-%d";
|
||||||
/* template for object path */
|
/* object path */
|
||||||
const char DBUS_OBJPATH[] = "/org/pwmt/zathura/synctex";
|
static const char DBUS_OBJPATH[] = "/org/pwmt/zathura/synctex";
|
||||||
|
/* interface name */
|
||||||
|
static const char DBUS_INTERFACE[] = "org.pwmt.zathura.synctex";
|
||||||
|
|
||||||
typedef struct private_s {
|
typedef struct private_s {
|
||||||
zathura_t* zathura;
|
zathura_t* zathura;
|
||||||
@ -32,7 +34,7 @@ typedef struct private_s {
|
|||||||
/* Introspection data for the service we are exporting */
|
/* Introspection data for the service we are exporting */
|
||||||
static const char SYNCTEX_DBUS_INTROSPECTION[] =
|
static const char SYNCTEX_DBUS_INTROSPECTION[] =
|
||||||
"<node>\n"
|
"<node>\n"
|
||||||
" <interface name='org.pwmt.zathura.Synctex'>\n"
|
" <interface name='org.pwmt.zathura.synctex'>\n"
|
||||||
" <method name='View'>\n"
|
" <method name='View'>\n"
|
||||||
" <arg type='s' name='position' direction='in' />\n"
|
" <arg type='s' name='position' direction='in' />\n"
|
||||||
" <arg type='b' name='return' direction='out' />\n"
|
" <arg type='b' name='return' direction='out' />\n"
|
||||||
@ -270,7 +272,7 @@ synctex_forward_position(const char* filename, const char* position)
|
|||||||
|
|
||||||
GVariant* vfilename = g_dbus_connection_call_sync(connection,
|
GVariant* vfilename = g_dbus_connection_call_sync(connection,
|
||||||
name, DBUS_OBJPATH, "org.freedesktop.DBus.Properties",
|
name, DBUS_OBJPATH, "org.freedesktop.DBus.Properties",
|
||||||
"Get", g_variant_new("(ss)", "org.pwmt.zathura.Synctex", "filename"),
|
"Get", g_variant_new("(ss)", DBUS_INTERFACE, "filename"),
|
||||||
G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE,
|
G_VARIANT_TYPE("(v)"), G_DBUS_CALL_FLAGS_NONE,
|
||||||
TIMEOUT, NULL, &error);
|
TIMEOUT, NULL, &error);
|
||||||
if (vfilename == NULL) {
|
if (vfilename == NULL) {
|
||||||
@ -296,7 +298,7 @@ synctex_forward_position(const char* filename, const char* position)
|
|||||||
found_one = true;
|
found_one = true;
|
||||||
|
|
||||||
GVariant* ret = g_dbus_connection_call_sync(connection,
|
GVariant* ret = g_dbus_connection_call_sync(connection,
|
||||||
name, DBUS_OBJPATH, "org.pwmt.zathura.Synctex", "View",
|
name, DBUS_OBJPATH, DBUS_INTERFACE, "View",
|
||||||
g_variant_new("(s)", position), G_VARIANT_TYPE("(b)"),
|
g_variant_new("(s)", position), G_VARIANT_TYPE("(b)"),
|
||||||
G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error);
|
G_DBUS_CALL_FLAGS_NONE, TIMEOUT, NULL, &error);
|
||||||
if (ret == NULL) {
|
if (ret == NULL) {
|
||||||
|
Loading…
Reference in New Issue
Block a user