Peter Hutterer [Fri, 5 Jul 2013 01:20:50 +0000 (11:20 +1000)]
Add a custom stylesheet to the documentation.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 23:23:30 +0000 (09:23 +1000)]
Add documentation about the test suite
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 23:08:04 +0000 (09:08 +1000)]
test: define a common device name
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 23:02:46 +0000 (09:02 +1000)]
test: constify the input_absinfo argument
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 23:00:24 +0000 (09:00 +1000)]
test: don't set the abs value when initializing an uinput device
The helper function uses abs.value for the axis code (to save a parameter).
Reset that to 0 before we write to the device
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 22:45:48 +0000 (08:45 +1000)]
test: fix up the tests to test for resolution now too
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 22:35:06 +0000 (08:35 +1000)]
test: write resolution for uinput devices after creating the device
EVIOCSABS allows us to set the device's abs axes to the desired resolution.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 01:38:56 +0000 (11:38 +1000)]
doc: tweak a few doxygen options, mainly to display the version
The rest is rather insignificant
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 01:37:20 +0000 (11:37 +1000)]
Some minor documentation fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 01:11:51 +0000 (11:11 +1000)]
test: add test for event values (type and code)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 01:05:39 +0000 (11:05 +1000)]
test: unify test case creation in test-event-names.c
Simple rename from custom test case variable names to tc
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 4 Jul 2013 00:07:44 +0000 (10:07 +1000)]
Add two helper functions to check event type/code
These aren't really that useful since they're just one or two lines in
code, but it saves callers from accidentally misplacing braces, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Jul 2013 05:27:51 +0000 (15:27 +1000)]
Add a simple example to the documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Jul 2013 05:16:26 +0000 (15:16 +1000)]
Indent some documentation better
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Jul 2013 05:15:10 +0000 (15:15 +1000)]
README: Drop the details, refer to documentation instead
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Jul 2013 04:58:22 +0000 (14:58 +1000)]
Sync the initial slot state from the device
libevdev_get_slot_value() needs to return the correct value from the outset.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 3 Jul 2013 04:51:02 +0000 (14:51 +1000)]
test: add test for extracting the right slot values on startup
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Jul 2013 00:55:59 +0000 (10:55 +1000)]
test: add a few sync test cases for incomplete syncs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Jul 2013 00:55:44 +0000 (10:55 +1000)]
If we don't have anything to sync, don't add a EV_SYN event
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 2 Jul 2013 00:50:37 +0000 (10:50 +1000)]
Switch to a state machine to handle incomplete syncs
A caller may start syncing but switch back to normal half-way through the
sync. In that case, we need to drop all sync events and continue with
regular events only.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 05:46:23 +0000 (15:46 +1000)]
Add a flag for blocking read
Not all clients need nonblocking read, so add a flag to read
in blocking mode. In that mode, events are only read from the fd when
the queue is empty.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 05:30:49 +0000 (15:30 +1000)]
If the caller doesn't sync when it should, process all events regardless
libevdev needs to maintain the correct state of the device, even if the caller
decides to drop all delta events after a SYN_DROPPED.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 04:40:22 +0000 (14:40 +1000)]
test: add test for abs and mt syncing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 04:39:53 +0000 (14:39 +1000)]
Don't sync mt axes that don't exist
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 03:34:21 +0000 (13:34 +1000)]
test: test for trying to enable invalid abs axis
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 03:31:49 +0000 (13:31 +1000)]
test: add tests for mt event values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 03:12:36 +0000 (13:12 +1000)]
test: add tests for checking event values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 03:12:20 +0000 (13:12 +1000)]
test: add new helper function for absolute events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 00:08:26 +0000 (10:08 +1000)]
test: add test for filtered event delivery
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 00:06:55 +0000 (10:06 +1000)]
Don't deliver events that are filtered
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Mon, 1 Jul 2013 00:08:02 +0000 (10:08 +1000)]
Disallow disabling of EV_SYN
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 23:49:50 +0000 (09:49 +1000)]
gitignore: add generated doxygen file
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 23:44:47 +0000 (09:44 +1000)]
test: add test for changing kernel abs values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 23:35:16 +0000 (09:35 +1000)]
Require data be NULL when enabling a non-EV_ABS axis
In the future this may change, but for now enforce that callers use NULL.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 23:32:02 +0000 (09:32 +1000)]
test: add test for getting abs axis data
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 23:31:38 +0000 (09:31 +1000)]
test: copy absinfo over to the uinput_user_dev before creation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 23:26:29 +0000 (09:26 +1000)]
test: rename two loop variables to be more meaningful
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 23:25:19 +0000 (09:25 +1000)]
test: move a block out of the inner loop
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 22:54:39 +0000 (08:54 +1000)]
test: fix parameter name for uinput_device_set_abs_bit
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 22:42:29 +0000 (08:42 +1000)]
test: add two more tests for enabling/disabling invalid events.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 22:33:53 +0000 (08:33 +1000)]
doc: set doxygen to quiet mode
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 22:33:02 +0000 (08:33 +1000)]
Add more documentation to stop complaints about undocumented members
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 05:27:24 +0000 (15:27 +1000)]
Drop code for kernel-enabling bits
We can't enable axes on devices at runtime in the kernel, not even
for uinput devices. So this API can't work anyway, remove it before
someone thinks it does work.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 30 Jun 2013 05:24:46 +0000 (15:24 +1000)]
test: add test for kernel-enabling bits
This test fails because we can't actually enable bits at runtime, guess I
should've thought of that before. Either way, commit this test (and revert it
again) so the test is in the repository in case we do get this ability later.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 29 Jun 2013 08:25:30 +0000 (18:25 +1000)]
Change signature for kernel_enable_event_code to match enable_event_code
They do essentially the same thing, so the function signature should be null.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 29 Jun 2013 08:19:50 +0000 (18:19 +1000)]
test: use new convenience function for uinput device creation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 29 Jun 2013 08:09:28 +0000 (18:09 +1000)]
test: move device creation into a shared function
remove some of that code duplication in the tests.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 29 Jun 2013 08:10:01 +0000 (18:10 +1000)]
test: provide uinput convenience function for varargs
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 29 Jun 2013 07:57:31 +0000 (17:57 +1000)]
test: prepare a common header file for all tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 29 Jun 2013 07:28:49 +0000 (17:28 +1000)]
test: add tests for device bit manipulation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 29 Jun 2013 07:34:32 +0000 (17:34 +1000)]
Return -1 for failing to enable/disable bits
as the documentation says
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 28 Jun 2013 03:18:28 +0000 (13:18 +1000)]
tools: add a tool to build and publish the documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 28 Jun 2013 03:15:27 +0000 (13:15 +1000)]
test: close the right pipe fds
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 28 Jun 2013 03:13:55 +0000 (13:13 +1000)]
test: fix a bunch of memory leaks
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 28 Jun 2013 03:13:15 +0000 (13:13 +1000)]
test: fix valgrind complaint about uninitialized bytes
uinput ignores the timestamp, but add it anyway to stop valgrind
worrying about it.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 28 Jun 2013 02:51:16 +0000 (12:51 +1000)]
Add a FIXME to log a warning message
When a sync is complete and the first event is a SYN_DROPPED again,
we have a problem. Log that so that the process can print a warning.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 28 Jun 2013 01:24:13 +0000 (11:24 +1000)]
test: add test case for button deltas after SYN_DROPPED
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 28 Jun 2013 00:18:35 +0000 (10:18 +1000)]
Add a flag for forcing a SYN_DROPPED event
uinput doesn't route a SYN_DROPPED, so we neeed to handle fds in
a rather complicated manner. For tests, avoid this and instead force
the library to sync if a specific flag is given.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Fri, 28 Jun 2013 00:18:03 +0000 (10:18 +1000)]
Build doc first, to see the warnings better
Leave the code warnings at the end of the build, makes them more visible.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 23:31:55 +0000 (09:31 +1000)]
Expand main documentation to explain libevdev a bit more
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 20:38:14 +0000 (06:38 +1000)]
README: Add link to API documentation
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 19:58:57 +0000 (05:58 +1000)]
README: fix library name
libevdevdev was an old name for this library. libevemu is something
completely different.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 04:28:23 +0000 (14:28 +1000)]
tools: update libevdev-events to use the new LIBEVDEV_READ_NORMAL flag
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 04:21:55 +0000 (14:21 +1000)]
Improve documentation to libevdev_next_event
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 04:20:03 +0000 (14:20 +1000)]
Require a flag for normal mode too
Makes the whole thing more explicit.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 01:03:52 +0000 (11:03 +1000)]
test: add test for event polling and SYN_DROPPED handling
Rudimentary only, but it's a start
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 01:02:39 +0000 (11:02 +1000)]
test: don't check for a max on EV_SYN events
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 00:37:21 +0000 (10:37 +1000)]
test: add incomplete test for input props
Can't set those via uinput, so we're limited to making sure nothing
goes crazy.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 00:29:11 +0000 (10:29 +1000)]
tests: add two multitouch tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 00:23:23 +0000 (10:23 +1000)]
test: add test case for device grabbing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 00:22:47 +0000 (10:22 +1000)]
test: test some more event max and invalid event type paths
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Thu, 27 Jun 2013 00:21:44 +0000 (10:21 +1000)]
Init dev->grabbed as LIBEVDEV_UNGRAB
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 26 Jun 2013 23:45:58 +0000 (09:45 +1000)]
Replace a few malloc + strcpy with strdup
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 26 Jun 2013 23:40:41 +0000 (09:40 +1000)]
Revert "test: Hook up gcov to require the test name"
This reverts commit
c590c70ea467b37e96b2b4cb41d91776519b569d.
Peter Hutterer [Wed, 26 Jun 2013 23:40:23 +0000 (09:40 +1000)]
Pull all tests together into one binary
Easier to monitor gcov coverage that way
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 26 Jun 2013 23:24:05 +0000 (09:24 +1000)]
test: Hook up gcov to require the test name
Make check will simply overwrite results of a previous test. Hook up gcov so that the test has to be
explicitly passed to avoid confusion here.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 26 Jun 2013 08:13:24 +0000 (18:13 +1000)]
Don't return a NULL name, ever.
Even if the device is not yet initialized (which would be a caller bug, but still)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 26 Jun 2013 07:31:15 +0000 (17:31 +1000)]
Fix distcheck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 26 Jun 2013 06:48:21 +0000 (16:48 +1000)]
test: add more event queue tests
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 26 Jun 2013 06:47:43 +0000 (16:47 +1000)]
Don't crash peeking at a zero-sized queue
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 23 Jun 2013 09:49:47 +0000 (19:49 +1000)]
Update gitignore
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 22 Jun 2013 10:00:48 +0000 (20:00 +1000)]
test: fix includes for distcheck
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 22 Jun 2013 09:45:39 +0000 (19:45 +1000)]
Slots are now definitely zero-indexed, see recent kernel patch
doc: specify that ABS_MT_SLOT must have a minimum of 0
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 22 Jun 2013 09:44:03 +0000 (19:44 +1000)]
Documentation fixes
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sat, 22 Jun 2013 09:13:36 +0000 (19:13 +1000)]
Use doxygen instead of man pages
Doxygen is bad for man pages, but having an online API documentation
is better and easier to maintain.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Tue, 18 Jun 2013 11:57:34 +0000 (21:57 +1000)]
Fix stray code tag in html
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 9 Jun 2013 10:22:18 +0000 (20:22 +1000)]
test: add test for internal event queue
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 9 Jun 2013 10:11:39 +0000 (20:11 +1000)]
Fix queue_num_free_elements
Return 0 for an unallocated queue, and return the actual number of events (rather than one too
little).
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 26 Jun 2013 07:26:50 +0000 (17:26 +1000)]
Don't return the next element if the queue is full
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 9 Jun 2013 10:07:14 +0000 (20:07 +1000)]
Don't allow a queue size of 0.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 9 Jun 2013 10:03:50 +0000 (20:03 +1000)]
Use a size_t, not an int, where appropriate
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jun 2013 07:30:08 +0000 (17:30 +1000)]
Hook up gcov
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jun 2013 06:50:48 +0000 (16:50 +1000)]
Directly compile libevdev sources
This avoids messing around with libtool for debugging. I may revert this
once the library is actually slightly stable, but for now this makes things
easier.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jun 2013 05:31:00 +0000 (15:31 +1000)]
Add a test for event the various libevdev_has_event * functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 9 Jun 2013 09:48:19 +0000 (19:48 +1000)]
Add an API to get the repeat values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Sun, 9 Jun 2013 09:49:10 +0000 (19:49 +1000)]
man: add a note about EV_REP values
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jun 2013 06:43:15 +0000 (16:43 +1000)]
Handle EV_REP events in event-names.h
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jun 2013 06:30:00 +0000 (16:30 +1000)]
Add the remaining ev bits
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jun 2013 06:03:54 +0000 (16:03 +1000)]
Use a macro for type_to_mask
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Peter Hutterer [Wed, 5 Jun 2013 06:01:25 +0000 (16:01 +1000)]
Add function to get max value for a given ev type
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>