aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
Commit message (Collapse)AuthorAgeFilesLines
* Minor: GLWindow fix size validation; GLContextImpl: Remove hold ctx lock ↵Sven Gothel2013-01-111-1/+1
| | | | count constraints at destroy.
* GLAutoDrawable/AnimatorBase: Add ExclusiveContextThread (ECT) feature; ↵Sven Gothel2013-01-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AnimatorBase: Add setModeBits/MODE_EXPECT_AWT_RENDERING_THREAD; FPSAnimator: Make transactions deterministic. ExclusiveContextThread (ECT) allows user to dedicate a GLContext to a given thread. Only the ECT will be allowed to claim the GLContext, hence releasing must be done on the ECT itself. The core feature is accessible via GLAutoDrawable, while it can be conveniently enabled and disabled via an AnimatorBase implementation. The latter ensures it's being released on the ECT and waits for the result. Note that ECT cannot be guaranteed to work correctly w/ native (heavyweight) AWT components due to resource locking and AWT-EDT access. This is disabled in all new tests per default and noted on the API doc. Note: 'Animator transaction' == start(), stop(), pause(), resume(). - Add ExclusiveContextThread (ECT) feature - GLAutoDrawable NEW: - Thread setExclusiveContextThread(Thread t) - Thread getExclusiveContextThread() - AnimatorBase NEW: - Thread setExclusiveContext(Thread t) - boolean setExclusiveContext(boolean enable) - boolean isExclusiveContextEnabled() - Thread getExclusiveContextThread() - AnimatorBase: Add setModeBits/MODE_EXPECT_AWT_RENDERING_THREAD Allows user to pre-determine whether AWT rendering is expected before starting the animator. If AWT is excluded, a more simple and transaction correct impl. will be used. - FPSAnimator: Make transactions deterministic. FPSAnimator previously did not ensure whether a transaction was completed. A deterministic transaction is required to utilize ECT. FPSAnimator now uses same mechanism like Animator to ensure completeness, i.e. Condition and 'finishLifecycleAction(..)'. Both are moved to AnimatorBase. Tested manually on Linux/NV, Linux/AMD, Windows/NV and OSX/NV. - All new tests validated correctness. - All new tests shows an performance increase of ~3x w/ single GLWindow, where multiple GLWindows don't show a perf. increase.
* NEWT WindowsWindow.c: UpdateInsets: Fix determiniation of isUndecorated - ↵Sven Gothel2012-12-301-1/+1
| | | | WS_SYSMENU is _not_ an indication!
* NEWT/Android: Fix NewtBaseActivity.getWindow() recursion if used w/o ↵Sven Gothel2012-12-251-1/+1
| | | | delegated Activity, i.e. our ActivityLauncher (Completes commit a35beb22d712b6da85a794115b19d484a12c8643)
* NEWT/Android: Fix NewtBaseActivity.getWindow() recursion if used w/o ↵Sven Gothel2012-12-241-2/+6
| | | | delegated Activity, i.e. our ActivityLauncher
* NEWT peserve 'mouseButtonModMask' to be sent for all mouse- and key events. ↵Sven Gothel2012-12-241-30/+43
| | | | | | | | | | | | | | | | TODO: NEWT Event Factories. Misc: Cleaned up spacing. On some native OS, the accumulation of pressed button modifier-mask is not available, e.g. OS X. NEWT WindowImpl.doMouseEvent(..), invoked by native NEWT events, will track the pressed mouse button modifier-mask, similar to mouseButtonPressed to synthesize the DRAGGED event. Added NEWT WindowImpl.doKeyEvent(..) to honor the pressed mouse button modifier-mask, i.e. pass it w/ key events as well. TODO: Unify synthesization of NEWT event artifacts as described by the above, allowing NEWT event translation to benefit from same code to gain same semantics. Notable: AWTNewtEventFactory and SWTNewtEventFactory
* AWT-NEWT Modifier mapping and test: part-3 (NEWT BUTTON MASK always, ..)Sven Gothel2012-12-241-8/+6
| | | | | | | | | | | | | | | | - AWTNewtEventFactory's awtModifiers2Newt: - always include NEWT BUTTON_MASK (press, release, ..) where AWT doesn't include them at release (it's only a DOWN_MASK). - Test BaseNewtEventModifiers, .. - No need to call super class Before, BeforeClass, .. manually - Use RedSquareES2 as GL demo - Adapt to AWTNewtEventFactory's modifier change above (NEWT BUTTON MASK even at release) - More descriptive error/log text - Added _mandatory_ TestNewtEventModifiersNEWTWindowAWT to test native NEWT behavior. This shall be the golden behavior all translated events shall compare w/.
* Fix 13168c99ff9e8bf71c83f1be7afee270a3db4074 / ↵Sven Gothel2012-12-232-79/+128
| | | | | | | | | | | | | | | | | 811e3791b98fea0dfa3b7d301cb532c54df8dc82: AWT-NEWT Modifier mapping - part-2 AWTNewtEventFactory: - getAWTButtonMask() -> getAWTButtonDownMask() - using proper _DOWN_MASK values (regression of commit 13168c99ff9e8bf71c83f1be7afee270a3db4074) - com.jogamp.newt.event.MouseEvent.BUTTON_NUMBER buttons - adding 'ModifierMappings.txt' to API doc header - remove obsolete 'int awtModifiers2Newt(int awtMods, boolean mouseHint)' - 'int awtButton2Newt(int awtButton)' 1:1 button name mapping Tests: - rename TestNewtEventModifiers -> BaseNewtEventModifiers to avoid being picked up by our junit testing framework. The latter tests all classes starting w/ 'Test*'
* Fix commit 811e3791b98fea0dfa3b7d301cb532c54df8dc82: Make AWT usage Java6 ↵Sven Gothel2012-12-231-55/+35
| | | | clean (was using Java7 stuff); Note: Need to test!
* Merge branch 'master' of https://github.com/sgothel/joglrhatcher2012-12-0611-224/+481
|\
| * SWT GLCanvas: Fix sporadic drop of redraw on X11 _and_ allow using custom ↵Sven Gothel2012-12-043-45/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GLCapabilities on X11 (feature complete) To allow custom GLCapabilities, we had to use native parenting on X11 w/ a new child window. The desired visualID chosen by the users GLCapabilities is passed to the new child window. The redraw drops must be caused by the original GDK or the new child GDK window. Now we use a plain X11 child window similar to NEWT's X11 window and NewtCanvasSWT, which doesn't expose this bug. (Note: SWTAccessor/GLCanvas still contains the uncommented GDK code path for further inspection, if desired) Also added SWTNewtEventFactory to test event handling on the SWT GLCanvas w/ GearsES2. TestSWTJOGLGLCanvas01GLn tests custom GLCapabilities now. SWTEDTUtil has been moved to private: com.jogamp.newt.swt -> jogamp.newt.swt.
| * SWT GLCanvas/NewtCanvasSWT: Check isVisible() @ validation; NewtCanvasSWT ↵Sven Gothel2012-12-021-9/+6
| | | | | | | | | | | | | | | | | | | | remove just introduced setVisible(false) and adapt to setEDTUtil() changes. ; Enhance Bug 643 unit test: Also test NEWT EDT and pre-visible GLWindow. - SWT GLCanvas/NewtCanvasSWT: Check isVisible() @ validation - NewtCanvasSWT remove just introduced setVisible(false) and adapt to setEDTUtil() changes - Enhance Bug 643 unit test: Also test NEWT EDT and pre-visible GLWindow.
| * NEWT EDTUtil: Simplify running state (default is running @ setEDTUtil()); ↵Sven Gothel2012-12-026-79/+78
| | | | | | | | Simplify DefaultEDTUtil impl. and fix concurrency leak w/ 'shouldStop'
| * Fix Bug 643: SWT 'display.asyncExec(Runnable runnable)' runnable not ↵Sven Gothel2012-12-021-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | executed on Windows Turns out that the NEWT Windows impl. didn't properly validated the client region @ WM_PAINT and hence 'exhausted' the message pipeline, i.e. never reached an IDLE state. The latter caused SWT to never reach a point where deferred asyncExec(..) Runnables got processed. Besides this SWT effect, this also caused a NEWT window on Windows to always repaint itself (?).
| * NEWT WindowImpl fixes: surfaceLockCount-- if native lock fails; ↵Sven Gothel2012-12-022-28/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | waitForVisible(.., fastFail:=false); waitForSize(..) @ setSize; reparent definePosition(..); - surfaceLockCount-- if native lock fails In case native lock fails, not only remove the windowLock but also decr. surfaceLockCount (proper roll back) - was a BUG! - waitForVisible(.., fastFail:=false) Don't fail fast if visibility wasn't reached. - waitForSize(..) @ setSize Wait for size change - otherwise an SWT child won't reach desired size. - reparent definePosition(..); Position might not get updated by WM events (SWT parent apparently) - Windows WindowDriver: Cleanup code a bit.
| * NEWT WindowImpl: Don't issue native resize if invisible, simply use ↵Sven Gothel2012-11-301-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | defineSize(..); Don't set persitent undecorated flag if child window at creation; Use local 'screen' directly. - Don't issue native resize if invisible, simply use defineSize(..) Invisible windows may not promote size change natively, hence simply setting the size via defineSize(..) is appropriate. Latter setVisible(true) will take size into account. - Don't set persitent undecorated flag if child window at creation Even if a window is a child at creation, it maybe reparented to top-level where the default behavior is to be expected. Undecorated top-level window shall require explicit setUndecorated(true). - Use local 'screen' directly. No need to make code more complicate ..
| * Fix NewtCanvasSWT's newtChild usage: Only use set newtChild if it's ready, ↵Sven Gothel2012-11-301-6/+15
| | | | | | | | i.e. SWTEDTUtil set and parented; Recognize pending resize.
| * Simplify NEWT EDTUtil invoke: To start EDT Runnable maybe null - start EDT ↵Sven Gothel2012-11-305-62/+54
| | | | | | | | | | | | even if on EDT thread. DEBUG: Name EDTUtil impl, e.g. Default, AWT and SWT
| * NewtCanvasSWT: Add DisposeListenerSven Gothel2012-11-291-3/+18
| |
* | Fix for JOGL bug 629, and added new unit tests.rhatcher2012-11-291-2/+120
|/ | | | | | | | | | | | | | | | | | | The change to AWTNewtEventFactory appears to fix the original issue for AWTCanvas instances, and the TestNewtEventModifiersAWTCanvas appears to work ok too. However, there are still issues with NewtCanvasAWT and NewtCanvasSWT instances. These might be problems in the test code, but there's also a good chance there are still issues in the NEWT event delivery infrastructure. For the time being I recommend that only TestNewtEventModifiersAWTCanvas be included in routine unit tests. The tests are defined in TestNewtEventModifiers, and the remaining test classes extend it to define how the window and associated GL drawing surface are created. File ModifierMappings.txt is simply informational, and shows how the modifier bits are laid out between AWT and NEWT. This possibly should have been a spreadsheet.
* SWTEDTUtil/AWTEDTUtil: Fix deadlock situations ; Cleanup ↵Sven Gothel2012-11-273-61/+111
| | | | | | | | | | TestNewtCanvasSWTBug628ResizeDeadlock - Fix deadlock situation in waitUntilStopped/Idle(), skip if on AWT/SWT EDT - Use RunnableTask for sync task invocation, don't block AWT/SWT EDT. - Cleanup TestNewtCanvasSWTBug628ResizeDeadlock (works on OSX as well)
* SWTAccessor: OS_gtk_widget_unrealize optional (SWT 4.3) ; decorate ↵Sven Gothel2012-11-261-2/+11
| | | | PrivilegedAction for static initSingleton block (SWTAccessor, NewtFactory, NativeWindowFactory)
* SWTEDTUtil/AWTEDTUtil: Fix deadlock situation in waitUntilStopped(), etc - ↵Sven Gothel2012-11-253-15/+25
| | | | | | wrap task execution (or enqueing) into status-sync 'edtLock' This fixes the disparity w/ DefaultEDTUtil, i.e. aligns it's implementation/semantics.
* Fix SWTEDTUtil Bug628: Perform NEWT event dispatching on SWT-EDT, due to ↵Sven Gothel2012-11-232-12/+14
| | | | | | possible triggered locking action, i.e. display(). Do the same for AWTEDTUtil. This fix actually clarifies the annotated FIXME :)
* NewtVersionActivity: Dump information in logcatSven Gothel2012-11-131-3/+7
|
* NEWT KeyEvent API doc: Document Windows shift+non-uppecase_char, commit ↵v2.0-rc11Sven Gothel2012-10-311-1/+8
| | | | c135d638fe820457977747e3d45960da64038d53
* NEWT Windows KeyEvent: We have to store the keyChar for typed events, since ↵Sven Gothel2012-10-312-3/+13
| | | | | | keyChar from pressed/released may be wrong (Uppercase: SHIFT-1, etc ..) Partially reverts commit: b62e1d027c289877686d6008ea8dd40e4e1541ec
* Fix NEWT KeyEvent: Deliver keyChar w/ pressed and released; Deliver proper ↵Sven Gothel2012-10-316-174/+220
| | | | | | | | | | | | | | | | | | | | | | modified flags and modifier-key events; Simplify Windows key handling Preface: Modifier-keys are SHIFT, CTRL, ALT and META and they have a matching modifier-bit. - Simplify Windows key handling - Employ MapVirtualKey(..) for virtual-key to character and scancode to virtual-key mappings, allowing to drop tracking of keyCode to keyChar in java code. This also removes the platform restriction of delivering keyChar at TYPED only. - Deliver keyChar w/ pressed and released - Due to the lift restriction on the Windows platform (see above), we can deliver keyChar w/ all key events on all platforms. - Deliver proper modified flags and modifier-key events All modifier-keys deliver pressed, released and typed events with their modifier-bit set. The above is covered by unit tests, which passed on X11, Windows and OSX (manual test run).
* NEWT Windows: Add more verbose DEBUG information for FOCUS handlingSven Gothel2012-10-301-5/+12
|
* NEWT/OSX getLocationOnScreenImpl(..): Use real ↵Sven Gothel2012-10-301-6/+12
| | | | OSXUtil.GetLocationOnScreen(..) if onscreen and surface available.
* NEWT X11 Display: Ignore events w/ NULL window, instead of throwing a ↵Sven Gothel2012-10-282-14/+12
| | | | disturbing and fatal RuntimeException
* Fix NEWT KeyCode: Basic KeyCode Validation on X11, Windows and OSXSven Gothel2012-10-286-99/+148
| | | | | | | - X11: Add VK_QUOTE mapping - OSX: Add single shift, ctrl alt key press; Fix mapping: Command -> Windows, Option -> ALT, add BACK_QUOTE and QUOTE.
* NEWT KeyEvent (Windows, OSX): Check whether keyCode is tracked before using ↵Sven Gothel2012-10-273-25/+27
| | | | bitfield, use more IntBitfield.put(..) return value for efficiency.
* Fix Bug 631 and enhance 601: Handle multiple keys (pressed, released, types ↵Sven Gothel2012-10-273-102/+98
| | | | | | | | | | incl. auto-repeat) - Using keyCode (bit) maps to isPressed and isAutoRepeat, allowing use of multiple keys - Enhance unit test TestKeyEventOrderNEWT w/ injecting variations of 2 diff. keys - Manual tested on X11, Windows and OSX w/ and w/o auto-repeat
* NEWT KeyEvent: Remove invalid version remarks.Sven Gothel2012-10-261-81/+35
|
* NEWT KeyEvent: Fix intendationSven Gothel2012-10-261-119/+119
|
* Fix Bug 601 - Auto-Repeat Behavior: Adding unit tests for typed key order w/ ↵Sven Gothel2012-10-264-40/+61
| | | | | | | | | and w/o auto repeat. Incl. fix for Windows. Auto-Repeat tests recognizes whether auto-repeat could be triggered by AWT Robot. The latter is not possible on Windows, hence manual testing was required on this platform. Impact: X11, Windows and OSX produce proper key sequence incl. auto-repeat modifier mask.
* NEWT ScreenMode Change Failover / Window.setFullscreen() shall use current ↵Sven Gothel2012-10-192-16/+35
| | | | | | | | | | | ScreenMode rotated resolution. ScreenMode Change Failover - In case a timeout appears (buggy XRandR), double check current ScreenMode in case it has been set. Window.setFullscreen() shall use current ScreenMode rotated resolution. - The Screen's virtual size in not correct!
* NEWT / BCM-VC-IV: Fix transparency according to given capabilitiesSven Gothel2012-10-192-12/+26
| | | | Tested manual w/ TestGearsES2NEWT on Raspberry Pi
* Minor NEWT Display/Screen API docSven Gothel2012-10-172-6/+8
|
* NEWT X11/KeyMap: Add XK_grave -> J_VK_BACK_QUOTESven Gothel2012-10-091-0/+2
|
* Raise NEWT MouseButton Maximum from 6 -> 16 (API Change)Sven Gothel2012-10-084-25/+43
| | | | | | | | - Button 9 has been reported to be sent by Olamedia - Rearrange the input bit mask in InputEvent (API Change) - Raise the max. button number to 16
* Use helper.isExternalAnimatorAnimating() instead of ↵Sven Gothel2012-10-051-0/+1
| | | | helper.isAnimatorAnimating() for decision whether to display() now; Minor API comments.
* Fix Bug 572 (2nd time): GLCanvas.validateGLDrawable() @ display() and ↵Sven Gothel2012-10-053-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | reshape() ; GLCanvas.reshape() only if drawble valid ; GLCanvas.validateGLDrawable() also test isDisplayable() ; Fix size validation ; resizeOffscreenDrawable(..) don't validate 'safe' size 1x1 - GLCanvas.validateGLDrawable() @ display() and reshape() To help users using GLCanvas w/ having a realized GLCanvas/Drawable, validateGLDrawable() is also called at reshape(). This shall ensure a valid drawable after even a non AWT-EDT issued first setVisible(). - GLCanvas.reshape() only if drawble valid Otherwise offscreen reshape attempts would happen even on unrealized drawable, which is not necessary. - GLCanvas.validateGLDrawable() also test isDisplayable() To make sure the native peer is valid, also test isDisplayable() - Fix size validation Since we have experienced odd size like 0 x -41 test each component, i.e. 0 < width && 0 < height. This is done through all JOGL/NEWT components. - resizeOffscreenDrawable(..) don't validate 'safe' size 1x1 In case method is called w/ odd size, i.e. 0 x -41, the safe size 1x1 is used. However, we cannot validate this size. Dump WARNING if odd size is detected.
* Fix regression of commit fbe331f013608eb31ff0d8675f4e4c9881c9c48b: X11 ↵Sven Gothel2012-10-051-1/+5
| | | | | | DisplayDriver dispatchMessagesNative() aDevice NPE at finally The aDevice could be pulled via destroy message, hence add check if null.
* Fix SWTEDTUtil bug, where it simply doesn't start by an implicit 'invoke()' ↵Sven Gothel2012-10-052-2/+15
| | | | | | | | | | | | | - No NewtCanvasSWT resize, nor input event delivery. A new EDTUtil instance is not started automatically. Since SWTEDTUtil is attached to the DisplayImpl later in time, i.e. after it's native creation, there is no EDTUtil.invoke(..) call which started it. The not started SWTEDTUtil could not deliver any events. Fix: Start it explicitly - add API doc comment in Display.setEDTUtil(..)
* Misc: Add commented-out NEWT X11/XCB-Event and X11ScreenRandR1[13] ↵Sven Gothel2012-10-026-0/+1346
| | | | | | | | | | compilation ; ... Adding [dead] native source files for NEWT/X11: - X11Event and XCBEvent - X11ScreenRandR11 X11ScreenRandR13 They are currently excluded from compilation, however I like do version them for later use.
* Relax Bug 613 workaround of commit 92398025abdabb2fdef0d78edd41e730991a6f94Sven Gothel2012-10-024-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Utilizing a GlobalToolkitLock in general to lock the display connection results in deadlock situations where locked surfaces signal other [offscreen] surfaces to render. We have to see whether we find a better solution, for now sporadic XCB assertion still happen. But it is preferrable to point to the root cause, then to jumping through hoops to complicate locking or even to deadlock. Locking: - X11GLXGraphicsConfigurationFactory add missing device locking in: - getAvailableCapabilities - chooseGraphicsConfigurationStatic - Newt/X11Window: Discard display events after window close. Relax ATI XCB/threading bug workaround: - ToolkitProperties: requiresGlobalToolkitLock() -> hasThreadingIssues() - NativeWindowFactory: Don't use GlobalToolkitLock in case of 'threadingIssues' the impact is too severe (see above) - NativeWindowFactory: Add getGlobalToolkitLockIfRequired(): To be used for small code blocks. If having 'threadingIssues' a GlobalToolkitLock is returned, otherwise NullToolkitLock. - X11GLXContext: [create/destroy]ContextARBImpl: Use 'NativeWindowFactory.getGlobalToolkitLockIfRequired()' for extra locking Misc Cleanup: - *DrawableFactory createMutableSurface: Also create new device if type is not suitable - *DrawableFactory createDummySurfaceImpl: Pass chosenCaps and use it (preserves orig. requested user caps)
* NativeWindow/X11 + NEWT/X11: Cache 'isXineramaEnabled()' to reduce X11 ↵Sven Gothel2012-09-283-7/+12
| | | | server roundtrips.
* NEWT X11 ScreenMode: Ignore invalid rotation eventSven Gothel2012-09-281-9/+16
|