platform/upstream/libevdev.git
11 years agoAxis values must be int, not unsigned int
Peter Hutterer [Fri, 23 Aug 2013 00:15:50 +0000 (10:15 +1000)]
Axis values must be int, not unsigned int

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoIgnore -Woverride-init in event-names.h
Peter Hutterer [Thu, 22 Aug 2013 06:04:40 +0000 (16:04 +1000)]
Ignore -Woverride-init in event-names.h

Having the declarations in the form of [0...EV_MAX] = NULL together
with the actual definitions causes warnings for every true definition if
-Woverride-init is enabled.

We can drop them for most as they're zero, but still need them for
ev_max (which defaults to -1), not zero. So use the GCC pragma to
disable the warnings for this file.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoChange event name generate script to be python 2/3 compatible
Peter Hutterer [Sun, 25 Aug 2013 22:53:46 +0000 (08:53 +1000)]
Change event name generate script to be python 2/3 compatible

Python 3 doesn't have a print statement, only a print function.

Fixed with:
  2to3 make-event-names.py | git apply

Print as function requires Python 2.6 which is reasonable enough given
that even RHEL6 ships that.

Even though it's not needed for 2.6, use
from __future__ import print_function
to avoid accidentally introducing a print statement in the future.
With this line, print "blah" is now a syntax error in python 2.
This line was added manually, after the 2to3 conversion.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: actually package generated documentation
Peter Hutterer [Tue, 27 Aug 2013 01:42:48 +0000 (11:42 +1000)]
doc: actually package generated documentation

Previous find command wouldn't actually list the generated documentation
files, so they'd be missing in the tarball.

...and add a dist-hook to make sure this won't happen during release.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoAdd support for EV_SW
Peter Hutterer [Wed, 14 Aug 2013 09:52:25 +0000 (19:52 +1000)]
Add support for EV_SW

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoAvoid under-allocation of array for syncing key/led state
Peter Hutterer [Mon, 26 Aug 2013 22:03:17 +0000 (08:03 +1000)]
Avoid under-allocation of array for syncing key/led state

No functional effect as the size would end up being the same anyway
due to the values of KEY_MAX and LED_MAX.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoRemove unneeded include of linux/uinput.h
Peter Hutterer [Mon, 26 Aug 2013 03:10:05 +0000 (13:10 +1000)]
Remove unneeded include of linux/uinput.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoMerge branch 'led-handling'
Peter Hutterer [Sun, 25 Aug 2013 23:53:10 +0000 (09:53 +1000)]
Merge branch 'led-handling'

11 years agoRename enums to match lower_case format
Peter Hutterer [Wed, 14 Aug 2013 00:17:59 +0000 (10:17 +1000)]
Rename enums to match lower_case format

This is technically an API, but not an ABI change.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
11 years agoStore the abs value after handling mt events
Peter Hutterer [Thu, 15 Aug 2013 01:10:17 +0000 (11:10 +1000)]
Store the abs value after handling mt events

This way any ABS_MT_ event value that comes in will also be stored in abs_info.
That always corresponds to "current slot", so if a user calls
libevdev_set_event_value() or libevdev_get_event_value() they're actually
modifying the current slot value.

When the current slot changes, sync the state back into the absinfo values.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agowrite EV_SYN input_event along with led events to device
polyphemus [Fri, 9 Aug 2013 15:38:51 +0000 (17:38 +0200)]
write EV_SYN input_event along with led events to device

Other clients of an evdev device need to have the events they receive
be separated, in moment in time, from other events by an EV_SYN/
SYN_REPORT. This is the responsibility of the client who writes events
into the stream.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoFix build without MSC_TIMESTAMP
Martin Minarik [Fri, 23 Aug 2013 17:47:55 +0000 (19:47 +0200)]
Fix build without MSC_TIMESTAMP

To build with older input.h

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoPass --no-print-directory to make
David Herrmann [Sat, 17 Aug 2013 11:58:18 +0000 (13:58 +0200)]
Pass --no-print-directory to make

The "Entering/Leaving directroy /xyz" messages only add noise to
make-output. Even without we still get short hints which directory is
currently processed. Compare the two outputs below:

With --no-print-directory added:
  make --no-print-directory all-recursive
  Making all in doc
  doxygen libevdev.doxygen
  Making all in libevdev
  python2 ./make-event-names.py --output=c > event-names.h
  make  all-am
    CC       libevdev.lo
    CCLD     libevdev.la
  Making all in tools
    CC       libevdev-events.o
    CCLD     libevdev-events
  Making all in test
    CC       test-main.o
    CC       test-event-names.o
    CC       test-libevdev-init.o
    CC       test-libevdev-has-event.o
    CC       test-int-queue.o
    CC       test-libevdev-events.o
    CC       libevdev.o
    CC       test-common-uinput.o
    CC       test-common.o
    CCLD     test-libevdev

Without it:
  make  all-recursive
  make[1]: Entering directory `/home/david/dev/libevdev'
  Making all in doc
  make[2]: Entering directory `/home/david/dev/libevdev/doc'
  doxygen libevdev.doxygen
  make[2]: Leaving directory `/home/david/dev/libevdev/doc'
  Making all in libevdev
  make[2]: Entering directory `/home/david/dev/libevdev/libevdev'
  python2 ./make-event-names.py --output=c > event-names.h
  make  all-am
  make[3]: Entering directory `/home/david/dev/libevdev/libevdev'
    CC       libevdev.lo
    CCLD     libevdev.la
  make[3]: Leaving directory `/home/david/dev/libevdev/libevdev'
  make[2]: Leaving directory `/home/david/dev/libevdev/libevdev'
  Making all in tools
  make[2]: Entering directory `/home/david/dev/libevdev/tools'
    CC       libevdev-events.o
    CCLD     libevdev-events
  make[2]: Leaving directory `/home/david/dev/libevdev/tools'
  Making all in test
  make[2]: Entering directory `/home/david/dev/libevdev/test'
    CC       test-main.o
    CC       test-event-names.o
    CC       test-libevdev-init.o
    CC       test-libevdev-has-event.o
    CC       test-int-queue.o
    CC       test-libevdev-events.o
    CC       libevdev.o
    CC       test-common-uinput.o
    CC       test-common.o
    CCLD     test-libevdev
  make[2]: Leaving directory `/home/david/dev/libevdev/test'
  make[2]: Entering directory `/home/david/dev/libevdev'
  make[2]: Leaving directory `/home/david/dev/libevdev'
  make[1]: Leaving directory `/home/david/dev/libevdev'

We don't really win any useful information from these messages.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoRemove deprecated SYMBOL_CACHE_SIZE from doxygen.in
David Herrmann [Sat, 17 Aug 2013 11:58:17 +0000 (13:58 +0200)]
Remove deprecated SYMBOL_CACHE_SIZE from doxygen.in

SYMBOL_CACHE_SIZE was removed in newer doxygen releases. We use the
default value, so simply drop it.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoAdd -I m4 to ACLOCAL_AMFLAGS
David Herrmann [Sat, 17 Aug 2013 11:58:14 +0000 (13:58 +0200)]
Add -I m4 to ACLOCAL_AMFLAGS

We put m4 files into a separate directory. If we ever put our own files in
there, we need to include it. Furthermore, this suppresses annoying
autotools warnings.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoAdd functions to toggle LEDs on the device
Peter Hutterer [Fri, 9 Aug 2013 03:21:28 +0000 (13:21 +1000)]
Add functions to toggle LEDs on the device

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoKeep the LED state and sync it after SYN_DROPPED
Peter Hutterer [Tue, 13 Aug 2013 23:29:41 +0000 (09:29 +1000)]
Keep the LED state and sync it after SYN_DROPPED

This enables libevdev_get_event_value(dev, EV_LED, LED_NUML); to check
if a LED is on or off.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoAdd setters for an event or slot value
Peter Hutterer [Fri, 9 Aug 2013 04:46:24 +0000 (14:46 +1000)]
Add setters for an event or slot value

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoRename libevdev_kernel_set_abs_value to libevdev_kernel_set_abs_info
Peter Hutterer [Fri, 9 Aug 2013 03:47:00 +0000 (13:47 +1000)]
Rename libevdev_kernel_set_abs_value to libevdev_kernel_set_abs_info

Keep it in line with the non-kernel setter

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoSync the key state on startup
Peter Hutterer [Tue, 13 Aug 2013 23:44:21 +0000 (09:44 +1000)]
Sync the key state on startup

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoSimplify a bit state setter
Peter Hutterer [Tue, 13 Aug 2013 23:15:51 +0000 (09:15 +1000)]
Simplify a bit state setter

set_bit_state does exactly what the previous if/else did.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoMinor documentation improvement
Peter Hutterer [Wed, 14 Aug 2013 00:22:24 +0000 (10:22 +1000)]
Minor documentation improvement

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agotest: devices with abs axes need to be created properly
Peter Hutterer [Mon, 29 Jul 2013 03:38:28 +0000 (13:38 +1000)]
test: devices with abs axes need to be created properly

Simply enabling the bits is not enough, we need to provide axis
information too if we want to enable this properly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoMake the tests optional to drop unneeded dependencies
Peter Hutterer [Mon, 29 Jul 2013 04:27:41 +0000 (14:27 +1000)]
Make the tests optional to drop unneeded dependencies

libevdev has no external dependencies and both check and libudev are
only required for running the unit-tests. Make them optional.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agotest: change device for enabling/disabling bits to use REL_*
Peter Hutterer [Mon, 29 Jul 2013 03:34:48 +0000 (13:34 +1000)]
test: change device for enabling/disabling bits to use REL_*

No real effect on the test, this check is just so that a follow-up patch to
fix the tests for the new uinput backend is a bit easier to review.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoFix stray * in documentation
Peter Hutterer [Fri, 9 Aug 2013 04:35:45 +0000 (14:35 +1000)]
Fix stray * in documentation

11 years agolibevdev 0.3 libevdev-0.3
Peter Hutterer [Thu, 8 Aug 2013 03:21:04 +0000 (13:21 +1000)]
libevdev 0.3

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoFix header guard, lowercased in some previous search/replace
Peter Hutterer [Thu, 8 Aug 2013 03:04:11 +0000 (13:04 +1000)]
Fix header guard, lowercased in some previous search/replace

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoAdd setters for product/vendor/bustype/version
Peter Hutterer [Thu, 25 Jul 2013 06:21:32 +0000 (16:21 +1000)]
Add setters for product/vendor/bustype/version

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoRename ID getters to have a consistent naming scheme
Peter Hutterer [Thu, 1 Aug 2013 03:22:07 +0000 (13:22 +1000)]
Rename ID getters to have a consistent naming scheme

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoReplace ID getter implementation with a define
Peter Hutterer [Tue, 30 Jul 2013 03:48:55 +0000 (13:48 +1000)]
Replace ID getter implementation with a define

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoProvide setters for name, phys, uniq
Peter Hutterer [Thu, 25 Jul 2013 06:11:04 +0000 (16:11 +1000)]
Provide setters for name, phys, uniq

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoAdd abs setters for changing a single value on an abs axis
Peter Hutterer [Wed, 24 Jul 2013 05:52:02 +0000 (15:52 +1000)]
Add abs setters for changing a single value on an abs axis

Changing a single value on an abs axis is slightly more common than
having to enable that axis outright. Provide a set of accessors for
doing so.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoRename a few getters for consistency
Peter Hutterer [Tue, 30 Jul 2013 01:25:00 +0000 (11:25 +1000)]
Rename a few getters for consistency

Deprecated:
* libevdev_get_abs_min, libevdev_get_abs_max
* libevdev_get_input_prop_name

Will be removed in one or two versions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoReplace libevdev_get_abs_* with macro-generated ones
Peter Hutterer [Thu, 25 Jul 2013 03:06:23 +0000 (13:06 +1000)]
Replace libevdev_get_abs_* with macro-generated ones

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoAdd setter for property bits
Peter Hutterer [Mon, 29 Jul 2013 05:34:37 +0000 (15:34 +1000)]
Add setter for property bits

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agotest: check for enabling REL_X with data
Peter Hutterer [Mon, 29 Jul 2013 04:35:52 +0000 (14:35 +1000)]
test: check for enabling REL_X with data

Only EV_REP and EV_ABS accept data.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoAdd libevdev_has_event_pending()
Peter Hutterer [Wed, 24 Jul 2013 03:37:53 +0000 (13:37 +1000)]
Add libevdev_has_event_pending()

Returns non-zero if there are events avialable to be read.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agodoc: fix css for notes and return values
Peter Hutterer [Tue, 30 Jul 2013 23:48:44 +0000 (09:48 +1000)]
doc: fix css for notes and return values

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoWhen enabling EV_REP, set the delay/period values
Peter Hutterer [Mon, 29 Jul 2013 01:46:01 +0000 (11:46 +1000)]
When enabling EV_REP, set the delay/period values

Just enabling EV_REP sets them to zero, but when enabling them directly,
a value is required.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoMake sure all EV_REP bits are set
Peter Hutterer [Mon, 29 Jul 2013 02:04:58 +0000 (12:04 +1000)]
Make sure all EV_REP bits are set

Current code was skipping REP_PERIOD

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoSet the size for repeat delays based on REP_CNT
Peter Hutterer [Mon, 29 Jul 2013 01:45:30 +0000 (11:45 +1000)]
Set the size for repeat delays based on REP_CNT

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoDon't try setting an ABS code without data
Peter Hutterer [Fri, 26 Jul 2013 06:53:04 +0000 (16:53 +1000)]
Don't try setting an ABS code without data

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agoAllow enabling of EV_SYN codes
Peter Hutterer [Fri, 26 Jul 2013 06:51:17 +0000 (16:51 +1000)]
Allow enabling of EV_SYN codes

Has no effect, but allow it nonetheless to avoid superfluous
conditions in client code.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agotest: drop some superfluous dev creation
Peter Hutterer [Mon, 29 Jul 2013 02:36:42 +0000 (12:36 +1000)]
test: drop some superfluous dev creation

copy/paste residue, had no effect

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agogitignore: ignore gcov, ctags, announce emails
Peter Hutterer [Mon, 29 Jul 2013 03:32:41 +0000 (13:32 +1000)]
gitignore: ignore gcov, ctags, announce emails

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
11 years agolibevdev 0.2.1 libevdev-0.2.1
Peter Hutterer [Wed, 24 Jul 2013 23:00:42 +0000 (09:00 +1000)]
libevdev 0.2.1

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoFix name and version in pkgconfig file
Peter Hutterer [Tue, 23 Jul 2013 21:19:12 +0000 (07:19 +1000)]
Fix name and version in pkgconfig file

evdev_read was an earlier name for this library.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agolibevdev 0.2 libevdev-0.2
Peter Hutterer [Sun, 21 Jul 2013 22:16:07 +0000 (08:16 +1000)]
libevdev 0.2

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: fix two doxygen include paths to be source-relative
Peter Hutterer [Mon, 22 Jul 2013 00:49:36 +0000 (10:49 +1000)]
doc: fix two doxygen include paths to be source-relative

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoAdd libevdev.css to EXTRA_DIST
Peter Hutterer [Mon, 22 Jul 2013 00:44:23 +0000 (10:44 +1000)]
Add libevdev.css to EXTRA_DIST

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoPoint to new API documentation URL
Peter Hutterer [Sun, 21 Jul 2013 22:31:36 +0000 (08:31 +1000)]
Point to new API documentation URL

And fix up the tool to publish it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoDocument mailing list
Peter Hutterer [Sun, 21 Jul 2013 22:20:46 +0000 (08:20 +1000)]
Document mailing list

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoChange github.com references to freedesktop.org
Peter Hutterer [Wed, 17 Jul 2013 01:05:08 +0000 (11:05 +1000)]
Change github.com references to freedesktop.org

Except for the API documentation, that'll stay on github for now until
I figure out where to put it (and have the space to put it in).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agotest: add uinput prop bits and the test for it
Peter Hutterer [Wed, 10 Jul 2013 23:09:14 +0000 (09:09 +1000)]
test: add uinput prop bits and the test for it

Turns out I was looking at an old header file, UI_SET_PROPBIT
has existed for quite a while.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoDon't include config.h in the public header
Peter Hutterer [Tue, 9 Jul 2013 04:39:23 +0000 (14:39 +1000)]
Don't include config.h in the public header

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: couple of minor documentation fixes
Peter Hutterer [Sat, 6 Jul 2013 00:27:10 +0000 (10:27 +1000)]
doc: couple of minor documentation fixes

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agodoc: css changes for gnome web
Peter Hutterer [Sat, 6 Jul 2013 00:26:54 +0000 (10:26 +1000)]
doc: css changes for gnome web

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11 years agoAdd a custom stylesheet to the documentation.
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>
11 years agoAdd documentation about the test suite
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>
11 years agotest: define a common device name
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>
11 years agotest: constify the input_absinfo argument
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>
11 years agotest: don't set the abs value when initializing an uinput device
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>
11 years agotest: fix up the tests to test for resolution now too
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>
11 years agotest: write resolution for uinput devices after creating the device
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>
11 years agodoc: tweak a few doxygen options, mainly to display the version
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>
11 years agoSome minor documentation fixes
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>
11 years agotest: add test for event values (type and code)
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>
11 years agotest: unify test case creation in test-event-names.c
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>
11 years agoAdd two helper functions to check event type/code
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>
11 years agoAdd a simple example to the documentation
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>
11 years agoIndent some documentation better
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>
11 years agoREADME: Drop the details, refer to documentation instead
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>
11 years agoSync the initial slot state from the device
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>
11 years agotest: add test for extracting the right slot values on startup
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>
11 years agotest: add a few sync test cases for incomplete syncs
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>
11 years agoIf we don't have anything to sync, don't add a EV_SYN event
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>
11 years agoSwitch to a state machine to handle incomplete syncs
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>
11 years agoAdd a flag for blocking read
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>
11 years agoIf the caller doesn't sync when it should, process all events regardless
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>
11 years agotest: add test for abs and mt syncing
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>
11 years agoDon't sync mt axes that don't exist
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>
11 years agotest: test for trying to enable invalid abs axis
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>
11 years agotest: add tests for mt event values
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>
11 years agotest: add tests for checking event values
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>
11 years agotest: add new helper function for absolute events
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>
11 years agotest: add test for filtered event delivery
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>
11 years agoDon't deliver events that are filtered
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>
11 years agoDisallow disabling of EV_SYN
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>
11 years agogitignore: add generated doxygen file
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>
11 years agotest: add test for changing kernel abs values
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>
11 years agoRequire data be NULL when enabling a non-EV_ABS axis
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>
11 years agotest: add test for getting abs axis data
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>
11 years agotest: copy absinfo over to the uinput_user_dev before creation
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>
11 years agotest: rename two loop variables to be more meaningful
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>
11 years agotest: move a block out of the inner loop
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>
11 years agotest: fix parameter name for uinput_device_set_abs_bit
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>
11 years agotest: add two more tests for enabling/disabling invalid events.
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>
11 years agodoc: set doxygen to quiet mode
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>
11 years agoAdd more documentation to stop complaints about undocumented members
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>