| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
size after creation in multiple monitor mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 ..
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
|
|
|
|
|
|
|
|
|
| |
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(..).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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')
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
applications to not block until window becomes visible.
|
|
|
|
| |
Signed-off-by: Harvey Harrison <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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, ..).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
(NewtCanvasAWT, ..)
.. otherwise an auto repeated key would cause fast focus traversal, not intended.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
+ */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
delegate (ie GLWindow)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
- SurfaceUpdateHelper contains impl. used by NativeSurface implementations.
|
|
|
|
| |
cleanup in X11
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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. :)
|
| |
|
|
|
|
| |
Completes commit d4670328991c02a6f11f8873ea7a2331f17d0ef0
|
|
|
|
| |
write access
|
|
|
|
| |
boolean, see Collection::add/remove
|
|
|
|
|
|
|
| |
makes sense)
- WindowImpl/GLWindow: Cleanup destroy code ..
- Tests: sync / remove FPS stderr print
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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()
|
| |
|
|
|
|
| |
and getChosenCapabilities() return immutable instances. Add cloneCapabilities() to create a mutable clone of an immutable set of capabilities.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
ScreenModeUtil fix:
- return 'null' for an empty list, check if list is null or empty.
- remove 'validate'
Window: TIMEOUT_NATIVEWINDOW 500 -> 1000 ms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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
- 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()
|
|
|
|
|
|
| |
- Window add focus tracking and query via hasFocus()
- TestTransformFeedbackVeryingsBug407NEWT allow fail if no GL3 is available
- TestFocus01SwingAWT check on NEWTChild focus
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|