/src/org/mt4j/util/manyMouse/ManyMouse.java
http://mt4j.googlecode.com/ · Java · 83 lines · 17 code · 18 blank · 48 comment · 2 complexity · c16c07c071128c8e5bcc69a4a27c4df9 MD5 · raw file
- package org.mt4j.util.manyMouse;
- import java.io.File;
- /*
- * Java bindings to the ManyMouse C code, via JNI.
- *
- * Please see the file LICENSE.txt in the source's root directory.
- *
- * This file written by Ryan C. Gordon.
- */
- /**
- * The Class ManyMouse.
- */
- public class ManyMouse{
-
- // JNI link.
- static {
- //TODO compile library on linux/osx
- if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) {
- System.loadLibrary("ManyMouse");
- }else if (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) {
- // System.loadLibrary("ManyMouse"); //FIXME why not working?
- System.load(System.getProperty("user.dir") + File.separator + "ManyMouse.so");
- }
- }
- // static { System.load("D:\\Eclipse Workspace\\MTMetaCollab\\ManyMouse.dll"); }
-
- // Native method hooks.
- /**
- * Inits the.
- *
- * @return the int
- */
- public native static synchronized int Init();
-
- /**
- * Java_ many mouse_ init.
- *
- * @return the int
- */
- public native static synchronized int Java_ManyMouse_Init();
-
- /**
- * Many mouse_ init.
- *
- * @return the int
- */
- public native static synchronized int ManyMouse_Init();
-
- /**
- * Quit.
- */
- public native static synchronized void Quit();
-
- /**
- * Device name.
- *
- * @param index the index
- *
- * @return the string
- */
- public native static synchronized String DeviceName(int index);
-
- /**
- * Poll event.
- *
- * @param event the event
- *
- * @return true, if successful
- */
- public native static synchronized boolean PollEvent(ManyMouseEvent event);
- } // ManyMouse
- // end of ManyMouse.java ...