xwiishow: simplify LED handling

Merge LED-handling so we don't duplicate if for each of the 3 LEDs.

Signed-off-by: Nicolas.Adenis-Lamarre <nicolas.adenis.lamarre@gmail.com>
Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
xwiishow: fix mp-stabilizer

We need to compare the actualy reported values during mp-stabilization,
not the offsets.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
xwiishow: draw mp+ based cursor

Draw a small rectangle with an mp+ controlled cursor. To use it, hold the
wiimote upwards, press 's' to recalibrate and then use rotation for
relative movement.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
xwiishow: add hint about 's' modifier

Add hint that 's' recalibrates the wiimote.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
lib: add xwii_iface_get_syspath() helper

This helper returns the syspath of a device. It is not neccesarily the
path passed during creation. Instead, it's the real device path (symlinks
resolved).

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
lib: watch for device-removal events

Additionally to hotplug events, we now explicitly watch for device-removal
events. This allows applications to detect device-removal more reasily
than waiting for HUP/ERR on any fd.

Device-removal is now reported as XWII_EVENT_GONE if enabled via
xwii_iface_watch().

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
xwiishow: handle XWII_EVENT_GONE events

Watch for device-removal events and stop dispatching events then. Keep
xwiishow open, though. Users might still be interested in messages that
arrived shortly before the device-removal.

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