aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
Commit message (Collapse)AuthorAgeFilesLines
* NewtCanvasAWT: Fix NPE (regression from commit ↵Sven Gothel2011-11-091-2/+4
| | | | 46542168d64b37f544f61802693f15b59b224e4e)
* NativeWindow: SurfaceChangeable::setSize() -> surfaceSizeChanged() to avoid ↵Sven Gothel2011-11-091-0/+4
| | | | | | | | | | | | conflicts with setSize() This fixes the NEWT OffscreenWindow conflict w/ setSize() which represents the action of changing the window's size. SurfaceChangeable's surfaceSizeChanged() merily notifies the actual size. JAWTWindow: Remove setSize() since it propagates the surface size upstream only. MacOSXJAWTWindow is not SurfaceChangeable complete (no surfaceSizeChanged).
* Fix regression: setScreen(..) invalid ref count & flagSven Gothel2011-11-091-25/+6
| | | | | | Undo parts of commits in this regard: - 46542168d64b37f544f61802693f15b59b224e4e: move method back to ReparentAction - f51e3dad6c4bd1f6d0001cecf6a0f692400ed602: remove added ref counter / flag
* OS X Layered View: Part5 NEWT/AWT Interaction ; Fix NSOpenGLLayer pos ; CleanupSven Gothel2011-11-095-78/+191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better JAWT* name for offscreen layer surface: - MacOSXCGLDrawableFactory, JAWTUtil, JAWTWindow, MacOSXJAWTWindow - FIXME: Need to get rid of the cached JAWT instance, in case we like to have dual usage of offscreenLayerSurface and onscreen. This would be done implicit by using NEWT .. hence low prio. AWTGraphicsConfiguration: - Fix create(): Use capsRequested for AWT aligned caps if capsChosen is null. (was capsChosen .. which is null) - Add updateGraphicsConfiguration() which allows to update the AWTGraphicsConfiguration. NewtFactoryAWT: - Add updateGraphicsConfiguration() .. entrypoint for AWTGraphicsConfiguration.updateGraphicsConfiguration() NSOpenGLLayer Impl: - For 'some reason' the layer's position is initially negative, fix it @ 1st 'draw' - Re-add CVDisplayLink OpenGL setting .. for what it's worth .. I don't know JAWTWindow: - Remove test setting: Only enable offscreenLayerSurface for applets if avail. (New unit test enables it seperatly) NewtCanvasAWT: - If NEWT child is offscreen, attach AWTMouseAdapter and AWTKeyAdapter to route these AWT input events to NEWT. - Don't loose-focus if NEWT child is offscreen. - Impl. NativeSurfaceHolder, NativeWindowHolder - NativeWindow is created at construction and it's GraphicsConfiguration updated at addNotify(..). - At addNotify/reparent: try harder to determine proper NEWT child size: - use preferred size if set - use minimum size if set - subtract insets from container size OffscreenWindow/WindowImpl: - Allow setSize() .. currently NOP for offscreen. - WindowImpl: Commented out recreate case for offscreen-setSize .. TEST: com.jogamp.opengl.test.junit.newt.parenting.TestParentingOffscreenLayer01AWT Passed tests: - GLCanvas - NewtCanvasAWT/OffscreenWindow
* OS X Layered View: Part4 NEWT OffscreenWindow/WindowImpl fixSven Gothel2011-11-092-9/+24
| | | | | | | | | | | | | | | | | | | WindowImpl: - Impl. NativeSurfaceHolder/NativeWindowHolder 'hooks' - setScreen() utilize proper screen reference count/destruction: - set 'screenReferenceAdded=true' and incr. ref-count, hence next destroy() properly decr. ref-count (may destuct screen). OffscreenWindow: - Allow parent window handle (simply ignore it) Otherwise we could not use OffscreenWindow for parenting tests. - Fix setSize() propaget if !isNativeValid() instead of !isVisible(), otherwise lazy initialization doesn't work. - Allow reconfigureWindowImpl() to pass flags other than visible, simply ignore them.
* NativeWindow: Add accessor interfaces NativeSurfaceHolder and NativeWindowHolderSven Gothel2011-11-091-1/+15
| | | | | | | | | | | | | | | | | - NativeSurfaceHolder interface allows access to it's implementation's NativeSurface reference. - NativeWindowHolder interface allows access to it's implementation's NativeWindow reference. Implement or extend interface w/ these accessors whereever it seems fit: - NEWT Window - GLDrawable These accessors allow lower layers to retrieve the NativeSurface/Window instance w/o knowledge of the 'upper' frameworks, ie. NativeWindow/JOGL or JOGL/NEWT. Commited in followups (due to mixed semantical changes in those files): - JAWTWindow - NewtCanvasAWT - Some NEWT impl.
* NativeWindow/JOGL: NativeSurface adds add/remove SurfaceUpdateListenerSven Gothel2011-11-063-98/+12
| | | | - SurfaceUpdateHelper contains impl. used by NativeSurface implementations.
* Impl layeredSurface (java/native):Sven Gothel2011-11-051-0/+2
| | | | | | | | - OSXUtil: NSView backing creation - OSXUtil: AttachJAWTSurfaceLayer - MacOSXCGLContext.create(): Attach NSOpenGLLayer if layered - MacOSXCGLDrawable.updateHandle(): if direct: add NSView backing layer - MacOSXCGLDrawable: Add getNSViewHandle() to distinguish between NSView and none (CGL/pbuffer)
* OSX: CGL type cleanup ; layeredSurface impl.Sven Gothel2011-11-052-16/+17
| | | | | | | | | - Use proper OSX types for NS/CGL prototypes (gluegen) and impl. - Impl layeredSurface (native): - OSXUtil: NSView backing creation - OSXUtil: AttachJAWTSurfaceLayer - CGL: NSOpenGLLayer type impl. and hook
* NEWT/Applet: Add 'newt.debug.Applet' ; Be more verbose in DEBUG Mode;Sven Gothel2011-10-292-2/+51
|
* NEWT/OSX: Using NewtView softLock ; Adding debug info to solve assertion: ↵Sven Gothel2011-10-271-43/+86
| | | | | | | | | | | | | 'NSThemeFrame lockFocus' NSView.m:6053 - surfaceLock/Unlock: Use NewtView softLock - createWindow: - enable lock/unlockFocus to force realization of view - add retainCount in dbg-msg - clarify changeContentView
* NEWT/OSX NewtView: Add 'soft' pthread locking impacts: ↵Sven Gothel2011-10-272-14/+78
| | | | | | | | needsDisplay/displayIfNeeded, .. - Add 'soft' pthread locking (blockin) - impacts: needsDisplay/displayIfNeeded, .. - needsDisplay/displayIfNeeded also respects destroyNotifySend (ignore action if set)
* NEWT/OSX: Refine comment for native requestFocus(); Remove warningSven Gothel2011-10-261-2/+5
|
* NEWT/OSX: Can't use sending key/mouse directly to WindowImpl, deadlock .. ↵Sven Gothel2011-10-261-1/+7
| | | | see comment
* NEWT/OSX: Add missing sendKeyEvent(..) specialization to produce the keyCode ↵Sven Gothel2011-10-261-1/+10
| | | | (like enqueueKeyEvent())
* Partially revert cba9a070f9649bec42627631d393963d548e320c: Skip ↵Sven Gothel2011-10-232-23/+23
| | | | focusAction() and native focus request on X11/Windows. On both platforms it's not required (proper focus traversion) and AWT would deadlock on Windows
* NEWT/ScreenMode: Make getCurrenctScreenMode..() more fail proof in case the ↵Sven Gothel2011-10-232-15/+31
| | | | (native) impl. doesn't work.
* Newt/OSX: Disable VERBOSESven Gothel2011-10-221-1/+1
|
* NEWT/Native RequestFocus: Even if owning focus, run the focusAction() call ↵Sven Gothel2011-10-223-34/+35
| | | | incl. native focus request (X11, Windows, OSX)
* NewtCanvasAWT: Cleanup / Remove FIXME tag (impl. is ok)Sven Gothel2011-10-221-6/+2
|
* NEWT/MacOSX: Fix resignKeyWindow super call. Summarize ↵Sven Gothel2011-10-222-44/+15
| | | | sendFocusLost/sendFocusGained -> focusChanged
* NEWT/ScreenMode: If unimplemented have at least current mode in list. ↵Sven Gothel2011-10-222-74/+86
| | | | Current mode uses ScreenSize w/ dummy values if unimplemented.
* Remove warningsSven Gothel2011-10-201-1/+5
|
* NEWT/OSX: Attempt to stabilize native parenting (ie w/ AWT) ; Add ↵Sven Gothel2011-10-204-100/+174
| | | | | | | | | | | | | | | | | windowRepaint() callback - act on positionChanged(..) only for realized windows, otherwise we could end in an AWT deadlock (AWT parent window). - add view parenting calls (addSubView/removeFromSuperview) - attachToParent after view configuration - allow concurrently view draw - add windowRepaint() callback (native -> java) - add more debug tracing
* Only revert ScreenMode (destroy/shutdown) if owner (Screen) changed itSven Gothel2011-10-193-11/+36
|
* NEWT/OSX: Adding 'fake' lockSurface based on [view canDraw]. Can't use ↵Sven Gothel2011-10-162-6/+53
| | | | lockFocus(), deadlocks since we render separate to focus mgmt.
* NEWT/OSX: Send events direct w/o EDT queue (like X11 and Win32)Sven Gothel2011-10-161-10/+28
|
* NEWT/OSX: Proper impl. of NEWT's focus management (fixes NEWT/AWT focus ↵Sven Gothel2011-10-165-34/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | behavior/tests) - Old code was just requesting the focus and made the window upfront and notifying a gained focus to WindowImpl. (hack) - Using proper requestFocus impl. issuing focusAction() and utilizing native focus gained/lost messages. This distinguish between 'makeKey' and 'orderFront'. Also requesting and accepting (view) first responder role, which is a precursor to proper gained/lost focus handling on OSX. - NEWTCanvasAWT: Adding 'steal AWT focus': +++ void requestFocus() { super.requestFocus(); // AWT < steal AWT focus > NEWTChild.requestFocus() } +++ Helps make the focus traversal between NEWT/AWT more reliable. Happend on OSX that AWT (NewtCanvasAWT instance) didn't release the focus after NEWT child gained the same. We are not able to use the 'focusAction()' here (disabled in this code path) due to AWT-EDT blocking and recursive focus changes. The latter is also intendend to request the AWT focus first .. - AWT/NEWT focus test 01 passes on OSX
* NEWT/OSX: exec. makeKeyAndOrderFront/makeKeyWindow on MainThreadSven Gothel2011-10-161-5/+6
|
* NEWT/OSX: Add mouse enter/exit and pointer features (visible, confined, ↵Sven Gothel2011-10-165-98/+299
| | | | warp) - cleanup pos/coord translations
* NEWT/Mouse: Skip 'move' event w/ same position. Add Enter/Exit eventsSven Gothel2011-10-154-7/+107
| | | | | | | | | | Skip 'mouse move' event w/ same position - On Windows, the OS sends us multiple event w/o change in position, suppress them Add Enter/Exit events incl. synthesize 'enter' event for windows/osx - X11: using native Enter/Leave events - Windows: using native Leave event (tracking) and synthesized enter event - OSX: TODO (required for the confined feature, etc)
* NEWT/Pointer Confined: Dispatch mouse move events before enabled; Only ↵Sven Gothel2011-10-151-3/+12
| | | | | | | | | | | | | | | | | | | request-focus/warp-ptr if enabled Dispatch mouse move events before enabled - Allows user app listener to track to the new centered mouse position before using the confined position. This is important for position change usage. See simplified demo GearsES2 Only request-focus/warp-ptr if enabled - No need to request focus and center mouse if leaving confinement Demo GearsES2: - No need to assume some position changes are erroneous (jumps) due to confinement. - Track unconfined mouse position, allowing confined navigation to have the proper position change value
* Fix NEWT/Pointer Invisible: INVISIBLE_MASK was equal w/ CONFINED_MASK (duh)Sven Gothel2011-10-151-1/+1
|
* NEWT/EDTUtil: Allow get/set poll period, defaults to defaultEDTPollPeriodSven Gothel2011-10-153-5/+32
|
* NEWT/OSX: Fix resize behavior / Cleanup coordinate transormation ↵Sven Gothel2011-10-132-51/+80
| | | | | | | | | | | | (client-space/top-level, child/parent) At resizing a perent window w/ a NEWT OSX child, the window position needs to be updated since it's absolute. Re-adding sending *Changed notifications via the appropriate WindowImpl methods. Turns out they are missing in some parent/child situations (fullscreen for example). Native getLocationOnScreen0(..) queries totalHeight by it's own to have correct values.
* NEWT: Filter Window focusChanged() and visibleChanged() [test if value changed]Sven Gothel2011-10-131-12/+16
|
* GLCanvas / GLWindow: Change 'manual' resize/repaint animation filterSven Gothel2011-10-131-2/+2
| | | | | | We not only shall skip windowing system triggered repaint if another animation thread is running, but also if the current thread is the animator thread. This keeps the animator intervals stable while resizing.
* NEWT/OSX MacWindow: Use screen of windowSven Gothel2011-10-121-1/+1
|
* Newt/OSX: Fix top/child positioning, positionChanged(), rely on native ↵Sven Gothel2011-10-124-50/+120
| | | | | | | | | | | | pos/size notifications Newt/MacWindow - remove redundant manual window-move/set-size code - Use local getLocationOnScreen(..), fixes positionChanged(..) - setFrameTopLeftPoint(..) use totalHeight (w/ insets) - create: don't 'retain' the window reference (ref counter) - close: release view, - cache insets - to be used @ create
* OSX Minor Cleanups: ctx delete note (freeze when shared ctx), Better ↵Sven Gothel2011-10-121-6/+14
| | | | MainThread Thread name[s]
* NEWT OSX: Disable native VERBOSITYSven Gothel2011-10-121-1/+1
|
* NEWTCanvasAWT: Add AWT GraphicsConfiguration in constructor, allowing ↵Sven Gothel2011-10-121-0/+16
| | | | transparency
* Fix Nativewindow GetLocationOnScreen OSX impl. - Transform OSX origin ↵Sven Gothel2011-10-121-1/+1
| | | | bottom-left to our top-left origin.
* NEWT/OSX: Fix erroneous child Window position and top-parent visibilitySven Gothel2011-10-112-73/+90
| | | | | | | | | | | | | | | | | - Regardless whether the window is a top-level or child window, we set it's position w/ absolut left-bottom coordinated. To do so even for an AWT parent component, we retrieve the screen position by traversing through the AWT tree and adding up each parent's rel. position, since the native view only reflects the AWT frame. Note: OSX does not use native views for each AWT component. - In case we reparent child -> top, we cannot orderOut() the ex parent, but need to just call orderBack(..), otherwise the whole ex-parent frame gets hidden. - In case we close a child window (and reparent child -> top), we need to remove the parent/child relation and orderOut(..) before close(..), otherwise the window artifact is left behind.
* NEWT Pointer Mods: Propagate 'confined' and 'invisible' to modifier mask of ↵Sven Gothel2011-10-115-15/+51
| | | | | | | | | | InputEvent (Mouse) ; Test confined navigation w/ GearsES2 InputEvent adds new MASK values: CONFINED_MASK and INVISIBLE_MASK, set at event creation allowing convenient testing of these mods. GearsES2 demonstrates the confined navigation testing the CONFINED_MASK and if having his mode acting on mouseMoved(..) and reset the mouse position.
* NEWT Pointer Feature: Add Windows impl. ; Fix test (warp action) ; Minor ↵Sven Gothel2011-10-106-14/+136
| | | | cleanup in X11
* NEWT: Add pointer features: visibility, confined and warp (move)Sven Gothel2011-10-107-36/+237
| | | | | | | | | | | | | | | visibility: - set pointer visible or invisible confined: - confine pointer to window, or not warp: - set mouse position within the window Implemented for X11, tested manually with TestGearsES2NEWT (see code for action keys). TODO: Windows, MaxOSX and Android (limited)
* GLWindow/GLDrawableHelper: Adding experimental notion of skipping GL context ↵Sven Gothel2011-10-082-5/+30
| | | | | | | | | | | | | release for a specific thread - marked deprecated - used to perf measure situation on omap3, ie figuring out where the low perf. in GearsES2 comes from, our core JOGL code or the GL usage. Turns out it's the GL usage itself, ie the shader - good. - calls are commented out in the demos
* NEWT/Android: Fix setting 'format'Sven Gothel2011-10-071-11/+12
|
* NEWT/Android: respect isUndecorated() and custom window size.Sven Gothel2011-10-061-37/+40
| | | | TODO: custom position and change position ?!