|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NativeWindow
Provides the low-level information required for
hardware-accelerated rendering in a platform-independent manner. A
window toolkit such as the AWT may either implement this interface
directly with one of its components, or provide and register an
implementation of NativeWindowFactory
which can create NativeWindow objects for its components.
A NativeWindow created for a particular on-screen component is expected to have the same lifetime as that component. As long as the component is alive, the NativeWindow must be able to control it, and any time it is visible and locked, provide information such as the window handle.
Field Summary | |
---|---|
static int |
LOCK_SUCCESS
Returned by lockSurface() if the surface is locked, and is unchanged. |
static int |
LOCK_SURFACE_CHANGED
Returned by lockSurface() if the surface is locked, but has changed. |
static int |
LOCK_SURFACE_NOT_READY
Returned by lockSurface() if the surface is not ready to be locked. |
Method Summary | |
---|---|
void |
destroy()
destroys the window and releases windowing related resources. |
long |
getDisplayHandle()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
AbstractGraphicsConfiguration |
getGraphicsConfiguration()
Returns the graphics configuration corresponding to this window. |
int |
getHeight()
Returns the current height of this window. |
Exception |
getLockedStack()
Return the lock-exception, or null if not locked. |
int |
getScreenIndex()
Convenience: Get display handle from AbstractGraphicsConfiguration . |
long |
getSurfaceHandle()
Returns the handle to the surface for this NativeWindow. |
int |
getWidth()
Returns the current width of this window. |
long |
getWindowHandle()
Returns the window handle for this NativeWindow. |
void |
invalidate()
render all native window information invalid, as if the native window was destroyed |
boolean |
isSurfaceLocked()
Return if surface is locked |
int |
lockSurface()
Lock the surface of this native window |
boolean |
surfaceSwap()
Provide a mechanism to utilize custom (pre-) swap surface code. |
void |
surfaceUpdated()
Method invoked after the render toolkit (e.g. |
void |
unlockSurface()
Unlock the surface of this native window Shall not modify the window handle, see getWindowHandle() ,
or the surface handle, see lockSurface() |
Field Detail |
---|
static final int LOCK_SURFACE_NOT_READY
lockSurface()
if the surface is not ready to be locked.
static final int LOCK_SURFACE_CHANGED
lockSurface()
if the surface is locked, but has changed.
static final int LOCK_SUCCESS
lockSurface()
if the surface is locked, and is unchanged.
Method Detail |
---|
int lockSurface() throws NativeWindowException
The window handle, see getWindowHandle()
,
and the surface handle, see lockSurface()
,
shall be set and be valid after a successfull call,
ie a return value other than LOCK_SURFACE_NOT_READY
.
The semantics of the underlying native locked resource
may be related to the ToolkitLock
one. Hence it is
important that implementation of both harmonize well.
The implementation may want to aquire the ToolkitLock
first to become it's owner before proceeding with it's
actual surface lock.
LOCK_SUCCESS
, LOCK_SURFACE_CHANGED
or LOCK_SURFACE_NOT_READY
.
NativeWindowException
- if surface is already lockedToolkitLock
void unlockSurface() throws NativeWindowException
getWindowHandle()
,
or the surface handle, see lockSurface()
NativeWindowException
- if surface is not lockedlockSurface()
,
ToolkitLock
boolean isSurfaceLocked()
Exception getLockedStack()
lockSurface()
and hence holds the locker's call stack.
boolean surfaceSwap()
void surfaceUpdated()
void invalidate()
destroy()
void destroy()
long getWindowHandle()
The window handle should be set/update by lockSurface()
,
where unlockSurface()
is not allowed to modify it.
After unlockSurface()
it is no more guaranteed
that the window handle is still valid.
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.
long getSurfaceHandle()
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.
int getWidth()
int getHeight()
AbstractGraphicsConfiguration getGraphicsConfiguration()
GraphicsConfigurationFactory.chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
long getDisplayHandle()
int getScreenIndex()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |