diff options
author | Sven Gothel <[email protected]> | 2010-11-17 10:38:19 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-11-17 10:38:19 +0100 |
commit | dd0038a68a9aa99646549644c3338266546b05f8 (patch) | |
tree | 4af6467b23aa30a5897a609f51c5e3cba0b5ece7 /make | |
parent | db4d7d198cc826bba871fea39461c3c8a2a3b1c6 (diff) |
Move GDI GlueGen wrapping from JOGL -> NativeWindow (following X11). Moving NEWT WindowsWindow GetRelativeLocation() native implementation to GDI as well.
Diffstat (limited to 'make')
-rw-r--r-- | make/build-common.xml | 6 | ||||
-rw-r--r-- | make/build-jogl.xml | 1 | ||||
-rw-r--r-- | make/build-nativewindow.xml | 45 | ||||
-rw-r--r-- | make/config/jogl/gdi-CustomCCode.c | 48 | ||||
-rw-r--r-- | make/config/jogl/gdi-win32.cfg | 26 | ||||
-rw-r--r-- | make/config/nativewindow/win32-CustomJavaCode.java | 24 | ||||
-rw-r--r-- | make/config/nativewindow/win32-lib.cfg | 37 | ||||
-rw-r--r-- | make/scripts/tests.bat | 5 | ||||
-rw-r--r-- | make/scripts/tests.sh | 5 | ||||
-rw-r--r-- | make/stub_includes/win32/window-lib.c (renamed from make/stub_includes/win32/window-system0.c) | 0 |
10 files changed, 109 insertions, 88 deletions
diff --git a/make/build-common.xml b/make/build-common.xml index 468e5933c..e6a066197 100644 --- a/make/build-common.xml +++ b/make/build-common.xml @@ -274,6 +274,7 @@ <property name="nativewindow.core.jar" value="${build.nativewindow}/nativewindow.core.jar" /> <property name="nativewindow.awt.jar" value="${build.nativewindow}/nativewindow.awt.jar" /> <property name="nativewindow.os.x11.jar" value="${build.nativewindow}/nativewindow.os.x11.jar" /> + <property name="nativewindow.os.windows.jar" value="${build.nativewindow}/nativewindow.os.windows.jar" /> <property name="jogl.core.jar" value="${build.jogl}/jogl.core.jar" /> <property name="jogl.cg.jar" value="${build.jogl}/jogl.cg.jar" /> @@ -312,8 +313,9 @@ <property name="newt.intelgdl.jar" value="${build.newt}/newt.intelgdl.jar" /> <!-- Atomic CDC JARS --> - <property name="nativewindow.core.cdc.jar" value="${build.nativewindow}/nativewindow.core.cdc.jar" /> - <property name="nativewindow.os.x11.cdc.jar" value="${build.nativewindow}/nativewindow.os.x11.cdc.jar" /> + <property name="nativewindow.core.cdc.jar" value="${build.nativewindow}/nativewindow.core.cdc.jar" /> + <property name="nativewindow.os.x11.cdc.jar" value="${build.nativewindow}/nativewindow.os.x11.cdc.jar" /> + <property name="nativewindow.os.windows.cdc.jar" value="${build.nativewindow}/nativewindow.os.windows.cdc.jar" /> <property name="jogl.core.cdc.jar" value="${build.jogl}/jogl.core.cdc.jar" /> <property name="jogl.gles1.cdc.jar" value="${build.jogl}/jogl.gles1.cdc.jar" /> diff --git a/make/build-jogl.xml b/make/build-jogl.xml index 850393202..ddfbc25f7 100644 --- a/make/build-jogl.xml +++ b/make/build-jogl.xml @@ -724,7 +724,6 @@ <antcall target="java.generate.gl.platforms" inheritRefs="true"> <param name="window.os.system" value="win32"/> - <param name="window.os0.cfg" value="${config.jogl}/gdi-win32.cfg" /> <param name="window.os1.cfg" value="${config.jogl}/wgl-win32.cfg" /> <param name="glext.platform.cfg" value="${config.jogl}/wglext.cfg" /> <param name="glext.platform.header" value="${stub.includes}/win32/wglext.c" /> diff --git a/make/build-nativewindow.xml b/make/build-nativewindow.xml index 46a3f58f4..432646841 100644 --- a/make/build-nativewindow.xml +++ b/make/build-nativewindow.xml @@ -81,6 +81,9 @@ <property name="java.part.x11" value="com/jogamp/nativewindow/impl/x11/** javax/media/nativewindow/x11/*" /> + <property name="java.part.windows" + value="com/jogamp/nativewindow/impl/windows/** javax/media/nativewindow/windows/*" /> + <!-- condition excludes --> <condition property="java.excludes.awt" @@ -231,7 +234,7 @@ </gluegen> <copy todir="${src.generated.java-cdc}"> <fileset dir="${src.generated.java}" - includes="com/jogamp/nativewindow/impl/x11/**" /> + includes="com/jogamp/nativewindow/impl/x11/** com/jogamp/nativewindow/impl/windows/**" /> </copy> </target> @@ -286,6 +289,7 @@ <echo message="Generating platform-specifics: Win32" /> <antcall target="java.generate.platforms" inheritRefs="true"> <param name="window.os.system" value="win32"/> + <param name="windowlib.os.cfg" value="${config.nativewindow}/win32-lib.cfg" /> <param name="jawt.cfg" value="${config.nativewindow}/jawt-win32.cfg" /> <param name="jawt.platform.header" value="${stub.includes}/jni/win32/jawt_md.h" /> </antcall> @@ -406,7 +410,7 @@ <linker id="linker.cfg.win32.msvc.nativewindow" extends="linker.cfg.win32.msvc"> <syslibset libs="gdi32, user32, kernel32" /> </linker> - + <linker id="linker.cfg.macosx.nativewindow" extends="linker.cfg.macosx"> <linkerarg value="-framework" /> <linkerarg value="Cocoa" /> @@ -561,6 +565,11 @@ <include name="${rootrel.src.c}/x11/XineramaHelper.c" if="isX11"/> </patternset> + <patternset id="c.src.files.windows"> + <include name="${rootrel.generated.c}/Windows/GDI*.c" if="isWindows"/> + <include name="${rootrel.src.c}/windows/GDImisc.c" if="isWindows"/> + </patternset> + <echo message="Compiling @{output.lib.name}" /> <cc outtype="shared" @@ -641,11 +650,20 @@ linker.cfg.id="${linker.cfg.id.oswin}"/> </target> - <target name="c.build.nativewindow.windowlib" depends="c.build.nativewindow.windowlib.x11"/> + <target name="c.build.nativewindow.windowlib.windows" if="isWindows"> + <javah destdir="${src.generated.c}/Windows" classpath="${classes}" class="com.jogamp.nativewindow.impl.windows.GDI" /> + + <c.build c.compiler.src.files="c.src.files.windows" + output.lib.name="nativewindow_win32" + compiler.cfg.id="${compiler.cfg.id}" + linker.cfg.id="${linker.cfg.id.oswin}"/> + </target> + <target name="c.build.nativewindow.windowlib" depends="c.build.nativewindow.windowlib.x11, c.build.nativewindow.windowlib.windows"/> <target name="c.manifest" if="isVC8Family"> <!-- exec mt, the Microsoft Manifest Tool, to include DLL manifests in order to resolve the location of msvcr80.dll --> <msvc.manifest objdir="${obj.nativewindow}" dllname="nativewindow_awt" /> + <msvc.manifest objdir="${obj.nativewindow}" dllname="nativewindow_win32" /> </target> <target name="c.build.nativewindow" depends="c.configure,c.build.nativewindow.windowlib,c.build.nativewindow.awt"> @@ -712,6 +730,19 @@ </jar> </target> + <target name="build-jars-windows" depends="setup-manifestfile"> + <jar manifest="tempversion" destfile="${nativewindow.os.windows.jar}" filesonly="true"> + <fileset dir="${classes}" + includes="${java.part.windows}" /> + </jar> + </target> + <target name="build-jars-windows-cdc" depends="setup-manifestfile-cdc"> + <jar manifest="tempversion-cdc" destfile="${nativewindow.os.windows.cdc.jar}" filesonly="true"> + <fileset dir="${classes-cdc}" + includes="${java.part.windows}" /> + </jar> + </target> + <target name="build-jars-all" depends="setup-manifestfile" unless="setup.noAWT"> <jar manifest="tempversion" destfile="${nativewindow.all.jar}" filesonly="true"> <fileset dir="${classes}" @@ -732,11 +763,11 @@ </jar> </target> - <target name="build-jars-javase" depends="setup-manifestfile,build-jars-awt,build-jars-x11,build-jars-all,build-jars-all-noawt"> + <target name="build-jars-javase" depends="setup-manifestfile,build-jars-awt,build-jars-x11,build-jars-windows,build-jars-all,build-jars-all-noawt"> <jar manifest="tempversion" destfile="${nativewindow.core.jar}" filesonly="true"> <fileset dir="${classes}" includes="${java.part.core}" - excludes="${java.part.awt} ${java.part.x11}"/> + excludes="${java.part.awt} ${java.part.x11} ${java.part.windows}"/> </jar> <jar manifest="tempversion" destfile="${build.nativewindow}/nativewindow-natives-${os.and.arch}.jar" filesonly="true"> <fileset dir="${obj.nativewindow}"> @@ -746,11 +777,11 @@ <delete file="tempversion"/> </target> - <target name="build-jars-cdc" depends="setup-manifestfile-cdc,build-jars-x11-cdc,build-jars-all-cdc"> + <target name="build-jars-cdc" depends="setup-manifestfile-cdc,build-jars-x11-cdc,build-jars-windows-cdc,build-jars-all-cdc"> <jar manifest="tempversion-cdc" destfile="${nativewindow.core.cdc.jar}" filesonly="true"> <fileset dir="${classes-cdc}" includes="${java.part.core}" - excludes="${java.part.awt} ${java.part.x11}"/> + excludes="${java.part.awt} ${java.part.x11} ${java.part.windows}"/> </jar> <jar manifest="tempversion-cdc" destfile="${build.nativewindow}/nativewindow-natives-${os.and.arch}-cdc.jar" filesonly="true"> <fileset dir="${obj.nativewindow}"> diff --git a/make/config/jogl/gdi-CustomCCode.c b/make/config/jogl/gdi-CustomCCode.c deleted file mode 100644 index 0fe9ee628..000000000 --- a/make/config/jogl/gdi-CustomCCode.c +++ /dev/null @@ -1,48 +0,0 @@ -#include <stdio.h> - -#define JOGL_DUMMY_WINDOW_NAME "__jogl_dummy_window" - -LRESULT CALLBACK DummyWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { - return DefWindowProc(hWnd,uMsg,wParam,lParam); -} - -ATOM oglClass = 0; - -HWND CreateDummyWindow( int x, int y, int width, int height ) { - HINSTANCE hInstance; - DWORD dwExStyle; - DWORD dwStyle; - HWND hWnd; - - hInstance = GetModuleHandle(NULL); - if( !oglClass ) { - WNDCLASS wc; - ZeroMemory( &wc, sizeof( wc ) ); - wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wc.lpfnWndProc = (WNDPROC) DummyWndProc; - wc.cbClsExtra = 0; - wc.cbWndExtra = 0; - wc.hInstance = hInstance; - wc.hIcon = NULL; - wc.hCursor = NULL; - wc.hbrBackground = NULL; - wc.lpszMenuName = NULL; - wc.lpszClassName = JOGL_DUMMY_WINDOW_NAME; - if( !(oglClass = RegisterClass( &wc )) ) { - printf( "RegisterClass Failed: %d\n", GetLastError() ); - return( 0 ); - } - } - - dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; - dwStyle = WS_OVERLAPPEDWINDOW; - if( !(hWnd=CreateWindowEx( dwExStyle, - JOGL_DUMMY_WINDOW_NAME, - JOGL_DUMMY_WINDOW_NAME, - dwStyle | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, - x, y, width, height, - NULL, NULL, hInstance, NULL ) ) ) { - return( 0 ); - } - return( hWnd ); -} diff --git a/make/config/jogl/gdi-win32.cfg b/make/config/jogl/gdi-win32.cfg deleted file mode 100644 index 7d831c7b9..000000000 --- a/make/config/jogl/gdi-win32.cfg +++ /dev/null @@ -1,26 +0,0 @@ -# This .cfg file is used to generate the interface to the wgl routines -# used internally by the WindowsGLContext implementation. -JavaOutputDir gensrc/classes -NativeOutputDir gensrc/native/jogl/Windows - -Package com.jogamp.opengl.impl.windows.wgl -JavaClass GDI -Style AllStatic -Include gl-common.cfg -Include gl-common-extensions.cfg -Include gl-desktop.cfg - -GLHeader wingdi.h - -AllowNonGLExtensions true - -CustomCCode #define WIN32_LEAN_AND_MEAN -CustomCCode #include <windows.h> -CustomCCode #undef WIN32_LEAN_AND_MEAN - -CustomCCode #include <wingdi.h> -CustomCCode #include <stddef.h> - -Include ../intptr.cfg - -IncludeAs CustomCCode gdi-CustomCCode.c diff --git a/make/config/nativewindow/win32-CustomJavaCode.java b/make/config/nativewindow/win32-CustomJavaCode.java new file mode 100644 index 000000000..cd5b00b79 --- /dev/null +++ b/make/config/nativewindow/win32-CustomJavaCode.java @@ -0,0 +1,24 @@ + + private static final long hInstance; + + static { + NWJNILibLoader.loadNativeWindow("win32"); + hInstance = initIDs0(); + if( 0 == hInstance ) { + throw new NativeWindowException("GDI: Could not initialized native stub"); + } + } + + public static synchronized void initSingleton() { + } + private static native long initIDs0(); + + public static long getModuleHandle() { + return hInstance; + } + + public static Point GetRelativeLocation(long src_win, long dest_win, int src_x, int src_y) { + return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y); + } + private static native Object GetRelativeLocation0(long src_win, long dest_win, int src_x, int src_y); + diff --git a/make/config/nativewindow/win32-lib.cfg b/make/config/nativewindow/win32-lib.cfg new file mode 100644 index 000000000..b7535b5e1 --- /dev/null +++ b/make/config/nativewindow/win32-lib.cfg @@ -0,0 +1,37 @@ +# This .cfg file is used to generate the interface to the wgl routines +# used internally by the WindowsGLContext implementation. +JavaOutputDir gensrc/classes +NativeOutputDir gensrc/native/Windows + +Package com.jogamp.nativewindow.impl.windows +JavaClass GDI +Style AllStatic + +Opaque boolean BOOL +Opaque long HINSTANCE +Opaque long HANDLE +Opaque long HBITMAP +Opaque long HDC +Opaque long HGDIOBJ +Opaque long HGLRC +Opaque long HPBUFFERARB +Opaque long HPBUFFEREXT +Opaque boolean BOOL +Opaque long PROC +Opaque long void ** + +Import javax.media.nativewindow.util.Point +Import javax.media.nativewindow.NativeWindowException +Import com.jogamp.nativewindow.impl.NWJNILibLoader + +CustomCCode #define WIN32_LEAN_AND_MEAN +CustomCCode #include <windows.h> +CustomCCode #undef WIN32_LEAN_AND_MEAN + +CustomCCode #include <wingdi.h> +CustomCCode #include <stddef.h> + +Include ../intptr.cfg + +IncludeAs CustomJavaCode GDI win32-CustomJavaCode.java + diff --git a/make/scripts/tests.bat b/make/scripts/tests.bat index 8fee63e8c..cfb801d79 100644 --- a/make/scripts/tests.bat +++ b/make/scripts/tests.bat @@ -1,5 +1,5 @@ -scripts\java-win64-dbg.bat com.jogamp.newt.opengl.GLWindow -scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT +REM scripts\java-win64-dbg.bat com.jogamp.newt.opengl.GLWindow +REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.acore.TestGLProfile01NEWT REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT -time 30000 REM scripts\java-win64-dbg.bat com.jogamp.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411 @@ -24,3 +24,4 @@ REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestScreenMode02NEWT REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestDisplayLifecycle01NEWT REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting01NEWT REM scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.parenting.TestParenting02NEWT +scripts\java-win64-dbg.bat com.jogamp.test.junit.newt.TestCloseNewtAWT diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh index d61435d67..1def82be5 100644 --- a/make/scripts/tests.sh +++ b/make/scripts/tests.sh @@ -36,7 +36,7 @@ function jrun() { #D_ARGS="-Dnewt.debug.Screen -Dnewt.debug.EDT -Djogamp.debug.Lock" #D_ARGS="-Dnewt.debug.EDT" #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all -Dnewt.debug=all" - D_ARGS="-Dnewt.debug=all" + #D_ARGS="-Dnewt.debug=all" X_ARGS="-Dsun.java2d.noddraw=true -Dsun.java2d.opengl=false" java $awtarg $X_ARGS $D_ARGS $* 2>&1 | tee -a java-run.log } @@ -61,7 +61,7 @@ function testawt() { #testawt com.jogamp.test.junit.jogl.demos.gl2.gears.newt.TestGearsNEWT #testawt com.jogamp.test.junit.newt.TestDisplayLifecycle01NEWT #testawt com.jogamp.test.junit.newt.TestDisplayLifecycle02NEWT -testawt com.jogamp.test.junit.newt.parenting.TestParenting01NEWT +#testawt com.jogamp.test.junit.newt.parenting.TestParenting01NEWT #testawt com.jogamp.test.junit.newt.parenting.TestParenting02NEWT #testawt com.jogamp.test.junit.newt.TestScreenMode00NEWT #testnoawt com.jogamp.test.junit.newt.TestScreenMode01NEWT @@ -97,6 +97,7 @@ testawt com.jogamp.test.junit.newt.parenting.TestParenting01NEWT #testawt com.jogamp.test.junit.newt.parenting.TestParenting03AWT #testawt com.jogamp.test.junit.newt.parenting.TestParenting03AWT -time 100000 #testawt com.jogamp.test.junit.newt.parenting.TestParenting03bAWT -time 100000 +testawt com.jogamp.test.junit.newt.TestCloseNewtAWT #testawt $* diff --git a/make/stub_includes/win32/window-system0.c b/make/stub_includes/win32/window-lib.c index c5c5d37b9..c5c5d37b9 100644 --- a/make/stub_includes/win32/window-system0.c +++ b/make/stub_includes/win32/window-lib.c |