aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/jogamp
Commit message (Collapse)AuthorAgeFilesLines
* Bug 935: NEWT PointerIcon: Utilize Toolkit Agnostic PixelFormat and ↵Sven Gothel2014-01-089-203/+317
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conversion Utilities (Allowing 'arbitrary' PointerIcon data input) Commit fe28bc125429b38cdcd016746081f4a6d521c6fd added the notion of toolkit agnostic PixelFormat and conversion utilities, utilized and further tested by this patch. +++ - PointerIcon is a PixelRectangle and hence holds the decoded data. This allows on-the-fly conversion if required as well as recreation w/o PNG re-decoding. - Using array-backed PointerIcon data where possible, allowing better performance when converting PixelFormat etc. - NEWT Display adds 'createPointerIcon(final IOUtil.ClassResources pngResource...' method to support agnostic PointerIcon creation. - NEWT Display adds methods to allow users to avoid PixelFormat and Buffer NIO type forced conversion: - PixelFormat getNativePointerIconPixelFormat() - boolean getNativePointerIconForceDirectNIO() +++ PNGImage -> PNGPixelRect Deleted: com.jogamp.opengl.util.texture.spi.PNGImage Added: com.jogamp.opengl.util.PNGPixelRect (We hope nobody was using PNGImage directly since it was a service-plugin for TextureIO) PNGPixelRect is a PixelRectangle PNGPixelRect actually is implemented OpenGL agnostic, however - since our PNGJ support lives under package 'jogamp.opengl.util.pngj' it cannot be moved up (yet). PNGPixelRect now handles all PixelFormat for the target format and also added support for grayscale+alpha (2 channels). The latter is force-converted to RGB* - similar to paletted. Further more, PNGPixelRect allows simply passing an OutputStream to write the PNG data. Used by: TextureIO and NEWT +++ - OffscreenSurfaceLayer's setCursor(..) uses the agnostic PixelRectangle instead of a PNG resource. - AWTMisc uses the PixelRectangle to produce the AWT Cursor and converts it to the required format. Hence same pixels are used for NEWT and AWT pointer/cursor icon. - TestGearsES2Newt and NewtAWTReparentingKeyAdapter 'tests' iterate over 3 custom PointerIcon when pressed 'c'. - JOGLNewtAppletBase uses the new custom PointerIcon 'newt/data/crosshair-lumina-trans-32x32.png', which is included in NEWT (213 bytes only). -
* Bug 935: NEWT PointerIcon/Visibility: Perform OffscreenLayerSurface ↵Sven Gothel2014-01-052-69/+127
| | | | | | | | | | | | | | | | | delegation _always_ in common WindowImpl ; Workaround for Windows+Applet issue. Perform OffscreenLayerSurface delegation _always_ in common WindowImpl Instead of performing OffscreenLayerSurface task on OSX's WindowDriver implementation, use generic implementation in WindowImpl for all platform exposing same behavior. ReparentAction takes care of reset/setup of PointerIcon/Visibility states. +++ This is also a workaround for Windows+Applet issue, where the PointerIcon gets periodically overridden by the AWT Component's icon.
* NEWT OSX: Add missing NewtCommon_init(env) (duh!) - Issuing ↵Sven Gothel2014-01-051-14/+9
| | | | | | | NewtCommon_throwNewRuntimeException(..) if given references are of invalid type Missing NewtCommon_init(env) always lead to a crash when calling NewtCommon_throwNewRuntimeException(..) due to uninitialized clazz instances!
* Bug 935: NEWT Windows Window-Icon: Use WNDCLASSEX w/ Small/Big Default Icons ↵Sven Gothel2014-01-052-30/+26
| | | | | | | | (NativeWindow GDI / NEWT ) .. this allows using the icon definition of WNDCLASSEX instead of setting them at CreateWindow0(..). - NativeWindow GDIUtil/RegisteredFactory uses WNDCLASSEX and Small/Big Defailt Icons
* Bug 935: NEWT OSX PointerIcon/Pointer-Visibility: Impl. ↵Sven Gothel2014-01-041-2/+34
| | | | | | | | | | OffscreenLayerSurface (OSX CALayer) w/ JAWTWindow Path Add setCursor(..) and hideCursor() to OffscreenLayerSurface interface, impl. in JAWTWindow w/ AWT. This allows an OSX NEWT Window using CALayer (i.e. NewtCanvasAWT) to have setPointerIcon(..) and setPointerVisible(..) functionality!
* Bug 935: NEWT PointerIcon: Refine Spec and Implementation / Fix OSX Crash ↵Sven Gothel2014-01-049-103/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and Issues - Refine Display.PointerIcon: Complete type allowing re-creation - Add associated Display reference - Add used IOUtil.ClassResources reference - Add isValid()/validate() methods for recreation - Refine API doc - Move Display.destroyPointerIcon(PointerIcon) -> PointerIcon.destroy() - Move DisplayImpl.PointerIconImpl -> PointerIconImpl (own source file) - Creation/Destruction and setting of PointerIcon happens on EDT - DisplayImpl.shutdownAll() and Display.destroy() calls destroyAllPointerIconFromList - WindowDriver.setPointerIconImpl: Validates PointerIconImpl (i.e. re-creates if required) - Fix 'initial' window.setPointerIcon(..) before createNative(..), tested w/ TestGearsES2NEWT - OSX Native Code: - Move mouse and pointer-state handling from NewtMacWindow -> NewtView class to retain states (pointer handle, pointer visibility, etc) when reparenting. Reparenting will move an exisiting NewtView into a new NewtMacWindow. - Enable all mouse move events: - NewtView::mouseEnter [nsWin makeFirstResponder: nsView]; - NewtView::mouseExited if( !mouseConfined ) { [nsView resignFirstResponder]; } - NewtView::mouseMoved issued [myCurser set] if required, fixing OSX issue not updating NSCursor properly. - MacWindow: - Test NewtMacWindow, NewtView and NSCursor handles before usage - Fix DBG_PRINT(..) warnings
* Bug 935: NEWT PointerIcon PNGIcon: Remove return value 'elem_bytesize[]' ↵Sven Gothel2014-01-031-3/+3
| | | | which is always 4 (RGBA/BGRA
* Bug 935: NEWT PointerIcon PNGIcon: Remove return value 'elem_bytesize[]' ↵Sven Gothel2014-01-035-14/+13
| | | | which is always 4 (RGBA/BGRA)
* Bug 935: NEWT PointerIcon: Add size, hotspot 'getter' and String representationSven Gothel2013-12-314-4/+30
| | | | PointerIcon's size and hotspot maybe be useful for certain user-app calculation.
* Bug 934, Bug 935: NEWT: Add support for custom Application/Window and ↵Sven Gothel2013-12-3110-13/+571
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pointer Icons - Utilizing JOGL's PNG decoder for all icons, if available. - Application/window icons: - Providing default application/window icons in 16x16 and 32x32 size - NewtFactory.setWindowIcons(..) or property 'newt.window.icons' maybe used to override default icons. - Using icons at application/window instantiation - Display.PointerIcons: - NativeWindow Win32 WindowClass no more references a default cursor in favor of fine grained cursor control [in NEWT] - Display provides create/destroy methods, where display destruction also releases open PointerIcon references. - Window.setPointerIcon(..) sets custom PointerIcon - Implemented Platforms - X11 - Windows - OSX - Manual Test: TestGearsES2NEWT (Press 'c')
* NEWT Cleanup - Remove Type Casts and OSX Newt/Fmod Workaround (Early ↵Sven Gothel2013-12-311-16/+0
| | | | WindowImpl initialization)
* NEWT WindowImpl: Add 'final' qualifier where possibleSven Gothel2013-12-311-54/+49
|
* Bug 924: Fullscreen toggle in X11 requires a 'sleep' on sluggish WMs (Unity) ↵Sven Gothel2013-12-201-2/+10
| | | | ; Block insets change while toggling fullscreen mode.
* Bug 924: Make ALWAYS_ON_TOP Persistent when Reparenting (child -> top) (2nd ↵Sven Gothel2013-12-201-0/+4
| | | | | | | | | | | | attempt) Commit c8726ef04b94ad8e66e1191a06ff793b908d130c reinforced ALWAYS_ON_TOP in native reconfig code issued at reparenting call, which might be too early for the WM. Perform ALWAYS_ON_TOP reinforcement from java side when reparenting CHILD -> TOP was successful and visibility is reached. X11 only! NewtAWTReparentingKeyAdapter: Add 'a' alwaysOnTop toggle to test w/o applet code.
* Bug 924: More robost Fullscreen ExitSven Gothel2013-12-191-24/+26
| | | | | | | | | | | - 'tempInvisible' shall be also performed for top windows, solves Unity-WM background refresh issue - Rename local field 'fullscreen' -> '_fullscreen' to avoid confusion - Proper insets handling: Set 'WindowImpl.this.fullscreen = _fullscreen' only before reconfiguring, otherwise wrong position maybe used due to wrong insets value. Tested w/ WMs: KWin + Unity
* NEWT WindowImpl: Enhance insetsChanged(..) DEBUG outputSven Gothel2013-12-191-4/+5
|
* Bug 924: Remove position criteria from reparent/fullscreen success, WM's ↵Sven Gothel2013-12-191-5/+6
| | | | only regard custom position as a hint (X11).
* Bug 924: X11 WindowDriver: Only perform 'tempFSAlwaysOnTop' toggle @ ↵Sven Gothel2013-12-191-9/+10
| | | | | | focusChanged(..) if isFullscreen() .. otherwise it will be triggered by reconfigure tasks while enabling/disabling fullscreen.
* Bug 924: Ignore reparent when in fullscreen - otherwise may confuse WMSven Gothel2013-12-191-0/+8
|
* Bug 922 (2/2): NEWT Window.reparentWindow(..): Use ↵Sven Gothel2013-12-111-2/+2
| | | | REPARENT_HINT_BECOMES_VISIBLE to ensure GL State Preservation ; Add unit test !
* Bug 922 (1/2): NEWT Window.reparentWindow(..): Provide ↵Sven Gothel2013-12-111-16/+39
| | | | | | | | | | | | REPARENT_HINT_BECOMES_VISIBLE hint via new method variant using hints; Deprecate other reparentWindow(..) variants w/o hints. NEWT Window.reparentWindow(..): Provide REPARENT_HINT_BECOMES_VISIBLE hint via new method variant using hints: - Add REPARENT_HINT_FORCE_RECREATION, covering 'old' forceDestroyCreate boolean argument - Add REPARENT_HINT_BECOMES_VISIBLE, Claim window becomes visible after reparenting, which is important for e.g. preserving the GL-states in case window is invisible while reparenting. Deprecate other reparentWindow(..) variants w/o hints. Use only new variant using hints w/o semantical change.
* Bug 914: Newt OSX: Reset NSApp's presentationOptions @ windowClose0() / ↵Sven Gothel2013-12-032-12/+17
| | | | | | | | | | | | | | | Assume having focus in fullscreen-mode - Reset NSApp's presentationOptions @ windowClose0() Commit 69c334448cfe8af553fd97689137ecf8f996b378 started using the [NSApp setPresentationOptions: opts] but missed to reset to defaults @ windowClose0(); - Assume having focus in fullscreen-mode NewtMacWindow::windowDidBecomeKey()' is not always called in fullscreen-mode! Note: OSX Fullscreen from a browser still shows the browser title-bar until mouse-click. Don't know how to avoid this. Minor issue..
* Bug 914 - Don't allow 'alwaysontop' in fullscreen mode, always allow ↵Sven Gothel2013-12-011-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | switching to other applications via ALT-TAB As described @ <http://forum.jogamp.org/Regression-of-alwaysOnTopBug-tp4030735p4030738.html>, we shall not steal the desktop in fullscreen mode via 'alwaysontop'. Latest tests on X11/GNU/Linux and Windows7 - before this patch: With default settings, i.e. alwaysontop (atop) disabled, it works as expected here, i.e.: - ALT-TAB triggers WM dialog, switching between apps. - ALT-TAB can actually switch to other apps. However, with enabled atop: - ALT-TAB triggers WM dialog, switching between apps. - ALT-TAB does _not_ switch to other apps. (*) I consider this a serious issue, since we shall not steal the desktop in fullscreen mode. This patch disables atop in fullscreen mode, i.e. (*) will switch to other apps again!
* Bug 907 - Refine DummyDispatchThread (DDT) Handling: Proper OO integration ↵Sven Gothel2013-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | in RegisteredClass; Safe DDT Post/WaitForReady handling and error cases ; ... Proper OO integration of DDT in RegisteredClass - DDT is optional to RegisteredClass[Factory], i.e. NEWT without DDT and DummyWindow with DDT. - Using native type DummyThreadContext per DDT passed as DDT handle to java referenced in RegisteredClass - Passing DDT handle to related native methods, if not null use DDT - otherwise work on current thread. The latter impacts CreateDummyWindow0 and DestroyWindow0. Safe DDT Post/WaitForReady handling and error cases ; ... - Wait until command it complete using a 3s timeout - Terminate thread if errors occur and throw an exception +++ Discussion: DDT Native Implementation Due to original code, the DDT is implemented in native code. Usually we should favor running the DDT from a java thread. However, since it's main purpose is _not_ to interact w/ java and the native implementation has less footprint (performance and memory) we shall be OK w/ it for now - as long the implementation IS SAFE.
* NEWT WindowImpl: Move consumePointerEvent(..) below doPointerEvent(..) to ↵Sven Gothel2013-11-181-109/+109
| | | | easy editing/review
* NEWT AWTAdapter*: Don't act if not setup (due to lazy setup mode), refines ↵Sven Gothel2013-11-181-0/+5
| | | | commit 5c6c11abf643013976ecbc0df463a923a1f52696
* NEWT AWTAdapter: Add notion of consuming the AWT InputEvent (will be used ↵Sven Gothel2013-11-181-41/+61
| | | | for key events); Allow AWTAdapter to be lazily setup w/ downstream object.
* Bug 903 - NEWT: Support 'Continue Drag on Exit'; Consistent Mouse ENTER/EXITSven Gothel2013-11-171-76/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Support 'Continue Drag on Exit' - Track dragging operation, allow exterior dragging - Hence track EXIT (see below) - Windows: - Capture mouse for exterior dragging - Only 'NewtWindows_trackPointerLeave' if 'entering' - Simplify touch: No 'inside' check - Not required. - Consistent Mouse ENTER/EXIT - Track ENTER/EXIT and synthesize if required, drop duplicate - OSX benefits, since it never produced ENTER/EXIT events - AWT (or other TK) translated events beahve equal now. - Required for EXIT event after ending exterior dragging and final RELEASE Tests: Passed unit tests 'junit.run.newt.event' on - GNU/Linux - Windows7 - OSX 10.7 Tested exterior tracking manually w/ NEWT TestGearsES2NEWT and TestGearsES2NewtCanvasAWT: - GNU/Linux - Windows7 (mouse) - Windows8.1 (touch) - OSX 10.7
* NEWT: Add more documentation to WindowImpl's doPointerEvent(..) and ↵Sven Gothel2013-11-131-9/+46
| | | | consumePointerEvent(..) impl. details
* Android Newt[Debug|Version]Activity: Separate both activities (testing odd ↵Sven Gothel2013-11-073-86/+130
| | | | reusing of app)
* Android: Add NewtDebugActivitySven Gothel2013-11-074-49/+112
|
* Bug 894 - GLDrawableFactory* [dummy|offscreen] Surface creation w/ own ↵Sven Gothel2013-11-061-1/+0
| | | | device does _not_ require locking on global shared device.
* NEWT Window: Expose 'setVisible(boolean wait, boolean visible)' allowing ↵Sven Gothel2013-11-061-11/+12
| | | | applications to not block until window becomes visible.
* Android NEWT.ScreenDriver MonitorSize: Use xdpi for for width (fix); Add ↵Sven Gothel2013-10-301-25/+35
| | | | DEBUG output.
* jogl: add missing @Override annotationsHarvey Harrison2013-10-1732-0/+161
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* jogl: remove all trailing whitespaceHarvey Harrison2013-10-1750-1138/+1138
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* MouseEvent: Clarify button-number and pointer-ID relation incl. case 'no ↵Sven Gothel2013-10-181-7/+7
| | | | | | | | | | button/pointer', i.e. button == 0, pointer-ID == -1 doPointerEvent: - allow id==-1 -> button==0 for no button, i.e. mouse move doMouseEvent: - keep button 0 value, i.e. map to pointer-ID -1
* WindowImpl: Fix DEBUG output's method name of doPointerEvent and ↵Sven Gothel2013-10-171-11/+11
| | | | consumePointerEvent
* Bug 800: Add Windows 7 Touch Event Support for NEWTSven Gothel2013-10-171-11/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Native: - WindowUserData tracks: - window size - mouse inside - pointer touch-down count and flags whether multiple-touch is supported. - Suppress WM_*BUTTON* events if within TOUCH operations, e.g. fingers are pressed, or if event is determined as TOUCH (0 != GetMessageExtraInfo()) - MOUSEMOVE issues NewtWindows_trackPointerLeave(..) directly if no TOUCH operation is in process. Removes need for MouseListener on Java side. - TOUCH events are send as follows: - PRIMARY first - 1 MOVE 2nd (if not sent already) - UP/DOWN (if not sent already) We only send max. one MOVE event, since Win7 / Win8 assignes MOVE per default, even if no actual move happened. Hence a single MOVE event shall suffice and is compatible w/ e.g. Android (AFAIK). - TOUCH pointer names are mapped to consecutive IDs on the java side.
* WindowImpl.doPointerEvent(..) Simplify pointer name->ID mapping, fix DEBUG.Sven Gothel2013-10-171-5/+7
|
* Regression of commit a90bf31f8747dd38c61d518f8af4d4d4a64a8e90: ↵Sven Gothel2013-10-171-3/+3
| | | | | | 'consume<Type>Event(<Type>Event ..)' must be protected and non-final Overriding by impl. class allowed.
* NEWT Multiple-Pointer API: Use PointerType[] instead of ordinal int[], ↵Sven Gothel2013-10-172-46/+108
| | | | implementer can use PointerType.valuesOf(int[] ordinals) to convert. Enhanced API doc. Methods 'final'
* NEWT PointerEvent: Unify event processing in new doPointerEvent(..) and ↵Sven Gothel2013-10-173-211/+276
| | | | | | | | | | | | | | | consumePointerEvent(..) - Unifies native mouse and Android's pointer event, ready for Win7 touch Unify event processing in new doPointerEvent(..), which is also invoked from doMouseEvent(..), and consumePointerEvent(). doPointerEvent(..): Validates and modifies event data and finally creates the event, where consumePointerEvent(..) calls gesture handlers and may synthesize events. Unifies native mouse and Android's pointer event, ready for Win7 touch. AndroidNewtEventFactory calls doPointerEvent(..) directly. Removed lots of duplicated pointer event handling code.
* MouseEvent: Clarify 'Multiple-Pointer' w/ button[mask] semantics, ; ↵Sven Gothel2013-10-171-3/+3
| | | | | | | | | | | | | | InputEvent: getButtonDownCount() and isAnyButtonDown(); - Clarify 'Multiple-Pointer' w/ button[mask] semantics - Pointer IDs start w/ 0 and are consecutive numbers. - 'button' == triggering pointer-ID - buttonMask in modifiers show pressed button _and_ pointer-IDs - deprecated BUTTON_NUMBER -> use BUTTON_COUNT (name semantics)
* Add efficient set(..all..) to Dimension, Insets, Point and Rectangle of ↵Sven Gothel2013-10-169-35/+10
| | | | NativeWindow's util types.
* Bug 861 - NEWT: Unify MouseEvent Processing incl. gesture processingSven Gothel2013-10-153-381/+490
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We processed MouseEvents within NEWT as follows: sendMouseEvent/enqueueMouseEvent -> doMouseEvent, - called by native code to be delivered via consumeMouseEvent (now or later) - events are validated (move/drag, boundaries) - missing events are synthesized (click, enter, ..) as well as in several factories, i.e.: - AWTNewtEventFactory (1:1) - AndroidNewtEventFactory - synthesized events .. (click, ..) - android typed gesture detection (drag -> 1 finger scroll..) The latter enqueues events do Window/Display directly to be consumed by WindowImpl. Then users may have their own gesture detection etc. +++ This change unifies mouse/pointer event processing within NEWT within consumeEvent(..) which represents a common entry point. Gesture processing is now realized w/ a public API - GestureHandler - GestureHandler.GestureListener - GestureHandler.GesureEvent which supplies: - default impl. of optional gesture handlers (scroll, .. - default: enabled) - public API to add/remove gesture-handler and -listener +++ This allows our impl. to scale better in support of more multiple pointer devices (-> Win7/Win8, X11, ..).
* NEWT Reparent/Fullscreen: Add 'waitForPosition(..)' when reparenting or back ↵Sven Gothel2013-10-091-3/+9
| | | | from fullscreen; JOGLNewtAppletBase: Reparent to pos 32/32, trying to avoid browser window focus/top stealing on X11.
* NEWT Reparent/Fullscreen: Fixes X11 unsuccessful return to parent window; ↵Sven Gothel2013-10-091-41/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add reparentWindow(..) top-level position arguments; Misc - Fixes X11 unsuccessful return to parent window On X11 when returning to parent window (-> CHILD), we have to set the window invisible and wait for the result. Otherwise it sometimes happens that the WM's reparent operation fails, i.e. the window won't become a child of desired parent and is positioned randomly. - Add reparentWindow(..) top-level position arguments .. allows bringing the child-window to top-level w/ a desired position. Otherwise the window would be positioned elsewhere as a top-level as the plain reparenting operation. X11 needs to set position and size _after_ making the window visible, otherwise WM may ignore the XConfigureWindow request. - Reparent recreate shall always store the desired position and size On OSX/CALayer when recreation is being used, we need to store the pos/size for later creation. - Tests: Use 'NewtAWTReparentingKeyAdapter' where possible (reparent/fullscreen) instead of duplicating such code. NewtAWTReparentingKeyAdapter: Performs reparenting and fullscreen operations off-thread (i.e. not on AWT/NEW EDT) while decorating the action w/ revoking/restoring the ExclusiveContextThread (ECT). Manually tested 'TestGearsES2NewtCanvasAWT' reparenting and fullscreen on X11, Windows and OSX/CALayer w/ JDK 7u40 successful.
* NEWT Display: Issue EDTUtil.start() at runOnEDTIfAvail(..) even if on EDT, ↵Sven Gothel2013-10-094-32/+32
| | | | | | | | | | | | | | | | | which is to be stopped. This case appears on e.g. OSX/CALayer (offscreen) reparenting using recreation (onscreen <-> offscreen), i.e. display destroy/create is performed on EDT. Misc Cleanup: - Rename EDTUtil: restart() -> start() - Rename Display: validateEDT() -> validateEDTStopped() - Simplify Display.setEDTUtil(..): Remove need for redundant 'newEDTUtil' local var. - Simplify Display.runOnEDTIfAvail(..): edtUtil is never null
* NEWT/OSX (Bug 836): Only WindowDriver.initWindow0(..) operation on ↵Sven Gothel2013-10-091-8/+13
| | | | | | main-thread must be synchronized (wait-until-done) - Leave WindowDriver.close0(..) w/o sync