Commit Graph

657 Commits (master)

Author SHA1 Message Date
Peter Hutterer 91203701cf wacom: group the list2hex output
Group by size 8 by default.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-21 09:31:52 +02:00
Peter Hutterer f08100bae2 meson.build: de-duplicate the icondir defines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-21 15:25:30 +10:00
Jakub Steiner 4cf5501044 Update icon based on the new logo
And add a symbolic variant as well

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-21 15:08:38 +10:00
Peter Hutterer 244b4f5994 wacom: make the parents for the raw log directory too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-21 14:04:23 +10:00
Peter Hutterer 10c34bc655 gui: simplify the Config's singleton pattern
Use __new__ instead of instance(), this way we can just use the same config
object as Config().do_something.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>k
2019-08-20 12:19:52 +10:00
Peter Hutterer 64fcf04e32 svg: use our Json SVG converter from kete
A few minor changes like passing in a filename and fixing the different
spellings of the orientations.

In order to use it from kete though we have to mess with the PYTHONPATH. But
since it's a in-tree tool only anyway... meh.

This loses the ability to disable pressure on tablets. I think that's just a
leftover from before we knew how to handle pressure in SVG exports. We should
just fix that properly instead of having a config option here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 12:02:30 +10:00
Peter Hutterer ac811920b8 tuhi: move the gui/svg.py file to tuhi
One JSON to SVG converter per project is enough.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 12:02:30 +10:00
Peter Hutterer f5bafb7f73 gui: use mm in the svg 2019-08-20 12:02:30 +10:00
Peter Hutterer 92fcfd12cc wacom: update the dimensions with the point size
Make sure our dimensions are in actual µm.

Note that this will mess with any cached JSON files since they are now on a
different scale.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 12:02:30 +10:00
Peter Hutterer 643dd34476 protocol: add the message for getting the point size
The dimensions of the tablet are in device units, the point size tells us how
big the actual tablet is.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 12:02:30 +10:00
Peter Hutterer 57aa0de954 protocol: the spark doesn't support get width/height
Let's make those noop messages that return the hardcoded width/height instead.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 12:02:30 +10:00
Peter Hutterer ff2618e68a protocol: add helper functions for converting to/from little endians
A few messages where we assumed the argument is a single byte are actually
little-endian 16 bits. let's add easy-to-use wrappers.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 12:02:30 +10:00
Peter Hutterer a7836abfe6 tools: fix syntax error in kete
Introduced in cc7ba1b365 for slightly
overzealous flake8 handling.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-20 11:56:38 +10:00
Peter Hutterer 6d718f16b5 wacom: rework the file data prefix handling
We know how it's supposed to look like, so let's hardcode it a bit better.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 15:46:50 +02:00
Peter Hutterer 116589d28d wacom: pen data first four bytes are the internal file format
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 15:46:50 +02:00
Peter Hutterer f742779c1a tuhi: log the tuhi server session data to a file
Storage is $XDG_DATA_HOME/tuhi/session-logs/tuhi-$DATE.log
Because it's really useful to have the logs of an old session around when
something goes wrong. Even for simple things like "what uuid was I using
again?"

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 15:43:01 +02:00
Peter Hutterer 9ef4002b39 Move the default config setting to the entry points
Have this in the effective main() methods (or close to that anyway) instead of
hidden away in the config implementations.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 15:43:01 +02:00
Peter Hutterer be9b3c02cc base: allow for a None vendor ID
Unsure how to trigger this case but I have all my devices (not recently
connected) with a vendor ID of None.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 15:41:10 +02:00
Peter Hutterer 8d67bbf5c4 gui: drop an unused config path
This is the copy of tuhi-kete, no need to keep the config path around here.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 14:30:26 +10:00
Peter Hutterer 101e2f380e gui: store the cached SVGs in $XDG_CACHE_DIR instead
This is transient data, they're constantly regenerated. Let's store them as
such.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 14:26:27 +10:00
Peter Hutterer cc7ba1b365 kete: move the ini file template out of the code
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 14:11:36 +10:00
Peter Hutterer be6d57562a Switch to pathlib everywhere
gresources and svgwrite don't (yet?) take a Path though, so we have to use
os.fspath() to convert those.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 14:11:36 +10:00
Peter Hutterer c8759eb400 gui: unify the loggers across the GUI
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-19 14:11:25 +10:00
Peter Hutterer 6dc67f13c8 svg: call the super constructor
Presumably gobject sets a few things up, so let's call it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 15:22:53 +10:00
Peter Hutterer 32091d9a7b wacom: improve a timestamp debug message
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 15:21:24 +10:00
Peter Hutterer e5375a55dd wacom: name an argument to make it more obvious what the magic 5 means
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 15:21:24 +10:00
Peter Hutterer d73da09e26 protocol: 0xc7 on the spark seems to be in big-endian
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 15:10:25 +10:00
Peter Hutterer 790d8c5e31 wacom: fix pressure range for the IntuosPro
8191 seems to be the max value

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 15:05:49 +10:00
Peter Hutterer 85f2e3c67a wacom: fix the dimensions for the Spark
The reachable range is 2100x14800, highest pressure is 1023. Unlike the slate
the paper block still affords to address almost the whole range even though
the paper is slightly narrower than the range - but it can slide left/right by
about 5mm.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 15:05:49 +10:00
Peter Hutterer bd6278a305 wacom: change the raw log file name to include the timestamp
Because it's annoying when there's an issue with the timestamp in the file and
you have to grep for the file name.

And while we're there, change the human readable date to be actually readable.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 14:58:41 +10:00
Peter Hutterer 35acce3ea6 wacom: log the raw yaml data into a subdirectory
It gets a bit too confusing otherwise with all the weirdly named files around

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 14:58:41 +10:00
Peter Hutterer 6bf7715e83 wacom: write just the timestamp to the log file
Easier to parse than a strftime. And we can just add that one in a comment
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 14:58:41 +10:00
Peter Hutterer 7f8222b351 wacom: add missing linebreaks to the yml log file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-15 14:58:41 +10:00
Peter Hutterer e6057e256d Merge tuhigui into tuhi.gui
Let's make this a submodule of tuhi so we can share some code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 08:18:39 +10:00
Peter Hutterer a87a297be3 Merge tuhigui/data to just data/
Step one in making the tuihgui a submodule of tuhi

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 08:18:39 +10:00
Peter Hutterer 547aec3d9b config: use super() instead of named base class
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 08:18:39 +10:00
Peter Hutterer d8859d1b6a README: headline fix
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 08:18:39 +10:00
Peter Hutterer 3d5c0aa23c test: add unit-testing for the various protocol messages
This only tests for the success cases, but at least we know that path is
executed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer c014393adb wacom: time_to_bytes is obsolete now
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer 1ea89d2f09 protocol: split GET_DIMENSIONS up into two messages
It's the same message with a different argument, let's try not to do
gymnastics in the Msg code just so we can return a tuple.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer 73bc782a53 protocol: 0xec is simply the GATT selection for file transfers
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer c39c20ede2 protocol: drop the UNKNOWN_B1 class
0xb1 is the SetMode command, the rest is just the argument for which mode we
want

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer 5e4ab89f41 Drop the semi-duplicate separate Protocol class
We can hook into the ProtocolVersion here, so let's de-duplicate this.
Should be backwards-compatible for config files but new config files will have
the uppercase name written now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer 552e06a0fc wacom: drop the now-obsolete send_nordic_command_sync
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer b34f8794e4 wacom: switch registering the device to the new protocol handling
This is still a bit awkward because the communication of the spark especially
is so strange. It sends a (rejected) uuid, then a single command to register
that UUID. The Slate and the IntuosPro are more sensible, they seem to have a
special message to register a UUID - that one either fails or succeeds.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer 6e20faa737 protocol: add a timeout argument to the new protocol handlers
The default timeout is too short for registering a button, let's control this
from the message.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer f68ffa6733 wacom: pass the timestamp in seconds down parse_pen_data
We don't carea about the struct time here

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer a08aa02607 wacom: drop a bunch of now-duplicate functions
This is all handled by the matching Msg now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer 023decb1d4 wacom: use the new protocol implemenation for all "normal" messages
This is an in-situ replacement of the old functionality vs the new one,
resulting in a bit of duplication. Now that the Protocol takes care of the
device-specifics most of our functions look identical. This will be fixed in a
follow-up commit.

Missing from the conversion here is the initial register handling (too
convoluted right now) and the parsing of the pen data.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00
Peter Hutterer bcbb0982c8 wacom: drop our NordicData, use the one from the protocol
Same thing anyway, this is just namespace handling

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2019-08-14 07:37:30 +10:00