Re: [gnome-love] Beginner documentation on writing extensions



Hi Ankur,

Look at this gnome-documents' module[0], it's a more straightforward example.

Basically, you'll need to define the interface (which describes the
interface, methods and their properties exposed via dbus).
For that, run the following command line to obtain the xml-formatted
interface for the object you need (look specifically at the method you
want):

gdbus introspect --session --dest org.gnome.SessionManager
--object-path /org/gnome/SessionManager/Presence -x

After that, you'll make a proxy object and instantiate it. In doing
so, this proxy object will be capable of calling the method you want
"as a native gjs object method", like:
sessionManagerObj.SetStatus() [1]. Each argument must be specified as
a serialized GVariant.

[0] https://git.gnome.org/browse/gnome-documents/tree/src/miners.js
[1] https://people.gnome.org/~mccann/gnome-session/docs/gnome-session.html#org.gnome.SessionManager.Presence

On Sat, Jun 20, 2015 at 7:31 PM, Ankur Sinha <sanjay ankur gmail com> wrote:
On Sat, 2015-06-20 at 23:24 +0100, Ankur Sinha wrote:
but I really don't know where to look on how the interface defined
there and so on are to be used.

This post contains docs on the various JS files:
http://mathematicalcoffee.blogspot.co.uk/2012/09/gnome-shell-javascript
-source.html#contactDisplay

but again, I'm not sure I know how to go about using this information.
--
Thanks,
Regards,
Ankur Sinha "FranciscoD"

http://fedoraproject.org/wiki/User:Ankursinha


_______________________________________________
gnome-love mailing list
gnome-love gnome org
https://mail.gnome.org/mailman/listinfo/gnome-love




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]