[Gambas-user] DBus - How are signal data converted to Gambas data?

Hans Lehmann hans at gambas-buch.de
Tue Jan 30 14:58:11 CET 2018


Am 30.01.2018 um 14:47 schrieb Benoît Minisini:
> As far as I remember, it was created to implement the DBus tray icon 
> protocol.
> For example, if you have a DBus method whose return value signature is 
> "ii" (two integers) :
> You create a new class named, for example, "MyDBusReturnValue" that 
> inherits "DBusValues", whose Signature constant returns "ii".
> You define the Gambas implementation of your method as returning a 
> "MyDBusReturnValue". And inside, you create a new object of that type, 
> assign to its Value property an array of integers, and return that 
> object.
> The internal marshalling routine will detect that MyDBusReturnValue 
> inherits DBusValues, and so will know what you want to do: it will 
> convert the Gambas array to the DBus values corresponding to the "ii" 
> signature.
> You have an example of that, with a more complex signature, with the 
> "_DbusMenuItemLayout" class in the 'gb.dbus.trayicon' component 
> project source code. 
Hello, Benoît,

Thank you very much for the information and the solution approach with 
the new class inherited by "DBusValues".

With kind regards

Hans


More information about the User mailing list