Skip to content

Commit

Permalink
chore(docs): Add interface XML and generated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadowApex committed Feb 23, 2024
1 parent f43200c commit 8b5c562
Show file tree
Hide file tree
Showing 12 changed files with 899 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ IMAGE_TAG ?= latest

# systemd-sysext variables
SYSEXT_ID ?= steamos
SYSEXT_VERSION_ID ?= 3.5.14
SYSEXT_VERSION_ID ?= 3.5.15

# Include any user defined settings
-include settings.mk
Expand Down Expand Up @@ -45,8 +45,6 @@ install: build ## Install inputplumber to the given prefix (default: PREFIX=/usr
$(PREFIX)/lib/systemd/system/$(NAME).service
install -D -m 644 rootfs/usr/share/$(NAME)/devices/steam_deck.yaml \
$(PREFIX)/share/$(NAME)/devices/steam_deck.yaml
install -D -m 644 rootfs/usr/share/$(NAME)/devices/gamepads.yaml \
$(PREFIX)/share/$(NAME)/devices/gamepads.yaml
@echo ""
@echo "Install completed. Enable service with:"
@echo " systemctl enable --now $(NAME)"
Expand All @@ -57,7 +55,6 @@ uninstall: ## Uninstall inputplumber
rm $(PREFIX)/share/dbus-1/system.d/$(DBUS_NAME).conf
rm $(PREFIX)/lib/systemd/system/$(NAME).service
rm $(PREFIX)/share/$(NAME)/devices/steam_deck.yaml
rm $(PREFIX)/share/$(NAME)/devices/gamepads.yaml

##@ Development

Expand Down Expand Up @@ -139,6 +136,21 @@ dist/$(NAME).raw: dist/$(NAME).tar.gz
mv $(CACHE_DIR)/$(NAME).raw $@
cd dist && sha256sum $(NAME).raw > $(NAME).raw.sha256.txt

XSL_TEMPLATE := ./docs/dbus2markdown.xsl
.PHONY: docs
docs: ## Generate markdown docs for DBus interfaces
mkdir -p docs
xsltproc --novalid -o docs/manager.md $(XSL_TEMPLATE) ./bindings/dbus-xml/org.shadowblip.Input.Manager.xml
sed -i 's/DBus Interface API/Manager DBus Interface API/g' ./docs/manager.md
xsltproc --novalid -o docs/composite_device.md $(XSL_TEMPLATE) ./bindings/dbus-xml/org.shadowblip.Input.CompositeDevice.xml
sed -i 's/DBus Interface API/CompositeDevice DBus Interface API/g' ./docs/composite_device.md
xsltproc --novalid -o docs/source_event_device.md $(XSL_TEMPLATE) ./bindings/dbus-xml/org.shadowblip.Input.Source.EventDevice.xml
sed -i 's/DBus Interface API/Source EventDevice DBus Interface API/g' ./docs/source_event_device.md
xsltproc --novalid -o docs/source_hidraw_device.md $(XSL_TEMPLATE) ./bindings/dbus-xml/org.shadowblip.Input.Source.HIDRawDevice.xml
sed -i 's/DBus Interface API/Source HIDRaw DBus Interface API/g' ./docs/source_hidraw_device.md
xsltproc --novalid -o docs/keyboard.md $(XSL_TEMPLATE) ./bindings/dbus-xml/org.shadowblip.Input.Keyboard
sed -i 's/DBus Interface API/Keyboard DBus Interface API/g' ./docs/keyboard.md

# Refer to .releaserc.yaml for release configuration
.PHONY: sem-release
sem-release: ## Publish a release with semantic release
Expand Down
64 changes: 64 additions & 0 deletions bindings/dbus-xml/org.shadowblip.Input.CompositeDevice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@

<!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.shadowblip.Input.CompositeDevice">
<!--
Target dbus devices that this [CompositeDevice] is managing
-->
<property name="DbusDevices" type="as" access="read"/>
<!--
The intercept mode of the composite device.
-->
<property name="InterceptMode" type="u" access="readwrite"/>
<!--
Name of the composite device
-->
<property name="Name" type="s" access="read"/>
<!--
List of source devices that this composite device is processing inputs for
-->
<property name="SourceDevicePaths" type="as" access="read"/>
<!--
Target devices that this [CompositeDevice] is managing
-->
<property name="TargetDevices" type="as" access="read"/>
</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>
<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>

55 changes: 55 additions & 0 deletions bindings/dbus-xml/org.shadowblip.Input.Keyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@

<!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.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.shadowblip.Input.Keyboard">
<!--
Send the given key to the virtual keyboard
-->
<method name="SendKey">
<arg name="key" type="s" direction="in"/>
<arg name="value" type="b" direction="in"/>
</method>
<!--
Name of the composite device
-->
<property name="Name" type="s" access="read"/>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
</node>

53 changes: 53 additions & 0 deletions bindings/dbus-xml/org.shadowblip.Input.Manager.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

<!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.shadowblip.InputManager">
<!--
Create a composite device using the give composite device config. The
path should be the absolute path to a composite device configuration file.
-->
<method name="CreateCompositeDevice">
<arg name="config_path" type="s" direction="in"/>
<arg type="s" direction="out"/>
</method>
<property name="InterceptMode" type="s" access="read"/>
</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>

53 changes: 53 additions & 0 deletions bindings/dbus-xml/org.shadowblip.Input.Source.EventDevice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

<!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.shadowblip.Input.Source.EventDevice">
<!--
Returns the full path to the device handler (e.g. /dev/input/event3)
-->
<property name="DevicePath" type="s" access="read"/>
<property name="Handlers" type="as" access="read"/>
<property name="Name" type="s" access="read"/>
<property name="PhysPath" type="s" access="read"/>
<property name="SysfsPath" type="s" access="read"/>
<property name="UniqueId" type="s" access="read"/>
</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>

52 changes: 52 additions & 0 deletions bindings/dbus-xml/org.shadowblip.Input.Source.HIDRawDevice.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

<!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.Introspectable">
<method name="Introspect">
<arg type="s" direction="out"/>
</method>
</interface>
<interface name="org.shadowblip.Input.Source.HIDRawDevice">
<property name="InterfaceNumber" type="i" access="read"/>
<property name="Manufacturer" type="s" access="read"/>
<property name="Path" type="s" access="read"/>
<property name="Product" type="s" access="read"/>
<property name="ProductId" type="s" access="read"/>
<property name="ReleaseNumber" type="s" access="read"/>
<property name="SerialNumber" type="s" access="read"/>
<property name="VendorId" type="s" access="read"/>
</interface>
<interface name="org.freedesktop.DBus.Peer">
<method name="Ping">
</method>
<method name="GetMachineId">
<arg type="s" direction="out"/>
</method>
</interface>
</node>

Loading

0 comments on commit 8b5c562

Please sign in to comment.