[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: on-the-fly D-Bus proxy creation
From: |
Michael Albinus |
Subject: |
Re: on-the-fly D-Bus proxy creation |
Date: |
Tue, 24 Feb 2015 09:52:52 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Daiki Ueno <address@hidden> writes:
> Hello,
Hi,
> One can call a D-Bus method as a normal method of CaribouDaemonProxy.
> This is really handy and I wished to have similar feature in Elisp
> (though I haven't ever written any practical D-Bus code in Elisp).
>
> Thanks to cl-generic, I gave it a try. With the attached code (far from
> complete though), a client can be implemented as:
>
> (dbus-define-proxy search-provider "\
> <node>
> <interface name=\"org.gnome.Shell.SearchProvider2\">
> <method name=\"GetInitialResultSet\">
> <arg type=\"as\" name=\"terms\" direction=\"in\" />
> <arg type=\"as\" name=\"results\" direction=\"out\" />
> </method>
> <!-- actually, there are more methods in this interface -->
> </interface>
> </node>")
>
> Then you can create a client and call D-Bus methods:
>
> (setq search-provider
> (search-provider-make :session
> "org.gnome.Weather.BackgroundService"
> "/org/gnome/Weather/BackgroundService"))
> (search-provider-call-GetInitialResultSet search-provider '("tokyo"))
>
> If this seems to be useful, I can finish it off as a patch.
There was some related work, see
<http://thread.gmane.org/gmane.emacs.devel/128998>.
I don't know the status, 'tho.
> Thanks,
>
> Daiki Ueno
Best regards, Michael.