This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository jtimer. See http://git.chorem.org/jtimer.git commit 9c9002654f39660c8a89ce98d4ed24099191f1df Author: Eric Chatellier <chatellier@codelutin.com> Date: Mon Feb 29 14:36:58 2016 +0100 fixes #1331: Remove dependency on jna-platform --- pom.xml | 10 +---- .../jtimer/ui/system/unix/UnixSystemInfo.java | 1 - .../java/org/chorem/jtimer/ui/system/unix/X11.java | 42 ++++++++++++++++++ .../java/org/chorem/jtimer/ui/system/unix/Xss.java | 1 - .../chorem/jtimer/ui/system/win32/Kernel32.java | 51 ++++++++++++++++++++++ .../org/chorem/jtimer/ui/system/win32/User32.java | 6 +-- .../jtimer/ui/system/win32/Win32SystemInfo.java | 4 +- 7 files changed, 98 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 7267082..71058f0 100644 --- a/pom.xml +++ b/pom.xml @@ -93,8 +93,6 @@ <!-- maven-site locales --> <locales>en</locales> - <jnaVersion>4.2.1</jnaVersion> - <!-- files to deploy to redmine --> <redmine.releaseFiles> target/${project.artifactId}-${project.version}-bin.zip, @@ -299,13 +297,7 @@ <dependency> <groupId>net.java.dev.jna</groupId> <artifactId>jna</artifactId> - <version>${jnaVersion}</version> - <scope>compile</scope> - </dependency> - <dependency> - <groupId>net.java.dev.jna</groupId> - <artifactId>jna-platform</artifactId> - <version>${jnaVersion}</version> + <version>4.2.1</version> <scope>compile</scope> </dependency> <dependency> diff --git a/src/main/java/org/chorem/jtimer/ui/system/unix/UnixSystemInfo.java b/src/main/java/org/chorem/jtimer/ui/system/unix/UnixSystemInfo.java index 9bdf710..b4997f2 100644 --- a/src/main/java/org/chorem/jtimer/ui/system/unix/UnixSystemInfo.java +++ b/src/main/java/org/chorem/jtimer/ui/system/unix/UnixSystemInfo.java @@ -26,7 +26,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.chorem.jtimer.ui.system.SystemInfo; -import com.sun.jna.platform.unix.X11; import com.sun.jna.ptr.IntByReference; /** diff --git a/src/main/java/org/chorem/jtimer/ui/system/unix/X11.java b/src/main/java/org/chorem/jtimer/ui/system/unix/X11.java new file mode 100644 index 0000000..7bc2e29 --- /dev/null +++ b/src/main/java/org/chorem/jtimer/ui/system/unix/X11.java @@ -0,0 +1,42 @@ +/* + * %%Ignore-License + * Copyright (c) 2007 Timothy Wall, All Rights Reserved + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * <p/> + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + */ +package org.chorem.jtimer.ui.system.unix; + +import com.sun.jna.Library; +import com.sun.jna.Native; +import com.sun.jna.NativeLong; +import com.sun.jna.Pointer; +import com.sun.jna.PointerType; + +/** Definition (incomplete) of the X library. */ +public interface X11 extends Library { + + class Drawable extends NativeLong { + private static final long serialVersionUID = 1L; + } + class Window extends Drawable { + private static final long serialVersionUID = 1L; + } + + class Display extends PointerType { } + + X11 INSTANCE = (X11)Native.loadLibrary("X11", X11.class); + + Display XOpenDisplay(String name); + Window XDefaultRootWindow(Display display); + int XFree(Pointer data); + int XCloseDisplay(Display display); + +} diff --git a/src/main/java/org/chorem/jtimer/ui/system/unix/Xss.java b/src/main/java/org/chorem/jtimer/ui/system/unix/Xss.java index 884444c..90bac0b 100644 --- a/src/main/java/org/chorem/jtimer/ui/system/unix/Xss.java +++ b/src/main/java/org/chorem/jtimer/ui/system/unix/Xss.java @@ -29,7 +29,6 @@ import com.sun.jna.Library; import com.sun.jna.Native; import com.sun.jna.NativeLong; import com.sun.jna.Structure; -import com.sun.jna.platform.unix.X11; import com.sun.jna.ptr.IntByReference; /** diff --git a/src/main/java/org/chorem/jtimer/ui/system/win32/Kernel32.java b/src/main/java/org/chorem/jtimer/ui/system/win32/Kernel32.java new file mode 100644 index 0000000..b7ba576 --- /dev/null +++ b/src/main/java/org/chorem/jtimer/ui/system/win32/Kernel32.java @@ -0,0 +1,51 @@ +/* + * #%L + * jTimer + * %% + * Copyright (C) 2007 - 2016 CodeLutin, Chatellier Eric + * %% + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program. If not, see + * <http://www.gnu.org/licenses/gpl-3.0.html>. + * #L% + */ +package org.chorem.jtimer.ui.system.win32; + +import com.sun.jna.Native; +import com.sun.jna.win32.StdCallLibrary; +import com.sun.jna.win32.W32APIOptions; + +/** + * Win kernel32 JNA Interface. + * + * @author chatellier + * @version $Revision$ + * + * Last update : $Date$ + * By : $Author$ + */ +public interface Kernel32 extends StdCallLibrary { + + /** The instance. */ + Kernel32 INSTANCE = (Kernel32) Native.loadLibrary("kernel32", Kernel32.class, W32APIOptions.UNICODE_OPTIONS); + + /** + * Retrieves the number of milliseconds that have elapsed since the system + * was started. + * + * @see "http://msdn2.microsoft.com/en-us/library/ms724408.aspx" + * @return number of milliseconds that have elapsed since the system was + * started. + */ + public int GetTickCount(); +}; diff --git a/src/main/java/org/chorem/jtimer/ui/system/win32/User32.java b/src/main/java/org/chorem/jtimer/ui/system/win32/User32.java index 95e2ff5..67d2ddd 100644 --- a/src/main/java/org/chorem/jtimer/ui/system/win32/User32.java +++ b/src/main/java/org/chorem/jtimer/ui/system/win32/User32.java @@ -2,7 +2,7 @@ * #%L * jTimer * %% - * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric + * Copyright (C) 2007 - 2016 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -19,7 +19,6 @@ * <http://www.gnu.org/licenses/gpl-3.0.html>. * #L% */ - package org.chorem.jtimer.ui.system.win32; import java.util.Arrays; @@ -28,6 +27,7 @@ import java.util.List; import com.sun.jna.Native; import com.sun.jna.Structure; import com.sun.jna.win32.StdCallLibrary; +import com.sun.jna.win32.W32APIOptions; /** * Win User32 JNA Interface. @@ -45,7 +45,7 @@ import com.sun.jna.win32.StdCallLibrary; public interface User32 extends StdCallLibrary { /** Instance. */ - User32 INSTANCE = (User32) Native.loadLibrary("user32", User32.class); + User32 INSTANCE = (User32) Native.loadLibrary("user32", User32.class, W32APIOptions.DEFAULT_OPTIONS); /** * Contains the time of the last input. diff --git a/src/main/java/org/chorem/jtimer/ui/system/win32/Win32SystemInfo.java b/src/main/java/org/chorem/jtimer/ui/system/win32/Win32SystemInfo.java index 7f611d2..da0e2ef 100644 --- a/src/main/java/org/chorem/jtimer/ui/system/win32/Win32SystemInfo.java +++ b/src/main/java/org/chorem/jtimer/ui/system/win32/Win32SystemInfo.java @@ -2,7 +2,7 @@ * #%L * jTimer * %% - * Copyright (C) 2007 - 2011 CodeLutin, Chatellier Eric + * Copyright (C) 2007 - 2016 CodeLutin, Chatellier Eric * %% * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -24,8 +24,6 @@ package org.chorem.jtimer.ui.system.win32; import org.chorem.jtimer.ui.system.SystemInfo; -import com.sun.jna.platform.win32.Kernel32; - /** * Win32 System info. * -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.