Macro for attaching Introspectable to a DBUS path
This commit is contained in:
parent
39a37b8ee7
commit
9675c880d9
104
secrettabero.scm
104
secrettabero.scm
|
@ -104,30 +104,39 @@
|
||||||
|
|
||||||
|
|
||||||
;; —————————————————————————————————————
|
;; —————————————————————————————————————
|
||||||
;; DBUS Path: /
|
;; DBUS generally
|
||||||
;; —————————————————————————————————————
|
;; —————————————————————————————————————
|
||||||
|
|
||||||
;; Callback function for org.freedesktop.DBus.Introspectable's `Introspect`.
|
;; Creates an Introspectable interface for the given path, given a list
|
||||||
(define (root-introspection-introspect)
|
;; of interfaces and subnodes.
|
||||||
|
(define-syntax handle-introspection-for-path
|
||||||
|
(syntax-rules ()
|
||||||
|
((handle-introspection-for-path node-path interfaces subnodes)
|
||||||
|
(let* ([xml
|
||||||
(introspect-node-xml
|
(introspect-node-xml
|
||||||
'(("org.freedesktop.DBus.Introspectable"
|
(list
|
||||||
|
(append '("org.freedesktop.DBus.Introspectable"
|
||||||
. (("Introspect"
|
. (("Introspect"
|
||||||
. (((direction . "out")
|
. (((direction . "out")
|
||||||
(type . "s")
|
(type . "s")
|
||||||
(name . "xml_data")))))))
|
(name . "xml_data"))))))
|
||||||
'(org)))
|
interfaces))
|
||||||
|
subnodes)]
|
||||||
|
[context
|
||||||
;; The DBUS context used for introspection.
|
(dbus:make-context bus: dbus:session-bus
|
||||||
(define root-introspection-context
|
|
||||||
(dbus:make-context
|
|
||||||
bus: dbus:session-bus
|
|
||||||
service: 'org.jadedctrl.secrettabero
|
service: 'org.jadedctrl.secrettabero
|
||||||
interface: 'org.freedesktop.DBus.Introspectable
|
interface: 'org.freedesktop.DBus.Introspectable
|
||||||
path: '/))
|
path: node-path)])
|
||||||
|
(dbus:register-method context "Introspect"
|
||||||
|
(lambda () xml))))))
|
||||||
|
|
||||||
(dbus:register-method root-introspection-context "Introspect"
|
|
||||||
root-introspection-introspect)
|
|
||||||
|
;; —————————————————————————————————————
|
||||||
|
;; DBUS Path: /
|
||||||
|
;; —————————————————————————————————————
|
||||||
|
|
||||||
|
(handle-introspection-for-path '/ '() '(org))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -135,27 +144,7 @@
|
||||||
;; DBUS Path: /org/
|
;; DBUS Path: /org/
|
||||||
;; —————————————————————————————————————
|
;; —————————————————————————————————————
|
||||||
|
|
||||||
;; Callback function for org.freedesktop.DBus.Introspectable's `Introspect`.
|
(handle-introspection-for-path '/org '() '(freedesktop))
|
||||||
(define (root-org-introspection-introspect)
|
|
||||||
(introspect-node-xml
|
|
||||||
'(("org.freedesktop.DBus.Introspectable"
|
|
||||||
. (("Introspect"
|
|
||||||
. (((direction . "out")
|
|
||||||
(type . "s")
|
|
||||||
(name . "xml_data")))))))
|
|
||||||
'(freedesktop)))
|
|
||||||
|
|
||||||
|
|
||||||
;; The DBUS context used for introspection.
|
|
||||||
(define root-org-introspection-context
|
|
||||||
(dbus:make-context
|
|
||||||
bus: dbus:session-bus
|
|
||||||
service: 'org.jadedctrl.secrettabero
|
|
||||||
interface: 'org.freedesktop.DBus.Introspectable
|
|
||||||
path: '/org))
|
|
||||||
|
|
||||||
(dbus:register-method root-org-introspection-context "Introspect"
|
|
||||||
root-org-introspection-introspect)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -163,27 +152,7 @@
|
||||||
;; DBUS Path: /org/freedesktop/
|
;; DBUS Path: /org/freedesktop/
|
||||||
;; —————————————————————————————————————
|
;; —————————————————————————————————————
|
||||||
|
|
||||||
;; Callback function for org.freedesktop.DBus.Introspectable's `Introspect`.
|
(handle-introspection-for-path '/org/freedesktop '() '(secrets))
|
||||||
(define (root-org-freedesktop-introspection-introspect)
|
|
||||||
(introspect-node-xml
|
|
||||||
'(("org.freedesktop.DBus.Introspectable"
|
|
||||||
. (("Introspect"
|
|
||||||
. (((direction . "out")
|
|
||||||
(type . "s")
|
|
||||||
(name . "xml_data")))))))
|
|
||||||
'(secrets)))
|
|
||||||
|
|
||||||
|
|
||||||
;; The DBUS context used for introspection.
|
|
||||||
(define root-org-freedesktop-introspection-context
|
|
||||||
(dbus:make-context
|
|
||||||
bus: dbus:session-bus
|
|
||||||
service: 'org.jadedctrl.secrettabero
|
|
||||||
interface: 'org.freedesktop.DBus.Introspectable
|
|
||||||
path: '/org/freedesktop))
|
|
||||||
|
|
||||||
(dbus:register-method root-org-freedesktop-introspection-context "Introspect"
|
|
||||||
root-org-freedesktop-introspection-introspect)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -191,26 +160,7 @@
|
||||||
;; DBUS Path: /org/freedesktop/secrets
|
;; DBUS Path: /org/freedesktop/secrets
|
||||||
;; —————————————————————————————————————
|
;; —————————————————————————————————————
|
||||||
|
|
||||||
;; Callback function for org.freedesktop.DBus.Introspectable's `Introspect`.
|
(handle-introspection-for-path '/org/freedesktop/secrets '() '())
|
||||||
(define (root-org-freedesktop-secrets-introspection-introspect)
|
|
||||||
(introspect-node-xml
|
|
||||||
'(("org.freedesktop.DBus.Introspectable"
|
|
||||||
. (("Introspect"
|
|
||||||
. (((direction . "out")
|
|
||||||
(type . "s")
|
|
||||||
(name . "xml_data")))))))))
|
|
||||||
|
|
||||||
|
|
||||||
;; The DBUS context used for introspection.
|
|
||||||
(define root-org-freedesktop-secrets-introspection-context
|
|
||||||
(dbus:make-context
|
|
||||||
bus: dbus:session-bus
|
|
||||||
service: 'org.jadedctrl.secrettabero
|
|
||||||
interface: 'org.freedesktop.DBus.Introspectable
|
|
||||||
path: '/org/freedesktop/secrets))
|
|
||||||
|
|
||||||
(dbus:register-method root-org-freedesktop-secrets-introspection-context "Introspect"
|
|
||||||
root-org-freedesktop-secrets-introspection-introspect)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue