Correctly pass "absolute" flag to motion handlers

If our motion-type is MOTION_REL, we currently pass "2" as boolean value
to motion-handlers, which is wrong. Instead compare the source to
MOTION_ABS and correctly forward the boolean "absolute" flag.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Allocate xwii_iface early

We need a valid xwii_iface for further configurations to avoid caching
each value only to apply it afterwards. The newer libxwiimote library
creates only an offline interface. Hence, we don't cause any runtime
changes by allocating it early.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Initialize relative valuators

We need to report relative motion events if we use the gyro as motion
input. Therefore, initialize the relative valuators similar to the
absolute ones.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Fix error handling in xwiimote_init()

We no longer initialize the xwii_iface here so do not unref it during
error handling.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Add support for hotplug events

We now watch for device hotplug events. This allows plugging extensions
during runtime and we correctly initialize them.

We do this by re-opening all required interfaces on every hotplug event.
The xwiimote library handles this correctly internally, so we don't end
up closing and reopening the interfaces all the time.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Support motion+ based motion-input

Support MotionPlus input transformations that provide relative
mouse-movements. This still isn't perfect but is definitely better than
the accelerometer based interface.

(adjusted to new interface and minor additions)
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>