diff options
Diffstat (limited to 'make')
-rw-r--r-- | make/build.xml | 59 | ||||
-rwxr-xr-x | make/jawt-CustomJavaCode.java | 27 | ||||
-rw-r--r-- | make/jawt-macosx.cfg | 4 | ||||
-rw-r--r-- | make/jawt-win32.cfg | 9 | ||||
-rw-r--r-- | make/jawt-x11.cfg | 8 |
5 files changed, 88 insertions, 19 deletions
diff --git a/make/build.xml b/make/build.xml index 798a58b10..e696d9af3 100644 --- a/make/build.xml +++ b/make/build.xml @@ -756,9 +756,14 @@ </linker> <patternset id="c.src.files.jogl"> - <include name="${rootrel.src.c.jogl}/*.c"/> + <include name="${rootrel.src.c.jogl}/InternalBufferUtils.c"/> <include name="${rootrel.src.c.jogl}/*.m" if="os.isMacOSX"/> - <include name="${rootrel.generated.c.jogl}/*.c"/> + <include name="${rootrel.generated.c.jogl}/*GL*.c"/> + </patternset> + + <patternset id="c.src.files.jogl_awt"> + <include name="${rootrel.src.c.jogl}/JAWT*.c"/> + <include name="${rootrel.generated.c.jogl}/JAWT*.c"/> </patternset> <patternset id="c.src.files.cg"> @@ -809,7 +814,7 @@ </compiler> <linker extends="${linker.cfg.id}"> - <syslibset dir="${java.lib.dir.platform}" libs="jawt"/> + <syslibset dir="${java.lib.dir.platform}" libs="jawt" if="c.compiler.use-jawt"/> </linker> </cc> </target> @@ -827,57 +832,72 @@ <move file="${obj}/libjogl.dylib" tofile="${obj}/libjogl.jnilib" /> </target> + <target name="c.rename.jogl_awt.lib.macosx" if="os.isMacOSX"> + <!-- FIXME: this is a hack; the cpptask should have an option to change the + suffix or at least understand the override from dylib to jnilib --> + <move file="${obj}/libjogl_awt.dylib" tofile="${obj}/libjogl_awt.jnilib" /> + </target> + <target name="c.rename.jogl_cg.lib.macosx" if="os.isMacOSX"> <!-- FIXME: this is a hack; the cpptask should have an option to change the suffix or at least understand the override from dylib to jnilib --> <move file="${obj}/libjogl_cg.dylib" tofile="${obj}/libjogl_cg.jnilib" /> </target> - <target name="c.build.jogl"> + <target name="c.build.jogl.core"> <antcall target="c.build" inheritRefs="true"> <param name="c.compiler.src.files" value="c.src.files.jogl"/> - <param name="output.lib.name" value="jogl"/> + <param name="output.lib.name" value="jogl"/> </antcall> <antcall target="c.rename.jogl.lib.macosx" inheritRefs="true" /> </target> + <target name="c.build.jogl.awt"> + <antcall target="c.build" inheritRefs="true"> + <param name="c.compiler.src.files" value="c.src.files.jogl_awt"/> + <param name="c.compiler.use-jawt" value="true"/> + <param name="output.lib.name" value="jogl_awt"/> + </antcall> + <antcall target="c.rename.jogl_awt.lib.macosx" inheritRefs="true" /> + </target> + <target name="c.build.cg" if="jogl.cg"> <antcall target="c.build" inheritRefs="true"> - <param name="c.compiler.src.files" value="c.src.files.cg"/> - <param name="c.compiler.use-cglib" value="XXX"/> - <param name="output.lib.name" value="jogl_cg"/> + <param name="c.compiler.src.files" value="c.src.files.cg"/> + <param name="c.compiler.use-cglib" value="true"/> + <param name="output.lib.name" value="jogl_cg"/> </antcall> <antcall target="c.rename.jogl_cg.lib.macosx" inheritRefs="true" /> </target> - <target name="c.compile.jogl.win32.vc6" depends="declare.win32.vc6, c.build.jogl, c.build.cg" > + <target name="c.compile.jogl.win32.vc6" depends="declare.win32.vc6, c.build.jogl.core, c.build.jogl.awt, c.build.cg" > </target> - <target name="c.compile.jogl.win32.vc7" depends="declare.win32.vc7, c.build.jogl, c.build.cg"> + <target name="c.compile.jogl.win32.vc7" depends="declare.win32.vc7, c.build.jogl.core, c.build.jogl.awt, c.build.cg"> <property name="c.compiler.use-msvc7" value="true"/> </target> - <target name="c.compile.jogl.win32.mingw" depends="declare.win32.mingw, c.build.jogl, c.build.cg"> + <target name="c.compile.jogl.win32.mingw" depends="declare.win32.mingw, c.build.jogl.core, c.build.jogl.awt, c.build.cg"> <antcall target="c.rename.jogl.libs.mingw" inheritrefs="true" /> </target> - <target name="c.compile.jogl.linux" depends="declare.linux, c.build.jogl, c.build.cg" > + <target name="c.compile.jogl.linux" depends="declare.linux, c.build.jogl.core, c.build.jogl.awt, c.build.cg" > </target> - <target name="c.compile.jogl.linux.amd64" depends="declare.linux.amd64, c.build.jogl, c.build.cg" > + <target name="c.compile.jogl.linux.amd64" depends="declare.linux.amd64, c.build.jogl.core, c.build.jogl.awt, c.build.cg" > </target> - <target name="c.compile.jogl.linux.ia64" depends="declare.linux.ia64, c.build.jogl, c.build.cg" > + <target name="c.compile.jogl.linux.ia64" depends="declare.linux.ia64, c.build.jogl.core, c.build.jogl.awt, c.build.cg" > </target> - <target name="c.compile.jogl.solaris" depends="declare.solaris, c.build.jogl"> + <target name="c.compile.jogl.solaris" depends="declare.solaris, c.build.jogl.core, c.build.jogl.awt"> </target> - <target name="c.compile.jogl.macosx" depends="declare.macosx, c.build.jogl, c.build.cg"> + <target name="c.compile.jogl.macosx" depends="declare.macosx, c.build.jogl.core, c.build.jogl.awt, c.build.cg"> </target> - <target name="c.compile.jogl.freebsd" depends="declare.freebsd, c.build.jogl, c.build.cg" > + <target name="c.compile.jogl.freebsd" depends="declare.freebsd, c.build.jogl.core, c.build.jogl.awt, c.build.cg" > </target> <!-- ================================================================== --> @@ -983,6 +1003,7 @@ <and> <available file="${jogl.dist.dir}/jogl-win32/jogl.jar" /> <available file="${jogl.dist.dir}/jogl-win32/jogl.dll" /> + <available file="${jogl.dist.dir}/jogl-win32/jogl_awt.dll" /> <available file="${jogl.dist.dir}/jogl-win32/jogl_cg.dll" /> </and> </condition> @@ -1000,6 +1021,7 @@ <and> <available file="${jogl.dist.dir}/jogl-linux/jogl.jar" /> <available file="${jogl.dist.dir}/jogl-linux/libjogl.so" /> + <available file="${jogl.dist.dir}/jogl-linux/libjogl_awt.so" /> <available file="${jogl.dist.dir}/jogl-linux/libjogl_cg.so" /> </and> </condition> @@ -1017,6 +1039,7 @@ <and> <available file="${jogl.dist.dir}/jogl-macosx/jogl.jar" /> <available file="${jogl.dist.dir}/jogl-macosx/libjogl.jnilib" /> + <available file="${jogl.dist.dir}/jogl-macosx/libjogl_awt.jnilib" /> <available file="${jogl.dist.dir}/jogl-macosx/libjogl_cg.jnilib" /> </and> </condition> @@ -1034,6 +1057,7 @@ <and> <available file="${jogl.dist.dir}/jogl-solsparc/jogl.jar" /> <available file="${jogl.dist.dir}/jogl-solsparc/libjogl.so" /> + <available file="${jogl.dist.dir}/jogl-solsparc/libjogl_awt.so" /> </and> </condition> <fail unless="solsparc.complete"> @@ -1050,6 +1074,7 @@ <and> <available file="${jogl.dist.dir}/jogl-solx86/jogl.jar" /> <available file="${jogl.dist.dir}/jogl-solx86/libjogl.so" /> + <available file="${jogl.dist.dir}/jogl-solx86/libjogl_awt.so" /> </and> </condition> <fail unless="solx86.complete"> diff --git a/make/jawt-CustomJavaCode.java b/make/jawt-CustomJavaCode.java new file mode 100755 index 000000000..7e8e83b39 --- /dev/null +++ b/make/jawt-CustomJavaCode.java @@ -0,0 +1,27 @@ +private static volatile JAWT jawt; + +/** Helper routine for all users to call to access the JAWT. */ +public static JAWT getJAWT() { + if (jawt == null) { + synchronized (JAWT.class) { + if (jawt == null) { + NativeLibLoader.loadAWTImpl(); + // Workaround for 4845371. + // Make sure the first reference to the JNI GetDirectBufferAddress is done + // from a privileged context so the VM's internal class lookups will succeed. + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + JAWT j = JAWT.create(); + j.version(JAWTFactory.JAWT_VERSION_1_4); + if (!JAWTFactory.JAWT_GetAWT(j)) { + throw new RuntimeException("Unable to initialize JAWT"); + } + jawt = j; + return null; + } + }); + } + } + } + return jawt; +} diff --git a/make/jawt-macosx.cfg b/make/jawt-macosx.cfg index 10097ec65..a7886a250 100644 --- a/make/jawt-macosx.cfg +++ b/make/jawt-macosx.cfg @@ -15,11 +15,13 @@ Opaque long NSView * IgnoreField JAWT GetComponent IgnoreField JAWT_DrawingSurfaceInfo platformInfo +IncludeAs CustomJavaCode JAWT jawt-CustomJavaCode.java + CustomCCode #include <inttypes.h> CustomCCode #include <jawt.h> - CustomCCode #include </usr/include/machine/types.h> +import java.security.* Import com.sun.opengl.impl.JAWT_PlatformInfo StructPackage JAWT_MacOSXDrawingSurfaceInfo com.sun.opengl.impl.macosx EmitStruct JAWT_MacOSXDrawingSurfaceInfo diff --git a/make/jawt-win32.cfg b/make/jawt-win32.cfg index c8a81ecfd..7f9d74e7b 100644 --- a/make/jawt-win32.cfg +++ b/make/jawt-win32.cfg @@ -5,24 +5,31 @@ Package com.sun.opengl.impl JavaClass JAWTFactory JavaOutputDir ..\build\gensrc\classes NativeOutputDir ..\build\gensrc\native\jogl + HierarchicalNativeOutput false + Opaque boolean jboolean Opaque long HDC + IgnoreField JAWT GetComponent IgnoreField JAWT_DrawingSurfaceInfo platformInfo IgnoreField JAWT_Win32DrawingSurfaceInfo null IgnoreField JAWT_Win32DrawingSurfaceInfo hpalette -CustomCCode #include <jawt.h> +IncludeAs CustomJavaCode JAWT jawt-CustomJavaCode.java + +CustomCCode #include <jawt.h> CustomCCode /* This typedef is only needed for VC6 */ CustomCCode #if _MSC_VER <= 1200 CustomCCode typedef int intptr_t; CustomCCode #endif +import java.security.* Import com.sun.opengl.impl.JAWT_PlatformInfo StructPackage JAWT_Win32DrawingSurfaceInfo com.sun.opengl.impl.windows EmitStruct JAWT_Win32DrawingSurfaceInfo Implements JAWT_Win32DrawingSurfaceInfo JAWT_PlatformInfo + CustomJavaCode JAWT_DrawingSurfaceInfo public JAWT_PlatformInfo platformInfo() { CustomJavaCode JAWT_DrawingSurfaceInfo return platformInfo0(getBuffer()); CustomJavaCode JAWT_DrawingSurfaceInfo } diff --git a/make/jawt-x11.cfg b/make/jawt-x11.cfg index d326c2f26..43ccef7ec 100644 --- a/make/jawt-x11.cfg +++ b/make/jawt-x11.cfg @@ -5,15 +5,23 @@ Package com.sun.opengl.impl JavaClass JAWTFactory JavaOutputDir ../build/gensrc/classes NativeOutputDir ../build/gensrc/native/jogl + HierarchicalNativeOutput false + Opaque boolean jboolean Opaque long Drawable Opaque long Display * + IgnoreField JAWT GetComponent IgnoreField JAWT_DrawingSurfaceInfo platformInfo IgnoreField JAWT_X11DrawingSurfaceInfo GetAWTColor + +IncludeAs CustomJavaCode JAWT jawt-CustomJavaCode.java + CustomCCode #include <inttypes.h> CustomCCode #include <jawt.h> + +import java.security.* Import com.sun.opengl.impl.JAWT_PlatformInfo StructPackage JAWT_X11DrawingSurfaceInfo com.sun.opengl.impl.x11 EmitStruct JAWT_X11DrawingSurfaceInfo |