aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/com
Commit message (Collapse)AuthorAgeFilesLines
* 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
* NEWT: Changed Lifecycle of Display/Screen (part 2)Sven Gothel2010-09-151-1/+1
| | | | | | | | | | | | | | | | | | | | | Window Reparenting (unification): On the fly Display/Screen creation resides in NewtFactory. Reparenting logic within Window. Handles all reparenting cases now: ACTION_NONE, ACTION_SOFT_REPARENTING, ACTION_NATIVE_REPARENTING, ACTION_NATIVE_CREATION - out.println -> err.println ++++ - Bumbed windows bat scripts to 1.6.0_21 and ant 1.8.1 - Debug: /RecursiveToolkitLock.java TO is 300s for now, while not finished. - +++ Needs more testing. Deadlocks: AWT/NEWT parenting.
* Merge branch 'master' into newt_display_unkey_threadSven Gothel2010-09-152-48/+52
|\
| * Removed COPYRIGHT.txt file, whichSven Gothel2010-09-142-48/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | is redundant due to COPYRIGHT notice in LICENSE.txt. It's product usage terms are no more applicable, since our repository is not used by Sun Microsystems to deliver a product. LICENSE.txt changes: - Updated SGI FreeB license reference from 1.1 to 2.0 - Dropped Sun alternative license, which is redundant due to the FreeB 2.0 license. - Added JogAmp Community and common denominator: New BSD 3-clause license README: - Added contacts - Sun -> JogAmp - Added Michael Bien Changed 'Sven Gothel' and 'Michael Bien' New BSD 3-clause license to 'JogAmp Community' Simplified BSD 2-clause license.
* | NEWT: Changed Lifecycle of Display/ScreenSven Gothel2010-09-101-0/+38
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Display/Screen: - Removed Display reusage by unique TLS key: type + name, instead use user-responsibility or Destroy-When-Unused (usage reference count). - Removed X11 Display TLS pool usage - Display creation means i, incl the later native one (X11). - Added reference counting as follows: - Display's refCount: number it is referenced by Screen: display.addReference()/display.removeReference() - Screen's refCount: number it is referenced by Window: screen.addReference()/screen.removeReference() - Lazy creation using refcount 0 -> 1 All resources are created when they are needed. This also removes redundant native Display/Screen objects, ie in case of [AWT] reparenting. - Default lifecycle is user-responsibility, ie no Destroy-When-Unused, where Window may be destroyed unrecoverable, which removes the Screen reference only. - If using optional Destroy-When-Unused a Window may be destroyed unrecoverable, which removes the Screen reference: Screen.removeReference(); IF Screen.refCount == 0 THEN Screen.destroy(); Display.removeReference(); IF Display.refCount == 0 THEN Display.destroy(); - Use Destroy-When-Unused lifecycle for all automatic created Display/Screen instances (GLWindow, NewtCanvasAWT,..) - Display/Screen destroy/create cycles valid, ie you can reuse destroyed Display/Screen's - EDTUtil: - Created right away. - Started always via invoke, if not running. - DefaultEDTUtil: - Simplified locking a bit locking on: - edtLock for start/stop - edtTasks for tasks queue - invoke-wait doubles check shouldStop - invoke-wait 'waiting' outside of edtLock +++ NEWT: Cleanup - Window.destroy/invalidate: deep -> unrecoverable - Window.isNativeWindowValid() -> Window.isNativeValid() to unify with Display/Screen - Window.isDestroyed() -> Window.isValid() to unify and simplify logic. Returns false if destroy(true) has been called. - NewtFactory.wrapDisplay(.. handle) -> NewtFactory.createDisplay(.. handle), since it actually creates a compatible display. +++ NativeWindow X11Util: Added non TLS createDisplay()/closeDisplay() +++ TODO: - Stabilize (many tests fail) - OSX
* GLAutoDrawable: setAnimator/getAnimator/invoke/display changes; NEWT: Adding ↵Sven Gothel2010-07-072-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | native repaint; Fix reparent/fullscreen New: NEWT Native Repaint ========================= Support for native repaint, which shall call display() in case no animator is running. GLAutoDrawable invoke(GLRunnable) impl. handles case if invoked on animator thread, or no animator thread is running (issueing a display() call). The impl resides in GLDrawableHelper. The Animator un-/registers itself at the GLAutoDrawable via setAnimator. New: NEWT AWT/NEWT Parenting Focus Handling ============================================ Introducing Window.FocusRunnable, to be registered at the NEWT Window, which will be executed before the native focus claim. Window.FocusRunnable's run method returns a boolean, which determines whether the native implementation shall proceed claiming the native focus. This API focus hook is necessary to allow an optional underlying windowing toolkit, ie AWT (see usage NewtCanvasAWT), to make the focus traversal transparent. Fix: GLEventListener / GLDrawableHelper ======================================== GLEventListener's init() and glViewport()/reshape() method must be called before the 1st display() and after a dispose() call. It could miss the 1st display() call if added after the setVisible(true) call - due to the native repainting. The impl resides in GLDrawableHelper. Fix: Misc NEWT ============== Window reparent issues a resize() and display() call, if it is visible. native Window uses direct send.*Event for input events (again), instead of enqueueing it for performance. Window impl all status change native event Java callbacks, instead of having duplicated code in all implementations. Fullscreen, reposition at zero. Reparent/Fullscreen repaint if visible. Native reparent/fullscreen, fix glitches on Windows (visibility while reparenting)
* Merge branch 'master' of github.com:sgothel/joglSven Gothel2010-06-261-1/+1
|\
| * Provide a classloader for all reflection driven classloading ops.Michael Bien2010-06-171-1/+1
| | | | | | | | | | - attempt to solve some issues in module systems - all classes are now loaded with the same classloader which loads GLProfile