javax.media.nativewindow

## Interface ProxySurface

- All Superinterfaces:
    MutableSurface, NativeSurface, SurfaceUpdatedListener

      public interface ProxySurface
      extends MutableSurface

  Provides a mutable `NativeSurface`, i.e. `MutableSurface`, while allowing an `UpstreamSurfaceHook` to influence the lifecycle and information.
  See Also:
    `UpstreamSurfaceHook`, `MutableSurface`, `NativeSurface`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `DEBUG`
    `static int` | `OPT_PROXY_OWNS_UPSTREAM_DEVICE` Implementation specific bit-value stating this `ProxySurface` owns the upstream's `AbstractGraphicsDevice`.
    `static int` | `OPT_PROXY_OWNS_UPSTREAM_SURFACE` Implementation specific bit-value stating this `ProxySurface` owns the upstream's surface handle
    `static int` | `OPT_UPSTREAM_WINDOW_INVISIBLE` Implementation specific bitvalue stating the upstream's `NativeSurface` is an invisible window, i.e.

    - ### Fields inherited from interface javax.media.nativewindow.NativeSurface

      `LOCK_SUCCESS, LOCK_SURFACE_CHANGED, LOCK_SURFACE_NOT_READY, LOCK_SURFACE_UNLOCKED`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addUpstreamOptionBits(int v)` Add the given bit-mask to this instance upstream-option-bits using bit-or w/ `v`.
    `void` | `clearUpstreamOptionBits(int v)` Clear the given bit-mask from this instance upstream-option-bits using bit-and w/ `~v`
    `boolean` | `containsUpstreamOptionBits(int v)` Returns `true` if the give bit-mask `v` is set in this instance upstream-option-bits, otherwise `false`.
    `void` | `createNotify()` `UpstreamSurfaceHook.create(ProxySurface)` is being issued and the proxy surface/window handles shall be set.
    `void` | `destroyNotify()` `UpstreamSurfaceHook.destroy(ProxySurface)` is being issued and all proxy surface/window handles shall be cleared.
    `void` | `enableUpstreamSurfaceHookLifecycle(boolean enable)` Enables or disables the `UpstreamSurfaceHook` lifecycle functions `UpstreamSurfaceHook.create(ProxySurface)` and `UpstreamSurfaceHook.destroy(ProxySurface)`.
    `int` | `getUpstreamOptionBits()`
    `StringBuilder` | `getUpstreamOptionBits(StringBuilder sink)`
    `NativeSurface` | `getUpstreamSurface()` Returns the optional upstream `NativeSurface` if used by implementation, otherwise `null`.
    `UpstreamSurfaceHook` | `getUpstreamSurfaceHook()` Returns the `UpstreamSurfaceHook` if `set`, otherwise `null`.
    `void` | `setGraphicsConfiguration(AbstractGraphicsConfiguration cfg)` Allow redefining the AbstractGraphicsConfiguration
    `void` | `setUpstreamSurfaceHook(UpstreamSurfaceHook hook)` Overrides the `UpstreamSurfaceHook`.
    `String` | `toString()`
    `StringBuilder` | `toString(StringBuilder sink)`

    - ### Methods inherited from interface javax.media.nativewindow.MutableSurface

      `setSurfaceHandle`

    - ### Methods inherited from interface javax.media.nativewindow.NativeSurface

      `addSurfaceUpdatedListener, addSurfaceUpdatedListener, convertToPixelUnits, convertToWindowUnits, getDisplayHandle, getGraphicsConfiguration, getScreenIndex, getSurfaceHandle, getSurfaceHeight, getSurfaceLockOwner, getSurfaceWidth, isSurfaceLockedByOtherThread, lockSurface, removeSurfaceUpdatedListener, surfaceSwap, unlockSurface`

    - ### Methods inherited from interface javax.media.nativewindow.SurfaceUpdatedListener

      `surfaceUpdated`

- - ### Field Detail

    - #### DEBUG

          static final boolean DEBUG

    - #### OPT_PROXY_OWNS_UPSTREAM_SURFACE

          static final int OPT_PROXY_OWNS_UPSTREAM_SURFACE

      Implementation specific bit-value stating this `ProxySurface` owns the upstream's surface handle
      See Also:
        `addUpstreamOptionBits(int)`, `clearUpstreamOptionBits(int)`, `getUpstreamOptionBits()`, Constant Field Values

    - #### OPT_PROXY_OWNS_UPSTREAM_DEVICE

          static final int OPT_PROXY_OWNS_UPSTREAM_DEVICE

      Implementation specific bit-value stating this `ProxySurface` owns the upstream's `AbstractGraphicsDevice`.
      See Also:
        `addUpstreamOptionBits(int)`, `clearUpstreamOptionBits(int)`, `getUpstreamOptionBits()`, Constant Field Values

    - #### OPT_UPSTREAM_WINDOW_INVISIBLE

          static final int OPT_UPSTREAM_WINDOW_INVISIBLE

      Implementation specific bitvalue stating the upstream's `NativeSurface` is an invisible window, i.e. maybe incomplete.
      See Also:
        `addUpstreamOptionBits(int)`, `clearUpstreamOptionBits(int)`, `getUpstreamOptionBits()`, Constant Field Values

  - ### Method Detail

    - #### setGraphicsConfiguration

          void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg)

      Allow redefining the AbstractGraphicsConfiguration

    - #### getUpstreamSurface

          NativeSurface getUpstreamSurface()

      Returns the optional upstream `NativeSurface` if used by implementation, otherwise `null`.

      The upstream `NativeSurface` is retrieved via `the UpstreamSurfaceHook`, i.e. `UpstreamSurfaceHook.getUpstreamSurface()`.

      One example is the JOGL EGLWrappedSurface, which might be backed up by a native platform NativeSurface (X11, WGL, CGL, ..).

    - #### getUpstreamSurfaceHook

          UpstreamSurfaceHook getUpstreamSurfaceHook()

      Returns the `UpstreamSurfaceHook` if `set`, otherwise `null`.

    - #### setUpstreamSurfaceHook

          void setUpstreamSurfaceHook(UpstreamSurfaceHook hook)

      Overrides the `UpstreamSurfaceHook`.

    - #### enableUpstreamSurfaceHookLifecycle

          void enableUpstreamSurfaceHookLifecycle(boolean enable)

      Enables or disables the `UpstreamSurfaceHook` lifecycle functions `UpstreamSurfaceHook.create(ProxySurface)` and `UpstreamSurfaceHook.destroy(ProxySurface)`.

      Use this for small code blocks where the native resources shall not change, i.e. resizing a derived (OpenGL) drawable.

    - #### createNotify

          void createNotify()

      `UpstreamSurfaceHook.create(ProxySurface)` is being issued and the proxy surface/window handles shall be set.

    - #### destroyNotify

          void destroyNotify()

      `UpstreamSurfaceHook.destroy(ProxySurface)` is being issued and all proxy surface/window handles shall be cleared.

    - #### getUpstreamOptionBits

          StringBuilder getUpstreamOptionBits(StringBuilder sink)

    - #### getUpstreamOptionBits

          int getUpstreamOptionBits()

    - #### containsUpstreamOptionBits

          boolean containsUpstreamOptionBits(int v)

      Returns `true` if the give bit-mask `v` is set in this instance upstream-option-bits, otherwise `false`.

    - #### addUpstreamOptionBits

          void addUpstreamOptionBits(int v)

      Add the given bit-mask to this instance upstream-option-bits using bit-or w/ `v`.

    - #### clearUpstreamOptionBits

          void clearUpstreamOptionBits(int v)

      Clear the given bit-mask from this instance upstream-option-bits using bit-and w/ `~v`

    - #### toString

          StringBuilder toString(StringBuilder sink)

    - #### toString

          String toString()

      Overrides:
        `toString` in class `Object`

Copyright 2010 JogAmp Community.