All values of this interface are represented in pixel units, if not stated otherwise.
See NativeWindow.
A NativeSurface created for a particular on- or offscreen component is expected to have the same lifetime as that component. As long as the component is alive and realized/visible, NativeSurface must be able provide information such as the surface handle while it is locked.
| Modifier and Type | Field and Description |
|---|---|
| public static final int | LOCK_SUCCESS
Returned by |
| public static final int | LOCK_SURFACE_CHANGED
Returned by |
| public static final int | LOCK_SURFACE_NOT_READY
Returned by |
| public static final int | LOCK_SURFACE_UNLOCKED
Unlocked state, . |
| Modifier and Type | Method and Description |
|---|---|
| public void | addSurfaceUpdatedListener(SurfaceUpdatedListener l)
Appends the given |
| public void | addSurfaceUpdatedListener(int
Position where the listener will be inserted.
Should be within (0 <= index && index <= size()).
An index value of -1 is interpreted as the end of the list, size(). index, SurfaceUpdatedListener The listener object to be inserted l)Inserts the given |
| public int[] | Returns: result int[2] storage windowUnitsAndResult for chaining holding the converted valuesint[2] storage holding the window units for the x- and y-coord to convert
and the resulting values. windowUnitsAndResult)Converts the given window units into pixel units in place. |
| public int[] | Returns: result int[2] storage pixelUnitsAndResult for chaining holding the converted valuesint[2] storage holding the pixel units for the x- and y-coord to convert
and the resulting values. pixelUnitsAndResult)Converts the given pixel units into window units in place. |
| public long | |
| public AbstractGraphicsConfiguration | |
| public int | |
| public long | |
| public int | Returns: height of the client area in pixel unitsReturns the height of the client area excluding insets (window decorations) in pixel units. |
| public Thread | |
| public int | Returns: width of the client area in pixel unitsReturns the width of the client area excluding insets (window decorations) in pixel units. |
| public boolean | isSurfaceLockedByOtherThread()
Query if surface is locked by another thread, i.e. not the current one. |
| public int | |
| public void | removeSurfaceUpdatedListener(SurfaceUpdatedListener l)
Remove the specified |
| public boolean | Returns: true if this method completed swapping the surface, otherwise false, in which case eg the GLDrawable implementation has to swap the code.Provide a mechanism to utilize custom (pre-) swap surface code. |
| public void | unlockSurface()
Unlock the surface of this native window
Shall not modify the surface handle, see
The implementation shall also invoke |
| LOCK_SUCCESS | back to summary |
|---|---|
| public static final int LOCK_SUCCESS Returned by | |
| LOCK_SURFACE_CHANGED | back to summary |
|---|---|
| public static final int LOCK_SURFACE_CHANGED Returned by | |
| LOCK_SURFACE_NOT_READY | back to summary |
|---|---|
| public static final int LOCK_SURFACE_NOT_READY Returned by | |
| LOCK_SURFACE_UNLOCKED | back to summary |
|---|---|
| public static final int LOCK_SURFACE_UNLOCKED Unlocked state, . | |
| addSurfaceUpdatedListener | back to summary |
|---|---|
| public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) Appends the given | |
| addSurfaceUpdatedListener | back to summary |
|---|---|
| public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException Inserts the given
| |
| convertToPixelUnits | back to summary |
|---|---|
| public int[] convertToPixelUnits(final int[] windowUnitsAndResult) Converts the given window units into pixel units in place.
| |
| convertToWindowUnits | back to summary |
|---|---|
| public int[] convertToWindowUnits(final int[] pixelUnitsAndResult) Converts the given pixel units into window units in place.
| |
| getDisplayHandle | back to summary |
|---|---|
| public long getDisplayHandle() Convenience: Get display handle from AbstractGraphicsConfiguration . AbstractGraphicsScreen . AbstractGraphicsDevice | |
| getGraphicsConfiguration | back to summary |
|---|---|
| public AbstractGraphicsConfiguration getGraphicsConfiguration() Returns the graphics configuration corresponding to this window.
In case the implementation utilizes a delegation pattern to wrap abstract toolkits,
this method shall return the native | |
| getScreenIndex | back to summary |
|---|---|
| public int getScreenIndex() Convenience: Get display handle from AbstractGraphicsConfiguration . AbstractGraphicsScreen | |
| getSurfaceHandle | back to summary |
|---|---|
| public long getSurfaceHandle() Returns the handle to the surface for this NativeSurface.
The surface handle should be set/update by
On X11 this returns an entity of type Window,
since there is no differentiation of surface and window there. | |
| getSurfaceHeight | back to summary |
|---|---|
| public int getSurfaceHeight() Returns the height of the client area excluding insets (window decorations) in pixel units.
| |
| getSurfaceLockOwner | back to summary |
|---|---|
| public Thread getSurfaceLockOwner() Return the locking owner's Thread, or null if not locked. | |
| getSurfaceWidth | back to summary |
|---|---|
| public int getSurfaceWidth() Returns the width of the client area excluding insets (window decorations) in pixel units.
| |
| isSurfaceLockedByOtherThread | back to summary |
|---|---|
| public boolean isSurfaceLockedByOtherThread() Query if surface is locked by another thread, i.e. not the current one.
final Thread o = getSurfaceLockOwner();
if( null != o && Thread.currentThread() != o ) { .. }
| |
| lockSurface | back to summary |
|---|---|
| public int lockSurface() throws NativeWindowException, RuntimeException Lock the surface of this native window.
The surface handle shall be valid after a successfull call,
ie return a value other than boolean ok = LOCK_SURFACE_NOT_READY < lockSurface();
The caller may need to take care of the result This call is blocking until the surface has been locked or a timeout is reached. The latter will throw a runtime exception. This call allows recursion from the same thread.
The implementation may want to aquire the
application level
The implementation shall also invoke
| |
| removeSurfaceUpdatedListener | back to summary |
|---|---|
| public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) Remove the specified | |
| surfaceSwap | back to summary |
|---|---|
| public boolean surfaceSwap() Provide a mechanism to utilize custom (pre-) swap surface code. This method is called before the render toolkit (e.g. JOGL) swaps the buffer/surface if double buffering is enabled. The implementation may itself apply the swapping, in which case true shall be returned.
| |
| unlockSurface | back to summary |
|---|---|
| public void unlockSurface() Unlock the surface of this native window
Shall not modify the surface handle, see
The implementation shall also invoke The implementation shall be fail safe, i.e. tolerant in case the native resources are already released / unlocked. In this case the implementation shall simply ignore the call. | |