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/config | |
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/config')
-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 |
4 files changed, 61 insertions, 74 deletions
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 + |