aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt/classes
Commit message (Collapse)AuthorAgeFilesLines
* 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)
* NEWT/Applet: Add 'newt.debug.Applet' ; Be more verbose in DEBUG Mode;Sven Gothel2011-10-292-2/+51
|
* NEWT/OSX: Add missing sendKeyEvent(..) specialization to produce the keyCode ↵Sven Gothel2011-10-261-1/+10
| | | | (like enqueueKeyEvent())
* NEWT/ScreenMode: Make getCurrenctScreenMode..() more fail proof in case the ↵Sven Gothel2011-10-231-15/+26
| | | | (native) impl. doesn't work.
* NewtCanvasAWT: Cleanup / Remove FIXME tag (impl. is ok)Sven Gothel2011-10-221-6/+2
|
* 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.
* NEWT/OSX: Attempt to stabilize native parenting (ie w/ AWT) ; Add ↵Sven Gothel2011-10-201-12/+13
| | | | | | | | | | | | | | | | | 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-161-6/+19
| | | | lockFocus(), deadlocks since we render separate to focus mgmt.
* NEWT/OSX: Proper impl. of NEWT's focus management (fixes NEWT/AWT focus ↵Sven Gothel2011-10-162-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Add mouse enter/exit and pointer features (visible, confined, ↵Sven Gothel2011-10-162-28/+50
| | | | warp) - cleanup pos/coord translations
* NEWT/Mouse: Skip 'move' event w/ same position. Add Enter/Exit eventsSven Gothel2011-10-152-4/+47
| | | | | | | | | | 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-131-42/+63
| | | | | | | | | | | | (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: Fix top/child positioning, positionChanged(), rely on native ↵Sven Gothel2011-10-121-18/+9
| | | | | | | | | | | | 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]
* NEWTCanvasAWT: Add AWT GraphicsConfiguration in constructor, allowing ↵Sven Gothel2011-10-121-0/+16
| | | | transparency
* NEWT/OSX: Fix erroneous child Window position and top-parent visibilitySven Gothel2011-10-111-39/+26
| | | | | | | | | | | | | | | | | - 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-104-8/+57
| | | | cleanup in X11
* NEWT: Add pointer features: visibility, confined and warp (move)Sven Gothel2011-10-106-36/+161
| | | | | | | | | | | | | | | 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 ?!
* NEWT/Window/setVisible: Remove setVisible(..) fast path - Always set ↵Sven Gothel2011-10-061-8/+2
| | | | | | | visible=true, even if size==0 We need to earmark visible=true in case the native window could not be created, even if the size is currently 0.
* NEWT/Android: Add TRANSLUCENT feature / Demo: 'GearsES2T'Sven Gothel2011-10-061-3/+6
|
* NEWT/Android: Add BUTTON1 for one-pointer eventsSven Gothel2011-10-061-2/+4
|
* NEWT/Android: Move fullscreen setting to AndroidWindow ; Cleanup AndroidWindowSven Gothel2011-10-062-53/+67
|
* Android/EGL: dump all caps, write-back formatSven Gothel2011-10-011-2/+10
|
* NEWT/Android: 565, 5551 or RGBA_8888 (no RGBX/888) ; surfaceRealized() ASAPSven Gothel2011-10-012-31/+48
|
* AndroidWindow: get required PixelFormat ID by req. CapsSven Gothel2011-09-302-4/+48
|
* Android: Use standard launch mode; Add default actions to NewtBaseActivity; ↵Sven Gothel2011-09-302-51/+26
| | | | Add RedSquare ES1 + ES2
* NEWT/Android: More ANativeWindow coop;Sven Gothel2011-09-301-48/+108
| | | | | | | | | | | | | | | | Note: surface's format _is_ the nativeVisualID of EGL. More ANativeWindow (ANW) coop: - add acquire/release for ANW - validate ANW format - Add fixCaps: 'format -> GLCaps' validation Test: - Constructor: Start w/ surface format RGB_565 (default) - createNative: Filter EGLConfig w/ surface format - Move surfaceHandle fetching from surfaceCreated -> surfaceChanged, where the format is available. - surfaceChanged: use fixedCaps validation
* NEWT DisplayImpl: Check for null event in taskSven Gothel2011-09-281-0/+6
|
* NewtBaseActivity: Enable 'slave' mode, ie as a downstream for external ↵Sven Gothel2011-09-281-11/+42
| | | | launched Activity, see NewtLauncherActivity
* NEWT/Android: Send MouseClicked event, MouseEvent enhancement, Demo: real 2 ↵Sven Gothel2011-09-283-16/+114
| | | | | | | | finger zoom MouseEvent: Check array sizes at cstr. Enhance 'toString()', pointer arrays added. GPUUISceneGLListener0A now uses 2 finger distance for zoom
* NEWT/OSX: 'Better' child window positioning, still, after reparenting into ↵Sven Gothel2011-09-272-2/+9
| | | | | | | | | parent, a white window rectangle remains. .. we also need to understand the absolute screen position better, ie. when required and when not (at window creation currently).
* NEWT/Threading: MainThread / DefaultEDTUtilSven Gothel2011-09-275-224/+94
| | | | | | | | | | | | | | | | | | | | | | | - MainThread: This class no more implements EDTUtil! This class just provides a main-thread utility, forking of a main java class on another thread while being able to continue doing platform specific things on the main-thread. The latter is essential for eg. MacOSX, where we continue to run NSApp.run(). - DefaultEDTUtil: - if Lock.DEBUG validate that no recursive locks are being hold, where it shall not (EDT: startup and return from task execution) - If task execution's result wasn't waited for (checked), at least dump exeception's stack trace if i happened. - MacDisplay: Just use DefaultEDTUtil - MacWindow: - No more need of special locking -> removed nsViewLock, since: - using proper EDT - capability to run from multiple threads (native Java thread attachment)
* NEWT: Adapt to GlueGen's Lock ChangeSet, all java callbacks for native have ↵Sven Gothel2011-09-279-54/+69
| | | | | | | | | | | | | | 'defer' 1st argument - Adapt to GlueGen's Lock ChangeSet: e4baba27507ce78e64a150ec6f69fb96f5721a34 - All java callbacks for native have 'defer' 1st argument. This allows enqueuing resulting events to the EDT if required, ie. the native thread may not be 'compatible' (MacOSX). - MacOSX-Native: enqueue key/mouse events and defer:=true for all java callbacks Since we are comming from a 3rd-party thread (AWT/NSApp-MainThread) we shall not abuse it.
* NEWT/JOGL: MacOSX UpdateSven Gothel2011-09-256-364/+255
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Feature related: - Added always-on-top - Added translucency - Child Window Position - AWT parent: manual traverse up the tree and calc position on screen (Problem: the parent view rect is not at the proper position, but covers the whole frame) EDTUtil related: - Works now w/ AWT ot headless (again) - OSX native JNI callbacks gathering JNIEnv properly and attaches/detaches thread. - AWT case: using AWT-Event which properly dispatches our cocoa events - MainThread (headless) case: Fork off thread w/ main class and kick off NSApp run(). This leads to same behavior as w/ AWT case. - Using DefaultEDTUtil - Cleanup MainThread (implements EDTUtil) - Currently not used as EDTUtil (osx), just as launcher - Removed EDTUtil impl code, reuse DefaultEDTUtil - Cleanup AWTEDTUtil (implements EDTUtil) - Currently not used as EDTUtil (osx)