aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes/com/jogamp/newt/Window.java
Commit message (Collapse)AuthorAgeFilesLines
* NEWT Window setSurfaceSize(..): Add API doc comment about setting pixel-unit ↵v2.2.0Sven Gothel2014-08-071-0/+5
| | | | size after creation in multiple monitor mode.
* Bug 741 HiDPI: Add ScalableSurface.getNativeSurfaceScale(..) to compute ↵Sven Gothel2014-06-091-0/+21
| | | | | | | | | | | | | | surface DPI ; Add NEWT Window.getPixelsPerMM(..) to query surface DPI With HiDPI and surface scale, we need knowledge of the native surface's pixel-scale matching the monitor's pixel-per-millimeter value. Preserving the queried native pixel-scale and exposing it via ScalableSurface.getNativeSurfaceScale(..) to compute surface DPI. Add NEWT Window.getPixelsPerMM(..) to query surface DPI. Surface DPI is demonstrated in GraphUI's GPUUISceneGLListener0A .. and TestRulerNEWT01, etc ..
* NEWT Window: Remove deprecated methods: HiDPI + reparentWindow(..)Sven Gothel2014-06-081-60/+0
| | | | | | | | Remove HiDPI pixel- from/to window-unit conversion and getter methods: Rectangle HiDPI pixel- from/to window-units are erroneous in case of multiple monitor setup where a mixed pixel-scale exist, since the methods didn't take the monitor viewport and each of it's pixel-scale into account (expensive). Remove deprecated reparentWindow(..) methods.
* Bug 741 HiDPI: Add ScalableSurface interface to get/set pixelScale w/ full ↵Sven Gothel2014-06-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OSX impl. Add ScalableSurface interface - To set pixelScale before and after realization - To get pixelScale - Implemented on: - NEWT Window - Generic impl. in WindowImpl - OSX WindowDriver impl. - Also propagetes pixelScale to parent JAWTWindow if offscreen (NewtCanvasAWT) - AWT WindowDriver impl. - JAWTWindow / OSXCalayer - AWT GLCanvas - AWT GLJPanel - NEWTCanvasAWT: - Propagates NEWT Window's pixelScale to underlying JAWTWindow - WrappedSurface for pixelScale propagation using offscreen drawables, i.e. GLJPanel - Generic helper in SurfaceScaleUtils (nativewindow package) - Fully implemented on OSX - Capable to switch pixelScale before realization, i.e. native-creation, as well as on-the-fly. - Impl. uses int[2] for pixelScale to support non-uniform scale. Test cases: - com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT - com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT - com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT - com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT - Press 'x' to toggle HiDPI - Commandline '-pixelScale <value>' - Added basic auto unit test (setting pre-realization)
* NEWT AWTAdapter: Simplify event processing / Window.enqueueEvent(..): Add ↵Sven Gothel2014-06-051-0/+5
| | | | | | | | | | API doc Simplify event processing of NEWT's AWTAdapter: - enqueueEvent -> processEvent - add return value (new enum) determinating action Using processEvent(..) now reduces manual invocation of NEWT Window.enqeueEvent(..).
* Bug 741 HiDPI: Refine Monitor/Screen [virtual] Viewport Definition / Add ↵Sven Gothel2014-05-261-3/+20
| | | | | | | | | | | | | | | | | | | | NEWT Support / Fix JAWT getPixelScale deadlock - NativeWindow/Surface/NEWT API DOC: Define Coordinate System of Window and Screen - OSXUtil: Add getPixelScale(..) via Screen index and 'windowOrView' - JAWTWindow/JAWTUtil.getPixelScale(..): Use pre-fetched AWT GraphicsConfiguration to solve AWT-TreeLock (deadlock) - [Virtual] Viewport of MonitorDevice and Screen: - Properly calculate and expose [virtual] viewport in window and pixel units - OSX Monitor viewports in pixel units are 'reconstructed' - Window/Viewport to Monitor selection shall be perfomed via window units (unique) - OSX NEWT Window create/init (native): Use given size and coordinates even in fullscreen mode Don't override by quering NSScreen coordinates, trust given values. - Fix test cases, i.e. usage of pixel- and window-units
* Bug 742 HiDPI: [Core API Change] Distinguish window-units and pixel-units: ↵Sven Gothel2014-05-231-6/+19
| | | | | | | | | | | | | | | Refine commit fb57c652fee6be133990cd7afbbd2fdfc084afaa - NEWT Screen, Monitor, MonitorMode, .. - All Units are in pixel units, not window units! - On OSX HiDPI, we report the current scaled monitor resolution, instead of the native pixel sized. Need to filter out those, i.e. report only native unscaled resolutions, since out MonitorMode analogy is per MonitorDevice and not per window! - Fix usage (one by one) of - Screen and Monitor viewport usage
* Bug 742 HiDPI: [Core API Change] Distinguish window-units and pixel-units: ↵Sven Gothel2014-05-221-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refine commit f9a00b91dcd146c72a50237b62270f33bd0da98e - Using comment tag 'FIXME HiDPI' to locate remaining issues - Fix remaining 'getPixel*(..)' -> 'getSurface*(..)' - UpstreamSurfaceHook - Fix usage (one by one) of - NativeWindow: getWindowWidth() / getWindowHeight() - NativeSurface/GLDrawable: getSurfaceWidth() / getSurfaceHeight() - mention window- or pixel units in API doc where required - use 'setSurfaceSize(..)' where appropriate to match 'getSurface*()' - GLFBODrawable - GLOffscreenAutoDrawable - UpstreamSurfaceHook.MutableSize - NativeWindow's Point: Add API doc and 'Point scaleInv(..)' - NativeSurface Simplify new conversion methods and use single in-place storage - 'int[] getWindowUnitXY(int[], int[])' -> 'int[] convertToWindowUnits(int[], int[])' - 'int[] getPixelUnitXY(int[], int[])' -> 'int[] convertToPixelUnits(int[], int[])' - NEWT Screen/Monitor - Assume screen/window units - TODO: Refine semantics - Monitor resolution probably is in pixel units ?! - Including the Rectangle/Monitor association etc etc - NEWT Window - Add setSurfaceSize(..) for convenience - Add 'Point convertToWindowUnits(final Point pixelUnitsAndResult)', etc .. - All window ops are using window units (size, pos, ..), but methods operating on the surface/drawable: windowRepaint(..) .. - TODO: Consider changing method names 'window*(..)' to 'surface*(..)' actually operating on surface/drawable - Window.windowRepaint(..) - GLAutoDrawableDelegate.windowResizedOp(..) (maybe all similar methods in here) - NEWT Mouse/Pointer Events - Using pixel units
* Bug 742 HiDPI: [Core API Change] Distinguish window-units and pixel-units; ↵Sven Gothel2014-05-211-17/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add HiDPI for AWT GLCanvas w/ OSX CALayer Core API Change: To support HiDPI thoroughly in JOGL (NativeWindow, JOGL, NEWT) we need to separate window- and pixel units. NativeWindow and NativeSurface now have distinguished access methods for window units and pixel units. NativeWindow: Using window units - getWindowWidth() * NEW Method * - getWindowHeight() * NEW Method * - getX(), getY(), ... NativeSurface: Using pixel units - getWidth() -> getSurfaceWidth() * RENAMED * - getHeight() -> getSurfaceHeight() * RENAMED * GLDrawable: Using pixel units - getWidth() -> getSurfaceWidth() * RENAMED, aligned w/ NativeSurface * - getHeight() -> getSurfaceHeight() * RENAMED, aligned w/ NativeSurface * Above changes also removes API collision w/ other windowing TK, e.g. AWT's getWidth()/getHeight() in GLCanvas and the same method names in GLDrawable before this change. +++ Now preliminary 'working': - AWT GLCanvas - AWT GLJPanel Tested manually on OSX w/ and w/o HiDPI Retina: java com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT -manual -noanim -time 1000000 java com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT -manual -noanim -time 1000000 +++ TODO: - NEWT - Change Window.setSize(..) to use pixel units ? - OSX HiDPI support - Testing .. - API refinement
* NEWT Window: Add API Doc for Custom Window IconsSven Gothel2014-01-301-0/+15
|
* Bug 934, Bug 935: NEWT: Add support for custom Application/Window and ↵Sven Gothel2013-12-311-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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')
* Bug 922 (1/2): NEWT Window.reparentWindow(..): Provide ↵Sven Gothel2013-12-111-1/+24
| | | | | | | | | | | | 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.
* NEWT Window: Expose 'setVisible(boolean wait, boolean visible)' allowing ↵Sven Gothel2013-11-061-5/+16
| | | | applications to not block until window becomes visible.
* jogl: remove all trailing whitespaceHarvey Harrison2013-10-171-16/+16
| | | | Signed-off-by: Harvey Harrison <[email protected]>
* Bug 861 - NEWT: Unify MouseEvent Processing incl. gesture processingSven Gothel2013-10-151-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Fixes X11 unsuccessful return to parent window; ↵Sven Gothel2013-10-091-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Don't invoke external keyboardFocusHandler for auto-repeat keys ↵Sven Gothel2013-06-241-1/+5
| | | | | | (NewtCanvasAWT, ..) .. otherwise an auto repeated key would cause fast focus traversal, not intended.
* Fix Bug 600 and Bug 721: Adding support for multiple monitors w/ NEWTSven Gothel2013-05-061-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Support for all monitor devices and their available modes - X11: Use RandR 1.3 if available - Retrieve information - Changing a monitor device's mode - Support for dedicated and spannig fullscreen - See <http://jogamp.org/files/screenshots/newt-mmonitor/html/> - TODO: - X11 RandR does _not_ relayout the virtual screen size and neither the CRT's viewport. We may need to relayout them if they were covering a seamless region to achieve same experience! - OSX: No machine to attach a secondary CRT -> TEST! - Tested Manually for Regressions - Linux ARMv6hf (Rasp-Pi/BCM, Panda/X11) - Android (Huawei, Kindle) - Tested Manually and junit: - X11/Linux - NV, ATI-Catalyst w/ 2 CRTs - VBox w/ 4 CRTs - Win/Windows - NV, w/ 2 CRTs - VBox w/ 4 CRTs - X11/OpenIndiana, NV, 1 CRT
* Fix NEWT/AWT WindowClosing Unit Tests ; Review/Cleanup NEWT WindowClosing ↵Sven Gothel2013-02-281-4/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix Bug 572 (2nd time): GLCanvas.validateGLDrawable() @ display() and ↵Sven Gothel2012-10-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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 Bug 601: Harmonize order of key events incl. auto-repeat and adding ↵Sven Gothel2012-09-161-0/+2
| | | | | | | | | | | | | | | | | | | | | AUTOREPEAT_MASK modifier bit. Refine InputEvent toString(..) and list modifiers by name. As now described in NEWT's KeyEvent: +/** + * Key events are delivered in the following order: + * <ol> + * <li>{@link #EVENT_KEY_PRESSED}</li> + * <li>{@link #EVENT_KEY_RELEASED}</li> + * <li>{@link #EVENT_KEY_TYPED}</li> + * </ol> + * In case the native platform does not + * deliver keyboard events in the above order or skip events, + * the NEWT driver will reorder and inject synthetic events if required. + * <p> + * Besides regular modifiers like {@link InputEvent##SHIFT_MASK} etc., + * the {@link InputEvent#AUTOREPEAT_MASK} bit is added if repetition is detected. + * </p> + */
* Bug 599 - FBObject / Offscreen Support - Part 1Sven Gothel2012-07-191-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New FBObject implementation handling FBO and it's attachments *** API CHANGE: Util -> Core *** while it's size and sample-count can be reconfigured on the fly. - com.jogamp.opengl.util.FBObject -> com.jogamp.opengl.FBObject - agnostic to texture unit - separate attachments using OO hierarchy reflecting FBO - handling MSAA and blitting - no FBO destruction for reconfig (attach/detach) - New GLFBODrawableImpl impl. an FBObject based GLDrawable - Instantiated by a dummy native surface (onscreen and invisible) hooked up to a dummy GLDrawable, which is the delegation for context creation. - Utilizies ProxySurface.UpstreamSurfaceHook for dummy surface avoiding specialization for native platforms. - TODO: Allow to utilize common surface interface as a dummy-surface to supporting API seperation of windowing/GL. The latter allows impl. of createGLDrawable(NativeSurface) with FBO. - New OffscreenAutoDrawable (extends GLAutoDrawableDelegate) for all offscreen drawables. Shall replace GLPbuffer. - New GLCapabilities*.isFBO() / setFBO(boolean) to request FBO offscreen, similar to isPBuffer(). Rule: if both are requested, FBO shall be favored. - GLContext adds raw FBO availability query (min. FBO avail), FBObject contains fine grained queries (TODO: Move parts to GLContext for efficiency). - Add framebuffer tracking, allowing fast querying: - GLBase/GLContext: public int getBoundFramebuffer(int target); public int getDefaultDrawFramebuffer(); public int getDefaultReadFramebuffer(); - GLContextImpl public final void setBoundFramebuffer(int target, int framebufferName) .. called by GL impl bind framebuffer - GL: getDefaultDrawFramebuffer(), getDefaultReadFramebuffer() Adding default framebuffer queries being issued by GL.glBindFramebuffer(target, 0) w/ a default framebuffer, o.e. zero. This allows a transparent use of a custom FBO even in case the applications attempts to reset FBO to zero. Value flow: GL <- GLContext <- GLDrawable, - GLCapabilities handle fbo/pbuffer seperate, don't disable the other - GLContext/GL track read/write framebuffer to be queried by FBObject to determine whether to bind/unbind a framebuffer - Test cases for multiple FBO w/ and w/o MSAA Other Features: - New interface ProxySurface.UpstreamSurfaceHook, allowing to hook an upstream surface of unknown type providing lifecycle and information (size, ..) callbacks. Used for all new dummy NativeSurface impl and SWT GLCanvas. - GLContext -> GLDrawable propagation context/drawable lifecycle via ProxySurface.UpstreamSurfaceHook allowing dynamic resources to react (create, init, ..) - contextRealized() - contextMadeCurrent() - SurfaceChangeable -> MutableSurface currently only contains setting the surface handle. TODO: May need to move ProxySurface.UpstreamSurfaceHook -> MutableSurface.UpstreamSurfaceHook, allowing other impl. classes (NEWT OffscreenWindow) to utilize the new upstream hookup mechanism - will allow FBO/Dummy window to work. - SWT GLCanvas using ProxySurface.UpstreamSurfaceHook for proper size propagation. - New GLAutoDrawable::getUpstreamWidget(), allowing GLEventListener to fetch the owning Java side UI element (NEWT, SWT, AWT, ..). - GLDrawableFactory: Removed createOffscreenSurface() - unused and not GL related - EGLDrawableFactory handles device/profile avail. mapping while actually creating context/drawable. This allows us to learn whether the ES context is software/hardware as well as FBO avail. - EGLDrawable: Removed secret buckets of EGL configs :) Employ native surface (X11, WGL, ..) to EGL 'mapping' in EGLDrawableFactory utilizing new EGLUpstreamSurfaceHook (implements ProxySurface.UpstreamSurfaceHook). Other Bugs: - Add CTX_OPTION_DEBUG to ctx/extension cache key since only a debug ctx may expose the ARB debug capability. This bug caused lack of ARB/AMD debug functionality. - Fix GLProfile deadlock (debug mode, w/ EGL/ES, no X11), dump availability information _after_ lock. - ImmModeSink draw(): Use GL's glDrawElements(..), don't cast for GL2ES1. Fixes use for GL2ES2. - Fix KeyEvent.getKeyChar() comment (-> only stable for keyTyped(..)) Misc: - Refined alot of API doc - New GLExtensions holds commonly used GL extension strings, allows better referencing and usage lookup. - Move GL (interface) decl. to GLBase - GLBuffers: Cleanup API doc (format, types) - TextureIO: Add PAM and PPM static suffix identifier - GLCapabilities getNumSamples() returns 0 if sampleBuffers is disabled, this seems to be more natural. - finalized a lot
* Misc cleanup: add @OverrideSven Gothel2012-06-271-43/+44
|
* NEWT: Add virtual on-screen keyboard visibility interface methods incl. ↵Sven Gothel2012-06-211-7/+28
| | | | | | | | | | | | | Android implementation. Note: Currently only w/ Android implementation. Note: On Android there is no way to reliably be notified of the current keyboard state. It would be best, if your code does not rely on this information Window adds: - setKeyboardVisible(boolean) - isKeyboardVisible() // unreliable on Android
* NEWT: Revert static/locked action instances due to possible deadlocks; class ↵Sven Gothel2012-05-021-9/+9
| | | | | | | | | | | | | | | Window.ReparentAction -> enum Window.ReparentOperation Revert static/locked action instances due to possible deadlocks - reverts commit: be59d561fd6ab8aa659e85cd962d38fffd1acb0a (partially) - reverts commit: 5742b1faa210401470032ef129e56a83c47fd046 Even thought the idea of having no temp. objects is nice to have, using a static instance requires locking which introduces a deadlock in case the action is being issued from diff. threads. class Window.ReparentAction -> enum Window.ReparentOperation (Minor API Change) Clarifies reparent operations using enums
* NEWT Window: Promote/Expose 'Window getDelegatedWindow()' for accessing the ↵Sven Gothel2011-11-191-0/+5
| | | | delegate (ie GLWindow)
* NEWT/AWT Focus Traversal / Deadlock Fix (Windows) ; Harmonized NEWT ↵Sven Gothel2011-11-181-3/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KeyListener handling (Bug 526) NativeWindow: - expose 'hasFocus()' Window: - 'protected enqueueRequestFocus(..)' -> 'public requestFocus(boolean wait)' - New: 'setKeyboardFocusHandler(KeyListener)' allowing focus traversal co-op w/ covered TK (AWT) WindowImpl: - Impl Window changes (see above) - Impl 'consumedTag' see commit 3b38957f36d4f89b85730755a41c00892ac70591 NewtCanvasAWT: - FocusAction only removes the global AWT focus owner. This fixes a deadlock on the Windows platform of AWT's native peer requestFocus impl, since it's no more called at this point. - NEW FocusTraversalKeyListener is set as the newtChild's KeyboardFocusHandler, allowing traversal to the next/previous AWT component. AWTParentWindowAdapter: - focusGained(..) clears AWT focus and propagates focus to Newt child, non blocking w/ 'requestFocus(false)' (see above) KeyEvent: - Document limitations of getKeyChar() (Bug 526) MacWindow: - only deliver keyChar on key Typed events, harmonizing platform behavior (Bug 526) WindowsWindow: - regenerate the keyCode for EVENT_KEY_TYPED (Bug 526) X11Windows: - complete keyCode mapping X11 -> Newt - X11KeySym2NewtVKey() - only deliver keyChar on key Typed events, harmonizing platform behavior (Bug 526) Tests: - GearsES2: Make focus visible - TestParentingFocusTraversal01AWT: unit test for keyboard focus traversal w/ NewtCanvasAWT
* NativeWindow/JOGL: NativeSurface adds add/remove SurfaceUpdateListenerSven Gothel2011-11-061-33/+0
| | | | - SurfaceUpdateHelper contains impl. used by NativeSurface implementations.
* NEWT Pointer Feature: Add Windows impl. ; Fix test (warp action) ; Minor ↵Sven Gothel2011-10-101-0/+4
| | | | cleanup in X11
* NEWT: Add pointer features: visibility, confined and warp (move)Sven Gothel2011-10-101-0/+34
| | | | | | | | | | | | | | | visibility: - set pointer visible or invisible confined: - confine pointer to window, or not warp: - set mouse position within the window Implemented for X11, tested manually with TestGearsES2NEWT (see code for action keys). TODO: Windows, MaxOSX and Android (limited)
* NEWT setAlwaysOnTop(): Allow windows to stay permanent on top; TODO: X11/WindowsSven Gothel2011-09-141-0/+4
|
* Destruction of GLAutoDrawable shall not remove them from AnimatorControl ↵Sven Gothel2011-09-081-10/+2
| | | | | | | | | | | | | | | | | | | (due to recreation) ; NEWT/Window: Remove isValid() API entry - always true! Destruction of GLAutoDrawable shall not remove them from AnimatorControl (due to recreation) - Completes commit b65e1e76d413b70e5593173e6bd36d30675554a6 - WindowImpl: - volatile: windowHandle/visible fields (memeory sync critical) - destroy must set visible := false, to avoid immediate recreation via a display call of another thread, ie an animator. NEWT/Window: Remove isValid() API entry - always true! - NEWT/Window's can always be recreated. - redundancy in API is even worse than redundancy in impl. :)
* NEWT Cleanup: Remove DEBUG_WINDOW_EVENT, ..Sven Gothel2011-09-061-1/+0
|
* NativeWindow/NEWT: Cont. refinement of Insets usageSven Gothel2011-09-061-3/+11
| | | | Completes commit d4670328991c02a6f11f8873ea7a2331f17d0ef0
* NativeWindow/NEWT: Refine Insets definition for size and position, read and ↵Sven Gothel2011-09-041-56/+56
| | | | write access
* NEWT Window/WindowImpl: Add generics - addChild()/removeChild() return ↵Sven Gothel2011-08-301-2/+2
| | | | boolean, see Collection::add/remove
* Newt Window: Remove 'invalidate()' method, only 'destroy()' is required (and ↵Sven Gothel2011-04-261-8/+1
| | | | | | | makes sense) - WindowImpl/GLWindow: Cleanup destroy code .. - Tests: sync / remove FPS stderr print
* Move implementation private files from com.jogamp.<module>.impl. to ↵Sven Gothel2011-02-091-1/+1
| | | | | | | | | | | | | | | jogamp.<module> (2/2) - edit files - com.jogamp.opengl.impl -> jogamp.opengl - com.jogamp.opengl.util.glsl.fixedfunc.impl -> jogamp.opengl.util.glsl.fixedfunc - com.jogamp.nativewindow.impl -> jogamp.nativewindow - com.jogamp.newt.impl -> jogamp.newt This sorts implementation details from the top level, ie skipping the public 'com', allowing a better seperation of public classes and implementation details and also reduces strings. This approach of public/private seperation is also used in the OpenJDK.
* JOGL/NEWT: Introduce WindowClosingProtocol (solves Bug/Request 444)Sven Gothel2010-12-191-1/+2
| | | | | | | | | | | | | | | | | Similar to JFrame's closing behavior, the following components window closing follow the new WindowClosingProtocol: - GLCanvas - GLJPanel - NEWT Window, GLWindow - NEWT NewtCanvasAWT The implementation obeys either 1) the user value set by this interface, 2) an underlying toolkit set user value (JFrame, ..) 3) or it's default, eg. {@link #DO_NOTHING_ON_CLOSE DO_NOTHING_ON_CLOSE} within an AWT environment. If none of the above determines the operation, this protocol default behavior {@link #DISPOSE_ON_CLOSE DISPOSE_ON_CLOSE} shall be used.
* JOGL/NEWT: Animator fixesSven Gothel2010-11-211-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider use cases with many drawables and no drawables at start, this had to be reflected all over this patch set, implementation, usage and test cases. - GLAnimatorControl - refine API doc / states - add 'void remove(GLAutoDrawable drawable);' - Animator*: - using RecursiveLock 'stateSync' for all actions out of the big synchronized (animator) block: - get status methods (thread, isPaused, ..), hence no more synchronized - display drawables change, utilizing synced ArrayList swap This removes the need for volatiles usage shouldPause/shouldStop within the display method. - added blocking wait for state change for add(GLAutoDrawable)/remove(GLAutoDrawable) method - remove flawed double checked locking in anim thread (pause/idle condition) - thread is now a daemon thread, hence it won't hinder the JVM from shutdown - - Animator use change: - Always resume after pause, except in case of final destroy -> NEWT invalidate / GLCanvas, this considers use cases with many drawables and no drawables at start. - GLDrawableHelper: Don't pause at implicit dispose()
* NEWT: Adding CapabilitiesChooser setter and using it in createNativeImpl() ..Sven Gothel2010-11-181-0/+9
|
* Implement CapabilitiesImmutable to indicate that getRequestedCapabilities() ↵Steve Vaughan2010-11-171-5/+11
| | | | and getChosenCapabilities() return immutable instances. Add cloneCapabilities() to create a mutable clone of an immutable set of capabilities.
* NEWT Lifecycle remodel: Window destroy() !Sven Gothel2010-11-161-17/+11
| | | | | | | | | | | | | | | | | | | | | | | NEWT's removed: Window: destoy(boolean unrecoverable) Display/Screen: get/set DestroyWhenUnused(boolean) We behave as follows: - Window.destroy() always decr Screen's reference counter, which issues destruction when reached zero. Then Screen does the same for Display .. - Window.destroy() keeps alive all references, hence it can be always recreated via setVisible(true). - Window.destroy() ensures Display's EDT is stopped if display is destroyed. - Window.invalidate() actually removes all Object reference, hence it cannot be recreated or used after it. This method exist to support a way to cleanup memory, GC. All test passed on Linux/X11 and Windows
* NEWT: ScreenModeUtil fix, misc changesSven Gothel2010-11-031-2/+2
| | | | | | | | ScreenModeUtil fix: - return 'null' for an empty list, check if list is null or empty. - remove 'validate' Window: TIMEOUT_NATIVEWINDOW 500 -> 1000 ms
* NEWT: ScreenMode changesSven Gothel2010-10-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - New type definition: ScreenMode { MonitorMode { SurfaceSize { Resolution, bpp }, ScreenSizeMM, refreshRate }, rotation }, where Resolution and ScreenSizeMM are of type DimensionReadOnly - ScreenMute instance is - immutable - hashable - cloneable The above allows fast query and storage w/o redundancies. More than 300 modes via permutation could be expected. ScreenMode impl. changes: ScreenImpl: To be implemented methods by native specialization: - protected int[] getScreenModeFirstImpl() - protected int[] getScreenModeNextImpl() - protected ScreenMode getCurrentScreenModeImpl() - protected boolean setCurrentScreenModeImpl(ScreenMode screenMode) The data unification etc is implemented generic using ScreenModeUtil and the 'int[]' streaming. ScreenModeStatus holds all ScreenMode related data and provides a locking strategy. ScreenModeListener provides a callback facility for ScreenMode change events. - Screens listen to ScreenModeStatus, so all FQN referenced Screen's receive the change. - Windows listen to Screen, to take appropriate action for the event (fullscreen, reshape). Misc: - Screen/Display: promoting 'addReference'/'removeReference' to public interface, so a user may trigger construction/destruction (-> junit tests, plus other clients than WindowImpl). - Gears: 'setSwapInterval' at 'reshape' instead of 'init', so it's reset when ScreenMode is changing. -
* NEWT: Fix / Stabilize Fullscreen/Decoration/Reparenting Mode ChangesSven Gothel2010-10-211-0/+3
| | | | | | | | | | | | | | | | | | | | | | - setSizeImpl/setPositionImpl/reparent -> reconfigureWindowImpl - setVisible(boolean) is state checked (500ms) for better reliability on resource creation. Guarantees valid surface. - reparentWindow: start pos of child -> top is current position on screen - reparentWindow: Recheck success (setVisible), if failed fall back to recreate, which gets rid of a lost child windows (1/20) .. - reparentWindow: if size failed, reconfigure for size again - add toggle decoration - unify nfs_ size/pos state - WindowsWindow.c/X11Window.c: Unify size/pos settings - X11Window.c: - NewtWindows_setFullscreen: use 'root of screen' instead of 'default root of display' - Adding SubstructureNotifyMask incl event semantics - Parse ReparentNotify (debugging of reparenting) Misc: - Add native getLocationOnScreen() impl to avoid possible AWT deadlock - setSize/setPosition/setFullScreen -> EDT - More documentation on expected native implementation semantics
* NativeWindow/NativeSurface Refactoring ; Added mouseClick NEWT/AWT unit testSven Gothel2010-10-061-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | NativeWindow/NativeSurface Refactoring - Using NativeSurface interface - NativeWindow extends NativeSurface, adds getLocationOnScreen(Point) - NativeWindow add: getParent() - NativeWindow/Surface: Removed 'invalidate()', use 'destroy()' if you must. - NullWindow -> ProxySurface impl NativeSurface - JOGL: Uses NativeSurface only. - GLDrawable.getNativeWindow() -> GLDrawable.getNativeSurface() Added mouseClick NEWT/AWT unit test JOGL: - GLAnimatorControl add: resetCounter() - NEWT: - GLWindow counters: return GLWindow counters always - WindowImpl - requestFocus() wait until done - reparent: readded requestFocusImpl(true), native impl skips java focusAction if reparented - X11Window: Add XRaiseWindow() in requestFocus()
* NEWT: Add Window.hasFocus() ; Test cleanup ..Sven Gothel2010-09-261-0/+2
| | | | | | - Window add focus tracking and query via hasFocus() - TestTransformFeedbackVeryingsBug407NEWT allow fail if no GL3 is available - TestFocus01SwingAWT check on NEWTChild focus
* NEWT: Fix Display/Window/Screen OO Identity, Reparenting and requestFocusSven Gothel2010-09-231-1603/+251
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NativeWindow: Interface NativeWindow changes: - Remove 'throws' qualifier in lockSurface(), since it is not - Adding convenient 'one call' isSurfaceLockedByOtherThread() - Adding getSurfaceLockOwner() NEWT Window/GLWindow: - Unclutter Window/GLWindow relationship - save Window's indentity GLWindow's role is a GLAutoDrawable implementation aggregating (maybe even compositioning) a Window. The previous implementation just derived from the Window implementation, overwriting methods and fields - impossible to ensure sanity / completness. It was also not ensured that the added functionality of GLWindow (setVisible, destroy, ..) has been issued in case of handling the aggregated Window alone (window callbacks, ..). To solve this issue in a 1st attempt without changing the GLWindow API, Window is just an interface, being implemented by their specializations, hence sanity is intrinsic. GLWindow's added functionality is ensured by a Window.LifecycleHook interfaced implementation, registered at the aggregated Window. - Screen and Window are interfaces now (new files) - Display is an abstract class. - Their (abstract) implementations resides in impl/<BaseName>Impl - GLWindow implements Window as well - Remove Screen reference handled by setScreen(Screen) method. - Lock native parentWindow if used (createNative/reparenting) - Move lockSurface/unlockSurface from unchecked override pattern to an callback style using abstract methods lockSurfaceImpl/... - Sorting all methods to semantic sections, abstract, superinterface, .. - Reparenting: Handling different reparenting situations: - Unchanged - No change - Native Reparenting - Compatible Display/Screen, try native reparenting - Native (Re)Creation - Use destroy/create pattern - Native Creation Pending - Create later - setUndecorated() calls reconfigure Window now, ie tries to change the window actually - Don't issue 'requestFocus()' directly from the native implementation anymore, call it from the Java code. - Window/GLWindow/NewtFactory: Constructor simplification Avoid explosion of constructor overloading, ie removing the 'undecorated' variant, since this is redundant due to the 'setUndecorated(boolean)' method. - Fixed/added API documentation
* NEWT: Changed Lifecycle of Display/Screen (part 2)Sven Gothel2010-09-151-79/+172
| | | | | | | | | | | | | | | | | | | | | Window Reparenting (unification): On the fly Display/Screen creation resides in NewtFactory. Reparenting logic within Window. Handles all reparenting cases now: ACTION_NONE, ACTION_SOFT_REPARENTING, ACTION_NATIVE_REPARENTING, ACTION_NATIVE_CREATION - out.println -> err.println ++++ - Bumbed windows bat scripts to 1.6.0_21 and ant 1.8.1 - Debug: /RecursiveToolkitLock.java TO is 300s for now, while not finished. - +++ Needs more testing. Deadlocks: AWT/NEWT parenting.