Install joystick-properties.h and xorg-joystick.pc for clients.

Let's clients be aware of properties made available by the driver.
This commit is contained in:
Sascha Hlusiak
2008-10-01 23:14:22 +02:00
parent 3c2a323a3a
commit 0da072fde4
8 changed files with 147 additions and 52 deletions

1
.gitignore vendored
View File

@@ -21,3 +21,4 @@ stamp-h1
xf86-input-joystick-*.tar.bz2
xf86-input-joystick-*.tar.gz
ChangeLog
*.pc

View File

@@ -19,7 +19,10 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src man config
SUBDIRS = src man config include
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xorg-joystick.pc
EXTRA_DIST = autogen.sh ChangeLog

View File

@@ -73,6 +73,7 @@ XORG_DRIVER_CHECK_EXT(XKB, kbproto)
PKG_CHECK_MODULES(XORG,
[xorg-server >= 1.3.99.901] xproto $REQUIRED_MODULES)
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
AC_SUBST(sdkdir)
CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
AC_SUBST([CFLAGS])
@@ -112,7 +113,12 @@ AC_HEADER_STDC
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
AC_OUTPUT([Makefile src/Makefile man/Makefile config/Makefile])
AC_OUTPUT([Makefile
src/Makefile
man/Makefile
config/Makefile
include/Makefile
xorg-joystick.pc])
echo
echo Building Linux joystick backend: $linux_backend

23
include/Makefile.am Normal file
View File

@@ -0,0 +1,23 @@
# Copyright 2008 Sascha Hlusiak
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
# SASCHA HLUSIAK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
EXTRA_DIST = joystick-properties.h
sdk_HEADERS = joystick-properties.h

View File

@@ -0,0 +1,96 @@
/*
* Copyright 2007-2008 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation, and that the name of Sascha Hlusiak not be used in
* advertising or publicity pertaining to distribution of the software without
* specific, written prior permission. Sascha Hlusiak makes no
* representations about the suitability of this software for any purpose. It
* is provided "as is" without express or implied warranty.
*
* SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
*/
#ifndef _JOYSTICK_PROPERTIES_
#define _JOYSTICK_PROPERTIES_
/**
* Properties exported by the joystick driver. These properties are
* recognized by the driver and will change its behavior when modified.
*/
/** Controls the verbosity of the driver */
/* 8 bit (0..20) */
#define JSTK_PROP_DEBUGLEVEL "Debug Level"
/** Number of buttons found on device */
/* 8 bit (0..MAXBUTTONS), read-only */
#define JSTK_PROP_NUMBUTTONS "Buttons"
/** Number of axes found on device */
/* 8 bit (0..MAXAXES), read-only */
#define JSTK_PROP_NUMAXES "Axes"
/** Generate pointer movement or button events */
/* 8 bit (0 or 1) */
#define JSTK_PROP_MOUSE_ENABLED "Generate Mouse Events"
/** Generate key events */
/* 8 bit (0 or 1) */
#define JSTK_PROP_KEYS_ENABLED "Generate Key Events"
/** Set the dead zone of each axis */
/* 32 bit (0..30000), for each axis*/
#define JSTK_PROP_AXIS_DEADZONE "Axis Deadzone"
/** Set axis type to none, byvalue, accelerated, absolute */
/* 8 bit, one of enum _JOYSTICKTYPE @ jstk.h per axis*/
#define JSTK_PROP_AXIS_TYPE "Axis Type"
/** Set mapping of axis to none, x, y, zx, zy, key */
/* 8 bit, one of enum _JOYSTICKMAPPING @ jstk.h per axis */
#define JSTK_PROP_AXIS_MAPPING "Axis Mapping"
/** Set movement factor of axis (default 1.0f) */
/* TODO float, movement amplify value per axis */
#define JSTK_PROP_AXIS_AMPLIFY "Axis Amplify"
/** Set KeySyms for axis in low position */
/* TODO 16 bit */
#define JSTK_PROP_AXIS_KEYS_LOW "Axis Keys (low)"
/** Set KeySyms for axis in high position */
/* TODO 16 bit */
#define JSTK_PROP_AXIS_KEYS_HIGH "Axis keys (high)"
/** Set the mapping of each button to
none, x, y, zx, zy, button, key, speed_multiply,
disable, disable_mouse, disable_keys */
/* 8 bit, one of enum _JOYSTICKMAPPING @ jstk.h per button */
#define JSTK_PROP_BUTTON_MAPPING "Button Mapping"
/** Set the logical button to report for this physical button */
/* 8 bit (0..32), logical button number per button */
#define JSTK_PROP_BUTTON_BUTTONNUMBER "Button Number"
/** Set amplify factor of button (default 1.0f) */
/* TODO float, button amplify value per button */
#define JSTK_PROP_BUTTON_AMPLIFY "Button Amplify"
/** Set KeySyms for button */
/* TODO 16 bit, set keysyms for button. Format: (button keysym1 keysym2 keysym3 keysym4) */
#define JSTK_PROP_BUTTON_KEYS "Button Keys"
#endif /* _JOYSTICK_PROPERTIES_ */

View File

@@ -28,6 +28,8 @@
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
@DRIVER_NAME@_drv_ladir = @inputdir@
INCLUDES=-I$(top_srcdir)/include/
@DRIVER_NAME@_drv_la_SOURCES = jstk.c jstk.h \
jstk_axis.c jstk_axis.h \
jstk_key.c jstk_key.h \

View File

@@ -38,66 +38,23 @@
#include "jstk.h"
#include "jstk_properties.h"
#include "joystick-properties.h" /* definitions of properties */
/* 8 bit, 0..20 */
#define JSTK_PROP_DEBUGLEVEL "Debug Level"
static Atom prop_debuglevel = 0;
/* 8 bit, 0..MAXBUTTONS */
#define JSTK_PROP_NUMBUTTONS "Buttons"
static Atom prop_numbuttons = 0;
/* 8 bit, 0..MAXAXES */
#define JSTK_PROP_NUMAXES "Axes"
static Atom prop_numaxes = 0;
/* 8 bit, 0 or 1 */
#define JSTK_PROP_MOUSE_ENABLED "Generate Mouse Events"
static Atom prop_mouse_enabled = 0;
/* 8 bit, 0 or 1 */
#define JSTK_PROP_KEYS_ENABLED "Generate Key Events"
static Atom prop_debuglevel = 0;
static Atom prop_numbuttons = 0;
static Atom prop_numaxes = 0;
static Atom prop_mouse_enabled = 0;
static Atom prop_keys_enabled = 0;
/* 32 bit, 0..30000 for each axis*/
#define JSTK_PROP_AXIS_DEADZONE "Axis Deadzone"
static Atom prop_axis_deadzone = 0;
/* 8 bit, one of enum _JOYSTICKTYPE @ jstk.h per axis*/
#define JSTK_PROP_AXIS_TYPE "Axis Type"
static Atom prop_axis_type = 0;
/* 8 bit, one of enum _JOYSTICKMAPPING @ jstk.h per axis */
#define JSTK_PROP_AXIS_MAPPING "Axis Mapping"
static Atom prop_axis_deadzone = 0;
static Atom prop_axis_type = 0;
static Atom prop_axis_mapping = 0;
/* float, movement amplify value per axis */
#define JSTK_PROP_AXIS_AMPLIFY "Axis Amplify"
static Atom prop_axis_amplify = 0;
/* 16 bit, set keysyms for low axis. Format: (axis keysym1 keysym2 keysym3 keysym4) */
#define JSTK_PROP_AXIS_KEYS_LOW "Axis Keys (low)"
static Atom prop_axis_keys_low = 0;
/* 16 bit, set keysyms for high axis. Format: (axis keysym1 keysym2 keysym3 keysym4) */
#define JSTK_PROP_AXIS_KEYS_HIGH "Axis keys (high)"
static Atom prop_axis_keys_high = 0;
/* 8 bit, one of enum _JOYSTICKMAPPING @ jstk.h per button */
#define JSTK_PROP_BUTTON_MAPPING "Button Mapping"
static Atom prop_button_mapping = 0;
/* 8 bit, logical button number per button */
#define JSTK_PROP_BUTTON_BUTTONNUMBER "Button Number"
static Atom prop_button_buttonnumber = 0;
/* float, button amplify value per button */
#define JSTK_PROP_BUTTON_AMPLIFY "Button Amplify"
static Atom prop_button_amplify = 0;
/* 16 bit, set keysyms for button. Format: (button keysym1 keysym2 keysym3 keysym4) */
#define JSTK_PROP_BUTTON_KEYS "Button Keys"
static Atom prop_button_keys = 0;

7
xorg-joystick.pc.in Normal file
View File

@@ -0,0 +1,7 @@
prefix=@prefix@
includedir=@includedir@
Name: xorg-joystick
Description: X.Org joystick input driver.
Version: @PACKAGE_VERSION@
Cflags: -I${includedir}