Sync LauncherUtil w/ GlueGen commit 1b9f0739ecc25105384b557afa698c42e08d4cc6 (adding main-cmdline-args)
Fix Bug 669: Recursive GLContext makeCurrent()/release()

Culprit:
  GLContext's makeCurrent() didn't clear the boolean flag 'unlockContextAndSurface'
  in case the context is already current (-> recursion).
  Above case was detected within a code block tailed by a finally block,
  which acted on mentioned flag, i.e. called lock.unlock() and hence decremented the lock count
  even though the method return w/ successful state.

  Fixed.

Added debug code:
  GLContext.release() debug code (DEBUG | TRACE_SWITCH),
  recording stack trace of last release() call, which is dumped in case no current was current.

Added 2 unit tests:
  - Simple recursive GLContext makeCurrent()/release() from within GLEventListener's display().
    Test also validates lock count and lock ownership.

  - GLAutoDrawable display() of another GLAutoDrawable
    from within GLEventListener's display(..).
NEWT/Android: Full Lifecycle for WindowDriver; Using static ViewGroup; AWTRobotUtil: More tolerant for non AWT env.; Fix adb-launch-*

- NEWT/Android WindowDriver
  - Full Lifecycle, remove refs on closeNative()
  - Respect isFullscreen()
  - Using static ViewGroup if available and surface not ready, allows running from main()

- AWTRobotUtil: More tolerant for non AWT env.
  - Check for NEWT first
  - Only use AWT iff available, which allows running on Android

- Fix adb-launch-*
  - Launch main/junit tests
Adapt to change 5060b728b26a89a14367f8fca9f4eb7968f719ca: ShaderState.uniform(..) returns false if no location available.
TestSwingAWTRobotUsageBeforeJOGLInitBug411: Fix 'chicken egg' init problem w/ AWTRobot, i.e. NativeWindow not yet initialized.

Regression since: 50f997557b91a2f014ef0c2ea848c5c326d0cfb2
Android/NewtVersionActivity: Dump avail. GLCaps / Use stderr, since log would cap 'em (too long).
Android: Allow selection of native window formats RGBA8888, RGBX8888 and RGB565; Fix HiSilicon/Vivante/Immersion.16 EGLConfig selection (zero depth buffer @ visualID)

- NEWT/Android Fix PixelFormat/NativeWindowFormat/VisualID Selection
  - Fix allows proper selection of native window formats: RGBA8888, RGBX8888 and RGB565

  - Selection is performed in 3 steps:
    1) @ Construction (non native): SurfaceHolder.setFormat( getSurfaceHolderFormat( caps ) )
    2) @ Native Surface Creation: getANativeWindowFormat( androidFormat) -> ANativeWindow_setBuffersGeometry(..)
       Note: The set native format is revalidated, i.e. read out via ANativeWindow_getFormat(..).
    3) @ EGL Creation: ANativeWindow_getFormat(..) -> fixCaps(..) - simply fixing the chosen caps.

- NEWT GLWindow.GLLifecycleHook.resetCounter:
  - Also reset GLAnimatorControl's counter, if attached.

- NEWT WindowImpl -> GLLifecycleHook.resetCounter() calls issued _after_ operation before unlock().

- JOGL/EGLGraphicsConfigurationFactory
  - Validate whether the visualID matching EGLConfig depth buffer is suitable.
    On HiSilicon/Vivante/Immersion.16: Depth buffer w/ matching visualID is zero!

- NativeWindow/Capabilities.compareTo: Fix alpha comparison
Bug 665 (part 1) - Allow dis-association of GLContext's GLDrawable ..

Changes allowing re-association (incl. null) of GLContext/GLDrawable:

- GLAutoDrawable: Refine API doc 'setContext(..)'

- GLContext: Refine API doc: 'setGLDrawable(..)' 'getGLDrawable()'

- GLContextImpl.setGLDrawable(): Handle null drawable

- GLAutoDrawableDelegate/GLAutoDrawableBase: Allow null GLContext

- GLDrawableHelper.switchContext(..)/recreateGLDrawable(): Balance GLContext.setGLDrawable(..) calls

- New GLEventListenerState, holding state vector [GLEventListener, GLContext, .. ]
  impl. relocation of all components from/to GLAutoDrawable.

- GLDrawableUtil
  - Using GLEventListenerState for swapGLContextAndAllGLEventListener(..)

+++

NEWT Window*:
  - getDisplayHandle() is 'final', no more 'shortcut' code allowed
    due to re-association incl. display handle.

  - close*:
    - close config's device (was missing)
    - null config

+++

Changes allowing reconfig of Display handle as required
to re-associate pre-existing GLContext to a 'window':

- AbstractGraphicsDevice: Add isHandleOwner() / clearHandleOwner()
  - Impl. in X11GraphicsDevice and EGLGraphicsDevice, NOP in DefaultGraphicsDevice

- DefaultGraphicsConfiguration add 'setScreen(..)'

- MutableGraphicsConfiguration
  - Make DefaultGraphicsConfiguration.setScreen(..) public

- NativeWindowFactory add 'createScreen(String type, AbstractGraphicsDevice device, int screen)'
  - Refactored from SWTAccessor

- NativeWindow x11ErrorHandler: Dump Stack Trace in DEBUG mode, always.
FBObject/GLFBODrawableImpl: Silence stderr if not in DEBUG mode relying on application handling verbosity and debug output

The following cases were dumping states on stderr:
  - FBOObject.isStatusValid() if false
    -> Only dumps if DEBUG

  - GLFBODrawableImpl.reset() if fboResetQuirk becomes true and 1st time in ClassLoader
    -> Only dumps if DEBUG
[EGL/X11]Context: Enhance DEBUG output for failed makeCurrentImpl(..)
ProxySurface: Add 'NativeSurface getUpstreamSurface()' ; ProxySurfaceImpl: Don't cache 'displayHandle'

- ProxySurface: Add 'NativeSurface getUpstreamSurface()' allowing querying direct access of a backing surface representing this instance.
  - Use case: EGLWrappedSurface
  - Default impl. returns null

- ProxySurfaceImpl: Don't cache 'displayHandle'
  - getDisplayHandle() is 'final', no more 'shortcut' code allowed
    due to re-association incl. display handle.

  - See commit b738983638703bb721ee4c9820c8ef43e2252e73
WGLContext: Enhance DEBUG output for failed makeCurrentImpl(..)
Refine GL[Auto]Drawable 'realized' state in API doc, and relax it's realized requirement in GL[Offscreen]AutoDrawableDelegate*

Compatible w/ 'before'.

TODO: Contemplate about GLDrawableFactory.createOffscreenAutoDrawable(..) whether it:
  - should better return an unrealized [auto]drawable
  - or adding another API method for such case

  Goal: Allow passing vector of [device/context/..] for use cases
        such as re-using an onscreen destructed surface and on-/offscreen hopping.
Animator: API doc cleanup, isPaused()==true if drawablesEmpty (Animator == FPSAnimator behavior), resume after add ifPaused()

- GLAnimatorControl: Refine API doc

- Animator.run():
  - if( drawablesEmpt) { pausedIssued = true; } - Same behavior as FPSAnimator

- AnimatorBase.add(..)
  - consider paused case if no drawablesEmpty, i.e. if ( isPaused() ) { resume(); }
Fix misc API docs ..
GLDrawableHelper.invoke: If drawable is !realized -> deferred execution
Fix regression of commit b738983638703bb721ee4c9820c8ef43e2252e73, possible 'pulling' display's device - check references
Bug 665 (part 3) - Allow dis-association of GLContext's GLDrawable .. - Add EGL/ES2 tests, attempt to fix wrapped EGL case

- Bug 665 (part 2) was commit 7fd5f76e1eb4bbf93fe9b1171744bd755d8f96e4

- Add EGL/ES2 tests in
  - TestGLContextDrawableSwitch01NEWT
  - TestGLContextDrawableSwitch11NEWT

- Attempt to fix wrapped EGL case (incomplete)
  - Using EGL/ES w/ non native EGL device/surface, but natively wrapped instances (most of the cases),
    a 'complicated' delegation of
       Native-Upstream -> EGL-Proxy -> EGL-Instance
    is being used heavily relying on the objects lifecycle.
    GLEventListenerState tries to roll back the realized state
    and even sets the upstream device handle,
    but this doesn't seem to be sufficient on X11.

Discussion:

It might turn out that we only can implement the survival of GLContext
and it's display device reliable w/ EGL within the GLAutoDrawable implementation,
which can hold the previous not destructed instances.
Add WindowClosingProtocol impact detail on WindowListener.windowDestroyNotify(..)
Fix Bug 678: Deliver key-char value for printable chars on all KeyEventListener (-> On Windows as well)

The following is observed, where t0 and t1 refer to subsequent different timestamps:
  NEWT delivery order:
      PRESSED (t0), RELEASED (t1) and TYPED (t1)

  WINDOWS delivery order:
      PRESSED (t0), TYPED (t0) and RELEASED (t1)
  Windows Auto-Repeat:
      PRESSED (t0), TYPED (t0)

Hence we changed the event reorder-code in NEWT to trigger NEWT-PRESSED on
Windows-TYPED for printable chars, assuring key-char values on all listener callbacks.

- KeyEvent.getKeyChar(): Removed disclaimer dedicated for Windows
- Keyevent.isActionKey(): Completed for all NEWT non-printable action keys; Added static variant
- Keyevent.isPrintableKey(): NEW: returns !isModifierKey(keyCode) && !isActionKey(keyCode) ; With static variant

- Windows WindowDriver:
  - EVENT_KEY_PRESSED handles non-printable chars only
  - EVENT_KEY_TYPE handles printable chars only
  - Native: VK_DELETE passes keyCode

- Unit tests: Wait for completion 1s -> 2s