1
0
forked from drath/libratbag
Commit Graph

85 Commits

Author SHA1 Message Date
Peter Hutterer
b140bc2827 test: add dpi min/max tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-13 17:46:05 +02:00
Peter Hutterer
a926afe8de ratbagd: standardise the log messages a bit better
Prefix with the sysname of the device, then have a 'failed to ...'

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-11 09:13:44 +02:00
Peter Hutterer
af78dc4ec2 ratbagd: rename device->name to device->sysname
Because that's what it is and it makes it less confusing in the code

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-11 09:13:44 +02:00
Peter Hutterer
186d626c40 Remove RATBAG_LED_TYPE_UNKNOWN from the enum list
A driver is supposed to know what type an LED is, unknown doesn't help anyone
here. So replace this with a private #define and abort when a driver doesn't
set the type. This also adds a requirement that any driver initializing a LED
must have the read_led() function, otherwise we can't fill it in correctly.

And bump the enum up by one, the first valid value should start at 1 (or some
other non-boolean value).

Related #365
Fixes #364

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-09 19:12:17 +02:00
Peter Hutterer
5a40d93a30 ratbagd: disable coredumps in ratbagd.devel
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-02 10:25:24 +02:00
Peter Hutterer
b1c4bba3b2 led: add support for color depth
The initial value of 400 in the enum is chosen so it looks weird when someone
tries to interpret the value as integer. Values of 1, 2, 4, etc. could be
confused with something realistic.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-22 09:18:28 +02:00
Jente Hidskes
db34ab5255 RatbagdButton: fix missed dbus return value
I missed this one in #336.
2017-09-17 21:34:47 +10:00
Jente Hidskes
a2b3c32124 RatbagdResolution: clamp values instead of returning an error
We cannot return error codes, but requesting a resync is overkill.
Instead, let's be nice and clamp these values.
2017-09-13 08:44:50 +10:00
Jente Hidskes
26e7237010 RatbagdLed: clamp values instead of returning an error
We cannot return error codes, but requesting a resync is overkill.
Instead, let's be nice and clamp these values.
2017-09-13 08:44:50 +10:00
Jente Hidskes
26a6215122 RatbagdResolution: rename get_rate to get_report_rate for consistency 2017-09-13 08:44:50 +10:00
Jente Hidskes
376adfdf2a ratbagd: fix return values in dbus methods
See #316.
2017-09-13 08:44:50 +10:00
Jente Hidskes
d990e3f027 RatbagdDevice: add a Resync signal
This signal is emitted upon an internal error, signalling clients to
resync their values.

Related to #316.
2017-09-13 08:44:50 +10:00
Jente Hidskes
2473f66cb3 Move note on return values to the interface documentation 2017-09-13 08:44:50 +10:00
Peter Hutterer
7edae05b37 ratbagd: fix verbose_raw setting
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-11 19:05:51 +10:00
Peter Hutterer
703e1f6f0d ratbagd: allow for --verbose=raw
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-11 09:26:07 +02:00
Peter Hutterer
afaf3fa83d ratbagd: Drop KeyMapping from the DBus interface
Plan is to remove the key mapping altogether and make it transparent from the
Macro mappings (in libratbag/the drivers). Meanwhile, remove the DBus API so
nothing can actually start using it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-07 08:25:59 +02:00
Peter Hutterer
94daeb1444 ratbagd: split the test device out into a seprate file
It always bothered me that it was in the middle of the normal ratbagd, which
made fiding it more effort than neccessary. Split it out into a separate file
so it's easily identifiable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-01 09:30:38 +02:00
Peter Hutterer
b9f6554767 ratbagd: fix enum type for resolutions
Found by coverity

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:48:52 +02:00
Peter Hutterer
6cdf8a901a ratbagd: fix use of potentially unused variable
Simply abort if the macro value is bad, that's a libratbag bug and should
never happen.

Found in #312

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:48:52 +02:00
Peter Hutterer
01ca2a6de7 ratbagd: drop the unused IsActive and IsDefault resolution signals
Obsolete, now that we're just updating the property.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:37:59 +02:00
Peter Hutterer
d64af72f74 ratbagd: fix profile IsActive property changes
We sent a signal out but not the "property has changed" signal we actually
needed.

Fixes #295

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 09:37:59 +02:00
Peter Hutterer
432d32bedc ratbagd: set the active profile before sending signals
Found by @bentiss, see #295

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 13:08:41 +10:00
Peter Hutterer
1103c208a8 ratbagd: if the svg doesn't exist, supply the fallback one
We keep the hardcoded fallback.svg for the test device, otherwise we get an
error every time we start ratbagd.devel

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-31 10:48:38 +10:00
Peter Hutterer
7e59f0f974 data: add a fallback.svg file
This SVG is generic enough to cover 7-button mice with up to 3 LEDs that are
supported but don't have an SVG. The SVG style is intentionally NOT a generic
mouse to make it obvious that something isn't right here. If we use a generic
mouse, people may not put the effort into a proper SVG style because the
generic mouse is good enough.

The fallback is currently only used for test devices
2017-08-31 10:48:38 +10:00
Benjamin Tissoires
c647d6df99 profiles: add name get/set capability
Some devices can have a custom name, so let's export that capability.

In ratbagd, libratbag/ratbag_profile_set_name() returns an error, we
put it under silence, the client has to check for the capabilities
before asking ratbagd to change the profile name.

Fixes: #266

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-08-31 10:22:51 +10:00
Benjamin Tissoires
97a927bb7d profiles: add a per profile capabilities field
Doesn't do much now without the next commit

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-08-31 10:22:51 +10:00
Peter Hutterer
643a4a89f4 ratbagd: fix assertion error when quitting with more than 1 devices attached
RATBAGD_FOREACH_DEVICE does not allow unlinking the device during the loop.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-30 09:42:47 +10:00
Jente Hidskes
6ddba76c93 RatbagdButton: make mapping properties writable
This brings RatbagdButton in line with the other Ratbagd* objects, and
more importantly solves https://github.com/libratbag/piper/issues/140.
2017-08-22 10:22:51 +10:00
Jente Hidskes
804d8f7969 RatbagdResolution: emit properties changed from resolution_set_default
This allows clients to respond to changes in the default resolution. It's
not the cleanest approach, but it works. To clean it up, we could cache
the changed resolutions and make sure to only emit the signal on those,
just as the FIXME already notes.

References https://github.com/libratbag/piper/pull/36.
2017-08-17 10:35:09 +10:00
Jente Hidskes
9b53119121 RatbagdResolution: emit properties changed from resolution_set_active
This allows clients to respond to changes in the active resolution. It's
not the cleanest approach, but it works. To clean it up, we could cache
the changed resolutions and make sure to only emit the signal on those,
just as the FIXME already notes.

References https://github.com/libratbag/piper/pull/132.
2017-08-17 10:35:09 +10:00
Jente Hidskes
b773ac085b ratbagd.c: unlink before emitting property changed 2017-08-11 11:12:24 +01:00
Jente Hidskes
282398493b ratbagd_button: emit property changed on ActionType when setting mappings 2017-07-31 14:38:24 +01:00
Jente Hidskes
022dc74354 ratbagd_button: emit property changed on Macro 2017-07-31 14:38:24 +01:00
Jente Hidskes
cd6ffca413 ratbagd_button: emit property changed on KeyMapping 2017-07-31 14:38:24 +01:00
Peter Hutterer
811281372b ratbagd: fix return code for SetSpecialMapping (#262)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-30 14:23:25 +02:00
Peter Hutterer
670cf90e11 ratbagd: handle SIGINT for quitting
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-28 14:48:10 +01:00
Peter Hutterer
f5210e1902 ratbagd: remove devices before removing the context
This code isn't actually hit because we don't handle signals correctly, but
once we do, ratbagd_free() will assert because the devices never get removed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-28 14:48:10 +01:00
Jente Hidskes
0a6b4b3778 ratbagd: change the led type to the enum 2017-07-26 18:07:19 +02:00
Jente Hidskes
b4f451285e ratbagd: change the special mapping to the enum 2017-07-26 18:07:19 +02:00
Benjamin Tissoires
de3bb0e579 implement resolution active set (#249)
Fixes #80

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-26 08:32:16 +02:00
Peter Hutterer
5399d15658 ratbagd: add support for test device button types
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-25 18:24:10 +02:00
Peter Hutterer
5f98d8d029 ratbagd: rename test's button type to action_type
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-25 18:24:10 +02:00
Peter Hutterer
10903e2434 ratbagd: change the button type to the enum value
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-25 18:24:10 +02:00
Peter Hutterer
b7f53effa1 ratbagd: add macro support
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-25 18:24:03 +02:00
Peter Hutterer
129551f3f4 ratbagd: add support for macros in the test device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-25 17:17:03 +02:00
Peter Hutterer
ae65ab3ae8 tools: ratbagctl: fix printing of special key map
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-25 17:17:03 +02:00
Peter Hutterer
96067f18ca ratbagd: change the key action types to enums
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-25 17:16:54 +02:00
Peter Hutterer
bf18e9b795 ratbagd: fix resolution_set_default
https://github.com/libratbag/libratbag/issues/246

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-25 12:17:15 +02:00
Benjamin Tissoires
6faa59c70d tools: ratbagctl: add support for separate X/Y resolutions
Big commit because of the test suite changes.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-25 11:09:24 +10:00
Benjamin Tissoires
c0c77100ad ratbagd: implement enable/disable profile
We also maps the commands to ratbag-command.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-25 11:06:59 +10:00