1
0
forked from drath/libratbag
Commit Graph

17 Commits

Author SHA1 Message Date
David Herrmann
eca2203603 ratbagd: add manager interface
Instead of relying on the cricket ObjectManager interface, use our own
manager interface. This gets rid of ridiculous recursive behavior of the
ObjectManager interface and instead allows us to control the behavior.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-29 14:09:23 +02:00
David Herrmann
e926212554 ratbagd: remove ratbagd_device_list()
This is no longer needed. Use the device-iterator in ratbagd.c directly
and then drop ratbagd_device_list().

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-29 13:25:05 +02:00
David Herrmann
65463b6efb ratbagd: add device iterator
Add iterators for ratbagd_device objects.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-29 13:22:13 +02:00
David Herrmann
9ac799bc95 ratbagd: add ratbagd_device_get_path()
Add helper to retrieve the device path from outside of ratbagd-device.c.
This will be needed for the non-object-manager based enumerators and
signals introduced to org.freedesktop.ratbag1.Manager.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-29 13:21:27 +02:00
David Herrmann
7e4d757bdf ratbagd: cache device path
Cache device path in device->path and avoid re-calculating it all the
time.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-29 13:09:45 +02:00
David Herrmann
1a8037cd6c ratbagd: expose profiles on the bus
Profiles are static children of devices. Expose them as 2nd-level objects
underneath their parent devices on the bus.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-26 18:53:55 +02:00
David Herrmann
dbc8a37b56 ratbagd: move dbus device management
Make sure the device management (lookup and enumeration and registration)
is done from the parent, not the child. Hence, move it into ratbagd.c over
ratbagd-device.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-26 18:07:18 +02:00
David Herrmann
b1851ada93 ratbagd: split dbus handling from object handling
Make sure our dbus callbacks to not contain any logic themselves. They
should be simple wrappers around our internal object handling.

This also makes use of the new sd-bus pat helpers, to-be-released with
systemd-v227 next week.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-26 18:02:00 +02:00
David Herrmann
c0799b0c1d ratbagd: drop UNPRIVILEGED from properties
This does not work, we cannot flag properties as UNPRIVILEGED. Drop it.
Lets figure out later what exactly we want as privilege level to
enumerate and query device properties.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-26 17:59:58 +02:00
David Herrmann
e461710811 ratbagd: add basic device properties
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>
2015-09-25 16:27:45 +02:00
David Herrmann
bea8e89cc7 ratbagd: create libratbag_device contexts
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>
2015-09-25 16:05:26 +02:00
David Herrmann
17d66153b0 ratbagd: ignore anything but event devices
We are only interested in evdev, so ignore anything but input-event
devices.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-25 15:57:14 +02:00
David Herrmann
8ca0c11154 ratbagd: keep libratbag context around
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>
2015-09-25 12:51:11 +02:00
David Herrmann
c4afc3d5c0 shared: add safe_close()
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>
2015-09-25 12:49:44 +02:00
David Herrmann
c22d51e439 build: be more consistent in variable names
Rename UDEV_* to LIBUDEV_* to be more consistent regarding other
pkg-build dependencies.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-25 12:35:43 +02:00
David Herrmann
aa052ae005 Import initial components
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>
2015-09-24 20:05:27 +02:00
David Herrmann
3f0b41ec3c Initialize ratbagd repository
Initial commit for the ratbagd project, a dbus daemon to manage libratbag
devices and proxy user accesses.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
2015-09-24 16:45:22 +02:00