Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kwhat committed Jan 23, 2017
1 parent 834582a commit 4fe838f
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 99 deletions.
22 changes: 11 additions & 11 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</target>



<target name="mostlyclean" depends="clean" description="Removes all items except previously built libs.">
<echo>Cleaning all build related items...</echo>

Expand Down Expand Up @@ -106,11 +105,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<echo>Cleaning all build related items...</echo>

<delete includeEmptyDirs="true" verbose="true" failonerror="false">
<!-- Brilliant!
<fileset dir="${dir.src}/jnitasks" />
<fileset dir="${dir.src}/libuiohook" />
-->

<fileset dir="${dir.lib}" />
</delete>
</target>
Expand Down Expand Up @@ -173,7 +167,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<typedef resource="org/jnitasks/antlib.xml" classpathref="ant.project.class.path" onerror="failall" />


<!-- Preform libuiohook target checks. -->
<!-- Preform target checks. -->
<fileset dir="${dir.src}/libuiohook" id="src-libuiohook" />
<pathconvert refid="src-libuiohook" property="project.check.libuiohook.download" setonempty="false" />
<available file="${dir.src}/libuiohook/configure" property="project.check.libuiohook.bootstrap" />
Expand Down Expand Up @@ -435,8 +429,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<include path="${dir.src}/jni/include" />

<include path="${ant.build.javac.include}" />
<include path="${ant.build.javac.include}/win32" if="native.os.isWindows"/>
<include path="${ant.build.javac.include}/${ant.build.native.os}" unless="native.os.isWindows"/>
<include path="${ant.build.javac.include}/win32" if="native.os.isWindows" />
<include path="${ant.build.javac.include}/${ant.build.native.os}" unless="native.os.isWindows" />

<fileset dir="${dir.src}/jni">
<include name="**/*.c" />
Expand Down Expand Up @@ -563,7 +557,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</packageset>

<doctitle><![CDATA[<h1>JNativeHook-${ant.build.major}.${ant.build.minor} API Documentation</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2006-2016 ${project.vendor}. All Rights Received.</i>]]></bottom>
<bottom><![CDATA[<i>Copyright &#169; 2006-2017 ${project.vendor}. All Rights Received.</i>]]></bottom>

<link href="http://docs.oracle.com/javase/7/docs/api/" />
</javadoc>
Expand All @@ -576,6 +570,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<mkdir dir="${dir.dist}" />

<zip destfile="${dir.dist}/${ant.project.name}-${ant.project.version}.zip" level="9">
<zipfileset dir="targets" prefix="${ant.project.name}/targets">
<include name="**/*.properties" />
</zipfileset>

<zipfileset dir="${dir.doc}" prefix="${ant.project.name}/doc">
<include name="**/*" />
</zipfileset>
Expand Down Expand Up @@ -614,7 +612,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</zipfileset>

<zipfileset dir="${basedir}" prefix="${ant.project.name}">
<include name="build.*" />
<include name="build.num" />
<include name="build.xml" />
<include name="cross.build.xml" />
<include name="AUTHORS" />
<include name="*.md" />

Expand Down
6 changes: 1 addition & 5 deletions cross.build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,6 @@
<ant antfile="cross.build.xml" target="-compile-cross" dir="${basedir}" inheritAll="false">
<property file="targets/armv6j-hardfloat-linux-gnueabihf.properties" />
</ant>

<ant antfile="cross.build.xml" target="-compile-cross" dir="${basedir}" inheritAll="false">
<property file="targets/armv7a-hardfloat-linux-gnueabihf.properties" />
</ant>
</target>


Expand Down Expand Up @@ -296,7 +292,7 @@
<fileset dir="${dir.maven}" includes="**/*" />
</delete>

<copy file="jnativehook/jar/jnativehook-${ant.build.major}.${ant.build.minor}.${ant.build.revision}.jar" tofile="${dir.maven}/${maven.jar.base}.jar"/>
<copy file="${basedir}/jar/jnativehook-${ant.build.major}.${ant.build.minor}.${ant.build.revision}.jar" tofile="${dir.maven}/${maven.jar.base}.jar"/>

<jar jarfile="${dir.maven}/${maven.jar.base}-sources.jar" basedir="jnativehook" update="true" compress="true" level="9">
<include name="src/java/**/*" />
Expand Down
2 changes: 1 addition & 1 deletion src/java/org/jnativehook/AbstractSwingInputAdapter.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* JNativeHook: Global keyboard and mouse hooking for Java.
* Copyright (C) 2006-2016 Alexander Barker. All Rights Received.
* Copyright (C) 2006-2017 Alexander Barker. All Rights Received.
* https://github.com/kwhat/jnativehook/
*
* JNativeHook is free software: you can redistribute it and/or modify
Expand Down
41 changes: 2 additions & 39 deletions src/java/org/jnativehook/NativeSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@
*/
package org.jnativehook;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
* A small class to determine the native system's operating system family and
* architecture. The class is only used to determine which native library to
Expand Down Expand Up @@ -71,10 +64,7 @@ public enum Family {
*/
public enum Arch {
/** The arm6j architecture. */
ARM6,

/** The arm7a architecture. */
ARM7,
ARM,

/** The sparc architecture. */
SPARC,
Expand Down Expand Up @@ -143,34 +133,7 @@ public static Arch getArchitecture() {
Arch arch;

if (osArch.equalsIgnoreCase("arm")) {
arch = Arch.ARM6;

// Arm7 is not supported by Java... Yes, seriously.
if (NativeSystem.getFamily() == Family.LINUX) {
File fin = new File("/proc/cpuinfo");
if (fin.exists() && fin.canRead()) {
Pattern p = Pattern.compile("ARMv7", Pattern.CASE_INSENSITIVE);

try {
BufferedReader br = new BufferedReader(new FileReader(fin));

String line = null;
while ((line = br.readLine()) != null) {
Matcher m = p.matcher(line);

if (m.find()) {
arch = Arch.ARM7;
break;
}
}

br.close();
}
catch (IOException e) {
// Assume Arm6.
}
}
}
arch = Arch.ARM;
}
else if (osArch.equalsIgnoreCase("sparc")) {
arch = Arch.SPARC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package org.jnativehook.dispatcher;

// Imports.

import javax.swing.SwingUtilities;
import java.util.ArrayList;
import java.util.List;
Expand Down
3 changes: 0 additions & 3 deletions src/java/org/jnativehook/keyboard/NativeKeyAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@
*/
public class NativeKeyAdapter implements NativeKeyListener {

@Override
public void nativeKeyTyped(NativeKeyEvent nativeEvent) {
// Do Nothing.
}

@Override
public void nativeKeyPressed(NativeKeyEvent nativeEvent) {
// Do Nothing.
}

@Override
public void nativeKeyReleased(NativeKeyEvent nativeEvent) {
// Do Nothing.
}
Expand Down
6 changes: 0 additions & 6 deletions src/java/org/jnativehook/keyboard/SwingKeyAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,26 @@
*/
public class SwingKeyAdapter extends AbstractSwingInputAdapter implements NativeKeyListener, KeyListener {

@Override
public void nativeKeyTyped(NativeKeyEvent nativeEvent) {
this.keyTyped(this.getJavaKeyEvent(nativeEvent));
}

@Override
public void nativeKeyPressed(NativeKeyEvent nativeEvent) {
this.keyPressed(this.getJavaKeyEvent(nativeEvent));
}

@Override
public void nativeKeyReleased(NativeKeyEvent nativeEvent) {
this.keyReleased(this.getJavaKeyEvent(nativeEvent));
}

@Override
public void keyTyped(KeyEvent keyEvent) {
// Do Nothing.
}

@Override
public void keyPressed(KeyEvent keyEvent) {
// Do Nothing.
}

@Override
public void keyReleased(KeyEvent keyEvent) {
// Do Nothing.
}
Expand Down
3 changes: 0 additions & 3 deletions src/java/org/jnativehook/mouse/NativeMouseAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,14 @@
*/
public class NativeMouseAdapter implements NativeMouseListener {

@Override
public void nativeMouseClicked(NativeMouseEvent nativeEvent) {
// Do Nothing.
}

@Override
public void nativeMousePressed(NativeMouseEvent nativeEvent) {
// Do Nothing.
}

@Override
public void nativeMouseReleased(NativeMouseEvent nativeEvent) {
// Do Nothing.
}
Expand Down
5 changes: 0 additions & 5 deletions src/java/org/jnativehook/mouse/NativeMouseInputAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,27 +26,22 @@
*/
public class NativeMouseInputAdapter implements NativeMouseInputListener {

@Override
public void nativeMouseClicked(NativeMouseEvent nativeEvent) {
// Do Nothing.
}

@Override
public void nativeMousePressed(NativeMouseEvent nativeEvent) {
// Do Nothing.
}

@Override
public void nativeMouseReleased(NativeMouseEvent nativeEvent) {
// Do Nothing.
}

@Override
public void nativeMouseDragged(NativeMouseEvent nativeEvent) {
// Do Nothing.
}

@Override
public void nativeMouseMoved(NativeMouseEvent nativeEvent) {
// Do Nothing.
}
Expand Down
2 changes: 0 additions & 2 deletions src/java/org/jnativehook/mouse/NativeMouseMotionAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,10 @@
*/
public class NativeMouseMotionAdapter implements NativeMouseMotionListener {

@Override
public void nativeMouseDragged(NativeMouseEvent nativeEvent) {
// Do Nothing.
}

@Override
public void nativeMouseMoved(NativeMouseEvent nativeEvent) {
// Do Nothing.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

public class NativeMouseWheelAdapter implements NativeMouseWheelListener {

@Override
public void nativeMouseWheelMoved(NativeMouseWheelEvent nativeEvent) {
// Do Nothing.
}
Expand Down
8 changes: 0 additions & 8 deletions src/java/org/jnativehook/mouse/SwingMouseAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,42 +30,34 @@
*/
public class SwingMouseAdapter extends AbstractSwingInputAdapter implements NativeMouseListener, MouseListener {

@Override
public void nativeMouseClicked(NativeMouseEvent nativeEvent) {
this.mouseClicked(this.getJavaKeyEvent(nativeEvent));
}

@Override
public void nativeMousePressed(NativeMouseEvent nativeEvent) {
this.mousePressed(this.getJavaKeyEvent(nativeEvent));
}

@Override
public void nativeMouseReleased(NativeMouseEvent nativeEvent) {
this.mousePressed(this.getJavaKeyEvent(nativeEvent));
}

@Override
public void mouseClicked(MouseEvent mouseEvent) {
// Do Nothing.
}

@Override
public void mousePressed(MouseEvent mouseEvent) {
// Do Nothing.
}

@Override
public void mouseReleased(MouseEvent mouseEvent) {
// Do Nothing.
}

@Override
public void mouseEntered(MouseEvent mouseEvent) {
// Do Nothing.
}

@Override
public void mouseExited(MouseEvent mouseEvent) {
// Do Nothing.
}
Expand Down
2 changes: 0 additions & 2 deletions src/java/org/jnativehook/mouse/SwingMouseWheelAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,10 @@
*/
public class SwingMouseWheelAdapter extends SwingMouseAdapter implements NativeMouseWheelListener, MouseWheelListener {

@Override
public void nativeMouseWheelMoved(NativeMouseWheelEvent nativeEvent) {
this.mouseWheelMoved(this.getJavaMouseWheelEvent(nativeEvent));
}

@Override
public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent) {
// Do Nothing.
}
Expand Down
12 changes: 0 additions & 12 deletions targets/armv7a-hardfloat-linux-gnueabihf.properties

This file was deleted.

0 comments on commit 4fe838f

Please sign in to comment.