summaryrefslogtreecommitdiffstats
path: root/src/newt/classes
Commit message (Collapse)AuthorAgeFilesLines
* NewtCanvasAWT: Handle 'lost' child and fullscreen case.Sven Gothel2012-01-162-31/+62
| | | | | | | NewtCanvasAWT may loose it's parent role (reparenting). In such cases it shall no more handle focus events. Focus handling is also no more desired in case the child is in fullscreen mode.
* NEWT childWindow: No autoPosition, use 0/0 as default.Sven Gothel2012-01-161-4/+10
|
* NEWT/OSX Pointer Invisible Fix: 10.6.* responder declarations & test ↵Sven Gothel2012-01-161-2/+2
| | | | | | | | | | | | | focus/isInside On OS X 10.6.8 the lack of responder method declarations (mouseEntered, ..) lead to ignore the impl. callbacks. 'isMouseInside' cannot rely on 'mouseExit'/'mouseEntered' when setMouseInvisible() is being called, deduce it manually. focusLost == mouseExit (OS X behavior), hence focusGained needs to set mouse invisible/visible in case it's requested.
* NEWT/OSX Performance Fix: Cache CGDisplayScreenSize() result, since it's ↵Sven Gothel2012-01-131-3/+23
| | | | | | | ridiculous slow Each call to CGDisplayScreenSize() took around 6ms (5ms .. 20ms, avrg 6ms) which added up to ~2s for ~400 Screen modes.
* GLContext/NativeSurface Impl's toString(): Add lock.toString()Sven Gothel2012-01-082-2/+3
|
* GLContext*/GLDrawableHelper: Fix consistency of recursive ↵Sven Gothel2012-01-081-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | makeCurrent()/release()/destroy() calls ; Enable context switch tracing ; GLCanvas: proper AbstractGraphicsDevice destruction GLContext*/GLDrawableHelper: Fix consistency of recursive makeCurrent()/release()/destroy() calls Utilizing volatile and lock.tryLock(0) for lockConsiderFailFast(), reducing redundant synchronization and using RecursiveLock implicit sync. GLContext 'early-out' is the case where the thread already holds the context, ie. context is already current and the native makeCurrent is skipped. makeCurrent()'s 'early-out' w/o incr. the recursive lock of GLContext and it's NativeSurface could lead to asymetry in lock/unlock count with release()/destroy() calls. The 1st release actually released the native ctx already. Properly utilize recursive lock/unlock in all cases and impl. 'early-out' after locking. Following the above in GLDrawableHelper.invokeGL()'s 'early-out' case as well, ie calling makeCurrent()/release() symmetrical. Introduce GLDrawableHelper.disposeGL(), which issues dispose on all GLEventListeners within a current context and issued context destruction directly. This simplifies GLAutodrawable's destroy/dispose calls and ensures that the above sequence of events happens atomically (lock is being hold until destruction). Enable context switch tracing If property 'jogl.debug.GLContext.TraceSwitch' is defined, trace context switch. GLCanvas: proper AbstractGraphicsDevice destruction
* NEWT/Android: MonitorMode: Don't validate refreshRate (0 on some devices); ↵Sven Gothel2011-12-262-3/+6
| | | | AndroidWindow: Trigger ScreenModeChanged only if Screen is already valid.
* ScreenImpl.ScreenMode: getOrAdd current ScreenMode.Sven Gothel2011-12-241-14/+20
| | | | | On Gnome it happend that the current mode was not 'scanned' by RandR, hence adding it if not existing helps stability.
* NEWT Windows/X11: Remove missed negative coordinate restrictions.Sven Gothel2011-12-243-10/+5
|
* NEWT Screen: Add virtual top-left origin getX()/getY() ; WindowsWindow.c: ↵Sven Gothel2011-12-2412-60/+98
| | | | | | | | | | | | | | | | | | allow negative coordinates - ScreenImpl: - Use Point & Dimension for holding virtual origin and size - updateScreenSize() -> updateVirtualScreenOriginAndSize() - DimensionImmutable getNativeScreenSizeImpl() -> void getVirtualScreenOriginAndSize(Point virtualOrigin, Dimension virtualSize) - WindowImpl setFullscreen(true): Use Screen virtual origin - WindowsWindow.c - For x/y coords use GET_X_LPARAM/GET_Y_LPARAM which casts '(int)(short)' to preserve negative coordinates. - NewtWindow_setVisiblePosSize() allow negative coordinates
* Fix regression of commit: 3f5df93484a2ea97c6e51a717f05d9ddcec64d84 (compile ↵Sven Gothel2011-12-231-2/+2
| | | | error, private field access)
* NEWT/OSX MacWindow.close(): More conservative closing approach.Sven Gothel2011-12-231-3/+6
| | | | | | | | | | | Closing: - Java: Set handle to null - Native: - Don't release the NSView explicit, but rely on NSWindow's release - Don't use NSWindow close() but simply call release() instead. The latter doesn't produce a crash SIGSEGV on exit in some cases. OSX 10.7.2, NV GPU
* Screen: width/height reflects virtual Screen size (-> big-desktop)Sven Gothel2011-12-2311-50/+110
| | | | | | | | | | Add updateScreenSize() utilizing new getNativeScreenSizeImpl() to set/update the virtual Screen size. This replaces setScreenSize() where the ScreenMode dimension was being used which doesn't reflect the virtual size. ScreenMode Test Impact: We cannot assertEquals(sm.getRotatedWidth(), screen.getWidth()), since ScreenMode size != virtual size.
* NEWT Multi-Monitor 1/2: Allow negative window position; Validate Screen-Index;Sven Gothel2011-12-2314-24/+63
| | | | | | | | | | | | | | | | - Allow negative window position, using flag 'autoPosition' to mark a custom user position. This impacts Windows and X11 window creation code, which supports native auto positioning. - Screen: Validate Screen-Index. In 'big-desktop' mode the Screen index is always 0. This is true for X11 with Xinerama enabled and MS-Windows in general. Platforms w/o multiple Screen support always use index 0. - X11: Separate X11 Display/Screen/Window native code in their respective C files - Windows test scripts: use '%*' to catch all arguments - Add missing (c)
* NEWT OSX: Add native ScreenMode impl. - TODO: Programmatically set the ↵Sven Gothel2011-12-202-4/+60
| | | | | | | rotation! (How to ?) Get/Set ScreenMode impl on OSX. Set is limited to resolution and size, since I don't know how to change the rotation.
* NEWT initScreenModeStatus(): Issue setScreenSize() to update screen size ↵Sven Gothel2011-12-202-2/+13
| | | | | | | | based on native RANDR (more correct) Clarify Screen's getWidth(), getHeight() values (-> rotated) Also add DEBUG output for collected native modes and nativeIdx mapping.
* Fix bug 531. Thx to Sebastien (finding) and Julien (fixing) it.Sven Gothel2011-12-181-3/+3
| | | | | | | https://jogamp.org/bugzilla/show_bug.cgi?id=531 Sorry .. we normally don't add credits in these git logs, maybe we should change that to encourage contributors!?
* 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-172-21/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix GLDrawableFactory lack of GLProfile initialization in case get*Factory() ↵Sven Gothel2011-12-132-2/+0
| | | | is called 1st, add tests. Add performance numbers of init/shutdown in tests.
* JOGLNewtApplet1Run: Config and add GLEventListener before hooking ↵Sven Gothel2011-12-111-7/+7
| | | | GLWindow/NewtCanvasAWT to AWT Applet Container
* Fix concurrency bug of GLProfile initialization ; Fix SharedResourceRunner ↵Sven Gothel2011-12-113-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'dead' thread (Applets) GLDrawableFactory: - clarify: public getWasSharedContextCreated(..) -> protected createSharedResource(..) - add: getSharesResourceThread() GLProfile: - proper locking of initSingletion(..) path: - Use RecursiveThreadGroupLock and add/remove GLDrawableFactory's sharesResourceThread while creating it's the sharedResource. This simplifies and fixes GLProfile's locking code. - Fix and simplify initSingleton(boolean) API doc - mark it deprecated. - Add initSingleton() for controlled initialization only, pairing w/ shutdown(..) Remove initSingleton(boolean) calls in code and test! +++ Fix SharedResourceRunner 'dead' thread (Applets) In Applets, stopping an Applet makes the browser Java plugin interrupting and killing all related threads, including our SharedResourceRunner thread. - Validate whether the shared resource thread is alive - Catch interruption in shared resource thread and assume it's a kill signal - releaseSharedResource: clear devicesTried set
* NEWT EVENT_MOUSE_WHEEL_MOVED: Fix Bug 413 - Generate proper mouse wheel events.Sven Gothel2011-12-024-3/+68
| | | | | | | | | | > 0: UP < 0: DOWN See MouseEvent.getWheelRotation() for details. OSX/Windows: Default to wheel 'button' 1 OSX: Properly report '<0' X11: Synthesize wheel events by mapping buttons 4/5 and 6/7 to wheel 1 and 2.
* New GLProfile.ShutdownType: SHARED_ONLY / COMPLETE - Enhance/Fix Lifecycle ↵Sven Gothel2011-12-011-4/+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.
* Fix Bug 522: NEWT requestFocus() causes a crash if !isNativeValid()Sven Gothel2011-12-011-1/+1
|
* Adapt to GlueGen commit 7e6cf46ed2e0e9772f79e06437596056efa8c682: ↵Sven Gothel2011-12-011-1/+1
| | | | JNILibLoaderBase addNativeJarLibs(..)
* Move manual GDI utils to GDIUtil ; Minor cleanup.Sven Gothel2011-12-012-6/+2
| | | | | | 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.
* JOGLNewtApplet1Run: Issue GLProfile.shutdown() to adapt to the 'new' plugin ↵Sven Gothel2011-11-301-3/+5
| | | | | | | | | | | | lifecycle. Applet 'restart' (init.start.stop.destroy .. init.start...) didn't work on Windows browsers (Firefox, Safari, Chrome, ..) w/ JVM 6u26..6u29. It seems that after destroy we loose the ClassLoader already (plugin2) hence we need to bind to the native resources again. Solution is to map the JOGL lifecycle of GLProfile [initSingleton()..shutdown()] to the Applet's [init..destroy].
* NEWT ScreenMode: Use unified ScreenMode in impl; X11Screen: Be verbose if TO ↵Sven Gothel2011-11-282-7/+7
| | | | reached, ie not successfully changed mode.
* NEWT MacWindow: Fix positionChange() Usage ; Fix getLocationOnScreenImpl()Sven Gothel2011-11-271-32/+27
| | | | | | | | | - Native invocation of positionChange(x,y) uses screen coordinates of client area. Manual invocation shall respect the semantics - hence calling super.positionChanged w/ client coords. - getLocationOnScreenImpl() shall return the screen coordinates of the client area - Use getTopLevelLocationOnScreen(), ie substract Insets of getLocationOnScreenImpl()
* MacWindow: Impl. DriverUpdatePosition; Alias position2TopLevel -> ↵Sven Gothel2011-11-273-70/+84
| | | | | | | | 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.
* NEWT: Add DriverUpdatePosition interface; Clarify NativeWindow API doc ↵Sven Gothel2011-11-272-1/+10
| | | | | | | (position) DriverUpdatePosition: Interface tagging driver requirement of absolute positioning, ie. depend on parent position.
* NEWT OSX: Add stopNSApplication(), revert commit ↵Sven Gothel2011-11-272-7/+28
| | | | c26d6005e1fe74e9aee01d9d72942f566884fcd2
* Revert some changes: X11Screen/RANDR, X11Util (XInitThreads/XLockDisplay), ↵Sven Gothel2011-11-262-6/+18
| | | | | | | | | | | | | | | 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.
* X11Screen RANDR: Use temp display connection due to arbirary failures sometimesSven Gothel2011-11-261-6/+5
|
* X11Util: Remove wrapped/locked X11Lib methodsSven Gothel2011-11-261-2/+2
| | | | | We shall lock a level above due to differentiation of XLockDisplay/RecursiveLock using X11/AWT ToolkitLock.
* NEWT X11Screen: Update X11 RANDR / GL locking test code (still commented out)Sven Gothel2011-11-261-8/+13
|
* NEWT/GLContextImpl: Refine API doc, NEWT: Display name -> connection nameSven Gothel2011-11-262-6/+13
|
* NEWT X11Display: Use default X11 locking for X11GraphicsDeviceSven Gothel2011-11-261-5/+15
| | | | | | | | Due to Display's reusage and hence concurrent involvement in off-thread animation, the X11 default lock is required. In case you require 2 GLWindow's w/o interference to each other (ie. locking), you need to use separate Display instances.
* NewtFactory/GLWindow: Cleanup API doc (Display lifecycle, copy or reuse, etc ..)Sven Gothel2011-11-262-22/+102
|
* Complete commit bafd9b99816f55c105230a59211caf13f0315910 (NEWT):Sven Gothel2011-11-253-9/+16
| | | | | | - WindowImpl exposes private non-delegated GraphicsConfiguration, - which is being used by GLWindow's wrapped NativeWindow instantiation (eg: AWT driver) - Fix NewtFactoryAWT.getNativeWindow() use AWTGraphicsConfiguration.create(..)
* Forgot to add JogAmp (c)Sven Gothel2011-11-254-0/+4
|
* NativeWindow X11GraphicsDevice: Pass 'owner' for close-display operation @ ↵Sven Gothel2011-11-251-7/+2
| | | | constructor
* Nativewindow AWT Device/Screen: Cleanup construction [default, specific]; ↵Sven Gothel2011-11-252-3/+4
| | | | AWTDevice: Remove subtype
* JOGL/NativeWindow: Push down JOGL's X11AWTGLXGraphicsConfigurationFactory to ↵Sven Gothel2011-11-252-50/+13
| | | | | | | | | | | | | | 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.
* NativeSurface's getGraphicsConfiguration() returns the native (delegated) ↵Sven Gothel2011-11-2312-61/+76
| | | | | | | | | | | 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.
* NEWT MacWindow: Revised offscreen FIXME tagsSven Gothel2011-11-201-6/+5
|
* NEWT/AWT Focus traversal enhancement/fix (incl. OS X fixes)Sven Gothel2011-11-194-263/+435
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - MacWindow/OffscreeSurface - Exclude native NEWT window calls in case it's an offscreen surface - MacWindow/DriverClearFocus - Introduce driver detail DriverClearFocus interface - OS X needs to clear the focus, before another TK (eg. AWT) can claim it's (native parent window focus) - MacWindow/KeyCode: - Move OS X keyCode utils to MacKeyUtil - MacKeyUtil now uses OS X virtual key codes first, before matching keyChar -> keyCode - NewtCanvasAWT - Issue all AWT 'requestFocus()' on current thread, Newt-EDT -> AWT-EDT may freeze Window's native peer requestFocus() impl. - FocusAction directly issue action on Newt-EDT, also request AWT focus if not having it (proper AWT traversal) - Add an FocusPropertyChangeListener, detecting focus lost to issue DriverClearFocus's clearFocus() if available. - merge configureNewtChildInputEventHandler() code into configureNewtChild() to simplify call tree. - WindowImplAccess: Use getDelegatedWindow()
* NEWT: Move 'focusAction()' invokation from native code to Java, avoiding ↵Sven Gothel2011-11-191-9/+21
| | | | deadlocks and simplify call-tree
* NEWT Window: Promote/Expose 'Window getDelegatedWindow()' for accessing the ↵Sven Gothel2011-11-194-8/+11
| | | | delegate (ie GLWindow)