Top Fields Constructors Methods
jogamp.nativewindow

public Class WrappedWindow

extends WrappedSurface
implements NativeWindow
Class Inheritance
All Implemented Interfaces
com.jogamp.nativewindow.NativeWindow, com.jogamp.nativewindow.NativeSurfaceHolder, com.jogamp.nativewindow.NativeSurface, com.jogamp.nativewindow.SurfaceUpdatedListener
Imports
com.jogamp.nativewindow.AbstractGraphicsConfiguration, .AbstractGraphicsDevice, .NativeSurface, .NativeWindow, .ProxySurface, .UpstreamSurfaceHook, .UpstreamWindowHookMutableSizePos, com.jogamp.nativewindow.util.Insets, .InsetsImmutable, .Point

Field Summary

Modifier and TypeField and Description
private final InsetsImmutable
private long

Constructor Summary

AccessConstructor and Description
public
WrappedWindow(final AbstractGraphicsConfiguration cfg, final long
the wrapped pre-existing native surface handle, maybe 0 if not yet determined
surfaceHandle
,
final int initialWinX, final int initialWinY, final int initialWinWidth, final int initialWinHeight, final int
FIXME: pixel-dim == window-dim 'for now' ?
initialPixelWidth
,
final int
FIXME: pixel-dim == window-dim 'for now' ?
initialPixelHeight
,
final boolean
true if this ProxySurface instance owns the AbstractGraphicsConfiguration's AbstractGraphicsDevice, otherwise false. Owning the device implies closing it at destroyNotify().
ownsDevice
,
final long windowHandle)

Utilizes a UpstreamWindowHookMutableSizePos to hold the size and position information, which is being passed to the ProxySurface instance.

public
WrappedWindow(final AbstractGraphicsConfiguration cfg, final long
the wrapped pre-existing native surface handle, maybe 0 if not yet determined
surfaceHandle
,
final UpstreamWindowHookMutableSizePos
the UpstreamSurfaceHook to be used
upstream
,
final boolean
true if this ProxySurface instance owns the AbstractGraphicsConfiguration's AbstractGraphicsDevice, otherwise false.
ownsDevice
,
final long windowHandle)

Method Summary

Modifier and TypeMethod and Description
public void
destroy()

Implements com.jogamp.nativewindow.NativeWindow.destroy.

Destroys this window incl.
public int
getHeight()

Implements com.jogamp.nativewindow.NativeWindow.getHeight.

Returns the height of the client area excluding insets (window decorations) in window units.
public InsetsImmutable
getInsets()

Implements com.jogamp.nativewindow.NativeWindow.getInsets.

Returns the insets defined as the width and height of the window decoration on the left, right, top and bottom in window units.
public Point
getLocationOnScreen(final Point
Optional Point storage. If not null, null, it is translated about the resulting screen position and returned.
point
)

Implements com.jogamp.nativewindow.NativeWindow.getLocationOnScreen.

Returns the window's top-left client-area position in the screen.
public final NativeSurface
public NativeWindow
public int
getWidth()

Implements com.jogamp.nativewindow.NativeWindow.getWidth.

Returns the width of the client area excluding insets (window decorations) in window units.
public long
getWindowHandle()

Implements com.jogamp.nativewindow.NativeWindow.getWindowHandle.

Returns the window handle for this NativeWindow.
public int
getX()

Implements com.jogamp.nativewindow.NativeWindow.getX.

Returns the x position of the top-left corner of the client area relative to it's parent in window units.
public int
getY()

Implements com.jogamp.nativewindow.NativeWindow.getY.

Returns the current y position of the top-left corner of the client area relative to it's parent in window units.
public boolean
hasFocus()

Implements com.jogamp.nativewindow.NativeWindow.hasFocus.

Returns true if this native window owns the focus, otherwise false.
protected void
invalidateImpl()

Overrides jogamp.nativewindow.WrappedSurface.invalidateImpl.

Must be overridden by implementations allowing having a UpstreamSurfaceHook being passed.
Inherited from jogamp.nativewindow.WrappedSurface:
convertToPixelUnitsconvertToWindowUnitsgetCurrentSurfaceScalegetMaximumSurfaceScalegetMinimumSurfaceScalegetRequestedSurfaceScalegetSurfaceHandlelockSurfaceImplsetSurfaceHandlesetSurfaceScaleunlockSurfaceImpl

Field Detail

insetsback to summary
private final InsetsImmutable insets
windowHandleback to summary
private long windowHandle

Constructor Detail

WrappedWindowback to summary
public WrappedWindow(final AbstractGraphicsConfiguration cfg, final long surfaceHandle, final int initialWinX, final int initialWinY, final int initialWinWidth, final int initialWinHeight, final int initialPixelWidth, final int initialPixelHeight, final boolean ownsDevice, final long windowHandle)

Utilizes a UpstreamWindowHookMutableSizePos to hold the size and position information, which is being passed to the ProxySurface instance.

Parameters
cfg:AbstractGraphicsConfiguration

the AbstractGraphicsConfiguration to be used

surfaceHandle:long

the wrapped pre-existing native surface handle, maybe 0 if not yet determined

initialPixelWidth:int

FIXME: pixel-dim == window-dim 'for now' ?

initialPixelHeight:int

FIXME: pixel-dim == window-dim 'for now' ?

ownsDevice:boolean

true if this ProxySurface instance owns the AbstractGraphicsConfiguration's AbstractGraphicsDevice, otherwise false. Owning the device implies closing it at destroyNotify().

WrappedWindowback to summary
public WrappedWindow(final AbstractGraphicsConfiguration cfg, final long surfaceHandle, final UpstreamWindowHookMutableSizePos upstream, final boolean ownsDevice, final long windowHandle)
Parameters
cfg:AbstractGraphicsConfiguration

the AbstractGraphicsConfiguration to be used

surfaceHandle:long

the wrapped pre-existing native surface handle, maybe 0 if not yet determined

upstream:UpstreamWindowHookMutableSizePos

the UpstreamSurfaceHook to be used

ownsDevice:boolean

true if this ProxySurface instance owns the AbstractGraphicsConfiguration's AbstractGraphicsDevice, otherwise false.

Method Detail

destroyback to summary
public void destroy()

Implements com.jogamp.nativewindow.NativeWindow.destroy.

Doc from com.jogamp.nativewindow.NativeWindow.destroy.

Destroys this window incl. releasing all related resources.

Annotations
@Override
getHeightback to summary
public int getHeight()

Implements com.jogamp.nativewindow.NativeWindow.getHeight.

Doc from com.jogamp.nativewindow.NativeWindow.getHeight.

Returns the height of the client area excluding insets (window decorations) in window units.

Returns:int

height of the client area in window units

Annotations
@Override
getInsetsback to summary
public InsetsImmutable getInsets()

Implements com.jogamp.nativewindow.NativeWindow.getInsets.

Doc from com.jogamp.nativewindow.NativeWindow.getInsets.

Returns the insets defined as the width and height of the window decoration on the left, right, top and bottom in window units.

Insets are zero if the window is undecorated, including child windows.

Insets are available only after the native window has been created, ie. the native window has been made visible.
The top-level window area's top-left corner is located at

  getX() - getInsets().getLeftWidth()
  getY() - getInsets().getTopHeight()
The top-level window size is
  getWidth()  + getInsets().getTotalWidth()
  getHeight() + getInsets().getTotalHeight()
Returns:InsetsImmutable

insets

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

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
point:Point

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

Annotations
@Override
getNativeSurfaceback to summary
public final NativeSurface getNativeSurface()

Implements com.jogamp.nativewindow.NativeWindow.getNativeSurface.

Doc from com.jogamp.nativewindow.NativeWindow.getNativeSurface.

Returns the associated NativeSurface of this NativeSurfaceHolder.

Returns this instance, which is-a NativeSurface.

Annotations
@Override
getParentback to summary
public NativeWindow getParent()

Implements com.jogamp.nativewindow.NativeWindow.getParent.

Returns:NativeWindow

Doc from com.jogamp.nativewindow.NativeWindow.getParent.

The parent NativeWindow, or null if this NativeWindow is top level.

Annotations
@Override
getWidthback to summary
public int getWidth()

Implements com.jogamp.nativewindow.NativeWindow.getWidth.

Doc from com.jogamp.nativewindow.NativeWindow.getWidth.

Returns the width of the client area excluding insets (window decorations) in window units.

Returns:int

width of the client area in window units

Annotations
@Override
getWindowHandleback to summary
public long getWindowHandle()

Implements com.jogamp.nativewindow.NativeWindow.getWindowHandle.

Doc from com.jogamp.nativewindow.NativeWindow.getWindowHandle.

Returns the window handle for this NativeWindow.

The window handle shall reflect the platform one for all window related operations, e.g. open, close, resize.

On X11 this returns an entity of type Window.
On Microsoft Windows this returns an entity of type HWND.

Annotations
@Override
getXback to summary
public int getX()

Implements com.jogamp.nativewindow.NativeWindow.getX.

Doc from com.jogamp.nativewindow.NativeWindow.getX.

Returns the x position of the top-left corner of the client area relative to it's parent in window units.

If no parent exist (top-level window), this coordinate equals the screen coordinate.

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

See Coordinate System.

Annotations
@Override
getYback to summary
public int getY()

Implements com.jogamp.nativewindow.NativeWindow.getY.

Doc from com.jogamp.nativewindow.NativeWindow.getY.

Returns the current y position of the top-left corner of the client area relative to it's parent in window units.

If no parent exist (top-level window), this coordinate equals the screen coordinate.

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

See Coordinate System.

Annotations
@Override
hasFocusback to summary
public boolean hasFocus()

Implements com.jogamp.nativewindow.NativeWindow.hasFocus.

Doc from com.jogamp.nativewindow.NativeWindow.hasFocus.

Returns true if this native window owns the focus, otherwise false.

Annotations
@Override
invalidateImplback to summary
protected void invalidateImpl()

Overrides jogamp.nativewindow.WrappedSurface.invalidateImpl.

Doc from jogamp.nativewindow.ProxySurfaceImpl.invalidateImpl.

Must be overridden by implementations allowing having a UpstreamSurfaceHook being passed.

Annotations
@Override