Commit Graph

66 Commits

Author SHA1 Message Date
Thomas Hindoe Paaboel Andersen
575b7bce98 add driver and svg for steelseries rival 310
The driver does not yet support button mappings or any
non-solid LED modes.

The device does not support reading out the current
configuration. On probe some default values are used
to get a usable profile.
2017-10-18 00:19:12 +02:00
Benjamin Tissoires
558f59b52c tools: replace ratbag-command.c with ratbag-command.py
Let the .c file die, and try to maintain the python version only.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-10-16 19:06:57 +02:00
Benjamin Tissoires
6ba5cc3319 meson.build: shut up a warning for the generated swig python wrapper
It's generated and it works, no need to have the missing-prototypes
warning on.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-10-16 19:06:57 +02:00
Benjamin Tissoires
1148d172b5 Generate a direct python wrapper around libratbag with swig
And use it to create ratabg-command.py

Benefits are that we bypass ratbagd, meaning we can attach gdb or run
valgrind on the tools themselves.

Problem is the python wrapper doesn't clean up after itself, and so
running valgrind is moot

Fixes #274

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-10-16 19:06:57 +02:00
Peter Hutterer
a535897ae7 Use Sphinx for the DBus interface documentation
Better than the markdown we were using before, even though we're currently
(ab)using the js/c++ domains for the structure. There is no DBus domain in
sphinx yet.

The main motivation was to get the enums into the documentation since they are
exported ABI.

Generating the documentation is quirky - we use doxygen to extract the
comments from the C header file and then use XSLT to convert to .rst which
sphinx can use. Still better than having to maintain even more copies of the
enums.

Since this is only of interest for maintainers that need to upload the
documentation, it is turned off by default.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-13 08:59:33 +02:00
Peter Hutterer
51c1be3806 Move the enums into their separate header file
libratbag is not a library anymore. Move all the stuff that we need for the
DBus interface (i.e. the enum values) into its own header file so they're
all in one place and we don't have to worry about it anymore.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-13 08:59:33 +02:00
Ogier Bouvier
0787e35964 data: add device file and svg for Logitech G703 wired
Signed-off-by: Ogier Bouvier <obouvier@logitech.com>
2017-10-09 12:12:26 +10:00
Peter Hutterer
d26d5b83f1 test: set RATBAG_TEST in code, not in meson
It's a fixed value so it's much easier to set this in the test binaries rather
than requiring the user to set this in the env before running a test manually.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-10-04 18:53:25 +10:00
Thomas Hindoe Paaboel Andersen
132212652f G9: add .svg for GNOME 2017-10-02 22:31:40 +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
0153efbf9c Remove now superfluous libratbag.sym
We don't ship a library anymore, so dealing with library symbols isn't
necessary.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-18 14:24:50 +02:00
Thomas Hindoe Paaboel Andersen
3e31b45db0 SVG for G300 in GNOME theme 2017-09-14 09:49:41 +02:00
Benjamin Tissoires
59df7defdb tools: add hidpp20-reset
Basically a nuclear weapon to reset the flash to 0.
Use it with caution!

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-09-13 09:21:53 +02:00
Stephen Kitt
8d67389042 Don't install ratbag-command manpage
Since we no longer install ratbag-command itself, there isn't much
point installing its manpage.

Signed-off-by: Stephen Kitt <steve@sk2.org>
2017-09-04 08:24:34 +10:00
Peter Hutterer
4037587f74 Get the libratbag data dir from the environment variable
And set it for the tests, so we can test with in-tree files.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-09-01 09:49:32 +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
c2fe745813 data/gnome: add a quick and dirty SVG checker for the GNOME SVGs
Checks for the three layers we need and that any buttons in the files are
consecutive and have the right layers

Fixes #196

Co-authored-by: Jente Hidskes <hjdskes@gmail.com>
2017-08-31 08:40:58 +02: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
Peter Hutterer
340e5b7d86 Switch to a .ini-file based device database
The hwdb was a quick and easy way to add entries for new devices but we need
more and more info about the various types of devices. It's better to move
this to a proper database.

Side-effect: this also gives us an easy way to point to the list of devices
supported and makes checking for e.g. missing svgs easier.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-28 17:50:20 +02:00
Peter Hutterer
be624fe943 Move dpi range parsing to a helper function
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-28 17:50:20 +02:00
Clément Vuchener
952eb1cf0e Add Logitech G900 SVG for gnome theme 2017-08-28 12:16:49 +02:00
Peter Hutterer
7036428066 meson.build: libratbag 0.9.900
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-25 13:48:39 +10:00
Peter Hutterer
572f00cf2a Add GNOME svg for Roccat Kone XTD 2017-08-23 08:04:12 +02:00
Peter Hutterer
13419dcbb8 doc: drop documentation
Our DBus interface is the only API now and libratbag is just the internal
library. Let's not build doxygen for it, there's no need.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-08-02 10:14:23 +01:00
Benjamin Tissoires
6cfca9e34b tools: share the devel boiler plate in a separate python file
We want to share as much as possible between ratbagctl.devel and
ratbagctl.test, so better have a separate file that knows how to
properly spawn the dbus daemon and terminate it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-08-01 10:31:43 +01:00
Thomas Hindoe Paaboel Andersen
bcf302904d meson: allow builddir other than 'build'
Configuring with 'meson builddir' would fail with:

Program build/ratbagctl.test found: NO
Meson encountered an error in file meson.build, line 512, column 0:
Program "build/ratbagctl.test" not found or not executable
2017-07-29 08:24:21 +01:00
Benjamin Tissoires
7e9566b00f Start dbus in the container for being able to run the test suite
We don't need a full systemd service, just dbus-daemon to be started.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-26 18:10:03 +02:00
Peter Hutterer
8c97a12741 Don't install ratbag-command
libratbag is now a static library only and the only exposed interface is the
DBus interface. We have ratbagctl for that interface.

ratbag-command shouldn't be installed, it becomes a pure developer tool now.
We still keep it around for that reason, but let's not install it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-25 11:14:13 +10:00
Peter Hutterer
0982d6a4a9 Drop libratbag as separate library
Now that ratbagd is part of libratbag, the DBus interface is the preferred way
to interact with a device. Shipping libratbag as a .so file means we have to
worry about two ABIs when it's unlikely that anyone ever uses the libratbag.so
directly.

Make it a static library internally instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-25 11:14:13 +10:00
Peter Hutterer
c1cabeeeeb meson: reduce the valgrind test timeouts
Factor 5 should be enough, factor 100 is a bit excessive

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-24 10:32:41 +02:00
Peter Hutterer
ca69365a86 meson: run ratbagctl.test as part of ninja test
Or at least do so when we're root.

Test is skipped on CircleCI because we don't have DBus.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-24 10:32:41 +02:00
Peter Hutterer
6274dea4ac meson: add ratbagd.py as input source for merge_ratbagd.py
Otherwise we won't notice changes to it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-20 07:09:28 +02:00
Peter Hutterer
a938521c9e ratbagd: use zalloc instead of calloc
Because we really don't care about OOM beside blowing up.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-19 10:09:01 +02:00
Peter Hutterer
a6d03fde18 ratbagd: use strdup_safe for all string copies
Because if we can't strdup a device name or dbus path, we have problems we
can't recover from anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-19 10:09:01 +02:00
Peter Hutterer
7b861ada4c Move the shared sources from ratbagd into src
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-19 10:09:01 +02:00
Benjamin Tissoires
fa1799eef3 tools: copy ratbagd.py from piper and integrate it in ratbagctl
We are using a custom python script to generate the final ratbagctl
so we can strip out the headers.

Now merging and testing ratbagd.py in piper will be easier than ever.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-19 08:39:29 +02:00
Peter Hutterer
77cc2fa82d Add logitech G303 SVG for gnome theme (#228)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-18 13:15:48 +02:00
Benjamin Tissoires
7b1e7dc4e7 tools: add a test suite for ratbagctl
Using unittest to be fancy

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-12 08:16:39 +02:00
Benjamin Tissoires
89d071bb80 Fix flake-8 complains
Piper already uses this, we might as well.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-12 08:16:39 +02:00
Clément Vuchener
e33a515fd6 data: add toned-down SVG for Logitech G500/G500s (#214)
* data/gnome: add SVG for Logitech G500/G500s

* data/gnome: add buttons 0 and 1 to the G700
2017-07-10 09:30:56 +02:00
Jente Hidskes
8fc58e259c Use toned-down device SVGs (#182)
* data/gnome: add GNOME theme requirements

* data/logitech-g403.svg: add G403 GNOME SVG

* data/logitech-g502.svg: add G502 GNOME SVG

* data/logitech-g700.svg: add G700 GNOME SVG

* meson: install GNOME SVG files
2017-07-07 16:05:36 +02:00
Jente Hidskes
e16aafe86c data: move default SVGs under default/ subdirectory..
.. and install them in the appropriate directory after #209
2017-07-07 15:07:45 +02:00
Benjamin Tissoires
79f4b9c0d6 tools: add ratbagctl.devel to launch both ratbagd and ratbagctl
When developing with ratbagd, we need to test against master, not
the system-wide installed daemon.

Allow to name space ratbagd with the creation of a new (not installed)
rabtagd.devel daemon, that is tagged with the git sha of the ratbagd
folder.

Handle this namespace in ratbagctl by looking at an environment variable
RATBAGCTL_DEVEL.

Then provide a python script that launches both rabtagd.devel and
ratbagctl with the correct environment variable set so that they can
talk to each other.

Note that we blindly overwrite the dbus .conf file as nobody else than
developers should have one.

Note: the tagging of ratbagd.devel (like the meson bit) won't run unless
a rebuild is triggered. So we don't necessarily always get the right git
tag. However, touching ratbagctl.in triggers a rebuild, so we should be
OK-ish.

Fixes #206

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-07 16:02:46 +10:00
Peter Hutterer
fe3169182c meson: fix valgrind setup
The previous approach had no effect, it wasn't doing things correctly.
Add a proper valgrind setup, run with:

       mesontest --setup=valgrind

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
[fixed rebase conflict]
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2017-07-05 09:36:30 +02:00
Peter Hutterer
642a5339bc meson: drop invalid configuration: tag for install_data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-05 09:35:51 +02:00
Peter Hutterer
4eb5411bf1 meson: fix svg data dir (#191)
It was missing the prefix

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-03 10:28:20 +02:00
Peter Hutterer
22af1176d3 meson: hack around Fedora's systemd libdir confusion
Fedora uses /usr/lib64 as libdir but systemd uses /usr/lib for its files. We
used libdir to install the unit files, which then end up in
/usr/lib64/systemd/systemd where it will be ignored. There's no good way to
avoid this beyond detecting this mismatch and hacking around it.

To keep custom prefixes intact, this patch detects a /usr prefix and checks
with systemd's pkconfig, if the libdir and the systemd unitdir mismatch, then
we adjust the path.

https://github.com/libratbag/libratbag/issues/188

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-07-03 09:57:20 +02:00
Peter Hutterer
f36fdc0492 meson: drop the separate shared library for ratbagd
We can reinstate that when we need it

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-29 15:03:11 +10:00
Peter Hutterer
907b96d447 meson: drop unused defines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-06-29 15:03:11 +10:00