Move java source files to gradle project layout and delete obsolete files

This commit is contained in:
2014-11-29 13:26:31 +00:00
parent d6fb64af87
commit d8f4fd4634
70 changed files with 0 additions and 3212 deletions

View File

@@ -1,68 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Created by Herkules.
-->
<project basedir="." default="all" name="jxinput">
<target name="init">
<property name="srcdir" value="../java"/>
<property name="dstdir" value="../build"/>
<property name="tmpdir" value="../tmp"/>
<property name="classesdir" value="../classes"/>
<property name="docdir" value="${dstdir}/javadoc"/>
<property name="jarfile" value="${dstdir}/jxinput.jar"/>
</target>
<target depends="init" name="compile">
<mkdir dir="${classesdir}"/>
<javac debug="true" deprecation="true" destdir="${classesdir}" srcdir="${srcdir}">
<classpath>
<pathelement location="../../third-party/java3d/win32/lib/ext/j3dcore.jar"/>
<pathelement location="../../third-party/java3d/win32/lib/ext/j3dutils.jar"/>
<pathelement location="../../third-party/java3d/win32/lib/ext/vecmath.jar"/>
</classpath>
</javac>
</target>
<target depends="init,compile" name="jar">
<mkdir dir="${dstdir}"/>
<jar basedir="${classesdir}" compress="true" jarfile="${jarfile}"/>
</target>
<!-- <target depends="init,all" description="Try running it." name="test">
<java classname="com.foo.Main" failonerror="true" fork="true">
<classpath>
<pathelement location="."/>
</classpath>
<arg value="-myfile"/>
<arg file="myfile.txt"/>
</java>
</target>
-->
<target depends="init" description="Javadoc for my API." name="javadoc">
<mkdir dir="${docdir}"/>
<javadoc destdir="${docdir}" sourcepath="${srcdir}" packagenames="*">
</javadoc>
</target>
<!--
Clean expects that the jxinput.dll is compiled into the dstdir
and may NOT be deleted!
-->
<target depends="init" description="Clean all build products." name="clean">
<delete>
<fileset dir="${dstdir}" includes="**/*" excludes="**/*.dll"/>
</delete>
<delete dir="${tmpdir}"/>
</target>
<target depends="init,jar" description="Build everything." name="all">
<echo message="Application built."/>
</target>
</project>

View File

@@ -1,2 +0,0 @@
build
dist

View File

@@ -1,69 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- You may freely edit this file. See commented blocks below for -->
<!-- some examples of how to customize the build. -->
<!-- (If you delete it and reopen the project it will be recreated.) -->
<project name="jxinput" default="default" basedir=".">
<description>Builds, tests, and runs the project jxinput.</description>
<import file="nbproject/build-impl.xml"/>
<!--
There exist several targets which are by default empty and which can be
used for execution of your tasks. These targets are usually executed
before and after some main targets. They are:
-pre-init: called before initialization of project properties
-post-init: called after initialization of project properties
-pre-compile: called before javac compilation
-post-compile: called after javac compilation
-pre-compile-single: called before javac compilation of single file
-post-compile-single: called after javac compilation of single file
-pre-compile-test: called before javac compilation of JUnit tests
-post-compile-test: called after javac compilation of JUnit tests
-pre-compile-test-single: called before javac compilation of single JUnit test
-post-compile-test-single: called after javac compilation of single JUunit test
-pre-jar: called before JAR building
-post-jar: called after JAR building
-post-clean: called after cleaning build products
(Targets beginning with '-' are not intended to be called on their own.)
Example of inserting an obfuscator after compilation could look like this:
<target name="-post-compile">
<obfuscate>
<fileset dir="${build.classes.dir}"/>
</obfuscate>
</target>
For list of available properties check the imported
nbproject/build-impl.xml file.
Another way to customize the build is by overriding existing main targets.
The targets of interest are:
-init-macrodef-javac: defines macro for javac compilation
-init-macrodef-junit: defines macro for junit execution
-init-macrodef-debug: defines macro for class debugging
-init-macrodef-java: defines macro for class execution
-do-jar-with-manifest: JAR building (if you are using a manifest)
-do-jar-without-manifest: JAR building (if you are not using a manifest)
run: execution of project
-javadoc-build: Javadoc generation
test-report: JUnit report generation
An example of overriding the target for project execution could look like this:
<target name="run" depends="jxinput-impl.jar">
<exec dir="bin" executable="launcher.exe">
<arg file="${dist.jar}"/>
</exec>
</target>
Notice that the overridden target depends on the jar target and not only on
the compile target as the regular run target does. Again, for a list of available
properties which you can use, check the target you are overriding in the
nbproject/build-impl.xml file.
-->
</project>

View File

@@ -1,3 +0,0 @@
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build

View File

@@ -1 +0,0 @@
private

View File

@@ -1,532 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
*** GENERATED FROM project.xml - DO NOT EDIT ***
*** EDIT ../build.xml INSTEAD ***
For the purpose of easier reading the script
is divided into following sections:
- initialization
- compilation
- jar
- execution
- debugging
- javadoc
- junit compilation
- junit execution
- junit debugging
- applet
- cleanup
-->
<project name="jxinput-impl" default="default" basedir=".." xmlns:j2seproject3="http://www.netbeans.org/ns/j2se-project/3" xmlns:j2seproject2="http://www.netbeans.org/ns/j2se-project/2" xmlns:j2seproject1="http://www.netbeans.org/ns/j2se-project/1">
<target name="default" depends="test,jar,javadoc" description="Build and test whole project."/>
<!--
======================
INITIALIZATION SECTION
======================
-->
<target name="-pre-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-init-private" depends="-pre-init">
<property file="nbproject/private/private.properties"/>
</target>
<target name="-init-user" depends="-pre-init,-init-private">
<property file="${user.properties.file}"/>
<!-- The two properties below are usually overridden -->
<!-- by the active platform. Just a fallback. -->
<property name="default.javac.source" value="1.4"/>
<property name="default.javac.target" value="1.4"/>
</target>
<target name="-init-project" depends="-pre-init,-init-private,-init-user">
<property file="nbproject/project.properties"/>
</target>
<target name="-do-init" depends="-pre-init,-init-private,-init-user,-init-project,-init-macrodef-property">
<available file="${manifest.file}" property="manifest.available"/>
<condition property="manifest.available+main.class">
<and>
<isset property="manifest.available"/>
<isset property="main.class"/>
<not>
<equals arg1="${main.class}" arg2="" trim="true"/>
</not>
</and>
</condition>
<condition property="manifest.available+main.class+mkdist.available">
<and>
<istrue value="${manifest.available+main.class}"/>
<isset property="libs.CopyLibs.classpath"/>
</and>
</condition>
<condition property="have.tests">
<or/>
</condition>
<condition property="have.sources">
<or>
<available file="${src.dir}"/>
</or>
</condition>
<condition property="netbeans.home+have.tests">
<and>
<isset property="netbeans.home"/>
<isset property="have.tests"/>
</and>
</condition>
<condition property="no.javadoc.preview">
<isfalse value="${javadoc.preview}"/>
</condition>
<property name="run.jvmargs" value=""/>
<property name="javac.compilerargs" value=""/>
<property name="work.dir" value="${basedir}"/>
<condition property="no.deps">
<and>
<istrue value="${no.dependencies}"/>
</and>
</condition>
<property name="javac.debug" value="true"/>
<property name="javadoc.preview" value="true"/>
</target>
<target name="-post-init">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-init-check" depends="-pre-init,-init-private,-init-user,-init-project,-do-init">
<fail unless="src.dir">Must set src.dir</fail>
<fail unless="build.dir">Must set build.dir</fail>
<fail unless="dist.dir">Must set dist.dir</fail>
<fail unless="build.classes.dir">Must set build.classes.dir</fail>
<fail unless="dist.javadoc.dir">Must set dist.javadoc.dir</fail>
<fail unless="build.test.classes.dir">Must set build.test.classes.dir</fail>
<fail unless="build.test.results.dir">Must set build.test.results.dir</fail>
<fail unless="build.classes.excludes">Must set build.classes.excludes</fail>
<fail unless="dist.jar">Must set dist.jar</fail>
</target>
<target name="-init-macrodef-property">
<macrodef name="property" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="name"/>
<attribute name="value"/>
<sequential>
<property name="@{name}" value="${@{value}}"/>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-javac">
<macrodef name="javac" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute name="srcdir" default="${src.dir}"/>
<attribute name="destdir" default="${build.classes.dir}"/>
<attribute name="classpath" default="${javac.classpath}"/>
<attribute name="debug" default="${javac.debug}"/>
<element name="customize" optional="true"/>
<sequential>
<javac srcdir="@{srcdir}" destdir="@{destdir}" debug="@{debug}" deprecation="${javac.deprecation}" source="${javac.source}" target="${javac.target}" includeantruntime="false">
<classpath>
<path path="@{classpath}"/>
</classpath>
<compilerarg line="${javac.compilerargs}"/>
<customize/>
</javac>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-junit">
<macrodef name="junit" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute name="includes" default="**/*Test.java"/>
<sequential>
<junit showoutput="true" fork="true" dir="${basedir}" failureproperty="tests.failed" errorproperty="tests.failed">
<batchtest todir="${build.test.results.dir}"/>
<classpath>
<path path="${run.test.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="test-sys-prop."/>
<mapper type="glob" from="test-sys-prop.*" to="*"/>
</syspropertyset>
<formatter type="brief" usefile="false"/>
<formatter type="xml"/>
<jvmarg line="${run.jvmargs}"/>
</junit>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-nbjpda">
<macrodef name="nbjpdastart" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="name" default="${main.class}"/>
<attribute name="classpath" default="${debug.classpath}"/>
<attribute name="stopclassname" default=""/>
<sequential>
<nbjpdastart transport="dt_socket" addressproperty="jpda.address" name="@{name}" stopclassname="@{stopclassname}">
<classpath>
<path path="@{classpath}"/>
</classpath>
</nbjpdastart>
</sequential>
</macrodef>
<macrodef name="nbjpdareload" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="dir" default="${build.classes.dir}"/>
<sequential>
<nbjpdareload>
<fileset includes="${fix.includes}*.class" dir="@{dir}"/>
</nbjpdareload>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-debug">
<macrodef name="debug" uri="http://www.netbeans.org/ns/j2se-project/3">
<attribute name="classname" default="${main.class}"/>
<attribute name="classpath" default="${debug.classpath}"/>
<element name="customize" optional="true"/>
<sequential>
<java fork="true" classname="@{classname}" dir="${work.dir}">
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xnoagent"/>
<jvmarg value="-Djava.compiler=none"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
<jvmarg line="${run.jvmargs}"/>
<classpath>
<path path="@{classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper type="glob" from="run-sys-prop.*" to="*"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-macrodef-java">
<macrodef name="java" uri="http://www.netbeans.org/ns/j2se-project/1">
<attribute name="classname" default="${main.class}"/>
<element name="customize" optional="true"/>
<sequential>
<java fork="true" classname="@{classname}" dir="${work.dir}">
<jvmarg line="${run.jvmargs}"/>
<classpath>
<path path="${run.classpath}"/>
</classpath>
<syspropertyset>
<propertyref prefix="run-sys-prop."/>
<mapper type="glob" from="run-sys-prop.*" to="*"/>
</syspropertyset>
<customize/>
</java>
</sequential>
</macrodef>
</target>
<target name="-init-presetdef-jar">
<presetdef name="jar" uri="http://www.netbeans.org/ns/j2se-project/1">
<jar jarfile="${dist.jar}" compress="${jar.compress}">
<j2seproject1:fileset dir="${build.classes.dir}"/>
</jar>
</presetdef>
</target>
<target name="init" depends="-pre-init,-init-private,-init-user,-init-project,-do-init,-post-init,-init-check,-init-macrodef-property,-init-macrodef-javac,-init-macrodef-junit,-init-macrodef-nbjpda,-init-macrodef-debug,-init-macrodef-java,-init-presetdef-jar"/>
<!--
===================
COMPILATION SECTION
===================
-->
<target name="deps-jar" depends="init" unless="no.deps"/>
<target name="-pre-pre-compile" depends="init,deps-jar">
<mkdir dir="${build.classes.dir}"/>
</target>
<target name="-pre-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile" if="have.sources">
<j2seproject3:javac/>
<copy todir="${build.classes.dir}">
<fileset dir="${src.dir}" excludes="${build.classes.excludes}"/>
</copy>
</target>
<target name="-post-compile">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile" depends="init,deps-jar,-pre-pre-compile,-pre-compile,-do-compile,-post-compile" description="Compile project."/>
<target name="-pre-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile-single" depends="init,deps-jar,-pre-pre-compile">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<j2seproject3:javac>
<customize>
<patternset includes="${javac.includes}"/>
</customize>
</j2seproject3:javac>
</target>
<target name="-post-compile-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile-single" depends="init,deps-jar,-pre-pre-compile,-pre-compile-single,-do-compile-single,-post-compile-single"/>
<!--
====================
JAR BUILDING SECTION
====================
-->
<target name="-pre-pre-jar" depends="init">
<dirname property="dist.jar.dir" file="${dist.jar}"/>
<mkdir dir="${dist.jar.dir}"/>
</target>
<target name="-pre-jar">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-jar-without-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" unless="manifest.available">
<j2seproject1:jar/>
</target>
<target name="-do-jar-with-manifest" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available" unless="manifest.available+main.class">
<j2seproject1:jar manifest="${manifest.file}"/>
</target>
<target name="-do-jar-with-mainclass" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class" unless="manifest.available+main.class+mkdist.available">
<j2seproject1:jar manifest="${manifest.file}">
<j2seproject1:manifest>
<j2seproject1:attribute name="Main-Class" value="${main.class}"/>
</j2seproject1:manifest>
</j2seproject1:jar>
<echo>To run this application from the command line without Ant, try:</echo>
<property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
<property name="dist.jar.resolved" location="${dist.jar}"/>
<pathconvert property="run.classpath.with.dist.jar">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to="${dist.jar.resolved}"/>
</pathconvert>
<echo>java -cp "${run.classpath.with.dist.jar}" ${main.class}</echo>
</target>
<target name="-do-jar-with-libraries" depends="init,compile,-pre-pre-jar,-pre-jar" if="manifest.available+main.class+mkdist.available">
<property name="build.classes.dir.resolved" location="${build.classes.dir}"/>
<pathconvert property="run.classpath.without.build.classes.dir">
<path path="${run.classpath}"/>
<map from="${build.classes.dir.resolved}" to=""/>
</pathconvert>
<pathconvert property="jar.classpath" pathsep=" ">
<path path="${run.classpath.without.build.classes.dir}"/>
<chainedmapper>
<flattenmapper/>
<globmapper from="*" to="lib/*"/>
</chainedmapper>
</pathconvert>
<taskdef classname="org.netbeans.modules.java.j2seproject.copylibstask.CopyLibs" name="copylibs" classpath="${libs.CopyLibs.classpath}"/>
<copylibs manifest="${manifest.file}" runtimeclasspath="${run.classpath.without.build.classes.dir}" jarfile="${dist.jar}" compress="${jar.compress}">
<fileset dir="${build.classes.dir}"/>
<manifest>
<attribute name="Main-Class" value="${main.class}"/>
<attribute name="Class-Path" value="${jar.classpath}"/>
</manifest>
</copylibs>
<echo>To run this application from the command line without Ant, try:</echo>
<property name="dist.jar.resolved" location="${dist.jar}"/>
<echo>java -jar "${dist.jar.resolved}"</echo>
</target>
<target name="-post-jar">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="jar" depends="init,compile,-pre-jar,-do-jar-with-manifest,-do-jar-without-manifest,-do-jar-with-mainclass,-do-jar-with-libraries,-post-jar" description="Build JAR."/>
<!--
=================
EXECUTION SECTION
=================
-->
<target name="run" depends="init,compile" description="Run a main class.">
<j2seproject1:java>
<customize>
<arg line="${application.args}"/>
</customize>
</j2seproject1:java>
</target>
<target name="run-single" depends="init,compile-single">
<fail unless="run.class">Must select one file in the IDE or set run.class</fail>
<j2seproject1:java classname="${run.class}"/>
</target>
<!--
=================
DEBUGGING SECTION
=================
-->
<target name="-debug-start-debugger" if="netbeans.home" depends="init">
<j2seproject1:nbjpdastart name="${debug.class}"/>
</target>
<target name="-debug-start-debuggee" depends="init,compile">
<j2seproject3:debug>
<customize>
<arg line="${application.args}"/>
</customize>
</j2seproject3:debug>
</target>
<target name="debug" if="netbeans.home" depends="init,compile,-debug-start-debugger,-debug-start-debuggee" description="Debug project in IDE."/>
<target name="-debug-start-debugger-stepinto" if="netbeans.home" depends="init">
<j2seproject1:nbjpdastart stopclassname="${main.class}"/>
</target>
<target name="debug-stepinto" if="netbeans.home" depends="init,compile,-debug-start-debugger-stepinto,-debug-start-debuggee"/>
<target name="-debug-start-debuggee-single" if="netbeans.home" depends="init,compile-single">
<fail unless="debug.class">Must select one file in the IDE or set debug.class</fail>
<j2seproject3:debug classname="${debug.class}"/>
</target>
<target name="debug-single" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-single"/>
<target name="-pre-debug-fix" depends="init">
<fail unless="fix.includes">Must set fix.includes</fail>
<property name="javac.includes" value="${fix.includes}.java"/>
</target>
<target name="-do-debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,compile-single">
<j2seproject1:nbjpdareload/>
</target>
<target name="debug-fix" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix"/>
<!--
===============
JAVADOC SECTION
===============
-->
<target name="-javadoc-build" depends="init">
<mkdir dir="${dist.javadoc.dir}"/>
<javadoc destdir="${dist.javadoc.dir}" source="${javac.source}" notree="${javadoc.notree}" use="${javadoc.use}" nonavbar="${javadoc.nonavbar}" noindex="${javadoc.noindex}" splitindex="${javadoc.splitindex}" author="${javadoc.author}" version="${javadoc.version}" windowtitle="${javadoc.windowtitle}" private="${javadoc.private}" additionalparam="${javadoc.additionalparam}" failonerror="true" useexternalfile="true">
<classpath>
<path path="${javac.classpath}"/>
</classpath>
<sourcepath>
<pathelement location="${src.dir}"/>
</sourcepath>
<packageset dir="${src.dir}" includes="*/**"/>
<fileset dir="${src.dir}" includes="*.java"/>
</javadoc>
</target>
<target name="-javadoc-browse" if="netbeans.home" unless="no.javadoc.preview" depends="init,-javadoc-build">
<nbbrowse file="${dist.javadoc.dir}/index.html"/>
</target>
<target name="javadoc" depends="init,-javadoc-build,-javadoc-browse" description="Build Javadoc."/>
<!--
=========================
JUNIT COMPILATION SECTION
=========================
-->
<target name="-pre-pre-compile-test" if="have.tests" depends="init,compile">
<mkdir dir="${build.test.classes.dir}"/>
</target>
<target name="-pre-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile-test" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test">
<j2seproject3:javac srcdir="" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}"/>
<copy todir="${build.test.classes.dir}"/>
</target>
<target name="-post-compile-test">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile-test" depends="init,compile,-pre-pre-compile-test,-pre-compile-test,-do-compile-test,-post-compile-test"/>
<target name="-pre-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="-do-compile-test-single" if="have.tests" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single">
<fail unless="javac.includes">Must select some files in the IDE or set javac.includes</fail>
<j2seproject3:javac srcdir="" destdir="${build.test.classes.dir}" debug="true" classpath="${javac.test.classpath}">
<customize>
<patternset includes="${javac.includes}"/>
</customize>
</j2seproject3:javac>
<copy todir="${build.test.classes.dir}"/>
</target>
<target name="-post-compile-test-single">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="compile-test-single" depends="init,compile,-pre-pre-compile-test,-pre-compile-test-single,-do-compile-test-single,-post-compile-test-single"/>
<!--
=======================
JUNIT EXECUTION SECTION
=======================
-->
<target name="-pre-test-run" if="have.tests" depends="init">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target name="-do-test-run" if="have.tests" depends="init,compile-test,-pre-test-run">
<j2seproject3:junit/>
</target>
<target name="-post-test-run" if="have.tests" depends="init,compile-test,-pre-test-run,-do-test-run">
<fail if="tests.failed">Some tests failed; see details above.</fail>
</target>
<target name="test-report" if="have.tests" depends="init"/>
<target name="-test-browse" if="netbeans.home+have.tests" depends="init"/>
<target name="test" depends="init,compile-test,-pre-test-run,-do-test-run,test-report,-post-test-run,-test-browse" description="Run unit tests."/>
<target name="-pre-test-run-single" if="have.tests" depends="init">
<mkdir dir="${build.test.results.dir}"/>
</target>
<target name="-do-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single">
<fail unless="test.includes">Must select some files in the IDE or set test.includes</fail>
<j2seproject3:junit includes="${test.includes}"/>
</target>
<target name="-post-test-run-single" if="have.tests" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single">
<fail if="tests.failed">Some tests failed; see details above.</fail>
</target>
<target name="test-single" depends="init,compile-test-single,-pre-test-run-single,-do-test-run-single,-post-test-run-single" description="Run single unit test."/>
<!--
=======================
JUNIT DEBUGGING SECTION
=======================
-->
<target name="-debug-start-debuggee-test" if="have.tests" depends="init,compile-test">
<fail unless="test.class">Must select one file in the IDE or set test.class</fail>
<j2seproject3:debug classname="junit.textui.TestRunner" classpath="${debug.test.classpath}">
<customize>
<arg line="${test.class}"/>
</customize>
</j2seproject3:debug>
</target>
<target name="-debug-start-debugger-test" if="netbeans.home+have.tests" depends="init,compile-test">
<j2seproject1:nbjpdastart name="${test.class}" classpath="${debug.test.classpath}"/>
</target>
<target name="debug-test" depends="init,compile-test,-debug-start-debugger-test,-debug-start-debuggee-test"/>
<target name="-do-debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,compile-test-single">
<j2seproject1:nbjpdareload dir="${build.test.classes.dir}"/>
</target>
<target name="debug-fix-test" if="netbeans.home" depends="init,-pre-debug-fix,-do-debug-fix-test"/>
<!--
=========================
APPLET EXECUTION SECTION
=========================
-->
<target name="run-applet" depends="init,compile-single">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject1:java classname="sun.applet.AppletViewer">
<customize>
<arg value="${applet.url}"/>
</customize>
</j2seproject1:java>
</target>
<!--
=========================
APPLET DEBUGGING SECTION
=========================
-->
<target name="-debug-start-debuggee-applet" if="netbeans.home" depends="init,compile-single">
<fail unless="applet.url">Must select one file in the IDE or set applet.url</fail>
<j2seproject3:debug classname="sun.applet.AppletViewer">
<customize>
<arg value="${applet.url}"/>
</customize>
</j2seproject3:debug>
</target>
<target name="debug-applet" if="netbeans.home" depends="init,compile-single,-debug-start-debugger,-debug-start-debuggee-applet"/>
<!--
===============
CLEANUP SECTION
===============
-->
<target name="deps-clean" depends="init" unless="no.deps"/>
<target name="-do-clean" depends="init">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<target name="-post-clean">
<!-- Empty placeholder for easier customization. -->
<!-- You can override this target in the ../build.xml file. -->
</target>
<target name="clean" depends="init,deps-clean,-do-clean,-post-clean" description="Clean build products."/>
</project>

View File

@@ -1,8 +0,0 @@
build.xml.data.CRC32=3ba4020f
build.xml.script.CRC32=654a06bb
build.xml.stylesheet.CRC32=d5b6853a
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=3ba4020f
nbproject/build-impl.xml.script.CRC32=00e7e9f7
nbproject/build-impl.xml.stylesheet.CRC32=99b91518

View File

@@ -1,57 +0,0 @@
application.args=
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
debug.classpath=\
${run.classpath}
debug.test.classpath=\
${run.test.classpath}
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/jxinput.jar
dist.javadoc.dir=${dist.dir}/javadoc
file.reference.jxinput-java=../../java
jar.compress=false
javac.classpath=\
${libs.Java3D.classpath}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.source=1.5
javac.target=1.5
javac.test.classpath=\
${javac.classpath}:\
${build.classes.dir}:\
${libs.junit.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=de.hardcode.jxinput.test.JXInputTestDialog
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
platform.active=default_platform
run.classpath=\
${javac.classpath}:\
${build.classes.dir}
# Space-separated list of JVM arguments used when running the project
# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
# or test-sys-prop.name=value to set system properties for unit tests):
run.jvmargs=
run.test.classpath=\
${javac.test.classpath}:\
${build.test.classes.dir}
src.dir=${file.reference.jxinput-java}

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.java.j2seproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/j2se-project/3">
<name>jxinput</name>
<minimum-ant-version>1.6.5</minimum-ant-version>
<source-roots>
<root id="src.dir"/>
</source-roots>
<test-roots/>
</data>
</configuration>
</project>

View File

@@ -1,205 +0,0 @@
/*
* @(#)HelloUniverse.java 1.15 02/02/07 14:48:36
*
* Copyright (c) 1996-2002 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any
* kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
* WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
* EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
* OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
* FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that Software is not designed,licensed or intended
* for use in the design, construction, operation or maintenance of
* any nuclear facility.
*/
package de.hardcode.jxinput.j3d.test;
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import com.sun.j3d.utils.applet.MainFrame;
import com.sun.j3d.utils.geometry.ColorCube;
import com.sun.j3d.utils.universe.*;
import javax.media.j3d.*;
import javax.vecmath.*;
import de.hardcode.jxinput.j3d.DeviceConfiguration;
import de.hardcode.jxinput.Axis;
import de.hardcode.jxinput.JXInputManager;
import de.hardcode.jxinput.j3d.IsActiveCondition;
import de.hardcode.jxinput.j3d.J3DInputDevice;
import de.hardcode.jxinput.j3d.IsActiveOnButtonCondition;
public class HelloUniverse extends Applet
{
private SimpleUniverse u = null;
TransformGroup objTrans;
public BranchGroup createSceneGraph()
{
BranchGroup objRoot = new BranchGroup();
objTrans = new TransformGroup();
objTrans.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
objRoot.addChild(objTrans);
objTrans.addChild(new ColorCube(0.4));
// Transform3D yAxis = new Transform3D();
// Alpha rotationAlpha = new Alpha(-1, Alpha.INCREASING_ENABLE,
// 0, 0,
// 4000, 0, 0,
// 0, 0, 0);
// RotationInterpolator rotator = new RotationInterpolator(rotationAlpha, objTrans, yAxis,
// 0.0f, (float) Math.PI*2.0f);
// BoundingSphere bounds = new BoundingSphere(new Point3d(0.0,0.0,0.0), 100.0);
// rotator.setSchedulingBounds(bounds);
// objTrans.addChild(rotator);
return objRoot;
}
public HelloUniverse()
{
}
public void init()
{
// These are the string arguments given to the VirtualInputDevice
// constructor. These are settable parameters. Look in the
// VirtualInputDevice constructor for a complete list.
String[] args = new String[10];
args[0] = "printvalues";
args[1] = "true";
args[2] = "yscreeninitloc";
args[3] = "50";
args[4] = null;
// now create the HelloUniverse Canvas
setLayout(new BorderLayout());
GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
Canvas3D c = new Canvas3D(config);
add("Center", c);
// Create a simple scene and attach it to the virtual universe
BranchGroup scene = createSceneGraph();
u = new SimpleUniverse(c);
//
// Use the inputdevice
//
InputDevice device = createInputDevice();
// Register the VirtualInputDevice with Java 3D
u.getViewer().getPhysicalEnvironment().addInputDevice( device );
// TransformGroup viewTrans = u.getViewingPlatform().getViewPlatformTransform();
// Put the behavoir to teh object
SensorBehavior s = new SensorBehavior( objTrans, device.getSensor(0) );
s.setSchedulingBounds( new BoundingSphere( new Point3d(0.0,0.0,0.0), Float.MAX_VALUE ) );
objTrans.addChild( s );
u.getViewingPlatform().setNominalViewingTransform();
u.addBranchGraph(scene);
}
public void destroy()
{
u.removeAllLocales();
}
/**
* Setup an input device.
*/
private InputDevice createInputDevice()
{
IsActiveCondition button1down = new IsActiveOnButtonCondition(JXInputManager.getJXInputDevice( 0 ).getButton( 0 ), true );
IsActiveCondition button1up = new IsActiveOnButtonCondition(JXInputManager.getJXInputDevice( 0 ).getButton( 0 ), false );
Axis xaxis = JXInputManager.getJXInputDevice( 0 ).getAxis( Axis.ID_X );
Axis yaxis = JXInputManager.getJXInputDevice( 0 ).getAxis( Axis.ID_Y );
DeviceConfiguration cnf = new DeviceConfiguration();
//
// Setup the configuration to use joysticks x/y for rotation is not button is pressed
// and for translation if button1 is pressed.
//
cnf.setRotational(
DeviceConfiguration.AXIS_Y,
xaxis,
button1up,
IsActiveCondition.NEVER,
0.0, Math.PI
);
cnf.setRotational(
DeviceConfiguration.AXIS_X,
yaxis,
button1up,
IsActiveCondition.NEVER,
0.0, Math.PI
);
cnf.setTranslational(
DeviceConfiguration.AXIS_Z,
yaxis,
button1down,
IsActiveCondition.NEVER,
-5.0, 4.0
);
cnf.setTranslational(
DeviceConfiguration.AXIS_X,
xaxis,
button1down,
IsActiveCondition.NEVER,
0.0, 4.0
);
// We have the config, create the device...
J3DInputDevice d = new J3DInputDevice( cnf );
// The InputDevice must be initialized before registering it
// with the PhysicalEnvironment object.
d.initialize();
return d;
}
public static void main(String[] args)
{
new MainFrame(new HelloUniverse(), 350, 350);
}
}

View File

@@ -1,70 +0,0 @@
package de.hardcode.jxinput.j3d.test;
/*
* @(#)SensorBehavior.java 1.8 02/02/07 14:48:34
*
* Copyright (c) 1996-2002 Sun Microsystems, Inc. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* - Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* This software is provided "AS IS," without a warranty of any
* kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
* WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
* EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES
* SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN
* OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR
* FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR
* PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF
* LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE SOFTWARE,
* EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
*
* You acknowledge that Software is not designed,licensed or intended
* for use in the design, construction, operation or maintenance of
* any nuclear facility.
*/
import javax.media.j3d.*;
import java.util.*;
public class SensorBehavior extends Behavior
{
private WakeupOnElapsedFrames conditions = new WakeupOnElapsedFrames(0);
private TransformGroup transformGroup;
private Sensor sensor;
private Transform3D transform = new Transform3D();
public SensorBehavior( TransformGroup tg, Sensor sensor )
{
transformGroup = tg;
this.sensor = sensor;
}
public void initialize()
{
wakeupOn( conditions );
}
public void processStimulus( Enumeration criteria )
{
sensor.getRead( transform );
transformGroup.setTransform( transform );
wakeupOn( conditions );
}
}

View File

@@ -1,15 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<BODY>
JXInput by HARDCODE Dev., Dipl. Phys. Joerg Plewe.
<p>
JXInput connects gaming input devices like joysticks or gamepads to the Java
environment.
</p>
Comments send to <A href="mailto:jxinput@hardcode.de">jxinput@hardcode.de</A>.
</BODY>
</HTML>

View File

@@ -1,8 +0,0 @@
*.ncb
Release
*.plg
Debug
*~
jxinput.vcproj.HERKBOOK.Herkules.user
jxinput.suo
*.opt

View File

@@ -1,175 +0,0 @@
#include "stdafx.h"
#include "JXInputManager.h"
#include "JXInput.h"
//
// Globals
//
extern HINSTANCE g_hInst;
JXInputManager::JXInputManager( HWND hWnd ) :
mhWnd( hWnd ),
mDeviceCounter( 0 )
{
for ( int i = 0; i < MAX_JXINPUTS; ++i )
{
mDevices[ i ] = NULL;
}
if ( FAILED( InitDirectInput( hWnd ) ) )
{
FreeDirectInput();
}
}
JXInputManager::~JXInputManager()
{
for ( int i = 0; i < getNumberOfJXInputs(); ++i )
{
delete mDevices[ i ];
mDevices[ i ] = NULL;
}
FreeDirectInput();
}
int JXInputManager::getNumberOfJXInputs() const
{
return mDeviceCounter;
}
JXInput& JXInputManager::getJXInput( int idx ) const
{
assert( idx < mDeviceCounter );
return * mDevices[ idx ];
}
int JXInputManager::getMaxNumberOfAxes() const
{
return JXINPUT_MAX_AXES;
}
int JXInputManager::getMaxNumberOfButtons() const
{
return JXINPUT_MAX_BUTTONS;
}
int JXInputManager::getMaxNumberOfDirectionals() const
{
return JXINPUT_MAX_DIRECTIONALS;
}
//-----------------------------------------------------------------------------
// Name: InitDirectInput()
// Desc: Initialize the DirectInput variables.
//-----------------------------------------------------------------------------
HRESULT JXInputManager::InitDirectInput( HWND hWnd )
{
HRESULT hr;
// Register with the DirectInput subsystem and get a pointer
// to a IDirectInput interface we can use.
// Create a DInput object
if( FAILED( hr = DirectInput8Create( g_hInst, DIRECTINPUT_VERSION,
IID_IDirectInput8, (VOID**)&mpDI, NULL ) ) )
return hr;
// Look for a simple joystick we can use for this sample program.
if( FAILED( hr = mpDI->EnumDevices( DI8DEVCLASS_GAMECTRL,
EnumJoysticksCallback,
(VOID*)this, DIEDFL_ALLDEVICES /*| DIEDFL_INCLUDEPHANTOMS*/ ) ) )
return hr;
// Look for a other devices
if( FAILED( hr = mpDI->EnumDevices( DI8DEVCLASS_DEVICE,
EnumJoysticksCallback,
(VOID*)this, DIEDFL_ALLDEVICES /*| DIEDFL_INCLUDEPHANTOMS*/ ) ) )
return hr;
return S_OK;
}
//-----------------------------------------------------------------------------
// Name: FreeDirectInput()
// Desc: Initialize the DirectInput variables.
//-----------------------------------------------------------------------------
HRESULT JXInputManager::FreeDirectInput()
{
if ( NULL != mpDI )
mpDI->Release();
mpDI = NULL;
return S_OK;
}
//-----------------------------------------------------------------------------
// Name: EnumJoysticksCallback()
// Desc: Called once for each enumerated joystick. If we find one, create a
// device interface on it so we can play with it.
//-----------------------------------------------------------------------------
BOOL CALLBACK JXInputManager::EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance,
VOID* pContext )
{
HRESULT hr;
LPDIRECTINPUTDEVICE8 pJoystick;
JXInputManager* pThis = (JXInputManager*)pContext;
//
// if the maximum number of devices is already registered,
// issue a warning and stop enumeration.
//
if( MAX_JXINPUTS == pThis->mDeviceCounter )
{
OutputDebugString( "Max. number of devices exceeded!" );
return DIENUM_STOP;
}
// Obtain an interface to the enumerated joystick.
hr = pThis->mpDI->CreateDevice( pdidInstance->guidInstance, &pJoystick, NULL );
// If it failed, then we can't use this joystick. (Maybe the user unplugged
// it while we were in the middle of enumerating it.)
if( FAILED(hr) )
return DIENUM_CONTINUE;
JXInput* pJ = new JXInput( pJoystick, pThis->mhWnd );
//
// only register useful devices
//
if( pJ->getNumberOfAxes() + pJ->getNumberOfButtons() + pJ->getNumberOfDirectionals() > 0 )
{
pThis->addJXInput( pJ );
}
else
{
delete pJ;
}
return DIENUM_CONTINUE;
}
/**
* Register a JXInput device.
*/
void JXInputManager::addJXInput( JXInput* pJ )
{
assert( mDeviceCounter < MAX_JXINPUTS );
if( mDeviceCounter < MAX_JXINPUTS )
mDevices[ mDeviceCounter++ ] = pJ;
}

View File

@@ -1,47 +0,0 @@
// JXInputManager.h: Schnittstelle f<>r die Klasse JXInputManager.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_JXINPUTMANAGER_H__24862402_14C9_407D_8532_A16A6E3A7D64__INCLUDED_)
#define AFX_JXINPUTMANAGER_H__24862402_14C9_407D_8532_A16A6E3A7D64__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define MAX_JXINPUTS 10
class JXInput;
class JXINPUT_API JXInputManager
{
public:
JXInputManager( HWND hWnd );
virtual ~JXInputManager();
int getNumberOfJXInputs() const;
JXInput& getJXInput( int idx ) const;
//
// Numbering methods
//
int getMaxNumberOfAxes() const;
int getMaxNumberOfButtons() const;
int getMaxNumberOfDirectionals() const;
private:
LPDIRECTINPUT8 mpDI;
HWND mhWnd;
JXInput* mDevices[ MAX_JXINPUTS ];
int mDeviceCounter;
HRESULT InitDirectInput( HWND hWnd = NULL );
HRESULT FreeDirectInput();
static BOOL CALLBACK EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance,
VOID* pContext );
void addJXInput( JXInput* pJ );
};
#endif // !defined(AFX_JXINPUTMANAGER_H__24862402_14C9_407D_8532_A16A6E3A7D64__INCLUDED_)

View File

@@ -1,37 +0,0 @@
========================================================================
DYNAMIC LINK LIBRARY : jxinput
========================================================================
Diese jxinput-DLL hat der Anwendungs-Assistent f<>r Sie erstellt.
Diese Datei enth<74>lt eine Zusammenfassung dessen, was Sie in jeder der Dateien
finden, die Ihre jxinput-Anwendung bilden.
jxinput.dsp
Diese Datei (Projektdatei) enth<74>lt Informationen auf Projektebene und wird zur
Erstellung eines einzelnen Projekts oder Teilprojekts verwendet. Andere Benutzer k<>nnen
die Projektdatei (.dsp) gemeinsam nutzen, sollten aber die Makefiles lokal exportieren.
jxinput.cpp
Dies ist die Hauptquellcodedatei f<>r die DLL.
jxinput.h
Diese Datei enth<74>lt Ihre DLL-Exporte.
/////////////////////////////////////////////////////////////////////////////
Weitere Standarddateien:
StdAfx.h, StdAfx.cpp
Diese Dateien werden zum Erstellen einer vorkompilierten Header-Datei (PCH) namens
jxinput.pch und einer vorkompilierten Typdatei namens StdAfx.obj verwendet.
/////////////////////////////////////////////////////////////////////////////
Weitere Hinweise:
Der Anwendungs-Assistent verwendet "ZU ERLEDIGEN:", um Bereiche des Quellcodes zu
kennzeichnen, die Sie hinzuf<75>gen oder anpassen sollten.
/////////////////////////////////////////////////////////////////////////////

View File

@@ -1,9 +0,0 @@
// stdafx.cpp : Quelltextdatei, die nur die Standard-Includes einbindet
// jxinput.pch ist die vorkompilierte Header-Datei
// stdafx.obj enth<74>lt die vorkompilierte Typinformation
#include "stdafx.h"
// ZU ERLEDIGEN: Verweis auf alle zus<75>tzlichen Header-Dateien, die Sie in STDAFX.H
// und nicht in dieser Datei ben<65>tigen

View File

@@ -1,32 +0,0 @@
// stdafx.h : Include-Datei f<>r Standard-System-Include-Dateien,
// oder projektspezifische Include-Dateien, die h<>ufig benutzt, aber
// in unregelm<6C><6D>igen Abst<73>nden ge<67>ndert werden.
//
#if !defined(AFX_STDAFX_H__68E14C76_098F_47ED_932B_4C01E8E9EFFB__INCLUDED_)
#define AFX_STDAFX_H__68E14C76_098F_47ED_932B_4C01E8E9EFFB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// F<>gen Sie hier Ihre Header-Dateien ein
#define WIN32_LEAN_AND_MEAN // Selten benutzte Teile der Windows-Header nicht einbinden
#define STRICT
#include <windows.h>
// ZU ERLEDIGEN: Verweisen Sie hier auf zus<75>tzliche Header-Dateien, die Ihr Programm ben<65>tigt
#ifdef JXINPUT_EXPORTS
#define JXINPUT_API __declspec(dllexport)
#else
#define JXINPUT_API __declspec(dllimport)
#endif
#include <dinput.h>
#include <assert.h>
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ f<>gt zus<75>tzliche Deklarationen unmittelbar vor der vorherigen Zeile ein.
#endif // !defined(AFX_STDAFX_H__68E14C76_098F_47ED_932B_4C01E8E9EFFB__INCLUDED_)

View File

@@ -1,279 +0,0 @@
#include "stdafx.h"
#include "de_hardcode_jxinput_directinput_DirectInputDriver.h"
#include "jxinput.h"
#include "JXInputManager.h"
//
// Globals
//
extern HINSTANCE g_hInst;
static JXInputManager* pJXInputManager = NULL;
static JXInput* apJXInput[ MAX_JXINPUTS ];
static HWND hWndJava;
//
// IDs of the static Java arrays.
//
static jfieldID sAxesFieldID;
static jfieldID sButtonsFieldID;
static jfieldID sDirectionsFieldID;
/**
* Remove all resources allocated by the Java binding.
*/
void shutdownJavaResources()
{
if ( NULL != pJXInputManager )
delete pJXInputManager;
if ( NULL != hWndJava )
DestroyWindow( hWndJava );
pJXInputManager = NULL;
for( int i = 0; i < MAX_JXINPUTS; ++i )
apJXInput[ i ] = NULL;
hWndJava = NULL;
}
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved)
{
return JNI_VERSION_1_2;
}
JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved)
{
shutdownJavaResources();
}
JNIEXPORT jboolean JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_nativeinit
(JNIEnv * penv, jclass pClazz )
{
//
// Create a non-visible window as 'owner' of the DI device.
//
hWndJava = CreateWindowEx(
0/*WS_EX_APPWINDOW*/, // DWORD dwExStyle, // extended window style
"STATIC", // LPCTSTR lpClassName, // pointer to registered class name
NULL, // LPCTSTR lpWindowName, // pointer to window name
0/*WS_CAPTION*/, // DWORD dwStyle, // window style
0, // int x, // horizontal position of window
0, // int y, // vertical position of window
0, // int nWidth, // window width
0, // int nHeight, // window height
NULL, // HWND hWndParent, // handle to parent or owner window
NULL, // HMENU hMenu, // handle to menu, or child-window identifier
g_hInst, // HINSTANCE hInstance, // handle to application instance
NULL // LPVOID lpParam // pointer to window-creation data
);
if ( NULL == pJXInputManager )
{
pJXInputManager = new JXInputManager( hWndJava );
for( int i = 0; i < MAX_JXINPUTS; ++i )
apJXInput[ i ] = NULL;
for ( int i = 0; i < pJXInputManager->getNumberOfJXInputs(); ++i )
{
apJXInput[ i ] = & pJXInputManager->getJXInput( i );
}
}
return true;
}
JNIEXPORT void JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_nativeexit
(JNIEnv *, jclass )
{
shutdownJavaResources();
}
/**
* Bind my field IDs to the Java variables.
*/
JNIEXPORT void JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_bind
(JNIEnv * penv, jclass pClazz)
{
//
// All fields are static.
//
sAxesFieldID = penv->GetStaticFieldID( pClazz, "sAxisValues", "[[D" );
sButtonsFieldID = penv->GetStaticFieldID( pClazz, "sButtonStates", "[[Z" );
sDirectionsFieldID = penv->GetStaticFieldID( pClazz, "sDirectionalValues", "[[I" );
}
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getNumberOfDevices
(JNIEnv *penv, jclass)
{
return pJXInputManager->getNumberOfJXInputs();
}
JNIEXPORT jstring JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getName
(JNIEnv *penv, jclass, jint dev)
{
return penv->NewStringUTF( apJXInput[ dev ]->getName() );
}
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getNumberOfAxes
(JNIEnv *, jclass, jint dev)
{
return apJXInput[ dev ]->getNumberOfAxes();
}
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getNumberOfButtons
(JNIEnv *, jclass, jint dev)
{
return apJXInput[ dev ]->getNumberOfButtons();
}
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getNumberOfDirectionals
(JNIEnv *, jclass, jint dev)
{
return apJXInput[ dev ]->getNumberOfDirectionals();
}
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getMaxNumberOfAxes
(JNIEnv *, jclass)
{
return pJXInputManager->getMaxNumberOfAxes();
}
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getMaxNumberOfButtons
(JNIEnv *, jclass)
{
return pJXInputManager->getMaxNumberOfButtons();
}
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getMaxNumberOfDirectionals
(JNIEnv *, jclass)
{
return pJXInputManager->getMaxNumberOfDirectionals();
}
JNIEXPORT jboolean JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_isAxisAvailable
(JNIEnv *, jclass, jint dev, jint idx )
{
return apJXInput[ dev ]->isAxisAvailable( idx );
}
JNIEXPORT jstring JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getAxisName
(JNIEnv *penv, jclass, jint dev, jint idx )
{
return penv->NewStringUTF( apJXInput[ dev ]->getAxisName( idx ) );
}
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getAxisType
(JNIEnv *, jclass, jint dev, jint idx )
{
return apJXInput[ dev ]->getAxisType( idx );
}
JNIEXPORT jboolean JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_isButtonAvailable
(JNIEnv *, jclass, jint dev, jint idx )
{
return apJXInput[ dev ]->isButtonAvailable( idx );
}
JNIEXPORT jstring JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getButtonName
(JNIEnv *penv, jclass, jint dev, jint idx )
{
return penv->NewStringUTF( apJXInput[ dev ]->getButtonName( idx ) );
}
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getButtonType
(JNIEnv *, jclass, jint dev, jint idx )
{
return apJXInput[ dev ]->getButtonType( idx );
}
JNIEXPORT jboolean JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_isDirectionalAvailable
(JNIEnv *, jclass, jint dev, jint idx )
{
return apJXInput[ dev ]->isDirectionalAvailable( idx );
}
JNIEXPORT jstring JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getDirectionalName
(JNIEnv *penv, jclass, jint dev, jint idx )
{
return penv->NewStringUTF( apJXInput[ dev ]->getDirectionalName( idx ) );
}
/**
* The main update method.
* Here, the actual work is done.
*/
JNIEXPORT void JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_nativeupdate
(JNIEnv * penv, jclass pClazz )
{
static jdouble axes [ MAX_JXINPUTS ][ JXINPUT_MAX_AXES ];
static jboolean buttons [ MAX_JXINPUTS ][ JXINPUT_MAX_BUTTONS ];
static jint directions [ MAX_JXINPUTS ][ JXINPUT_MAX_DIRECTIONALS ];
static jobjectArray axisarrayarray;
static jobjectArray buttonarrayarray;
static jobjectArray directionarrayarray;
static jdoubleArray axisarray;
static jbooleanArray buttonarray;
static jintArray directionarray;
axisarrayarray = (jobjectArray)penv->GetStaticObjectField( pClazz, sAxesFieldID );
buttonarrayarray = (jobjectArray)penv->GetStaticObjectField( pClazz, sButtonsFieldID );
directionarrayarray = (jobjectArray)penv->GetStaticObjectField( pClazz, sDirectionsFieldID );
//
// For each device....
//
for ( int dev = 0; dev < pJXInputManager->getNumberOfJXInputs(); ++dev )
{
// Do the update of the device.
apJXInput[ dev ]->update();
//
// Copy all values into my arrays.
//
for ( int i = 0; i < JXINPUT_MAX_AXES; ++i )
axes[ dev ][ i ] = apJXInput[ dev ]->getAxisValue( i );
for ( int i = 0; i < JXINPUT_MAX_BUTTONS; ++i )
buttons[ dev ][ i ] = apJXInput[ dev ]->isButtonDown( i );
for ( int i = 0; i < JXINPUT_MAX_DIRECTIONALS; ++i )
directions[ dev ][ i ] = apJXInput[ dev ]->getDirection( i );
//
// Move my arrays to the Java arrays.
//
axisarray = (jdoubleArray)penv->GetObjectArrayElement( axisarrayarray, dev );
penv->SetDoubleArrayRegion( axisarray, 0, JXINPUT_MAX_AXES, axes[ dev ] );
buttonarray = (jbooleanArray)penv->GetObjectArrayElement( buttonarrayarray, dev );
penv->SetBooleanArrayRegion( buttonarray, 0, JXINPUT_MAX_BUTTONS, buttons[ dev ] );
directionarray = (jintArray)penv->GetObjectArrayElement( directionarrayarray, dev );
penv->SetIntArrayRegion( directionarray, 0, JXINPUT_MAX_DIRECTIONALS, directions[ dev ] );
}
}

View File

@@ -1,183 +0,0 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class de_hardcode_jxinput_directinput_DirectInputDriver */
#ifndef _Included_de_hardcode_jxinput_directinput_DirectInputDriver
#define _Included_de_hardcode_jxinput_directinput_DirectInputDriver
#ifdef __cplusplus
extern "C" {
#endif
/* Inaccessible static: sIsOperational */
/* Inaccessible static: sAxisValues */
/* Inaccessible static: sButtonStates */
/* Inaccessible static: sDirectionalValues */
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: nativeinit
* Signature: ()Z
*/
JNIEXPORT jboolean JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_nativeinit
(JNIEnv *, jclass);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: nativeexit
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_nativeexit
(JNIEnv *, jclass);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: bind
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_bind
(JNIEnv *, jclass);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getNumberOfDevices
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getNumberOfDevices
(JNIEnv *, jclass);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getName
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getName
(JNIEnv *, jclass, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getNumberOfAxes
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getNumberOfAxes
(JNIEnv *, jclass, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getNumberOfButtons
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getNumberOfButtons
(JNIEnv *, jclass, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getNumberOfDirectionals
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getNumberOfDirectionals
(JNIEnv *, jclass, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getMaxNumberOfAxes
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getMaxNumberOfAxes
(JNIEnv *, jclass);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getMaxNumberOfButtons
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getMaxNumberOfButtons
(JNIEnv *, jclass);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getMaxNumberOfDirectionals
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getMaxNumberOfDirectionals
(JNIEnv *, jclass);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: isAxisAvailable
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_isAxisAvailable
(JNIEnv *, jclass, jint, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getAxisName
* Signature: (II)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getAxisName
(JNIEnv *, jclass, jint, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getAxisType
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getAxisType
(JNIEnv *, jclass, jint, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: isButtonAvailable
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_isButtonAvailable
(JNIEnv *, jclass, jint, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getButtonName
* Signature: (II)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getButtonName
(JNIEnv *, jclass, jint, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getButtonType
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getButtonType
(JNIEnv *, jclass, jint, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: isDirectionalAvailable
* Signature: (II)Z
*/
JNIEXPORT jboolean JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_isDirectionalAvailable
(JNIEnv *, jclass, jint, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: getDirectionalName
* Signature: (II)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_getDirectionalName
(JNIEnv *, jclass, jint, jint);
/*
* Class: de_hardcode_jxinput_directinput_DirectInputDriver
* Method: nativeupdate
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_de_hardcode_jxinput_directinput_DirectInputDriver_nativeupdate
(JNIEnv *, jclass);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -1,24 +0,0 @@
#include "stdafx.h"
HINSTANCE g_hInst;
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
g_hInst = (HINSTANCE)hModule;
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
g_hInst = NULL;
break;
}
return TRUE;
}

View File

@@ -1,600 +0,0 @@
//
// jxinput.cpp
//
#include "stdafx.h"
#include "jxinput.h"
//
// Globals
//
extern HINSTANCE g_hInst;
/**
* Ctor: Connect with DI
*/
JXInput::JXInput( LPDIRECTINPUTDEVICE8 pJoystick, HWND hWnd ) :
mpJoystick( pJoystick ),
mSliderCount( 0 ),
mPOVCount( 0 ),
mButtonCount( 0 )
{
initAxisConfig();
initButtonsConfig();
initDirectionalsConfig();
if ( FAILED( InitDirectInput( hWnd ) ) )
{
FreeDirectInput();
}
}
/**
* Destructor:
* Free DirectInput.
*/
JXInput::~JXInput()
{
FreeDirectInput();
}
void JXInput::update()
{
UpdateInputState();
}
TCHAR * const JXInput::getName() const
{
return (TCHAR*)mdiDevInfo.tszInstanceName;
}
int JXInput::getNumberOfAxes() const
{
return mdiDevCaps.dwAxes;
}
int JXInput::getNumberOfButtons() const
{
return mButtonCount;
}
int JXInput::getNumberOfDirectionals() const
{
return mPOVCount;
}
double JXInput::getAxisValueHelper( LONG val, int idx ) const
{
const AxisConfig& cfg = mAxisConfig[ idx ];
double span = (double)( cfg.mMaxValue - cfg.mMinValue );
double ret = (double)(val - cfg.mMinValue) / span;
if ( TYPE_SLIDER != cfg.mType )
return ret*2.0 - 1.0;
return ret;
}
double JXInput::getX() const
{
return getAxisValueHelper( mJS.lX, ID_X );
}
double JXInput::getY() const
{
return getAxisValueHelper( mJS.lY, ID_Y );
}
double JXInput::getZ() const
{
return getAxisValueHelper( mJS.lZ, ID_Z );
}
double JXInput::getRotX() const
{
return getAxisValueHelper( mJS.lRx, ID_ROTX );
}
double JXInput::getRotY() const
{
return getAxisValueHelper( mJS.lRy, ID_ROTY );
}
double JXInput::getRotZ() const
{
return getAxisValueHelper( mJS.lRz, ID_ROTZ );
}
double JXInput::getSlider0() const
{
return getAxisValueHelper( mJS.rglSlider[ 0 ], ID_SLIDER0 );
}
double JXInput::getSlider1() const
{
return getAxisValueHelper( mJS.rglSlider[ 1 ], ID_SLIDER1 );
}
bool JXInput::isAxisAvailable( int idx ) const
{
assert( idx < JXINPUT_MAX_AXES );
return mAxisConfig[ idx ].mIsAvailable;
}
TCHAR * const JXInput::getAxisName( int idx ) const
{
assert( idx < JXINPUT_MAX_AXES );
return (char*const)mAxisConfig[ idx ].mName;
}
int JXInput::getAxisType( int idx ) const
{
assert( idx < JXINPUT_MAX_AXES );
return mAxisConfig[ idx ].mType;
}
double JXInput::getAxisValue( int idx ) const
{
assert( idx < JXINPUT_MAX_AXES );
// Failsafe if called accidentally
if ( ! mAxisConfig[ idx ].mIsAvailable )
return 0.0;
return (this->*mAxisConfig[ idx ].mGetValueMethod)();
}
bool JXInput::isButtonAvailable( int idx ) const
{
assert( idx < JXINPUT_MAX_BUTTONS );
return mButtonConfig[ idx ].mIsAvailable;
}
TCHAR * const JXInput::getButtonName( int idx ) const
{
assert( idx < JXINPUT_MAX_BUTTONS );
return (char*const)mButtonConfig[ idx ].mName;
}
int JXInput::getButtonType( int idx ) const
{
assert( idx < JXINPUT_MAX_BUTTONS );
return mButtonConfig[ idx ].mType;
}
bool JXInput::isButtonDown( int idx ) const
{
assert( idx < JXINPUT_MAX_BUTTONS );
return 0 != mJS.rgbButtons[ idx ] ;
}
bool JXInput::isDirectionalAvailable( int idx ) const
{
assert( idx < JXINPUT_MAX_DIRECTIONALS );
return mDirectionalConfig[ idx ].mIsAvailable;
}
TCHAR * const JXInput::getDirectionalName( int idx ) const
{
assert( idx < JXINPUT_MAX_DIRECTIONALS );
return (char*const)mDirectionalConfig[ idx ].mName;
}
int JXInput::getDirection( int idx ) const
{
assert( idx < JXINPUT_MAX_DIRECTIONALS );
return mJS.rgdwPOV[ idx ] ;
}
/**
* Initialize axis configuration array.
*/
void JXInput::initAxisConfig()
{
mAxisConfig[ ID_X ].mIsAvailable = false;
mAxisConfig[ ID_X ].mType = TYPE_TRANSLATION;
mAxisConfig[ ID_X ].mGetValueMethod = &JXInput::getX;
mAxisConfig[ ID_Y ].mIsAvailable = false;
mAxisConfig[ ID_Y ].mType = TYPE_TRANSLATION;
mAxisConfig[ ID_Y ].mGetValueMethod = &JXInput::getY;
mAxisConfig[ ID_Z ].mIsAvailable = false;
mAxisConfig[ ID_Z ].mType = TYPE_TRANSLATION;
mAxisConfig[ ID_Z ].mGetValueMethod = &JXInput::getZ;
mAxisConfig[ ID_ROTX ].mIsAvailable = false;
mAxisConfig[ ID_ROTX ].mType = TYPE_ROTATION;
mAxisConfig[ ID_ROTX ].mGetValueMethod = &JXInput::getRotX;
mAxisConfig[ ID_ROTY ].mIsAvailable = false;
mAxisConfig[ ID_ROTY ].mType = TYPE_ROTATION;
mAxisConfig[ ID_ROTY ].mGetValueMethod = &JXInput::getRotY;
mAxisConfig[ ID_ROTZ ].mIsAvailable = false;
mAxisConfig[ ID_ROTZ ].mType = TYPE_ROTATION;
mAxisConfig[ ID_ROTZ ].mGetValueMethod = &JXInput::getRotZ;
mAxisConfig[ ID_SLIDER0 ].mIsAvailable = false;
mAxisConfig[ ID_SLIDER0 ].mType = TYPE_SLIDER;
mAxisConfig[ ID_SLIDER0 ].mGetValueMethod = &JXInput::getSlider0;
mAxisConfig[ ID_SLIDER1 ].mIsAvailable = false;
mAxisConfig[ ID_SLIDER1 ].mType = TYPE_SLIDER;
mAxisConfig[ ID_SLIDER1 ].mGetValueMethod = &JXInput::getSlider1;
}
/**
* Initialize buttons configuration array.
*/
void JXInput::initButtonsConfig()
{
for ( int i = 0; i < JXINPUT_MAX_BUTTONS; ++i )
{
mButtonConfig[ i ].mIsAvailable = false;
mButtonConfig[ i ].mName[ 0 ] = '\0';
mButtonConfig[ i ].mType = TYPE_PUSHBUTTON;
}
}
/**
* Initialize directionals configuration array.
*/
void JXInput::initDirectionalsConfig()
{
for ( int i = 0; i < JXINPUT_MAX_DIRECTIONALS; ++i )
{
mDirectionalConfig[ i ].mIsAvailable = false;
mDirectionalConfig[ i ].mName[ 0 ] = '\0';
}
}
//-----------------------------------------------------------------------------
// Name: EnumAxesCallback()
// Desc: Callback function for enumerating the axes on a joystick
//-----------------------------------------------------------------------------
BOOL CALLBACK JXInput::EnumAxesCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,
VOID* pContext )
{
JXInput* pThis = (JXInput*)pContext;
AxisConfig* pAxCfg = NULL;
// Set the UI to reflect what objects the joystick supports
// Code derived from M$ samples, really sucks, eh?
if (pdidoi->guidType == GUID_XAxis)
{
pAxCfg = & pThis->mAxisConfig[ ID_X ];
}
if (pdidoi->guidType == GUID_YAxis)
{
pAxCfg = & pThis->mAxisConfig[ ID_Y ];
}
if (pdidoi->guidType == GUID_ZAxis)
{
pAxCfg = & pThis->mAxisConfig[ ID_Z ];
}
if (pdidoi->guidType == GUID_RxAxis)
{
pAxCfg = & pThis->mAxisConfig[ ID_ROTX ];
}
if (pdidoi->guidType == GUID_RyAxis)
{
pAxCfg = & pThis->mAxisConfig[ ID_ROTY ];
}
if (pdidoi->guidType == GUID_RzAxis)
{
pAxCfg = & pThis->mAxisConfig[ ID_ROTZ ];
}
if (pdidoi->guidType == GUID_Slider)
{
switch( pThis->mSliderCount++ )
{
case 0 :
pAxCfg = & pThis->mAxisConfig[ ID_SLIDER0 ];
break;
case 1 :
pAxCfg = & pThis->mAxisConfig[ ID_SLIDER1 ];
break;
}
}
// fail-safe
if( NULL == pAxCfg ) // e.g. GUID_Unknown
return DIENUM_CONTINUE;
//
// Perform config.
//
DIPROPRANGE diprg;
diprg.diph.dwSize = sizeof(DIPROPRANGE);
diprg.diph.dwHeaderSize = sizeof(DIPROPHEADER);
diprg.diph.dwHow = DIPH_BYID;
diprg.diph.dwObj = pdidoi->dwType; // Specify the enumerated axis
// Get the range for the axis
if( FAILED( pThis->mpJoystick->GetProperty( DIPROP_RANGE, &diprg.diph ) ) )
return DIENUM_CONTINUE;
pAxCfg->mMinValue = diprg.lMin;
pAxCfg->mMaxValue = diprg.lMax;
strcpy( (char*)pAxCfg->mName, (char*)pdidoi->tszName );
pAxCfg->mIsAvailable = true;
return DIENUM_CONTINUE;
}
//-----------------------------------------------------------------------------
// Name: EnumButtonsCallback()
// Desc: Callback function for enumerating the axes on a joystick
//-----------------------------------------------------------------------------
BOOL CALLBACK JXInput::EnumButtonsCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,
VOID* pContext )
{
JXInput* pThis = (JXInput*)pContext;
//
// if the maximum number of buttons is already registered,
// issue a warning and stop enumeration.
//
if( JXINPUT_MAX_BUTTONS == pThis->mButtonCount )
{
OutputDebugString( "Max. number of buttons exceeded!" );
return DIENUM_STOP;
}
ButtonConfig* pBtCfg = NULL;
if ( pdidoi->guidType == GUID_Button )
{
assert( JXINPUT_MAX_BUTTONS > pThis->mButtonCount );
pBtCfg = & pThis->mButtonConfig[ pThis->mButtonCount++ ];
}
// fail-safe
if( NULL == pBtCfg ) // e.g. unknown stuff
return DIENUM_CONTINUE;
assert( NULL != pBtCfg );
//
// Perform config.
//
strcpy( (char*)pBtCfg->mName, (char*)pdidoi->tszName );
pBtCfg->mIsAvailable = true;
return DIENUM_CONTINUE;
}
//-----------------------------------------------------------------------------
// Name: EnumPOVsCallback()
// Desc: Callback function for enumerating the axes on a joystick
//-----------------------------------------------------------------------------
BOOL CALLBACK JXInput::EnumPOVsCallback( const DIDEVICEOBJECTINSTANCE* pdidoi,
VOID* pContext )
{
JXInput* pThis = (JXInput*)pContext;
//
// if the maximum number of buttons is already registered,
// issue a warning and stop enumeration.
//
if( JXINPUT_MAX_DIRECTIONALS == pThis->mPOVCount )
{
OutputDebugString( "Max. number of POVs exceeded!" );
return DIENUM_STOP;
}
DirectionalConfig* pDirCfg = NULL;
if (pdidoi->guidType == GUID_POV)
{
assert( JXINPUT_MAX_DIRECTIONALS > pThis->mPOVCount );
pDirCfg = & pThis->mDirectionalConfig[ pThis->mPOVCount++ ];
}
// fail-safe
if( NULL == pDirCfg ) // e.g. unknown stuff
return DIENUM_CONTINUE;
assert( NULL != pDirCfg );
//
// Perform config.
//
strcpy( (char*)pDirCfg->mName, (char*)pdidoi->tszName );
pDirCfg->mIsAvailable = true;
return DIENUM_CONTINUE;
}
//-----------------------------------------------------------------------------
// Name: EnumEffectsCallback()
// Desc: Callback function for enumerating the effects of a joystick
//-----------------------------------------------------------------------------
BOOL CALLBACK JXInput::EnumEffectsCallback( const DIEFFECTINFO* pdidoi,
VOID* pContext )
{
JXInput* pThis = (JXInput*)pContext;
//
// Work on that!!
//
return DIENUM_CONTINUE;
}
//-----------------------------------------------------------------------------
// Name: InitDirectInput()
// Desc: Initialize the DirectInput variables.
//-----------------------------------------------------------------------------
HRESULT JXInput::InitDirectInput( HWND hWnd )
{
HRESULT hr;
// Make sure we got a joystick
if( NULL == mpJoystick )
{
return E_FAIL;
}
//
// Ask the device for some useful information.
//
mdiDevInfo.dwSize = sizeof( DIDEVICEINSTANCE );
hr = mpJoystick->GetDeviceInfo( &mdiDevInfo );
if( FAILED(hr) )
return hr;
// Set the data format to "simple joystick" - a predefined data format
//
// A data format specifies which controls on a device we are interested in,
// and how they should be reported. This tells DInput that we will be
// passing a DIJOYSTATE structure to IDirectInputDevice::GetDeviceState().
hr = mpJoystick->SetDataFormat( &c_dfDIJoystick2 );
if( FAILED(hr) )
return hr;
// Set the cooperative level to let DInput know how this device should
// interact with the system and with other DInput applications.
// hr = g_pJoystick->SetCooperativeLevel( hDlg, DISCL_EXCLUSIVE|DISCL_FOREGROUND );
DWORD mode = ( NULL == hWnd ? DISCL_NONEXCLUSIVE|DISCL_BACKGROUND : DISCL_EXCLUSIVE|DISCL_BACKGROUND );
hr = mpJoystick->SetCooperativeLevel( hWnd, mode );
if( FAILED(hr) )
return hr;
// Determine how many axis the joystick has (so we don't error out setting
// properties for unavailable axis)
mdiDevCaps.dwSize = sizeof(DIDEVCAPS);
hr = mpJoystick->GetCapabilities(&mdiDevCaps);
if ( FAILED(hr) )
return hr;
// Enumerate the axes of the joyctick and set the range of each axis. Note:
// we could just use the defaults, but we're just trying to show an example
// of enumerating device objects (axes, buttons, etc.).
mpJoystick->EnumObjects( EnumAxesCallback, (VOID*)this, DIDFT_AXIS );
mpJoystick->EnumObjects( EnumButtonsCallback, (VOID*)this, DIDFT_BUTTON );
mpJoystick->EnumObjects( EnumPOVsCallback, (VOID*)this, DIDFT_POV );
mpJoystick->EnumEffects( EnumEffectsCallback, (VOID*)this, DIEFT_ALL );
// For FF sticks, switch on autocenter as long as we do not use real FF
SwitchAutoCenter( true );
return S_OK;
}
//-----------------------------------------------------------------------------
// Name: UpdateInputState()
// Desc: Get the input device's state and display it.
//-----------------------------------------------------------------------------
HRESULT JXInput::UpdateInputState()
{
HRESULT hr;
if( mpJoystick )
{
// Poll the device to read the current state
hr = mpJoystick->Poll();
if( FAILED(hr) )
{
// DInput is telling us that the input stream has been
// interrupted. We aren't tracking any state between polls, so
// we don't have any special reset that needs to be done. We
// just re-acquire and try again.
hr = mpJoystick->Acquire();
while( hr == DIERR_INPUTLOST )
hr = mpJoystick->Acquire();
// hr may be DIERR_OTHERAPPHASPRIO or other errors. This
// may occur when the app is minimized or in the process of
// switching, so just try again later
return S_OK;
}
// Get the input's device state
if( FAILED( hr = mpJoystick->GetDeviceState( sizeof(DIJOYSTATE2), &mJS ) ) )
return hr; // The device should have been acquired during the Poll()
}
return S_OK;
}
//-----------------------------------------------------------------------------
// Name: FreeDirectInput()
// Desc: Initialize the DirectInput variables.
//-----------------------------------------------------------------------------
HRESULT JXInput::FreeDirectInput()
{
// Unacquire and release any DirectInputDevice objects.
if( NULL != mpJoystick )
{
// Unacquire the device one last time just in case
// the app tried to exit while the device is still acquired.
mpJoystick->Unacquire();
mpJoystick->Release();
mpJoystick = NULL;
}
return S_OK;
}
HRESULT JXInput::SwitchAutoCenter( bool onoff )
{
HRESULT hr;
DIPROPDWORD DIPropAutoCenter;
DIPropAutoCenter.diph.dwSize = sizeof(DIPropAutoCenter);
DIPropAutoCenter.diph.dwHeaderSize = sizeof(DIPROPHEADER);
DIPropAutoCenter.diph.dwObj = 0;
DIPropAutoCenter.diph.dwHow = DIPH_DEVICE;
DIPropAutoCenter.dwData = ( onoff ? DIPROPAUTOCENTER_ON : DIPROPAUTOCENTER_OFF );
hr = mpJoystick->SetProperty( DIPROP_AUTOCENTER, &DIPropAutoCenter.diph );
return hr;
}

View File

@@ -1,175 +0,0 @@
# Microsoft Developer Studio Project File - Name="jxinput" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=jxinput - Win32 Debug
!MESSAGE Dies ist kein g<>ltiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
!MESSAGE verwenden Sie den Befehl "Makefile exportieren" und f<>hren Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "jxinput.mak".
!MESSAGE
!MESSAGE Sie k<>nnen beim Ausf<73>hren von NMAKE eine Konfiguration angeben
!MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "jxinput.mak" CFG="jxinput - Win32 Debug"
!MESSAGE
!MESSAGE F<>r die Konfiguration stehen zur Auswahl:
!MESSAGE
!MESSAGE "jxinput - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library")
!MESSAGE "jxinput - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""
# PROP Scc_LocalPath ""
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "jxinput - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JXINPUT_EXPORTS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MT /W3 /GX /O2 /I "C:\j2sdk1.4.2\include" /I "C:\j2sdk1.4.2\include\win32" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JXINPUT_EXPORTS" /FR /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "NDEBUG"
# ADD RSC /l 0x407 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 dxguid.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\build\jxinput.dll"
!ELSEIF "$(CFG)" == "jxinput - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JXINPUT_EXPORTS" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "C:\j2sdk1.4.2\include" /I "C:\j2sdk1.4.2\include\win32" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JXINPUT_EXPORTS" /FR /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x407 /d "_DEBUG"
# ADD RSC /l 0x407 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 dxguid.lib dinput8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"..\Classes\jxinput.dll" /pdbtype:sept
!ENDIF
# Begin Target
# Name "jxinput - Win32 Release"
# Name "jxinput - Win32 Debug"
# Begin Group "Quellcodedateien"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\de_hardcode_jxinput_directinput_DirectInputDriver.cpp
# End Source File
# Begin Source File
SOURCE=.\dllmain.cpp
# End Source File
# Begin Source File
SOURCE=.\jxinput.cpp
# End Source File
# Begin Source File
SOURCE=.\JXInputManager.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header-Dateien"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\de_hardcode_jxinput_directinput_DirectInputDriver.h
!IF "$(CFG)" == "jxinput - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__DE_HA="..\classes\de\hardcode\jxinput\directinput\DirectInputDriver.class"
# Begin Custom Build
InputPath=.\de_hardcode_jxinput_directinput_DirectInputDriver.h
"de_hardcode_jxinput_directinput_DirectInputDriver.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
cd ..\Classes
C:\j2sdk1.4.2\bin\javah -classpath . -d ..\win32 de.hardcode.jxinput.directinput.DirectInputDriver
cd ..\win32
# End Custom Build
!ELSEIF "$(CFG)" == "jxinput - Win32 Debug"
# PROP Ignore_Default_Tool 1
USERDEP__DE_HA="..\classes\de\hardcode\jxinput\directinput\DirectInputDriver.class"
# Begin Custom Build
InputPath=.\de_hardcode_jxinput_directinput_DirectInputDriver.h
"de_hardcode_jxinput_directinput_DirectInputDriver.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
cd ..\Classes
C:\j2sdk1.4.2\bin\javah -classpath . -d ..\win32 de.hardcode.jxinput.directinput.DirectInputDriver
cd ..\win32
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\jxinput.h
# End Source File
# Begin Source File
SOURCE=.\JXInputManager.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Ressourcendateien"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project

View File

@@ -1,29 +0,0 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNUNG: DIESE ARBEITSBEREICHSDATEI DARF NICHT BEARBEITET ODER GEL<45>SCHT WERDEN!
###############################################################################
Project: "jxinput"=".\jxinput.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################

View File

@@ -1,183 +0,0 @@
#define JXINPUT_MAX_AXES 8
#define JXINPUT_MAX_BUTTONS 256
#define JXINPUT_MAX_DIRECTIONALS 4
/**
* This class will be exported by jxinput.dll.
*/
class JXINPUT_API JXInput
{
public:
typedef enum AXISTYPE
{
TYPE_TRANSLATION,
TYPE_ROTATION,
TYPE_SLIDER
};
typedef enum BUTTONTYPE
{
TYPE_PUSHBUTTON,
TYPE_TOGGLEBUTTON
};
typedef enum AXISID
{
ID_X, ID_Y, ID_Z,
ID_ROTX, ID_ROTY, ID_ROTZ,
ID_SLIDER0, ID_SLIDER1
};
//
// Ctor
//
JXInput( LPDIRECTINPUTDEVICE8 pJoystick, HWND hWnd = NULL );
//
// Dtor
//
virtual ~JXInput();
//
// Operational methods
//
void update();
// Ask for the name
TCHAR * const getName() const;
//
// Numbering methods
//
int getNumberOfAxes() const;
int getNumberOfButtons() const;
int getNumberOfDirectionals() const;
//
// Access axes
//
double getX() const; /** -1.0 .... 1.0 */
double getY() const; /** -1.0 .... 1.0 */
double getZ() const; /** -1.0 .... 1.0 */
double getRotX() const; /** -1.0 .... 1.0 */
double getRotY() const; /** -1.0 .... 1.0 */
double getRotZ() const; /** -1.0 .... 1.0 */
double getSlider0() const; /** 0.0 .... 1.0 */
double getSlider1() const; /** 0.0 .... 1.0 */
//
// Axis methods
//
bool isAxisAvailable( int idx ) const;
TCHAR* const getAxisName( int idx ) const;
int getAxisType( int idx ) const;
double getAxisValue( int idx ) const;
//
// Button methods
//
bool isButtonAvailable( int idx ) const;
TCHAR* const getButtonName( int idx ) const;
int getButtonType( int idx ) const;
bool isButtonDown( int idx ) const;
//
// Directional methods
//
bool isDirectionalAvailable( int idx ) const;
TCHAR* const getDirectionalName( int idx ) const;
int getDirection( int idx ) const;
private://-----------------------------------------------------------------------------------------
LPDIRECTINPUTDEVICE8 mpJoystick;
DIDEVICEINSTANCE mdiDevInfo;
DIDEVCAPS mdiDevCaps;
DIJOYSTATE2 mJS; // DInput joystick state
int mSliderCount;
int mPOVCount;
int mButtonCount;
double getAxisValueHelper( LONG val, int idx ) const;
HRESULT SwitchAutoCenter( bool onoff = true );
HRESULT InitDirectInput( HWND hWnd = NULL );
HRESULT FreeDirectInput();
HRESULT UpdateInputState();
static BOOL CALLBACK EnumAxesCallback
(
const DIDEVICEOBJECTINSTANCE* pdidoi,
VOID* pContext
);
static BOOL CALLBACK EnumButtonsCallback
(
const DIDEVICEOBJECTINSTANCE* pdidoi,
VOID* pContext
);
static BOOL CALLBACK EnumPOVsCallback
(
const DIDEVICEOBJECTINSTANCE* pdidoi,
VOID* pContext
);
static BOOL CALLBACK EnumEffectsCallback
(
const DIEFFECTINFO* pdidoi,
VOID* pContext
);
class JXINPUT_API AxisConfig
{
public:
bool mIsAvailable;
CHAR mName[MAX_PATH];
AXISTYPE mType;
LONG mMinValue;
LONG mMaxValue;
double (JXInput::*mGetValueMethod)() const;
} mAxisConfig [ JXINPUT_MAX_AXES ];
void initAxisConfig();
class JXINPUT_API ButtonConfig
{
public:
bool mIsAvailable;
CHAR mName[MAX_PATH];
BUTTONTYPE mType;
} mButtonConfig[ JXINPUT_MAX_BUTTONS ];
void initButtonsConfig();
class JXINPUT_API DirectionalConfig
{
public:
bool mIsAvailable;
CHAR mName[MAX_PATH];
} mDirectionalConfig[ JXINPUT_MAX_DIRECTIONALS ];
void initDirectionalsConfig();
};

View File

@@ -1,20 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "jxinput", "jxinput.vcproj", "{8AEA84DC-D8F0-4425-BEBF-A84E91115F76}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8AEA84DC-D8F0-4425-BEBF-A84E91115F76}.Debug|Win32.ActiveCfg = Debug|Win32
{8AEA84DC-D8F0-4425-BEBF-A84E91115F76}.Debug|Win32.Build.0 = Debug|Win32
{8AEA84DC-D8F0-4425-BEBF-A84E91115F76}.Release|Win32.ActiveCfg = Release|Win32
{8AEA84DC-D8F0-4425-BEBF-A84E91115F76}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,367 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Name="jxinput"
ProjectGUID="{8AEA84DC-D8F0-4425-BEBF-A84E91115F76}"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="NDEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Release/jxinput.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="C:\Programme\Java\jdk1.5.0_06\include;C:\Programme\Java\jdk1.5.0_06\include\win32"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JXINPUT_EXPORTS"
StringPooling="true"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Release/jxinput.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dxguid.lib dinput8.lib user32.lib"
OutputFile="..\build\jxinput.dll"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/jxinput.pdb"
ImportLibrary=".\Release/jxinput.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Release/jxinput.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory="..\classes"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="true"
SuppressStartupBanner="true"
TargetEnvironment="1"
TypeLibraryName=".\Debug/jxinput.tlb"
HeaderFileName=""
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="C:\Programme\Java\jdk1.5.0_06\include;C:\Programme\Java\jdk1.5.0_06\include\win32"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JXINPUT_EXPORTS"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="stdafx.h"
PrecompiledHeaderFile=".\Debug/jxinput.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1031"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dxguid.lib dinput8.lib user32.lib"
OutputFile="..\Classes\jxinput.dll"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/jxinput.pdb"
ImportLibrary=".\Debug/jxinput.lib"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile=".\Debug/jxinput.bsc"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Quellcodedateien"
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
>
<File
RelativePath="de_hardcode_jxinput_directinput_DirectInputDriver.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="dllmain.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="jxinput.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="JXInputManager.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
/>
</FileConfiguration>
</File>
<File
RelativePath="StdAfx.cpp"
>
<FileConfiguration
Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="1"
/>
</FileConfiguration>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="1"
/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Header-Dateien"
Filter="h;hpp;hxx;hm;inl"
>
<File
RelativePath="de_hardcode_jxinput_directinput_DirectInputDriver.h"
>
</File>
<File
RelativePath="jxinput.h"
>
</File>
<File
RelativePath="JXInputManager.h"
>
</File>
<File
RelativePath="StdAfx.h"
>
</File>
</Filter>
<Filter
Name="Ressourcendateien"
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
>
</Filter>
<File
RelativePath="ReadMe.txt"
>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>