Add two device properties:
- Id: Returns the string ID to identify the device
- Description: Returns the ratbag-device name
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Make sure to create libratbag_device contexts for each device we add. If
libratbag returns NULL, we just ignore the devices. Otherwise, we keep
the context around and manage the device.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Make sure the ratbagd context has a reference to a valid libratbag
context at all times. We need this to access libratbag devices, so lets
reference on in our own context.
This also adds a dependency for libratbag via autotools.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Add safe_close() helper that makes close(2) a bit nicer to use. This also
introduces PROTECT_ERRNO, which makes sure a function does not clutter
errno if called.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This adds two new components:
1) ratbagd
The ratbagd daemon is a very basic dbus daemon that provides an
org.freedesktop.DBus.ObjectManager based enumeration and modification
API for libratbag devices. So far, all it does is enumerate input
devices on the bus. However, this will be extended to advertise full
libratbag hierarchies on the bus and allow clients to modify
properties via DBus.
So far, it is root-only, but the DBus policy can be losened and PolKit
support can be added.
2) ratbagctl
A very basic command-line tool to manage ratbagd. It's basically a
command-line interface for the DBus API of ratbagd.
So far, it has no hookup for anything. This will be added once ratbagd
gains further DBus APIs.
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>