Saturday, April 2, 2016

Forward Sync

#!/usr/bin/python
import dbus, sys
bus = dbus.SessionBus()
daemon = bus.get_object("org.mate.atril.Daemon", "/org/mate/atril/Daemon")
reply = daemon.FindDocument('file://' + sys.argv[1], True, dbus_interface = "org.mate.atril.Daemon")
window_obj = bus.get_object(reply, "/org/mate/atril/Window/0")
window_obj.SyncView(sys.argv[2], (int(sys.argv[3]), int(sys.argv[4])), 0, dbus_interface="org.mate.atril.Window")
call as "synctex-atril /tex_tmp/file.pdf /home/user/file.tex 77 1"
#define APPLICATION_DBUS_OBJECT_PATH "/org/mate/atril/Atril"
#define APPLICATION_DBUS_INTERFACE   "org.mate.atril.Application"

#define ATRIL_DAEMON_SERVICE        "org.mate.atril.Daemon"
#define ATRIL_DAEMON_OBJECT_PATH    "/org/mate/atril/Daemon"
#define ATRIL_DAEMON_INTERFACE      "org.mate.atril.Daemon"

#define EV_WINDOW_DBUS_OBJECT_PATH "/org/mate/atril/Window/%d"
#define EV_WINDOW_DBUS_INTERFACE   "org.mate.atril.Window"

in order to be able to use a certain service, a client must indicate not only the object path providing the desired service, but also the bus name under which the service process is connected to the bus



bus name    = org.mate.atril.Daemon  # qdbus
object path = /org/mate/atril/Daemon # qdbus org.mate.atril.Daemon
qdbus org.mate.atril.Daemon /org/mate/atril/Daemon org.mate.atril.Daemon.FindDocument "file:///tex_tmp/setup_tarif.pdf" true # qdbus org.mate.atril.Daemon /org/mate/atril/Daemon
qdbus --literal `qdbus org.mate.atril.Daemon /org/mate/atril/Daemon org.mate.atril.Daemon.FindDocument "file:///tex_tmp/setup_tarif.pdf" true` /org/mate/atril/Atril org.mate.atril.Application.GetWindowList

No comments:

Post a Comment