Jogamp
JOGL: Reenable Applet/Webstart/RCP support for JOGL + AWT + X11
authorSven Gothel <sgothel@jausoft.com>
Thu, 14 Oct 2010 19:26:43 +0000 (21:26 +0200)
committerSven Gothel <sgothel@jausoft.com>
Thu, 14 Oct 2010 19:26:43 +0000 (21:26 +0200)
commit774138544e1eec3330309ad682fa05154a07ab8d
treea9d612e98f1d16390763f54ab1888ff66f081a22
parentd7faeb8b96f5aba76967096006af4c420d964fef
JOGL: Reenable Applet/Webstart/RCP support for JOGL + AWT + X11

Changed GLProfile/NativeWindowFactory/.. initialization methodology:

    GLProfile:
        public static synchronized void initSingleton(final boolean firstUIActionOnProcess);

    NativeWindowFactory:
        public static synchronized void initSingleton(final boolean firstUIActionOnProcess);

+++

Introducing NativeWindow ToolkitLock, implementations are
    NullToolkitLock
    JAWTToolkitLock
    X11JAWTToolkitLock
    X11ToolkitLock

AbstractGraphicsDevice provides generic global toolkit locking methods,
implemented by the ToolkitLock interface.

ToolkitLock's are aggregated in NativeWindow's DefaultGraphicsDevice
to implement it's superclass lock()/unlock() methods.

This enables a device specific locking strategy, ie on X11/AWT utilizing
JAWT && X11 locking, and maybe none for others (NEWT).

No locking is required for X11 / AWT, in case the above mentioned
initialization happened as a 'firstUIActionOnProcess'.

The ToolkitLock factory is currently a hardcoded part of NativeWindowFactory.
We may have to allow 3rd party NativeWindow implementations
to register custom ones.

+++

com.jogamp.opengl.impl.GLDrawableImpl cleanup:
  Dealing with all locking code, providing all public methods. Exceptions are commented.
  Specializations x11/windows/.. only contains platform code.
  Pulled down access qualifiers if possible public -> protected.

com.jogamp.nativewindow.impl.x11.X11Util
  Wrapping all X11Lib method with the new locking code.

com.jogamp.nativewindow.impl.jawt.JAWTUtil
  Utilize global SunToolkit.awtLock() is available,
  the fallback to global JAWT.lock().
  The latter just invokes the first.

javax.media.nativewindow.awt.AWTGraphicsDevice
    setHandle(long handle) -> setSubType(String type, long handle)
    which also resets the ToolkitLock respecting the new type.
    This ensures correct locking after the sub type has been determined,
    ie AWT using an X11 peer.

+++

Misc Changes done on the way ..

GLCanvas:
    Fixed inversed this.drawableHelper.isExternalAnimatorAnimating() condition,
    which disabled normal repaint.

GLJPanel:
    Removed drawableHelper.isExternalAnimatorAnimating() condition,
    which disabled painting, since the animation thread just updates the source image.

NEWT WindowImpl:
    When reparenting back to parent and 'refit' child if it's size exceeds it's parent.
    More 'Fix: Memory consumption' commit 6ced17f0325d5719e992b246ffd156e5b39694b4.

NEWTEvent:
    Removed code to evaluate the 'system event' attribute, need to find a better approach.
107 files changed:
doc/Implementation/runtime-properties.txt
make/build-junit.xml
make/config/nativewindow/x11-CustomJavaCode.java
make/scripts/java-run-all.sh
make/scripts/java-win64-dbg.bat
make/scripts/make.jogl.all.linux-x86_64.sh
make/scripts/tests.bat
make/scripts/tests.sh
src/jogl/classes/com/jogamp/opengl/impl/GLContextImpl.java
src/jogl/classes/com/jogamp/opengl/impl/GLDrawableFactoryImpl.java
src/jogl/classes/com/jogamp/opengl/impl/GLDrawableImpl.java
src/jogl/classes/com/jogamp/opengl/impl/GLPbufferImpl.java
src/jogl/classes/com/jogamp/opengl/impl/GLWorkerThread.java
src/jogl/classes/com/jogamp/opengl/impl/awt/AWTUtil.java
src/jogl/classes/com/jogamp/opengl/impl/awt/Java2D.java
src/jogl/classes/com/jogamp/opengl/impl/egl/EGLDrawableFactory.java
src/jogl/classes/com/jogamp/opengl/impl/egl/EGLGraphicsConfigurationFactory.java
src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLDrawableFactory.java
src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/MacOSXPbufferCGLDrawable.java
src/jogl/classes/com/jogamp/opengl/impl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsDummyWGLDrawable.java
src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsOffscreenWGLDrawable.java
src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsPbufferWGLDrawable.java
src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLContext.java
src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLDrawableFactory.java
src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
src/jogl/classes/com/jogamp/opengl/impl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11DummyGLXDrawable.java
src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXContext.java
src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXDrawableFactory.java
src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfiguration.java
src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11GLXGraphicsConfigurationFactory.java
src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11OffscreenGLXDrawable.java
src/jogl/classes/com/jogamp/opengl/impl/x11/glx/X11PbufferGLXDrawable.java
src/jogl/classes/com/jogamp/opengl/impl/x11/glx/awt/X11AWTGLXGraphicsConfigurationFactory.java
src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
src/jogl/classes/javax/media/opengl/GLProfile.java
src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
src/junit/com/jogamp/test/junit/jogl/acore/DumpVersion.java
src/junit/com/jogamp/test/junit/jogl/acore/TestGLProfile01NEWT.java
src/junit/com/jogamp/test/junit/jogl/awt/TestAWT01GLn.java
src/junit/com/jogamp/test/junit/jogl/awt/TestAWT02WindowClosing.java
src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWT01GLn.java
src/junit/com/jogamp/test/junit/jogl/awt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/Gears.java
src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsAWT.java
src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNEWT.java
src/junit/com/jogamp/test/junit/jogl/demos/gl2/gears/TestGearsNewtAWTWrapper.java
src/junit/com/jogamp/test/junit/jogl/drawable/TestDrawable01NEWT.java
src/junit/com/jogamp/test/junit/jogl/glsl/TestTransformFeedbackVeryingsBug407NEWT.java
src/junit/com/jogamp/test/junit/jogl/offscreen/TestOffscreen01NEWT.java
src/junit/com/jogamp/test/junit/jogl/texture/TestTexture01AWT.java
src/junit/com/jogamp/test/junit/newt/TestDisplayLifecycle01NEWT.java
src/junit/com/jogamp/test/junit/newt/TestEventSourceNotAWTBug.java [moved from src/junit/com/jogamp/test/junit/newt/TestEventSourceNotNEWTBug.java with 96% similarity]
src/junit/com/jogamp/test/junit/newt/TestFocus01SwingAWTRobot.java
src/junit/com/jogamp/test/junit/newt/TestFocus02SwingAWTRobot.java
src/junit/com/jogamp/test/junit/newt/TestGLWindows01NEWT.java
src/junit/com/jogamp/test/junit/newt/TestGLWindows02NEWTAnimated.java
src/junit/com/jogamp/test/junit/newt/TestListenerCom01AWT.java
src/junit/com/jogamp/test/junit/newt/TestWindows01NEWT.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01NEWT.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01aAWT.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01bAWT.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01cAWT.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting01cSwingAWT.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting02AWT.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting02NEWT.java
src/junit/com/jogamp/test/junit/newt/parenting/TestParenting03AWT.java
src/junit/com/jogamp/test/junit/util/UITestCase.java
src/nativewindow/classes/com/jogamp/nativewindow/impl/GraphicsConfigurationFactoryImpl.java
src/nativewindow/classes/com/jogamp/nativewindow/impl/NativeWindowFactoryImpl.java
src/nativewindow/classes/com/jogamp/nativewindow/impl/NullToolkitLock.java [new file with mode: 0644]
src/nativewindow/classes/com/jogamp/nativewindow/impl/ProxySurface.java
src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTToolkitLock.java [new file with mode: 0644]
src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTUtil.java
src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/JAWTWindow.java
src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTToolkitLock.java [new file with mode: 0644]
src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11JAWTWindow.java
src/nativewindow/classes/com/jogamp/nativewindow/impl/jawt/x11/X11SunJDKReflection.java
src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11GraphicsConfigurationFactory.java
src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11ToolkitLock.java [new file with mode: 0644]
src/nativewindow/classes/com/jogamp/nativewindow/impl/x11/X11Util.java
src/nativewindow/classes/javax/media/nativewindow/AbstractGraphicsDevice.java
src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java
src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
src/nativewindow/classes/javax/media/nativewindow/ToolkitLock.java [new file with mode: 0644]
src/nativewindow/classes/javax/media/nativewindow/awt/AWTGraphicsDevice.java
src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsDevice.java
src/nativewindow/classes/javax/media/nativewindow/x11/X11GraphicsScreen.java
src/nativewindow/native/x11/Xmisc.c
src/newt/classes/com/jogamp/newt/NewtFactory.java
src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
src/newt/classes/com/jogamp/newt/impl/DisplayImpl.java
src/newt/classes/com/jogamp/newt/impl/WindowImpl.java
src/newt/classes/com/jogamp/newt/impl/awt/AWTCanvas.java
src/newt/classes/com/jogamp/newt/impl/awt/AWTWindow.java
src/newt/classes/com/jogamp/newt/impl/macosx/MacWindow.java
src/newt/classes/com/jogamp/newt/impl/windows/WindowsWindow.java
src/newt/classes/com/jogamp/newt/impl/x11/X11Display.java
src/newt/classes/com/jogamp/newt/impl/x11/X11Window.java
src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
http://JogAmp.org git info: FAQ, tutorial and man pages.