ridiculous refactor to allow enums to be dbus strings for better TS generation

This commit is contained in:
Luke D. Jones
2023-06-27 21:16:13 +12:00
parent fca7d23a31
commit 7b17a13ce7
43 changed files with 1516 additions and 267 deletions
+105
View File
@@ -0,0 +1,105 @@
method return time=1687857321.236676 sender=:1.373 -> destination=:1.434 serial=2259 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.asuslinux.Daemon">
<!--
Writes a data stream of length. Will force system thread to exit until
it is restarted
-->
<method name="Write">
<arg name="input" type="(ays)" direction="in"/>
</method>
<!--
Set the global AniMe brightness
-->
<method name="SetImageBrightness">
<arg name="bright" type="d" direction="in"/>
</method>
<!--
Set base brightness level
-->
<method name="SetBrightness">
<arg name="brightness" type="s" direction="in"/>
</method>
<!--
Enable the builtin animations or not
-->
<method name="SetBuiltinsEnabled">
<arg name="enabled" type="b" direction="in"/>
</method>
<!--
Set which builtin animation is used for each stage
-->
<method name="SetBuiltinAnimations">
<arg name="boot" type="s" direction="in"/>
<arg name="awake" type="s" direction="in"/>
<arg name="sleep" type="s" direction="in"/>
<arg name="shutdown" type="s" direction="in"/>
</method>
<!--
Set whether the AniMe is enabled at all
-->
<method name="SetEnableDisplay">
<arg name="enabled" type="b" direction="in"/>
</method>
<!--
The main loop is the base system set action if the user isn't running
the user daemon
-->
<method name="RunMainLoop">
<arg name="start" type="b" direction="in"/>
</method>
<!--
Get the device state as stored by asusd
-->
<method name="DeviceState">
<arg type="(bsb(ssss))" direction="out"/>
</method>
<!--
Notify listeners of the status of AniMe LED power and factory
system-status animations
-->
<signal name="NotifyDeviceState">
<arg name="data" type="(bsb(ssss))"/>
</signal>
</interface>
</node>
"
+146
View File
@@ -0,0 +1,146 @@
method return time=1687857321.234264 sender=:1.373 -> destination=:1.433 serial=2258 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.asuslinux.Daemon">
<!--
Set the keyboard brightness level (0-3)
-->
<method name="SetBrightness">
<arg name="brightness" type="s" direction="in"/>
</method>
<!--
Set a variety of states, input is array of enum.
`enabled` sets if the sent array should be disabled or enabled
```text
pub struct AuraPowerDev {
tuf: Vec<AuraDevTuf>,
x1866: Vec<AuraDevRog1>,
x19b6: Vec<AuraDevRog2>,
}
pub enum AuraDevTuf {
Boot,
Awake,
Sleep,
Keyboard,
}
pub enum AuraDevRog1 {
Awake = 0x000002,
Keyboard = 0x080000,
Lightbar = 0x040500,
Boot = 0xc31209,
Sleep = 0x300804,
}
pub enum AuraDevRog2 {
BootLogo = 1,
BootKeyb = 1 << 1,
AwakeLogo = 1 << 2,
AwakeKeyb = 1 << 3,
SleepLogo = 1 << 4,
SleepKeyb = 1 << 5,
ShutdownLogo = 1 << 6,
ShutdownKeyb = 1 << 7,
BootBar = 1 << (7 + 2),
AwakeBar = 1 << (7 + 3),
SleepBar = 1 << (7 + 4),
ShutdownBar = 1 << (7 + 5),
BootLid = 1 << (15 + 1),
AwakeLid = 1 << (15 + 2),
SleepLid = 1 << (15 + 3),
ShutdownLid = 1 << (15 + 4),
BootRearGlow = 1 << (23 + 1),
AwakeRearGlow = 1 << (23 + 2),
SleepRearGlow = 1 << (23 + 3),
ShutdownRearGlow = 1 << (23 + 4),
}
```
-->
<method name="SetLedsPower">
<arg name="options" type="(asasas)" direction="in"/>
<arg name="enabled" type="b" direction="in"/>
</method>
<method name="SetLedMode">
<arg name="effect" type="(ss(yyy)(yyy)ss)" direction="in"/>
</method>
<method name="NextLedMode">
</method>
<method name="PrevLedMode">
</method>
<method name="NextLedBrightness">
</method>
<method name="PrevLedBrightness">
</method>
<method name="LedsEnabled">
<arg type="(asasas)" direction="out"/>
</method>
<!--
Return the current mode data
-->
<method name="LedMode">
<arg type="s" direction="out"/>
</method>
<!--
Return a list of available modes
-->
<method name="LedModes">
<arg type="a{s(ss(yyy)(yyy)ss)}" direction="out"/>
</method>
<!--
On machine that have some form of either per-key keyboard or per-zone
this can be used to write custom effects over dbus. The input is a
nested `Vec<Vec<8>>` where `Vec<u8>` is a raw USB packet
-->
<method name="DirectAddressingRaw">
<arg name="data" type="aay" direction="in"/>
</method>
<signal name="NotifyLed">
<arg name="data" type="(ss(yyy)(yyy)ss)"/>
</signal>
<signal name="NotifyPowerStates">
<arg name="data" type="(asasas)"/>
</signal>
<!--
Return the current LED brightness
-->
<property name="LedBrightness" type="n" access="read"/>
</interface>
</node>
"
@@ -0,0 +1,107 @@
method return time=1687857321.238947 sender=:1.373 -> destination=:1.435 serial=2260 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.asuslinux.Daemon">
<method name="SetGpuMuxMode">
<arg name="mode" type="u" direction="in"/>
</method>
<method name="GpuMuxMode">
<arg type="u" direction="out"/>
</method>
<signal name="NotifyGpuMuxMode">
<arg name="mode" type="u"/>
</signal>
<method name="SetPostBootSound">
<arg name="on" type="b" direction="in"/>
</method>
<method name="PostBootSound">
<arg type="n" direction="out"/>
</method>
<signal name="NotifyPostBootSound">
<arg name="on" type="b"/>
</signal>
<method name="SetPanelOd">
<arg name="overdrive" type="b" direction="in"/>
</method>
<!--
Get the `panel_od` value from platform. Updates the stored value in
internal config also.
-->
<method name="PanelOd">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyPanelOd">
<arg name="overdrive" type="b"/>
</signal>
<method name="SetMiniLedMode">
<arg name="on" type="b" direction="in"/>
</method>
<!--
Get the `panel_od` value from platform. Updates the stored value in
internal config also.
-->
<method name="MiniLedMode">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyMiniLedMode">
<arg name="on" type="b"/>
</signal>
<method name="SetDgpuDisable">
<arg name="disable" type="b" direction="in"/>
</method>
<method name="DgpuDisable">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyDgpuDisable">
<arg name="disable" type="b"/>
</signal>
<method name="SetEgpuEnable">
<arg name="enable" type="b" direction="in"/>
</method>
<method name="EgpuEnable">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyEgpuEnable">
<arg name="enable" type="b"/>
</signal>
</interface>
</node>
"
@@ -0,0 +1,60 @@
method return time=1687857321.240891 sender=:1.373 -> destination=:1.436 serial=2261 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.asuslinux.Daemon">
<method name="SetChargeControlEndThreshold">
<arg name="limit" type="y" direction="in"/>
</method>
<method name="ChargeControlEndThreshold">
<arg type="y" direction="out"/>
</method>
<method name="MainsOnline">
<arg type="b" direction="out"/>
</method>
<signal name="NotifyChargeControlEndThreshold">
<arg name="limit" type="y"/>
</signal>
<signal name="NotifyMainsOnline">
<arg name="on" type="b"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
</node>
"
@@ -0,0 +1,120 @@
method return time=1687857321.242598 sender=:1.373 -> destination=:1.437 serial=2262 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.asuslinux.Daemon">
<!--
Fetch profile names
-->
<method name="Profiles">
<arg type="as" direction="out"/>
</method>
<!--
Toggle to next platform_profile. Names provided by `Profiles`.
If fan-curves are supported will also activate a fan curve for profile.
-->
<method name="NextProfile">
</method>
<!--
Fetch the active profile name
-->
<method name="ActiveProfile">
<arg type="s" direction="out"/>
</method>
<!--
Set this platform_profile name as active
-->
<method name="SetActiveProfile">
<arg name="profile" type="s" direction="in"/>
</method>
<!--
Get a list of profiles that have fan-curves enabled.
-->
<method name="EnabledFanProfiles">
<arg type="as" direction="out"/>
</method>
<!--
Set a profile fan curve enabled status. Will also activate a fan curve
if in the same profile mode
-->
<method name="SetFanCurveEnabled">
<arg name="profile" type="s" direction="in"/>
<arg name="enabled" type="b" direction="in"/>
</method>
<!--
Get the fan-curve data for the currently active Profile
-->
<method name="FanCurveData">
<arg name="profile" type="s" direction="in"/>
<arg type="(b(s(yyyyyyyy)(yyyyyyyy))(s(yyyyyyyy)(yyyyyyyy)))" direction="out"/>
</method>
<!--
Set the fan curve for the specified profile.
Will also activate the fan curve if the user is in the same mode.
-->
<method name="SetFanCurve">
<arg name="profile" type="s" direction="in"/>
<arg name="curve" type="(s(yyyyyyyy)(yyyyyyyy))" direction="in"/>
</method>
<!--
Reset the stored (self) and device curve to the defaults of the
platform.
Each platform_profile has a different default and the defualt can be
read only for the currently active profile.
-->
<method name="SetActiveCurveToDefaults">
</method>
<!--
Reset the stored (self) and device curve to the defaults of the
platform.
Each platform_profile has a different default and the defualt can be
read only for the currently active profile.
-->
<method name="ResetProfileCurves">
<arg name="profile" type="s" direction="in"/>
</method>
<signal name="NotifyProfile">
<arg name="profile" type="s"/>
</signal>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
</node>
"
@@ -0,0 +1,48 @@
method return time=1687857321.244505 sender=:1.373 -> destination=:1.438 serial=2263 reply_serial=2
string "
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.freedesktop.DBus.Properties">
<method name="Get">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg type="v" direction="out"/>
</method>
<method name="Set">
<arg name="interface_name" type="s" direction="in"/>
<arg name="property_name" type="s" direction="in"/>
<arg name="value" type="v" direction="in"/>
</method>
<method name="GetAll">
<arg name="interface_name" type="s" direction="in"/>
<arg type="a{sv}" direction="out"/>
</method>
<!--
Emits the `org.freedesktop.DBus.Properties.PropertiesChanged` signal.
-->
<signal name="PropertiesChanged">
<arg name="interface_name" type="s"/>
<arg name="changed_properties" type="a{sv}"/>
<arg name="invalidated_properties" type="as"/>
</signal>
</interface>
<interface name="org.asuslinux.Daemon">
<method name="SupportedFunctions">
<arg type="(b(b)(bb)(sbasasu)(bbbbbb))" direction="out"/>
</method>
</interface>
</node>
"