aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorelias <[email protected]>2006-07-03 11:59:10 +0000
committerelias <[email protected]>2006-07-03 11:59:10 +0000
commitb67427552f48a96eb5169fc4887c42a30559b5a1 (patch)
tree3861d0307d75e53d3681095ab620c0f91b6c8dc0 /plugins
parentcf0b36ca538568bdeb85cfab1acc2b1d60b4cb51 (diff)
added DefaultControllerEnvironment.loadLibrary convenience method for plugins. It will also respect the new net.java.games.input.librarypath property for locating natives (useful for applets). Removed the mac os x jinput-osx-legacy library loading, as it is not necessary anymore with the combined 10.3/10.4 library
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@145 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins')
-rwxr-xr-xplugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java16
-rw-r--r--plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java8
-rw-r--r--plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java8
-rw-r--r--plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java8
4 files changed, 4 insertions, 36 deletions
diff --git a/plugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java b/plugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java
index 68e42b0..b2aec33 100755
--- a/plugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java
+++ b/plugins/OSX/src/java/net/java/games/input/OSXEnvironmentPlugin.java
@@ -56,21 +56,7 @@ import java.security.PrivilegedAction;
*/
public final class OSXEnvironmentPlugin extends ControllerEnvironment implements Plugin {
static {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- if (isMacOSXEqualsOrBetterThan(10, 4)) {
- System.loadLibrary("jinput-osx");
- } else {
- // If we're not on 10.4 or later, try to load the legacy library first
- try {
- System.loadLibrary("jinput-osx-legacy");
- } catch (UnsatisfiedLinkError e) {
- System.loadLibrary("jinput-osx");
- }
- }
- return null;
- }
- });
+ DefaultControllerEnvironment.loadLibrary("jinput-osx");
}
private final static boolean isMacOSXEqualsOrBetterThan(int major_required, int minor_required) {
diff --git a/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java b/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java
index d6afb96..7ad3439 100644
--- a/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java
+++ b/plugins/linux/src/java/net/java/games/input/LinuxEnvironmentPlugin.java
@@ -44,13 +44,7 @@ public final class LinuxEnvironmentPlugin extends ControllerEnvironment implemen
private final static LinuxDeviceThread device_thread = new LinuxDeviceThread();
static {
- AccessController.doPrivileged(
- new PrivilegedAction() {
- public final Object run() {
- System.loadLibrary("jinput-linux");
- return null;
- }
- });
+ DefaultControllerEnvironment.loadLibrary("jinput-linux");
}
public final static Object execute(LinuxDeviceTask task) throws IOException {
diff --git a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java
index e09286a..1fcacb7 100644
--- a/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java
+++ b/plugins/windows/src/java/net/java/games/input/DirectInputEnvironmentPlugin.java
@@ -53,13 +53,7 @@ import net.java.games.util.plugins.Plugin;
*/
public final class DirectInputEnvironmentPlugin extends ControllerEnvironment implements Plugin {
static {
- AccessController.doPrivileged(
- new PrivilegedAction() {
- public final Object run() {
- System.loadLibrary("jinput-dx8");
- return null;
- }
- });
+ DefaultControllerEnvironment.loadLibrary("jinput-dx8");
}
private final Controller[] controllers;
diff --git a/plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java b/plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java
index 304ff13..d8185e2 100644
--- a/plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java
+++ b/plugins/windows/src/java/net/java/games/input/RawInputEnvironmentPlugin.java
@@ -53,13 +53,7 @@ import net.java.games.util.plugins.Plugin;
*/
public final class RawInputEnvironmentPlugin extends ControllerEnvironment implements Plugin {
static {
- AccessController.doPrivileged(
- new PrivilegedAction() {
- public final Object run() {
- System.loadLibrary("jinput-raw");
- return null;
- }
- });
+ DefaultControllerEnvironment.loadLibrary("jinput-raw");
}
private final Controller[] controllers;