PageRenderTime 21ms CodeModel.GetById 13ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1
 2
 3package org.mt4j.util.manyMouse;
 4
 5import java.io.File;
 6
 7
 8
 9/*
10 * Java bindings to the ManyMouse C code, via JNI.
11 *
12 * Please see the file LICENSE.txt in the source's root directory.
13 *
14 *  This file written by Ryan C. Gordon.
15 */
16
17/**
18 * The Class ManyMouse.
19 */
20public class ManyMouse{
21	
22	// JNI link.
23	static { 
24		//TODO compile library on linux/osx
25		if (System.getProperty("os.name").toLowerCase().indexOf("windows") > -1) {
26			System.loadLibrary("ManyMouse"); 
27		}else if  (System.getProperty("os.name").toLowerCase().indexOf("linux") > -1) {
28//			System.loadLibrary("ManyMouse");  //FIXME why not working?
29			System.load(System.getProperty("user.dir") + File.separator +  "ManyMouse.so");
30		}
31	}
32//	static { System.load("D:\\Eclipse Workspace\\MTMetaCollab\\ManyMouse.dll"); }
33    
34    // Native method hooks.
35    /**
36	 * Inits the.
37	 * 
38	 * @return the int
39	 */
40    public native static synchronized int Init();
41    
42    /**
43     * Java_ many mouse_ init.
44     * 
45     * @return the int
46     */
47    public native static synchronized int Java_ManyMouse_Init();
48    
49    /**
50     * Many mouse_ init.
51     * 
52     * @return the int
53     */
54    public native static synchronized int ManyMouse_Init();
55    
56    /**
57     * Quit.
58     */
59    public native static synchronized void Quit();
60    
61    /**
62     * Device name.
63     * 
64     * @param index the index
65     * 
66     * @return the string
67     */
68    public native static synchronized String DeviceName(int index);
69    
70    /**
71     * Poll event.
72     * 
73     * @param event the event
74     * 
75     * @return true, if successful
76     */
77    public native static synchronized boolean PollEvent(ManyMouseEvent event);
78
79
80} // ManyMouse
81
82// end of ManyMouse.java ...
83