aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
Commit message (Collapse)AuthorAgeFilesLines
* Fix Bug 560 and NEWT window closing behavior in general for all platforms.Sven Gothel2012-05-0113-41/+138
| | | | | | | | | | | | | | | | | | | | | | - NEWT/WindowImpl: - 'void windowDestroyNotify()' -> 'boolean windowDestroyNotify(boolean force)', allowing to signal a forced close, as well as replying whether the window has been closed. (called by native code) - destroy(): set states before releasing the window lock - NEWT/X11: Pass windowDeleteAtom for reconfigure window, in case of reparenting child to top-level - NEWT/OSX: - Add 'BOOL windowShouldClose()' impl., ie. having a chance to reject the close attempt - Common impl. for 'windowShouldClose' and 'windowWillClose' -> 'windowClosingImpl' utilizing new 'windowDestroyNotify' code (see above). Fixes bug 560. - NEWT/JOGLNewtApplet1Run: Refine out-of browser window behavior for window-close button - default: move NEWT window back to browser parent - closeable: close NEWT window - jogl-test-applets: Add NApplet-Closeable test (Applet out-of browser window is closable)
* NEWT/WindowImpl: Make all 'action' class instances final; Action's init() ↵Sven Gothel2012-05-011-110/+101
| | | | determines whether it shall be executed.
* Bug 556: Newt Mouse Synthetic Drag Event: Clear state if mouse enters/leaves ↵Sven Gothel2012-04-271-7/+14
| | | | | | | | | | | | | window. Since we cannot guarantee to have the pressed button information when receiving the mouse move event, we synthesize the dragged event (move while mouse button pressed). To simplify the situation and have a compromise, we clear the mouse pressed states when mouse enters or leaves the window to remove the dragged events at re-entering. This seems more sensible, since dragging after re-entering the mouse shall not be expected.
* Bug 570: NEWT General/X11: Decouple setFullscreen() and setAlwaysOnTop(); ↵Sven Gothel2012-04-272-35/+60
| | | | | | | | | | | | | | Use window-static instances for runnable actions NEWT General/X11: Decouple setFullscreen() and setAlwaysOnTop() - X11 fullscreen/above: Don't assume 'always-on-top' if switch to fullscreen. - WindowImpl: Remove relation between 'always-on-top' and fullscreen when quering and switching. Use window-static instances for runnable actions - Removes temp objects for EDT runnables - Uses synchronization on action instance to avoid concurrency
* Fix Bug 571: X11 behavior, where the PRESSED button is not included in the ↵Sven Gothel2012-04-271-1/+4
| | | | native mask.
* NEWT Input- Mouse-Event: Consitency of mouse button number; Add button -> ↵Sven Gothel2012-04-272-19/+36
| | | | button-mask func.
* Newt/AWT Event Factory: Add Mouse Wheel Event ConversionSven Gothel2012-04-242-2/+16
| | | | .. also reverse AWT rotation sign, since NEWT uses the reverse oriantation.
* Newt/OSX(native): close0() shall not release NewtMacWindow (NSWindow) in ↵Sven Gothel2012-04-213-20/+53
| | | | | | | | case it's already in destruction (destroyNotifySend via windowWillClose()) This fixes the double release crash of the NSWindow, at the end of an application. Tested on OSX 10.6.8 and 10.7.3.
* NEWT/MainThread: Wait for new non daemon threads after 'main' class has ↵Sven Gothel2012-04-211-24/+102
| | | | finished, mimics proper Java behavior.
* NEWT/Android: Fix requestFocus() - run impl. on UI thread.Sven Gothel2012-04-181-3/+7
|
* TextureSequence Shader Support; GLMediaPlayer uses 'int' where possible; ↵Sven Gothel2012-04-161-0/+36
| | | | | | | | | | | | | General enhancments. For details about TextureSequence/GLMediaPlayer shader collaboration w/ your own shader source, see TextureSequence and TexCubeES2 / MovieSimple demo. TextureSequence allows implementations to provide their own texture lookup function which may provide color space conversion (YUV) .. or other runtime hw-accel features. Have a look at the next commit, which provides an Libav/FFMpeg implementation w/ YUV/RGB shader conversion. MovieCube adds keyboard control (Android: firm touch on display to launch keyboard, don't break it though :)
* NEWT/Android: Add (soft) keyboard input. Complete the Android -> NEWT key ↵Sven Gothel2012-04-162-77/+106
| | | | | | | | | | | | | | | | | | | | | | translation. Minor fixes for mouse as well. - AndroidNewtEventFactory - Android -> NEWT KeyCodes, leave out control keys like HOME, BACK, .. TBD .. - We don't consume the key event, in case we cannot map it, so the Android OS has a chance to handle the control keys. - Key-Release generates a Key Typed event. - Key/Mouse translate Android time-base (upTime) to Unix. - AndroidWindow - set our onKeyListener, using above tranlator - setFocusable(true) and setFocusableInTouchMode(true) on our SurfaceView, otherwise no key event will be delivered. Note: 'requestFocus()' must also be called on the view for key input! - Test: NEWTGearsES2Activity, which launches the soft key via: InputMethodManager mgr = (InputMethodManager) win.getAndroidView().getContext().getSystemService(Context.INPUT_METHOD_SERVICE); mgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); // shows keyboard .. and requests the focus of the view for input.
* NEWT WindowImpl: Ensure screenChange suspense animation, even w/o having the ↵Sven Gothel2012-04-161-0/+4
| | | | | | | notify method being called. This happens on android, where we just react on an already happened screen rotate. W/o animation suspend GL rendering could be disturbed or the thread could starve.
* StringBuffer -> StringBuilder (Local objects, no concurrency) ; Impacts: ↵Sven Gothel2012-04-162-3/+3
| | | | Capabilities/GLContext API 'toString(StringBuilder)'
* AndroidWindow: Fix regression (commit ↵Sven Gothel2012-04-121-1/+1
| | | | c9066a6df7a0b8612a8a0b3e5c8977268a1257e8), no destruction on surface size change.
* Android: Cleanup AndroidWindow. NewtBaseActivity: Reset FPSCounter on ↵Sven Gothel2012-04-092-43/+15
| | | | resume, Sync LauncherUtil
* NEWT/Android: Add notion of 'brokenFocusChange' for Android impl, where ↵Sven Gothel2012-04-042-12/+16
| | | | requestFocus and focusChanged is always forced
* AndroidWindow/NewtBaseActivity: Properly split functionality, remove ↵Sven Gothel2012-04-032-81/+182
| | | | | | | | | | | | | | | | | | | | | | | | android.view.Window reference and use from AndroidWindow; Force transparency flag; Multiple NEWT Windows in Activity. AndroidWindow: - Force transparency flag to EGL Capabilities chooser (see commit 0d12af05128da433aa7b6767ba5a7f6ee9bce6c4) - Keep androidFormat besides nativeFormat, used to determine transparency flag and recreation. - Move transparency style selection from AndroidWindow.instantiationFinished() -> NewtBaseActivity.setContentView(..) - Remove AndroidWindow.becomeContentViewOf(..) and add it's fullscreen layout features to NewtBaseActivity.setContentView(..) NewtBaseActivity: - General support for multiple NEWT windows. - Adding functionality removed from AndroidWindow - see above - Adding 'addContentView(..)' and 'registerNEWTWindow(..)' which, besides 'setContentView(..)' performs registration of the NEWT window for the 'onDestroy()' method. The 'add*' and 'set*' variant also handle layout etc. - Add direct methods to set fullscreen feature and transparency theme.
* Enhance and generalize AWT Threading* implementation; Minor changes ..Sven Gothel2012-03-251-60/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Threading*: - add invoke(..) generalizing the Therading decision GLCanvas: - remove 'manual' Threading decision, simply call Threading.invoke(..) - use anonymous Runnable instances - remove drawable lock, drawable is volatile instead GLJPanel: - remove 'manual' Threading decision, simply call Threading.invoke(..) - use anonymous Runnable instances - DEBUG: Use getThreadName() prefix GLContextImpl: - Remove GLWorkerThread idle command on makeCurrent(), no holding of context in worker thread while idle. - DEBUG: Use getThreadName() prefix X11GLXContext: - DEBUG: Use getThreadName() prefix TODO: Validate whether it's OK for GLCanvas and GLJPanel to set Threading.Mode.MT as the default mode!
* Reduce Thread.dumpStack() in debug mode where no negative behavior appears ↵Sven Gothel2012-03-182-2/+0
| | | | or a stack trace may be helpful.
* Adapt to GlueGen IO resource changes URL -> URLConnection for effeciency; ↵Sven Gothel2012-03-171-25/+25
| | | | | | | | | | API doc enhancements; Minor edits - API doc added/enhanced: - ShaderCode - ShaderUtil - NewtBaseActivity: Clarify method / var names
* Android Tests: Using JogAmp's ActivityLauncher (gluegen commit: ↵Sven Gothel2012-03-142-31/+109
| | | | | | | | 0cfc7847c58b51c9a26b50d905b592d1fc4c8578) - Remove jogl.android-launcher.apk in favor of generic jogamp.android-launcher.apk - All Android test code resides in jogl.test.apk (initial launcher and delegated 'real' one)
* Adapt to gluegen Properties/Security commits ↵Sven Gothel2012-03-133-76/+18
| | | | f4ac27e177f6deb444280d3b375e7d343e38bd080 and eedb4b530fb83fc59a26962bcf7847a1404092a0
* Android: Minor cleanup ; NewtBaseActivity: clear static context at destroySven Gothel2012-03-102-1/+2
|
* AndroidWindow: Fix Native PixelFormat == VisualID { <0 case, TRANSLUCENCY, ↵Sven Gothel2012-03-101-73/+53
| | | | | | | | | | | | | | | | ..} ; Generate focus event/state; onTouch() consumed - fix Native PixelFormat == VisualID { <0 case, TRANSLUCENCY, ..} - surfaceChanged(..): use 'ANativeWindow_getFormat(surfaceHandle)' if given format is generic (<0) - match used caps w/ format exactly - generate focus event/state: always focus at creation and listen to onFocusChange() - onTouch() consumed only if we mapped a NEWT event, otherwise return false. - use VisualIDHolder of already chosen config to determine native VisualID - use Log.d(MD.TAG, ..)
* NEWT/setFullscreen(v): Save new state for to-be-created windows (not yet valid).Sven Gothel2012-03-101-11/+12
|
* AndroidWindow.surfaceChanged(.., int pFormat, ..): Use passed pixel-format ↵Sven Gothel2012-03-071-4/+8
| | | | | | | if valid Turns out on Android 4.0.3 / Pandaboard ES (at least), the NDK method 'ANativeWindow_getFormat()' returns '1'.
* NativeWindow public* reorg 3/3 ; NativeVisualID -> VisualIDHolder incl. ↵Sven Gothel2012-03-061-3/+5
| | | | | | | | | | | | | | | | | | | | | | proper utilization. - VisualIDHolder: Update documentation (Exception case, etc) - NativeVisualID -> VisualIDHolder (public) - incl. generic Comparator - better doc and enum values - VID_UNDEFINED == 0 - methods shall not throw exception, but return UNDEFINED - CapabilitiesImmutable extends VisualIDHolder - All Capabilties impl. - use VID_UNDEFINED for undef. value - use final private (immutable) fields - AbstractGraphicsConfiguration extends VisualIDHolder - X11 CreateDummyWindow takes (int) visualID
* NativeWindow public-spec to public-impl reorg ↵Sven Gothel2012-03-0614-30/+46
| | | | (javax.media.nativewindow.<impl> -> com.jogamp.nativewindow.<impl>) 2/3
* Fix GLWindow/SWT-GLCanvas: set context synchronized ; Misc ChangesSven Gothel2012-03-051-0/+1
| | | | | | | | | | | | Fix GLWindow/SWT-GLCanvas: set context synchronized - GLWindow fix commit a0177c8a1048683e5d43f4712f8f9e37091d4e85. Removed explicit recursive surface lock requires recursive context locking, otherwise concurrent rendering fails. The implicit recursive surface lock within context makeCurrent() is applied after the context lock itself. Misc Changes - Fix TestPBufferDeadlockAWT, which was not using the unique profile string reference
* Complete LOCK_SURFACE_CHANGED ; Introduce NativeVisualID (Daisy chaining ↵Sven Gothel2012-03-054-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *GraphicsConfiguration) ; ... NativeVisualID: New interface for Capabilities implementations, allowing retrieval of the native 'visual id'. Impl. by WGL, X11 and EGL. JAWTWindow.lockSurface() - Detect surfaceHandle change an return LOCK_SURFACE_CHANGED (see: LOCK_SURFACE_CHANGED) EGLDrawable: - Impl. updateHandle() (see: LOCK_SURFACE_CHANGED) - use NativeVisualID for EGLGraphicsConfiguration selection to respect a native 'visual id' EGLContext.createContextImpl: Use NIO for attributes EGLDisplayUtil: Enhance eglGetDisplay w/ DEBUG code and NativeSurface / EGL_DEFAULT_DISPLAY variation EGL, XGL, WGL GraphicsConfiguration: - Don't set ALPHA_SIZE and STENCIL_SIZE if not requested in attribute list for context creation. - toString() shows proper identification, eg.: egl, x11, win32 .. EGLGraphicsConfigurationFactory: Daisy chain GraphicsConfigurationFactory for native device type (currently only X11). This allows choosing the EGLGraphicsConfiguration and hence native visual id based on EGL when invoked via the factory model (generic). In case EGLGraphicsConfigurationFactory is not suitable or doesn't produce a native visual id, it falls back the the original one. X11AWTGraphicsConfigurationFactory and X11Window: Use generic NativeVisualID which allows EGLGraphicsConfiguration implicit. *GraphicsConfiguration's DEBUG flag is pushed up to DefaultGraphicsConfiguration LOCK_SURFACE_CHANGED: - commit 006e9fe402a0a47b45fd2c4af51296aef895e8b5 - commit a0177c8a1048683e5d43f4712f8f9e37091d4e85 Impact: - Fixes EGL/GLES (wrapper/native) usage on X11, proper Xvisual selection w/ EGL - Fixes EGL/GLES (wrapper/native) usage on Windows, ANGLE works w/ NEWT and forced ES2
* NEWT/Windows lockSurfaceImpl(): Detect hdc change and result w/ ↵Sven Gothel2012-03-041-4/+19
| | | | | | | | LOCK_SURFACE_CHANGED This allows an underlying delegation/mapping to update the handles, eg.: EGLDrawable. See commit a0177c8a1048683e5d43f4712f8f9e37091d4e85
* NewtFactory: Since the platform string references are unique, let's just ↵Sven Gothel2012-03-044-20/+18
| | | | compare the references instead of a string compare
* NEWT/GLWindow.display(): No explicit surface locking/unlocking for ↵Sven Gothel2012-03-041-7/+2
| | | | | | | | | | GLDrawableHelper.invokeGL(..) - it's done implicit at makeCurrent()/release() The explicit locking takes away the locking result, eg. SURFACE_CHANGED, which is required to update the delegated drawable handles (e.g.: EGL surface handle). With the followup fix of EGLDrawable.updateHandle()'s recreate EGL surface, an EGL 'wrapper' can work on Windows (eg. ANGLE).
* NativeWindow: Relax Xinerama dependency / Rename Windows impl subfolder to ↵Sven Gothel2012-02-271-1/+1
| | | | | | | common name win32 (same as stub_include) Utilizing dlopen/dlsym in an efficient way relaxes the platform requirement of having Xinerama available. This allows using Nokia N9 MeeGo out of the box.
* ScreenMode/X11: Use common defaults in case of undefined values. X11: ↵Sven Gothel2012-02-272-9/+17
| | | | Tolerate invalid refresh rate and use default.
* NEWT Screen.getCurrentScreenModeIntern() !ScreenMode case: Attempt to get ↵Sven Gothel2012-02-261-0/+3
| | | | screen size if 0.
* NEWT/ScreenMode DEBUG_TEST_SCREENMODE_DISABLED ↵Sven Gothel2012-02-231-1/+6
| | | | (-Dnewt.test.Screen.disableScreenMode) - If set also avoid 'getCurrentScreenModeImpl()'
* NEWT: Add time costs in DEBUG mode. NEWT/XRandR: Reuse ↵Sven Gothel2012-02-235-128/+186
| | | | | | | | | | | XRRScreenConfiguration to reduce perf hit on Linux ARM Omap4. On Linux ARM Omap4, we experience a performance hit when using XRandR: 1st call of XRRSizes: ~ 1668 ms Each call of XRRGetScreenInfo: ~ 1109 ms Even though XRRGetScreenInfo is cached in NEWT's X11Screen initialization, overall init time is ~2s, far too expensive.
* X11Screen: Only dump RandR version info in DEBUG mode.Sven Gothel2012-02-221-1/+1
|
* EGL Display Lifecycle Robustness Patch (impl. workaround)Sven Gothel2012-02-222-6/+6
| | | | | | | | | | Added EGLDisplayUtil helper class managing the lifecycle of the EGL display handle recursively. This class is required, due to implementation bugs within EGL where EGL.eglTerminate(long) does not mark the resource for deletion when still in use, bug releases them immediatly. This fixes unit test com.jogamp.opengl.test.junit.jogl.acore.TestInitConcurrentNEWT on Linux ARM w/ Omap4 and Tegra2.
* DEBUG Output: More thread-names to drawable/context lifecycle; Remove ↵Sven Gothel2012-02-223-9/+8
| | | | massive '!!!' occurence
* Hide dump of screen origin/size behind DEBUG flag.Sven Gothel2012-02-191-1/+3
|
* OpenGL ES/EGL OverhaulSven Gothel2012-02-132-21/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - GLProfile properly detects native EGL/ES1/ES2 on the 'desktop' device factory. This allows usage of Mesa's EGL/ES or Imageon's PVR emulation, etc. - GLProfile drops getDefaultDesktopDevice() and getDefaultEGLDevice() since both are aligned by getDefaultDevice(). - Fix GL_ARB_ES2_compatibility detection and utilize resulting isGLES2Compatible() where possible. This allows ES2 compatible desktop profiles to use core ES2 functionality (glShaderBinary() .. etc) even with a GL2ES2 desktop implementation. - EGLDrawable: If createSurface(..) fails (BAD_NATIVE_WINDOW) w/ surfaceHandle it uses windowHandle if available and differs. This allows the ANGLE impl. to work. - Properly order of EGL/ES library lookup: ES2: libGLESv2.so.2, libGLESv2.so, GLES20, GLESv2_CM EGL: libEGL.so.1, libEGL.so, EGL - *DynamicLookupHelper reference will be null if it's library is not complete (all tool libs, all glue libs and a ProcAddressFunc lookup function - if named). - Enhance GL version string (incl. ES2 compatible, hw/sw, ..) - GLBase: Fix docs and remove redundancies - Prepared (disabled) DesktopES2DynamicLibraryBundleInfo to be used for a real EGL/ES2 implementation within the desktop GL lib (AMD). Sadly it currenly crashed within eglGetDisplay(EGL_DEFAULT_DISPLAY), hence it's disabled.
* NEWT: Fix deadlock w/ AWT parent (NewtCanvasAWT) - focus window @ creation ↵Sven Gothel2012-02-081-3/+7
| | | | after releasing parent lock (AWT lock).
* Fix Bug 516 (Determine Java Version) / Fix OS X 10.5 linkage (weak ↵Sven Gothel2012-01-221-0/+4
| | | | | | | | | | | | | | | framework, NEWT) - Fix Bug 516 (Determine Java Version). See gluegen: 64639b805a32338385421f168e12c1ef7f749d00 - Fix OS X 10.5 linkage (weak framework, NEWT) - Use weak framework linkage for all modules and frameworks: AppKit, QuartzCore, Cocoa, OpenGL, JavaNativeFoundation - NEWT: Handle NS exception while calling OS X >= 10.6 only methods: - 'setAllowsConcurrentViewDrawing()' - 'setCanDrawConcurrently()'
* NEWT/OSX: Window close (release) on main thread, ensuring no 'main thread' ↵Sven Gothel2012-01-191-1/+2
| | | | event is pending
* NEWT/X11: Fix Insets determination for undecorated / child window.Sven Gothel2012-01-181-53/+86
| | | | | | | | | | | | Due to latest changes, a bug is disposed where the native 'updateInsets' attempts to determine the window insets by it's parent window (fall-back). The latter works only in case of a top-level window. Adding query to the WM whether the window is decorated (top-level) or not. Attempt to use the fall-back parent window method in case of a decorated window. This whole inset code based on the parent window is probably completly redundant, nevertheless we keep it alive until further notice.
* NEWT: Use accessors to read/write postion and size, allowing better trace ↵Sven Gothel2012-01-189-132/+124
| | | | | | | | | and controlling autoPosition; Restrict more fields to private where possible. WindowImpl's position and size is made private and accessed by it's getter and setter (definePosition/defineSize). This allows better tracing of value changes and ensures autoPosition is set to false.
* NEWT/OSX: Cleanup 'javaWindowObject' @ window-close & avoid NPE; Disable ↵Sven Gothel2012-01-184-16/+78
| | | | | | | | | | | | | | | | | | lostFocus (resignKeyWindow) when in fullscreen mode; Ignore invalid key release/type events. - Cleanup 'javaWindowObject' @ window-close & avoid NPE Ensure that the direct window.close() impl. removes the global reference and that all use cases check for NULL pointer. - Disable lostFocus (resignKeyWindow) when in fullscreen mode Similar to the X11 KDE bug, OS X delivers a lostFocus event which we prevent from being processed in fullscreen mode. - Ignore invalid key release/type events In case of offscreen/onscreen switching (fullscreen/reparenting) via destroy/create, the still pressed key would be send to the new window and repeat the action (key typed). State validation discards the double processing.