aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/com/jogamp
Commit message (Collapse)AuthorAgeFilesLines
* Fix Bug #589 (JAWT Offscreen-Layer resize) and Offscreen-Layer ↵Sven Gothel2012-06-301-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | setSwapInterval() deadlock; Reuse JAWT instance; Cleanup - Fixes - OSXUtil.CreateCALayer*(..): Pass layer target size (if known). This fixes Bug #589 - MacOSXWindowSystemInterface-pbuffer.m: - ALL: displayLink NULL check - setSwapInterval(..): lock only for variable setting, could deadlock when start/stop CVDisplayLink - JAWTWindow.destroy(): use 'surfaceLock' instead of 'synchronized' - Cleanup / Performance - JAWTWindow.lockSurface(): Reuse JAWT instance - MacOSXJAWTWindow: AttachJAWTSurfaceLayer0(..) -> SetJAWTRootSurfaceLayer0(..) Reflects semantic better. - DEBUG - JAWTWindow.updateBounds(..) notify of bounds change
* NativeSurface.unlockSurface(): Change fail-fast policy to fail safe tolerantSven Gothel2012-06-291-2/+4
| | | | | | | | | - This policy allows more simple destruction handling w/o validating on the top level. - Hence 'unlockSurface()' shall not throw any exception. - 'lockSurface()' keeps unchanges, clarified w/ explicit 'throws' declaration, ie will fail-fast.
* Misc cleanup: add @OverrideSven Gothel2012-06-271-4/+10
|
* NativeSurface Cleanup (API Change) - Adapt to GlueGen Lock cleanup commit: ↵Sven Gothel2012-06-271-58/+81
| | | | | | | | | | | | 834b9e530e652b7ff7c5e222720bce3ad2b11c5f - adapt to GlueGen Lock cleanup - remove isSurfaceLocked(), use 'null != getSurfaceLockOwner()' instead Misc: - remove unused priv./impl. methods - add @Override
* NEWT API Change 'WindowClosingProtocol': Use 'enum WindowClosingMode' ↵Sven Gothel2012-05-021-12/+8
| | | | instead of static final int values.
* NativeWindow public-spec to public-impl reorg ↵Sven Gothel2012-03-0614-28/+35
| | | | (javax.media.nativewindow.<impl> -> com.jogamp.nativewindow.<impl>) 2/3
* NativeWindow public-spec to public-impl reorg ↵Sven Gothel2012-03-0614-0/+1778
| | | | (javax.media.nativewindow.<impl> -> com.jogamp.nativewindow.<impl>) 1/2
* Clean/Fix: Threading CodeSven Gothel2011-02-261-1/+1
| | | | | | - Remove unsafe double checked locking - Annotate safe double checked locking (volatile) - use 'static final' if possible
* Move implementation private files from com.jogamp.<module>.impl. to ↵Sven Gothel2011-02-0823-3032/+0
| | | | | | | | | | | | | | | jogamp.<module> (1/2) - rename task - com.jogamp.opengl.impl -> jogamp.opengl - com.jogamp.opengl.util.glsl.fixedfunc.impl -> jogamp.opengl.util.glsl.fixedfunc - com.jogamp.nativewindow.impl -> jogamp.nativewindow - com.jogamp.newt.impl -> jogamp.newt This sorts implementation details from the top level, ie skipping the public 'com', allowing a better seperation of public classes and implementation details and also reduces strings. This approach of public/private seperation is also used in the OpenJDK.
* Cleanup / DebugSven Gothel2010-12-231-1/+1
|
* JOGL/NEWT: Introduce WindowClosingProtocol (solves Bug/Request 444)Sven Gothel2010-12-192-1/+97
| | | | | | | | | | | | | | | | | Similar to JFrame's closing behavior, the following components window closing follow the new WindowClosingProtocol: - GLCanvas - GLJPanel - NEWT Window, GLWindow - NEWT NewtCanvasAWT The implementation obeys either 1) the user value set by this interface, 2) an underlying toolkit set user value (JFrame, ..) 3) or it's default, eg. {@link #DO_NOTHING_ON_CLOSE DO_NOTHING_ON_CLOSE} within an AWT environment. If none of the above determines the operation, this protocol default behavior {@link #DISPOSE_ON_CLOSE DISPOSE_ON_CLOSE} shall be used.
* Debug/Cleanup: toString: print base classname only; Misc ..Sven Gothel2010-12-191-1/+0
|
* JAWTUtil: Fix case when init is run on AWT EDT (which is odd, ie not using ↵Sven Gothel2010-12-151-11/+16
| | | | GLProfile.initSingleton(..)
* NativeWindow: Move RegisteredClass to private impl packageSven Gothel2010-12-122-0/+177
|
* JAWTUtil: Eager initialization of AWT desktop propsSven Gothel2010-12-121-0/+25
| | | | | Triggers immediate AWT property resolution. Would reproduce any javaws / AWT race condition.
* Windows RegisterClass: Use new RegisteredClassFactory (window class), Misc.Sven Gothel2010-12-121-1/+2
| | | | | | | | | | | | | | | | | This solves the issue when an applet is started/stop and started again, or another applet runs in the same JVM. Also soves the issue for multiple JVMs. RegisteredClassFactory can be instanced to manage one shared window class, currently in use for GDI's dummy window and NEWT. A class base name and a window proc handle must be passed in the factory cstr. Before registering, the class is tested if already exists, eg another applet in the same JVM. If registration fails, the class name will iterate until successful or MAX_INT reached, eg if multiple JVMs are running. Added NativeWindow Common Native Code.
* Cleanup GLGraphicsConfiguration[Factory] implementations (X11/WGL)Sven Gothel2010-12-103-20/+123
| | | | | | | | | | | | | | | | | - AWT/WGL: - Using sun.awt.Win32GraphicsConfig via reflection, if supported, else we may fail. - Preselection of PFD as follows: - 1st choice is to create our own AWT GraphicsConfig (GC) based on PFD/GLCaps, ignoring WGL_SUPPORT_GDI_ARB, PFD_SUPPORT_GDI - 2nd choice is to use AWT PFD pool of GC's - else we fail -> use NewtCanvasAWT instead (TODO: Other JDK/AWT implementations ?) - Set PFD will be performed at setRealized(..) - SharedContext (X11/WGL) is synchronized to allow multithreaded access, if required - Simplified and unified (X11/WGL) GraphicsConfigurationFactory - WGL 'external' drawables will be determined with given arguments right away
* NativeWindow: Expose lock test/get methods and constructor with HDCSven Gothel2010-12-091-2/+17
|
* X11 DummyWindow: Pass size and set size in proxySven Gothel2010-12-041-2/+2
|
* Refined VersionInfo usageSven Gothel2010-11-251-0/+2
|
* NativeWindow: Fix XSynchronize gluegenSven Gothel2010-11-221-2/+2
|
* Merge branch 'master' of github.com:sgothel/joglMichael Bien2010-11-183-67/+39
|\
| * NativeWindow JAWT Impl: Fix: Remove double unlock of locks if JAWT lock failed.Sven Gothel2010-11-183-67/+39
| |
* | print platform info additional to the module info.Michael Bien2010-11-181-0/+1
| |
* | modifications due to changes in GlueGen's VersionUtil.getManifest().Michael Bien2010-11-181-3/+2
|/ | | | made references created in double checked locks volatile.
* Finishing Immutable changes including GLCapabiltiesImmutable.Sven Gothel2010-11-172-6/+6
|
* Merge branch 'pulled'Sven Gothel2010-11-171-2/+2
|\
| * Implement CapabilitiesImmutable to indicate that getRequestedCapabilities() ↵Steve Vaughan2010-11-171-2/+2
| | | | | | | | and getChosenCapabilities() return immutable instances. Add cloneCapabilities() to create a mutable clone of an immutable set of capabilities.
* | cleanup importsSven Gothel2010-11-171-5/+0
| |
* | JAWTWindow: Avoid AWTTreeLock, cleanup.Sven Gothel2010-11-174-31/+83
| | | | | | | | | | | | | | Use native implementation for getLocationOnScreen() if available. If unavailable call AWT's implementation only in case the AWT TreeLock is hold by this thread. Finalize methods ..
* | Moving NEWT X11Window GetRelativeLocation() native implementation to ↵Sven Gothel2010-11-171-0/+10
|/ | | | NativeWindow X11.
* X11: Make X11 error handler quiet where we expect an X11 error, ie OpenGL 4 ↵Sven Gothel2010-11-161-4/+4
| | | | not available ..
* GlueGen JogampVersion Adaption (getInfo -> toStringBuffer/toString)Sven Gothel2010-11-141-1/+1
|
* Adapt to GlueGen Version changes; Adding NativeWindowVersion, JoglVersion ↵Sven Gothel2010-11-121-0/+60
| | | | | | | | | and NewtVersion. Adapt to GlueGen Version changes: b735755815312b5fe2c003642de60711be1cd645 .. 556c7e70d3d57aa99b5787b1e4d8a7b1c299ed3f Show information of all subcomponenet.
* NativeWindow: Provide 'setX11ErrorHandler(boolean onoff)'Sven Gothel2010-11-031-5/+26
|
* Minor cleanup: strings, unused vars, ..Sven Gothel2010-11-021-1/+1
| | | | | | | | | | DEBUG strings w/ thread name nativewindow.TraceLock -> nativewindow.debug.ToolkitLock.TraceLock Sync Xmisc (DummyWindow) with NEWT's creation test scripts: awt and non-awt usage
* Proper X11 Display ClosingSven Gothel2010-10-295-153/+125
| | | | | | | | | | | | | | | | | | | | | X11Util: Removed TLS semantics, since TLS name -> dpy mapping is erroneous at this point. Added lists for open connections (for optional later shutdown). AbstractGraphicsDevice interface and implementations: Adding 'close()' method allowing native implementations the ability to close the native resource, ie X11GraphicsDevice. This becomes necessary for 'on the fly' created X11 Display connections, ie in X11AWTGLXGraphicsConfigurationFactory, which enables closing. Utilize 'close' call in use cases: GLCanvas, GLJPanel and AWTCanvas. Remove active X11 Display creation in X11JAWTWindow, as a last resort, use the X11SunJDKReflection method. Used for reference only, not active rendering etc, mostly for on the fly AWT parenting in NewtFactoryAWT. However, these 'on the fly' references are erroneous and should be remodelled, ie passice and active X11GraphicsDevice's ..
* Minor: fix imports, JAWTUtil: query headless 1st (faster), ↵Sven Gothel2010-10-271-3/+2
| | | | NativeWindowFactory added nonAWT ToolkitLock create method
* Analysis of glXMakeCurrent freeze on ATI fglrx 8.78.6; Misc ..Sven Gothel2010-10-261-4/+17
| | | | | | | | | | | Analysis of glXMakeCurrent freeze on ATI fglrx 8.78.6 - Workaround in TestGLWindows01NEWT: same create/destroy order - Prove bug with simple native test app: jogl/test/native/displayMultiple02.c Misc: - Reverted d52181032830acdd5e4069a41ccd0daff5922d8a, ie reenable x11IOErrorHandler (nativewindow) - GLDrawableHelper: methods -> final - X11Util.NamedDisplay: remove unused RecursiveLock, Cloneable
* can't enable x11IOErrorHandler without disableSven Gothel2010-10-261-1/+6
|
* X11Util: lock toolkit/x11 unificationSven Gothel2010-10-261-180/+101
|
* NEWT: ScreenMode changesSven Gothel2010-10-261-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New type definition: ScreenMode { MonitorMode { SurfaceSize { Resolution, bpp }, ScreenSizeMM, refreshRate }, rotation }, where Resolution and ScreenSizeMM are of type DimensionReadOnly - ScreenMute instance is - immutable - hashable - cloneable The above allows fast query and storage w/o redundancies. More than 300 modes via permutation could be expected. ScreenMode impl. changes: ScreenImpl: To be implemented methods by native specialization: - protected int[] getScreenModeFirstImpl() - protected int[] getScreenModeNextImpl() - protected ScreenMode getCurrentScreenModeImpl() - protected boolean setCurrentScreenModeImpl(ScreenMode screenMode) The data unification etc is implemented generic using ScreenModeUtil and the 'int[]' streaming. ScreenModeStatus holds all ScreenMode related data and provides a locking strategy. ScreenModeListener provides a callback facility for ScreenMode change events. - Screens listen to ScreenModeStatus, so all FQN referenced Screen's receive the change. - Windows listen to Screen, to take appropriate action for the event (fullscreen, reshape). Misc: - Screen/Display: promoting 'addReference'/'removeReference' to public interface, so a user may trigger construction/destruction (-> junit tests, plus other clients than WindowImpl). - Gears: 'setSwapInterval' at 'reshape' instead of 'init', so it's reset when ScreenMode is changing. -
* JOGL: Reenable Applet/Webstart/RCP support for JOGL + AWT + X11Sven Gothel2010-10-1413-202/+752
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Harmonize all runtime properties, see doc/Implementation/runtime-properties.txtSven Gothel2010-10-111-1/+1
|
* Relocated RecursiveToolkitLock -> gluegen ; NEWT AWTParentWindowAdapter fix ↵Sven Gothel2010-10-095-215/+7
| | | | | | | | | | | | | | | | | | & WindowImpl debug change ; Add NEWT/AWT unit test 1 frame - 2 NewtCanvasAWT Relocated RecursiveToolkitLock -> gluegen com.jogamp.nativewindow.impl.RecursiveToolkitLock -> com.jogamp.common.util.RecursiveToolkitLock NEWT AWTParentWindowAdapter fix - minimize action if status unchanged - added missing isValid() condition before runOnEDT.. NEWT WindowImpl: - debug output only if action triggered (resize/visible) Add NEWT/AWT unit test 1 frame - 2 NewtCanvasAWT - Testing case where AWTParentWindowAdapter provokes both GLWindow instances to resize/visible
* Fix RecursiveToolkitLock: Implement complete fair FIFO scheduler ↵Sven Gothel2010-10-091-30/+67
| | | | (wait-interrupt) using a LinkedList
* Fix: NativeWindow RecursiveToolkitLock, GLWindow lockSurface/unlockSurfaceSven Gothel2010-10-071-67/+101
| | | | | | | | | | | | Fix: NativeWindow RecursiveToolkitLock - Use notify(), instead of notifyAll(), so only one thread is being awakened for the single resource. Otherwise starvation and timeout happen, since the oldest thread might not get waken up (earlier than other threads) within timeout. - Inner class for all synchronized (flow/mem) fields for easier fine grained sync/lock. Fix: GLWindow lockSurface/unlockSurface - Enter locked surface block only if surface lock could be acquired
* NativeWindow/NativeSurface Refactoring ; Added mouseClick NEWT/AWT unit testSven Gothel2010-10-064-115/+101
| | | | | | | | | | | | | | | | | | | | | | | | | NativeWindow/NativeSurface Refactoring - Using NativeSurface interface - NativeWindow extends NativeSurface, adds getLocationOnScreen(Point) - NativeWindow add: getParent() - NativeWindow/Surface: Removed 'invalidate()', use 'destroy()' if you must. - NullWindow -> ProxySurface impl NativeSurface - JOGL: Uses NativeSurface only. - GLDrawable.getNativeWindow() -> GLDrawable.getNativeSurface() Added mouseClick NEWT/AWT unit test JOGL: - GLAnimatorControl add: resetCounter() - NEWT: - GLWindow counters: return GLWindow counters always - WindowImpl - requestFocus() wait until done - reparent: readded requestFocusImpl(true), native impl skips java focusAction if reparented - X11Window: Add XRaiseWindow() in requestFocus()
* RecursiveToolkitLock default TO 5sSven Gothel2010-09-261-1/+1
|
* NEWT: Fix Display/Window/Screen OO Identity, Reparenting and requestFocusSven Gothel2010-09-233-5/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NativeWindow: Interface NativeWindow changes: - Remove 'throws' qualifier in lockSurface(), since it is not - Adding convenient 'one call' isSurfaceLockedByOtherThread() - Adding getSurfaceLockOwner() NEWT Window/GLWindow: - Unclutter Window/GLWindow relationship - save Window's indentity GLWindow's role is a GLAutoDrawable implementation aggregating (maybe even compositioning) a Window. The previous implementation just derived from the Window implementation, overwriting methods and fields - impossible to ensure sanity / completness. It was also not ensured that the added functionality of GLWindow (setVisible, destroy, ..) has been issued in case of handling the aggregated Window alone (window callbacks, ..). To solve this issue in a 1st attempt without changing the GLWindow API, Window is just an interface, being implemented by their specializations, hence sanity is intrinsic. GLWindow's added functionality is ensured by a Window.LifecycleHook interfaced implementation, registered at the aggregated Window. - Screen and Window are interfaces now (new files) - Display is an abstract class. - Their (abstract) implementations resides in impl/<BaseName>Impl - GLWindow implements Window as well - Remove Screen reference handled by setScreen(Screen) method. - Lock native parentWindow if used (createNative/reparenting) - Move lockSurface/unlockSurface from unchecked override pattern to an callback style using abstract methods lockSurfaceImpl/... - Sorting all methods to semantic sections, abstract, superinterface, .. - Reparenting: Handling different reparenting situations: - Unchanged - No change - Native Reparenting - Compatible Display/Screen, try native reparenting - Native (Re)Creation - Use destroy/create pattern - Native Creation Pending - Create later - setUndecorated() calls reconfigure Window now, ie tries to change the window actually - Don't issue 'requestFocus()' directly from the native implementation anymore, call it from the Java code. - Window/GLWindow/NewtFactory: Constructor simplification Avoid explosion of constructor overloading, ie removing the 'undecorated' variant, since this is redundant due to the 'setUndecorated(boolean)' method. - Fixed/added API documentation