Revamp DBus tooling
The current tooling for implementing DBus interfaces in gjs is far from perfect, sometimes simple types work, sometimes GValues have to be used, and it's often unclear when.
Another thing is that tuples in dbus type descriptions are described using arrays on the javascript side, but JS arrays are also used for actual array types in dbus, leading to weird things like this (note the three arrays with [[[
):
<method name="GetTechnologies">
<arg name="technologies" type="a(oa{sv})" direction="out"/>
</method>
GetTechnologies() {
return new GLib.Variant('(a(oa{sv}))', [[
[
'/net/connman/technology/wifi',
{
'Name': GLib.Variant.new_string('WiFi'),
},
'/net/connman/technology/bluetooth',
{
'Name': GLib.Variant.new_string('Bluetooth'),
},
]
]]);
}
Not sure what the best path to improve the situation here is without breaking existing code, maybe it would already be enough to encourage only using GVariants for everything dbus, then we could rely on the existing documentation and examples of GDBus.