Commit 3af11f0a authored by Petri Hintukainen's avatar Petri Hintukainen

BD-J: Add dummy classes to allow building with Java 9+ and Java < 9

parent 46ea4e66
......@@ -226,6 +226,12 @@ pkginclude_HEADERS = \
if USING_BDJAVA_BUILD_JAR
if BDJ_J2SE
awt_src = java-$(BDJ_TYPE):java-build-support
else
awt_src = java-$(BDJ_TYPE)
endif
jardir=$(datadir)/java/
jar_DATA = \
$(top_builddir)/.libs/libbluray-$(BDJ_TYPE)-$(VERSION).jar \
......@@ -237,7 +243,7 @@ all-local:
ant -f $(top_srcdir)/src/libbluray/bdj/build.xml \
-Dbuild='$(abs_builddir)/src/libbluray/bdj/build' \
-Ddist='$(abs_builddir)/.libs' \
-Dsrc_awt=:java-$(BDJ_TYPE) \
-Dsrc_awt=:$(awt_src) \
-Dbootclasspath="$(BDJ_BOOTCLASSPATH)" \
-Dversion='$(BDJ_TYPE)-$(VERSION)'
......
......@@ -247,6 +247,7 @@ else
BDJ_TYPE=j2se
fi
AC_SUBST(BDJ_TYPE)
AM_CONDITIONAL([BDJ_J2SE], [ test x"$BDJ_TYPE" != x"j2me" ])
dnl bootclasspath
AC_SUBST(BDJ_BOOTCLASSPATH)
......
......@@ -41,6 +41,9 @@
<jar jarfile="${dist}/libbluray-awt-${version}.jar" basedir="${build}">
<include name="java/awt/**" />
<include name="sun/**" />
<!-- following classes are used only at build time -->
<exclude name="sun/awt/CausedFocusEvent**" />
<exclude name="java/awt/event/FocusEvent**" />
</jar>
</target>
......
/*
* This file is part of libbluray
* Copyright (C) 2019 libbluray
*
* 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.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
package java.awt.event;
import java.awt.Component;
public class FocusEvent extends ComponentEvent {
/*
* Dummy class used during compilation
*
* This class is used at compile time to hide Java 8 / Java 9 differences in
* java.awt.peer.*, java.awt.FocusEvent and sun.awt.CausedFocusEvent.
*
* This allows compiling special version of BDFramePeer
* that will work both in Java < 9 and Java > 9.
* Correct methods and dependencies are automatically selected at run time,
* thanks to Java on-demand linking.
*
* NOTE:
* This class is not complete and should not be included at runtime.
*
*/
static {
if (System.getProperty("does_not_exist") == null)
throw new Error("This class should not be included at run time");
}
public class /* enum */ Cause {
}
/* Needed when compiling for HaVi */
public static final int FOCUS_FIRST = 1004;
public static final int FOCUS_LAST = 1005;
public static final int FOCUS_GAINED = FOCUS_FIRST;
public static final int FOCUS_LOST = 1 + FOCUS_FIRST;
public FocusEvent(Component src, int id, boolean t) {
super(src, id);
}
public FocusEvent(Component src, int id) {
super(src, id);
}
}
/*
* This file is part of libbluray
* Copyright (C) 2019 libbluray
*
* 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.
*
* 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.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
package sun.awt;
import java.awt.event.FocusEvent;
import java.awt.Component;
public class CausedFocusEvent extends FocusEvent {
/*
* Dummy class used during compilation
*
* This class is used at compile time to hide Java 8 / Java 9 differences in
* java.awt.peer.*, java.awt.FocusEvent and sun.awt.CausedFocusEvent.
*
* This allows compiling special version of BDFramePeer
* that will work both in Java < 9 and Java > 9.
* Correct methods and dependencies are automatically selected at run time,
* thanks to Java on-demand linking.
*
* NOTE:
* This class is not complete and should not be included at runtime.
*
*/
static {
if (System.getProperty("does_not_exist") == null)
throw new Error("This class should not be included at run time");
}
public class /* enum */ Cause {
};
public CausedFocusEvent(Component src, int id) {
super(src, id);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment