aboutsummaryrefslogtreecommitdiffstats
path: root/src/nativewindow/classes
Commit message (Collapse)AuthorAgeFilesLines
...
* Findbugs.increment_volatile: Use AtomicInteger or add comment that operation ↵Sven Gothel2014-07-081-7/+7
| | | | is safe!
* Findbugs.synchronization: Fix double-check w/o volatile; Remove redundant ↵Sven Gothel2014-07-081-1/+1
| | | | synchronized from setter
* Code Clean-Up based on our Recommended Settings (jogamp-scripting ↵Sven Gothel2014-07-0364-487/+499
| | | | | | | | | | | | | c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
* Fix 'typo' in messages: 'Catched' -> 'Caught'Sven Gothel2014-06-284-5/+5
|
* Adapt to GlueGen commit c3054a01990e55ab35756ea23ab7d7c05f24dd37 (compount ↵Sven Gothel2014-06-171-1/+1
| | | | call-by-value extension), utilizing native JVMUtil_NewDirectByteBufferCopy(..)
* Fix Bug 1019 - Remedy of Bug 691 causes 'access/modify after free' and ↵Sven Gothel2014-06-123-68/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | crashes the app The 'magic' MyNSOpenGLContext::dealloc (MacOSXWindowSystemInterface-calayer.m) of force destroying the underlying CGLContextObj of it's associated NSOpenGLContext as introduced as a remedy of Bug 691 is plain wrong. It was added in commit f6e6fab2a7ddfb5c9b614cb072c27ff697629161 to mitigate the experience behavior of delayed GL context destruction when creating/destroying them multiple times as exposed in unit test TestGLCanvasAddRemove01SwingAWT. While this 'hack' worked for some reason on some OSX versions, it caused a 'access/modify after free' issue exposed under some circumstances and crashes the application. The actual culprit of the delayed GL context destruction is different. The offthread CALayer detachment and hence final destruction issued on the main-thread is _not_ issued immediately due to some referencing holding by NSApp. Issuing an empty event on the NSApp (thread) will wake up the thread and release claimed resources. This has been found while realizing that the GL context are released if the mouse is being moved (duh!). This issue is also known when triggering stop on the NSApp (NEWT MainThread), same remedy has been implemented here for a long time.
* Bug 741 HiDPI: Add ScalableSurface.getNativeSurfaceScale(..) to compute ↵Sven Gothel2014-06-095-27/+60
| | | | | | | | | | | | | | surface DPI ; Add NEWT Window.getPixelsPerMM(..) to query surface DPI With HiDPI and surface scale, we need knowledge of the native surface's pixel-scale matching the monitor's pixel-per-millimeter value. Preserving the queried native pixel-scale and exposing it via ScalableSurface.getNativeSurfaceScale(..) to compute surface DPI. Add NEWT Window.getPixelsPerMM(..) to query surface DPI. Surface DPI is demonstrated in GraphUI's GPUUISceneGLListener0A .. and TestRulerNEWT01, etc ..
* Bug 741 HiDPI: Simplify ScalableSurface (2): Add request pixelScale API ↵Sven Gothel2014-06-085-25/+34
| | | | | | | | | | | | | | | | | | | entry, fixed NewtCanvasAWT use-case We require the requested pixelScale in NewtCanvasAWT if the NEWT window (child) is not yet realized, so the JAWTWindow can receive the request, since realized/current pixelScale is still 1. Remove return value (requested pixel scale): - public int[] setSurfaceScale(final int[] result, final int[] pixelScale); + public void setSurfaceScale(final int[] pixelScale); Add API hook to query requested pixel scale: + int[] getRequestedSurfaceScale(final int[] result); Unique name for get[Current]*: - public int[] getSurfaceScale(final int[] result); + public int[] getCurrentSurfaceScale(final int[] result);
* Bug 741 HiDPI: Simplify ScalableSurface [set|get]SurfaceScale(..) spec, ↵Sven Gothel2014-06-085-26/+28
| | | | | | | | | | | | which also fixed JAWTWindow getSurfaceScale() issue on Windows Let setSurfaceScale(..) return the validated requested values and getSurfaceScale(..) always the current values. This removes complication and solves a bug w/ JAWTWindow on Windows, where we used 'drawable' as an indicator for 'previous locked' state. The latter is not true since on Windows 'drawable' is set to null in unlock, getWindowHandle() should be taken instead.
* Bug 741 HiDPI: Add ScalableSurface interface to get/set pixelScale w/ full ↵Sven Gothel2014-06-086-44/+418
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OSX impl. Add ScalableSurface interface - To set pixelScale before and after realization - To get pixelScale - Implemented on: - NEWT Window - Generic impl. in WindowImpl - OSX WindowDriver impl. - Also propagetes pixelScale to parent JAWTWindow if offscreen (NewtCanvasAWT) - AWT WindowDriver impl. - JAWTWindow / OSXCalayer - AWT GLCanvas - AWT GLJPanel - NEWTCanvasAWT: - Propagates NEWT Window's pixelScale to underlying JAWTWindow - WrappedSurface for pixelScale propagation using offscreen drawables, i.e. GLJPanel - Generic helper in SurfaceScaleUtils (nativewindow package) - Fully implemented on OSX - Capable to switch pixelScale before realization, i.e. native-creation, as well as on-the-fly. - Impl. uses int[2] for pixelScale to support non-uniform scale. Test cases: - com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT - com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT - com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT - com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT - Press 'x' to toggle HiDPI - Commandline '-pixelScale <value>' - Added basic auto unit test (setting pre-realization)
* Minor: API-Doc / DEBUG Typo, GDISurface: Make fields privateSven Gothel2014-06-083-4/+4
|
* UpstreamSurfaceHook: Add 'NativeSurface getUpstreamSurface()' (from ↵Sven Gothel2014-06-085-7/+40
| | | | EGLUpstreamSurfaceHook) to generalize ProxySurfaceImpl.getUpstreamSurface()
* Bug 741 HiDPI: Add new NativeSurfaceHolder interface to GLDrawable and ↵Sven Gothel2014-06-064-1/+58
| | | | | | | | | | | | | | NativeWindow; [AWT|SWT]NewtEventFactory use NativeSurfaceHolder as source, fixes pixel unit conversion - Add new NativeSurfaceHolder interface to GLDrawable and NativeWindow, allowing NativeSurface access (pixel unit conversion) A NativeSurfaceHolder is e.g.: - NativeWindow (is-a) - NEWT [GL]Window - GLDrawable (has-a) - [AWT|SWT]GLCanvas - [AWT|SWT]NewtEventFactory use NativeSurfaceHolder as source, fixes pixel unit conversion
* Bug 741 HiDPI: [Core API Change] Bring back get[Width|Height]() in ↵Sven Gothel2014-05-276-20/+20
| | | | | | | | | | | NativeWindow, i.e. getWindow[Width|Height]() -> get[Width|Height]() We have distinguished pixel- and window units in commit f9a00b91dcd146c72a50237b62270f33bd0da98e and introduced NativeWindow.getWindow[Width|Height]() and NativeSurface.getSurface[Width|Height](). To have a unique naming scheme, we could rename all method using 'Window', but for simplicity and since there will be no 'semantic override' just use the simple version.
* Bug 1012: Fix erroneous handling of multiple monitor coordinates on OSX with ↵Sven Gothel2014-05-262-22/+8
| | | | | | | | | | | NEWT To properly convert Top-Left (TL) from/to Bottom-Left (BL) coordinates we need to utilize the given CGDisplay viewport (TL) and NSScreen (BL) to perform the y-flip. This is especially true for the case of having multiple monitors covering different viewports (mixed resolution).
* Bug 741 HiDPI: Refine Monitor/Screen [virtual] Viewport Definition / Add ↵Sven Gothel2014-05-265-27/+74
| | | | | | | | | | | | | | | | | | | | NEWT Support / Fix JAWT getPixelScale deadlock - NativeWindow/Surface/NEWT API DOC: Define Coordinate System of Window and Screen - OSXUtil: Add getPixelScale(..) via Screen index and 'windowOrView' - JAWTWindow/JAWTUtil.getPixelScale(..): Use pre-fetched AWT GraphicsConfiguration to solve AWT-TreeLock (deadlock) - [Virtual] Viewport of MonitorDevice and Screen: - Properly calculate and expose [virtual] viewport in window and pixel units - OSX Monitor viewports in pixel units are 'reconstructed' - Window/Viewport to Monitor selection shall be perfomed via window units (unique) - OSX NEWT Window create/init (native): Use given size and coordinates even in fullscreen mode Don't override by quering NSScreen coordinates, trust given values. - Fix test cases, i.e. usage of pixel- and window-units
* Bug 742 HiDPI: [Core API Change] Distinguish window-units and pixel-units: ↵Sven Gothel2014-05-232-12/+43
| | | | | | | | | | | | | | | Refine commit fb57c652fee6be133990cd7afbbd2fdfc084afaa - NEWT Screen, Monitor, MonitorMode, .. - All Units are in pixel units, not window units! - On OSX HiDPI, we report the current scaled monitor resolution, instead of the native pixel sized. Need to filter out those, i.e. report only native unscaled resolutions, since out MonitorMode analogy is per MonitorDevice and not per window! - Fix usage (one by one) of - Screen and Monitor viewport usage
* Bug 742 HiDPI: [Core API Change] Distinguish window-units and pixel-units: ↵Sven Gothel2014-05-2213-59/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refine commit f9a00b91dcd146c72a50237b62270f33bd0da98e - Using comment tag 'FIXME HiDPI' to locate remaining issues - Fix remaining 'getPixel*(..)' -> 'getSurface*(..)' - UpstreamSurfaceHook - Fix usage (one by one) of - NativeWindow: getWindowWidth() / getWindowHeight() - NativeSurface/GLDrawable: getSurfaceWidth() / getSurfaceHeight() - mention window- or pixel units in API doc where required - use 'setSurfaceSize(..)' where appropriate to match 'getSurface*()' - GLFBODrawable - GLOffscreenAutoDrawable - UpstreamSurfaceHook.MutableSize - NativeWindow's Point: Add API doc and 'Point scaleInv(..)' - NativeSurface Simplify new conversion methods and use single in-place storage - 'int[] getWindowUnitXY(int[], int[])' -> 'int[] convertToWindowUnits(int[], int[])' - 'int[] getPixelUnitXY(int[], int[])' -> 'int[] convertToPixelUnits(int[], int[])' - NEWT Screen/Monitor - Assume screen/window units - TODO: Refine semantics - Monitor resolution probably is in pixel units ?! - Including the Rectangle/Monitor association etc etc - NEWT Window - Add setSurfaceSize(..) for convenience - Add 'Point convertToWindowUnits(final Point pixelUnitsAndResult)', etc .. - All window ops are using window units (size, pos, ..), but methods operating on the surface/drawable: windowRepaint(..) .. - TODO: Consider changing method names 'window*(..)' to 'surface*(..)' actually operating on surface/drawable - Window.windowRepaint(..) - GLAutoDrawableDelegate.windowResizedOp(..) (maybe all similar methods in here) - NEWT Mouse/Pointer Events - Using pixel units
* Bug 742 HiDPI: [Core API Change] Distinguish window-units and pixel-units; ↵Sven Gothel2014-05-2124-179/+372
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add HiDPI for AWT GLCanvas w/ OSX CALayer Core API Change: To support HiDPI thoroughly in JOGL (NativeWindow, JOGL, NEWT) we need to separate window- and pixel units. NativeWindow and NativeSurface now have distinguished access methods for window units and pixel units. NativeWindow: Using window units - getWindowWidth() * NEW Method * - getWindowHeight() * NEW Method * - getX(), getY(), ... NativeSurface: Using pixel units - getWidth() -> getSurfaceWidth() * RENAMED * - getHeight() -> getSurfaceHeight() * RENAMED * GLDrawable: Using pixel units - getWidth() -> getSurfaceWidth() * RENAMED, aligned w/ NativeSurface * - getHeight() -> getSurfaceHeight() * RENAMED, aligned w/ NativeSurface * Above changes also removes API collision w/ other windowing TK, e.g. AWT's getWidth()/getHeight() in GLCanvas and the same method names in GLDrawable before this change. +++ Now preliminary 'working': - AWT GLCanvas - AWT GLJPanel Tested manually on OSX w/ and w/o HiDPI Retina: java com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT -manual -noanim -time 1000000 java com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT -manual -noanim -time 1000000 +++ TODO: - NEWT - Change Window.setSize(..) to use pixel units ? - OSX HiDPI support - Testing .. - API refinement
* Bug 742 HiDPI: Add access to private HiDPI in AWT pixelScale value in ↵Sven Gothel2014-05-202-3/+87
| | | | JAWTUtil and JAWTWindow
* JAWTWindow: Non intrusive workaround for Bug 1004 and providing ↵Sven Gothel2014-05-122-4/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AppContextInfo to mitigate related bugs, e.g. Bug 983 Bug 1004, as well as Bug 983, are caused by issueing certain AWT tasks from a Thread which ThreadGroup is not mapped to a valid sun.awt.AppContext (AppContext). The 'certain AWT tasks' are all quering the current EventQueue instance, which is associated to the AppContext. This operation will fail and cause a NullPointerException. This workaround simply gathers a ThreadGroup which is mapped to the desired AppContext. This AppContext ThreadGroup is being used to launch a new Thread which is then mapped to an AppContext and hence can issue all AWT commands. +++ In the Bug 1004 scenario, JAWTWindow is constructed from within the AWT EDT, which ThreadGroup does belong to the AppContext. Here the issue is that an AWT operation was invoked from the OSX main thread, which itself does not belong to the AppContext. The workaround as described above solves this issue. +++ For Bug 983 the scenario is different, since JAWTWindow is _not_ constructed from a thread which ThreadGroup is mapped to the AppContext. [It is also not constructed on the AWT-EDT]. It is recommended to have Java3D gathering the AppContextInfo itself early and issues the JAWTWindow creation on an eligible thread using AppContextInfo.invokeOnAppContextThread(..) similar to JAWTWindow.attachSurfaceLayer(..). This will allow removing the more intrusive remedy of Java3D commit bdda2ac20bfef85271da764d1989ec3434d5c67a and simply issuing the crucial commands on a proper thread. +++ The more intrusive workaround of above commit does not work in general at least for Bug 1004 (OSX and Applets). While forcing the mapping of the 'alien' thread-group to the AppContext work for the 1st launch w/ the 1st AppContext, a second launch w/ a new AppContext will fail. Here we did update the new AppContext knowledge in AppContextInfo, however a NPE is received in getEventQueue() .. since the AppContext is gathered after patching, but the EventQueue is still null. Further more, using static knowledge of AppContext/ThreadGroup mapping violates at least the Applet lifecycle. Here we can have one ClassLoader with multiple AppContext - i.e. Applets.
* Cleanup *GraphicsDevice: Use 'final' for ctor parameter; ↵Sven Gothel2014-04-016-16/+15
| | | | DefaultGraphicsDevice.getUniqueID(..) shall perform 'intern()' only once.
* Refine commit 9fb1e46e43900ec9b2f9c9af1fc8984e101c8811: Avoid loading [j]awt ↵Sven Gothel2014-02-282-50/+63
| | | | | | | | | | | | | | | | | native libs and null-cursor creation in headless mode Commit 9fb1e46e43900ec9b2f9c9af1fc8984e101c8811 exposed sideffects, i.e. libjawt.so could not be loaded in JAWTUtil's static-init while in headless mode. JAWTUtil's static init block was triggered from AWTMisc debug flag changes. Fix drops operations in headless mode: - JAWTUtil - awt native lib loading - querying headfull features (locking, java2d ..) - AWTMisc - creating null cursor
* AWTMisc.static: Allow static creation of 'null' AWT cursor to fail (i.e. AWT ↵Sven Gothel2014-02-262-4/+18
| | | | headless)
* SurfaceUpdatedListener: Order methods in impl. Class; ↵Sven Gothel2014-02-132-33/+36
| | | | SurfaceUpdatedListener: Mark methods final, use volatile 'isEmpty' to bail out early @ surfaceUpdated.
* TextureIO: Support PNGTextureWriter w/ TextureData IntBuffer (via ↵Sven Gothel2014-02-131-2/+1
| | | | | | | | | | | | | | | PNGPixelRect and PixelFormatUtil) TextureData IntBuffer could be caused by AWT read-pixels but is not seamlessly supported via PNGPixelRect since the latter uses a hardcoded ByteBuffer. Add static PNGPixelRect.write(..) supporting IntBuffer to support this case for now. PNGPixelRect instances do not support any Buffer type to avoid a bloated implementation. PixelFormatUtil adds support for int32 pixel format conversion.
* Bug 973: NativeWindowFactory: Needs service provider interface (SPI) for TK ↵Sven Gothel2014-02-121-2/+2
| | | | specific implementations (Scaling)
* Bug 973: NativeWindowFactory: Needs service provider interface (SPI) for TK ↵Sven Gothel2014-02-121-4/+19
| | | | | | specific implementations (Scaling) Add FIXME note ..
* NativeWindowFactory.createWrappedWindow [WrappedWindow]: Using ↵Sven Gothel2014-01-313-11/+57
| | | | UpstreamSurfaceHookMutableSizePos to take position into account; WrappedWindow: invalidate and destroy - display device could be opened.
* Add NativeWindowFactory.getLocationOnScreen(NativeWindow nw) to retrieve the ↵Sven Gothel2014-01-311-0/+19
| | | | NativeWindow location on screen
* NativeWindowFactory: Add Support for creating a platform agnostic wrapped ↵Sven Gothel2014-01-303-0/+149
| | | | AbstractGraphicsDevice/NativeWindow
* Bug 952 - JAWTWindow.JAWTComponentListener's ctor() and detach() may ↵Sven Gothel2014-01-271-10/+21
| | | | | | | | | | | | | deadlock due to AWTTreeLock acquisition while add/remove AWT listener The AWTTreeLock is acquired by Component.removeHierarchyListener and as for _every_ AWT component, modifications shall happen on the AWT-EDT. IMHO the user shall offload AWT modifications to the AWT-EDT similar to what JOGL's GLCanvas and NEWTCanvasAWT does. However, since JAWTWindow also represents a NativeWindow instance we shall offload AWTTreeLock methods ourselves!
* Bug 948 - NVIDIA 331.38 (Linux X11) EGL impl. only supports _one_ EGL ↵Sven Gothel2014-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Display via eglGetDisplay(..) NVIDIA 331.38 (Linux X11) EGL impl. only supports _one_ EGL Display via eglGetDisplay. - Subsequent eglGetDisplay(..) calls fail. - Using the same 'global' egl-display does work though Remedy: Add 'GLRendererQuirks.SingletonEGLDisplayOnly' Detection of quirk is done as usual in GLContextImpl.setRendererQuirks(..), and EGLDrawableFactory passes the quirk, if detected, down to EGLDisplayUtil. The latter implements the singleton eglDisplay handle. EGLDisplayUtil: Cleaned up .. - EGLDisplayRef employs the reference handling incl. eglInitialize(..) and eglTerminate(), as well as the new singleton quirk. - Mark all internal methods 'private', to remove possible [untested] sideffects.
* EGLDisplayUtil.eglCreateEGLGraphicsDevice(..): Don't open() device implicit; ↵Sven Gothel2014-01-231-0/+12
| | | | EGLDrawableFactory.mapAvailableEGLESConfig(..): Clarify
* JAWTWindow DEBUG: Dump all JAVA_VERSION* informationSven Gothel2014-01-141-0/+3
|
* JAWTWindow.JAWTComponentListener: Minor CleanupSven Gothel2014-01-131-5/+5
|
* Bug 937 - JAWTWindow: Unsatisfying Visibility ComputationSven Gothel2014-01-121-56/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | Simplify JAWTComponentListener's HierarchyListener: - Don't interfere w/ Component's visibility anymore! This shall reduce sideeffects. Utilize 'isShowing' in each Component specialization, i.e. GLCanvas. - On SHOWING_CHANGED if a parent caused a change of the tracked components showing state, propagate it to the offscreen-layer! - Remove all other complicated states! GLCanvas, GLJPanel: - Instead of 'isVisible()' use 'showing state', since only the 'showing state' reflects 'true' visibility throughout the hierarchy. - Add HierarchyListener and track volatile showing state to be used instead of 'isVisible'. Using a cached showing state is more efficient than quering 'isShowing()' all the time! NewtCanvasAWT: - Use 'isShowing()' instead of 'isVisible(), see above
* Misc Cleanup: JAWTWindow: Reusing visible in HIERARCHY listener; Remove ↵Sven Gothel2014-01-112-20/+13
| | | | obsolete 'getPrivateGraphicsConfiguration()'
* PixelRectangle.GenericPixelRect: hashCode() impl. didn't set volatile ↵Sven Gothel2014-01-091-0/+1
| | | | hashCodeComputed := true (always re-computes hash code - duh!)
* Bug 935: NEWT PointerIcon: Utilize Toolkit Agnostic PixelFormat and ↵Sven Gothel2014-01-083-29/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conversion Utilities (Allowing 'arbitrary' PointerIcon data input) Commit fe28bc125429b38cdcd016746081f4a6d521c6fd added the notion of toolkit agnostic PixelFormat and conversion utilities, utilized and further tested by this patch. +++ - PointerIcon is a PixelRectangle and hence holds the decoded data. This allows on-the-fly conversion if required as well as recreation w/o PNG re-decoding. - Using array-backed PointerIcon data where possible, allowing better performance when converting PixelFormat etc. - NEWT Display adds 'createPointerIcon(final IOUtil.ClassResources pngResource...' method to support agnostic PointerIcon creation. - NEWT Display adds methods to allow users to avoid PixelFormat and Buffer NIO type forced conversion: - PixelFormat getNativePointerIconPixelFormat() - boolean getNativePointerIconForceDirectNIO() +++ PNGImage -> PNGPixelRect Deleted: com.jogamp.opengl.util.texture.spi.PNGImage Added: com.jogamp.opengl.util.PNGPixelRect (We hope nobody was using PNGImage directly since it was a service-plugin for TextureIO) PNGPixelRect is a PixelRectangle PNGPixelRect actually is implemented OpenGL agnostic, however - since our PNGJ support lives under package 'jogamp.opengl.util.pngj' it cannot be moved up (yet). PNGPixelRect now handles all PixelFormat for the target format and also added support for grayscale+alpha (2 channels). The latter is force-converted to RGB* - similar to paletted. Further more, PNGPixelRect allows simply passing an OutputStream to write the PNG data. Used by: TextureIO and NEWT +++ - OffscreenSurfaceLayer's setCursor(..) uses the agnostic PixelRectangle instead of a PNG resource. - AWTMisc uses the PixelRectangle to produce the AWT Cursor and converts it to the required format. Hence same pixels are used for NEWT and AWT pointer/cursor icon. - TestGearsES2Newt and NewtAWTReparentingKeyAdapter 'tests' iterate over 3 custom PointerIcon when pressed 'c'. - JOGLNewtAppletBase uses the new custom PointerIcon 'newt/data/crosshair-lumina-trans-32x32.png', which is included in NEWT (213 bytes only). -
* Bug 935: NEWT PointerIcon: Add Toolkit Agnostic PixelFormat and Conversion ↵Sven Gothel2014-01-083-0/+763
| | | | | | | | | | Utilities (Allowing 'arbitrary' PointerIcon data input) To allowing 'arbitrary' PointerIcon data input, i.e. via raw pixels we need to define an agnostic PixelFormat and required conversion utilities. The latter is not hw accelereated (toolkit agnostic), but this shall be expected and satisfying for small amount of 'pixels'.
* Bug 935: NEWT PointerIcon/Visibility: Perform JAWTWindow's ↵Sven Gothel2014-01-052-18/+26
| | | | | | | OffscreenLayerSurface PointerIcon/Visibility tasks async on AWT-EDT setCursor(..) and hideCursor(..) must happen on the AWT-EDT w/o blocking, otherwise we may deadlock the NEWT-EDT.
* Bug 935: NEWT Windows Window-Icon: Use WNDCLASSEX w/ Small/Big Default Icons ↵Sven Gothel2014-01-052-4/+11
| | | | | | | | (NativeWindow GDI / NEWT ) .. this allows using the icon definition of WNDCLASSEX instead of setting them at CreateWindow0(..). - NativeWindow GDIUtil/RegisteredFactory uses WNDCLASSEX and Small/Big Defailt Icons
* Bug 935: NEWT OSX PointerIcon/Pointer-Visibility: Impl. ↵Sven Gothel2014-01-043-0/+85
| | | | | | | | | | OffscreenLayerSurface (OSX CALayer) w/ JAWTWindow Path Add setCursor(..) and hideCursor() to OffscreenLayerSurface interface, impl. in JAWTWindow w/ AWT. This allows an OSX NEWT Window using CALayer (i.e. NewtCanvasAWT) to have setPointerIcon(..) and setPointerVisible(..) functionality!
* Bug 928 - JAWTWindow's JAWTComponentListener _not_ attached and original ↵Sven Gothel2013-12-181-8/+14
| | | | | | | | | | | | | | | | | | visibility state not restored @ detach Commit ebed9f0322e2a2279a525e04ee3875c9034a7f45 (fix for Bug 906) causes a regression to fix for Bug 816, Bug 849 and Bug 889 (OSX CALayer Positioning and JAWTWindow visibility). The commit adds the JAWTComponentListener instance 'jawtComponentListener' to the component before it's assignment (duh!). +++ Further more, detaching the JAWTComponentListener shall restore the component's original 'local visibility state', which might got overridden by it's 'hierarchyChanged' implementation. +++
* Bug 907 - Refine DummyDispatchThread (DDT) Handling: Proper OO integration ↵Sven Gothel2013-11-293-24/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | in RegisteredClass; Safe DDT Post/WaitForReady handling and error cases ; ... Proper OO integration of DDT in RegisteredClass - DDT is optional to RegisteredClass[Factory], i.e. NEWT without DDT and DummyWindow with DDT. - Using native type DummyThreadContext per DDT passed as DDT handle to java referenced in RegisteredClass - Passing DDT handle to related native methods, if not null use DDT - otherwise work on current thread. The latter impacts CreateDummyWindow0 and DestroyWindow0. Safe DDT Post/WaitForReady handling and error cases ; ... - Wait until command it complete using a 3s timeout - Terminate thread if errors occur and throw an exception +++ Discussion: DDT Native Implementation Due to original code, the DDT is implemented in native code. Usually we should favor running the DDT from a java thread. However, since it's main purpose is _not_ to interact w/ java and the native implementation has less footprint (performance and memory) we shall be OK w/ it for now - as long the implementation IS SAFE.
* Bug 907 - Fix regression of 'cleanup' Commit ↵Sven Gothel2013-11-281-0/+1
| | | | 52c95c19dbd69a7fc6b307d2b2db357ceb43ddf5
* Bug 907 - Cleanup Commit e9c711a86aa05f4f24c69972532833f5a98911a3Sven Gothel2013-11-281-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | Cleanup Commit e9c711a86aa05f4f24c69972532833f5a98911a3: - Fix while loop in SendCloseMessage (native) - static 'threadid' must be volatile - Whitespace - Redundancy - CreateDummyWindow - Scope (java, move JNI funcs back to private) - Remove [invalid] pointer usage (native) - ThreadParam's threadReady and hWndPtr shall not be pointers - invalid - No need to use a threadReady pointer. - Validate threadid (native) TODO: - Make 'native dispatch thread' optional - Store 'native dispatch thread' in window class
* Bug 907 - Initial patch allowing Jogl to respond to other applications that ↵Randolf Schultz2013-11-281-11/+8
| | | | try to retrieve window names
* Bug 672 (NewtCanvasSWT): Reuse SWTAccessor.isOS_TYPE ; Impl ↵Sven Gothel2013-11-251-4/+4
| | | | | | | | | | | | | | | | | | | | | NW.getLocationOnScreen(..) for X11 and Windows ; Allow unit test to run on all platforms. - Reuse SWTAccessor.isOS_TYPE (public now) - Impl NW.getLocationOnScreen(..) for X11 and Windows reusing existing native code - Allow unit test to run on all platforms. Note: NewtCanvasSWT unit tests require a 'wait for realized' while SWT dispatching. Otherwise the 'sash unit test' will fail since realiziation happens later, at least on X11. Hence extended AWTRobotUtil.waitForRealized(..) to use a 'waitAction' which is used here w/ special SWT dispatch Runnable. AWTRobotUtil.waitForRealized(..) operates on time-delta instead of iteration-counter, allowing above 'waitAction' Runnable. AWTRobotUtil.waitForRealized(..) removed 2nd 'glad.isRealized()' loop ..