Top Fields Constructors Methods
jogamp.newt

public Class OffscreenWindow

extends WindowImpl
implements MutableSurface
Class Inheritance
All Implemented Interfaces
com.jogamp.nativewindow.MutableSurface, com.jogamp.nativewindow.NativeSurface, com.jogamp.nativewindow.SurfaceUpdatedListener
Imports
java.util.List, com.jogamp.nativewindow.AbstractGraphicsConfiguration, .AbstractGraphicsScreen, .GraphicsConfigurationFactory, .MutableSurface, .NativeWindowException, .VisualIDHolder, com.jogamp.nativewindow.util.Point, com.jogamp.newt.MonitorDevice

Field Summary

Modifier and TypeField and Description
pack-priv static long
pack-priv long
Inherited from jogamp.newt.WindowImpl:
capabilitiesChoosercapsRequestedCHANGE_MASK_ALWAYSONBOTTOMCHANGE_MASK_ALWAYSONTOPCHANGE_MASK_DECORATIONCHANGE_MASK_FULLSCREENCHANGE_MASK_MAXIMIZED_HORZCHANGE_MASK_MAXIMIZED_VERTCHANGE_MASK_PARENTINGCHANGE_MASK_RESIZABLECHANGE_MASK_STICKYCHANGE_MASK_VISIBILITYCHANGE_MASK_VISIBILITY_FASTDEBUG_TEST_REPARENT_INCOMPATIBLEhasPixelScalekeyboardVisiblemaxPixelScaleminimumReconfigStateMaskminPixelScalePSTATE_BIT_FOCUS_CHANGE_BROKENPSTATE_BIT_FULLSCREEN_MAINMONITORPSTATE_MASK_FOCUS_CHANGE_BROKENPSTATE_MASK_FULLSCREEN_MAINMONITORQUEUED_EVENT_TOQUIRK_BIT_VISIBILITYquirksreqPixelScaleSTATE_BIT_COUNT_ALL_PUBLICSTATE_BIT_COUNT_ALL_RECONFIGSTATE_BIT_FULLSCREEN_SPANSTATE_MASK_ALL_PUBLICSTATE_MASK_ALL_PUBLIC_SUPPORTEDSTATE_MASK_ALL_RECONFIGSTATE_MASK_CREATENATIVESTATE_MASK_FULLSCREEN_SPANstateMasksupportedReconfigStateMaskwindowList

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
createNativeImpl()

Implements abstract jogamp.newt.WindowImpl.createNativeImpl.

The native implementation must set the native windowHandle.
public synchronized void
destroy()

Overrides jogamp.newt.WindowImpl.destroy.

Implements com.jogamp.newt.Window.destroy.

Destroys this window incl.
public Point
getLocationOnScreen(final Point
Optional Point storage. If not null, null, it is translated about the resulting screen position and returned.
storage
)

Overrides jogamp.newt.WindowImpl.getLocationOnScreen.

Implements com.jogamp.nativewindow.NativeWindow.getLocationOnScreen.

Returns the window's top-left client-area position in the screen.
protected Point
getLocationOnScreenImpl(final int x, final int y)

Implements abstract jogamp.newt.WindowImpl.getLocationOnScreenImpl.

Translates the given window client-area coordinates with top-left origin to screen coordinates in window units.
protected final int
getSupportedReconfigMaskImpl()

Implements abstract jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Returns the reconfigure state-mask supported by the implementation.
public long
getSurfaceHandle()

Overrides jogamp.newt.WindowImpl.getSurfaceHandle.

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Returns the handle to the surface for this NativeSurface.
protected boolean
reconfigureWindowImpl(final int
client-area position in window units, or <0 if unchanged
x
,
final int
client-area position in window units, or <0 if unchanged
y
,
final int
client-area size in window units, or <=0 if unchanged
width
,
final int
client-area size in window units, or <=0 if unchanged
height
,
final int
bitfield of change and status flags
flags
)

Implements abstract jogamp.newt.WindowImpl.reconfigureWindowImpl.

The native implementation should invoke the referenced java state callbacks to notify this Java object of state changes.
protected void
requestFocusImpl(final boolean
if true, bypass focusChanged(boolean, boolean) and force focus request
reparented
)

Implements abstract jogamp.newt.WindowImpl.requestFocusImpl.

Async request which shall be performed within TIMEOUT_NATIVEWINDOW.
public boolean
setFullscreen(final boolean
enable or disable fullscreen mode
fullscreen
)

Overrides jogamp.newt.WindowImpl.setFullscreen.

Implements com.jogamp.newt.Window.setFullscreen.

Enable or disable fullscreen mode for this window.
public boolean
setFullscreen(final List<MonitorDevice>
if null fullscreen will be spanned across all MonitorDevices, otherwise across the given list of MonitorDevice.
monitors
)

Overrides jogamp.newt.WindowImpl.setFullscreen.

Implements com.jogamp.newt.Window.setFullscreen.

Enable fullscreen mode for this window spanning across the given MonitorDevices or across all MonitorDevices.
public void
setPosition(final int
coord of the client-area's top left corner in window units
x
,
final int
coord of the client-area's top left corner in window units
y
)

Overrides jogamp.newt.WindowImpl.setPosition.

Implements com.jogamp.newt.Window.setPosition.

Sets the location of the window's client area excluding insets (window decorations) in window units.
public void
setSurfaceHandle(final long handle)

Implements com.jogamp.nativewindow.MutableSurface.setSurfaceHandle.

Sets the surface handle which is created outside of this implementation.
Inherited from jogamp.newt.WindowImpl:
addChildaddGestureHandleraddGestureHandleraddGestureListeneraddGestureListeneraddKeyListeneraddKeyListeneraddMouseListeneraddMouseListeneraddSurfaceUpdatedListeneraddSurfaceUpdatedListeneraddWindowListeneraddWindowListenerappendStateBitsareDefaultGesturesEnabledautoPositioncanCreateNativeImplconfinePointerconfinePointerImplconsumeEventconsumeKeyEventconsumePointerEventconsumeWindowEventconvertToPixelUnitsconvertToPixelUnitsconvertToWindowUnitsconvertToWindowUnitscreatecreatedefinePositiondefineSizedestroydoMouseEventdoMouseEventdoPointerEventdoPointerEventenqueueEventenqueueKeyEventenqueueMouseEventenqueueWindowEventfocusChangedfocusVisibleChangedgetBoundsgetChosenCapabilitiesgetCurrentSurfaceScalegetDefaultCloseOperationgetDelegatedWindowgetDisplayHandlegetGraphicsConfigurationgetHeightgetInsetsgetKeyListenergetKeyListenersgetLifecycleHookgetLockgetMainMonitorgetMaximumSurfaceScalegetMinimumSurfaceScalegetMouseListenergetMouseListenersgetNativeSurfacegetParentgetParentWindowHandlegetPixelScaleXgetPixelScaleYgetPixelsPerMMgetPointerIcongetReconfigStateMaskStringgetReconfigureMaskgetRequestedCapabilitiesgetRequestedSurfaceScalegetScreengetScreenIndexgetStateMaskgetStateMaskStringgetStatePublicBitCountgetStatePublicBitmaskgetSupportedStateMaskgetSupportedStateMaskStringgetSurfaceHeightgetSurfaceLockOwnergetSurfaceWidthgetThreadNamegetTitlegetWidthgetWindowHandlegetWindowListenergetWindowListenersgetWrappedSurfacegetXgetYhasDeviceChangedhasFocusinsetsChangedinsetsVisibleChangedinstantiationFinishedImplisAlwaysOnBottomisAlwaysOnTopisChildWindowisFullscreenisKeyboardVisibleisKeyCodeTrackedisKeyPressedisMaximizedHorzisMaximizedVertisNativeValidisOffscreenInstanceisPointerConfinedisPointerVisibleisReconfigureMaskSupportedisResizableisStickyisSurfaceLockedByOtherThreadisUndecoratedisVisiblekeyboardVisibilityChangedlockSurfacelockSurfaceImplmaximizedChangedmonitorModeChangedpixelScaleChangeNotifypositionChangedreconfigMaximizedManualremoveChildremoveGestureHandlerremoveGestureListenerremoveKeyListenerremoveMouseListenerremoveSurfaceUpdatedListenerremoveWindowListenerreparentWindowrequestFocusrequestFocusresetMaximizedManualresetStateMaskrunOnEDTIfAvailsendKeyEventsendMouseEventsendMouseEventRequestFocussendWindowEventsetAlwaysOnBottomsetAlwaysOnTopsetBrokenFocusChangesetCapabilitiesChoosersetDefaultCloseOperationsetDefaultGesturesEnabledsetFocusActionsetGraphicsConfigurationsetKeyboardFocusHandlersetKeyboardVisiblesetKeyboardVisibleImplsetKeyPressedsetLifecycleHooksetMaximizedsetPointerIconsetPointerIconImplsetPointerVisiblesetPointerVisibleImplsetResizablesetScreensetSizesetStickysetSurfaceScalesetSurfaceSizesetTitlesetTitleImplsetTopLevelPositionsetTopLevelSizesetUndecoratedsetVisiblesetVisiblesetVisibleActionImplsetVisibleImplsetWindowDestroyNotifyActionsetWindowHandleshutdownAllsizeChangedsizePosInsetsFocusVisibleChangedsizePosMaxInsetsVisibleChangedsurfaceSwapsurfaceUpdatedtoHexStringtoHexStringtoStringunlockSurfaceunlockSurfaceImplvisibleChangedvisibleChangedSendMouseEventvisibleChangedWindowRepaintwarpPointerwarpPointerImplwindowDestroyNotifywindowRepaintwindowRepaint

Field Detail

nextWindowHandleback to summary
pack-priv static long nextWindowHandle
surfaceHandleback to summary
pack-priv long surfaceHandle

Constructor Detail

OffscreenWindowback to summary
public OffscreenWindow()

Method Detail

closeNativeImplback to summary
protected void closeNativeImpl()

Implements abstract jogamp.newt.WindowImpl.closeNativeImpl.

Annotations
@Override
createNativeImplback to summary
protected void createNativeImpl()

Implements abstract jogamp.newt.WindowImpl.createNativeImpl.

Doc from jogamp.newt.WindowImpl.createNativeImpl.

The native implementation must set the native windowHandle.

The implementation shall respect the states isAlwaysOnTop()/FLAG_IS_ALWAYSONTOP and isUndecorated()/FLAG_IS_UNDECORATED, ie. the created window shall reflect those settings.

The implementation should invoke the referenced java state callbacks to notify this Java object of state changes.

Annotations
@Override
destroyback to summary
public synchronized void destroy()

Overrides jogamp.newt.WindowImpl.destroy.

Implements com.jogamp.newt.Window.destroy.

Doc from com.jogamp.newt.Window.destroy.

Destroys this window incl. releasing all related resources.

Also iterates through this window's children and destroys them.

Visibility is set to false.

Method sends out pre- and post- destruction events to all of it's WindowListener.

This method invokes Screen#removeReference() after it's own destruction,
which will issue Screen#destroy() if the reference count becomes 0.
This destruction sequence shall end up in Display#destroy(), if all reference counts become 0.

The Window can be recreate via setVisible(true).

This method is lifecycle heavy.

Annotations
@Override
getLocationOnScreenback to summary
public Point getLocationOnScreen(final Point storage)

Overrides jogamp.newt.WindowImpl.getLocationOnScreen.

Implements com.jogamp.nativewindow.NativeWindow.getLocationOnScreen.

Doc from com.jogamp.nativewindow.NativeWindow.getLocationOnScreen.

Returns the window's top-left client-area position in the screen.

If Point is not null, it is translated about the resulting screen position and returned.

See Coordinate System.

Since the position reflects the client area, it does not include the insets.

Parameters
storage:Point

Optional Point storage. If not null, null, it is translated about the resulting screen position and returned.

Annotations
@Override
getLocationOnScreenImplback to summary
protected Point getLocationOnScreenImpl(final int x, final int y)

Implements abstract jogamp.newt.WindowImpl.getLocationOnScreenImpl.

Doc from jogamp.newt.WindowImpl.getLocationOnScreenImpl.

Translates the given window client-area coordinates with top-left origin to screen coordinates in window units.

Since the position reflects the client area, it does not include the insets.

May return null, in which case the caller shall traverse through the NativeWindow tree as demonstrated in getLocationOnScreen(com.jogamp.nativewindow.util.Point).

Returns:Point

if not null, the screen location of the given coordinates

Annotations
@Override
getSupportedReconfigMaskImplback to summary
protected final int getSupportedReconfigMaskImpl()

Implements abstract jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Doc from jogamp.newt.WindowImpl.getSupportedReconfigMaskImpl.

Returns the reconfigure state-mask supported by the implementation.

Default value is STATE_MASK_VISIBLE | STATE_MASK_FOCUSED, i.e. the minimum requirement for all implementations.

Annotations
@Override
getSurfaceHandleback to summary
public long getSurfaceHandle()

Overrides jogamp.newt.WindowImpl.getSurfaceHandle.

Implements com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Doc from com.jogamp.nativewindow.NativeSurface.getSurfaceHandle.

Returns the handle to the surface for this NativeSurface.

The surface handle should be set/update by lockSurface(), where unlockSurface() is not allowed to modify it. After unlockSurface() it is no more guaranteed that the surface handle is still valid. The surface handle shall reflect the platform one for all drawable surface operations, e.g. opengl, swap-buffer.

On X11 this returns an entity of type Window, since there is no differentiation of surface and window there.
On Microsoft Windows this returns an entity of type HDC.

Annotations
@Override
reconfigureWindowImplback to summary
protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags)

Implements abstract jogamp.newt.WindowImpl.reconfigureWindowImpl.

Doc from jogamp.newt.WindowImpl.reconfigureWindowImpl.

The native implementation should invoke the referenced java state callbacks to notify this Java object of state changes.

Implementations shall set x/y to 0, in case it's negative. This could happen due to insets and positioning a decorated window to 0/0, which would place the frame outside of the screen.

Parameters
x:int

client-area position in window units, or <0 if unchanged

y:int

client-area position in window units, or <0 if unchanged

width:int

client-area size in window units, or <=0 if unchanged

height:int

client-area size in window units, or <=0 if unchanged

flags:int

bitfield of change and status flags

Annotations
@Override
requestFocusImplback to summary
protected void requestFocusImpl(final boolean reparented)

Implements abstract jogamp.newt.WindowImpl.requestFocusImpl.

Doc from jogamp.newt.WindowImpl.requestFocusImpl.

Async request which shall be performed within TIMEOUT_NATIVEWINDOW.

If if force == false the native implementation may only request focus if not yet owner.

focusChanged(boolean, boolean) should be called to notify about the focus traversal.

Parameters
reparented:boolean

if true, bypass focusChanged(boolean, boolean) and force focus request

Annotations
@Override
setFullscreenback to summary
public boolean setFullscreen(final boolean fullscreen)

Overrides jogamp.newt.WindowImpl.setFullscreen.

Implements com.jogamp.newt.Window.setFullscreen.

Doc from com.jogamp.newt.Window.setFullscreen.

Enable or disable fullscreen mode for this window.

Fullscreen mode is established on the main monitor.

This method is lifecycle heavy.

Parameters
fullscreen:boolean

enable or disable fullscreen mode

Returns:boolean

success

Annotations
@Override
setFullscreenback to summary
public boolean setFullscreen(final List<MonitorDevice> monitors)

Overrides jogamp.newt.WindowImpl.setFullscreen.

Implements com.jogamp.newt.Window.setFullscreen.

Doc from com.jogamp.newt.Window.setFullscreen.

Enable fullscreen mode for this window spanning across the given MonitorDevices or across all MonitorDevices.

Disable fullscreen via setFullscreen(boolean).

This method is lifecycle heavy.

Parameters
monitors:List<MonitorDevice>

if null fullscreen will be spanned across all MonitorDevices, otherwise across the given list of MonitorDevice.

Returns:boolean

success

Annotations
@Override
setPositionback to summary
public void setPosition(final int x, final int y)

Overrides jogamp.newt.WindowImpl.setPosition.

Implements com.jogamp.newt.Window.setPosition.

Doc from com.jogamp.newt.Window.setPosition.

Sets the location of the window's client area excluding insets (window decorations) in window units.
This call is ignored if in fullscreen mode.

Parameters
x:int

coord of the client-area's top left corner in window units

y:int

coord of the client-area's top left corner in window units

Annotations
@Override
setSurfaceHandleback to summary
public void setSurfaceHandle(final long handle)

Implements com.jogamp.nativewindow.MutableSurface.setSurfaceHandle.

Doc from com.jogamp.nativewindow.MutableSurface.setSurfaceHandle.

Sets the surface handle which is created outside of this implementation.

Annotations
@Override