js: use ES6 template strings for dbus interfaces

Use multiline template strings for dbus interfaces as they're easier to maintain
This commit is contained in:
Marco Trevisan (Treviño)
2018-08-23 02:55:02 +02:00
parent f77b3da74f
commit dbf993300a
37 changed files with 1006 additions and 945 deletions

View File

@ -14,40 +14,42 @@ const PanelMenu = imports.ui.panelMenu;
/* Keep in sync with data/org.freedesktop.bolt.xml */
const BoltClientInterface = '<node> \
<interface name="org.freedesktop.bolt1.Manager"> \
<property name="Probing" type="b" access="read"></property> \
<property name="AuthMode" type="s" access="readwrite"></property> \
<method name="EnrollDevice"> \
<arg type="s" name="uid" direction="in"> </arg> \
<arg type="s" name="policy" direction="in"> </arg> \
<arg type="s" name="flags" direction="in"> </arg> \
<arg name="device" direction="out" type="o"> </arg> \
</method> \
<signal name="DeviceAdded"> \
<arg name="device" type="o"> </arg> \
</signal> \
</interface> \
</node>';
const BoltClientInterface = `
<node>
<interface name="org.freedesktop.bolt1.Manager">
<property name="Probing" type="b" access="read"></property>
<property name="AuthMode" type="s" access="readwrite"></property>
<method name="EnrollDevice">
<arg type="s" name="uid" direction="in"> </arg>
<arg type="s" name="policy" direction="in"> </arg>
<arg type="s" name="flags" direction="in"> </arg>
<arg name="device" direction="out" type="o"> </arg>
</method>
<signal name="DeviceAdded">
<arg name="device" type="o"> </arg>
</signal>
</interface>
</node>`;
const BoltDeviceInterface = '<node> \
<interface name="org.freedesktop.bolt1.Device"> \
<property name="Uid" type="s" access="read"></property> \
<property name="Name" type="s" access="read"></property> \
<property name="Vendor" type="s" access="read"></property> \
<property name="Type" type="s" access="read"></property> \
<property name="Status" type="s" access="read"></property> \
<property name="Parent" type="s" access="read"></property> \
<property name="SysfsPath" type="s" access="read"></property> \
<property name="Stored" type="b" access="read"></property> \
<property name="Policy" type="s" access="read"></property> \
<property name="Key" type="s" access="read"></property> \
<property name="Label" type="s" access="read"></property> \
<property name="ConnectTime" type="t" access="read"></property> \
<property name="AuthorizeTime" type="t" access="read"></property> \
<property name="StoreTime" type="t" access="read"></property> \
</interface> \
</node>';
const BoltDeviceInterface = `
<node>
<interface name="org.freedesktop.bolt1.Device">
<property name="Uid" type="s" access="read"></property>
<property name="Name" type="s" access="read"></property>
<property name="Vendor" type="s" access="read"></property>
<property name="Type" type="s" access="read"></property>
<property name="Status" type="s" access="read"></property>
<property name="Parent" type="s" access="read"></property>
<property name="SysfsPath" type="s" access="read"></property>
<property name="Stored" type="b" access="read"></property>
<property name="Policy" type="s" access="read"></property>
<property name="Key" type="s" access="read"></property>
<property name="Label" type="s" access="read"></property>
<property name="ConnectTime" type="t" access="read"></property>
<property name="AuthorizeTime" type="t" access="read"></property>
<property name="StoreTime" type="t" access="read"></property>
</interface>
</node>`;
const BoltDeviceProxy = Gio.DBusProxy.makeProxyWrapper(BoltDeviceInterface);