Canvas containing a NEWT Window using native parenting.
Implementation allows use of custom GLCapabilities.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private volatile Rectangle | |
| private static final boolean | |
| private volatile NewtCanvasSWT. | |
| private volatile Window | |
| private WindowClosingProtocol. | |
| private volatile boolean | |
| private volatile boolean | |
| private volatile boolean | |
| private final AbstractGraphicsScreen |
| Access | Constructor and Description |
|---|---|
| public | NewtCanvasSWT(final Composite
the SWT composite parent, final int additional styles to SWT#NO_BACKGROUND style, final Window optional preassigned child)Window, maybe nullInstantiates a NewtCanvas with a NEWT child. |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| public static NewtCanvasSWT | Returns: a new instancethe SWT composite parent, final int additional styles to SWT#NO_BACKGROUND style, final Window optional preassigned child)Window, maybe nullCreates an instance using |
| public void | dispose()
Overrides org.
|
| public boolean | forceFocus()
Overrides org. |
| public WindowClosingProtocol. | |
| public NativeWindow | Returns: this SWT Canvas NativeWindow representation, may be null in case it has not been realized.
|
| public Window | |
| private Point | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv static String | |
| pack-priv void | |
| private final void | |
| public void | setBounds(final int
the new x coordinate for the receiver x, final int the new y coordinate for the receiver y, final int the new width for the receiver width, final int the new height for the receiver height)Overrides org. |
| public WindowClosingProtocol. | setDefaultCloseOperation(final WindowClosingProtocol.
the new close operation value opImplements com. |
| public Window | Returns: the previous attached newt child.Sets a new NEWT child, provoking reparenting. |
| public boolean | setParent(final Composite
the new parent for the control. parent)Overrides org. |
| pack-priv static String | |
| public void | update()
Overrides org. |
| protected final void | |
| protected final void | updatePosSizeCheck(final int newX, final int newY, final int newWidth, final int newHeight, final boolean updatePos)
|
| protected final void | |
| protected final boolean |
| clientArea | back to summary |
|---|---|
| private volatile Rectangle clientArea | |
| DEBUG | back to summary |
|---|---|
| private static final boolean DEBUG | |
| nativeWindow | back to summary |
|---|---|
| private volatile NewtCanvasSWT. | |
| newtChild | back to summary |
|---|---|
| private volatile Window newtChild | |
| newtChildCloseOp | back to summary |
|---|---|
| private WindowClosingProtocol. | |
| newtChildReady | back to summary |
|---|---|
| private volatile boolean newtChildReady | |
| postSetPos | back to summary |
|---|---|
| private volatile boolean postSetPos | |
| postSetSize | back to summary |
|---|---|
| private volatile boolean postSetSize | |
| screen | back to summary |
|---|---|
| private final AbstractGraphicsScreen screen | |
| NewtCanvasSWT | back to summary |
|---|---|
| public NewtCanvasSWT(final Composite parent, final int style, final Window child) Instantiates a NewtCanvas with a NEWT child. Note The NEWT child | |
| configureNewtChild | back to summary |
|---|---|
| pack-priv void configureNewtChild(final boolean attach) | |
| create | back to summary |
|---|---|
| public static NewtCanvasSWT create(final Composite parent, final int style, final Window child) Creates an instance using Note The NEWT child
| |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides org. Destroys this resource:
| |
| forceFocus | back to summary |
|---|---|
| public boolean forceFocus() Overrides org. Doc from org. Forces the receiver to have the keyboard focus, causing all keyboard events to be delivered to it.
| |
| getDefaultCloseOperation | back to summary |
|---|---|
| public WindowClosingProtocol. Implements com.
| |
| getNativeWindow | back to summary |
|---|---|
public NativeWindow getNativeWindow()
| |
| getNEWTChild | back to summary |
|---|---|
public Window getNEWTChild()
| |
| getParentLocationOnScreen | back to summary |
|---|---|
| private Point getParentLocationOnScreen() | |
| isFullscreen | back to summary |
|---|---|
| pack-priv boolean isFullscreen() | |
| isParent | back to summary |
|---|---|
| pack-priv boolean isParent() | |
| newtWinHandleToHexString | back to summary |
|---|---|
| pack-priv static String newtWinHandleToHexString(final Window w) | |
| reparentWindow | back to summary |
|---|---|
| pack-priv void reparentWindow(final boolean add) | |
| requestFocusNEWTChild | back to summary |
|---|---|
| private final void requestFocusNEWTChild() | |
| setBounds | back to summary |
|---|---|
| public void setBounds(final int x, final int y, final int width, final int height) Overrides org. Doc from org. Sets the receiver's size and location in points to the rectangular
area specified by the arguments. The Note Attempting to set the width or height of the receiver to a negative number will cause that value to be set to zero instead. Note On GTK, attempting to set the width or height of the receiver to a number higher or equal 2^14 will cause them to be set to (2^14)-1 instead.
| |
| setDefaultCloseOperation | back to summary |
|---|---|
| public WindowClosingProtocol. Implements com.
| |
| setNEWTChild | back to summary |
|---|---|
| public Window setNEWTChild(final Window newChild) Sets a new NEWT child, provoking reparenting.
A previously detached Note When switching NEWT child's, detaching the previous first via Note The NEWT child
| |
| setParent | back to summary |
|---|---|
| public boolean setParent(final Composite parent) Overrides org. Doc from org. Changes the parent of the widget to be the one provided.
Returns | |
| toHexString | back to summary |
|---|---|
| pack-priv static String toHexString(final long l) | |
| update | back to summary |
|---|---|
| public void update() Overrides org. Doc from org. Forces all outstanding paint requests for the widget to be processed before this method returns. If there are no outstanding paint request, this method does nothing. Note:
| |
| updatePosSizeCheck | back to summary |
|---|---|
| protected final void updatePosSizeCheck() | |
| updatePosSizeCheck | back to summary |
|---|---|
| protected final void updatePosSizeCheck(final int newX, final int newY, final int newWidth, final int newHeight, final boolean updatePos) | |
| updateSizeCheck | back to summary |
|---|---|
| protected final void updateSizeCheck() | |
| validateNative | back to summary |
|---|---|
| protected final boolean validateNative() assumes nativeWindow == null ! | |
| Modifier and Type | Field and Description |
|---|---|
| private final AbstractGraphicsConfiguration | |
| private final InsetsImmutable | |
| private final long |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addSurfaceUpdatedListener(final SurfaceUpdatedListener l)
Implements com. SurfaceUpdatedListener to the end of the list.
|
| public void | addSurfaceUpdatedListener(final 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, final SurfaceUpdatedListener The listener object to be inserted l)Implements com. SurfaceUpdatedListener at the
specified position in the list.
|
| public final int[] | convertToPixelUnits(final int[]
int[2] storage holding the window units for the x- and y-coord to convert
and the resulting values. windowUnitsAndResult)Implements com. |
| public final int[] | convertToWindowUnits(final int[]
int[2] storage holding the pixel units for the x- and y-coord to convert
and the resulting values. pixelUnitsAndResult)Implements com. |
| public void | |
| public long | getDisplayHandle()
Implements com. |
| public AbstractGraphicsConfiguration | getGraphicsConfiguration()
Implements com. |
| public int | getHeight()
Implements com. |
| public InsetsImmutable | getInsets()
Implements com. |
| public Point | getLocationOnScreen(final Point
Optional point)Point storage.
If not null, null, it is translated about the resulting screen position
and returned.Implements com. |
| public final NativeSurface | getNativeSurface()
Implements com. NativeSurface of this NativeSurfaceHolder.
|
| public NativeWindow | |
| public int | getScreenIndex()
Implements com. |
| public long | getSurfaceHandle()
Implements com. |
| public int | getSurfaceHeight()
Implements com. |
| public Thread | getSurfaceLockOwner()
Implements com. |
| public int | getSurfaceWidth()
Implements com. |
| public int | getWidth()
Implements com. |
| public long | getWindowHandle()
Implements com. |
| public int | getX()
Implements com. |
| public int | getY()
Implements com. |
| public boolean | hasFocus()
Implements com. |
| public boolean | isSurfaceLockedByOtherThread()
Implements com. |
| public int | lockSurface()
Implements com. |
| public void | removeSurfaceUpdatedListener(final SurfaceUpdatedListener l)
Implements com. SurfaceUpdatedListener from the list.
|
| public boolean | surfaceSwap()
Implements com. |
| public void | surfaceUpdated(final Object
is the caller object who updated the surface,
e.g. a JOGL GLDrawable. updater, final NativeSurface the updated NativeSurface ns, final long the time in ms, when the surface was updated when)Implements com. |
| public void | unlockSurface()
Implements com. lockSurface()
The implementation shall also invoke |
| config | back to summary |
|---|---|
| private final AbstractGraphicsConfiguration config | |
| insets | back to summary |
|---|---|
| private final InsetsImmutable insets | |
| nativeWindowHandle | back to summary |
|---|---|
| private final long nativeWindowHandle | |
| SWTNativeWindow | back to summary |
|---|---|
| public SWTNativeWindow(final AbstractGraphicsConfiguration config, final long nativeWindowHandle) | |
| addSurfaceUpdatedListener | back to summary |
|---|---|
| public void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) Implements com. Doc from com. Appends the given
| |
| addSurfaceUpdatedListener | back to summary |
|---|---|
| public void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException Implements com. Doc from com. Inserts the given
| |
| convertToPixelUnits | back to summary |
|---|---|
| public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) Implements com. Doc from com. Converts the given window units into pixel units in place.
| |
| convertToWindowUnits | back to summary |
|---|---|
| public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) Implements com. Doc from com. Converts the given pixel units into window units in place.
| |
| destroy | back to summary |
|---|---|
| public void destroy() Implements com. Doc from com. Destroys this window incl. releasing all related resources.
| |
| getDisplayHandle | back to summary |
|---|---|
| public long getDisplayHandle() Implements com. Doc from com. Convenience: Get display handle from AbstractGraphicsConfiguration . AbstractGraphicsScreen . AbstractGraphicsDevice
| |
| getGraphicsConfiguration | back to summary |
|---|---|
| public AbstractGraphicsConfiguration getGraphicsConfiguration() Implements com. Doc from com. 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
| |
| getHeight | back to summary |
|---|---|
| public int getHeight() Implements com. Doc from com. Returns the height of the client area excluding insets (window decorations) in window units.
| |
| getInsets | back to summary |
|---|---|
| public InsetsImmutable getInsets() Implements com. Doc from com. 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 size is
| |
| getLocationOnScreen | back to summary |
|---|---|
| public Point getLocationOnScreen(final Point point) Implements com. Doc from com. Returns the window's top-left client-area position in the screen.
If See Coordinate System. Since the position reflects the client area, it does not include the insets. | |
| getNativeSurface | back to summary |
|---|---|
| public final NativeSurface getNativeSurface() Implements com. Doc from com. Returns the associated
Returns this instance, which is-a
| |
| getParent | back to summary |
|---|---|
| public NativeWindow getParent() Implements com.
| |
| getScreenIndex | back to summary |
|---|---|
| public int getScreenIndex() Implements com. Doc from com. Convenience: Get display handle from AbstractGraphicsConfiguration . AbstractGraphicsScreen
| |
| getSurfaceHandle | back to summary |
|---|---|
| public long getSurfaceHandle() Implements com. Doc from com. 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() Implements com. Doc from com. Returns the height of the client area excluding insets (window decorations) in pixel units.
| |
| getSurfaceLockOwner | back to summary |
|---|---|
| public Thread getSurfaceLockOwner() Implements com. Doc from com. Return the locking owner's Thread, or null if not locked.
| |
| getSurfaceWidth | back to summary |
|---|---|
| public int getSurfaceWidth() Implements com. Doc from com. Returns the width of the client area excluding insets (window decorations) in pixel units.
| |
| getWidth | back to summary |
|---|---|
| public int getWidth() Implements com. Doc from com. Returns the width of the client area excluding insets (window decorations) in window units.
| |
| getWindowHandle | back to summary |
|---|---|
| public long getWindowHandle() Implements com. Doc from com. 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.
| |
| getX | back to summary |
|---|---|
| public int getX() Implements com. Doc from com. 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.
| |
| getY | back to summary |
|---|---|
| public int getY() Implements com. Doc from com. 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.
| |
| hasFocus | back to summary |
|---|---|
| public boolean hasFocus() Implements com. Doc from com. Returns true if this native window owns the focus, otherwise false.
| |
| isSurfaceLockedByOtherThread | back to summary |
|---|---|
| public boolean isSurfaceLockedByOtherThread() Implements com. Doc from com. 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 Implements com. Doc from com. 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(final SurfaceUpdatedListener l) Implements com. Doc from com. Remove the specified
| |
| surfaceSwap | back to summary |
|---|---|
| public boolean surfaceSwap() Implements com. Doc from com. 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.
| |
| surfaceUpdated | back to summary |
|---|---|
| public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) Implements com. Doc from com. Notification of a surface update event, eg. after a swap buffer operation.
| |
| unlockSurface | back to summary |
|---|---|
| public void unlockSurface() Implements com. Doc from com. 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.
| |