From 52c95c19dbd69a7fc6b307d2b2db357ceb43ddf5 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 28 Nov 2013 16:34:15 +0100 Subject: Bug 907 - Cleanup Commit e9c711a86aa05f4f24c69972532833f5a98911a3 Cleanup Commit e9c711a86aa05f4f24c69972532833f5a98911a3: - Fix while loop in SendCloseMessage (native) - static 'threadid' must be volatile - Whitespace - Redundancy - CreateDummyWindow - Scope (java, move JNI funcs back to private) - Remove [invalid] pointer usage (native) - ThreadParam's threadReady and hWndPtr shall not be pointers - invalid - No need to use a threadReady pointer. - Validate threadid (native) TODO: - Make 'native dispatch thread' optional - Store 'native dispatch thread' in window class --- .../jogamp/nativewindow/windows/GDIUtil.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/nativewindow/classes/jogamp') diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java index 0cf813ad5..6c639c754 100644 --- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java +++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java @@ -59,8 +59,10 @@ public class GDIUtil implements ToolkitProperties { if( !initIDs0() ) { throw new NativeWindowException("GDI: Could not initialized native stub"); } - long a = getDummyWndProc0(); - dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, a); + dummyWindowClassFactory = new RegisteredClassFactory(dummyWindowClassNameBase, getDummyWndProc0()); + if(DEBUG) { + System.out.println("GDI.initSingleton() dummyWindowClassFactory "+dummyWindowClassFactory); + } isInit = true; } } @@ -91,7 +93,11 @@ public class GDIUtil implements ToolkitProperties { public static long CreateDummyWindow(int x, int y, int width, int height) { synchronized(dummyWindowSync) { - dummyWindowClass = dummyWindowClassFactory.getSharedClass(); + if(DEBUG) { + System.out.println("GDI.CreateDummyWindow() dummyWindowClassFactory "+dummyWindowClassFactory); + System.out.println("GDI.CreateDummyWindow() dummyWindowClass "+dummyWindowClass); + } + // FIXME return CreateDummyWindow0(dummyWindowClass.getHInstance(), dummyWindowClass.getName(), dummyWindowClass.getName(), x, y, width, height); return CreateDummyWindowAndMessageLoop(dummyWindowClass.getHInstance(), dummyWindowClass.getName(), dummyWindowClass.getName(), x, y, width, height); } } @@ -102,6 +108,7 @@ public class GDIUtil implements ToolkitProperties { if( null == dummyWindowClass ) { throw new InternalError("GDI Error ("+dummyWindowClassFactory.getSharedRefCount()+"): SharedClass is null"); } + // FIXME res = GDI.DestroyWindow(hwnd); res = SendCloseMessage(hwnd); dummyWindowClassFactory.releaseSharedClass(); } @@ -124,13 +131,13 @@ public class GDIUtil implements ToolkitProperties { public static native boolean DestroyWindowClass(long hInstance, String className); private static native boolean initIDs0(); - static native long getDummyWndProc0(); + private static native long getDummyWndProc0(); private static native Object GetRelativeLocation0(long src_win, long dest_win, int src_x, int src_y); private static native boolean IsChild0(long win); private static native boolean IsUndecorated0(long win); - static native long CreateDummyWindow0(long hInstance, String className, String windowName, int x, int y, int width, int height); + private static native long CreateDummyWindow0(long hInstance, String className, String windowName, int x, int y, int width, int height); - static native long CreateDummyWindowAndMessageLoop(long hInstance, String className, String windowName, int x, int y, int width, int height); - static native boolean SendCloseMessage(long win); + private static native long CreateDummyWindowAndMessageLoop(long hInstance, String className, String windowName, int x, int y, int width, int height); + private static native boolean SendCloseMessage(long win); } -- cgit v1.2.3