From ee3c818621f72439c54356afaa3a0b35dc9c4c25 Mon Sep 17 00:00:00 2001 From: Ryan Huffman Date: Mon, 8 Jun 2009 20:41:23 -0700 Subject: [PATCH] Initial skeleton structure --- COPYING | 8 ++++ Makefile.am | 40 +++++++++++++++++ README | 12 ++++++ autogen.sh | 12 ++++++ configure.ac | 84 ++++++++++++++++++++++++++++++++++++ man/Makefile.am | 57 ++++++++++++++++++++++++ man/tuio.man | 33 ++++++++++++++ src/Makefile.am | 37 ++++++++++++++++ src/tuio.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/tuio.h | 35 +++++++++++++++ xorg-tuio.pc.in | 6 +++ 11 files changed, 455 insertions(+) create mode 100644 COPYING create mode 100644 Makefile.am create mode 100644 README create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 man/Makefile.am create mode 100644 man/tuio.man create mode 100644 src/Makefile.am create mode 100644 src/tuio.c create mode 100644 src/tuio.h create mode 100644 xorg-tuio.pc.in diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..573e0c5 --- /dev/null +++ b/COPYING @@ -0,0 +1,8 @@ +This is a stub file. This package has not yet had its complete licensing +information compiled. Please see the individual source files for details on +your rights to use and modify this software. + +All licensing questions regarding this software should be directed at the +NUI Group TUIO Driver Project: + +http://nuicode.com/projects/gsoc-mpx diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..be5e3ab --- /dev/null +++ b/Makefile.am @@ -0,0 +1,40 @@ +# Copyright 2005 Adam Jackson. +# +# 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 +# ADAM JACKSON 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. + +AUTOMAKE_OPTIONS = foreign + +# Ensure headers are installed below $(prefix) for distcheck +DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg' + +SUBDIRS = src man + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = xorg-tuio.pc + +EXTRA_DIST = ChangeLog + +MAINTAINERCLEANFILES=ChangeLog + +.PHONY: ChangeLog + +ChangeLog: + $(CHANGELOG_CMD) + +dist-hook: ChangeLog diff --git a/README b/README new file mode 100644 index 0000000..798463e --- /dev/null +++ b/README @@ -0,0 +1,12 @@ +xf86-input-tuio - Linux input driver for use with TUIO devices + +NOTE: This driver is still being developed and is not yet usable + +Please submit bugs & patches to the NUI Group MPX TUIO Driver project page: + + http://nuicode.com/projects/gsoc-mpx + (Create a new task) + +Currently, the development code can be found at: + + git://repo.or.cz/xf86-input-tuio.git diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..904cd67 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir + +autoreconf -v --install || exit 1 +cd $ORIGDIR || exit $? + +$srcdir/configure --enable-maintainer-mode "$@" diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..6325dca --- /dev/null +++ b/configure.ac @@ -0,0 +1,84 @@ +# Copyright 2005 Adam Jackson. +# +# 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 +# ADAM JACKSON 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. +# +# Process this file with autoconf to produce a configure script + +AC_PREREQ(2.57) +AC_INIT([xf86-input-tuio], + 0.0.1, + [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], + xf86-input-tuio) + +AC_CONFIG_SRCDIR([Makefile.am]) +AC_CONFIG_AUX_DIR(.) +AM_INIT_AUTOMAKE([dist-bzip2]) + +AM_MAINTAINER_MODE + +# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG +m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.2) +AM_CONFIG_HEADER([config.h]) + +# Checks for programs. +AC_DISABLE_STATIC +AC_PROG_LIBTOOL +AC_PROG_CC +AC_PROG_CXX +XORG_CWARNFLAGS + +AH_TOP([#include "xorg-server.h"]) + +AC_ARG_WITH(xorg-module-dir, + AC_HELP_STRING([--with-xorg-module-dir=DIR], + [Default xorg module directory [[default=$libdir/xorg/modules]]]), + [moduledir="$withval"], + [moduledir="$libdir/xorg/modules"]) +inputdir=${moduledir}/input +AC_SUBST(inputdir) + +# Checks for extensions +XORG_DRIVER_CHECK_EXT(XINPUT, inputproto) + +# Checks for pkg-config packages. We need to be able to override sdkdir +# to satisfy silly distcheck requirements. +PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES) +XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS" +AC_ARG_WITH([sdkdir], [], + [sdkdir="$withval"], + [sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`]) +AC_SUBST([sdkdir]) + +# Checks for libraries. + +# Checks for header files. +AC_HEADER_STDC + +DRIVER_NAME=tuio +AC_SUBST([DRIVER_NAME]) + +XORG_MANPAGE_SECTIONS +XORG_RELEASE_VERSION +XORG_CHANGELOG + +AC_OUTPUT([Makefile + src/Makefile + man/Makefile + xorg-tuio.pc]) diff --git a/man/Makefile.am b/man/Makefile.am new file mode 100644 index 0000000..276f2f0 --- /dev/null +++ b/man/Makefile.am @@ -0,0 +1,57 @@ +# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# +# 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. +# +# The above copyright notice and this permission notice 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 NONINFRINGEMENT. +# IN NO EVENT SHALL THE OPEN GROUP 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. +# +# Except as contained in this notice, the name of the copyright holders shall +# not be used in advertising or otherwise to promote the sale, use or +# other dealings in this Software without prior written authorization +# from the copyright holders. +# + +drivermandir = $(DRIVER_MAN_DIR) + +driverman_PRE = @DRIVER_NAME@.man + +driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@) + +EXTRA_DIST = @DRIVER_NAME@.man + +CLEANFILES = $(driverman_DATA) + +SED = sed + +# Strings to replace in man pages +XORGRELSTRING = @PACKAGE_STRING@ + XORGMANNAME = X Version 11 + +MAN_SUBSTS = \ + -e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \ + -e 's|__xservername__|Xorg|g' \ + -e 's|__xconfigfile__|xorg.conf|g' \ + -e 's|__projectroot__|$(prefix)|g' \ + -e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \ + -e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \ + -e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \ + -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ + -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' + +SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man + +.man.$(DRIVER_MAN_SUFFIX): + sed $(MAN_SUBSTS) < $< > $@ diff --git a/man/tuio.man b/man/tuio.man new file mode 100644 index 0000000..a7970a6 --- /dev/null +++ b/man/tuio.man @@ -0,0 +1,33 @@ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH TUIO __drivermansuffix__ __vendorversion__ +.SH NAME +tuio \- Multitouch TUIO Linux input driver +.SH SYNOPSIS +.nf +.B "Section \*qInputDevice\*q" +\ \ ... +.B EndSection +.fi +.SH DESCRIPTION +.B tuio +is an __xservername__ input driver. +.PP +.SH SUPPORTED HARDWARE +TODO +.PP +.SH CONFIGURATION DETAILS +TODO +.PP +.SH SUPPORTED PROPERTIES +The following properties are provided by the +.B tuio +driver. + +TODO + +.SH AUTHORS +Ryan Huffman +.SH "SEE ALSO" +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), +. diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..39d1ae8 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,37 @@ +# Copyright 2005 Adam Jackson. +# +# 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 +# ADAM JACKSON 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. + + +# this is obnoxious: +# -module lets us name the module exactly how we want +# -avoid-version prevents gratuitous .0.0.0 version numbers on the end +# _ladir passes a dummy rpath to libtool so the thing will actually link +# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. +AM_CFLAGS = $(XORG_CFLAGS) + +@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la +@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version +@DRIVER_NAME@_drv_ladir = @inputdir@ + +INCLUDES=-I$(top_srcdir)/include/ + +@DRIVER_NAME@_drv_la_SOURCES = @DRIVER_NAME@.c \ + @DRIVER_NAME@.h + diff --git a/src/tuio.c b/src/tuio.c new file mode 100644 index 0000000..d6e4724 --- /dev/null +++ b/src/tuio.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2009 Ryan Huffman + * + * 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 the rights + * to use, copy, modify, merge, publish, distribute, sublicense, 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 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 NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS 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. + * + * Authors: + * Ryan Huffman (ryanhuffman@gmail.com) + */ + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "tuio.h" + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +/* Module Functions */ +static pointer +TuioPlug(pointer, pointer, int *, int *); + +static void +TuioUnplug(pointer); + +/* Driver Function */ +static InputInfoPtr +TuioPreInit(InputDriverPtr drv, IDevPtr dev, int flags); + +static XF86ModuleVersionInfo TuioVersionRec = +{ + "tuio", + MODULEVENDORSTRING, + MODINFOSTRING1, + MODINFOSTRING2, + XORG_VERSION_CURRENT, + PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL, + ABI_CLASS_XINPUT, + ABI_XINPUT_VERSION, + MOD_CLASS_XINPUT, + {0, 0, 0, 0} +}; + +_X_EXPORT InputDriverRec TUIO = +{ + 1, + "tuio", + NULL, + TuioPreInit, + TuioUnInit, + NULL, + 0 +}; + +_X_EXPORT XF86ModuleData tuioModuleData = +{ + &TuioVersionRec, + TuioPlug, + TuioUnplug +}; + +static pointer +TuioPlug(pointer module, + pointer options, + int *errmaj, + int *errmin) +{ + xf86AddInputDriver(&TUIO, module, 0); + return module; +} + +static void +TuioUnplug(pointer p) +{ +} + +static void +TuioReadInput(InputInfoPtr pInfo) +{ +} + +static int +TuioControl(DeviceIntPtr device, int what) +{ + return 1; +} + +static InputInfoPtr +TuioPreInit(InputDriverPtr drv, IDevPtr dev, int flags) +{ + InputInfoPtr pInfo; + const char *device; + + if (!(pInfo = xf86AllocateInput(drv, 0))) + return NULL; + + return pInfo; +} + +static void +TuioUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) +{ +} + diff --git a/src/tuio.h b/src/tuio.h new file mode 100644 index 0000000..d011969 --- /dev/null +++ b/src/tuio.h @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2009 Ryan Huffman + * + * 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 the rights + * to use, copy, modify, merge, publish, distribute, sublicense, 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 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 NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS 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. + * + * Authors: + * Ryan Huffman (ryanhuffman@gmail.com) + */ + +#ifndef TUIO_H +#define TUIO_H + +#include +#include +#include +#include + +#endif + diff --git a/xorg-tuio.pc.in b/xorg-tuio.pc.in new file mode 100644 index 0000000..9a3f365 --- /dev/null +++ b/xorg-tuio.pc.in @@ -0,0 +1,6 @@ +sdkdir=@sdkdir@ + +Name: xorg-tuio +Description: X.Org TUIO input driver. +Version: @PACKAGE_VERSION@ +Cflags: -I${sdkdir} -- 2.11.4.GIT