Code cleanup.
- separated hotplug functionality from device driver for USB devices
- factored out common code to minimize redundancy for different platforms (linux/freebsd)
- created an internal "device" data type to allow handling both USB and serial devices
  transparently without conditions everywhere.

Also fixed a minor performance bug. If there is no device plugged in, the repeat interval is ignored.


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@139 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
now spacenavd should compile and be completely usable for serial devices on any platform


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@140 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
Abort running if another spacenavd instance is already running. The detection
is robust even in the case of a stale pidfile.



git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@141 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
Fixed bug #3512076 by placing #include "proto_x11.h" inside a USE_X11 ifdef block


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@142 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
Added DESTDIR to the makefile, see bug #3512087


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@143 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
Added DESTDIR to the makefile by applying Anthoine Bourgeois' patch. See bug #3512087


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@144 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
- added -L/usr/X11/lib to the generated X link line in configure
- fixed a couple of annoying warnings in dummy_usb.c
- in spnavd.c I forgot to include string.h
- fixed a typo in xdetect_freebsd.c and made it compile on MacOSX too


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@145 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
starting preliminary work on macosx port


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@146 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
fixed a bug in libspnav which made it impossible to close and reopen the
connection to spacenavd. Reported by Andreas Hermann.



git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@147 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
forgot a close call


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@148 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
started merging the serial magellan code


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@149 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
added contrib directory for unmaintained 3rd party contributions, starting with
Richard Shaw's and John Morris' systemd unit file from Fedora.



git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@150 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
added spnavcfg.desktop file along with the icons


git-svn-id: https://spacenav.svn.sourceforge.net/svnroot/spacenav@151 9acbd7d0-4e34-0410-9de4-80efa1d9a8fd
merged Ralf Morel's patch for multiple device support



git-svn-id: https://svn.code.sf.net/p/spacenav/code/@152 ef983eb1-d774-4af8-acfd-baaf7b16a646
beefed up the error handling and logging around the XAUTHORITY setup, and added the possibility of using the HOME env var as a fallback


git-svn-id: https://svn.code.sf.net/p/spacenav/code/@153 ef983eb1-d774-4af8-acfd-baaf7b16a646
added missing include in smag_comm.c


git-svn-id: https://svn.code.sf.net/p/spacenav/code/@154 ef983eb1-d774-4af8-acfd-baaf7b16a646
fixed an off-by-one error introduced in the latest commit which broke the main
device detection routine and fell back unto the alternative device detection.



git-svn-id: https://svn.code.sf.net/p/spacenav/code/@155 ef983eb1-d774-4af8-acfd-baaf7b16a646
Fixed a bug introduced with the multi-device support patch. device->close()
would not be called when removing devices any more muldi-device patch was
applied). This would leave LEDs on when shutting down spacenavd.

Also simplified the code in some places



git-svn-id: https://svn.code.sf.net/p/spacenav/code/@156 ef983eb1-d774-4af8-acfd-baaf7b16a646
- implemented more elaborate device selection with a predicate callback
- added the ability to specify a list of USB device IDs in the configuration
  file, for non-standard devices to be handled by spacenavd (such as joysticks).
- added joystick support on linux. Joysticks are not claimed by default unless
  listed in the device-id config option.



git-svn-id: https://svn.code.sf.net/p/spacenav/code/@157 ef983eb1-d774-4af8-acfd-baaf7b16a646
- removed unnecessary devjs handler. Joysticks can be used as regular HID devices
- fixed axis range mapping for various HID devices
- fixed device detection which would pick up any logitech device instead of just 3Dconnexion ones


git-svn-id: https://svn.code.sf.net/p/spacenav/code/@158 ef983eb1-d774-4af8-acfd-baaf7b16a646