summaryrefslogtreecommitdiffstats
path: root/src/newt
Commit message (Collapse)AuthorAgeFilesLines
* NEWTEvent: Fix toString message - add commaSven Gothel2013-03-261-1/+1
|
* Android/NEWT MouseEvent: Fix Detection/Processing of 2-Finger-Scroll Gesture ↵Sven Gothel2013-03-241-81/+143
| | | | | | | | | | | | | | | | | - Part 2 Multiple tests on different devices disclosed that: - 1 of 2 pointers get disconnected every now and then .. -> Shall tolerate this case - dist-delta within gesture may shrink below doubleTouchSlope -> Remove constraint after gesture detection - Always validate pointer-id GearsES2 - Works quite stable on several devices now - Moved soft-keyboad show to 4-pointer pressed >= 0.7f pressure
* Newt/MouseEvent: Add 'float[3] getRotation()', getWheelScale() -> ↵Sven Gothel2013-03-243-38/+101
| | | | | | | | | | | | getRotationScale(), refinement of commit 18cb57246372eda72c25a5cd9a69a873bdf09489 Turns out the 'wheel' semantics are not generic enough and confining rotation values to one axis only satisfies the traditional mouse wheel. Widen the definition of 'rotation' and delivering 3-axis if supported. On NEWT/Android, we deliver the 2-axis for example, allowing to rotate around both or scrolling using both directions (-> GearsES2).
* Android/NEWT MouseEvent: Fix Delivery of MultiTouch PRESSED/RELEASE; Fix ↵Sven Gothel2013-03-241-146/+194
| | | | | | | | | | | | | | | | | | | | | | | | Detection/Processing of 2-Finger-Scroll Gesture ; GearsES2: Add NEWT based 'zoom' gesture detection. - Fix Delivery of MultiTouch PRESSED/RELEASE Adopting MouseEvent changes of commit 18cb57246372eda72c25a5cd9a69a873bdf09489 - Fix Detection/Processing of 2-Finger-Scroll Gesture Dropping utilization of Android's GestureDetector and implementing our own, which turns out to simplify keeping track of states. Our gesture detection works well w/ user NEWT based gesture detection (-> See GearsES2 zoom and rotate), using following criteria related to Android parameter: - ScaledDoubleTapSlop: - Max 2 finger distance - ScaledTouchSlop: - Min. movement w/ 2 pointer withing ScaledDoubleTapSlop starting 'scroll' mode - Max. change of finger distance in respect to initiating 2-finger distance (2x ScaledTouchSlop) - Max. distance growth in respect to initiating 2-finger distance. - GearsES2: Add NEWT based 'zoom' gesture detection.
* NEWT/MouseEvent: Refine MultiTouch Event Spec regarding associated 'action' ↵Sven Gothel2013-03-241-15/+82
| | | | | | | | | | | | | | | | | | | | pointer Index; Add PointerType[PointerClass]; Add 'wheelScale' Attribute; - Refine MultiTouch Event Spec regarding associated 'action' pointer Index In case an instance represents multi-touch events, i.e. {@link #getPointerCount()} is > 1, the first data element represents the pointer which triggered the action if individual to one pointer. For example {@link #getX(int) e.getX(0)} at {@link #EVENT_MOUSE_PRESSED} returns the data of the pressed pointer, etc. - Add PointerType[PointerClass] This allows applications to identify the type and it's class [On-/Offscreen] helping to interpret semantics, e.g. wheel-rotate and new wheel-scale - Add 'wheelScale' Attribute Returns the scale used to determine the {@link #getWheelRotation() wheel rotation}, which semantics depends on the {@link #getPointerType() pointer type's} {@link PointerClass}. See API doc for details .. TODO: NEWT/Android changes adopting these changes.
* NEWT/Android: Fix suspense regression of commit ↵Sven Gothel2013-03-231-2/+6
| | | | | | | | | | d514ecbf052d013ea8c0982c490757678075a9ea Explicit win.destroy() shall only be called at activity.onDestroy(), - GLStateKeeper preservation is marked at pause, - and the Window's surfaceDestroyed() will also issue destroy() - so it's safe Reason: On Suspense (or power button), application is paused _without_ surfaceDestruction !
* NEWT/Android (Bug 665): Add Support for GLStateKeeper ; onPause() always ↵Sven Gothel2013-03-224-52/+165
| | | | | | | | | | | | | | | | | | | destroys ; Recognizing all GLAutoDrawable's GLAnimatorControl for pause/resume ; Use GLAnimatorControl instead of Animator - Add Support for GLStateKeeper If !isFinishing() (HOME button), preserve the GLEventListener if an GLStateKeeper instance - onPause() always destroys onDestroy() is too late, i.e. surfaceDestroyed() already called - Recognizing all GLAutoDrawable's GLAnimatorControl for pause/resume pause/resume the GLAnimatorControl of all GLAutoDrawable instances - Use GLAnimatorControl instead of Animator We used an Animator reference .. duh! Note: The EGL native WindowDriver (Android and BCM.IV) must retain their own copy of EGLGraphicsDevice, which preserves the EGLDisplay handle due to EGLDisplayUtil reference counting per nativeHandleID.
* NEWT/Android WindowDriver.closeNative0(..): Catch Exception at surface ↵Sven Gothel2013-03-221-4/+10
| | | | destroy allowing to continue destruction.
* Add GLStateKeeper handling GLEventListenerState preservation and ↵Sven Gothel2013-03-222-4/+7
| | | | | | | | | | | | | | | restauration for GLAutoDrawable - New GLStateKeeper interface, package com.jogamp.opengl Implemented by: - GLAutoDrawableBase Currently supported by: - NEWT GLWindow - GLEventListenerState package move: com.jogamp.opengl.util -> com.jogamp.opengl
* NEWT/Android: Remove KeyEvent.KEYCODE_HOME handling, since it doesn't work - ↵Sven Gothel2013-03-221-19/+0
| | | | i.e. cannot be intercepted this way.
* NEWT/Android: Fix BACK button implementation, use different KeyCode mappings ↵Sven Gothel2013-03-215-24/+146
| | | | | | | | | | | | | | | | | | | | | and allowing native action to be suppressed. - Don't trust soft-kbd visibility state, but perform invisible action. If the latter was successful - soft-kbd was visible before. - Map BACK to VK_KEYBOARD_INVISIBLE and propagate it, if soft-kbd was visible before. No native default action is performed. - Map BACK to VK_ESCAPE event and propagate it, if soft-kbd was invisible _and_ an activity was registered via registerActivity(Activity), i.e. by NewtBaseActivity. Otherwise proceed w/ default action (-> activity.finish()). - If the KeyListener consumed the [EVENT_KEY_RELEASED, VK_ESCAPE] event, it will be suppressed and no default action performed. This allows applications to have a custom 'ESCAPE' or 'BACK' handling. Otherwise (not consumed) the default action is performed.
* NEWTEvent: Add isConsumed() and setConsumed(boolean) methods to simply ↵Sven Gothel2013-03-213-14/+42
| | | | usage, using the existing consumedTag attachment for compatibility and efficiency.
* OSX/NEWT: Fix visible -> false when closing and reparenting window. This ↵Sven Gothel2013-03-202-4/+4
| | | | | | | | | | | lead to non functional recreational reparenting. OSX recreational reparenting moves the saved GLEventListenerState at destroy to the new dawable/surface, which must be valid. The flaky visible state caused seemingly random reparenting failures. - WindowImpl.ReparentActionRecreate.run() set 'visible:=true', which circumvented OSX to wait for actual realization. - OSX WindowDriver.closeNative(): Issue visibleChanged(true, false); ASAP
* OSX/NEWT: Fix native window parenting freeze, invisible/orderOut0, Position ↵Sven Gothel2013-03-204-75/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | bugs w/ parenting Fix native window parenting freeze: - Pull out setJavaWindowObject(..) of changeContentView(..) to be called seperately, add param for changeContentView(..) to enable/disable setJavaWindowObject() - initWindow0(..): - Call changeContentView(..) w/o setJavaWindowObject() - setJavaWindowObject(..) at end of initialization Fix native window parenting orderOut0: If parent window is invisible or no parent used call orderOut(..), otherwise call orderBack(). Fix updatePosition(..): positionChanged(..) - Position bug w/ parenting - AWT parent passed 0/0 - call positionChanged(..) w/ client-pos instead of screen-pos Fix getLocationOnScreenImpl(..) - Position bug w/ parenting - Position < 0/0 is valid! Misc: - setWindowClientTopLeftPointAndSize0(..), setWindowClientTopLeftPoint0(..): Add 'display' param, deciding whether area should be display (invalidated)
* OSX/NEWT: NSWindow/NSView Ops on main-thread w/o blocking - Part2Sven Gothel2013-03-192-62/+117
| | | | | | | | | Continues commit 81cbcdc8469143587b2044661dd613c798ae02ba Perform on main-thread invocation from Java, allowing to issue visibleChanged(..) after creation/visible calls. This fixes the 'Visibility not reached ..' regressions.
* OSX/NEWT: Following CALayer streaming design, i.e. issue NSWindow/NSView Ops ↵Sven Gothel2013-03-196-230/+373
| | | | | | | | | | | | | | | | | | | | | on main-thread w/o blocking; NEWT/WindowImpl: Volatile multithreaded mutable values Similar to commits: 28c6472335b924080d638b33a28f8f4eedb459b1 f354fb204d8973453c538dda78a2c82c87be61dc main-thread operations cannot block main-thread. Luckily we are able to create the NSWindow and NSView instance uninitialized (deferred) on the current thread, while issuing their initialization on the main-thread w/o blocking. Further more a size glitch is fixed, which didn't take the title bar into account. +++ NEWT/WindowImpl: Volatile multithreaded mutable values Since position, size and other attributes might get changes off-thread, these fields needs to be volatile.
* OSX/CALayer: OSX/CALayer Threading Part3 - Run CALayer ops in a streaming ↵Sven Gothel2013-03-191-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | design on main-thread w/o [infinitive] blocking History: Part1 commit 896e8b021b39e9415040a57a1d540d7d24b02db1 (Run CALayer Ops on current thread to avoid blocking) Part2 commit 28c6472335b924080d638b33a28f8f4eedb459b1 (Run CALayer Ops on main-thread w/o blocking) Dependency: GlueGen commit 4becdfa125b07ff969d6540e1112735b53cd15eb (Fix RecursiveLockImpl* Timeout corner case) Part2 misses essential locking of the OpenGL context (and it's surface upfront) while creating the NSOpenGLLayer instance. The latter instantiates a OpenGL context shared w/ JOGL's, hence it cannot be locked. Encapsulating NSOpenGLLayer creation/attachment and it's detachment/release in sub-classes AttachNSOpenGLLayer and DetachNSOpenGLLayer, where instances will be streamed on main-thread. Both tasks are triggered at associateDrawable(boolean bound). The mentioned GL context locking requires disturbs the 'streaming' design considerably in AttachNSOpenGLLayer. It is solved by attempt to acquire the recursive lock of the surface and the context via 'tryLock(maxwait)' w/ screen-vSync-period/2. If the locks could not be acquired completly, the AttachNSOpenGLLayer instance will be re-queued to the main-thread for later execution. Before DetachNSOpenGLLayer is being streamed, it is validated whether AttachNSOpenGLLayer did run. A recursive situation does happen w/ resizing an offscreen pbuffer drawable! Hence extra care is being taken.
* Adapt to GlueGen commit b1eb7ca6b9d7dec7ff62c1f1e8ef0a0545724d2f: Function- ↵Sven Gothel2013-03-183-4/+7
| | | | RunnableTask adds PrintStream 'exceptionOut' argument in ctor.
* Fix NEWT WindowImpl reparent-recreate w/ GLEventListenerState: Bug ↵Sven Gothel2013-03-141-8/+9
| | | | | | | | | introduced w/ commit e2506d7663b752f00f0a98f793ebad52e65bd1e3 In case a reparent action takes place w/ recreate, only preserve the GLEventListenerState if the window is valid and will become visible again (wasVisible). Also add proper DEBUG log prefix to GLEventListenerState.
* OSX/CALayer: Simplify FixCALayerLayout()/layoutSurfaceLayer() call, no more ↵Sven Gothel2013-03-141-3/+0
| | | | | | | | | | | | need for explicit call - OffscreenLayerSurface.layoutSurfaceLayer() removed, no more required - JAWTWindow adds a ComponentListener, which issues FixCALayerLayout() at resized, moved and shown. - MyNSOpenGLLayer no more requires fix*Size() methods - MyNSOpenGLLayer::setDedicatedSize() need no explicit CATransaction, performed by caller.
* Minor Changes: EGLDisplayUtil: Add stack trace in DEBUG mode for opened ↵Sven Gothel2013-03-131-1/+1
| | | | DPYs; JAWTWindow: Add JAWT info in toString()
* Bug 665: Allow re-association of GLContext/GLEventListener to a GLDrawable ↵Sven Gothel2013-03-132-17/+33
| | | | | | | | | | | | | | | | | | | | (Part 5) - GLAutoDrawableBase: - Add 'setPreserveGLStateAtDestroy(..)' to preserve the GLEventListenerState at destroy() operation, and impl. details pullGLEventListenerState()/pushGLEventListenerState(). pullGLEventListenerState() is called automatic at destroyImplInLock(), where pushGLEventListenerState() has to be called after drawable realization instead of context creation. - Note/TODO: Method will become public in GLAutoDrawable in general! - NEWT/GLWindow: - Use GLEventListenerState preservation for reparenting case w/ destruction, i.e. keep GLContext/GLEventListener alive while reparenting in recreation mode. Scenario: NewtCanvasAWT Child <-> Top on OSX w/ CALayer
* Adapt to GlueGen's relocation of AWTEDTExecutor - GlueGen commit ↵Sven Gothel2013-02-281-1/+1
| | | | 99a50b38f5650fedca0f207e03706ffa9492e50c
* NEWT: Harmonize MouseEvent Pressure (API Change!)Sven Gothel2013-02-282-18/+84
| | | | | | | | | | | Due to high fluctuation (lack of normalized) pressure values on Android devices, an option to query the normalized value and access to the current known maximum pressure is required. MouseEvent: - getMaxPressure() returning the [self calibrated] known maximum pressure - getPressure(..) -> getPressure(.., boolean normalize) (API Change!) - return normalize ? pressure/maxPressure : pressure;
* NEWT WindowImpl: Cleanup redundancies in destroy() and ↵Sven Gothel2013-02-281-32/+37
| | | | | | | | | | | windowDestroyNotify(boolean) - destroy() - screen is never null! - always attempt to removeScreenReference() - windowDestroyNotify(boolean) - NOP if !isNativeValid() to avoid DESTROY_* events
* Fix Bug 677: NEWT/Android: Add support for Android's KeyEvent.KEYCODE_BACKSven Gothel2013-02-285-36/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Original author: Eric Brayet <[email protected]> Revised by: Sven Gothel <[email protected]> I took the freedom to cleanup the three original patches from https://github.com/Pooouf/jogl.git branch 'bug_677': - 7449d4726633d524a3bb79efffd04cfd0ca25e58 (removed by followup patch!) - 68c739a4f03e46deecdbb71c125b4586aec08d63 (removes previous patch!) - c2813dfc325a1482d18b6fc304e4e483f5633964 Further more I was able to reduce the 'extra' code while utilizing - Window's isKeyboardVisible() and using keyboardVisibilityChanged(false) to update the hidden keyboard state. - Moving the key-handling code to the containing WindowDriver class avoiding passing a reference to the inner view. - Using AndroidNewtEventFactory for NEWT KeyEvent creation +++ - Handle KeyEvent.KEYCODE_BACK w/ jogamp.newt.driver.android.WindowDriver.MSurfaceView.onKeyPreIme(..): if( soft keyboard is up ) [1] Update keyboard visibility state and return NEWT KeyEvent.VK_KEYBOARD_INVISIBLE; else [2] call WindowImpl.windowDestroyNotify(true) [3] then cont. processing, i.e. return false; - Turns out respecting WindowClosingMode might be - too complicated - interfere w/ Android UI behavior - AndroidNewtEventFactory - createKeyEvent - static - adding boolean param 'inclSysKeys', if true, KEYCODE_BACK and KEYCODE_HOME are mapped - Unit tests: GearsES2 + MovieCubeActivity0 shows keyboard if pressure > 0.6f - pressure on Android shall be between [0..1], however we have to figure out badly calibrated touchpads/Android device where we could experience pressure > 2.0f ! - TODO: API documentation of pressure [0..1]
* Fix merge conflict of erikbrayet/bug_668Sven Gothel2013-02-281-1/+1
|\
| * Fix bug 668 : Android keyboard input was uppercaseEric Brayet2013-02-141-2/+2
| |
* | Fix NEWT/AWT WindowClosing Unit Tests ; Review/Cleanup NEWT WindowClosing ↵Sven Gothel2013-02-2813-103/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mechanism Due to a NEWT WindowClosing event regression cause by NewtCanvasAWT changes a review of our WindowClosing event mechanism was required. Important cleanups are marked w/ '(*)' below. I would have preferred to change the 'WindowListener.windowDestroyNotify(WindowEvent)' method to pass a WindowCloseEvent object exposing more information like toolkit or programmatic destruction and passing whether a 'closing' or 'nop' action will be performed based on the WindowClosingMode. For now I postponed this idea .. since it would change the API again, but may reconsider it after merging the Android 'closing' patch. - InputEvent.consumedTag -> NEWTEvent.consumedTag - Window - (*) Promote setWindowDestroyNotifyAction(Runnable) to public, former WindowImpl.setHandleDestroyNotify(boolean). Using a Runnable action for WindowImpl.windowDestroyNotify(boolean) allows a setting defined alternative for destroy() and gets rid of [ab]using WindowListener.windowDestroyNotify(WindowEvent) for lifecycle actions. Used in: - GLWindow - GLAutoDrawableDelegate impl. - WindowImpl - Respect NEWTEvent.consumedTag for WindowEvents as well - (*) Impl. setHandleDestroyNotify(boolean) (see above) - (*) destroy() simply sends out pre- and post- destruction Window events, where windowDestroyNotify(boolean) sends out the pre-destruction event if NOP. - (*) windowDestroyNotify(boolean) is public now, allowing other impl. details to follow proper destruction using handleDestroyNotify Runnable (-> NewtCanvasAWT). - AWTWindowClosingProtocol: - addClosingListenerOneShot() -> addClosingListener() - calling addClosingListener() at addNotify() - calling removeClosingListener() at removeNotify() - AWTWindowClosingProtocol ctor taking NOP runnable, allowing to send WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY at WindowClosingMode.DO_NOTHING_ON_CLOSE - add/remove listener on AWT-EDT - AWTWindowAdapter - Add 'removeWindowClosingFrom(..)', allowing to remove window closing event fwd. - Also fwd windowClosed in window closing fwd'ing. - NewtCanvasAWT - (*) Utilize AWTWindowClosingProtocol NOP runnable (see above) to fwd closing-NOP event to NEWT - (*) Unify remove/destroy code in destroyImpl(..) - !removeNotify -> destroy NEWT child programatic or as toolkit event - removeNotify || windowClosing -> destroy jawtWindow - (*) Remove AWTWindowAdapter/AWTParentWindowAdapter's windowClosingListener, since we utilize AWTWindowClosingProtocol - DisplayImpl - Adding 'final void dispatchMessage(final NEWTEvent event)' allowing to remove the NEWTEventTask wrapping for no reason in enqueueEvent(..) if on EDT and waiting.
* | NEWT/OSX Fix: Child positioning ; NewtCanvasAWT: Change reparent time and ↵Sven Gothel2013-02-224-205/+306
| | | | | | | | | | | | | | | | | | | | | | | | | | | | use actual component size while setting min/pref. size at setup - NEWT/OSX Fix: Child positioning - If !Offscreen and has-parent: Gather screen location by traversing through parent and set native position (was removed w/ commit 7d5c51b635e0795d9b170342bdebe8e7e0bbd01d since still buggy). - NewtCanvasAWT: Change reparent time and use actual component size while setting min/pref. size at setup - Analog to AWT GLCanvas - validates and reparents at reshape(..), paint(..) and update(..) - reshape(..) also trigers jawtWindow.layoutSurfaceLayer() -
* | OSX/Java7/CALayer + JAWT: Partially Fix AWT/NEWT CALayer 'out of sight' bug, ↵Sven Gothel2013-02-202-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | where our CALayer is moved out of the visible area - same erroneous behavior for GLCanvas and NewtCanvasAWT - sized-frame: Set framesize and validate() it - sized-component: Set component preferred size and call frame.pack() - added workaround 'OffscreenLayerSurface.layoutSurfaceLayer()' to fix CALayer size, which snaps for: - OK initial size before setVisible: sized-frame and sized-component - OK resize w/ sized-frame - OK manual frame resize - Invisible: w/ sized-component after setVisible() ++ - CALayer-Sublayer (GL) has additional retain/release when added/removed to be on safe side.
* | NewtCanvasAWT: Fix size determination, i.e. take newt-child's size into ↵Sven Gothel2013-02-201-6/+10
| | | | | | | | account if no preferred size is given.
* | NEWT/OSX: Fix 'locationOnScreen' usage and use proper client-area window ↵Sven Gothel2013-02-204-80/+93
| | | | | | | | | | | | screen position (Fixes resize -> position) - Tested w/ NEWT GearsES2 and Java6 and Java7 on OSX
* | Bug 678 (fix), Bug 641 (API + Windows Impl.), Bug 688 (prep): Update NEWT's ↵Sven Gothel2013-02-1925-1303/+1237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KeyEvent handling while distinguish keyCode (kbd layout independent) and keySym (kbd layout dependent) API Changes: - Virtual key codes and symbols are of type short. - KeyEvent.keySymbol() shall return a layout dependent value (Bug 641) - Method returns former keyCode() value, which was layout dependent. - Returns 'short' value - KeyEvent.keyCode() returns a short value, instead of int - KeyEvent.keyCode() shall return a layout independent value (Bug 641) - To ease implementation, we only 'require' the scan code to be mapped to a 'US Keyboard layout', which allows reusing layout dependent code while preserving the goal to have a fixed physical key association - Implementation status: - Windows OK - X11 TODO - OSX: 50/50 TODO - Using layout independent 'action keys' - Using layout dependent 'printable keys' - returning above semantics for both, keyCode and keySym - Android 50/50 TODO - Returning the layout independent keyCode - Mapping probably incomplete - KeyEvent.EVENT_KEY_TYPED and KeyListener.keyTyped(KeyEvent) (Bug 688) - Marked DEPRECATED - No more called for auto-repeat events - Synthesized in WindowImpl.consumeKeyEvent(..): No more injection by native- or java driver code - NEWTEvent.eventType: int -> short - field, as well as all method involving eventType changed to short. - NEWTEvent.isSystemEvent: REMOVED - Never used as well as never being implemented properly Internal Changes: - Simplified keyEvent driver code - Especially the Windows native driver's mapping code could be simplified using scanCode and MapVirtualKeyEx - NEWT Event Factories: hashMap -> switch/case Unit Tests: - - Added NewtCanvasAWT Offscreen Layer Tests important to test the AWT -> NEWT translation on OSX/CALayer: - TestNewtKeyCodeModifiersAWT - TestNewtKeyCodesAWT - TestNewtKeyEventAutoRepeatAWT - TestNewtKeyEventOrderAWT - TestNewtKeyPressReleaseUnmaskRepeatAWT
* | NEWT/OSX: Fix Memory Leak ; Fix Occasional Crash Duer to Lifecycle Ops not ↵Sven Gothel2013-02-173-39/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on Main-Thread. - Fix Memory Leak - NewtWindow::dealloc -> [NewtView release]: Fixes NewtView leak - NewtView::dealloc -> removeTrackingRect: Removes occasional crash (double free of TrackingRect) - Fix Occasional Crash Duer to Lifecycle Ops not on Main-Thread. Perform OSX WindowDriver ops on Main-Thread: - close0 - changeContentView0 - createWindow0 - Cleaned up AddRemove unit tests, added TestAddRemove03GLWindowNEWT
* | Fix Bug 691 (part-2): Extra '[subLayer release]' is wrong, since ↵Sven Gothel2013-02-151-2/+3
|/ | | | | | | | | | | | | | | | | | | | 'CGL.releaseNSOpenGLLayer' triggers release - but very late w/ AWT usage. OSXUtil_RemoveCASublayer0's added '[subLayer release]' in commit f6e6fab2a7ddfb5c9b614cb072c27ff697629161 is wrong, since 'CGL.releaseNSOpenGLLayer' actually does trigger it's release. This was not seen w/ AWT tests, since it happens very later. A NewtCanvasAWT test disclosed this error -> removed that extra release call. The culprit for the late release w/ AWT usage was CGL.createNSOpenGLLayer's call in the current thread. Moving it to the Main-Thread fixed the problem. All CALayer lifecycle calls are issued on the Main-Thread now. NSOpenGLLayer's CVDisplayLink OpenGL fitting via 'CVDisplayLinkSetCurrentCGDisplayFromOpenGLContext' is now performed at it's context creation in 'NSOpenGLLayer::openGLContextForPixelFormat'. The 'extra' release of the NSOpenGLLayer's NSOpenGLContext as introduced in commit f6e6fab2a7ddfb5c9b614cb072c27ff697629161 is still valid.
* LinuxEventDeviceTracker: Map printable char using KeyEvent.isPrintableKey.Xerxes Rånby2013-01-311-1/+8
| | | | | | | The NEWT VK namespace tries to map keyCodes to its Unicode varianti, make use this quirk. Signed-off-by: Xerxes Rånby <[email protected]>
* LinuxEventDeviceTracker: LinuxEVKey2NewtVKey(EVKey 122-248)Xerxes Rånby2013-01-311-28/+273
| | | | Signed-off-by: Xerxes Rånby <[email protected]>
* LinuxEventDeviceTracker: LinuxEVKey2NewtVKey(EVKey 0-121)Xerxes Rånby2013-01-311-81/+257
| | | | Signed-off-by: Xerxes Rånby <[email protected]>
* LinuxEventDeviceTracker: gracefully manage hot-swap of USB devices.Xerxes Rånby2013-01-311-24/+29
| | | | Signed-off-by: Xerxes Rånby <[email protected]>
* LinuxEventDeviceTracker: LinuxEventDeviceManager monitor /dev/input/event*Xerxes Rånby2013-01-301-4/+58
| | | | | | | The LinuxEventDeviceManager will start new EventDevicePoller threads when more /dev/input/event* files become available. Signed-off-by: Xerxes Rånby <[email protected]>
* Add LinuxEventDeviceTracker used by RaspPi newt/driver/bcm/vc/iv/WindowDriverXerxes Rånby2013-01-302-0/+409
| | | | Signed-off-by: Xerxes Rånby <[email protected]>
* Fix AWTKeyAdapter: Reorder AWT events to NEWT order - also ensuring TYPED is ↵Sven Gothel2013-01-302-26/+35
| | | | | | | always sent. This foremost fixes an issue w/ OSX/Java7 and NewtCanvasAWT offscreen CALayer usage, which utilizes AWTKeyAdapter and AWTNewtEventFactory (AWT -> NEWT) key events.
* Fix Bug 678: Deliver key-char value for printable chars on all ↵Sven Gothel2013-01-293-67/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | | KeyEventListener (-> On Windows as well) The following is observed, where t0 and t1 refer to subsequent different timestamps: NEWT delivery order: PRESSED (t0), RELEASED (t1) and TYPED (t1) WINDOWS delivery order: PRESSED (t0), TYPED (t0) and RELEASED (t1) Windows Auto-Repeat: PRESSED (t0), TYPED (t0) Hence we changed the event reorder-code in NEWT to trigger NEWT-PRESSED on Windows-TYPED for printable chars, assuring key-char values on all listener callbacks. - KeyEvent.getKeyChar(): Removed disclaimer dedicated for Windows - Keyevent.isActionKey(): Completed for all NEWT non-printable action keys; Added static variant - Keyevent.isPrintableKey(): NEW: returns !isModifierKey(keyCode) && !isActionKey(keyCode) ; With static variant - Windows WindowDriver: - EVENT_KEY_PRESSED handles non-printable chars only - EVENT_KEY_TYPE handles printable chars only - Native: VK_DELETE passes keyCode - Unit tests: Wait for completion 1s -> 2s
* Add WindowClosingProtocol impact detail on ↵Sven Gothel2013-01-281-1/+10
| | | | WindowListener.windowDestroyNotify(..)
* Fix regression of commit b738983638703bb721ee4c9820c8ef43e2252e73, possible ↵Sven Gothel2013-01-271-1/+4
| | | | 'pulling' display's device - check references
* Bug 665 (part 1) - Allow dis-association of GLContext's GLDrawable ..Sven Gothel2013-01-243-22/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes allowing re-association (incl. null) of GLContext/GLDrawable: - GLAutoDrawable: Refine API doc 'setContext(..)' - GLContext: Refine API doc: 'setGLDrawable(..)' 'getGLDrawable()' - GLContextImpl.setGLDrawable(): Handle null drawable - GLAutoDrawableDelegate/GLAutoDrawableBase: Allow null GLContext - GLDrawableHelper.switchContext(..)/recreateGLDrawable(): Balance GLContext.setGLDrawable(..) calls - New GLEventListenerState, holding state vector [GLEventListener, GLContext, .. ] impl. relocation of all components from/to GLAutoDrawable. - GLDrawableUtil - Using GLEventListenerState for swapGLContextAndAllGLEventListener(..) +++ NEWT Window*: - getDisplayHandle() is 'final', no more 'shortcut' code allowed due to re-association incl. display handle. - close*: - close config's device (was missing) - null config +++ Changes allowing reconfig of Display handle as required to re-associate pre-existing GLContext to a 'window': - AbstractGraphicsDevice: Add isHandleOwner() / clearHandleOwner() - Impl. in X11GraphicsDevice and EGLGraphicsDevice, NOP in DefaultGraphicsDevice - DefaultGraphicsConfiguration add 'setScreen(..)' - MutableGraphicsConfiguration - Make DefaultGraphicsConfiguration.setScreen(..) public - NativeWindowFactory add 'createScreen(String type, AbstractGraphicsDevice device, int screen)' - Refactored from SWTAccessor - NativeWindow x11ErrorHandler: Dump Stack Trace in DEBUG mode, always.
* Android: Allow selection of native window formats RGBA8888, RGBX8888 and ↵Sven Gothel2013-01-203-48/+98
| | | | | | | | | | | | | | | | | | | | | | | | RGB565; Fix HiSilicon/Vivante/Immersion.16 EGLConfig selection (zero depth buffer @ visualID) - NEWT/Android Fix PixelFormat/NativeWindowFormat/VisualID Selection - Fix allows proper selection of native window formats: RGBA8888, RGBX8888 and RGB565 - Selection is performed in 3 steps: 1) @ Construction (non native): SurfaceHolder.setFormat( getSurfaceHolderFormat( caps ) ) 2) @ Native Surface Creation: getANativeWindowFormat( androidFormat) -> ANativeWindow_setBuffersGeometry(..) Note: The set native format is revalidated, i.e. read out via ANativeWindow_getFormat(..). 3) @ EGL Creation: ANativeWindow_getFormat(..) -> fixCaps(..) - simply fixing the chosen caps. - NEWT GLWindow.GLLifecycleHook.resetCounter: - Also reset GLAnimatorControl's counter, if attached. - NEWT WindowImpl -> GLLifecycleHook.resetCounter() calls issued _after_ operation before unlock(). - JOGL/EGLGraphicsConfigurationFactory - Validate whether the visualID matching EGLConfig depth buffer is suitable. On HiSilicon/Vivante/Immersion.16: Depth buffer w/ matching visualID is zero! - NativeWindow/Capabilities.compareTo: Fix alpha comparison
* Android/NewtVersionActivity: Dump avail. GLCaps / Use stderr, since log ↵Sven Gothel2013-01-191-2/+3
| | | | would cap 'em (too long).
* NEWT/Android: Full Lifecycle for WindowDriver; Using static ViewGroup; ↵Sven Gothel2013-01-192-47/+137
| | | | | | | | | | | | | | | | AWTRobotUtil: More tolerant for non AWT env.; Fix adb-launch-* - NEWT/Android WindowDriver - Full Lifecycle, remove refs on closeNative() - Respect isFullscreen() - Using static ViewGroup if available and surface not ready, allows running from main() - AWTRobotUtil: More tolerant for non AWT env. - Check for NEWT first - Only use AWT iff available, which allows running on Android - Fix adb-launch-* - Launch main/junit tests