This implements a signal that is fired whenever the active resolution
changes. For now the signal is only fired when the resolution changes
through the setter, ratbagd_resolution_set_resolution, as profile changes may
not always be hooked up in the hardware.
Reference #8.
This implements a signal that is fired whenever the active profile
changes. For now the signal is only fired when the profile changes
through the setter, ratbagd_profile_set_active, as profile changes may
not always be hooked up in the hardware.
Fixes#7.
We don't really expect more than 2-3 devices even on a test box. This function
serves little purpose, we can easily require a caller to just get all devices
(usually just one anyway) and then go from there.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This is the terminology used in libratbag as well (and everywhere else where
we deal with input devices).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Strings can suffer from locale issues, the official recommendation for DBus
APIs is to use enums here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Strings can suffer from locale issues, the official recommendation for DBus
APIs is to use enums here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Exporting just the filename requires the caller to know where that file sits.
That's useful for things like e.g. icons where callers may several sets to
chose from but here most callers will just use the default svg provided by
libratbag.
Export that, so that we don't have build-time dependencies in the callers just
for that single path.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
It's a lot easier to interact with ratbagd from a python script than it is
with C code. Plus this means we test the bindings whenever we use ratbagctl.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This just exports the button index so far and makes sure we can write clients
that deal with button objects instead of making stuff up to test for buttons.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Returning the object path makes it harder for the client to identify which
object is the active one. A simple index into the devices array is easier to
handle.
Note: another approach was to have an IsActive property on the profile
directly. This would require updating all properties when the active profile
is changed, it's simpler to just have one index.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
sd_bus_encode_many() escaps elements starting with a digit so our 0 profile
has an object path of /.../_30. This is quite confusing during debugging.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Lets use the new get_device_path() helper to allow calling show-device
without any argument. This follows what show-profile does already.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
New verb: show-profile
This simply prints a profile of a given device by querying ratbagd for
all information on the selected profile.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Add a new property to profiles that exposes resolutions on the bus. We
simply expose a dictionary entry for each resolution, hence, we can
easily extend it in the future. However, we avoid the full overhead of
real dbus objects, as there is no real need for it.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Add two new helpers to query ratbagd for the object-paths of a specific
object:
GetDeviceByName: Return device given a device name
GetProfileByIndex: Return a profile given a profile index
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>