aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes/jogamp
Commit message (Collapse)AuthorAgeFilesLines
* OSX/Java7 JAWT/JAWTUtil: Support OSX/Java7 CALayer only JAWT mode; Cleanup ↵Sven Gothel2012-02-131-12/+65
| | | | | | | | | JAWT/JAWTUtil - Support OSX/Java7 CALayer only JAWT mode - Cleanup JAWT/JAWTUtil while moving elaborated logic and data to JAWTUtil, leave generated JAWT simple.
* NativeWindow/OSX: Fix Offscreen CALayer SIGSEGV @ Shutdown (Cleanup referencing)Sven Gothel2012-01-192-19/+20
| | | | | | | | | | - allocate CALayer w/ invoking init: [[CALayer alloc] init] - attach CALayer to JAWTSurfaceLayer w/o autorelease: surfaceLayers.layer = layer; // already incr. retain count - destroy CALayer @ JAWTWindow destroy
* WindowsJAWTWindow: unlock() invalidates the 'hdc' (surfaceHandle)Sven Gothel2012-01-091-0/+1
|
* GLContext/NativeSurface Impl's toString(): Add lock.toString()Sven Gothel2012-01-083-3/+9
|
* CgDynamicLibraryBundleInfo: Add TempJarCache usage for atomic native jar (of ↵Sven Gothel2011-12-181-0/+2
| | | | | | | atomic java JAR) - GLProfile, NWJNILibLoader, NEWTJNILibLoader: Issue Platform.initSingleton() upfront within priviledge block.
* New Interface 'OffscreenLayerOption', impl. by JAWTWindow (impl) and ↵Sven Gothel2011-12-171-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | NewtCanvasAWT/GLCanvas (delegation) ; Fix GLCanvas OffscreenLayerSurface usage. JAWTWindow.destroy(): - No more getGraphicsConfiguration().getScreen().getDevice().close() call, since the configuration (hence the device) is passed @ creation and owned by the caller. New Interface 'OffscreenLayerOption', impl. by JAWTWindow (impl) and NewtCanvasAWT/GLCanvas (delegation) - Abstract offscreenLayer option to be delegated by using classes - Allow offscreen testing of GLCanvas as well (like NewtCanvasAWT) Fix GLCanvas OffscreenLayerSurface usage - common 'createDrawableAndContext()' for context and drawable instance creation - addNotify() calls createDrawableAndContext() after super.addNotify() to be able to lock the surface (JAWTWindow) and hence to determine offscreen usage. - reshape(...) issues recreation 'dispose(true)' in case of using an offscreen layer - dispose() explicitly destroys the JAWTWindow NewtCanvasAWT: - explicitly close the device of the JAWTWindow (as GLCanvas does) Tests: com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer01GLCanvasAWT com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer02NewtCanvasAWT
* New GLProfile.ShutdownType: SHARED_ONLY / COMPLETE - Enhance/Fix Lifecycle ↵Sven Gothel2011-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | Management - Leave Platform, .. TempJarCache untouched. - GLDrawableFactoryImpl*: Leave DynamicLibraryBundle(lib-binding) untouched, for NativeLibrary, JNILibLoaderBase (JNI libs), .. consistency. - SHARED_ONLY: shutdown shared GLDrawableFactoryImpl* resources and NativeWindowFactory - COMPLETE: additionally shutdown GLContext* Clear all cached GL/GLX proc-address and device/context mappings. - Use new "GLProfile.shutdown(GLProfile.ShutdownType.SHARED_ONLY)" in Applets - X11GLXDrawableFactory Shutdown: Uncomment close/destroy of shared resources. - JAWTWindow.destroy(): Close the delegated device. In case it's X11 this closes the exclusive opened X11 Display.
* Adapt to GlueGen commit 7e6cf46ed2e0e9772f79e06437596056efa8c682: ↵Sven Gothel2011-12-011-1/+1
| | | | JNILibLoaderBase addNativeJarLibs(..)
* Minor edits.Sven Gothel2011-12-013-11/+38
|
* X11Util / GDISurface RobustnessSven Gothel2011-12-012-48/+58
| | | | | | | | X11Util: - shutdown: keep list of displays, if not really closed. - Init default display name in initSingleton. GDISurface: Check ReleaseDC and throw exception if fails
* Move manual GDI utils to GDIUtil ; Minor cleanup.Sven Gothel2011-12-013-22/+128
| | | | | | RegisteredClassFactory: Reference the factories itself instead of the RegisteredClass. This enables the shutdown hook to clear the factories state, which is required for proper recreation.
* MacWindow: Impl. DriverUpdatePosition; Alias position2TopLevel -> ↵Sven Gothel2011-11-271-2/+2
| | | | | | | | getLocationOnScreenImpl Since the MacWindow position needs to be changed in concert with the parent, we need to be triggered to update ours. AWTParentWindowAdapter issues 'updatePosition()' if DriverUpdatePosition is implemented.
* JAWTWindow: Impl. insets (if AWT component is a Container)Sven Gothel2011-11-271-3/+14
|
* Revert some changes: X11Screen/RANDR, X11Util (XInitThreads/XLockDisplay), ↵Sven Gothel2011-11-261-2/+10
| | | | | | | | | | | | | | | NEWT XDisplay Locking Revert X11Screen RANDR commit 8cecd0c2963d982aa119cbb07698e56b9c271188, ie. use default 'render' display connection, best results on Ubuntu, Solaris, CentOS (no failures). Revert X11Util (XInitThreads/XLockDisplay) rational logic, commit 0314be79a7a93931a74fe4322bc78e699d7741e9, X11Util.HAS_XLOCKDISPLAY_BUG:=true and X11Util.XINITTHREADS_ALWAYS_ENABLED:=true. Which enables always utilizing XInitThreads() either before or after AWT initialization, as well as disable all XLockDisplay/XUnlockDisplay locks. Rever NEWT XDisplay X11 basic Locking commit 50100b85ce5fde48788efbc2211b26fb9d7c9dfd, ie use null locking if X11Util.HAS_XLOCKDISPLAY_BUG and X11Util.XINITTHREADS_ALWAYS_ENABLED.
* X11Util: Remove wrapped/locked X11Lib methodsSven Gothel2011-11-266-228/+12
| | | | | We shall lock a level above due to differentiation of XLockDisplay/RecursiveLock using X11/AWT ToolkitLock.
* MacOSXJAWTWindow: Also need to fix (onscreen:=false) of the encapsulated ↵Sven Gothel2011-11-261-1/+5
| | | | GraphicsConfiguration
* X11Util.shutdown(): Remove x11IOErrorHandlerSven Gothel2011-11-261-0/+2
|
* X11Util: Cleanup ATI_HAS_XCLOSEDISPLAY_BUG API doc.Sven Gothel2011-11-261-9/+22
|
* X11AWTGraphicsConfigurationFactory: Use lock: owner ? AWT-Lock : X11-AWT-LockSven Gothel2011-11-261-1/+1
|
* NativeWindow X11 Locking: Fix XInitThreads/XLockDisplay/XUnlockDisplay Usage ;Sven Gothel2011-11-253-53/+68
| | | | | | | | | | | | XLockDisplay/XUnlockDisplay shall only be used if XInitThreads() was successful, otherwise it has no effect (X11 spec). - Only issue XInitThreads() if firstX11ActionOnProcess==true, store result to determing whether we can utilize XLockDisplay/XUnlockDisplay. - If we cannot utilize XLockDisplay/XUnlockDisplay, use RecursiveLock - NativeWindowFactory: Only return AWTToolkitLock or X11JAWTToolkitLock if explicitly requested
* JAWTWindow: remove validateNative() ..Sven Gothel2011-11-254-60/+3
| | | | | - remove validateNative() - don't dispose AWT component, since we are an immutable uplink (was disposed if Window)
* NativeWindow X11GraphicsDevice: Pass 'owner' for close-display operation @ ↵Sven Gothel2011-11-251-1/+3
| | | | constructor
* JOGL/NativeWindow: Push down JOGL's X11AWTGLXGraphicsConfigurationFactory to ↵Sven Gothel2011-11-251-0/+185
| | | | | | | | | | | | | | NativeWindow X11AWTGraphicsConfigurationFactory X11AWTGraphicsConfigurationFactory properly construct a AWTGraphicsConfiguration encapsulated a native X11GraphicsConfiguration, now available for non JOGL modules, ie NEWT. AWTGraphicsConfiguration's create() utilizes the X11AWTGraphicsConfigurationFactory via the generic factory mechanism and hence allows encapsulating a native [X11]GraphicsConfiguration. NewtCanvasAWT creates/destroys the JAWT NativeWindow on addNotify/removeNotify (reparentWindow) again. Hence the JAWTWindow is instantiated completly only, instead of utilizing updateConfiguration(..), which simplifies the mechanism.
* GraphicsConfigurationFactory: Kick off 'registerFactory' via static method ↵Sven Gothel2011-11-233-2/+6
| | | | | | instead of constructor for clarity. - prepare for 'jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory'
* NativeSurface's getGraphicsConfiguration() returns the native (delegated) ↵Sven Gothel2011-11-237-15/+20
| | | | | | | | | | | AbstractGraphicsConfiguration, if delegation is used. This change restricts the usage of AbstractGraphicsConfiguration's getNativeGraphicsConfiguration() to NativeSurface implementations and hence reduces complexity. NativeSurface implementations are adapted and access to it's AbstractGraphicsConfiguration is controlled via get/set method avoiding flawed usage (read/write), since read access shall return the delegated AbstractGraphicsConfiguration, if used.
* Fix X11Util.dumpOpenDisplayConnection() ; Bug 515: Update fglrx driver ↵Sven Gothel2011-11-231-5/+5
| | | | remark and native test.
* NativeWindow GraphicsDevice javadoc cleanup / Factory method access cleanup ↵Sven Gothel2011-11-212-4/+9
| | | | (minor edits)
* Initialize JAWTUtil/JAWTJNILibLoader in static initialzier block, not ↵Sven Gothel2011-11-212-3/+8
| | | | leaving privileged block
* Fix OS X JAWT SIGSEGV @ NEWT Window creation ; Reloc ↵Sven Gothel2011-11-185-47/+94
| | | | | | | | | AttachJAWTSurfaceLayer() OSXUtil -> MacOSXJAWTWindow Threading/sync issue when creating a NEWT window, which issues a Java callback from native code (positionChanged()). The latter requires a location validation w/ getLocationOnScreen() involved. Hence getLocationOnScreen() shall not lock the JAWT native resources, since it may not be ready yet (-> threading/sync issue).
* OSXUtil: Remove (ClassLoader) dependency on JAWT_DrawingSurfaceInfo (dirty hack)Sven Gothel2011-11-121-2/+4
| | | | .. need to move the attach/detach surface layer NIO methods to a AWT OSX class.
* OS X Layered View Part8: Generalize OffscreenLayerSurface ; Use local JAWT ↵Sven Gothel2011-11-125-100/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | instance ; Applet's on OS X are working Generalize OffscreenLayerSurface - Using new OffscreenLayerSurface allows using this functionality in a clean manner, ie. no 'dirty' usage of MacOSXJAWTWindow in a JOGL GL class. - 'Promoting' OffscreenLayerSurface functionality to JAWTWindow and it's handling to GLDrawableFactoryImpl::createGLDrawable(). - Move MacOSXCGLDrawableFactory's "MacOSXJAWTWindow getLayeredSurfaceHost(NativeSurface surface)" to NativeWindowFactory "OffscreenLayerSurface getOffscreenLayerSurface(NativeSurface surface, boolean ifEnabled)" Use local JAWT instance - Only w/ a local JAWT instance per JAWTWindow it is possible to switch between offscreen-layer and onscreen. We also have to determing offscreen-layer lazy at surface lock, since only at that time we have knowledge whether it's an Applet or not. +++ ContextUpdater: Use local pthread mutex, add DEBUG output JAWTWindow/NewtCanvasAWT: Adding methods to request offscreen-layer-surface (if supported), besides 'if applet' this may trigger the new functionality. +++ Applet's on OS X are working: - OS X 10.6.4 - Safari: - Hangs for a while at start .. whole screen freezes .. approx. 10s - Sometimes crashes when Applet stops - after all our resources are released! - Keyboard input isn't assigned sometimes. - Otherwise .. works well, incl. offscreen/onscreen parenting - Firefox 8.0: - Hangs for a while at start .. whole screen freezes .. approx. 10s - Sometimes crashes when Applet stops - after all our resources are released! - Keyboard input is never assigned. - Otherwise .. works well, incl. offscreen/onscreen parenting - OS X 10.7 - Safari: - Sometimes crashes when Applet stops - after all our resources are released! - Keyboard input isn't assigned sometimes. - Otherwise .. works well, incl. offscreen/onscreen parenting - Firefox 8.0: - Sometimes crashes when Applet stops - after all our resources are released! - Keyboard input is never assigned. - Otherwise .. works well, incl. offscreen/onscreen parenting
* Nativewindow: Introduce API private MutableGraphicsConfigurationSven Gothel2011-11-122-2/+51
| | | | | MutableGraphicsConfiguration allows derivations to set the chosen capabilities, hence it is a non public API from which eg. JOGL GraphicsConfiguration derive.
* OS X Layered View: Part7 Allow NEWT onscreen MacWindow to be used incl ↵Sven Gothel2011-11-112-6/+12
| | | | | | reparenting Test: enable NEWT 'onscreen' case
* Revert introduction of NativeSurfaceHolder and NativeWindowHolder interfacesSven Gothel2011-11-113-18/+0
| | | | | | | | | | | | | I was too fast introducing these accessors, since they are currently not needed and hence redundant. Complete - 7bc4c218b47033cb66f4eb5e707a86a0a4e60cff Partial in regards to the holder interfaces only: - d8fa00d35a49f4faf5f04aeb7e2bba4e972965f5 - f51e3dad6c4bd1f6d0001cecf6a0f692400ed602 - 46542168d64b37f544f61802693f15b59b224e4e
* OS X Layered View: Part6 (native) Using a root CALayer where we ↵Sven Gothel2011-11-102-73/+83
| | | | | | | | | | | | | | | | | attach/detach our GL one - it seems to be more stable, having one root CALayer attached to the JAWT_SurfaceView forever - tackles crach at GL layer destruction - proper release of all GL layer resources - now final [gl-layer dealloc] happens at very destruction of JAWT object, even though it was removed from root-layer earlier (and all other references) - see comment in MacOSXWindowSystemInterface-pbuffer.m :: createNSOpenGLLayer(..) - at least no more crash .. and resource release ASAP, but the GL-layer itself (see above)
* Fix MacOSXJAWTWindow: Impl. SurfaceChangeable ; Proper invalidateNative()Sven Gothel2011-11-102-11/+38
| | | | | | | | | | Impl. SurfaceChangeable (regression 8f5465396fe429ce6b7ecae808416691271c7867) - offscreenSurfaceLayer code requires instanceof SurfaceChangeable - overwrite JAWTWindow size getter: use surfaceSizeChanged() values if used. Proper invalidateNative() - detach JAWTSurfaceLayer if set - destroy dummy NSWindow (was typo)
* Fix regression JAWTWindow/AWTGraphicsConfiguration ↵Sven Gothel2011-11-101-0/+11
| | | | | | | | | | | updateGraphicsConfiguration() of commit 46542168d64b37f544f61802693f15b59b224e4e While introducing NewtCanvasAWT's lifetime reference of (JAWTWindow) nativeWindow using updateGraphicsConfiguration() to determine the actual config values at addNotify(), it was overseen that the AWTGraphicsDevice needs to be re-validated. JAWTWindow's validateNative() ensures that the AWTGraphicsDevice reflects the platform native handle where required (X11).
* NativeWindow minor edits: Remove warnings (generics, imports, ..)Sven Gothel2011-11-102-10/+10
|
* NativeWindow: SurfaceChangeable::setSize() -> surfaceSizeChanged() to avoid ↵Sven Gothel2011-11-093-7/+2
| | | | | | | | | | | | conflicts with setSize() This fixes the NEWT OffscreenWindow conflict w/ setSize() which represents the action of changing the window's size. SurfaceChangeable's surfaceSizeChanged() merily notifies the actual size. JAWTWindow: Remove setSize() since it propagates the surface size upstream only. MacOSXJAWTWindow is not SurfaceChangeable complete (no surfaceSizeChanged).
* OS X Layered View: Part5 NEWT/AWT Interaction ; Fix NSOpenGLLayer pos ; CleanupSven Gothel2011-11-094-23/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better JAWT* name for offscreen layer surface: - MacOSXCGLDrawableFactory, JAWTUtil, JAWTWindow, MacOSXJAWTWindow - FIXME: Need to get rid of the cached JAWT instance, in case we like to have dual usage of offscreenLayerSurface and onscreen. This would be done implicit by using NEWT .. hence low prio. AWTGraphicsConfiguration: - Fix create(): Use capsRequested for AWT aligned caps if capsChosen is null. (was capsChosen .. which is null) - Add updateGraphicsConfiguration() which allows to update the AWTGraphicsConfiguration. NewtFactoryAWT: - Add updateGraphicsConfiguration() .. entrypoint for AWTGraphicsConfiguration.updateGraphicsConfiguration() NSOpenGLLayer Impl: - For 'some reason' the layer's position is initially negative, fix it @ 1st 'draw' - Re-add CVDisplayLink OpenGL setting .. for what it's worth .. I don't know JAWTWindow: - Remove test setting: Only enable offscreenLayerSurface for applets if avail. (New unit test enables it seperatly) NewtCanvasAWT: - If NEWT child is offscreen, attach AWTMouseAdapter and AWTKeyAdapter to route these AWT input events to NEWT. - Don't loose-focus if NEWT child is offscreen. - Impl. NativeSurfaceHolder, NativeWindowHolder - NativeWindow is created at construction and it's GraphicsConfiguration updated at addNotify(..). - At addNotify/reparent: try harder to determine proper NEWT child size: - use preferred size if set - use minimum size if set - subtract insets from container size OffscreenWindow/WindowImpl: - Allow setSize() .. currently NOP for offscreen. - WindowImpl: Commented out recreate case for offscreen-setSize .. TEST: com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer01AWT Passed tests: - GLCanvas - NewtCanvasAWT/OffscreenWindow
* OS X Layered View: Part3 JAWTWindow/MacOSXJAWTWindow (Java/Native)Sven Gothel2011-11-093-23/+80
| | | | | | | | | | | | | | | | JAWTWindow: - Add comment about caller of cstr, since it uses reflection - Field 'config' is of type AWTGraphicsConfiguration, validate and type it - Impl. NativeSurfaceHolder/NativeWindowHolder 'hooks' MacOSXJAWTWindow: - Use agnostic JAWTUtil.isJAWTVersionUsingOffscreenLayer() to determine 'isOffscreenLayeredSurface'. We may promote this notion to JAWTWindow, which already holds 'isApplet' - lockSurface() case 'isOffscreenLayeredSurface': - Create dummy NSWindow (OSXUtil) for getWindowHandle() - Fix chosen caps: offscreen
* Minor edits: remove redundanciesSven Gothel2011-11-091-3/+0
|
* NativeWindow: Add accessor interfaces NativeSurfaceHolder and NativeWindowHolderSven Gothel2011-11-092-0/+10
| | | | | | | | | | | | | | | | | - NativeSurfaceHolder interface allows access to it's implementation's NativeSurface reference. - NativeWindowHolder interface allows access to it's implementation's NativeWindow reference. Implement or extend interface w/ these accessors whereever it seems fit: - NEWT Window - GLDrawable These accessors allow lower layers to retrieve the NativeSurface/Window instance w/o knowledge of the 'upper' frameworks, ie. NativeWindow/JOGL or JOGL/NEWT. Commited in followups (due to mixed semantical changes in those files): - JAWTWindow - NewtCanvasAWT - Some NEWT impl.
* NativeWindow/JOGL: NativeSurface adds add/remove SurfaceUpdateListenerSven Gothel2011-11-062-2/+103
| | | | - SurfaceUpdateHelper contains impl. used by NativeSurface implementations.
* Impl layeredSurface (java/native):Sven Gothel2011-11-052-47/+130
| | | | | | | | - OSXUtil: NSView backing creation - OSXUtil: AttachJAWTSurfaceLayer - MacOSXCGLContext.create(): Attach NSOpenGLLayer if layered - MacOSXCGLDrawable.updateHandle(): if direct: add NSView backing layer - MacOSXCGLDrawable: Add getNSViewHandle() to distinguish between NSView and none (CGL/pbuffer)
* Cleanup ; JAWT* version flag setting based whetherSven Gothel2011-11-054-21/+34
| | | | | | | | | | Cleanup - use Platform OS_TYPE - .. JAWT* version flag - if JAWTWindow is Applet, attempt offscreenLayer if avail - ..
* MacOsX/JAWT_SurfaceLayers/CALayers: Kick off / JAWT_getAWT() CALAYER version ↵Sven Gothel2011-10-293-18/+88
| | | | support.
* OSX: Avoid invoking JNI or performSelectorOnMainThread in JNI if already ↵Sven Gothel2011-10-131-1/+5
| | | | mainThread
* OSX/SWT: Adding OSXUtil: RunOnMainThread(), IsMainThread() / Utilizing those ↵Sven Gothel2011-10-132-21/+54
| | | | | | | | | | | | | | for SWT access/calls Adding OSXUtil: RunOnMainThread(), IsMainThread() - Issuing a native call where the user Runnable is to be performed on the main thread - Enable query if we are on the main thread. Utilizing those for SWT access/calls - Using the above to call all SWT functions on the main thread if required (incomplete) TODO/Issues: - JOGL OSX CGL Context fails, ie expecting NS, but having CGL
* NEWT/OSX: Fix erroneous child Window position and top-parent visibilitySven Gothel2011-10-111-1/+1
| | | | | | | | | | | | | | | | | - Regardless whether the window is a top-level or child window, we set it's position w/ absolut left-bottom coordinated. To do so even for an AWT parent component, we retrieve the screen position by traversing through the AWT tree and adding up each parent's rel. position, since the native view only reflects the AWT frame. Note: OSX does not use native views for each AWT component. - In case we reparent child -> top, we cannot orderOut() the ex parent, but need to just call orderBack(..), otherwise the whole ex-parent frame gets hidden. - In case we close a child window (and reparent child -> top), we need to remove the parent/child relation and orderOut(..) before close(..), otherwise the window artifact is left behind.