From 5e9c02bce7b241a0bf95c8abca9a91cd25e51ed3 Mon Sep 17 00:00:00 2001
From: Harvey Harrison
Date: Thu, 17 Oct 2013 22:27:27 -0700
Subject: jogl: remove all trailing whitespace
Signed-off-by: Harvey Harrison
---
src/newt/classes/jogamp/newt/Debug.java | 18 +-
src/newt/classes/jogamp/newt/DefaultEDTUtil.java | 36 +-
src/newt/classes/jogamp/newt/DisplayImpl.java | 66 +--
.../classes/jogamp/newt/MonitorDeviceImpl.java | 28 +-
src/newt/classes/jogamp/newt/MonitorModeProps.java | 44 +-
src/newt/classes/jogamp/newt/NEWTJNILibLoader.java | 16 +-
src/newt/classes/jogamp/newt/OffscreenWindow.java | 28 +-
src/newt/classes/jogamp/newt/ScreenImpl.java | 98 ++--
.../classes/jogamp/newt/ScreenMonitorState.java | 18 +-
src/newt/classes/jogamp/newt/WindowImpl.java | 554 ++++++++++-----------
.../classes/jogamp/newt/awt/NewtFactoryAWT.java | 16 +-
.../jogamp/newt/awt/event/AWTNewtEventFactory.java | 74 +--
.../newt/awt/event/AWTParentWindowAdapter.java | 20 +-
.../jogamp/newt/driver/DriverClearFocus.java | 6 +-
.../jogamp/newt/driver/DriverUpdatePosition.java | 8 +-
.../classes/jogamp/newt/driver/awt/AWTCanvas.java | 40 +-
.../classes/jogamp/newt/driver/awt/AWTEDTUtil.java | 32 +-
.../jogamp/newt/driver/awt/DisplayDriver.java | 16 +-
.../jogamp/newt/driver/awt/ScreenDriver.java | 28 +-
.../jogamp/newt/driver/awt/WindowDriver.java | 50 +-
.../jogamp/newt/driver/bcm/egl/DisplayDriver.java | 12 +-
.../jogamp/newt/driver/bcm/egl/ScreenDriver.java | 20 +-
.../jogamp/newt/driver/bcm/egl/WindowDriver.java | 22 +-
.../newt/driver/bcm/vc/iv/DisplayDriver.java | 10 +-
.../jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java | 22 +-
.../jogamp/newt/driver/bcm/vc/iv/WindowDriver.java | 30 +-
.../newt/driver/intel/gdl/DisplayDriver.java | 12 +-
.../jogamp/newt/driver/intel/gdl/ScreenDriver.java | 22 +-
.../jogamp/newt/driver/intel/gdl/WindowDriver.java | 18 +-
.../jogamp/newt/driver/kd/DisplayDriver.java | 12 +-
.../jogamp/newt/driver/kd/ScreenDriver.java | 26 +-
.../jogamp/newt/driver/kd/WindowDriver.java | 22 +-
.../newt/driver/linux/LinuxEventDeviceTracker.java | 16 +-
.../newt/driver/linux/LinuxMouseTracker.java | 46 +-
.../jogamp/newt/driver/macosx/DisplayDriver.java | 18 +-
.../jogamp/newt/driver/macosx/MacKeyUtil.java | 38 +-
.../jogamp/newt/driver/macosx/ScreenDriver.java | 32 +-
.../jogamp/newt/driver/macosx/WindowDriver.java | 126 ++---
.../jogamp/newt/driver/windows/DisplayDriver.java | 18 +-
.../jogamp/newt/driver/windows/ScreenDriver.java | 28 +-
.../jogamp/newt/driver/windows/WindowDriver.java | 90 ++--
.../jogamp/newt/driver/x11/DisplayDriver.java | 28 +-
src/newt/classes/jogamp/newt/driver/x11/RandR.java | 22 +-
.../classes/jogamp/newt/driver/x11/RandR11.java | 66 +--
.../classes/jogamp/newt/driver/x11/RandR13.java | 60 +--
.../jogamp/newt/driver/x11/ScreenDriver.java | 68 +--
.../jogamp/newt/driver/x11/WindowDriver.java | 92 ++--
.../classes/jogamp/newt/event/NEWTEventTask.java | 10 +-
src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java | 46 +-
.../jogamp/newt/swt/event/SWTNewtEventFactory.java | 48 +-
50 files changed, 1138 insertions(+), 1138 deletions(-)
(limited to 'src/newt/classes/jogamp')
diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java
index 4b0a98216..46a354d4a 100644
--- a/src/newt/classes/jogamp/newt/Debug.java
+++ b/src/newt/classes/jogamp/newt/Debug.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
* You acknowledge that this software is not designed or intended for use
* in the design, construction, operation or maintenance of any nuclear
* facility.
- *
+ *
* Sun gratefully acknowledges that this software was originally authored
* and developed by Kenneth Bradley Russell and Christopher John Kline.
*/
@@ -51,14 +51,14 @@ public class Debug extends PropertyAccess {
// Some common properties
private static final boolean verbose;
private static final boolean debugAll;
-
+
static {
AccessController.doPrivileged(new PrivilegedAction
* @param mode_idx if not null, returns the index of resulting {@link MonitorDevice} within {@link Cache#monitorDevices}.
* @param cache hash arrays of unique {@link MonitorMode} components and {@link MonitorDevice}s, allowing to avoid duplicates
* @param modeProperties the input data
@@ -218,7 +218,7 @@ public class MonitorModeProps {
if(count > monitorProperties.length-offset) {
throw new RuntimeException("properties array too short (count), should be >= "+count+", is "+(monitorProperties.length-offset));
}
- final int limit = offset + count;
+ final int limit = offset + count;
offset++;
final List allMonitorModes = cache.monitorModes.getData();
final int id = monitorProperties[offset++];
@@ -252,7 +252,7 @@ public class MonitorModeProps {
monitor_idx[0] = _monitorIdx;
}
return monitorDevice;
- }
+ }
private static MonitorMode getByNativeIdAndRotation(List monitorModes, int modeId, int rotation) {
if( null!=monitorModes && monitorModes.size()>0 ) {
for (int i=0; i
* This variant expects count to be {@link MIN_MONITOR_DEVICE_PROPERTIES} - 1 - {@link NUM_MONITOR_MODE_PROPERTIES},
- * due to lack of supported mode and current mode.
+ * due to lack of supported mode and current mode.
*
*
* @param mode_idx if not null, returns the index of resulting {@link MonitorDevice} within {@link Cache#monitorDevices}.
@@ -310,7 +310,7 @@ public class MonitorModeProps {
}
return monitorDevice;
}
-
+
/** WARNING: must be synchronized with ScreenMode.h, native implementation */
public static int[] streamOutMonitorDevice (MonitorDevice monitorDevice) {
// min 11: count, id, ScreenSizeMM[width, height], Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
@@ -339,7 +339,7 @@ public class MonitorModeProps {
}
return data;
}
-
+
public final void swapRotatePair(int rotation, int[] pairs, int offset, int numPairs) {
if( MonitorMode.ROTATE_0 == rotation || MonitorMode.ROTATE_180 == rotation ) {
// nop
@@ -347,9 +347,9 @@ public class MonitorModeProps {
}
for(int i=0; i() {
public Boolean run() {
diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java
index 0a302d76b..eba844230 100644
--- a/src/newt/classes/jogamp/newt/OffscreenWindow.java
+++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt;
@@ -50,7 +50,7 @@ import com.jogamp.newt.MonitorDevice;
public class OffscreenWindow extends WindowImpl implements MutableSurface {
long surfaceHandle;
-
+
public OffscreenWindow() {
surfaceHandle = 0;
}
@@ -72,7 +72,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
synchronized(OffscreenWindow.class) {
setWindowHandle(nextWindowHandle++);
}
- visibleChanged(false, true);
+ visibleChanged(false, true);
}
protected void closeNativeImpl() {
@@ -92,7 +92,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
@Override
public long getSurfaceHandle() {
return surfaceHandle;
- }
+ }
protected void requestFocusImpl(boolean reparented) {
}
@@ -101,7 +101,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
public void setPosition(int x, int y) {
// nop
}
-
+
@Override
public boolean setFullscreen(boolean fullscreen) {
return false; // nop
@@ -112,7 +112,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
return false; // nop
}
-
+
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
sizeChanged(false, width, height, false);
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
@@ -137,13 +137,13 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
}
return new Point(0,0);
}
-
+
protected Point getLocationOnScreenImpl(int x, int y) {
return new Point(x,y);
}
-
+
protected void updateInsetsImpl(Insets insets) {
- // nop ..
+ // nop ..
}
}
diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java
index 7068d7464..d7e6c641c 100644
--- a/src/newt/classes/jogamp/newt/ScreenImpl.java
+++ b/src/newt/classes/jogamp/newt/ScreenImpl.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt;
@@ -56,7 +56,7 @@ import com.jogamp.newt.util.MonitorModeUtil;
public abstract class ScreenImpl extends Screen implements MonitorModeListener {
protected static final boolean DEBUG_TEST_SCREENMODE_DISABLED;
-
+
static {
Debug.initSingleton();
DEBUG_TEST_SCREENMODE_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableScreenMode", true);
@@ -67,14 +67,14 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
public static final int default_sm_heightmm = 324;
public static final int default_sm_rate = 60;
public static final int default_sm_rotation = 0;
-
+
static {
DisplayImpl.initSingleton();
}
-
+
/** Ensure static init has been run. */
/* pp */static void initSingleton() { }
-
+
protected DisplayImpl display;
protected int screen_idx;
protected String fqname;
@@ -85,14 +85,14 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
protected static Dimension usrSize = null; // property values: newt.ws.swidth and newt.ws.sheight
protected static volatile boolean usrSizeQueried = false;
private ArrayList refMonitorModeListener = new ArrayList();
-
+
private long tCreated; // creationTime
- private static Class> getScreenClass(String type) throws ClassNotFoundException
+ private static Class> getScreenClass(String type) throws ClassNotFoundException
{
final Class> screenClass = NewtFactory.getCustomClass(type, "ScreenDriver");
if(null==screenClass) {
- throw new ClassNotFoundException("Failed to find NEWT Screen Class <"+type+".ScreenDriver>");
+ throw new ClassNotFoundException("Failed to find NEWT Screen Class <"+type+".ScreenDriver>");
}
return screenClass;
}
@@ -104,7 +104,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
if(!usrSizeQueried) {
usrSizeQueried = true;
final int w = Debug.getIntProperty("newt.ws.swidth", true, 0);
- final int h = Debug.getIntProperty("newt.ws.sheight", true, 0);
+ final int h = Debug.getIntProperty("newt.ws.sheight", true, 0);
if(w>0 && h>0) {
usrSize = new Dimension(w, h);
System.err.println("User screen size "+usrSize);
@@ -135,7 +135,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
System.err.println("Screen.create() NEW: "+screen+" "+Display.getThreadName());
}
return screen;
- }
+ }
} catch (Exception e) {
throw new RuntimeException(e);
}
@@ -167,16 +167,16 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
@Override
public synchronized final void createNative()
throws NativeWindowException
- {
+ {
if(null == aScreen) {
if(DEBUG) {
tCreated = System.nanoTime();
System.err.println("Screen.createNative() START ("+DisplayImpl.getThreadName()+", "+this+")");
} else {
tCreated = 0;
- }
+ }
display.addReference();
-
+
createNativeImpl();
if(null == aScreen) {
throw new NativeWindowException("Screen.createNative() failed to instanciate an AbstractGraphicsScreen");
@@ -249,7 +249,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
protected abstract void createNativeImpl();
protected abstract void closeNativeImpl();
-
+
/**
* Returns the validated screen index, which is either the passed idx
* value or 0.
@@ -258,23 +258,23 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
*
*/
protected abstract int validateScreenIndex(int idx);
-
+
/**
* Stores the virtual origin and virtual rotated screen size.
*
- * This method is called after the MonitorMode has been set or changed,
+ * This method is called after the MonitorMode has been set or changed,
* hence you may utilize it.
*
*
* Default implementation uses the union of all monitor's viewport,
- * calculated via {@link #unionOfMonitorViewportSize()}.
+ * calculated via {@link #unionOfMonitorViewportSize()}.
*
* @param vOriginSize storage for result
*/
- protected void calcVirtualScreenOriginAndSize(final Rectangle vOriginSize) {
+ protected void calcVirtualScreenOriginAndSize(final Rectangle vOriginSize) {
unionOfMonitorViewportSize(vOriginSize);
}
-
+
@Override
public final String getFQName() {
return fqname;
@@ -335,15 +335,15 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
//
- // MonitorDevice and MonitorMode
+ // MonitorDevice and MonitorMode
//
-
+
/**
* To be implemented by the native specification.
* Is called within a thread safe environment.
* Is called only to collect the {@link MonitorMode}s and {@link MonitorDevice}s, usually at startup setting up modes.
*
- * WARNING: must be synchronized with
+ * WARNING: must be synchronized with
*
*
{@link MonitorModeProps#NUM_SCREEN_MODE_PROPERTIES} and
@@ -356,19 +356,19 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
* @param cache memory pool caching the result
*/
protected abstract void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache);
-
+
protected Rectangle getNativeMonitorDeviceViewportImpl(MonitorDevice monitor) { return null; }
-
+
/**
* To be implemented by the native specification.
* Is called within a thread safe environment.
*
- * Implementation shall not unify the result w/ monitor's supported modes or a locally
+ * Implementation shall not unify the result w/ monitor's supported modes or a locally
* saved {@link MonitorModeProps.Cache}, since caller will perform such tasks.
*
*/
protected abstract MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor);
-
+
/**
* To be implemented by the native specification.
* Is called within a thread safe environment.
@@ -378,13 +378,13 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
@Override
public final List getMonitorModes() {
final ScreenMonitorState sms = getScreenMonitorStatus(false);
- return null != sms ? sms.getMonitorModes().getData() : null;
+ return null != sms ? sms.getMonitorModes().getData() : null;
}
-
+
@Override
public final List getMonitorDevices() {
final ScreenMonitorState sms = getScreenMonitorStatus(false);
- return null != sms ? sms.getMonitorDevices().getData() : null;
+ return null != sms ? sms.getMonitorDevices().getData() : null;
}
final ScreenMonitorState getScreenMonitorStatus(boolean throwException) {
@@ -395,7 +395,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
return res;
}
-
+
@Override
public void monitorModeChangeNotify(MonitorEvent me) {
if(DEBUG) {
@@ -417,9 +417,9 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
if( null != newViewport ) {
monitor.setViewportValue(newViewport);
}
- }
+ }
}
-
+
@Override
public void monitorModeChanged(MonitorEvent me, boolean success) {
if(success) {
@@ -443,9 +443,9 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
public synchronized final void removeMonitorModeListener(MonitorModeListener sml) {
refMonitorModeListener.remove(sml);
}
-
+
/**
- *
+ *
* @param cache optional ..
* @param modeId
* @return
@@ -468,7 +468,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
/**
- *
+ *
* @param cache mandatory !
* @param monitorId
* @param currentMode
@@ -493,7 +493,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
return MonitorModeProps.streamInMonitorDevice(null, cache, this, props, 0);
}
-
+
/**
* Utilizes {@link #getCurrentMonitorModeImpl()}, if the latter returns null it uses
* the current screen size and dummy values.
@@ -530,7 +530,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
sms = ScreenMonitorState.getScreenMonitorState(this.getFQName());
if(null==sms) {
final MonitorModeProps.Cache cache = new MonitorModeProps.Cache();
- if( 0 >= collectNativeMonitorModes(cache) ) {
+ if( 0 >= collectNativeMonitorModes(cache) ) {
updateVirtualScreenOriginAndSize();
vScrnSizeUpdated = true;
final MonitorMode mode = getVirtualMonitorMode(cache, 0);
@@ -557,7 +557,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
System.err.println("["+i+"]["+j+"]: "+iMode.next());
}
}
- }
+ }
sms = new ScreenMonitorState(cache.monitorDevices, cache.monitorModes);
ScreenMonitorState.mapScreenMonitorState(this.getFQName(), sms);
}
@@ -580,7 +580,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
* Collects {@link MonitorDevice}s and {@link MonitorMode}s within the given cache.
*
*/
- private final int collectNativeMonitorModes(MonitorModeProps.Cache cache) {
+ private final int collectNativeMonitorModes(MonitorModeProps.Cache cache) {
if(!DEBUG_TEST_SCREENMODE_DISABLED) {
collectNativeMonitorModesAndDevicesImpl(cache);
}
@@ -639,12 +639,12 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
} finally {
sms.unlock();
}
- }
+ }
} finally {
ScreenMonitorState.unlockScreenMonitorState();
}
}
-
+
private final void shutdown() {
ScreenMonitorState sms = ScreenMonitorState.getScreenMonitorStateUnlocked(getFQName());
if(null != sms) {
@@ -661,11 +661,11 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
}
}
ScreenMonitorState.unmapScreenMonitorStateUnlocked(getFQName());
- }
+ }
}
-
+
/** pp */ static final void shutdownAll() {
- final int sCount = screenList.size();
+ final int sCount = screenList.size();
if(DEBUG) {
System.err.println("Screen.shutdownAll "+sCount+" instances, on thread "+Display.getThreadName());
}
diff --git a/src/newt/classes/jogamp/newt/ScreenMonitorState.java b/src/newt/classes/jogamp/newt/ScreenMonitorState.java
index 66e75be16..01e6cfee9 100644
--- a/src/newt/classes/jogamp/newt/ScreenMonitorState.java
+++ b/src/newt/classes/jogamp/newt/ScreenMonitorState.java
@@ -42,7 +42,7 @@ import java.util.HashMap;
public class ScreenMonitorState {
private static boolean DEBUG = Screen.DEBUG;
-
+
private final RecursiveLock lock = LockFactory.createRecursiveLock();
private final ArrayHashSet allMonitors;
private final ArrayHashSet allMonitorModes;
@@ -105,21 +105,21 @@ public class ScreenMonitorState {
protected static void unlockScreenMonitorState() {
screen2ScreenMonitorState.unlock();
}
-
+
public ScreenMonitorState(ArrayHashSet allMonitors,
ArrayHashSet allMonitorModes) {
- this.allMonitors = allMonitors;
+ this.allMonitors = allMonitors;
this.allMonitorModes = allMonitorModes;
}
- protected ArrayHashSet getMonitorDevices() {
+ protected ArrayHashSet getMonitorDevices() {
return allMonitors;
}
-
- protected ArrayHashSet getMonitorModes() {
+
+ protected ArrayHashSet getMonitorModes() {
return allMonitorModes;
}
-
+
protected final int addListener(MonitorModeListener l) {
lock();
try {
@@ -151,14 +151,14 @@ public class ScreenMonitorState {
protected final MonitorDevice getMonitor(MonitorDevice monitor) {
return allMonitors.get(monitor);
}
-
+
protected final void validateMonitor(MonitorDevice monitor) {
final MonitorDevice md = allMonitors.get(monitor);
if( null == md ) {
throw new InternalError("Monitor unknown: "+monitor);
}
}
-
+
protected final void fireMonitorModeChangeNotify(MonitorDevice monitor, MonitorMode desiredMode) {
lock();
try {
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index a35d89408..a0ef8816b 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt;
@@ -87,19 +87,19 @@ import jogamp.nativewindow.SurfaceUpdatedHelper;
public abstract class WindowImpl implements Window, NEWTEventConsumer
{
public static final boolean DEBUG_TEST_REPARENT_INCOMPATIBLE;
-
+
static {
Debug.initSingleton();
DEBUG_TEST_REPARENT_INCOMPATIBLE = Debug.isPropertyDefined("newt.test.Window.reparent.incompatible", true);
-
+
ScreenImpl.initSingleton();
}
-
- protected static final ArrayList> windowList = new ArrayList>();
-
+
+ protected static final ArrayList> windowList = new ArrayList>();
+
/** Maybe utilized at a shutdown hook, impl. does not block. */
public static final void shutdownAll() {
- final int wCount = windowList.size();
+ final int wCount = windowList.size();
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.shutdownAll "+wCount+" instances, on thread "+getThreadName());
}
@@ -132,25 +132,25 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
}
-
+
/** Timeout of queued events (repaint and resize) */
- static final long QUEUED_EVENT_TO = 1200; // ms
+ static final long QUEUED_EVENT_TO = 1200; // ms
private static final PointerType[] constMousePointerTypes = new PointerType[] { PointerType.Mouse };
-
+
//
// Volatile: Multithread Mutable Access
- //
+ //
private volatile long windowHandle = 0; // lifecycle critical
private volatile boolean visible = false; // lifecycle critical
- private volatile boolean hasFocus = false;
+ private volatile boolean hasFocus = false;
private volatile int width = 128, height = 128; // client-area size w/o insets, default: may be overwritten by user
private volatile int x = 64, y = 64; // client-area pos w/o insets
private volatile Insets insets = new Insets(); // insets of decoration (if top-level && decorated)
-
+
private RecursiveLock windowLock = LockFactory.createRecursiveLock(); // Window instance wide lock
private int surfaceLockCount = 0; // surface lock recursion count
-
+
private ScreenImpl screen; // never null after create - may change reference though (reparent)
private boolean screenReferenceAdded = false;
private NativeWindow parentWindow = null;
@@ -162,7 +162,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private List fullscreenMonitors = null;
private boolean fullscreenUseMainMonitor = true;
private boolean autoPosition = true; // default: true (allow WM to choose top-level position, if not set by user)
-
+
private int nfs_width, nfs_height, nfs_x, nfs_y; // non fullscreen client-area size/pos w/o insets
private NativeWindow nfs_parent = null; // non fullscreen parent, in case explicit reparenting is performed (offscreen)
private String title = "Newt Window";
@@ -178,26 +178,26 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private KeyListener keyboardFocusHandler = null;
private SurfaceUpdatedHelper surfaceUpdatedHelper = new SurfaceUpdatedHelper();
-
+
private Object childWindowsLock = new Object();
private ArrayList childWindows = new ArrayList();
private ArrayList mouseListeners = new ArrayList();
-
+
/** from event passing: {@link WindowImpl#consumePointerEvent(MouseEvent)}. */
private static class PointerState0 {
/** mouse entered window - is inside the window (may be synthetic) */
boolean insideWindow = false;
-
+
/** last time when a mouse button was pressed */
long lastButtonPressTime = 0;
-
+
void clearButton() {
lastButtonPressTime = 0;
}
}
private PointerState0 pState0 = new PointerState0();
-
+
/** from direct input: {@link WindowImpl#doPointerEvent(boolean, boolean, int[], short, int, int, boolean, short[], int[], int[], float[], float, float[], float)}. */
private static class PointerState1 extends PointerState0 {
/** current pressed mouse button number */
@@ -206,15 +206,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
int buttonPressedMask = 0;
/** last mouse button click count */
short lastButtonClickCount = (short)0;
-
+
final void clearButton() {
super.clearButton();
lastButtonPressTime = 0;
- lastButtonClickCount = (short)0;
+ lastButtonClickCount = (short)0;
buttonPressed = 0;
- buttonPressedMask = 0;
+ buttonPressedMask = 0;
}
-
+
/** last pointer-move position for 8 touch-down pointers */
final Point[] movePositions = new Point[] {
new Point(), new Point(), new Point(), new Point(),
@@ -227,16 +227,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
private PointerState1 pState1 = new PointerState1();
-
+
/** pointer names -> pointer ID (consecutive index, starting w/ 0) */
private final ArrayHashSet pName2pID = new ArrayHashSet();
-
+
private boolean defaultGestureHandlerEnabled = true;
private DoubleTapScrollGesture gesture2PtrTouchScroll = null;
private ArrayList pointerGestureHandler = new ArrayList();
-
+
private ArrayList gestureListeners = new ArrayList();
-
+
private ArrayList keyListeners = new ArrayList();
private ArrayList windowListeners = new ArrayList();
@@ -267,7 +267,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
{
final Class> windowClass = NewtFactory.getCustomClass(type, "WindowDriver");
if(null==windowClass) {
- throw new ClassNotFoundException("Failed to find NEWT Window Class <"+type+".WindowDriver>");
+ throw new ClassNotFoundException("Failed to find NEWT Window Class <"+type+".WindowDriver>");
}
return windowClass;
}
@@ -293,7 +293,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
throw new NativeWindowException(t);
}
}
-
+
public static WindowImpl create(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
try {
Class> windowClass = getWindowClass(screen.getDisplay().getType());
@@ -329,11 +329,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
hasFocus = false;
parentWindowHandle = 0;
}
-
+
protected final void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg) {
config = cfg;
}
-
+
public static interface LifecycleHook {
/**
* Reset of internal state counter, ie totalFrames, etc.
@@ -341,8 +341,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
*/
public abstract void resetCounter();
- /**
- * Invoked after Window setVisible,
+ /**
+ * Invoked after Window setVisible,
* allows allocating resources depending on the native Window.
* Called from EDT while window is locked.
*/
@@ -354,9 +354,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @param value true to set the one-shot preservation if supported, otherwise clears it.
*/
void preserveGLStateAtDestroy(boolean value);
-
- /**
- * Invoked before Window destroy action,
+
+ /**
+ * Invoked before Window destroy action,
* allows releasing of resources depending on the native Window.
* Surface not locked yet.
* Called not necessarily from EDT.
@@ -388,12 +388,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @see #pauseRenderingAction()
*/
void resumeRenderingAction();
-
+
/**
* Shutdown rendering action (thread) abnormally.
*
* Should be called only at shutdown, if necessary.
- *
+ *
*/
void shutdownRenderingAction();
}
@@ -406,14 +406,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
} else {
tStart = 0;
}
-
- if( null != parentWindow &&
+
+ if( null != parentWindow &&
NativeSurface.LOCK_SURFACE_NOT_READY >= parentWindow.lockSurface() ) {
throw new NativeWindowException("Parent surface lock: not ready: "+parentWindow);
}
-
+
// child window: position defaults to 0/0, no auto position, no negative position
- if( null != parentWindow && ( autoPosition || 0>getX() || 0>getY() ) ) {
+ if( null != parentWindow && ( autoPosition || 0>getX() || 0>getY() ) ) {
definePosition(0, 0);
}
boolean postParentlockFocus = false;
@@ -556,28 +556,28 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
/**
* Notifies the driver impl. that the instantiation is finished,
- * ie. instance created and all fields set.
+ * ie. instance created and all fields set.
*/
protected void instantiationFinished() {
// nop
}
-
+
protected boolean canCreateNativeImpl() {
return true; // default: always able to be created
}
-
- /**
+
+ /**
* The native implementation must set the native windowHandle.
*
*
* The implementation shall respect the states {@link #isAlwaysOnTop()}/{@link #FLAG_IS_ALWAYSONTOP} and
* {@link #isUndecorated()}/{@link #FLAG_IS_UNDECORATED}, ie. the created window shall reflect those settings.
*
- *
+ *
*
* The implementation should invoke the referenced java state callbacks
* to notify this Java object of state changes.
- *
+ *
* @see #windowDestroyNotify(boolean)
* @see #focusChanged(boolean, boolean)
* @see #visibleChanged(boolean, boolean)
@@ -589,16 +589,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
protected abstract void closeNativeImpl();
- /**
+ /**
* Async request which shall be performed within {@link #TIMEOUT_NATIVEWINDOW}.
*
- * If if force == false the native implementation
+ * If if force == false the native implementation
* may only request focus if not yet owner.
*
* {@link #focusChanged(boolean, boolean)} should be called
- * to notify about the focus traversal.
- *
- *
+ * to notify about the focus traversal.
+ *
+ *
* @param force if true, bypass {@link #focusChanged(boolean, boolean)} and force focus request
*/
protected abstract void requestFocusImpl(boolean force);
@@ -608,7 +608,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public static final int FLAG_CHANGE_FULLSCREEN = 1 << 2;
public static final int FLAG_CHANGE_ALWAYSONTOP = 1 << 3;
public static final int FLAG_CHANGE_VISIBILITY = 1 << 4;
-
+
public static final int FLAG_HAS_PARENT = 1 << 8;
public static final int FLAG_IS_UNDECORATED = 1 << 9;
public static final int FLAG_IS_FULLSCREEN = 1 << 10;
@@ -619,12 +619,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
/**
* The native implementation should invoke the referenced java state callbacks
* to notify this Java object of state changes.
- *
+ *
*
* Implementations shall set x/y to 0, in case it's negative. This could happen due
* to insets and positioning a decorated window to 0/0, which would place the frame
* outside of the screen.
- *
+ *
* @param x client-area position, or <0 if unchanged
* @param y client-area position, or <0 if unchanged
* @param width client-area size, or <=0 if unchanged
@@ -635,12 +635,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @see #positionChanged(boolean,int, int)
*/
protected abstract boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags);
-
- /**
+
+ /**
* Tests whether a single reconfigure flag is supported by implementation.
*
* Default is all but {@link #FLAG_IS_FULLSCREEN_SPAN}
- *
+ *
*/
protected boolean isReconfigureFlagSupported(int changeFlags) {
return 0 == ( changeFlags & FLAG_IS_FULLSCREEN_SPAN );
@@ -656,14 +656,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
protected static String getReconfigureFlagsAsString(StringBuilder sb, int flags) {
if(null == sb) { sb = new StringBuilder(); }
sb.append("[");
-
+
if( 0 != ( FLAG_CHANGE_PARENTING & flags) ) {
sb.append("*");
}
sb.append("PARENT_");
sb.append(0 != ( FLAG_HAS_PARENT & flags));
sb.append(", ");
-
+
if( 0 != ( FLAG_CHANGE_FULLSCREEN & flags) ) {
sb.append("*");
}
@@ -679,24 +679,24 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
sb.append("UNDECOR_");
sb.append(0 != ( FLAG_IS_UNDECORATED & flags));
sb.append(", ");
-
+
if( 0 != ( FLAG_CHANGE_ALWAYSONTOP & flags) ) {
sb.append("*");
}
sb.append("ALWAYSONTOP_");
sb.append(0 != ( FLAG_IS_ALWAYSONTOP & flags));
sb.append(", ");
-
+
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
sb.append("*");
}
sb.append("VISIBLE_");
sb.append(0 != ( FLAG_IS_VISIBLE & flags));
-
+
sb.append("]");
return sb.toString();
}
-
+
protected void setTitleImpl(String title) {}
/**
@@ -713,11 +713,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @return if not null, the screen location of the given coordinates
*/
protected abstract Point getLocationOnScreenImpl(int x, int y);
-
+
/** Triggered by user via {@link #getInsets()}.
- * Implementations may implement this hook to update the insets.
+ * Implementations may implement this hook to update the insets.
* However, they may prefer the event driven path via {@link #insetsChanged(boolean, int, int, int, int)}.
- *
+ *
* @see #getInsets()
* @see #insetsChanged(boolean, int, int, int, int)
*/
@@ -726,7 +726,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
protected boolean setPointerVisibleImpl(boolean pointerVisible) { return false; }
protected boolean confinePointerImpl(boolean confine) { return false; }
protected void warpPointerImpl(int x, int y) { }
-
+
//----------------------------------------------------------------------
// NativeSurface
//
@@ -791,7 +791,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public final RecursiveLock getLock() {
return windowLock;
}
-
+
@Override
public long getSurfaceHandle() {
return windowHandle; // default: return window handle
@@ -810,7 +810,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
@Override
public final long getDisplayHandle() {
return config.getNativeGraphicsConfiguration().getScreen().getDevice().getHandle();
- }
+ }
@Override
public final int getScreenIndex() {
@@ -879,19 +879,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public final Screen getScreen() {
return screen;
}
-
+
@Override
public final MonitorDevice getMainMonitor() {
return screen.getMainMonitor(new Rectangle(getX(), getY(), getWidth(), getHeight()));
}
-
+
protected final void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
- reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_VISIBILITY, visible));
- }
+ reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_VISIBILITY, visible));
+ }
final void setVisibleActionImpl(boolean visible) {
boolean nativeWindowCreated = false;
boolean madeVisible = false;
-
+
final RecursiveLock _lock = windowLock;
_lock.lock();
try {
@@ -911,7 +911,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
madeVisible = nativeWindowCreated;
}
// always flag visible, allowing a retry ..
- WindowImpl.this.visible = true;
+ WindowImpl.this.visible = true;
} else if(WindowImpl.this.visible != visible) {
if(isNativeValid()) {
setVisibleImpl(visible, getX(), getY(), getWidth(), getHeight());
@@ -965,14 +965,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window setVisible: START ("+getThreadName()+") "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+this.visible+" -> "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+(null!=parentWindow));
}
- runOnEDTIfAvail(wait, new VisibleAction(visible));
+ runOnEDTIfAvail(wait, new VisibleAction(visible));
}
@Override
public void setVisible(boolean visible) {
setVisible(true, visible);
}
-
+
private class SetSizeAction implements Runnable {
int width, height;
boolean disregardFS;
@@ -1024,11 +1024,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private void setFullscreenSize(int width, int height) {
runOnEDTIfAvail(true, new SetSizeAction(width, height, true));
- }
+ }
@Override
public void setSize(int width, int height) {
runOnEDTIfAvail(true, new SetSizeAction(width, height, false));
- }
+ }
@Override
public void setTopLevelSize(int width, int height) {
setSize(width - getInsets().getTotalWidth(), height - getInsets().getTotalHeight());
@@ -1049,10 +1049,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window DestroyAction() hasScreen "+(null != screen)+", isNativeValid "+isNativeValid()+" - "+getThreadName());
}
-
+
// send synced destroy-notify notification
sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
-
+
// Childs first ..
synchronized(childWindowsLock) {
if(childWindows.size()>0) {
@@ -1111,30 +1111,30 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(animatorPaused) {
lifecycleHook.resumeRenderingAction();
}
-
+
// these refs shall be kept alive - resurrection via setVisible(true)
/**
if(null!=parentWindow && parentWindow instanceof Window) {
((Window)parentWindow).removeChild(WindowImpl.this);
- }
+ }
childWindows = null;
surfaceUpdatedListeners = null;
mouseListeners = null;
keyListeners = null;
capsRequested = null;
lifecycleHook = null;
-
- screen = null;
+
+ screen = null;
windowListeners = null;
parentWindow = null;
- */
+ */
}
}
private final DestroyAction destroyAction = new DestroyAction();
@Override
public void destroy() {
- visible = false; // Immediately mark synchronized visibility flag, avoiding possible recreation
+ visible = false; // Immediately mark synchronized visibility flag, avoiding possible recreation
runOnEDTIfAvail(true, destroyAction);
}
@@ -1144,15 +1144,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
destroy();
}
-
+
/**
* @param cWin child window, must not be null
* @param pWin parent window, may be null
- * @return true if at least one of both window's configurations is offscreen
+ * @return true if at least one of both window's configurations is offscreen
*/
protected static boolean isOffscreenInstance(NativeWindow cWin, NativeWindow pWin) {
boolean ofs = false;
- final AbstractGraphicsConfiguration cWinCfg = cWin.getGraphicsConfiguration();
+ final AbstractGraphicsConfiguration cWinCfg = cWin.getGraphicsConfiguration();
if( null != cWinCfg ) {
ofs = !cWinCfg.getChosenCapabilities().isOnscreen();
}
@@ -1164,7 +1164,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
return ofs;
}
-
+
private class ReparentAction implements Runnable {
final NativeWindow newParentWindow;
final int topLevelX, topLevelY;
@@ -1187,7 +1187,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
removeScreenReference();
screen = newScreen;
}
-
+
public final void run() {
boolean animatorPaused = false;
if(null!=lifecycleHook) {
@@ -1198,7 +1198,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
lifecycleHook.resumeRenderingAction();
}
}
-
+
private void reparent() {
// mirror pos/size so native change notification can get overwritten
final int oldX = getX();
@@ -1209,7 +1209,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
int width = oldWidth;
int height = oldHeight;
boolean wasVisible;
-
+
final RecursiveLock _lock = windowLock;
_lock.lock();
try {
@@ -1217,7 +1217,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// force recreation if offscreen, since it may become onscreen
forceDestroyCreate |= isOffscreenInstance(WindowImpl.this, newParentWindow);
}
-
+
wasVisible = isVisible();
Window newParentWindowNEWT = null;
@@ -1233,7 +1233,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(null!=newParentWindow) {
// REPARENT TO CHILD WINDOW
-
+
// reset position to 0/0 within parent space
x = 0;
y = 0;
@@ -1278,7 +1278,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
operation = ReparentOperation.ACTION_NATIVE_CREATION_PENDING;
}
} else if ( forceDestroyCreate || !NewtFactory.isScreenCompatible(newParentWindow, screen) ) {
- // Destroy this window, may create a new compatible Screen/Display, while trying to preserve resources if becoming visible again.
+ // Destroy this window, may create a new compatible Screen/Display, while trying to preserve resources if becoming visible again.
destroy( wasVisible );
if(null!=newParentWindowNEWT) {
setScreen( (ScreenImpl) newParentWindowNEWT.getScreen() );
@@ -1333,11 +1333,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if ( ReparentOperation.ACTION_INVALID == operation ) {
throw new NativeWindowException("Internal Error: reparentAction not set");
}
-
+
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.reparent: ACTION ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+" new parentWindowHandle "+toHexString(newParentWindowHandle)+", reparentAction "+operation+", pos/size "+x+"/"+y+" "+width+"x"+height+", visible "+wasVisible);
}
-
+
if( ReparentOperation.ACTION_NOP == operation ) {
return;
}
@@ -1401,18 +1401,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
if(ok) {
requestFocusInt( 0 == parentWindowHandle /* skipFocusAction if top-level */);
- display.dispatchMessagesNative(); // status up2date
+ display.dispatchMessagesNative(); // status up2date
}
}
}
if(!ok || !wasVisible) {
- // make size and position persistent manual,
+ // make size and position persistent manual,
// since we don't have a WM feedback (invisible or recreation)
definePosition(x, y);
defineSize(width, height);
}
-
+
if(!ok) {
// native reparent failed -> try creation, while trying to preserve resources if becoming visible again.
if(DEBUG_IMPLEMENTATION) {
@@ -1430,7 +1430,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
definePosition(x, y);
defineSize(width, height);
}
-
+
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.reparent: END-1 ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
}
@@ -1451,7 +1451,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// This may run on the new Display/Screen connection, hence a new EDT task
runOnEDTIfAvail(true, reparentActionRecreate);
break;
-
+
default:
}
}
@@ -1566,7 +1566,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(WindowImpl.this.alwaysOnTop != alwaysOnTop) {
// set current state
WindowImpl.this.alwaysOnTop = alwaysOnTop;
-
+
if( isNativeValid() ) {
// Mirror pos/size so native change notification can get overwritten
final int x = getX();
@@ -1591,12 +1591,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public final void setAlwaysOnTop(boolean value) {
runOnEDTIfAvail(true, new AlwaysOnTopAction(value));
}
-
+
@Override
public final boolean isAlwaysOnTop() {
return alwaysOnTop;
}
-
+
@Override
public String getTitle() {
return title;
@@ -1624,7 +1624,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
setVal = setPointerVisibleImpl(pointerVisible);
}
if(setVal) {
- this.pointerVisible = pointerVisible;
+ this.pointerVisible = pointerVisible;
}
}
}
@@ -1632,7 +1632,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public boolean isPointerConfined() {
return pointerConfined;
}
-
+
@Override
public void confinePointer(boolean confine) {
if(this.pointerConfined != confine) {
@@ -1652,18 +1652,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
if(setVal) {
- this.pointerConfined = confine;
+ this.pointerConfined = confine;
}
- }
+ }
}
-
+
@Override
public void warpPointer(int x, int y) {
if(0 != getWindowHandle()) {
warpPointerImpl(x, y);
}
}
-
+
@Override
public final InsetsImmutable getInsets() {
if(isUndecorated()) {
@@ -1672,7 +1672,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
updateInsetsImpl(insets);
return insets;
}
-
+
@Override
public final int getWidth() {
return width;
@@ -1694,8 +1694,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
protected final boolean autoPosition() { return autoPosition; }
-
- /** Sets the position fields {@link #x} and {@link #y} to the given values and {@link #autoPosition} to false. */
+
+ /** Sets the position fields {@link #x} and {@link #y} to the given values and {@link #autoPosition} to false. */
protected final void definePosition(int x, int y) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("definePosition: "+this.x+"/"+this.y+" -> "+x+"/"+y);
@@ -1705,7 +1705,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
this.x = x; this.y = y;
}
- /** Sets the size fields {@link #width} and {@link #height} to the given values. */
+ /** Sets the size fields {@link #width} and {@link #height} to the given values. */
protected final void defineSize(int width, int height) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("defineSize: "+this.width+"x"+this.height+" -> "+width+"x"+height);
@@ -1713,7 +1713,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
this.width = width; this.height = height;
}
-
+
@Override
public final boolean isVisible() {
return visible;
@@ -1732,7 +1732,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public final Window getDelegatedWindow() {
return this;
}
-
+
//----------------------------------------------------------------------
// WindowImpl
//
@@ -1755,8 +1755,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return old;
}
- /**
- * If this Window actually wraps a {@link NativeSurface} from another instance or toolkit,
+ /**
+ * If this Window actually wraps a {@link NativeSurface} from another instance or toolkit,
* it will return such reference. Otherwise returns null.
*/
public NativeSurface getWrappedSurface() {
@@ -1768,13 +1768,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
windowDestroyNotifyAction = r;
}
- /**
- * Returns the non delegated {@link AbstractGraphicsConfiguration},
+ /**
+ * Returns the non delegated {@link AbstractGraphicsConfiguration},
* see {@link #getGraphicsConfiguration()}. */
public final AbstractGraphicsConfiguration getPrivateGraphicsConfiguration() {
return config;
}
-
+
protected final long getParentWindowHandle() {
return isFullscreen() ? 0 : parentWindowHandle;
}
@@ -1864,7 +1864,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public void requestFocus(boolean wait) {
requestFocus(wait /* wait */, false /* skipFocusAction */, brokenFocusChange /* force */);
}
-
+
private void requestFocus(boolean wait, boolean skipFocusAction, boolean force) {
if( isNativeValid() &&
( force || !hasFocus() ) &&
@@ -1872,7 +1872,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
runOnEDTIfAvail(wait, force ? requestFocusActionForced : requestFocusAction);
}
}
-
+
/** Internally forcing request focus on current thread */
private void requestFocusInt(boolean skipFocusAction) {
if( skipFocusAction || !focusAction() ) {
@@ -1880,14 +1880,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
System.err.println("Window.RequestFocusInt: forcing - ("+getThreadName()+"): skipFocusAction "+skipFocusAction+", focus "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
}
requestFocusImpl(true);
- }
+ }
}
-
+
@Override
public void setFocusAction(FocusRunnable focusAction) {
this.focusAction = focusAction;
}
-
+
private boolean focusAction() {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.focusAction() START - "+getThreadName()+", focusAction: "+focusAction+" - windowHandle "+toHexString(getWindowHandle()));
@@ -1903,16 +1903,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
return res;
}
-
+
protected void setBrokenFocusChange(boolean v) {
brokenFocusChange = v;
}
-
+
@Override
public void setKeyboardFocusHandler(KeyListener l) {
keyboardFocusHandler = l;
}
-
+
private class SetPositionAction implements Runnable {
int x, y;
@@ -1932,7 +1932,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(isNativeValid()) {
// this.x/this.y will be set by sizeChanged, triggered by windowing event system
reconfigureWindowImpl(x, y, getWidth(), getHeight(), getReconfigureFlags(0, isVisible()));
-
+
// Wait until custom position is reached within tolerances
waitForPosition(true, x, y, Window.TIMEOUT_NATIVEWINDOW);
} else {
@@ -1950,16 +1950,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
autoPosition = false;
runOnEDTIfAvail(true, new SetPositionAction(x, y));
}
-
+
@Override
public void setTopLevelPosition(int x, int y) {
setPosition(x + getInsets().getLeftWidth(), y + getInsets().getTopHeight());
}
-
+
private class FullScreenAction implements Runnable {
boolean fullscreen;
- private boolean init(boolean fullscreen) {
+ private boolean init(boolean fullscreen) {
if(isNativeValid()) {
this.fullscreen = fullscreen;
return isFullscreen() != fullscreen;
@@ -1967,7 +1967,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
WindowImpl.this.fullscreen = fullscreen; // set current state for createNative(..)
return false;
}
- }
+ }
public boolean fsOn() { return fullscreen; }
public final void run() {
@@ -1981,9 +1981,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final int oldY = getY();
final int oldWidth = getWidth();
final int oldHeight = getHeight();
-
+
int x,y,w,h;
-
+
final RectangleImmutable sviewport = screen.getViewport();
final RectangleImmutable viewport;
final int fs_span_flag;
@@ -2007,7 +2007,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
nfs_y = oldY;
nfs_width = oldWidth;
nfs_height = oldHeight;
- x = viewport.getX();
+ x = viewport.getX();
y = viewport.getY();
w = viewport.getWidth();
h = viewport.getHeight();
@@ -2020,12 +2020,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
y = nfs_y;
w = nfs_width;
h = nfs_height;
-
+
if(null!=parentWindow) {
// reset position to 0/0 within parent space
x = 0;
y = 0;
-
+
// refit if size is bigger than parent
if( w > parentWindow.getWidth() ) {
w = parentWindow.getWidth();
@@ -2044,7 +2044,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final DisplayImpl display = (DisplayImpl) screen.getDisplay();
display.dispatchMessagesNative(); // status up2date
final boolean wasVisible = isVisible();
-
+
// Lock parentWindow only during reparenting (attempt)
final NativeWindow parentWindowLocked;
if( null != parentWindow ) {
@@ -2065,8 +2065,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
parentWindowLocked = null;
}
try {
- reconfigureWindowImpl(x, y, w, h,
- getReconfigureFlags( ( ( null != parentWindowLocked ) ? FLAG_CHANGE_PARENTING : 0 ) |
+ reconfigureWindowImpl(x, y, w, h,
+ getReconfigureFlags( ( ( null != parentWindowLocked ) ? FLAG_CHANGE_PARENTING : 0 ) |
fs_span_flag | FLAG_CHANGE_FULLSCREEN | FLAG_CHANGE_DECORATION, isVisible()) );
} finally {
if(null!=parentWindowLocked) {
@@ -2074,7 +2074,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
display.dispatchMessagesNative(); // status up2date
-
+
if(wasVisible) {
setVisibleImpl(true, x, y, w, h);
boolean ok = 0 <= WindowImpl.this.waitForVisible(true, false);
@@ -2086,7 +2086,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
if(ok) {
requestFocusInt(fullscreen /* skipFocusAction if fullscreen */);
- display.dispatchMessagesNative(); // status up2date
+ display.dispatchMessagesNative(); // status up2date
}
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window fs done: ok " + ok + ", " + WindowImpl.this);
@@ -2098,24 +2098,24 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
}
}
- private final FullScreenAction fullScreenAction = new FullScreenAction();
+ private final FullScreenAction fullScreenAction = new FullScreenAction();
@Override
public boolean setFullscreen(boolean fullscreen) {
return setFullscreenImpl(fullscreen, true, null);
}
-
+
@Override
public boolean setFullscreen(List monitors) {
return setFullscreenImpl(true, false, monitors);
}
-
+
private boolean setFullscreenImpl(boolean fullscreen, boolean useMainMonitor, List monitors) {
synchronized(fullScreenAction) {
fullscreenMonitors = monitors;
fullscreenUseMainMonitor = useMainMonitor;
if( fullScreenAction.init(fullscreen) ) {
- if(fullScreenAction.fsOn() && isOffscreenInstance(WindowImpl.this, parentWindow)) {
+ if(fullScreenAction.fsOn() && isOffscreenInstance(WindowImpl.this, parentWindow)) {
// enable fullscreen on offscreen instance
if(null != parentWindow) {
nfs_parent = parentWindow;
@@ -2124,19 +2124,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
throw new InternalError("Offscreen instance w/o parent unhandled");
}
}
-
+
runOnEDTIfAvail(true, fullScreenAction);
-
+
if(!fullScreenAction.fsOn() && null != nfs_parent) {
// disable fullscreen on offscreen instance
reparentWindow(nfs_parent, -1, -1, true /* forceDestroyCreate */);
nfs_parent = null;
}
}
- return this.fullscreen;
+ return this.fullscreen;
}
}
-
+
private class MonitorModeListenerImpl implements MonitorModeListener {
boolean animatorPaused = false;
boolean hadFocus = false;
@@ -2226,7 +2226,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
//----------------------------------------------------------------------
// Child Window Management
- //
+ //
@Override
public final boolean removeChild(NativeWindow win) {
@@ -2282,7 +2282,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.consumeEvent: REPAINT "+Thread.currentThread().getName()+" - queued "+e+", discard-to "+discardTO);
// Thread.dumpStack();
- }
+ }
return discardTO; // discardTO:=true -> consumed
}
return true;
@@ -2343,11 +2343,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
//
// MouseListener/Event Support
//
-
+
//
// Native MouseEvents pre-processed to be enqueued or consumed directly
//
-
+
public final void sendMouseEvent(short eventType, int modifiers,
int x, int y, short button, float rotation) {
doMouseEvent(false, false, eventType, modifiers, x, y, button, MouseEvent.getRotationXYZ(rotation, modifiers), 1f);
@@ -2369,11 +2369,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
int x, int y, short button, float[] rotationXYZ, float rotationScale) {
doMouseEvent(true, wait, eventType, modifiers, x, y, button, rotationXYZ, rotationScale);
} */
-
+
/**
* Send mouse event (one-pointer) either to be directly consumed or to be enqueued
- *
- * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
+ *
+ * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
* otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
* @param wait if true wait until {@link #consumeEvent(NEWTEvent) consumed}.
*/
@@ -2383,7 +2383,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
throw new NativeWindowException("Invalid mouse button number" + button);
}
doPointerEvent(enqueue, wait, constMousePointerTypes, eventType, modifiers,
- 0 /*actionIdx*/, new short[] { (short)(button-1) },
+ 0 /*actionIdx*/, new short[] { (short)(button-1) },
new int[]{x}, new int[]{y}, new float[]{0f} /*pressure*/,
1f /*maxPressure*/, rotationXYZ, rotationScale);
}
@@ -2396,11 +2396,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
*
*
* The given pointer names, pNames, are mapped to consecutive pointer IDs starting w/ 0
- * using a hash-map if normalPNames is false.
- * Otherwise a simple int to short type cast is performed.
+ * using a hash-map if normalPNames is false.
+ * Otherwise a simple int to short type cast is performed.
*
- *
- * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
+ *
+ * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
* otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
* @param wait if true wait until {@link #consumeEvent(NEWTEvent) consumed}.
* @param pTypes {@link MouseEvent.PointerType} for each pointer (multiple pointer)
@@ -2410,14 +2410,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @param normalPNames see pName below.
* @param pNames Pointer name for each pointer (multiple pointer).
* We assume consecutive pointer names starting w/ 0 if normalPIDs is true.
- * Otherwise we hash-map the values during state pressed to retrieve the normal ID.
+ * Otherwise we hash-map the values during state pressed to retrieve the normal ID.
* @param pX X-axis for each pointer (multiple pointer)
* @param pY Y-axis for each pointer (multiple pointer)
* @param pPressure Pressure for each pointer (multiple pointer)
* @param maxPressure Maximum pointer pressure for all pointer
*/
public final void doPointerEvent(boolean enqueue, boolean wait,
- final PointerType[] pTypes, short eventType, int modifiers,
+ final PointerType[] pTypes, short eventType, int modifiers,
int actionIdx, boolean normalPNames, final int[] pNames,
final int[] pX, final int[] pY, float[] pPressure,
float maxPressure, final float[] rotationXYZ, final float rotationScale) {
@@ -2447,25 +2447,25 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
pIDs[i] = (short)pNames[i];
}
}
- doPointerEvent(enqueue, wait, pTypes, eventType, modifiers, actionIdx, pIDs,
+ doPointerEvent(enqueue, wait, pTypes, eventType, modifiers, actionIdx, pIDs,
pX, pY, pPressure, maxPressure, rotationXYZ, rotationScale);
}
-
+
/**
* Send multiple-pointer event either to be directly consumed or to be enqueued
*
* The index for the element of multiple-pointer arrays represents the pointer which triggered the event
* is passed via actionIdx.
- *
- *
- * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
+ *
+ *
+ * @param enqueue if true, event will be {@link #enqueueEvent(boolean, NEWTEvent) enqueued},
* otherwise {@link #consumeEvent(NEWTEvent) consumed} directly.
* @param wait if true wait until {@link #consumeEvent(NEWTEvent) consumed}.
* @param pTypes {@link MouseEvent.PointerType} for each pointer (multiple pointer)
* @param eventType
* @param modifiers
* @param pActionIdx index of multiple-pointer arrays representing the pointer which triggered the event
- * @param pID Pointer ID for each pointer (multiple pointer). We assume consecutive pointerIDs starting w/ 0.
+ * @param pID Pointer ID for each pointer (multiple pointer). We assume consecutive pointerIDs starting w/ 0.
* A pointer-ID of -1 may also denote no pointer/button activity, i.e. {@link PointerType#Mouse} move.
* @param pX X-axis for each pointer (multiple pointer)
* @param pY Y-axis for each pointer (multiple pointer)
@@ -2473,14 +2473,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* @param maxPressure Maximum pointer pressure for all pointer
*/
public final void doPointerEvent(boolean enqueue, boolean wait,
- final PointerType[] pTypes, short eventType, int modifiers,
+ final PointerType[] pTypes, short eventType, int modifiers,
int pActionIdx, final short[] pID, final int[] pX, final int[] pY, final float[] pPressure,
float maxPressure, final float[] rotationXYZ, float rotationScale) {
final long when = System.currentTimeMillis();
final int pCount = pTypes.length;
-
+
if( 0 > pActionIdx || pActionIdx >= pCount) {
- throw new IllegalArgumentException("actionIdx out of bounds [0.."+(pCount-1)+"]");
+ throw new IllegalArgumentException("actionIdx out of bounds [0.."+(pCount-1)+"]");
}
if( 0 < pActionIdx ) {
// swap values to make idx 0 the triggering pointer
@@ -2518,11 +2518,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
button = com.jogamp.newt.event.MouseEvent.BUTTON1;
}
}
-
+
//
// - Determine ENTERED/EXITED state
// - Remove redundant move/drag events
- // - Reset states if applicable
+ // - Reset states if applicable
//
int x = pX[0];
int y = pY[0];
@@ -2537,7 +2537,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
movePositionP0.set(0, 0);
}
// Fall through intended!
-
+
case MouseEvent.EVENT_MOUSE_ENTERED:
// clip coordinates to window dimension
x = Math.min(Math.max(x, 0), getWidth()-1);
@@ -2545,11 +2545,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
pState1.insideWindow = eventType == MouseEvent.EVENT_MOUSE_ENTERED;
pState1.clearButton();
break;
-
+
case MouseEvent.EVENT_MOUSE_MOVED:
case MouseEvent.EVENT_MOUSE_DRAGGED:
if( null != movePositionP0 ) {
- if( pState1.insideWindow && movePositionP0.getX() == x && movePositionP0.getY() == y ) {
+ if( pState1.insideWindow && movePositionP0.getX() == x && movePositionP0.getY() == y ) {
if(DEBUG_MOUSE_EVENT) {
System.err.println("doPointerEvent: skip "+MouseEvent.getEventTypeString(eventType)+" w/ same position: "+movePositionP0);
}
@@ -2557,16 +2557,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
movePositionP0.set(x, y);
}
-
+
// Fall through intended !
-
+
default:
if(!pState1.insideWindow) {
- pState1.insideWindow = true;
+ pState1.insideWindow = true;
pState1.clearButton();
}
}
-
+
if( x < 0 || y < 0 || x >= getWidth() || y >= getHeight() ) {
if(DEBUG_MOUSE_EVENT) {
System.err.println("doPointerEvent: drop: "+MouseEvent.getEventTypeString(eventType)+
@@ -2582,29 +2582,29 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final int buttonMask = InputEvent.getButtonMask(button);
modifiers |= buttonMask; // Always add current button to modifier mask (Bug 571)
modifiers |= pState1.buttonPressedMask; // Always add currently pressed mouse buttons to modifier mask
-
+
if( isPointerConfined() ) {
modifiers |= InputEvent.CONFINED_MASK;
}
if( !isPointerVisible() ) {
modifiers |= InputEvent.INVISIBLE_MASK;
}
-
+
pX[0] = x;
pY[0] = y;
-
+
//
// - Determine CLICK COUNT
// - Ignore sent CLICKED
// - Track buttonPressed incl. buttonPressedMask
// - Fix MOVED/DRAGGED event
//
- final MouseEvent e;
+ final MouseEvent e;
switch( eventType ) {
case MouseEvent.EVENT_MOUSE_CLICKED:
e = null;
break;
-
+
case MouseEvent.EVENT_MOUSE_PRESSED:
if( 0 >= pPressure[0] ) {
pPressure[0] = maxPressure;
@@ -2618,16 +2618,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
pState1.lastButtonPressTime = when;
pState1.buttonPressed = button;
- e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
+ e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
pX, pY, pPressure, maxPressure, button, pState1.lastButtonClickCount, rotationXYZ, rotationScale);
} else {
- e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
+ e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
pX, pY, pPressure, maxPressure, button, (short)1, rotationXYZ, rotationScale);
}
break;
case MouseEvent.EVENT_MOUSE_RELEASED:
if( 1 == pCount ) {
- e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
+ e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
pX, pY, pPressure, maxPressure, button, pState1.lastButtonClickCount, rotationXYZ, rotationScale);
if( when - pState1.lastButtonPressTime >= MouseEvent.getClickTimeout() ) {
pState1.lastButtonClickCount = (short)0;
@@ -2635,7 +2635,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
pState1.buttonPressed = 0;
} else {
- e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
+ e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
pX, pY, pPressure, maxPressure, button, (short)1, rotationXYZ, rotationScale);
}
pState1.buttonPressedMask &= ~buttonMask;
@@ -2645,10 +2645,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
break;
case MouseEvent.EVENT_MOUSE_MOVED:
if ( 0 != pState1.buttonPressedMask ) { // any button or pointer move -> drag
- e = new MouseEvent(MouseEvent.EVENT_MOUSE_DRAGGED, this, when, modifiers, pTypes, pID,
+ e = new MouseEvent(MouseEvent.EVENT_MOUSE_DRAGGED, this, when, modifiers, pTypes, pID,
pX, pY, pPressure, maxPressure, pState1.buttonPressed, (short)1, rotationXYZ, rotationScale);
} else {
- e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
+ e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
pX, pY, pPressure, maxPressure, button, (short)0, rotationXYZ, rotationScale);
}
break;
@@ -2658,12 +2658,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
// Fall through intended!
default:
- e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
+ e = new MouseEvent(eventType, this, when, modifiers, pTypes, pID,
pX, pY, pPressure, maxPressure, button, (short)0, rotationXYZ, rotationScale);
}
doEvent(enqueue, wait, e); // actual mouse event
}
-
+
@Override
public final void addMouseListener(MouseListener l) {
addMouseListener(-1, l);
@@ -2676,8 +2676,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@SuppressWarnings("unchecked")
ArrayList clonedListeners = (ArrayList) mouseListeners.clone();
- if(0>index) {
- index = clonedListeners.size();
+ if(0>index) {
+ index = clonedListeners.size();
}
clonedListeners.add(index, l);
mouseListeners = clonedListeners;
@@ -2698,8 +2698,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public final MouseListener getMouseListener(int index) {
@SuppressWarnings("unchecked")
ArrayList clonedListeners = (ArrayList) mouseListeners.clone();
- if(0>index) {
- index = clonedListeners.size()-1;
+ if(0>index) {
+ index = clonedListeners.size()-1;
}
return clonedListeners.get(index);
}
@@ -2717,7 +2717,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public final boolean areDefaultGesturesEnabled() {
return defaultGestureHandlerEnabled;
}
-
+
@Override
public final void addGestureHandler(GestureHandler gh) {
addGestureHandler(-1, gh);
@@ -2729,7 +2729,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@SuppressWarnings("unchecked")
ArrayList cloned = (ArrayList) pointerGestureHandler.clone();
- if(0>index) {
+ if(0>index) {
index = cloned.size();
}
cloned.add(index, gh);
@@ -2756,7 +2756,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@SuppressWarnings("unchecked")
ArrayList cloned = (ArrayList) gestureListeners.clone();
- if(0>index) {
+ if(0>index) {
index = cloned.size();
}
cloned.add(index, gl);
@@ -2772,11 +2772,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
cloned.remove(gl);
gestureListeners= cloned;
}
-
+
private static int step(int lower, int edge, int value) {
return value < edge ? lower : value;
}
-
+
/**
* Consume the {@link MouseEvent}, i.e.
*
@@ -2786,18 +2786,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
* - dispatch event to listener
*
*/
- protected void consumePointerEvent(MouseEvent pe) {
+ protected void consumePointerEvent(MouseEvent pe) {
int x = pe.getX();
int y = pe.getY();
-
+
if(DEBUG_MOUSE_EVENT) {
System.err.println("consumePointerEvent.in: "+pe);
}
-
+
//
// - Determine ENTERED/EXITED state
// - Synthesize ENTERED event
- // - Reset states if applicable
+ // - Reset states if applicable
//
final long when = pe.getWhen();
int eventType = pe.getEventType();
@@ -2812,7 +2812,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
pState0.clearButton();
eEntered = null;
break;
-
+
default:
if(!pState0.insideWindow) {
pState0.insideWindow = true;
@@ -2833,12 +2833,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
return; // .. invalid ..
}
-
+
//
// Handle Default Gestures
//
if( defaultGestureHandlerEnabled &&
- pe.getPointerType(0).getPointerClass() == MouseEvent.PointerClass.Onscreen )
+ pe.getPointerType(0).getPointerClass() == MouseEvent.PointerClass.Onscreen )
{
if( null == gesture2PtrTouchScroll ) {
final int scaledScrollSlop;
@@ -2849,16 +2849,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
final float pixWPerMM = (float)monitor.getCurrentMode().getRotatedWidth() / (float)mm.getWidth();
final float pixHPerMM = (float)monitor.getCurrentMode().getRotatedHeight() / (float)mm.getHeight();
final float pixPerMM = Math.min(pixHPerMM, pixWPerMM);
- scaledScrollSlop = Math.round(DoubleTapScrollGesture.SCROLL_SLOP_MM * pixPerMM);
- scaledDoubleTapSlop = Math.round(DoubleTapScrollGesture.DOUBLE_TAP_SLOP_MM * pixPerMM);
+ scaledScrollSlop = Math.round(DoubleTapScrollGesture.SCROLL_SLOP_MM * pixPerMM);
+ scaledDoubleTapSlop = Math.round(DoubleTapScrollGesture.DOUBLE_TAP_SLOP_MM * pixPerMM);
if(DEBUG_MOUSE_EVENT) {
System.err.println("consumePointerEvent.gscroll: scrollSlop "+scaledScrollSlop+", doubleTapSlop "+scaledDoubleTapSlop+", pixPerMM "+pixPerMM+", "+monitor);
}
} else {
scaledScrollSlop = DoubleTapScrollGesture.SCROLL_SLOP_PIXEL;
- scaledDoubleTapSlop = DoubleTapScrollGesture.DOUBLE_TAP_SLOP_PIXEL;
+ scaledDoubleTapSlop = DoubleTapScrollGesture.DOUBLE_TAP_SLOP_PIXEL;
}
- gesture2PtrTouchScroll = new DoubleTapScrollGesture(step(DoubleTapScrollGesture.SCROLL_SLOP_PIXEL, DoubleTapScrollGesture.SCROLL_SLOP_PIXEL/2, scaledScrollSlop),
+ gesture2PtrTouchScroll = new DoubleTapScrollGesture(step(DoubleTapScrollGesture.SCROLL_SLOP_PIXEL, DoubleTapScrollGesture.SCROLL_SLOP_PIXEL/2, scaledScrollSlop),
step(DoubleTapScrollGesture.DOUBLE_TAP_SLOP_PIXEL, DoubleTapScrollGesture.DOUBLE_TAP_SLOP_PIXEL/2, scaledDoubleTapSlop));
}
if( gesture2PtrTouchScroll.process(pe) ) {
@@ -2903,11 +2903,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
}
-
+
//
// - Synthesize mouse CLICKED
// - Ignore sent CLICKED
- //
+ //
final MouseEvent eClicked;
switch( eventType ) {
case MouseEvent.EVENT_MOUSE_PRESSED:
@@ -2921,7 +2921,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
eClicked = pe.createVariant(MouseEvent.EVENT_MOUSE_CLICKED);
} else {
eClicked = null;
- pState0.lastButtonPressTime = 0;
+ pState0.lastButtonPressTime = 0;
}
break;
case MouseEvent.EVENT_MOUSE_CLICKED:
@@ -2935,7 +2935,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
default:
eClicked = null;
}
-
+
if( null != pe ) {
if(DEBUG_MOUSE_EVENT) {
System.err.println("consumePointerEvent.send.1: "+pe);
@@ -2949,7 +2949,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
dispatchMouseEvent(eClicked);
}
}
-
+
private final void dispatchMouseEvent(MouseEvent e) {
for(int i = 0; !e.isConsumed() && i < mouseListeners.size(); i++ ) {
MouseListener l = mouseListeners.get(i);
@@ -2989,15 +2989,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
//
private static final int keyTrackingRange = 255;
private final IntBitfield keyPressedState = new IntBitfield( keyTrackingRange + 1 );
-
+
protected final boolean isKeyCodeTracked(final short keyCode) {
return ( 0xFFFF & (int)keyCode ) <= keyTrackingRange;
}
-
+
/**
* @param keyCode the keyCode to set pressed state
* @param pressed true if pressed, otherwise false
- * @return the previus pressed value
+ * @return the previus pressed value
*/
protected final boolean setKeyPressed(short keyCode, boolean pressed) {
final int v = 0xFFFF & (int)keyCode;
@@ -3008,7 +3008,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
/**
* @param keyCode the keyCode to test pressed state
- * @return true if pressed, otherwise false
+ * @return true if pressed, otherwise false
*/
protected final boolean isKeyPressed(short keyCode) {
final int v = 0xFFFF & (int)keyCode;
@@ -3017,7 +3017,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
return false;
}
-
+
public void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
// Always add currently pressed mouse buttons to modifier mask
consumeKeyEvent( KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
@@ -3027,12 +3027,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// Always add currently pressed mouse buttons to modifier mask
enqueueEvent(wait, KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
}
-
+
@Override
public final void setKeyboardVisible(boolean visible) {
if(isNativeValid()) {
// We don't skip the impl. if it seems that there is no state change,
- // since we cannot assume the impl. reliably gives us it's current state.
+ // since we cannot assume the impl. reliably gives us it's current state.
final boolean ok = setKeyboardVisibleImpl(visible);
if(DEBUG_IMPLEMENTATION || DEBUG_KEY_EVENT) {
System.err.println("setKeyboardVisible(native): visible "+keyboardVisible+" -- op[visible:"+visible +", ok "+ok+"] -> "+(visible && ok));
@@ -3046,13 +3046,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public final boolean isKeyboardVisible() {
return keyboardVisible;
}
- /**
+ /**
* Returns true if operation was successful, otherwise false.
*
* We assume that a failed invisible operation is due to an already invisible keyboard,
- * hence even if an invisible operation failed, the keyboard is considered invisible!
- *
- */
+ * hence even if an invisible operation failed, the keyboard is considered invisible!
+ *
+ */
protected boolean setKeyboardVisibleImpl(boolean visible) {
return false; // nop
}
@@ -3066,7 +3066,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
protected boolean keyboardVisible = false;
-
+
@Override
public void addKeyListener(KeyListener l) {
addKeyListener(-1, l);
@@ -3079,7 +3079,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@SuppressWarnings("unchecked")
ArrayList clonedListeners = (ArrayList) keyListeners.clone();
- if(0>index) {
+ if(0>index) {
index = clonedListeners.size();
}
clonedListeners.add(index, l);
@@ -3101,7 +3101,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public KeyListener getKeyListener(int index) {
@SuppressWarnings("unchecked")
ArrayList clonedListeners = (ArrayList) keyListeners.clone();
- if(0>index) {
+ if(0>index) {
index = clonedListeners.size()-1;
}
return clonedListeners.get(index);
@@ -3125,7 +3125,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
return e.isConsumed();
}
-
+
protected void consumeKeyEvent(KeyEvent e) {
boolean consumedE = false;
if( null != keyboardFocusHandler && !e.isAutoRepeat() ) {
@@ -3164,7 +3164,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@Override
- public void addWindowListener(int index, WindowListener l)
+ public void addWindowListener(int index, WindowListener l)
throws IndexOutOfBoundsException
{
if(l == null) {
@@ -3172,8 +3172,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
@SuppressWarnings("unchecked")
ArrayList clonedListeners = (ArrayList) windowListeners.clone();
- if(0>index) {
- index = clonedListeners.size();
+ if(0>index) {
+ index = clonedListeners.size();
}
clonedListeners.add(index, l);
windowListeners = clonedListeners;
@@ -3194,8 +3194,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
public WindowListener getWindowListener(int index) {
@SuppressWarnings("unchecked")
ArrayList clonedListeners = (ArrayList) windowListeners.clone();
- if(0>index) {
- index = clonedListeners.size()-1;
+ if(0>index) {
+ index = clonedListeners.size()-1;
}
return clonedListeners.get(index);
}
@@ -3234,7 +3234,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
l.windowRepaint((WindowUpdateEvent)e);
break;
default:
- throw
+ throw
new NativeWindowException("Unexpected window event type "
+ e.getEventType());
}
@@ -3248,7 +3248,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
System.err.println("Window.focusChanged: ("+getThreadName()+"): (defer: "+defer+") "+this.hasFocus+" -> "+focusGained+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
}
hasFocus = focusGained;
- final int evt = focusGained ? WindowEvent.EVENT_WINDOW_GAINED_FOCUS : WindowEvent.EVENT_WINDOW_LOST_FOCUS ;
+ final int evt = focusGained ? WindowEvent.EVENT_WINDOW_GAINED_FOCUS : WindowEvent.EVENT_WINDOW_LOST_FOCUS ;
if(!defer) {
sendWindowEvent(evt);
} else {
@@ -3256,7 +3256,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
}
-
+
/** Triggered by implementation's WM events to update the visibility state. */
protected void visibleChanged(boolean defer, boolean visible) {
if(this.visible != visible) {
@@ -3282,7 +3282,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
display.dispatchMessagesNative(); // status up2date
}
if(this.visible != visible) {
- final String msg = "Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+this.visible;
+ final String msg = "Visibility not reached as requested within "+timeOut+"ms : requested "+visible+", is "+this.visible;
if(failFast) {
throw new NativeWindowException(msg);
} else if (DEBUG_IMPLEMENTATION) {
@@ -3297,7 +3297,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
- /** Triggered by implementation's WM events to update the client-area size w/o insets/decorations. */
+ /** Triggered by implementation's WM events to update the client-area size w/o insets/decorations. */
protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
if(force || getWidth() != newWidth || getHeight() != newHeight) {
if(DEBUG_IMPLEMENTATION) {
@@ -3316,7 +3316,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
}
-
+
private boolean waitForSize(int w, int h, boolean failFast, long timeOut) {
final DisplayImpl display = (DisplayImpl) screen.getDisplay();
display.dispatchMessagesNative(); // status up2date
@@ -3338,8 +3338,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
return true;
}
}
-
- /** Triggered by implementation's WM events to update the position. */
+
+ /** Triggered by implementation's WM events to update the position. */
protected void positionChanged(boolean defer, int newX, int newY) {
if ( getX() != newX || getY() != newY ) {
if(DEBUG_IMPLEMENTATION) {
@@ -3352,7 +3352,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
enqueueWindowEvent(false, WindowEvent.EVENT_WINDOW_MOVED);
}
} else {
- autoPosition = false; // ensure it's off even w/ same position
+ autoPosition = false; // ensure it's off even w/ same position
}
}
@@ -3396,10 +3396,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
return ok;
}
-
+
/**
- * Triggered by implementation's WM events to update the insets.
- *
+ * Triggered by implementation's WM events to update the insets.
+ *
* @see #getInsets()
* @see #updateInsetsImpl(Insets)
*/
@@ -3409,7 +3409,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.insetsChanged: skip insets change for undecoration mode");
}
- } else if ( (left != insets.getLeftWidth() || right != insets.getRightWidth() ||
+ } else if ( (left != insets.getLeftWidth() || right != insets.getRightWidth() ||
top != insets.getTopHeight() || bottom != insets.getBottomHeight() )
) {
insets.set(left, right, top, bottom);
@@ -3419,10 +3419,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
}
-
+
/**
* Triggered by implementation's WM events or programmatic while respecting {@link #getDefaultCloseOperation()}.
- *
+ *
* @param force if true, overrides {@link #setDefaultCloseOperation(WindowClosingMode)} with {@link WindowClosingProtocol#DISPOSE_ON_CLOSE}
* and hence force destruction. Otherwise is follows the user settings.
* @return true if this window is no more valid and hence has been destroyed, otherwise false.
@@ -3434,9 +3434,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
System.err.println("Window.windowDestroyNotify(isNativeValid: "+isNativeValid()+", force: "+force+", mode "+defMode+" -> "+mode+") "+getThreadName()+": "+this);
// Thread.dumpStack();
}
-
+
final boolean destroyed;
-
+
if( isNativeValid() ) {
if( WindowClosingMode.DISPOSE_ON_CLOSE == mode ) {
if(force) {
@@ -3457,7 +3457,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
// send synced destroy notifications
sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
}
-
+
destroyed = !isNativeValid();
} else {
destroyed = true;
@@ -3465,19 +3465,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.windowDestroyNotify(isNativeValid: "+isNativeValid()+", force: "+force+", mode "+mode+") END "+getThreadName()+": destroyed "+destroyed+", "+this);
- }
-
+ }
+
return destroyed;
}
@Override
public void windowRepaint(int x, int y, int width, int height) {
- windowRepaint(false, x, y, width, height);
+ windowRepaint(false, x, y, width, height);
}
-
+
/**
* Triggered by implementation's WM events to update the content
- */
+ */
protected void windowRepaint(boolean defer, int x, int y, int width, int height) {
width = ( 0 >= width ) ? getWidth() : width;
height = ( 0 >= height ) ? getHeight() : height;
@@ -3542,7 +3542,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
protected final void shouldNotCallThis() {
throw new NativeWindowException("Should not call this");
}
-
+
public static String getThreadName() {
return Display.getThreadName();
}
diff --git a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
index 861a6d6be..2ba5b3460 100644
--- a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
+++ b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package jogamp.newt.awt;
import javax.media.nativewindow.AbstractGraphicsConfiguration;
@@ -76,12 +76,12 @@ public class NewtFactoryAWT extends NewtFactory {
}
return (JAWTWindow)nw;
}
-
+
public static void destroyNativeWindow(JAWTWindow jawtWindow) {
final AbstractGraphicsConfiguration config = jawtWindow.getGraphicsConfiguration();
jawtWindow.destroy();
- config.getScreen().getDevice().close();
+ config.getScreen().getDevice().close();
}
-
+
}
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
index d71ad175b..0ee3cc0cd 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,26 +20,26 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package jogamp.newt.awt.event;
import com.jogamp.newt.event.MouseEvent;
/**
*
- *
- *
+ *
* @param awtMods
* The AWT event modifiers.
- *
+ *
* @param awtModsEx
* The AWT extended event modifiers.
* AWT passes mouse button specific bits here and are the preferred way check the mouse button state.
*/
public static final int awtModifiers2Newt(final int awtMods, final int awtModsEx) {
int newtMods = 0;
-
+
/** Redundant old modifiers ..
if ((awtMods & java.awt.event.InputEvent.SHIFT_MASK) != 0) newtMods |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
if ((awtMods & java.awt.event.InputEvent.CTRL_MASK) != 0) newtMods |= com.jogamp.newt.event.InputEvent.CTRL_MASK;
if ((awtMods & java.awt.event.InputEvent.META_MASK) != 0) newtMods |= com.jogamp.newt.event.InputEvent.META_MASK;
if ((awtMods & java.awt.event.InputEvent.ALT_MASK) != 0) newtMods |= com.jogamp.newt.event.InputEvent.ALT_MASK;
if ((awtMods & java.awt.event.InputEvent.ALT_GRAPH_MASK) != 0) newtMods |= com.jogamp.newt.event.InputEvent.ALT_GRAPH_MASK; */
-
+
if ((awtModsEx & java.awt.event.InputEvent.SHIFT_DOWN_MASK) != 0) newtMods |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
if ((awtModsEx & java.awt.event.InputEvent.CTRL_DOWN_MASK) != 0) newtMods |= com.jogamp.newt.event.InputEvent.CTRL_MASK;
if ((awtModsEx & java.awt.event.InputEvent.META_DOWN_MASK) != 0) newtMods |= com.jogamp.newt.event.InputEvent.META_MASK;
@@ -221,7 +221,7 @@ public class AWTNewtEventFactory {
// being ignored intentionally. The AWT docs say that the
// BUTTON1_DOWN_MASK etc bits in the extended modifiers are
// the preferred place to check current button state.
-
+
if( 0 != awtModsEx ) {
for (int n = 0 ; n < awtButtonDownMasks.length ; ++n) {
if ( (awtModsEx & awtButtonDownMasks[n]) != 0 ) {
@@ -232,7 +232,7 @@ public class AWTNewtEventFactory {
return newtMods;
}
-
+
public static short awtKeyCode2NewtKeyCode(final int awtKeyCode) {
final short defNEWTKeyCode = (short)awtKeyCode;
switch (awtKeyCode) {
@@ -371,7 +371,7 @@ public class AWTNewtEventFactory {
case java.awt.event.KeyEvent.VK_MULTIPLY : return com.jogamp.newt.event.KeyEvent.VK_MULTIPLY;
case java.awt.event.KeyEvent.VK_DIVIDE : return com.jogamp.newt.event.KeyEvent.VK_DIVIDE;
case java.awt.event.KeyEvent.VK_NUM_LOCK : return com.jogamp.newt.event.KeyEvent.VK_NUM_LOCK;
- case java.awt.event.KeyEvent.VK_KP_LEFT : /** Fall through intended .. */
+ case java.awt.event.KeyEvent.VK_KP_LEFT : /** Fall through intended .. */
case java.awt.event.KeyEvent.VK_LEFT : return com.jogamp.newt.event.KeyEvent.VK_LEFT;
case java.awt.event.KeyEvent.VK_KP_UP : /** Fall through intended .. */
case java.awt.event.KeyEvent.VK_UP : return com.jogamp.newt.event.KeyEvent.VK_UP;
@@ -381,7 +381,7 @@ public class AWTNewtEventFactory {
case java.awt.event.KeyEvent.VK_DOWN : return com.jogamp.newt.event.KeyEvent.VK_DOWN;
case java.awt.event.KeyEvent.VK_CONTEXT_MENU : return com.jogamp.newt.event.KeyEvent.VK_CONTEXT_MENU;
case java.awt.event.KeyEvent.VK_WINDOWS : return com.jogamp.newt.event.KeyEvent.VK_WINDOWS;
- case java.awt.event.KeyEvent.VK_META : return com.jogamp.newt.event.KeyEvent.VK_META;
+ case java.awt.event.KeyEvent.VK_META : return com.jogamp.newt.event.KeyEvent.VK_META;
case java.awt.event.KeyEvent.VK_HELP : return com.jogamp.newt.event.KeyEvent.VK_HELP;
case java.awt.event.KeyEvent.VK_COMPOSE : return com.jogamp.newt.event.KeyEvent.VK_COMPOSE;
case java.awt.event.KeyEvent.VK_BEGIN : return com.jogamp.newt.event.KeyEvent.VK_BEGIN;
@@ -558,7 +558,7 @@ public class AWTNewtEventFactory {
case com.jogamp.newt.event.KeyEvent.VK_DOWN : return java.awt.event.KeyEvent.VK_DOWN;
case com.jogamp.newt.event.KeyEvent.VK_CONTEXT_MENU : return java.awt.event.KeyEvent.VK_CONTEXT_MENU;
case com.jogamp.newt.event.KeyEvent.VK_WINDOWS : return java.awt.event.KeyEvent.VK_WINDOWS;
- case com.jogamp.newt.event.KeyEvent.VK_META : return java.awt.event.KeyEvent.VK_META;
+ case com.jogamp.newt.event.KeyEvent.VK_META : return java.awt.event.KeyEvent.VK_META;
case com.jogamp.newt.event.KeyEvent.VK_HELP : return java.awt.event.KeyEvent.VK_HELP;
case com.jogamp.newt.event.KeyEvent.VK_COMPOSE : return java.awt.event.KeyEvent.VK_COMPOSE;
case com.jogamp.newt.event.KeyEvent.VK_BEGIN : return java.awt.event.KeyEvent.VK_BEGIN;
@@ -636,7 +636,7 @@ public class AWTNewtEventFactory {
}
return new com.jogamp.newt.event.MouseEvent(
newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
- mods, event.getX(), event.getY(), (short)event.getClickCount(),
+ mods, event.getX(), event.getY(), (short)event.getClickCount(),
newtButton, MouseEvent.getRotationXYZ(rotation, mods), 1f);
}
return null; // no mapping ..
@@ -650,11 +650,11 @@ public class AWTNewtEventFactory {
if( (short)0 != newtType ) {
final short newtKeyCode = awtKeyCode2NewtKeyCode( event.getKeyCode() );
return com.jogamp.newt.event.KeyEvent.create(
- newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
- awtModifiers2Newt(event.getModifiers(), event.getModifiersEx()),
+ newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
+ awtModifiers2Newt(event.getModifiers(), event.getModifiersEx()),
newtKeyCode, newtKeyCode, event.getKeyChar());
}
return null; // no mapping ..
}
-
+
}
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
index fa494adca..325f17278 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
*/
-
+
package jogamp.newt.awt.event;
import java.awt.KeyboardFocusManager;
@@ -45,7 +45,7 @@ import com.jogamp.newt.event.awt.AWTWindowAdapter;
public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt.event.HierarchyListener
{
NativeWindow downstreamParent;
-
+
public AWTParentWindowAdapter(NativeWindow downstreamParent, com.jogamp.newt.Window downstream) {
super(downstream);
this.downstreamParent = downstreamParent;
@@ -111,12 +111,12 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
public void componentMoved(java.awt.event.ComponentEvent e) {
if(DEBUG_IMPLEMENTATION) {
- System.err.println("AWT: componentMoved: "+e);
+ System.err.println("AWT: componentMoved: "+e);
}
final Window newtWindow = getNewtWindow();
if(newtWindow.getDelegatedWindow() instanceof DriverUpdatePosition) {
((DriverUpdatePosition)newtWindow.getDelegatedWindow()).updatePosition(0, 0);
- }
+ }
}
public void windowActivated(java.awt.event.WindowEvent e) {
@@ -130,7 +130,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
public void hierarchyChanged(java.awt.event.HierarchyEvent e) {
if( null == getNewtEventListener() ) {
long bits = e.getChangeFlags();
- final java.awt.Component changed = e.getChanged();
+ final java.awt.Component changed = e.getChanged();
if( 0 != ( java.awt.event.HierarchyEvent.SHOWING_CHANGED & bits ) ) {
final boolean showing = changed.isShowing();
if(DEBUG_IMPLEMENTATION) {
@@ -142,7 +142,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
getNewtWindow().setVisible(showing);
}
}});
- }
+ }
if(DEBUG_IMPLEMENTATION) {
if( 0 != ( java.awt.event.HierarchyEvent.DISPLAYABILITY_CHANGED & bits ) ) {
final boolean displayability = changed.isDisplayable();
diff --git a/src/newt/classes/jogamp/newt/driver/DriverClearFocus.java b/src/newt/classes/jogamp/newt/driver/DriverClearFocus.java
index 0a824e83b..0ff86fe93 100644
--- a/src/newt/classes/jogamp/newt/driver/DriverClearFocus.java
+++ b/src/newt/classes/jogamp/newt/driver/DriverClearFocus.java
@@ -1,10 +1,10 @@
package jogamp.newt.driver;
-/**
+/**
* Interface tagging driver requirement of clearing the focus.
*
- * Some drivers require a programmatic {@link #clearFocus()} when traversing the focus.
- *
+ * Some drivers require a programmatic {@link #clearFocus()} when traversing the focus.
+ *
*/
public interface DriverClearFocus {
/** Programmatic clear the focus */
diff --git a/src/newt/classes/jogamp/newt/driver/DriverUpdatePosition.java b/src/newt/classes/jogamp/newt/driver/DriverUpdatePosition.java
index 2ec327187..e5f9b6a68 100644
--- a/src/newt/classes/jogamp/newt/driver/DriverUpdatePosition.java
+++ b/src/newt/classes/jogamp/newt/driver/DriverUpdatePosition.java
@@ -1,14 +1,14 @@
package jogamp.newt.driver;
-/**
+/**
* Interface tagging driver requirement of absolute positioning, ie. depend on parent position.
*/
public interface DriverUpdatePosition {
- /**
+ /**
* Programmatic update the top-left corner
* of the client area relative to it's parent.
- *
- * @param x x-component
+ *
+ * @param x x-component
* @param y y-component
**/
void updatePosition(int x, int y);
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
index 9a1632130..14cc9c69d 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.awt;
@@ -100,7 +100,7 @@ public class AWTCanvas extends Canvas {
@Override
public void paint(Graphics g) {
}
-
+
public boolean hasDeviceChanged() {
boolean res = displayConfigChanged;
displayConfigChanged=false;
@@ -154,12 +154,12 @@ public class AWTCanvas extends Canvas {
public NativeWindow getNativeWindow() {
final JAWTWindow _jawtWindow = jawtWindow;
return (null != _jawtWindow) ? _jawtWindow : null;
- }
-
+ }
+
public boolean isOffscreenLayerSurfaceEnabled() {
- return null != jawtWindow ? jawtWindow.isOffscreenLayerSurfaceEnabled() : false;
+ return null != jawtWindow ? jawtWindow.isOffscreenLayerSurfaceEnabled() : false;
}
-
+
public void removeNotify() {
try {
dispose();
@@ -188,7 +188,7 @@ public class AWTCanvas extends Canvas {
}
}
}
-
+
private String getThreadName() { return Thread.currentThread().getName(); }
/**
@@ -200,7 +200,7 @@ public class AWTCanvas extends Canvas {
* Workaround for problems with Xinerama and java.awt.Component.checkGD
* when adding to a container on a different graphics device than the
* one that this Canvas is associated with.
- *
+ *
* GC will be null unless:
* - A native peer has assigned it. This means we have a native
* peer, and are already comitted to a graphics configuration.
@@ -214,7 +214,7 @@ public class AWTCanvas extends Canvas {
* chosen is only non-null on platforms where the GLDrawableFactory
* returns a non-null GraphicsConfiguration (in the GLCanvas
* constructor).
- *
+ *
* if gc is from this Canvas' native peer then it should equal chosen,
* otherwise it is from an ancestor component that this Canvas is being
* added to, and we go into this block.
@@ -224,21 +224,21 @@ public class AWTCanvas extends Canvas {
* Check for compatibility with gc. If they differ by only the
* device then return a new GCconfig with the super-class' GDevice
* (and presumably the same visual ID in Xinerama).
- *
+ *
*/
if (!chosen.getDevice().getIDstring().equals(gc.getDevice().getIDstring())) {
/*
* Here we select a GraphicsConfiguration on the alternate
* device that is presumably identical to the chosen
* configuration, but on the other device.
- *
+ *
* Should really check to ensure that we select a configuration
* with the same X visual ID for Xinerama screens, otherwise the
* GLDrawable may have the wrong visual ID (I don't think this
* ever gets updated). May need to add a method to
* X11GLDrawableFactory to do this in a platform specific
* manner.
- *
+ *
* However, on platforms where we can actually get into this
* block, both devices should have the same visual list, and the
* same configuration should be selected here.
@@ -265,7 +265,7 @@ public class AWTCanvas extends Canvas {
chosen = compatible;
if( !config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities())) {
displayConfigChanged=true;
- }
+ }
awtConfig = config;
}
}
@@ -275,7 +275,7 @@ public class AWTCanvas extends Canvas {
* return the GC that was selected in the constructor (and might
* cause an exception in Component.checkGD when adding to a
* container, but in this case that would be the desired behavior).
- *
+ *
*/
return chosen;
} else if (gc == null) {
@@ -299,7 +299,7 @@ public class AWTCanvas extends Canvas {
CapabilitiesImmutable capsRequested,
CapabilitiesChooser chooser,
GraphicsDevice device) {
- final AbstractGraphicsScreen aScreen = null != device ?
+ final AbstractGraphicsScreen aScreen = null != device ?
AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT):
AWTGraphicsScreen.createDefault();
AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
index 02f4be0cd..bddb43b30 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
@@ -40,9 +40,9 @@ import jogamp.newt.Debug;
public class AWTEDTUtil implements EDTUtil {
public static final boolean DEBUG = Debug.debug("EDT");
-
+
private final Object edtLock = new Object(); // locking the EDT start/stop state
- private final ThreadGroup threadGroup;
+ private final ThreadGroup threadGroup;
private final String name;
private final Runnable dispatchMessages;
private NEDT nedt = null;
@@ -66,7 +66,7 @@ public class AWTEDTUtil implements EDTUtil {
final public void setPollPeriod(long ms) {
pollPeriod = ms;
}
-
+
@Override
public final boolean start() throws IllegalStateException {
synchronized(edtLock) {
@@ -107,12 +107,12 @@ public class AWTEDTUtil implements EDTUtil {
public final boolean isCurrentThreadNEDT() {
return nedt == Thread.currentThread();
}
-
+
@Override
public final boolean isCurrentThreadEDTorNEDT() {
- return EventQueue.isDispatchThread() || nedt == Thread.currentThread();
+ return EventQueue.isDispatchThread() || nedt == Thread.currentThread();
}
-
+
@Override
final public boolean isRunning() {
return nedt.isRunning() ;
@@ -127,12 +127,12 @@ public class AWTEDTUtil implements EDTUtil {
public final boolean invoke(boolean wait, Runnable task) {
return invokeImpl(wait, task, false);
}
-
+
private static Runnable nullTask = new Runnable() {
@Override
- public void run() { }
+ public void run() { }
};
-
+
private final boolean invokeImpl(boolean wait, Runnable task, boolean stop) {
Throwable throwable = null;
RunnableTask rTask = null;
@@ -145,7 +145,7 @@ public class AWTEDTUtil implements EDTUtil {
if(DEBUG) {
Thread.dumpStack();
}
- return false;
+ return false;
}
if( isCurrentThreadEDT() ) {
if(null != task) {
@@ -181,7 +181,7 @@ public class AWTEDTUtil implements EDTUtil {
if(null != task) {
rTask = new RunnableTask(task,
wait ? rTaskLock : null,
- true /* always catch and report Exceptions, don't disturb EDT */,
+ true /* always catch and report Exceptions, don't disturb EDT */,
wait ? null : System.err);
AWTEDTExecutor.singleton.invoke(false, rTask);
}
@@ -205,7 +205,7 @@ public class AWTEDTUtil implements EDTUtil {
}
return true;
}
- }
+ }
@Override
final public boolean waitUntilIdle() {
@@ -241,7 +241,7 @@ public class AWTEDTUtil implements EDTUtil {
}
}
}
-
+
class NEDT extends Thread {
volatile boolean shouldStop = false;
volatile boolean isRunning = false;
@@ -261,7 +261,7 @@ public class AWTEDTUtil implements EDTUtil {
super.start();
}
- /**
+ /**
* Utilizing locking only on tasks and its execution,
* not for event dispatching.
*/
@@ -302,7 +302,7 @@ public class AWTEDTUtil implements EDTUtil {
}
} finally {
if(DEBUG) {
- System.err.println(getName()+": AWT-EDT run() END "+ getName()+", "+error);
+ System.err.println(getName()+": AWT-EDT run() END "+ getName()+", "+error);
}
synchronized(edtLock) {
isRunning = false;
@@ -317,7 +317,7 @@ public class AWTEDTUtil implements EDTUtil {
} // finally
} // run()
} // EventDispatchThread
-
+
}
diff --git a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
index 30449f9bc..9e716d544 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.awt;
@@ -57,7 +57,7 @@ public class DisplayDriver extends DisplayImpl {
protected EDTUtil createEDTUtil() {
final EDTUtil def;
if(NewtFactory.useEDT()) {
- def = new AWTEDTUtil(Thread.currentThread().getThreadGroup(), "AWTDisplay-"+getFQName(), dispatchMessagesRunnable);
+ def = new AWTEDTUtil(Thread.currentThread().getThreadGroup(), "AWTDisplay-"+getFQName(), dispatchMessagesRunnable);
if(DEBUG) {
System.err.println("Display.createNative("+getFQName()+") Create EDTUtil: "+def.getClass().getName());
}
@@ -67,7 +67,7 @@ public class DisplayDriver extends DisplayImpl {
return def;
}
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
aDevice.close();
}
diff --git a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
index 126143e1e..a2430e2bb 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
@@ -1,21 +1,21 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -28,7 +28,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.awt;
@@ -66,10 +66,10 @@ public class ScreenDriver extends ScreenImpl {
}
protected void closeNativeImpl() { }
-
+
protected int validateScreenIndex(int idx) {
- return idx; // pass through ...
- }
+ return idx; // pass through ...
+ }
private static MonitorMode getModeProps(Cache cache, DisplayMode mode) {
int rate = mode.getRefreshRate();
@@ -90,16 +90,16 @@ public class ScreenDriver extends ScreenImpl {
props[i++] = 0; // flags
props[i++] = 0; // mode_idx
props[i++] = 0; // rotation
- return MonitorModeProps.streamInMonitorMode(null, cache, props, 0);
+ return MonitorModeProps.streamInMonitorMode(null, cache, props, 0);
}
-
+
@Override
protected void collectNativeMonitorModesAndDevicesImpl(Cache cache) {
final GraphicsDevice awtGD = ((AWTGraphicsDevice)getDisplay().getGraphicsDevice()).getGraphicsDevice();
final DisplayMode[] awtModes = awtGD.getDisplayModes();
for(int i=0; i=0 || y>=0) {
System.err.println("BCEGL Window.setPositionImpl n/a in BroadcomEGL");
}
-
+
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
}
@@ -122,7 +122,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
protected void updateInsetsImpl(Insets insets) {
- // nop ..
+ // nop ..
}
@Override
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
index 4872a9071..52c92a5da 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -72,7 +72,7 @@ public class DisplayDriver extends DisplayImpl {
DispatchMessages();
}
- protected static native boolean initIDs();
+ protected static native boolean initIDs();
private native void DispatchMessages();
}
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
index be99052d7..5a1917419 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -53,9 +53,9 @@ public class ScreenDriver extends ScreenImpl {
protected void closeNativeImpl() { }
protected int validateScreenIndex(int idx) {
- return 0; // only one screen available
- }
-
+ return 0; // only one screen available
+ }
+
@Override
protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
@@ -92,20 +92,20 @@ public class ScreenDriver extends ScreenImpl {
protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
return false;
}
-
+
@Override
protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
vOriginSize.set(0, 0, cachedWidth, cachedHeight);
}
-
+
/** Called from {@link #initNative()}. */
protected void setScreenSize(int width, int height) {
cachedWidth = width;
cachedHeight = height;
}
-
+
private static int cachedWidth = 0;
- private static int cachedHeight = 0;
+ private static int cachedHeight = 0;
protected static native boolean initIDs();
protected native void initNative();
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
index e820439d0..560e49e96 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -65,7 +65,7 @@ public class WindowDriver extends WindowImpl {
final EGLGraphicsDevice aDevice = (EGLGraphicsDevice) aScreen.getDevice();
final EGLGraphicsDevice eglDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(aDevice.getNativeDisplayID(), aDevice.getConnection(), aDevice.getUnitID());
final DefaultGraphicsScreen eglScreen = new DefaultGraphicsScreen(eglDevice, aScreen.getIndex());
-
+
final AbstractGraphicsConfiguration cfg = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice(), capsRequested).chooseGraphicsConfiguration(
capsRequested, capsRequested, capabilitiesChooser, eglScreen, VisualIDHolder.VID_UNDEFINED);
if (null == cfg) {
@@ -89,24 +89,24 @@ public class WindowDriver extends WindowImpl {
windowHandleClose = nativeWindowHandle;
addWindowListener(LinuxMouseTracker.getSingleton());
addWindowListener(LinuxEventDeviceTracker.getSingleton());
- focusChanged(false, true);
+ focusChanged(false, true);
}
protected void closeNativeImpl() {
final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) getGraphicsConfiguration().getScreen().getDevice();
-
+
removeWindowListener(LinuxMouseTracker.getSingleton());
removeWindowListener(LinuxEventDeviceTracker.getSingleton());
-
+
if(0!=windowHandleClose) {
CloseWindow(windowHandleClose, windowUserData);
windowUserData=0;
}
-
+
eglDevice.close();
}
- protected void requestFocusImpl(boolean reparented) {
+ protected void requestFocusImpl(boolean reparented) {
focusChanged(false, true);
}
@@ -115,7 +115,7 @@ public class WindowDriver extends WindowImpl {
setVisible0(nativeWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
}
-
+
if(0!=nativeWindowHandle) {
if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) {
final boolean fs = 0 != ( FLAG_IS_FULLSCREEN & flags) ;
@@ -135,11 +135,11 @@ public class WindowDriver extends WindowImpl {
System.err.println("setPosition n/a in KD");
}
}
-
+
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
}
-
+
return true;
}
@@ -148,9 +148,9 @@ public class WindowDriver extends WindowImpl {
}
protected void updateInsetsImpl(Insets insets) {
- // nop ..
+ // nop ..
}
-
+
//----------------------------------------------------------------------
// Internals only
//
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
index ee93eb932..4cb566bc2 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.intel.gdl;
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
index 27b776562..b5202aaf9 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.intel.gdl;
@@ -62,9 +62,9 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
protected void closeNativeImpl() { }
protected int validateScreenIndex(int idx) {
- return 0; // only one screen available
+ return 0; // only one screen available
}
-
+
@Override
protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
@@ -101,11 +101,11 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
return false;
}
-
+
protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
vOriginSize.set(0, 0, cachedWidth, cachedHeight);
}
-
+
//----------------------------------------------------------------------
// Internals only
//
@@ -118,7 +118,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
cachedWidth = width;
cachedHeight = height;
}
-
+
private static int cachedWidth = 0;
private static int cachedHeight = 0;
}
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
index 98335f192..80821d4da 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.intel.gdl;
@@ -108,7 +108,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
}
-
+
return true;
}
@@ -126,9 +126,9 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
protected void updateInsetsImpl(Insets insets) {
- // nop ..
+ // nop ..
}
-
+
//----------------------------------------------------------------------
// Internals only
//
diff --git a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
index 3cd72e971..1b92ca586 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.kd;
diff --git a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
index f893275ca..17cc5dd2f 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.kd;
@@ -58,9 +58,9 @@ public class ScreenDriver extends ScreenImpl {
protected void closeNativeImpl() { }
protected int validateScreenIndex(int idx) {
- return 0; // only one screen available
- }
-
+ return 0; // only one screen available
+ }
+
@Override
protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
@@ -97,16 +97,16 @@ public class ScreenDriver extends ScreenImpl {
protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
return false;
}
-
+
protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
vOriginSize.set(0, 0, cachedWidth, cachedHeight);
}
-
+
protected void sizeChanged(int w, int h) {
cachedWidth = w;
cachedHeight = h;
}
-
+
private static int cachedWidth = 0;
- private static int cachedHeight = 0;
+ private static int cachedHeight = 0;
}
diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
index c733a3e94..d30d4f025 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.kd;
@@ -97,7 +97,7 @@ public class WindowDriver extends WindowImpl {
setVisible0(eglWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
}
-
+
if(0!=eglWindowHandle) {
if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) {
final boolean fs = 0 != ( FLAG_IS_FULLSCREEN & flags) ;
@@ -117,11 +117,11 @@ public class WindowDriver extends WindowImpl {
System.err.println("setPosition n/a in KD");
}
}
-
+
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
}
-
+
return true;
}
@@ -130,9 +130,9 @@ public class WindowDriver extends WindowImpl {
}
protected void updateInsetsImpl(Insets insets) {
- // nop ..
+ // nop ..
}
-
+
//----------------------------------------------------------------------
// Internals only
//
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
index e68b91d82..b7c86a26d 100644
--- a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
+++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -126,7 +126,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
try {
while(true) {
Thread.sleep(1000);
- }
+ }
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
@@ -186,7 +186,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
/**
* The Linux input event interface.
* http://www.kernel.org/doc/Documentation/input/input.txt
- *
+ *
* struct input_event {
* struct timeval time;
* unsigned short type;
@@ -262,7 +262,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
break;
case 1: // EV_KEY
keyCode = LinuxEVKey2NewtVKey(code); // The device independent code.
- keyChar = NewtVKey2Unicode(keyCode, modifiers); // The printable character w/ key modifiers.
+ keyChar = NewtVKey2Unicode(keyCode, modifiers); // The printable character w/ key modifiers.
if(Window.DEBUG_KEY_EVENT) {
System.out.println("[EV_KEY: [time "+timeSeconds+":"+timeSecondFraction+"] type "+type+" / code "+code+" = value "+value);
}
@@ -946,7 +946,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
case 248: // mic mute
break; // FIXME
- default:
+ default:
}
if(Window.DEBUG_KEY_EVENT) {
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
index 0d6278bfb..1e314b7f4 100644
--- a/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
+++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -48,16 +48,16 @@ import com.jogamp.newt.event.WindowUpdateEvent;
* within it's own polling thread.
*/
public class LinuxMouseTracker implements WindowListener {
-
+
private static final LinuxMouseTracker lmt;
-
+
static {
lmt = new LinuxMouseTracker();
final Thread t = new Thread(lmt.mouseDevicePoller, "NEWT-LinuxMouseTracker");
t.setDaemon(true);
t.start();
}
-
+
public static LinuxMouseTracker getSingleton() {
return lmt;
}
@@ -71,7 +71,7 @@ public class LinuxMouseTracker implements WindowListener {
private short old_buttonDown = 0;
private WindowImpl focusedWindow = null;
private MouseDevicePoller mouseDevicePoller = new MouseDevicePoller();
-
+
@Override
public void windowResized(WindowEvent e) { }
@@ -107,7 +107,7 @@ public class LinuxMouseTracker implements WindowListener {
@Override
public void windowRepaint(WindowUpdateEvent e) { }
-
+
class MouseDevicePoller implements Runnable {
@Override
public void run() {
@@ -150,17 +150,17 @@ public class LinuxMouseTracker implements WindowListener {
yo=(b[0]&128)>0;
xd=b[1];
yd=b[2];
-
+
x+=xd;
y-=yd;
-
+
if(x<0) {
x=0;
}
if(y<0) {
y=0;
}
-
+
buttonDown = 0;
if(lb) {
buttonDown = MouseEvent.BUTTON1;
@@ -171,7 +171,7 @@ public class LinuxMouseTracker implements WindowListener {
if(rb) {
buttonDown = MouseEvent.BUTTON3;
}
-
+
if(null != focusedWindow) {
if( x >= focusedWindow.getScreen().getWidth() ) {
x = focusedWindow.getScreen().getWidth() - 1;
@@ -179,31 +179,31 @@ public class LinuxMouseTracker implements WindowListener {
if( y >= focusedWindow.getScreen().getHeight() ) {
y = focusedWindow.getScreen().getHeight() - 1;
}
- int wx = x - focusedWindow.getX(), wy = y - focusedWindow.getY();
-
+ int wx = x - focusedWindow.getX(), wy = y - focusedWindow.getY();
+
if(old_x != x || old_y != y) {
// mouse moved
- focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_MOVED, 0, wx, wy, (short)0, 0 );
+ focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_MOVED, 0, wx, wy, (short)0, 0 );
}
-
+
if(old_buttonDown != buttonDown) {
// press/release
if( 0 != buttonDown ) {
- focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_PRESSED, 0, wx, wy, buttonDown, 0 );
+ focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_PRESSED, 0, wx, wy, buttonDown, 0 );
} else {
- focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_RELEASED, 0, wx, wy, old_buttonDown, 0 );
+ focusedWindow.sendMouseEvent(MouseEvent.EVENT_MOUSE_RELEASED, 0, wx, wy, old_buttonDown, 0 );
}
- }
+ }
} else {
if(Window.DEBUG_MOUSE_EVENT) {
System.out.println(x+"/"+y+", hs="+hs+",vs="+vs+",lb="+lb+",rb="+rb+",mb="+mb+",xo="+xo+",yo="+yo+"xd="+xd+",yd="+yd);
}
}
-
+
old_x = x;
old_y = y;
old_buttonDown = buttonDown;
-
+
}
if(null != fis) {
try {
@@ -214,5 +214,5 @@ public class LinuxMouseTracker implements WindowListener {
}
}
}
- }
+ }
}
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
index a99bc4f23..2dbdfdce7 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2012 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.macosx;
@@ -60,19 +60,19 @@ public class DisplayDriver extends DisplayImpl {
public static void initSingleton() {
// just exist to ensure static init has been run
}
-
+
public DisplayDriver() {
}
protected void dispatchMessagesNative() {
// nop
}
-
+
protected void createNativeImpl() {
aDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
}
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
aDevice.close();
}
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
index baa94facd..a89150d7c 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
@@ -3,14 +3,14 @@
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
- *
+ *
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
- *
+ *
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of JogAmp Community.
@@ -30,7 +30,7 @@ package jogamp.newt.driver.macosx;
import com.jogamp.newt.event.KeyEvent;
public class MacKeyUtil {
-
+
//
// KeyCodes (Layout Dependent)
//
@@ -64,17 +64,17 @@ public class MacKeyUtil {
private static final short kVK_ANSI_8 = 0x1C;
private static final short kVK_ANSI_0 = 0x1D;
private static final short kVK_ANSI_RightBracket = 0x1E;
- private static final short kVK_ANSI_O = 0x1F;
+ private static final short kVK_ANSI_O = 0x1F;
private static final short kVK_ANSI_U = 0x20;
private static final short kVK_ANSI_LeftBracket = 0x21;
private static final short kVK_ANSI_I = 0x22;
private static final short kVK_ANSI_P = 0x23;
private static final short kVK_ANSI_L = 0x25;
private static final short kVK_ANSI_J = 0x26;
- private static final short kVK_ANSI_Quote = 0x27;
+ private static final short kVK_ANSI_Quote = 0x27;
private static final short kVK_ANSI_K = 0x28;
private static final short kVK_ANSI_Semicolon = 0x29;
- private static final short kVK_ANSI_Backslash = 0x2A;
+ private static final short kVK_ANSI_Backslash = 0x2A;
private static final short kVK_ANSI_Comma = 0x2B;
private static final short kVK_ANSI_Slash = 0x2C;
private static final short kVK_ANSI_N = 0x2D;
@@ -99,7 +99,7 @@ public class MacKeyUtil {
private static final short kVK_ANSI_Keypad7 = 0x59;
private static final short kVK_ANSI_Keypad8 = 0x5B;
private static final short kVK_ANSI_Keypad9 = 0x5C;
-
+
//
// KeyCodes (Layout Independent)
//
@@ -150,7 +150,7 @@ public class MacKeyUtil {
private static final short kVK_RightArrow = 0x7C;
private static final short kVK_DownArrow = 0x7D;
private static final short kVK_UpArrow = 0x7E;
-
+
//
// Key constants handled differently on Mac OS X than other platforms
//
@@ -230,8 +230,8 @@ public class MacKeyUtil {
private static final char NSHelpFunctionKey = 0xF746;
private static final char NSModeSwitchFunctionKey = 0xF747;
*/
-
- static short validateKeyCode(short keyCode, char keyChar) {
+
+ static short validateKeyCode(short keyCode, char keyChar) {
// OS X Virtual Keycodes
switch(keyCode) {
//
@@ -267,17 +267,17 @@ public class MacKeyUtil {
case kVK_ANSI_8: return KeyEvent.VK_8;
case kVK_ANSI_0: return KeyEvent.VK_0;
case kVK_ANSI_RightBracket: return KeyEvent.VK_CLOSE_BRACKET;
- case kVK_ANSI_O: return KeyEvent.VK_O;
+ case kVK_ANSI_O: return KeyEvent.VK_O;
case kVK_ANSI_U: return KeyEvent.VK_U;
case kVK_ANSI_LeftBracket: return KeyEvent.VK_OPEN_BRACKET;
case kVK_ANSI_I: return KeyEvent.VK_I;
case kVK_ANSI_P: return KeyEvent.VK_P;
case kVK_ANSI_L: return KeyEvent.VK_L;
case kVK_ANSI_J: return KeyEvent.VK_J;
- case kVK_ANSI_Quote: return KeyEvent.VK_QUOTE;
+ case kVK_ANSI_Quote: return KeyEvent.VK_QUOTE;
case kVK_ANSI_K: return KeyEvent.VK_K;
case kVK_ANSI_Semicolon: return KeyEvent.VK_SEMICOLON;
- case kVK_ANSI_Backslash: return KeyEvent.VK_BACK_SLASH;
+ case kVK_ANSI_Backslash: return KeyEvent.VK_BACK_SLASH;
case kVK_ANSI_Comma: return KeyEvent.VK_COMMA;
case kVK_ANSI_Slash: return KeyEvent.VK_SLASH;
case kVK_ANSI_N: return KeyEvent.VK_N;
@@ -302,7 +302,7 @@ public class MacKeyUtil {
case kVK_ANSI_Keypad7: return KeyEvent.VK_7;
case kVK_ANSI_Keypad8: return KeyEvent.VK_8;
case kVK_ANSI_Keypad9: return KeyEvent.VK_9;
-
+
//
// KeyCodes (Layout Independent)
//
@@ -321,7 +321,7 @@ public class MacKeyUtil {
case kVK_RightControl: return KeyEvent.VK_CONTROL;
// case kVK_Function: return KeyEvent.VK_F;
case kVK_F17: return KeyEvent.VK_F17;
- // case kVK_VolumeUp:
+ // case kVK_VolumeUp:
// case kVK_VolumeDown:
// case kVK_Mute:
case kVK_F18: return KeyEvent.VK_F18;
@@ -354,7 +354,7 @@ public class MacKeyUtil {
case kVK_DownArrow: return KeyEvent.VK_DOWN;
case kVK_UpArrow: return KeyEvent.VK_UP;
}
-
+
switch (keyChar) {
case NSUpArrowFunctionKey: return KeyEvent.VK_UP;
case NSDownArrowFunctionKey: return KeyEvent.VK_DOWN;
@@ -422,5 +422,5 @@ public class MacKeyUtil {
}
return (short) keyChar; // let's hope for the best (compatibility of keyChar/keyCode's)
- }
+ }
}
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
index a3bb26731..5d3b7287b 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2011 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.macosx;
@@ -44,7 +44,7 @@ import com.jogamp.newt.MonitorDevice;
import com.jogamp.newt.MonitorMode;
public class ScreenDriver extends ScreenImpl {
-
+
static {
DisplayDriver.initSingleton();
}
@@ -68,7 +68,7 @@ public class ScreenDriver extends ScreenImpl {
}
return res;
}
-
+
@Override
protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
int crtIdx = 0;
@@ -85,16 +85,16 @@ public class ScreenDriver extends ScreenImpl {
final MonitorMode currentMode = getMonitorModeImpl(cache, crtIdx, -1);
if ( null == currentMode ) {
throw new InternalError("Could not gather current mode of device "+crtIdx+", but gathered "+modeIdx+" modes");
- }
+ }
final int[] monitorProps = getMonitorProps0(crtIdx);
if ( null == monitorProps ) {
throw new InternalError("Could not gather device "+crtIdx+", but gathered "+modeIdx+" modes");
- }
+ }
// merge monitor-props + supported modes
MonitorModeProps.streamInMonitorDevice(null, cache, this, supportedModes, currentMode, monitorProps, 0);
-
+
// next monitor, 1st mode
- supportedModes= new ArrayHashSet();
+ supportedModes= new ArrayHashSet();
crtIdx++;
modeIdx=0;
} else {
@@ -108,16 +108,16 @@ public class ScreenDriver extends ScreenImpl {
protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
return getMonitorModeImpl(null, monitor.getId(), -1);
}
-
+
@Override
protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode) {
return setMonitorMode0(monitor.getId(), mode.getId(), mode.getRotation());
}
-
+
protected int validateScreenIndex(int idx) {
- return 0; // big-desktop w/ multiple monitor attached, only one screen available
+ return 0; // big-desktop w/ multiple monitor attached, only one screen available
}
-
+
private native int[] getMonitorProps0(int crt_idx);
private native int[] getMonitorMode0(int crt_index, int mode_idx);
private native boolean setMonitorMode0(int crt_index, int nativeId, int rot);
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
index 08638d868..f36d32772 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.macosx;
@@ -53,14 +53,14 @@ import com.jogamp.newt.event.InputEvent;
import com.jogamp.newt.event.KeyEvent;
public class WindowDriver extends WindowImpl implements MutableSurface, DriverClearFocus, DriverUpdatePosition {
-
+
static {
DisplayDriver.initSingleton();
}
public WindowDriver() {
}
-
+
@Override
protected void createNativeImpl() {
final AbstractGraphicsConfiguration cfg = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice(), capsRequested).chooseGraphicsConfiguration(
@@ -69,7 +69,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
setGraphicsConfiguration(cfg);
- reconfigureWindowImpl(getX(), getY(), getWidth(), getHeight(), getReconfigureFlags(FLAG_CHANGE_VISIBILITY, true));
+ reconfigureWindowImpl(getX(), getY(), getWidth(), getHeight(), getReconfigureFlags(FLAG_CHANGE_VISIBILITY, true));
if (0 == getWindowHandle()) {
throw new NativeWindowException("Error creating window");
}
@@ -79,7 +79,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
protected void closeNativeImpl() {
try {
if(DEBUG_IMPLEMENTATION) { System.err.println("MacWindow.CloseAction "+Thread.currentThread().getName()); }
- final long handle = getWindowHandle();
+ final long handle = getWindowHandle();
visibleChanged(true, false);
setWindowHandle(0);
surfaceHandle = 0;
@@ -92,16 +92,16 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
} } );
}
} catch (Throwable t) {
- if(DEBUG_IMPLEMENTATION) {
+ if(DEBUG_IMPLEMENTATION) {
Exception e = new Exception("Warning: closeNative failed - "+Thread.currentThread().getName(), t);
e.printStackTrace();
}
}
}
-
+
@Override
protected int lockSurfaceImpl() {
- /**
+ /**
* if( isOffscreenInstance ) {
* return LOCK_SUCCESS;
* }
@@ -116,7 +116,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
@Override
protected void unlockSurfaceImpl() {
- /**
+ /**
* if( isOffscreenInstance ) {
* return;
* }
@@ -129,7 +129,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
}
}
-
+
@Override
public final long getSurfaceHandle() {
return 0 != sscSurfaceHandle ? sscSurfaceHandle : surfaceHandle;
@@ -147,14 +147,14 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
public void run() {
orderOut0( 0 != getParentWindowHandle() ? getParentWindowHandle() : getWindowHandle() );
} } );
- } /** this is done by recreation!
+ } /** this is done by recreation!
else if (isVisible()){
OSXUtil.RunOnMainThread(false, new Runnable() {
public void run() {
orderFront0( 0!=getParentWindowHandle() ? getParentWindowHandle() : getWindowHandle() );
} } );
} */
- }
+ }
}
@Override
@@ -179,7 +179,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
focusChanged(false, true);
}
}
-
+
@Override
public final void clearFocus() {
if(DEBUG_IMPLEMENTATION) {
@@ -194,9 +194,9 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
focusChanged(false, false);
}
}
-
+
private boolean useParent(NativeWindow parent) { return null != parent && 0 != parent.getWindowHandle(); }
-
+
@Override
public void updatePosition(int x, int y) {
final long handle = getWindowHandle();
@@ -215,8 +215,8 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
// no native event (fullscreen, some reparenting)
positionChanged(true, x, y);
}
- }
-
+ }
+
@Override
protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
final long handle = getWindowHandle();
@@ -237,7 +237,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
super.sizeChanged(defer, newWidth, newHeight, force);
}
-
+
@Override
protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, int flags) {
final boolean _isOffscreenInstance = isOffscreenInstance(this, this.getParent());
@@ -250,11 +250,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
final boolean useParent = useParent(parent);
if( useParent ) {
pClientLevelOnSreen = getLocationOnScreenImpl(x, y, parent, useParent);
- } else {
+ } else {
pClientLevelOnSreen = new Point(x, y);
}
}
-
+
if(DEBUG_IMPLEMENTATION) {
final AbstractGraphicsConfiguration cWinCfg = this.getGraphicsConfiguration();
final NativeWindow pWin = getParent();
@@ -269,9 +269,9 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
"\n\t, "+getReconfigureFlagsAsString(null, flags));
// Thread.dumpStack();
}
-
+
final boolean setVisible = 0 != ( FLAG_IS_VISIBLE & flags);
-
+
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && !setVisible ) {
if ( !isOffscreenInstance ) {
OSXUtil.RunOnMainThread(false, new Runnable() {
@@ -290,11 +290,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
if(isOffscreenInstance) {
createWindow(true, 0 != getWindowHandle(), pClientLevelOnSreen, 64, 64, false, setVisible, false);
} else {
- createWindow(false, 0 != getWindowHandle(), pClientLevelOnSreen, width, height,
+ createWindow(false, 0 != getWindowHandle(), pClientLevelOnSreen, width, height,
0 != ( FLAG_IS_FULLSCREEN & flags), setVisible, 0 != ( FLAG_IS_ALWAYSONTOP & flags));
}
} else {
- if( width>0 && height>0 ) {
+ if( width>0 && height>0 ) {
if( !isOffscreenInstance ) {
OSXUtil.RunOnMainThread(false, new Runnable() {
public void run() {
@@ -306,7 +306,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
sizeChanged(true, width, height, false);
}
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && setVisible ) {
- if( !isOffscreenInstance ) {
+ if( !isOffscreenInstance ) {
OSXUtil.RunOnMainThread(false, new Runnable() {
public void run() {
orderFront0(getWindowHandle());
@@ -321,7 +321,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
}
if(DEBUG_IMPLEMENTATION) {
- System.err.println("MacWindow reconfig.X: clientPos "+pClientLevelOnSreen+", "+width+"x"+height+" -> clientPos "+getLocationOnScreenImpl(0, 0)+", insets: "+getInsets());
+ System.err.println("MacWindow reconfig.X: clientPos "+pClientLevelOnSreen+", "+width+"x"+height+" -> clientPos "+getLocationOnScreenImpl(0, 0)+", insets: "+getInsets());
}
return true;
}
@@ -332,28 +332,28 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
final boolean useParent = useParent(parent);
return getLocationOnScreenImpl(x, y, parent, useParent);
}
-
+
private Point getLocationOnScreenImpl(final int x, final int y, final NativeWindow parent, final boolean useParent) {
if( !useParent && !isOffscreenInstance && 0 != surfaceHandle) {
return OSXUtil.GetLocationOnScreen(surfaceHandle, true, x, y);
}
-
+
final Point p = new Point(x, y);
if( useParent ) {
p.translate( parent.getLocationOnScreen(null) );
}
return p;
}
-
+
@Override
protected void updateInsetsImpl(Insets insets) {
// nop - using event driven insetsChange(..)
}
-
+
/** Callback for native screen position change event of the client area. */
- protected void screenPositionChanged(boolean defer, int newX, int newY) {
+ protected void screenPositionChanged(boolean defer, int newX, int newY) {
// passed coordinates are in screen position of the client area
- if(getWindowHandle()!=0) {
+ if(getWindowHandle()!=0) {
final NativeWindow parent = getParent();
if( null == parent || isOffscreenInstance ) {
if(DEBUG_IMPLEMENTATION) {
@@ -362,7 +362,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
positionChanged(defer, newX, newY);
} else {
// screen position -> rel child window position
- Point absPos = new Point(newX, newY);
+ Point absPos = new Point(newX, newY);
Point parentOnScreen = parent.getLocationOnScreen(null);
absPos.translate( parentOnScreen.scale(-1, -1) );
if(DEBUG_IMPLEMENTATION) {
@@ -374,10 +374,10 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
System.err.println("MacWindow.positionChanged.2 (Screen Pos - IGN): ("+getThreadName()+"): (defer: "+defer+") "+getX()+"/"+getY()+" -> "+newX+"/"+newY);
}
}
-
+
@Override
protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
- if( !isOffscreenInstance ) {
+ if( !isOffscreenInstance ) {
return setPointerVisible0(getWindowHandle(), hasFocus(), pointerVisible);
} // else may need offscreen solution ? FIXME
return false;
@@ -385,29 +385,29 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
@Override
protected boolean confinePointerImpl(final boolean confine) {
- if( !isOffscreenInstance ) {
+ if( !isOffscreenInstance ) {
return confinePointer0(getWindowHandle(), confine);
} // else may need offscreen solution ? FIXME
return false;
}
-
+
@Override
protected void warpPointerImpl(final int x, final int y) {
- if( !isOffscreenInstance ) {
+ if( !isOffscreenInstance ) {
warpPointer0(getWindowHandle(), x, y);
} // else may need offscreen solution ? FIXME
}
-
+
@Override
public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
}
-
+
@Override
public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short _keyCode, short _keySym, char keyChar) {
- throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
+ throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
}
-
+
protected final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short _keyCode, char keyChar, char keySymChar) {
// Note that we send the key char for the key code on this
// platform -- we do not get any useful key codes out of the system
@@ -427,7 +427,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
", was: pressed "+isKeyPressed(keyCode)+", isModifierKeyCode "+isModifierKeyCode+
", nativeValid "+isNativeValid()+", isOffscreen "+isOffscreenInstance);
} */
-
+
// OSX delivery order is PRESSED (t0), RELEASED (t1) and TYPED (t2) -> NEWT order: PRESSED (t0) and RELEASED (t1)
// Auto-Repeat: OSX delivers only PRESSED, inject auto-repeat RELEASE key _before_ PRESSED
switch(eventType) {
@@ -451,15 +451,15 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
//----------------------------------------------------------------------
// Internals only
- //
-
- private void createWindow(final boolean offscreenInstance, final boolean recreate,
- final PointImmutable pS, final int width, final int height,
+ //
+
+ private void createWindow(final boolean offscreenInstance, final boolean recreate,
+ final PointImmutable pS, final int width, final int height,
final boolean fullscreen, final boolean visible, final boolean alwaysOnTop) {
final long parentWinHandle = getParentWindowHandle();
final long preWinHandle = getWindowHandle();
-
+
if(DEBUG_IMPLEMENTATION) {
System.err.println("MacWindow.createWindow on thread "+Thread.currentThread().getName()+
": offscreen "+offscreenInstance+", recreate "+recreate+
@@ -474,7 +474,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
setWindowHandle(0);
if( 0 == surfaceHandle ) {
throw new NativeWindowException("Internal Error - create w/ window, but no Newt NSView");
- }
+ }
OSXUtil.RunOnMainThread(false, new Runnable() {
public void run() {
changeContentView0(parentWinHandle, preWinHandle, 0);
@@ -483,14 +483,14 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
} else {
if( 0 != surfaceHandle ) {
throw new NativeWindowException("Internal Error - create w/o window, but has Newt NSView");
- }
+ }
surfaceHandle = createView0(pS.getX(), pS.getY(), width, height, fullscreen);
if( 0 == surfaceHandle ) {
throw new NativeWindowException("Could not create native view "+Thread.currentThread().getName()+" "+this);
}
}
-
- final long newWin = createWindow0( pS.getX(), pS.getY(), width, height, fullscreen,
+
+ final long newWin = createWindow0( pS.getX(), pS.getY(), width, height, fullscreen,
( isUndecorated() || offscreenInstance ) ? NSBorderlessWindowMask :
NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask,
NSBackingStoreBuffered, surfaceHandle);
@@ -498,9 +498,9 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
throw new NativeWindowException("Could not create native window "+Thread.currentThread().getName()+" "+this);
}
setWindowHandle( newWin );
-
+
final boolean isOpaque = getGraphicsConfiguration().getChosenCapabilities().isBackgroundOpaque() && !offscreenInstance;
- // Blocking initialization on main-thread!
+ // Blocking initialization on main-thread!
OSXUtil.RunOnMainThread(true, new Runnable() {
public void run() {
initWindow0( parentWinHandle, newWin, pS.getX(), pS.getY(), width, height,
@@ -517,7 +517,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
ie.printStackTrace();
}
}
-
+
protected static native boolean initIDs0();
private native long createView0(int x, int y, int w, int h, boolean fullscreen);
private native long createWindow0(int x, int y, int w, int h, boolean fullscreen, int windowStyle, int backingStoreType, long view);
@@ -543,7 +543,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
private native void changeContentView0(long parentWindowOrView, long window, long view);
/** Must be called on Main-Thread */
private native void setWindowClientTopLeftPointAndSize0(long window, int x, int y, int w, int h, boolean display);
- /** Must be called on Main-Thread */
+ /** Must be called on Main-Thread */
private native void setWindowClientTopLeftPoint0(long window, int x, int y, boolean display);
/** Must be called on Main-Thread */
private native void setAlwaysOnTop0(long window, boolean atop);
@@ -551,7 +551,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
private static native boolean setPointerVisible0(long windowHandle, boolean hasFocus, boolean visible);
private static native boolean confinePointer0(long windowHandle, boolean confine);
private static native void warpPointer0(long windowHandle, int x, int y);
-
+
// Window styles
private static final int NSBorderlessWindowMask = 0;
private static final int NSTitledWindowMask = 1 << 0;
@@ -567,5 +567,5 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
private volatile long surfaceHandle = 0;
private long sscSurfaceHandle = 0;
private boolean isOffscreenInstance = false;
-
+
}
diff --git a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
index 595d5e952..d3c7416cc 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.windows;
@@ -52,10 +52,10 @@ public class DisplayDriver extends DisplayImpl {
NEWTJNILibLoader.loadNEWT();
sharedClassFactory = new RegisteredClassFactory(newtClassBaseName, WindowDriver.getNewtWndProc0());
-
+
if (!WindowDriver.initIDs0(RegisteredClassFactory.getHInstance())) {
throw new NativeWindowException("Failed to initialize WindowsWindow jmethodIDs");
- }
+ }
}
public static void initSingleton() {
@@ -76,7 +76,7 @@ public class DisplayDriver extends DisplayImpl {
aDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
}
- protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+ protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
sharedClassFactory.releaseSharedClass();
aDevice.close();
}
diff --git a/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
index 621091320..e789b995f 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.windows;
@@ -60,7 +60,7 @@ public class ScreenDriver extends ScreenImpl {
protected void createNativeImpl() {
aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
}
-
+
@Override
protected void closeNativeImpl() {
}
@@ -71,7 +71,7 @@ public class ScreenDriver extends ScreenImpl {
private final String getActiveMonitorName(String adapterName, int monitor_idx) {
return getActiveMonitorName0(adapterName, monitor_idx);
}
-
+
private final MonitorMode getMonitorModeImpl(MonitorModeProps.Cache cache, String adapterName, int crtModeIdx) {
if( null == adapterName ) {
return null;
@@ -107,7 +107,7 @@ public class ScreenDriver extends ScreenImpl {
final int[] monitorProps = getMonitorDevice0(adapterName, crtIdx);
// merge monitor-props + supported modes
MonitorModeProps.streamInMonitorDevice(null, cache, this, supportedModes, currentMode, monitorProps, 0);
-
+
// next monitor, 1st mode
supportedModes= new ArrayHashSet();
}
@@ -116,7 +116,7 @@ public class ScreenDriver extends ScreenImpl {
adapterName = getAdapterName(crtIdx);
}
}
-
+
@Override
protected Rectangle getNativeMonitorDeviceViewportImpl(MonitorDevice monitor) {
final String adapterName = getAdapterName(monitor.getId());
@@ -135,7 +135,7 @@ public class ScreenDriver extends ScreenImpl {
protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
return getMonitorModeImpl(null, getAdapterName(monitor.getId()), -1);
}
-
+
@Override
protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode) {
return setMonitorMode0(monitor.getId(),
@@ -150,14 +150,14 @@ public class ScreenDriver extends ScreenImpl {
@Override
protected int validateScreenIndex(int idx) {
- return 0; // big-desktop w/ multiple monitor attached, only one screen available
+ return 0; // big-desktop w/ multiple monitor attached, only one screen available
}
-
+
@Override
protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
vOriginSize.set(getVirtualOriginX0(), getVirtualOriginY0(), getVirtualWidthImpl0(), getVirtualHeightImpl0());
}
-
+
// Native calls
private native int getVirtualOriginX0();
private native int getVirtualOriginY0();
diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
index b2e175415..30405aa05 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.windows;
@@ -74,26 +74,26 @@ public class WindowDriver extends WindowImpl {
}
final long hWnd = getWindowHandle();
hdc = GDI.GetDC(hWnd);
-
+
// return ( 0 == hdc ) ? LOCK_SURFACE_NOT_READY : ( hdc_old != hdc ) ? LOCK_SURFACE_CHANGED : LOCK_SUCCESS ;
- if( 0 == hdc ) {
+ if( 0 == hdc ) {
return LOCK_SURFACE_NOT_READY;
- }
+ }
hmon = MonitorFromWindow0(hWnd);
-
+
// Let's not trigger on HDC change, GLDrawableImpl.'s destroy/create is a nop here anyways.
// FIXME: Validate against EGL surface creation: ANGLE uses HWND -> fine!
- return LOCK_SUCCESS;
-
+ return LOCK_SUCCESS;
+
/**
if( hdc_old == hdc ) {
return LOCK_SUCCESS;
}
- if(DEBUG_IMPLEMENTATION) {
+ if(DEBUG_IMPLEMENTATION) {
System.err.println("WindowsWindow: surface change "+toHexString(hdc_old)+" -> "+toHexString(hdc));
// Thread.dumpStack();
}
- return LOCK_SURFACE_CHANGED; */
+ return LOCK_SURFACE_CHANGED; */
}
@Override
@@ -137,24 +137,24 @@ public class WindowDriver extends WindowImpl {
}
setGraphicsConfiguration(cfg);
final VersionNumber winVer = Platform.getOSVersionNumber();
- final int flags = getReconfigureFlags(0, true) &
+ final int flags = getReconfigureFlags(0, true) &
( FLAG_IS_ALWAYSONTOP | FLAG_IS_UNDECORATED ) ;
final long _windowHandle = CreateWindow0(DisplayDriver.getHInstance(), display.getWindowClassName(), display.getWindowClassName(),
winVer.getMajor(), winVer.getMinor(),
- getParentWindowHandle(), getX(), getY(), getWidth(), getHeight(), autoPosition(), flags);
+ getParentWindowHandle(), getX(), getY(), getWidth(), getHeight(), autoPosition(), flags);
if ( 0 == _windowHandle ) {
throw new NativeWindowException("Error creating window");
}
setWindowHandle(_windowHandle);
windowHandleClose = _windowHandle;
-
+
if(DEBUG_IMPLEMENTATION) {
Exception e = new Exception("Info: Window new window handle "+Thread.currentThread().getName()+
" (Parent HWND "+toHexString(getParentWindowHandle())+
") : HWND "+toHexString(_windowHandle)+", "+Thread.currentThread());
e.printStackTrace();
}
- }
+ }
protected void closeNativeImpl() {
if(windowHandleClose != 0) {
@@ -162,7 +162,7 @@ public class WindowDriver extends WindowImpl {
try {
GDI.ReleaseDC(windowHandleClose, hdc);
} catch (Throwable t) {
- if(DEBUG_IMPLEMENTATION) {
+ if(DEBUG_IMPLEMENTATION) {
Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
e.printStackTrace();
}
@@ -188,14 +188,14 @@ public class WindowDriver extends WindowImpl {
System.err.println("WindowsWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
getReconfigureFlagsAsString(null, flags));
}
-
+
if(0 == ( FLAG_IS_UNDECORATED & flags)) {
final InsetsImmutable i = getInsets();
-
+
// client position -> top-level window position
x -= i.getLeftWidth() ;
y -= i.getTopHeight() ;
-
+
if(0 top-level window size
width += i.getTotalWidth();
@@ -203,9 +203,9 @@ public class WindowDriver extends WindowImpl {
}
}
reconfigureWindow0( getParentWindowHandle(), getWindowHandle(), x, y, width, height, flags);
-
+
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
- visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
+ visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
}
return true;
}
@@ -222,7 +222,7 @@ public class WindowDriver extends WindowImpl {
@Override
protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
final boolean[] res = new boolean[] { false };
-
+
this.runOnEDTIfAvail(true, new Runnable() {
public void run() {
res[0] = setPointerVisible0(getWindowHandle(), pointerVisible);
@@ -234,19 +234,19 @@ public class WindowDriver extends WindowImpl {
@Override
protected boolean confinePointerImpl(final boolean confine) {
final Boolean[] res = new Boolean[] { Boolean.FALSE };
-
+
this.runOnEDTIfAvail(true, new Runnable() {
public void run() {
final Point p0 = getLocationOnScreenImpl(0, 0);
- res[0] = Boolean.valueOf(confinePointer0(getWindowHandle(), confine,
+ res[0] = Boolean.valueOf(confinePointer0(getWindowHandle(), confine,
p0.getX(), p0.getY(), p0.getX()+getWidth(), p0.getY()+getHeight()));
}
});
return res[0].booleanValue();
}
-
+
@Override
- protected void warpPointerImpl(final int x, final int y) {
+ protected void warpPointerImpl(final int x, final int y) {
this.runOnEDTIfAvail(true, new Runnable() {
public void run() {
final Point sPos = getLocationOnScreenImpl(x, y);
@@ -255,44 +255,44 @@ public class WindowDriver extends WindowImpl {
});
return;
}
-
+
protected Point getLocationOnScreenImpl(int x, int y) {
return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
}
protected void updateInsetsImpl(Insets insets) {
- // nop - using event driven insetsChange(..)
+ // nop - using event driven insetsChange(..)
}
-
+
//
// PointerEvent Handling
//
/**
* Send multiple-pointer {@link MouseEvent.PointerType#TouchScreen} event to be directly consumed
*
- * Assumes non normal pointer names and rotation/scroll will be determined by a gesture handler.
+ * Assumes non normal pointer names and rotation/scroll will be determined by a gesture handler.
*
*/
- public final void sendTouchScreenEvent(short eventType, int modifiers,
+ public final void sendTouchScreenEvent(short eventType, int modifiers,
int pActionIdx, int[] pNames,
int[] pX, int[] pY, float[] pPressure, float maxPressure) {
final int pCount = pNames.length;
final MouseEvent.PointerType[] pTypes = new MouseEvent.PointerType[pCount];
for(int i=pCount-1; i>=0; i--) { pTypes[i] = PointerType.TouchScreen; }
- doPointerEvent(false /*enqueue*/, false /*wait*/,
- pTypes, eventType, modifiers, pActionIdx, false /*normalPNames*/, pNames,
+ doPointerEvent(false /*enqueue*/, false /*wait*/,
+ pTypes, eventType, modifiers, pActionIdx, false /*normalPNames*/, pNames,
pX, pY, pPressure, maxPressure, new float[] { 0f, 0f, 0f} /*rotationXYZ*/, 1f/*rotationScale*/);
}
-
+
//
// KeyEvent Handling
//
private short repeatedKey = KeyEvent.VK_UNDEFINED;
-
+
private final boolean handlePressTypedAutoRepeat(boolean isModifierKey, int modifiers, short keyCode, short keySym, char keyChar) {
if( setKeyPressed(keyCode, true) ) {
// AR: Key was already pressed: Either [enter | within] AR mode
@@ -308,18 +308,18 @@ public class WindowDriver extends WindowImpl {
super.sendKeyEvent(KeyEvent.EVENT_KEY_RELEASED, modifiers, keyCode, keySym, keyChar);
}
return true;
- }
+ }
return false;
}
-
+
@Override
public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
final boolean isModifierKey = KeyEvent.isModifierKey(keySym);
// System.err.println("*** sendKeyEvent: event "+KeyEvent.getEventTypeString(eventType)+", keyCode "+toHexString(keyCode)+", keyChar <"+keyChar+">, mods "+toHexString(modifiers)+
// ", isKeyCodeTracked "+isKeyCodeTracked(keyCode)+", was: pressed "+isKeyPressed(keyCode)+", printableKey "+KeyEvent.isPrintableKey(keyCode, false)+" [modifierKey "+isModifierKey+"] - "+System.currentTimeMillis());
-
+
// Reorder: WINDOWS delivery order is PRESSED (t0), TYPED (t0) and RELEASED (t1) -> NEWT order: PRESSED (t0) and RELEASED (t1)
- // Auto-Repeat: WINDOWS delivers only PRESSED (t0) and TYPED (t0).
+ // Auto-Repeat: WINDOWS delivers only PRESSED (t0) and TYPED (t0).
switch(eventType) {
case KeyEvent.EVENT_KEY_RELEASED:
if( isKeyCodeTracked(keyCode) ) {
@@ -339,12 +339,12 @@ public class WindowDriver extends WindowImpl {
break;
}
}
-
+
@Override
public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
}
-
+
//----------------------------------------------------------------------
// Internals only
//
@@ -361,5 +361,5 @@ public class WindowDriver extends WindowImpl {
private static native boolean setPointerVisible0(long windowHandle, boolean visible);
private static native boolean confinePointer0(long windowHandle, boolean grab, int l, int t, int r, int b);
- private static native void warpPointer0(long windowHandle, int x, int y);
+ private static native void warpPointer0(long windowHandle, int x, int y);
}
diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
index d911483b0..aa8067520 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.x11;
@@ -83,7 +83,7 @@ public class DisplayDriver extends DisplayImpl {
CompleteDisplay0(aDevice.getHandle());
} catch(RuntimeException e) {
closeNativeImpl(aDevice);
- throw e;
+ throw e;
}
}
@@ -114,14 +114,14 @@ public class DisplayDriver extends DisplayImpl {
protected long getJavaObjectAtom() { return javaObjectAtom; }
protected long getWindowDeleteAtom() { return windowDeleteAtom; }
// protected long getKbdHandle() { return kbdHandle; } // XKB disabled for now
-
- /** Returns null if !{@link #isNativeValid()}, otherwise the Boolean value of {@link X11GraphicsDevice#isXineramaEnabled()}. */
+
+ /** Returns null if !{@link #isNativeValid()}, otherwise the Boolean value of {@link X11GraphicsDevice#isXineramaEnabled()}. */
protected Boolean isXineramaEnabled() { return isNativeValid() ? Boolean.valueOf(((X11GraphicsDevice)aDevice).isXineramaEnabled()) : null; }
-
+
//----------------------------------------------------------------------
// Internals only
//
-
+
private static native boolean initIDs0(boolean debug);
private native void CompleteDisplay0(long handle);
@@ -137,10 +137,10 @@ public class DisplayDriver extends DisplayImpl {
/** X11 Window delete atom marker used on EDT */
private long windowDeleteAtom;
-
+
/** X11 Window java object property used on EDT */
- private long javaObjectAtom;
-
+ private long javaObjectAtom;
+
/** X11 Keyboard handle used on EDT */
// private long kbdHandle; // XKB disabled for now
}
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR.java b/src/newt/classes/jogamp/newt/driver/x11/RandR.java
index e39a6c63a..8b065d1f0 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR.java
@@ -38,18 +38,18 @@ import com.jogamp.newt.MonitorDevice;
import com.jogamp.newt.MonitorMode;
public interface RandR {
- public static final VersionNumber version110 = new VersionNumber(1, 1, 0);
+ public static final VersionNumber version110 = new VersionNumber(1, 1, 0);
public static final VersionNumber version130 = new VersionNumber(1, 3, 0);
public static final VersionNumber version140 = new VersionNumber(1, 4, 0);
VersionNumber getVersion();
-
+
void dumpInfo(final long dpy, final int screen_idx);
-
+
/**
- * Encapsulate initial device query allowing caching of internal data structures.
+ * Encapsulate initial device query allowing caching of internal data structures.
* Methods covered:
- *
- * Above methods may be called w/o begin/end, in which case no
+ * Above methods may be called w/o begin/end, in which case no
* internal data structures can be cached:
*
* @param dpy TODO
@@ -66,11 +66,11 @@ public interface RandR {
*/
boolean beginInitialQuery(long dpy, ScreenDriver screen);
void endInitialQuery(long dpy, ScreenDriver screen);
-
+
int getMonitorDeviceCount(final long dpy, final ScreenDriver screen);
int[] getAvailableRotations(final long dpy, final ScreenDriver screen, final int crt_idx);
/**
- *
+ *
* @param dpy
* @param screen
* @param mode_idx w/o indexing rotation
@@ -80,7 +80,7 @@ public interface RandR {
int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, MonitorModeProps.Cache cache, final int crt_idx);
int[] getMonitorDeviceViewport(final long dpy, final ScreenDriver screen, final int crt_idx);
int[] getCurrentMonitorModeProps(final long dpy, final ScreenDriver screen, final int crt_idx);
- boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode);
-
- public void updateScreenViewport(final long dpy, final ScreenDriver screen, RectangleImmutable viewport);
+ boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode);
+
+ public void updateScreenViewport(final long dpy, final ScreenDriver screen, RectangleImmutable viewport);
}
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR11.java b/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
index 877607f72..6c22a3fc6 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
@@ -38,8 +38,8 @@ import com.jogamp.newt.MonitorMode;
class RandR11 implements RandR {
private static final boolean DEBUG = ScreenDriver.DEBUG;
-
- RandR11() {
+
+ RandR11() {
}
@Override
@@ -51,13 +51,13 @@ class RandR11 implements RandR {
public void dumpInfo(final long dpy, final int screen_idx) {
// NOP
}
-
+
private int widthMM=0, heightMM=0;
private int modeCount = 0;
private int resolutionCount = 0;
private int[][] nrates = null; // [nres_number][nrate_number]
private int[] idx_rate = null, idx_res = null;
-
+
@Override
public boolean beginInitialQuery(long dpy, ScreenDriver screen) {
// initialize iterators and static data
@@ -76,11 +76,11 @@ class RandR11 implements RandR {
return false;
}
}
-
+
for(int nresIdx=0; nresIdx < resolutionCount; nresIdx++) {
modeCount += nrates[nresIdx].length;
}
-
+
idx_rate = new int[modeCount];
idx_res = new int[modeCount];
@@ -94,23 +94,23 @@ class RandR11 implements RandR {
}
return true;
}
-
+
@Override
public void endInitialQuery(long dpy, ScreenDriver screen) {
idx_rate=null;
- idx_res=null;
- nrates=null;
+ idx_res=null;
+ nrates=null;
}
-
+
@Override
public int getMonitorDeviceCount(final long dpy, final ScreenDriver screen) {
return 1;
}
-
+
@Override
public int[] getAvailableRotations(final long dpy, final ScreenDriver screen, final int crt_idx) {
if( 0 < crt_idx ) {
- // RandR11 only supports 1 CRT
+ // RandR11 only supports 1 CRT
return null;
}
final int screen_idx = screen.getIndex();
@@ -120,17 +120,17 @@ class RandR11 implements RandR {
}
return availRotations;
}
-
+
@Override
public int[] getMonitorModeProps(final long dpy, final ScreenDriver screen, final int mode_idx) {
if( mode_idx >= modeCount ) {
return null;
- }
+ }
final int screen_idx = screen.getIndex();
-
+
final int nres_index = idx_res[mode_idx];
final int nrate_index = idx_rate[mode_idx];
-
+
final int[] res = getScreenResolution0(dpy, screen_idx, nres_index);
if(null==res || 0==res.length) {
return null;
@@ -144,7 +144,7 @@ class RandR11 implements RandR {
if( res[3] > heightMM ) {
heightMM = res[3];
}
-
+
int rate = nrates[nres_index][nrate_index];
if(0>=rate) {
rate = ScreenImpl.default_sm_rate;
@@ -166,13 +166,13 @@ class RandR11 implements RandR {
if( MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL != i ) {
throw new InternalError("XX");
}
- return props;
+ return props;
}
-
+
@Override
public int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, final MonitorModeProps.Cache cache, final int crt_idx) {
if( 0 < crt_idx ) {
- // RandR11 only supports 1 CRT
+ // RandR11 only supports 1 CRT
return null;
}
final int[] currentModeProps = getCurrentMonitorModeProps(dpy, screen, crt_idx);
@@ -194,15 +194,15 @@ class RandR11 implements RandR {
props[i++] = currentMode.getId(); // current mode id
props[i++] = currentMode.getRotation();
for(int j=0; jresId || resId>=resolutionCount) {
throw new RuntimeException("Invalid resolution index: ! 0 < "+resId+" < "+resolutionCount+", "+monitor+", "+mode);
- }
+ }
final int f = (int)mode.getRefreshRate(); // simply cut-off, orig is int
final int r = mode.getRotation();
@@ -335,11 +335,11 @@ class RandR11 implements RandR {
}
return done;
}
-
+
@Override
public final void updateScreenViewport(final long dpy, final ScreenDriver screen, RectangleImmutable viewport) {
// nop
- }
+ }
/** @return int[] { rot1, .. } */
private static native int[] getAvailableScreenRotations0(long display, int screen_index);
@@ -353,7 +353,7 @@ class RandR11 implements RandR {
private static native long getScreenConfiguration0(long display, int screen_index);
private static native void freeScreenConfiguration0(long screenConfiguration);
-
+
private static native int getCurrentScreenResolutionIndex0(long screenConfiguration);
private static native int getCurrentScreenRate0(long screenConfiguration);
private static native int getCurrentScreenRotation0(long screenConfiguration);
@@ -361,5 +361,5 @@ class RandR11 implements RandR {
/** needs own Display connection for XRANDR event handling */
private static native boolean setCurrentScreenModeStart0(long display, int screen_index, long screenConfiguration, int mode_index, int freq, int rot);
private static native boolean setCurrentScreenModePollEnd0(long display, int screen_index, int mode_index, int freq, int rot);
-
+
}
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR13.java b/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
index ac83fc5f2..a08741d9e 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
@@ -43,19 +43,19 @@ import com.jogamp.newt.MonitorMode;
*
*/
class RandR13 implements RandR {
private static final boolean DEBUG = ScreenDriver.DEBUG;
-
- RandR13() {
+
+ RandR13() {
}
-
+
@Override
public final VersionNumber getVersion() {
return version130;
}
-
+
@Override
public void dumpInfo(final long dpy, final int screen_idx) {
long screenResources = getScreenResources0(dpy, screen_idx);
@@ -66,12 +66,12 @@ class RandR13 implements RandR {
dumpInfo0(dpy, screen_idx, screenResources);
} finally {
freeScreenResources0(screenResources);
- }
+ }
}
-
+
long sessionScreenResources = 0;
IntLongHashMap crtInfoHandleMap = null;
-
+
@Override
public boolean beginInitialQuery(long dpy, ScreenDriver screen) {
final int screen_idx = screen.getIndex();
@@ -84,7 +84,7 @@ class RandR13 implements RandR {
return false;
}
}
-
+
@Override
public void endInitialQuery(long dpy, ScreenDriver screen) {
if( null != crtInfoHandleMap ) {
@@ -100,7 +100,7 @@ class RandR13 implements RandR {
sessionScreenResources = 0;
}
}
-
+
private final long getScreenResourceHandle(final long dpy, final int screen_idx) {
if( 0 != sessionScreenResources ) {
return sessionScreenResources;
@@ -112,7 +112,7 @@ class RandR13 implements RandR {
freeScreenResources0( screenResourceHandle );
}
}
-
+
private final long getMonitorInfoHandle(final long dpy, final int screen_idx, long screenResources, final int monitor_idx) {
if( null != crtInfoHandleMap ) {
long h = crtInfoHandleMap.get(monitor_idx);
@@ -129,8 +129,8 @@ class RandR13 implements RandR {
if( null == crtInfoHandleMap ) {
freeMonitorInfoHandle0(monitorInfoHandle);
}
- }
-
+ }
+
@Override
public int getMonitorDeviceCount(final long dpy, final ScreenDriver screen) {
final int screen_idx = screen.getIndex();
@@ -141,7 +141,7 @@ class RandR13 implements RandR {
releaseScreenResourceHandle(screenResources);
}
}
-
+
@Override
public int[] getAvailableRotations(final long dpy, final ScreenDriver screen, final int crt_idx) {
final int screen_idx = screen.getIndex();
@@ -152,7 +152,7 @@ class RandR13 implements RandR {
final int[] availRotations = getAvailableRotations0(monitorInfo);
if(null==availRotations || 0==availRotations.length) {
return null;
- }
+ }
return availRotations;
} finally {
releaseMonitorInfoHandle(monitorInfo);
@@ -161,7 +161,7 @@ class RandR13 implements RandR {
releaseScreenResourceHandle(screenResources);
}
}
-
+
@Override
public int[] getMonitorModeProps(final long dpy, final ScreenDriver screen, final int mode_idx) {
final int screen_idx = screen.getIndex();
@@ -172,7 +172,7 @@ class RandR13 implements RandR {
releaseScreenResourceHandle(screenResources);
}
}
-
+
@Override
public int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, MonitorModeProps.Cache cache, final int crt_idx) {
final int screen_idx = screen.getIndex();
@@ -188,9 +188,9 @@ class RandR13 implements RandR {
releaseScreenResourceHandle(screenResources);
}
}
-
+
@Override
- public int[] getMonitorDeviceViewport(final long dpy, final ScreenDriver screen, final int crt_idx) {
+ public int[] getMonitorDeviceViewport(final long dpy, final ScreenDriver screen, final int crt_idx) {
final int screen_idx = screen.getIndex();
final long screenResources = getScreenResourceHandle(dpy, screen_idx);
try {
@@ -204,7 +204,7 @@ class RandR13 implements RandR {
releaseScreenResourceHandle(screenResources);
}
}
-
+
@Override
public int[] getCurrentMonitorModeProps(final long dpy, final ScreenDriver screen, final int crt_idx) {
final int screen_idx = screen.getIndex();
@@ -220,7 +220,7 @@ class RandR13 implements RandR {
releaseScreenResourceHandle(screenResources);
}
}
-
+
@Override
public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode) {
final int screen_idx = screen.getIndex();
@@ -229,7 +229,7 @@ class RandR13 implements RandR {
try {
final long monitorInfo = getMonitorInfoHandle(dpy, screen_idx, screenResources, monitor.getId());
try {
- res = setMonitorMode0(dpy, screenResources, monitorInfo, monitor.getId(), mode.getId(), mode.getRotation(),
+ res = setMonitorMode0(dpy, screenResources, monitorInfo, monitor.getId(), mode.getId(), mode.getRotation(),
-1, -1); // no fixed position!
} finally {
releaseMonitorInfoHandle(monitorInfo);
@@ -239,36 +239,36 @@ class RandR13 implements RandR {
}
return res;
}
-
+
@Override
public final void updateScreenViewport(final long dpy, final ScreenDriver screen, final RectangleImmutable viewport) {
final int screen_idx = screen.getIndex();
final long screenResources = getScreenResourceHandle(dpy, screen_idx);
try {
- setScreenViewport0(dpy, screen_idx, screenResources, viewport.getX(), viewport.getY(), viewport.getWidth(), viewport.getHeight());
+ setScreenViewport0(dpy, screen_idx, screenResources, viewport.getX(), viewport.getY(), viewport.getWidth(), viewport.getHeight());
} finally {
dumpInfo0(dpy, screen_idx, screenResources);
releaseScreenResourceHandle(screenResources);
}
}
-
+
private static native long getScreenResources0(long display, int screen_index);
private static native void freeScreenResources0(long screenResources);
private static native void dumpInfo0(long display, int screen_index, long screenResources);
-
+
private static native int getMonitorDeviceCount0(long screenResources);
-
+
private static native long getMonitorInfoHandle0(long display, int screen_index, long screenResources, int monitor_index);
private static native void freeMonitorInfoHandle0(long monitorInfoHandle);
-
+
private static native int[] getAvailableRotations0(long monitorInfo);
private static native int[] getMonitorViewport0(long monitorInfo);
private static native int[] getMonitorCurrentMode0(long monitorInfo);
-
+
private static native int[] getMonitorMode0(long screenResources, int mode_index);
private static native int[] getMonitorCurrentMode0(long screenResources, long monitorInfo);
private static native int[] getMonitorDevice0(long display, long screenResources, long monitorInfo, int monitor_idx);
-
+
private static native boolean setMonitorMode0(long display, long screenResources, long monitorInfo, int monitor_idx, int mode_id, int rotation, int x, int y);
private static native boolean setScreenViewport0(long display, int screen_index, long screenResources, int x, int y, int width, int height);
}
diff --git a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
index c01d899f8..7f75e03f0 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.x11;
@@ -54,19 +54,19 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
import com.jogamp.newt.MonitorDevice;
import com.jogamp.newt.MonitorMode;
-public class ScreenDriver extends ScreenImpl {
+public class ScreenDriver extends ScreenImpl {
protected static final boolean DEBUG_TEST_RANDR13_DISABLED;
-
+
static {
Debug.initSingleton();
DEBUG_TEST_RANDR13_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableRandR13", true);
-
+
DisplayDriver.initSingleton();
}
/** Ensure static init has been run. */
/* pp */static void initSingleton() { }
-
+
public ScreenDriver() {
}
@@ -74,14 +74,14 @@ public class ScreenDriver extends ScreenImpl {
protected void createNativeImpl() {
// validate screen index
Long handle = runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
- public Long run(long dpy) {
+ public Long run(long dpy) {
return new Long(GetScreen0(dpy, screen_idx));
} } );
if (handle.longValue() == 0) {
throw new RuntimeException("Error creating screen: " + screen_idx);
}
- final X11GraphicsDevice x11dev = (X11GraphicsDevice) getDisplay().getGraphicsDevice();
- final long dpy = x11dev.getHandle();
+ final X11GraphicsDevice x11dev = (X11GraphicsDevice) getDisplay().getGraphicsDevice();
+ final long dpy = x11dev.getHandle();
aScreen = new X11GraphicsScreen(x11dev, screen_idx);
{
int v[] = getRandRVersion0(dpy);
@@ -118,7 +118,7 @@ public class ScreenDriver extends ScreenImpl {
if( rAndR.beginInitialQuery(device.getHandle(), this) ) {
try {
final int crtCount = rAndR.getMonitorDeviceCount(device.getHandle(), this);
-
+
// Gather all available rotations
final ArrayHashSet availableRotations = new ArrayHashSet();
for(int i = 0; i < crtCount; i++) {
@@ -129,7 +129,7 @@ public class ScreenDriver extends ScreenImpl {
availableRotations.addAll(rotationList);
}
}
-
+
// collect all modes, while injecting all available rotations
{
int modeIdx = 0;
@@ -147,8 +147,8 @@ public class ScreenDriver extends ScreenImpl {
if( cache.monitorModes.size() > 0 ) {
for(int i = 0; i < crtCount; i++) {
final int[] monitorProps = rAndR.getMonitorDeviceProps(device.getHandle(), this, cache, i);
- if( null != monitorProps &&
- MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES <= monitorProps[0] && // Enabled ? I.e. contains active modes ?
+ if( null != monitorProps &&
+ MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES <= monitorProps[0] && // Enabled ? I.e. contains active modes ?
MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES <= monitorProps.length ) {
MonitorModeProps.streamInMonitorDevice(null, cache, this, monitorProps, 0);
}
@@ -174,11 +174,11 @@ public class ScreenDriver extends ScreenImpl {
device.unlock();
}
}
-
+
@Override
protected MonitorMode queryCurrentMonitorModeImpl(final MonitorDevice monitor) {
if( null == rAndR ) { return null; }
-
+
return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
public MonitorMode run(long dpy) {
final int[] currentModeProps = rAndR.getCurrentMonitorModeProps(dpy, ScreenDriver.this, monitor.getId());
@@ -189,14 +189,14 @@ public class ScreenDriver extends ScreenImpl {
@Override
protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
if( null == rAndR ) { return false; }
-
+
final long t0 = System.currentTimeMillis();
boolean done = runWithOptTempDisplayHandle( new DisplayImpl.DisplayRunnable() {
public Boolean run(long dpy) {
return Boolean.valueOf( rAndR.setCurrentMonitorMode(dpy, ScreenDriver.this, monitor, mode) );
- }
+ }
}).booleanValue();
-
+
if(DEBUG || !done) {
System.err.println("X11Screen.setCurrentMonitorModeImpl: TO ("+SCREEN_MODE_CHANGE_TIMEOUT+") reached: "+
(System.currentTimeMillis()-t0)+"ms; "+monitor.getCurrentMode()+" -> "+mode);
@@ -205,10 +205,10 @@ public class ScreenDriver extends ScreenImpl {
}
private DisplayImpl.DisplayRunnable xineramaEnabledQueryWithTemp = new DisplayImpl.DisplayRunnable() {
- public Boolean run(long dpy) {
- return new Boolean(X11Util.XineramaIsEnabled(dpy));
+ public Boolean run(long dpy) {
+ return new Boolean(X11Util.XineramaIsEnabled(dpy));
} };
-
+
@Override
protected int validateScreenIndex(final int idx) {
final DisplayDriver x11Display = (DisplayDriver) getDisplay();
@@ -219,7 +219,7 @@ public class ScreenDriver extends ScreenImpl {
return runWithTempDisplayHandle( xineramaEnabledQueryWithTemp ).booleanValue() ? 0 : idx;
}
}
-
+
@Override
protected void calcVirtualScreenOriginAndSize(final Rectangle vOriginSize) {
final RectangleImmutable ov = (RectangleImmutable) getViewport().cloneMutable();
@@ -244,17 +244,17 @@ public class ScreenDriver extends ScreenImpl {
System.err.println("X11Screen.calcVirtualScreenOriginAndSize: Querying X11: "+ov+" -> "+vOriginSize);
}
}
- }
-
+ }
+
//----------------------------------------------------------------------
// Internals only
- //
+ //
private final T runWithLockedDisplayDevice(DisplayRunnable action) {
return display.runWithLockedDisplayDevice(action);
}
-
+
private final T runWithTempDisplayHandle(DisplayRunnable action) {
- final long displayHandle = X11Util.openDisplay(display.getName());
+ final long displayHandle = X11Util.openDisplay(display.getName());
if(0 == displayHandle) {
throw new RuntimeException("null device");
}
@@ -266,7 +266,7 @@ public class ScreenDriver extends ScreenImpl {
}
return res;
}
-
+
private final T runWithOptTempDisplayHandle(DisplayRunnable action) {
if( null != rAndR && rAndR.getVersion().compareTo(RandR.version130) >= 0 ) {
return display.runWithLockedDisplayDevice(action);
@@ -274,12 +274,12 @@ public class ScreenDriver extends ScreenImpl {
return runWithTempDisplayHandle(action);
}
}
-
+
private static native long GetScreen0(long dpy, int scrn_idx);
private static native int getWidth0(long display, int scrn_idx);
private static native int getHeight0(long display, int scrn_idx);
-
+
private static native int[] getRandRVersion0(long display);
}
diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
index 806dd270c..02f80c0c3 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
@@ -1,22 +1,22 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
* Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
- *
+ *
* - Redistribution of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
- *
+ *
* - Redistribution in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- *
+ *
* Neither the name of Sun Microsystems, Inc. or the names of
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
- *
+ *
* This software is provided "AS IS," without a warranty of any kind. ALL
* EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
* INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,7 +29,7 @@
* DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
* ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
* SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
+ *
*/
package jogamp.newt.driver.x11;
@@ -57,7 +57,7 @@ public class WindowDriver extends WindowImpl {
private static final int X11_WHEEL_ONE_DOWN_BUTTON = 5;
private static final int X11_WHEEL_TWO_UP_BUTTON = 6;
private static final int X11_WHEEL_TWO_DOWN_BUTTON = 7;
-
+
static {
ScreenDriver.initSingleton();
}
@@ -70,21 +70,21 @@ public class WindowDriver extends WindowImpl {
final ScreenDriver screen = (ScreenDriver) getScreen();
final DisplayDriver display = (DisplayDriver) screen.getDisplay();
final AbstractGraphicsDevice edtDevice = display.getGraphicsDevice();
-
- // Decoupled X11 Device/Screen allowing X11 display lock-free off-thread rendering
+
+ // Decoupled X11 Device/Screen allowing X11 display lock-free off-thread rendering
final long renderDeviceHandle = X11Util.openDisplay(edtDevice.getConnection());
if( 0 == renderDeviceHandle ) {
throw new RuntimeException("Error creating display(GfxCfg/Render): "+edtDevice.getConnection());
}
renderDevice = new X11GraphicsDevice(renderDeviceHandle, AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
final AbstractGraphicsScreen renderScreen = new X11GraphicsScreen(renderDevice, screen.getIndex());
-
+
final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(display.getGraphicsDevice(), capsRequested);
final AbstractGraphicsConfiguration cfg = factory.chooseGraphicsConfiguration(
capsRequested, capsRequested, capabilitiesChooser, renderScreen, VisualIDHolder.VID_UNDEFINED);
if(DEBUG_IMPLEMENTATION) {
System.err.println("X11Window.createNativeImpl() factory: "+factory+", chosen config: "+cfg);
- }
+ }
if (null == cfg) {
throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
}
@@ -93,13 +93,13 @@ public class WindowDriver extends WindowImpl {
throw new NativeWindowException("Chosen Configuration w/o native visual ID: "+cfg);
}
setGraphicsConfiguration(cfg);
- final int flags = getReconfigureFlags(0, true) &
+ final int flags = getReconfigureFlags(0, true) &
( FLAG_IS_ALWAYSONTOP | FLAG_IS_UNDECORATED ) ;
edtDevice.lock();
- try {
+ try {
setWindowHandle(CreateWindow0(getParentWindowHandle(),
- edtDevice.getHandle(), screen.getIndex(), visualID,
- display.getJavaObjectAtom(), display.getWindowDeleteAtom(),
+ edtDevice.getHandle(), screen.getIndex(), visualID,
+ display.getJavaObjectAtom(), display.getWindowDeleteAtom(),
getX(), getY(), getWidth(), getHeight(), autoPosition(), flags));
} finally {
edtDevice.unlock();
@@ -117,10 +117,10 @@ public class WindowDriver extends WindowImpl {
final AbstractGraphicsDevice edtDevice = display.getGraphicsDevice();
edtDevice.lock();
try {
- CloseWindow0(edtDevice.getHandle(), windowHandleClose,
+ CloseWindow0(edtDevice.getHandle(), windowHandleClose,
display.getJavaObjectAtom(), display.getWindowDeleteAtom() /* , display.getKbdHandle() */); // XKB disabled for now
} catch (Throwable t) {
- if(DEBUG_IMPLEMENTATION) {
+ if(DEBUG_IMPLEMENTATION) {
Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
e.printStackTrace();
}
@@ -135,7 +135,7 @@ public class WindowDriver extends WindowImpl {
}
}
- /**
+ /**
*
@@ -145,7 +145,7 @@ public class WindowDriver extends WindowImpl {
protected boolean isReconfigureFlagSupported(int changeFlags) {
return true; // all flags!
}
-
+
@Override
protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, int flags) {
if(DEBUG_IMPLEMENTATION) {
@@ -153,8 +153,8 @@ public class WindowDriver extends WindowImpl {
}
final int _x, _y;
if(0 == ( FLAG_IS_UNDECORATED & flags)) {
- final InsetsImmutable i = getInsets();
-
+ final InsetsImmutable i = getInsets();
+
// client position -> top-level window position
_x = x - i.getLeftWidth() ;
_y = y - i.getTopHeight() ;
@@ -177,7 +177,7 @@ public class WindowDriver extends WindowImpl {
final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable
*
*/
+ @Override
public final boolean equals(Object obj) {
if (this == obj) { return true; }
if (obj instanceof MonitorDevice) {
@@ -102,6 +103,7 @@ public abstract class MonitorDevice {
*
nativeID
*
*/
+ @Override
public final int hashCode() {
return nativeId;
}
@@ -228,6 +230,7 @@ public abstract class MonitorDevice {
*/
public abstract boolean setCurrentMode(MonitorMode mode);
+ @Override
public String toString() {
return "Monitor[Id "+Display.toHexString(nativeId)+", "+sizeMM+" mm, viewport "+viewport+ ", orig "+originalMode+", curr "+currentMode+
", modeChanged "+modeChanged+", modeCount "+supportedModes.size()+"]";
diff --git a/src/newt/classes/com/jogamp/newt/MonitorMode.java b/src/newt/classes/com/jogamp/newt/MonitorMode.java
index 175d6e5f2..59f28e791 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorMode.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorMode.java
@@ -114,12 +114,14 @@ public class MonitorMode implements Comparable {
/** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the ascending order. */
public static final Comparator monitorModeComparator = new Comparator() {
+ @Override
public int compare(MonitorMode mm1, MonitorMode mm2) {
return mm1.compareTo(mm2);
} };
/** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the descending order. */
public static final Comparator monitorModeComparatorInv = new Comparator() {
+ @Override
public int compare(MonitorMode mm1, MonitorMode mm2) {
return mm2.compareTo(mm1);
} };
@@ -172,6 +174,7 @@ public class MonitorMode implements Comparable {
}
return sb;
}
+ @Override
public final String toString() {
return new String(surfaceSize+" @ "+refreshRate+" Hz, flags ["+flags2String(flags).toString()+"]");
}
@@ -228,6 +231,7 @@ public class MonitorMode implements Comparable {
*
flags
*
*/
+ @Override
public final boolean equals(Object obj) {
if (this == obj) { return true; }
if (obj instanceof SizeAndRRate) {
@@ -247,6 +251,7 @@ public class MonitorMode implements Comparable {
*
refreshRate
*
*/
+ @Override
public final int hashCode() {
return hashCode;
}
@@ -360,6 +365,7 @@ public class MonitorMode implements Comparable {
return getRotatedWH(false);
}
+ @Override
public final String toString() {
return "[Id "+Display.toHexString(nativeId)+", " + sizeAndRRate + ", " + rotation + " degr]";
}
@@ -409,6 +415,7 @@ public class MonitorMode implements Comparable {
*
rotation
*
*/
+ @Override
public final boolean equals(Object obj) {
if (this == obj) { return true; }
if (obj instanceof MonitorMode) {
@@ -428,6 +435,7 @@ public class MonitorMode implements Comparable {
*
rotation
*
*/
+ @Override
public final int hashCode() {
return hashCode;
}
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index 7116877a3..5ae3f3692 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -56,6 +56,7 @@ public class NewtFactory {
static {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
NativeWindowFactory.initSingleton(); // last resort ..
diff --git a/src/newt/classes/com/jogamp/newt/Screen.java b/src/newt/classes/com/jogamp/newt/Screen.java
index 1274b3459..ef62ec95d 100644
--- a/src/newt/classes/com/jogamp/newt/Screen.java
+++ b/src/newt/classes/com/jogamp/newt/Screen.java
@@ -53,9 +53,11 @@ public abstract class Screen {
public static final boolean DEBUG = Debug.debug("Screen");
/** return precomputed hashCode from FQN {@link #getFQName()} */
+ @Override
public abstract int hashCode();
/** return true if obj is of type Display and both FQN {@link #getFQName()} equals */
+ @Override
public boolean equals(Object obj) {
if (this == obj) { return true; }
if (obj instanceof Screen) {
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index de1b7224f..1f5c26f27 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -107,10 +107,12 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
private AWTWindowClosingProtocol awtWindowClosingProtocol =
new AWTWindowClosingProtocol(this, new Runnable() {
+ @Override
public void run() {
NewtCanvasAWT.this.destroyImpl(false /* removeNotify */, true /* windowClosing */);
}
}, new Runnable() {
+ @Override
public void run() {
if( newtChild != null ) {
newtChild.sendWindowEvent(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY);
@@ -148,14 +150,17 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
setNEWTChild(child);
}
+ @Override
public void setShallUseOffscreenLayer(boolean v) {
shallUseOffscreenLayer = v;
}
+ @Override
public final boolean getShallUseOffscreenLayer() {
return shallUseOffscreenLayer;
}
+ @Override
public final boolean isOffscreenLayerSurfaceEnabled() {
return jawtWindow.isOffscreenLayerSurfaceEnabled();
}
@@ -178,6 +183,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
class FocusAction implements Window.FocusRunnable {
+ @Override
public boolean run() {
final boolean isParent = isParent();
final boolean isFullscreen = isFullscreen();
@@ -214,11 +220,13 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
};
class FocusTraversalKeyListener implements KeyListener {
+ @Override
public void keyPressed(KeyEvent e) {
if( isParent() && !isFullscreen() ) {
handleKey(e, false);
}
}
+ @Override
public void keyReleased(KeyEvent e) {
if( isParent() && !isFullscreen() ) {
handleKey(e, true);
@@ -263,6 +271,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
private final FocusTraversalKeyListener newtFocusTraversalKeyListener = new FocusTraversalKeyListener();
class FocusPropertyChangeListener implements PropertyChangeListener {
+ @Override
public void propertyChange(PropertyChangeEvent evt) {
final Object oldF = evt.getOldValue();
final Object newF = evt.getNewValue();
@@ -358,10 +367,12 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
* or {@link #addNotify()} hasn't been called yet.*/
public NativeWindow getNativeWindow() { return jawtWindow; }
+ @Override
public WindowClosingMode getDefaultCloseOperation() {
return awtWindowClosingProtocol.getDefaultCloseOperation();
}
+ @Override
public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
return awtWindowClosingProtocol.setDefaultCloseOperation(op);
}
@@ -745,6 +756,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
}
}
private final Runnable forceRelayout = new Runnable() {
+ @Override
public void run() {
if(DEBUG) {
System.err.println("NewtCanvasAWT.forceRelayout.0");
@@ -797,6 +809,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
if (!disableBackgroundEraseInitialized) {
try {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
try {
Class> clazz = getToolkit().getClass();
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
index 9b1b82297..409f78307 100644
--- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
+++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
@@ -102,6 +102,7 @@ public class JOGLNewtApplet1Run extends Applet {
/** if valid glStandalone:=true (own window) ! */
int glXd=Integer.MAX_VALUE, glYd=Integer.MAX_VALUE, glWidth=Integer.MAX_VALUE, glHeight=Integer.MAX_VALUE;
+ @Override
public void init() {
if(DEBUG) {
System.err.println("JOGLNewtApplet1Run.init() START");
@@ -223,6 +224,7 @@ public class JOGLNewtApplet1Run extends Applet {
}
}
+ @Override
public void start() {
if(DEBUG) {
System.err.println("JOGLNewtApplet1Run.start() START (isVisible "+isVisible()+", isDisplayable "+isDisplayable()+")");
@@ -266,6 +268,7 @@ public class JOGLNewtApplet1Run extends Applet {
}
}
+ @Override
public void stop() {
if(DEBUG) {
System.err.println("JOGLNewtApplet1Run.stop() START");
@@ -276,6 +279,7 @@ public class JOGLNewtApplet1Run extends Applet {
}
}
+ @Override
public void destroy() {
if(DEBUG) {
System.err.println("JOGLNewtApplet1Run.destroy() START");
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
index a6a30a8bf..d17d2e77c 100644
--- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
+++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtAppletBase.java
@@ -112,6 +112,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
try {
final Class> clazz = AccessController.doPrivileged(new PrivilegedAction>() {
+ @Override
public Class> run() {
final ClassLoader cl = Thread.currentThread().getContextClassLoader();
Class> clazz = null;
@@ -169,6 +170,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
if(null == glWindow.getParent()) {
// we may be called directly by the native EDT
new Thread(new Runnable() {
+ @Override
public void run() {
if( glWindow.isNativeValid() ) {
glWindow.reparentWindow(awtParent);
@@ -256,6 +258,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
// ***********************************************************************************
// ***********************************************************************************
+ @Override
public void init(GLAutoDrawable drawable) {
GL _gl = drawable.getGL();
@@ -276,10 +279,13 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
_gl.setSwapInterval(glSwapInterval);
}
}
+ @Override
public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
}
+ @Override
public void display(GLAutoDrawable drawable) {
}
+ @Override
public void dispose(GLAutoDrawable drawable) {
}
diff --git a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
index 7dda47534..edb2429bb 100644
--- a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
@@ -142,6 +142,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
}
}
+ @Override
public String toString() {
return "DoubleTapScroll[state "+gestureState+", in "+isWithinGesture()+", has "+(null!=hitGestureEvent)+", pc "+pointerDownCount+"]";
}
diff --git a/src/newt/classes/com/jogamp/newt/event/InputEvent.java b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
index 6520dafcf..f29b632e8 100644
--- a/src/newt/classes/com/jogamp/newt/event/InputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
@@ -210,10 +210,12 @@ public abstract class InputEvent extends NEWTEvent
return 0 != ( modifiers & BUTTONALL_MASK );
}
+ @Override
public String toString() {
return toString(null).toString();
}
+ @Override
public StringBuilder toString(StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
index a89148574..5cef734bb 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
@@ -31,8 +31,10 @@ package com.jogamp.newt.event;
public abstract class KeyAdapter implements KeyListener
{
+ @Override
public void keyPressed(KeyEvent e) {
}
+ @Override
public void keyReleased(KeyEvent e) {
}
}
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
index 81680bf32..49aa4e054 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
@@ -196,10 +196,12 @@ public class KeyEvent extends InputEvent
return keyCode;
}
+ @Override
public final String toString() {
return toString(null).toString();
}
+ @Override
public final StringBuilder toString(StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
index 77c66a2da..03242e147 100644
--- a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
@@ -56,10 +56,12 @@ public class MonitorEvent extends OutputEvent {
}
}
+ @Override
public final String toString() {
return toString(null).toString();
}
+ @Override
public final StringBuilder toString(StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
index 652f87d5b..98252fe14 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
@@ -30,20 +30,28 @@ package com.jogamp.newt.event;
public abstract class MouseAdapter implements MouseListener
{
+ @Override
public void mouseClicked(MouseEvent e) {
}
+ @Override
public void mouseEntered(MouseEvent e) {
}
+ @Override
public void mouseExited(MouseEvent e) {
}
+ @Override
public void mousePressed(MouseEvent e) {
}
+ @Override
public void mouseReleased(MouseEvent e) {
}
+ @Override
public void mouseMoved(MouseEvent e) {
}
+ @Override
public void mouseDragged(MouseEvent e) {
}
+ @Override
public void mouseWheelMoved(MouseEvent e) {
}
}
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
index 4d7cc3b36..635bdba52 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
@@ -510,10 +510,12 @@ public class MouseEvent extends InputEvent
return rotationScale;
}
+ @Override
public final String toString() {
return toString(null).toString();
}
+ @Override
public final StringBuilder toString(StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
index 022e2d0e1..af800e61e 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
@@ -131,6 +131,7 @@ public class NEWTEvent extends java.util.EventObject {
}
}
+ @Override
public String toString() {
return toString(null).toString();
}
diff --git a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
index d275eab46..b4e1341da 100644
--- a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
@@ -75,6 +75,7 @@ public class PinchToZoomGesture implements GestureHandler {
this.zoom = 1f;
}
+ @Override
public String toString() {
return "PinchZoom[1stTouch "+zoomFirstTouch+", in "+isWithinGesture()+", has "+(null!=zoomEvent)+", zoom "+zoom+"]";
}
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
index e826f4a6a..bbc170958 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
@@ -40,10 +40,12 @@ public class TraceKeyAdapter implements KeyListener {
this.downstream = downstream;
}
+ @Override
public void keyPressed(KeyEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.keyPressed(e); }
}
+ @Override
public void keyReleased(KeyEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.keyReleased(e); }
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
index d035091c4..db8376034 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
@@ -40,34 +40,42 @@ public class TraceMouseAdapter implements MouseListener {
this.downstream = downstream;
}
+ @Override
public void mouseClicked(MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseClicked(e); }
}
+ @Override
public void mouseEntered(MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseEntered(e); }
}
+ @Override
public void mouseExited(MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseExited(e); }
}
+ @Override
public void mousePressed(MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mousePressed(e); }
}
+ @Override
public void mouseReleased(MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseReleased(e); }
}
+ @Override
public void mouseMoved(MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseMoved(e); }
}
+ @Override
public void mouseDragged(MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseDragged(e); }
}
+ @Override
public void mouseWheelMoved(MouseEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.mouseWheelMoved(e); }
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
index 630e85303..7b844f059 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
@@ -40,30 +40,37 @@ public class TraceWindowAdapter implements WindowListener {
this.downstream = downstream;
}
+ @Override
public void windowResized(WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowResized(e); }
}
+ @Override
public void windowMoved(WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowMoved(e); }
}
+ @Override
public void windowDestroyNotify(WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowDestroyNotify(e); }
}
+ @Override
public void windowDestroyed(WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowDestroyed(e); }
}
+ @Override
public void windowGainedFocus(WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowGainedFocus(e); }
}
+ @Override
public void windowLostFocus(WindowEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowLostFocus(e); }
}
+ @Override
public void windowRepaint(WindowUpdateEvent e) {
System.err.println(e);
if(null!=downstream) { downstream.windowRepaint(e); }
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
index e237c0d80..ccc627444 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
@@ -30,18 +30,25 @@ package com.jogamp.newt.event;
public abstract class WindowAdapter implements WindowListener
{
+ @Override
public void windowResized(WindowEvent e) {
}
+ @Override
public void windowMoved(WindowEvent e) {
}
+ @Override
public void windowDestroyNotify(WindowEvent e) {
}
+ @Override
public void windowDestroyed(WindowEvent e) {
}
+ @Override
public void windowGainedFocus(WindowEvent e) {
}
+ @Override
public void windowLostFocus(WindowEvent e) {
}
+ @Override
public void windowRepaint(WindowUpdateEvent e) {
}
}
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
index 8c7abfe99..2841fd0f6 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
@@ -66,10 +66,12 @@ public class WindowEvent extends NEWTEvent {
}
}
+ @Override
public String toString() {
return toString(null).toString();
}
+ @Override
public StringBuilder toString(StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
index 8a204d234..9044517b5 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
@@ -44,10 +44,12 @@ public class WindowUpdateEvent extends WindowEvent {
return bounds;
}
+ @Override
public String toString() {
return toString(null).toString();
}
+ @Override
public StringBuilder toString(StringBuilder sb) {
if(null == sb) {
sb = new StringBuilder();
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
index 1b53671ba..f6f11b81f 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
@@ -49,11 +49,13 @@ public class AWTKeyAdapter extends AWTAdapter implements java.awt.event.KeyListe
super(downstream);
}
+ @Override
public AWTAdapter addTo(java.awt.Component awtComponent) {
awtComponent.addKeyListener(this);
return this;
}
+ @Override
public AWTAdapter removeFrom(java.awt.Component awtComponent) {
awtComponent.removeKeyListener(this);
return this;
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
index ab4bf7a3f..73a02c9fc 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
@@ -46,6 +46,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
super(downstream);
}
+ @Override
public AWTAdapter addTo(java.awt.Component awtComponent) {
awtComponent.addMouseListener(this);
awtComponent.addMouseMotionListener(this);
@@ -53,6 +54,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
return this;
}
+ @Override
public AWTAdapter removeFrom(java.awt.Component awtComponent) {
awtComponent.removeMouseListener(this);
awtComponent.removeMouseMotionListener(this);
@@ -60,6 +62,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
return this;
}
+ @Override
public void mouseClicked(java.awt.event.MouseEvent e) {
com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
if(null!=newtListener) {
@@ -69,6 +72,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
}
+ @Override
public void mouseEntered(java.awt.event.MouseEvent e) {
com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
if(null!=newtListener) {
@@ -78,6 +82,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
}
+ @Override
public void mouseExited(java.awt.event.MouseEvent e) {
com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
if(null!=newtListener) {
@@ -87,6 +92,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
}
+ @Override
public void mousePressed(java.awt.event.MouseEvent e) {
com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
if(null!=newtListener) {
@@ -96,6 +102,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
}
+ @Override
public void mouseReleased(java.awt.event.MouseEvent e) {
com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
if(null!=newtListener) {
@@ -105,6 +112,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
}
+ @Override
public void mouseDragged(java.awt.event.MouseEvent e) {
com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
if(null!=newtListener) {
@@ -114,6 +122,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
}
+ @Override
public void mouseMoved(java.awt.event.MouseEvent e) {
com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
if(null!=newtListener) {
@@ -123,6 +132,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
}
}
+ @Override
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e) {
com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
if(null!=newtListener) {
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
index 8c9781b77..8a9a2a49f 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
@@ -50,6 +50,7 @@ public class AWTWindowAdapter
super(downstream);
}
+ @Override
public AWTAdapter addTo(java.awt.Component awtComponent) {
java.awt.Window win = getWindow(awtComponent);
awtComponent.addComponentListener(this);
@@ -74,6 +75,7 @@ public class AWTWindowAdapter
return this;
}
+ @Override
public AWTAdapter removeFrom(java.awt.Component awtComponent) {
awtComponent.removeFocusListener(this);
awtComponent.removeComponentListener(this);
@@ -94,6 +96,7 @@ public class AWTWindowAdapter
return null;
}
+ @Override
public void focusGained(java.awt.event.FocusEvent e) {
com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
if(DEBUG_IMPLEMENTATION) {
@@ -106,6 +109,7 @@ public class AWTWindowAdapter
}
}
+ @Override
public void focusLost(java.awt.event.FocusEvent e) {
com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
if(DEBUG_IMPLEMENTATION) {
@@ -118,6 +122,7 @@ public class AWTWindowAdapter
}
}
+ @Override
public void componentResized(java.awt.event.ComponentEvent e) {
com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
if(DEBUG_IMPLEMENTATION) {
@@ -142,6 +147,7 @@ public class AWTWindowAdapter
}
}
+ @Override
public void componentMoved(java.awt.event.ComponentEvent e) {
com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
if(DEBUG_IMPLEMENTATION) {
@@ -154,6 +160,7 @@ public class AWTWindowAdapter
}
}
+ @Override
public void componentShown(java.awt.event.ComponentEvent e) {
final java.awt.Component comp = e.getComponent();
if(DEBUG_IMPLEMENTATION) {
@@ -171,6 +178,7 @@ public class AWTWindowAdapter
}*/
}
+ @Override
public void componentHidden(java.awt.event.ComponentEvent e) {
final java.awt.Component comp = e.getComponent();
if(DEBUG_IMPLEMENTATION) {
@@ -188,6 +196,7 @@ public class AWTWindowAdapter
}*/
}
+ @Override
public void windowActivated(java.awt.event.WindowEvent e) {
com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
if(null!=newtListener) {
@@ -197,10 +206,13 @@ public class AWTWindowAdapter
}
}
+ @Override
public void windowClosed(java.awt.event.WindowEvent e) { }
+ @Override
public void windowClosing(java.awt.event.WindowEvent e) { }
+ @Override
public void windowDeactivated(java.awt.event.WindowEvent e) {
com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
if(null!=newtListener) {
@@ -210,13 +222,17 @@ public class AWTWindowAdapter
}
}
+ @Override
public void windowDeiconified(java.awt.event.WindowEvent e) { }
+ @Override
public void windowIconified(java.awt.event.WindowEvent e) { }
+ @Override
public void windowOpened(java.awt.event.WindowEvent e) { }
class WindowClosingListener implements java.awt.event.WindowListener {
+ @Override
public void windowClosing(java.awt.event.WindowEvent e) {
com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
if(null!=newtListener) {
@@ -225,6 +241,7 @@ public class AWTWindowAdapter
enqueueEvent(true, event);
}
}
+ @Override
public void windowClosed(java.awt.event.WindowEvent e) {
com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
if(null!=newtListener) {
@@ -234,10 +251,15 @@ public class AWTWindowAdapter
}
}
+ @Override
public void windowActivated(java.awt.event.WindowEvent e) { }
+ @Override
public void windowDeactivated(java.awt.event.WindowEvent e) { }
+ @Override
public void windowDeiconified(java.awt.event.WindowEvent e) { }
+ @Override
public void windowIconified(java.awt.event.WindowEvent e) { }
+ @Override
public void windowOpened(java.awt.event.WindowEvent e) { }
}
}
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index ac81e8469..8c1110ed3 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -117,6 +117,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
super(null, null, false /* always handle device lifecycle ourselves */);
this.window = (WindowImpl) window;
this.window.setWindowDestroyNotifyAction( new Runnable() {
+ @Override
public void run() {
defaultWindowDestroyNotifyOp();
} } );
@@ -549,6 +550,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
anim.stop(); // on anim thread, non-blocking
} else {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
if( anim.isAnimating() && null != animThread ) {
try {
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index a25b43777..e63a53524 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -99,6 +99,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
public static NewtCanvasSWT create(final Composite parent, final int style, final Window child) {
final NewtCanvasSWT[] res = new NewtCanvasSWT[] { null };
parent.getDisplay().syncExec( new Runnable() {
+ @Override
public void run() {
res[0] = new NewtCanvasSWT( parent, style, child);
}
@@ -254,10 +255,12 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
/** @return this SWT Canvas NativeWindow representation, may be null in case it has not been realized. */
public NativeWindow getNativeWindow() { return nativeWindow; }
+ @Override
public WindowClosingMode getDefaultCloseOperation() {
return newtChildCloseOp; // TODO: implement ?!
}
+ @Override
public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
return newtChildCloseOp = op; // TODO: implement ?!
}
diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java
index 46a354d4a..7ef2d7ffc 100644
--- a/src/newt/classes/jogamp/newt/Debug.java
+++ b/src/newt/classes/jogamp/newt/Debug.java
@@ -54,6 +54,7 @@ public class Debug extends PropertyAccess {
static {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
PropertyAccess.addTrustedPrefix("newt.");
return null;
diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java
index c6cb706a4..0c29d772a 100644
--- a/src/newt/classes/jogamp/newt/DisplayImpl.java
+++ b/src/newt/classes/jogamp/newt/DisplayImpl.java
@@ -53,6 +53,7 @@ public abstract class DisplayImpl extends Display {
static {
NativeWindowFactory.addCustomShutdownHook(true /* head */, new Runnable() {
+ @Override
public void run() {
WindowImpl.shutdownAll();
ScreenImpl.shutdownAll();
@@ -147,6 +148,7 @@ public abstract class DisplayImpl extends Display {
final DisplayImpl f_dpy = this;
try {
runOnEDTIfAvail(true, new Runnable() {
+ @Override
public void run() {
f_dpy.createNativeImpl();
}});
@@ -244,6 +246,7 @@ public abstract class DisplayImpl extends Display {
task.run();
}
+ @Override
public boolean validateEDTStopped() {
if( 0==refCount && null == aDevice ) {
final EDTUtil _edtUtil = edtUtil;
@@ -277,6 +280,7 @@ public abstract class DisplayImpl extends Display {
aDevice = null;
refCount=0;
stopEDT( edtUtil, new Runnable() { // blocks!
+ @Override
public void run() {
if ( null != f_aDevice ) {
f_dpy.closeNativeImpl(f_aDevice);
@@ -308,6 +312,7 @@ public abstract class DisplayImpl extends Display {
d.aDevice = null;
d.refCount=0;
final Runnable closeNativeTask = new Runnable() {
+ @Override
public void run() {
if ( null != d.getGraphicsDevice() ) {
d.closeNativeImpl(f_aDevice);
@@ -329,6 +334,7 @@ public abstract class DisplayImpl extends Display {
}
}
+ @Override
public synchronized final int addReference() {
if(DEBUG) {
System.err.println("Display.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
@@ -343,6 +349,7 @@ public abstract class DisplayImpl extends Display {
}
+ @Override
public synchronized final int removeReference() {
if(DEBUG) {
System.err.println("Display.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1));
@@ -355,6 +362,7 @@ public abstract class DisplayImpl extends Display {
return refCount;
}
+ @Override
public synchronized final int getReferenceCount() {
return refCount;
}
@@ -450,6 +458,7 @@ public abstract class DisplayImpl extends Display {
private volatile boolean haveEvents = false;
final protected Runnable dispatchMessagesRunnable = new Runnable() {
+ @Override
public void run() {
DisplayImpl.this.dispatchMessages();
} };
diff --git a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
index f1e212394..9364ada30 100644
--- a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
+++ b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
@@ -51,6 +51,7 @@ import com.jogamp.common.util.cache.TempJarCache;
public class NEWTJNILibLoader extends JNILibLoaderBase {
public static boolean loadNEWT() {
return AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Boolean run() {
Platform.initSingleton();
final String libName = "newt";
diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java
index eba844230..2478b1e5d 100644
--- a/src/newt/classes/jogamp/newt/OffscreenWindow.java
+++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java
@@ -57,6 +57,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
static long nextWindowHandle = 0x100; // start here - a marker
+ @Override
protected void createNativeImpl() {
if(capsRequested.isOnscreen()) {
throw new NativeWindowException("Capabilities is onscreen");
@@ -75,6 +76,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
visibleChanged(false, true);
}
+ @Override
protected void closeNativeImpl() {
// nop
}
@@ -85,6 +87,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
surfaceHandle = 0;
}
+ @Override
public void setSurfaceHandle(long handle) {
surfaceHandle = handle ;
}
@@ -94,6 +97,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
return surfaceHandle;
}
+ @Override
protected void requestFocusImpl(boolean reparented) {
}
@@ -113,6 +117,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
}
+ @Override
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
sizeChanged(false, width, height, false);
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
@@ -138,10 +143,12 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
return new Point(0,0);
}
+ @Override
protected Point getLocationOnScreenImpl(int x, int y) {
return new Point(x,y);
}
+ @Override
protected void updateInsetsImpl(Insets insets) {
// nop ..
}
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index a0ef8816b..5102fd26d 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -207,6 +207,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
/** last mouse button click count */
short lastButtonClickCount = (short)0;
+ @Override
final void clearButton() {
super.clearButton();
lastButtonPressTime = 0;
@@ -536,12 +537,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
private Object closingListenerLock = new Object();
private WindowClosingMode defaultCloseOperation = WindowClosingMode.DISPOSE_ON_CLOSE;
+ @Override
public WindowClosingMode getDefaultCloseOperation() {
synchronized (closingListenerLock) {
return defaultCloseOperation;
}
}
+ @Override
public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
synchronized (closingListenerLock) {
WindowClosingMode _op = defaultCloseOperation;
@@ -956,6 +959,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
this.visible = visible;
}
+ @Override
public final void run() {
setVisibleActionImpl(visible);
}
@@ -983,6 +987,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
this.disregardFS = disregardFS;
}
+ @Override
public final void run() {
final RecursiveLock _lock = windowLock;
_lock.lock();
@@ -1035,6 +1040,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
private class DestroyAction implements Runnable {
+ @Override
public final void run() {
boolean animatorPaused = false;
if(null!=lifecycleHook) {
@@ -1188,6 +1194,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
screen = newScreen;
}
+ @Override
public final void run() {
boolean animatorPaused = false;
if(null!=lifecycleHook) {
@@ -1462,6 +1469,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
private class ReparentActionRecreate implements Runnable {
+ @Override
public final void run() {
final RecursiveLock _lock = windowLock;
_lock.lock();
@@ -1514,6 +1522,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
this.undecorated = undecorated;
}
+ @Override
public final void run() {
final RecursiveLock _lock = windowLock;
_lock.lock();
@@ -1559,6 +1568,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
this.alwaysOnTop = alwaysOnTop;
}
+ @Override
public final void run() {
final RecursiveLock _lock = windowLock;
_lock.lock();
@@ -1834,6 +1844,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
private final Runnable requestFocusAction = new Runnable() {
+ @Override
public final void run() {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.RequestFocusAction: force 0 - ("+getThreadName()+"): "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -1842,6 +1853,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
};
private final Runnable requestFocusActionForced = new Runnable() {
+ @Override
public final void run() {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.RequestFocusAction: force 1 - ("+getThreadName()+"): "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -1921,6 +1933,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
this.y = y;
}
+ @Override
public final void run() {
final RecursiveLock _lock = windowLock;
_lock.lock();
@@ -1970,6 +1983,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
public boolean fsOn() { return fullscreen; }
+ @Override
public final void run() {
final RecursiveLock _lock = windowLock;
_lock.lock();
@@ -2144,6 +2158,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
List _fullscreenMonitors = null;
boolean _fullscreenUseMainMonitor = true;
+ @Override
public void monitorModeChangeNotify(MonitorEvent me) {
hadFocus = hasFocus();
if(DEBUG_IMPLEMENTATION) {
@@ -2164,6 +2179,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
}
}
+ @Override
public void monitorModeChanged(MonitorEvent me, boolean success) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("Window.monitorModeChanged: hadFocus "+hadFocus+", "+me+", success: "+success+" @ "+Thread.currentThread().getName());
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
index 325f17278..4bcb0fc82 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
@@ -51,16 +51,19 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
this.downstreamParent = downstreamParent;
}
+ @Override
public AWTAdapter addTo(java.awt.Component awtComponent) {
awtComponent.addHierarchyListener(this);
return super.addTo(awtComponent);
}
+ @Override
public AWTAdapter removeFrom(java.awt.Component awtComponent) {
awtComponent.removeHierarchyListener(this);
return super.removeFrom(awtComponent);
}
+ @Override
public void focusGained(java.awt.event.FocusEvent e) {
// forward focus to NEWT child
final com.jogamp.newt.Window newtChild = getNewtWindow();
@@ -78,12 +81,14 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
}
}
+ @Override
public void focusLost(java.awt.event.FocusEvent e) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("AWT: focusLost: "+ e);
}
}
+ @Override
public void componentResized(java.awt.event.ComponentEvent e) {
// Need to resize the NEWT child window
// the resized event will be send via the native window feedback.
@@ -93,6 +98,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
}
final Window newtWindow = getNewtWindow();
newtWindow.runOnEDTIfAvail(false, new Runnable() {
+ @Override
public void run() {
int cw = comp.getWidth();
int ch = comp.getHeight();
@@ -109,6 +115,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
}});
}
+ @Override
public void componentMoved(java.awt.event.ComponentEvent e) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("AWT: componentMoved: "+e);
@@ -119,14 +126,17 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
}
}
+ @Override
public void windowActivated(java.awt.event.WindowEvent e) {
// no propagation to NEWT child window
}
+ @Override
public void windowDeactivated(java.awt.event.WindowEvent e) {
// no propagation to NEWT child window
}
+ @Override
public void hierarchyChanged(java.awt.event.HierarchyEvent e) {
if( null == getNewtEventListener() ) {
long bits = e.getChangeFlags();
@@ -137,6 +147,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
System.err.println("AWT: hierarchyChanged SHOWING_CHANGED: showing "+showing+", "+changed+", source "+e.getComponent());
}
getNewtWindow().runOnEDTIfAvail(false, new Runnable() {
+ @Override
public void run() {
if(getNewtWindow().isVisible() != showing) {
getNewtWindow().setVisible(showing);
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
index 14cc9c69d..f7722c91c 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
@@ -107,6 +107,7 @@ public class AWTCanvas extends Canvas {
return res;
}
+ @Override
public void addNotify() {
/**
@@ -160,6 +161,7 @@ public class AWTCanvas extends Canvas {
return null != jawtWindow ? jawtWindow.isOffscreenLayerSurfaceEnabled() : false;
}
+ @Override
public void removeNotify() {
try {
dispose();
@@ -195,6 +197,7 @@ public class AWTCanvas extends Canvas {
* Overridden to choose a GraphicsConfiguration on a parent container's
* GraphicsDevice because both devices
*/
+ @Override
public GraphicsConfiguration getGraphicsConfiguration() {
/*
* Workaround for problems with Xinerama and java.awt.Component.checkGD
@@ -324,6 +327,7 @@ public class AWTCanvas extends Canvas {
if (!disableBackgroundEraseInitialized) {
try {
AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
public Object run() {
try {
Class> clazz = getToolkit().getClass();
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
index bddb43b30..4a7193306 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
@@ -218,6 +218,7 @@ public class AWTEDTUtil implements EDTUtil {
}
try {
AWTEDTExecutor.singleton.invoke(true, new Runnable() {
+ @Override
public void run() { }
});
} catch (Exception e) { }
diff --git a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
index 9e716d544..d9a4a48e5 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
@@ -46,6 +46,7 @@ public class DisplayDriver extends DisplayImpl {
public DisplayDriver() {
}
+ @Override
protected void createNativeImpl() {
aDevice = AWTGraphicsDevice.createDefault();
}
@@ -54,6 +55,7 @@ public class DisplayDriver extends DisplayImpl {
aDevice = d;
}
+ @Override
protected EDTUtil createEDTUtil() {
final EDTUtil def;
if(NewtFactory.useEDT()) {
@@ -67,10 +69,12 @@ public class DisplayDriver extends DisplayImpl {
return def;
}
+ @Override
protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
aDevice.close();
}
+ @Override
protected void dispatchMessagesNative() { /* nop */ }
}
diff --git a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
index a2430e2bb..a4356707e 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
@@ -49,6 +49,7 @@ public class ScreenDriver extends ScreenImpl {
public ScreenDriver() {
}
+ @Override
protected void createNativeImpl() {
aScreen = new AWTGraphicsScreen((AWTGraphicsDevice)display.getGraphicsDevice());
}
@@ -65,8 +66,10 @@ public class ScreenDriver extends ScreenImpl {
super.updateVirtualScreenOriginAndSize();
}
+ @Override
protected void closeNativeImpl() { }
+ @Override
protected int validateScreenIndex(int idx) {
return idx; // pass through ...
}
diff --git a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
index db71695b7..9854524d9 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
@@ -86,6 +86,7 @@ public class WindowDriver extends WindowImpl {
private Frame awtFrame = null;
private AWTCanvas awtCanvas;
+ @Override
protected void requestFocusImpl(boolean reparented) {
awtContainer.requestFocus();
}
@@ -97,6 +98,7 @@ public class WindowDriver extends WindowImpl {
}
}
+ @Override
protected void createNativeImpl() {
if(0!=getParentWindowHandle()) {
throw new RuntimeException("Window parenting not supported in AWT, use AWTWindow(Frame) cstr for wrapping instead");
@@ -140,6 +142,7 @@ public class WindowDriver extends WindowImpl {
}
}
+ @Override
protected void closeNativeImpl() {
setWindowHandle(0);
if(null!=awtContainer) {
@@ -176,6 +179,7 @@ public class WindowDriver extends WindowImpl {
return res;
}
+ @Override
protected void updateInsetsImpl(javax.media.nativewindow.util.Insets insets) {
final Insets contInsets = awtContainer.getInsets();
insets.set(contInsets.left, contInsets.right, contInsets.top, contInsets.bottom);
@@ -214,6 +218,7 @@ public class WindowDriver extends WindowImpl {
awtContainer.validate();
}
+ @Override
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("AWTWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
@@ -266,6 +271,7 @@ public class WindowDriver extends WindowImpl {
return true;
}
+ @Override
protected Point getLocationOnScreenImpl(int x, int y) {
java.awt.Point ap = awtCanvas.getLocationOnScreen();
ap.translate(x, y);
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
index 1b73cb381..9da671d37 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
@@ -61,6 +61,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
public DisplayDriver() {
}
+ @Override
protected void createNativeImpl() {
final long handle = CreateDisplay(ScreenDriver.fixedWidth, ScreenDriver.fixedHeight);
if (handle == EGL.EGL_NO_DISPLAY) {
@@ -69,6 +70,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
aDevice = new EGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, handle, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT, null);
}
+ @Override
protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
DestroyDisplay(aDevice.getHandle());
@@ -76,6 +78,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
aDevice.close();
}
+ @Override
protected void dispatchMessagesNative() {
// n/a .. DispatchMessages();
}
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
index 269574adc..d3231557f 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
@@ -53,12 +53,15 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
public ScreenDriver() {
}
+ @Override
protected void createNativeImpl() {
aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
}
+ @Override
protected void closeNativeImpl() { }
+ @Override
protected int validateScreenIndex(int idx) {
return 0; // only one screen available
}
@@ -100,6 +103,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
return false;
}
+ @Override
protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
vOriginSize.set(0, 0, fixedWidth, fixedHeight); // FIXME
}
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
index bed0520ff..39f168e0f 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
@@ -52,6 +52,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
public WindowDriver() {
}
+ @Override
protected void createNativeImpl() {
if(0!=getParentWindowHandle()) {
throw new RuntimeException("Window parenting not supported (yet)");
@@ -72,12 +73,14 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
}
+ @Override
protected void closeNativeImpl() {
if(0!=windowHandleClose) {
CloseWindow(getDisplayHandle(), windowHandleClose);
}
}
+ @Override
protected void requestFocusImpl(boolean reparented) { }
protected void setSizeImpl(int width, int height) {
@@ -89,6 +92,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
}
+ @Override
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
if(0!=getWindowHandle()) {
if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) {
@@ -117,10 +121,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
return true;
}
+ @Override
protected Point getLocationOnScreenImpl(int x, int y) {
return new Point(x,y);
}
+ @Override
protected void updateInsetsImpl(Insets insets) {
// nop ..
}
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
index 52c92a5da..d8d93f123 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
@@ -59,15 +59,18 @@ public class DisplayDriver extends DisplayImpl {
public DisplayDriver() {
}
+ @Override
protected void createNativeImpl() {
// FIXME: map name to EGL_*_DISPLAY
aDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
}
+ @Override
protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
aDevice.close();
}
+ @Override
protected void dispatchMessagesNative() {
DispatchMessages();
}
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
index 5a1917419..dc2a8459a 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
@@ -45,13 +45,16 @@ public class ScreenDriver extends ScreenImpl {
public ScreenDriver() {
}
+ @Override
protected void createNativeImpl() {
aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
initNative();
}
+ @Override
protected void closeNativeImpl() { }
+ @Override
protected int validateScreenIndex(int idx) {
return 0; // only one screen available
}
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
index 560e49e96..4d4977776 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
@@ -55,6 +55,7 @@ public class WindowDriver extends WindowImpl {
public WindowDriver() {
}
+ @Override
protected void createNativeImpl() {
if(0!=getParentWindowHandle()) {
throw new RuntimeException("Window parenting not supported (yet)");
@@ -92,6 +93,7 @@ public class WindowDriver extends WindowImpl {
focusChanged(false, true);
}
+ @Override
protected void closeNativeImpl() {
final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) getGraphicsConfiguration().getScreen().getDevice();
@@ -106,10 +108,12 @@ public class WindowDriver extends WindowImpl {
eglDevice.close();
}
+ @Override
protected void requestFocusImpl(boolean reparented) {
focusChanged(false, true);
}
+ @Override
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
setVisible0(nativeWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
@@ -143,10 +147,12 @@ public class WindowDriver extends WindowImpl {
return true;
}
+ @Override
protected Point getLocationOnScreenImpl(int x, int y) {
return new Point(x,y);
}
+ @Override
protected void updateInsetsImpl(Insets insets) {
// nop ..
}
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
index 4cb566bc2..cc435540f 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
@@ -59,6 +59,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
public DisplayDriver() {
}
+ @Override
protected void createNativeImpl() {
synchronized(DisplayDriver.class) {
if(0==initCounter) {
@@ -72,6 +73,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
aDevice = new DefaultGraphicsDevice(NativeWindowFactory.TYPE_DEFAULT, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT, displayHandle);
}
+ @Override
protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
if(0==displayHandle) {
throw new NativeWindowException("displayHandle null; initCnt "+initCounter);
@@ -87,6 +89,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
aDevice.close();
}
+ @Override
protected void dispatchMessagesNative() {
if(0!=displayHandle) {
DispatchMessages(displayHandle, focusedWindow);
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
index b5202aaf9..44802e348 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
@@ -53,14 +53,17 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
public ScreenDriver() {
}
+ @Override
protected void createNativeImpl() {
AbstractGraphicsDevice adevice = getDisplay().getGraphicsDevice();
GetScreenInfo(adevice.getHandle(), screen_idx);
aScreen = new DefaultGraphicsScreen(adevice, screen_idx);
}
+ @Override
protected void closeNativeImpl() { }
+ @Override
protected int validateScreenIndex(int idx) {
return 0; // only one screen available
}
@@ -102,6 +105,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
return false;
}
+ @Override
protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
vOriginSize.set(0, 0, cachedWidth, cachedHeight);
}
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
index 80821d4da..0e96c65d0 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
@@ -48,6 +48,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
static long nextWindowHandle = 1;
+ @Override
protected void createNativeImpl() {
if(0!=getParentWindowHandle()) {
throw new NativeWindowException("GDL Window does not support window parenting");
@@ -72,6 +73,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
}
+ @Override
protected void closeNativeImpl() {
if(0!=surfaceHandle) {
synchronized(WindowDriver.class) {
@@ -82,6 +84,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
}
}
+ @Override
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
ScreenDriver screen = (ScreenDriver) getScreen();
@@ -112,6 +115,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
return true;
}
+ @Override
protected void requestFocusImpl(boolean reparented) {
((DisplayDriver)getScreen().getDisplay()).setFocus(this);
}
@@ -121,10 +125,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
return surfaceHandle;
}
+ @Override
protected Point getLocationOnScreenImpl(int x, int y) {
return new Point(x,y);
}
+ @Override
protected void updateInsetsImpl(Insets insets) {
// nop ..
}
diff --git a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
index 1b92ca586..929688b11 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
@@ -59,15 +59,18 @@ public class DisplayDriver extends DisplayImpl {
public DisplayDriver() {
}
+ @Override
protected void createNativeImpl() {
// FIXME: map name to EGL_*_DISPLAY
aDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT);
}
+ @Override
protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
aDevice.close();
}
+ @Override
protected void dispatchMessagesNative() {
DispatchMessages();
}
diff --git a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
index 17cc5dd2f..9ebe2629a 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
@@ -51,12 +51,15 @@ public class ScreenDriver extends ScreenImpl {
public ScreenDriver() {
}
+ @Override
protected void createNativeImpl() {
aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
}
+ @Override
protected void closeNativeImpl() { }
+ @Override
protected int validateScreenIndex(int idx) {
return 0; // only one screen available
}
@@ -98,6 +101,7 @@ public class ScreenDriver extends ScreenImpl {
return false;
}
+ @Override
protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
vOriginSize.set(0, 0, cachedWidth, cachedHeight);
}
diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
index d30d4f025..158e6ab2f 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
@@ -56,6 +56,7 @@ public class WindowDriver extends WindowImpl {
public WindowDriver() {
}
+ @Override
protected void createNativeImpl() {
if(0!=getParentWindowHandle()) {
throw new RuntimeException("Window parenting not supported (yet)");
@@ -83,6 +84,7 @@ public class WindowDriver extends WindowImpl {
windowHandleClose = eglWindowHandle;
}
+ @Override
protected void closeNativeImpl() {
if(0!=windowHandleClose) {
CloseWindow(windowHandleClose, windowUserData);
@@ -90,8 +92,10 @@ public class WindowDriver extends WindowImpl {
}
}
+ @Override
protected void requestFocusImpl(boolean reparented) { }
+ @Override
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
setVisible0(eglWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
@@ -125,10 +129,12 @@ public class WindowDriver extends WindowImpl {
return true;
}
+ @Override
protected Point getLocationOnScreenImpl(int x, int y) {
return new Point(x,y);
}
+ @Override
protected void updateInsetsImpl(Insets insets) {
// nop ..
}
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
index 2dbdfdce7..c44685dc8 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
@@ -64,14 +64,17 @@ public class DisplayDriver extends DisplayImpl {
public DisplayDriver() {
}
+ @Override
protected void dispatchMessagesNative() {
// nop
}
+ @Override
protected void createNativeImpl() {
aDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
}
+ @Override
protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
aDevice.close();
}
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
index 5d3b7287b..4f3cc691b 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
@@ -52,10 +52,12 @@ public class ScreenDriver extends ScreenImpl {
public ScreenDriver() {
}
+ @Override
protected void createNativeImpl() {
aScreen = new DefaultGraphicsScreen(getDisplay().getGraphicsDevice(), screen_idx);
}
+ @Override
protected void closeNativeImpl() { }
private MonitorMode getMonitorModeImpl(MonitorModeProps.Cache cache, int crt_idx, int mode_idx) {
@@ -114,6 +116,7 @@ public class ScreenDriver extends ScreenImpl {
return setMonitorMode0(monitor.getId(), mode.getId(), mode.getRotation());
}
+ @Override
protected int validateScreenIndex(int idx) {
return 0; // big-desktop w/ multiple monitor attached, only one screen available
}
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
index f36d32772..7db3e2aab 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
@@ -87,6 +87,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
isOffscreenInstance = false;
if (0 != handle) {
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
close0( handle );
} } );
@@ -144,6 +145,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
if (isNativeValid()) {
if (0 != sscSurfaceHandle) {
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
orderOut0( 0 != getParentWindowHandle() ? getParentWindowHandle() : getWindowHandle() );
} } );
@@ -160,6 +162,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
@Override
protected void setTitleImpl(final String title) {
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
setTitle0(getWindowHandle(), title);
} } );
@@ -172,6 +175,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
if(!isOffscreenInstance) {
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
requestFocus0(getWindowHandle(), force);
} } );
@@ -187,6 +191,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
}
if(!isOffscreenInstance) {
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
resignFocus0(getWindowHandle());
} } );
@@ -209,6 +214,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
System.err.println("MacWindow: updatePosition() parent["+useParent+" "+pX+"/"+pY+"] "+x+"/"+y+" -> "+x+"/"+y+" rel-client-pos, "+p0S+" screen-client-pos");
}
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
setWindowClientTopLeftPoint0(handle, p0S.getX(), p0S.getY(), isVisible());
} } );
@@ -230,6 +236,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
System.err.println("MacWindow: sizeChanged() parent["+useParent+" "+x+"/"+y+"] "+getX()+"/"+getY()+" "+newWidth+"x"+newHeight+" -> "+p0S+" screen-client-pos");
}
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
setWindowClientTopLeftPoint0(getWindowHandle(), p0S.getX(), p0S.getY(), isVisible());
} } );
@@ -275,6 +282,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && !setVisible ) {
if ( !isOffscreenInstance ) {
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
orderOut0(getWindowHandle());
visibleChanged(true, false);
@@ -297,6 +305,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
if( width>0 && height>0 ) {
if( !isOffscreenInstance ) {
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
setWindowClientTopLeftPointAndSize0(getWindowHandle(), pClientLevelOnSreen.getX(), pClientLevelOnSreen.getY(), width, height, setVisible);
} } );
@@ -308,6 +317,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && setVisible ) {
if( !isOffscreenInstance ) {
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
orderFront0(getWindowHandle());
visibleChanged(true, true);
@@ -476,6 +486,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
throw new NativeWindowException("Internal Error - create w/ window, but no Newt NSView");
}
OSXUtil.RunOnMainThread(false, new Runnable() {
+ @Override
public void run() {
changeContentView0(parentWinHandle, preWinHandle, 0);
close0( preWinHandle );
@@ -502,6 +513,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
final boolean isOpaque = getGraphicsConfiguration().getChosenCapabilities().isBackgroundOpaque() && !offscreenInstance;
// Blocking initialization on main-thread!
OSXUtil.RunOnMainThread(true, new Runnable() {
+ @Override
public void run() {
initWindow0( parentWinHandle, newWin, pS.getX(), pS.getY(), width, height,
isOpaque, fullscreen, visible && !offscreenInstance, surfaceHandle);
diff --git a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
index d3c7416cc..d8ff7ecb5 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
@@ -71,16 +71,19 @@ public class DisplayDriver extends DisplayImpl {
public DisplayDriver() {
}
+ @Override
protected void createNativeImpl() {
sharedClass = sharedClassFactory.getSharedClass();
aDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
}
+ @Override
protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
sharedClassFactory.releaseSharedClass();
aDevice.close();
}
+ @Override
protected void dispatchMessagesNative() {
DispatchMessages0();
}
diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
index 30405aa05..6e8ac3efa 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
@@ -127,6 +127,7 @@ public class WindowDriver extends WindowImpl {
return false;
}
+ @Override
protected void createNativeImpl() {
final ScreenDriver screen = (ScreenDriver) getScreen();
final DisplayDriver display = (DisplayDriver) screen.getDisplay();
@@ -156,6 +157,7 @@ public class WindowDriver extends WindowImpl {
}
}
+ @Override
protected void closeNativeImpl() {
if(windowHandleClose != 0) {
if (hdc != 0) {
@@ -183,6 +185,7 @@ public class WindowDriver extends WindowImpl {
hdc_old = 0;
}
+ @Override
protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
if(DEBUG_IMPLEMENTATION) {
System.err.println("WindowsWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
@@ -210,6 +213,7 @@ public class WindowDriver extends WindowImpl {
return true;
}
+ @Override
protected void requestFocusImpl(boolean force) {
requestFocus0(getWindowHandle(), force);
}
@@ -224,6 +228,7 @@ public class WindowDriver extends WindowImpl {
final boolean[] res = new boolean[] { false };
this.runOnEDTIfAvail(true, new Runnable() {
+ @Override
public void run() {
res[0] = setPointerVisible0(getWindowHandle(), pointerVisible);
}
@@ -236,6 +241,7 @@ public class WindowDriver extends WindowImpl {
final Boolean[] res = new Boolean[] { Boolean.FALSE };
this.runOnEDTIfAvail(true, new Runnable() {
+ @Override
public void run() {
final Point p0 = getLocationOnScreenImpl(0, 0);
res[0] = Boolean.valueOf(confinePointer0(getWindowHandle(), confine,
@@ -248,6 +254,7 @@ public class WindowDriver extends WindowImpl {
@Override
protected void warpPointerImpl(final int x, final int y) {
this.runOnEDTIfAvail(true, new Runnable() {
+ @Override
public void run() {
final Point sPos = getLocationOnScreenImpl(x, y);
warpPointer0(getWindowHandle(), sPos.getX(), sPos.getY());
@@ -256,10 +263,12 @@ public class WindowDriver extends WindowImpl {
return;
}
+ @Override
protected Point getLocationOnScreenImpl(int x, int y) {
return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
}
+ @Override
protected void updateInsetsImpl(Insets insets) {
// nop - using event driven insetsChange(..)
}
diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
index aa8067520..504839797 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
@@ -63,6 +63,7 @@ public class DisplayDriver extends DisplayImpl {
public DisplayDriver() {
}
+ @Override
public String validateDisplayName(String name, long handle) {
return X11Util.validateDisplayName(name, handle);
}
@@ -72,6 +73,7 @@ public class DisplayDriver extends DisplayImpl {
*
* We use a private non-shared X11 Display instance for EDT window operations and one for exposed animation, eg. OpenGL.
*/
+ @Override
protected void createNativeImpl() {
X11Util.setX11ErrorHandler(true, DEBUG ? false : true); // make sure X11 error handler is set
long handle = X11Util.openDisplay(name);
diff --git a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
index 7f75e03f0..bef7f60ec 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
@@ -74,6 +74,7 @@ public class ScreenDriver extends ScreenImpl {
protected void createNativeImpl() {
// validate screen index
Long handle = runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Long run(long dpy) {
return new Long(GetScreen0(dpy, screen_idx));
} } );
@@ -180,6 +181,7 @@ public class ScreenDriver extends ScreenImpl {
if( null == rAndR ) { return null; }
return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public MonitorMode run(long dpy) {
final int[] currentModeProps = rAndR.getCurrentMonitorModeProps(dpy, ScreenDriver.this, monitor.getId());
return MonitorModeProps.streamInMonitorMode(null, null, currentModeProps, 0);
@@ -192,6 +194,7 @@ public class ScreenDriver extends ScreenImpl {
final long t0 = System.currentTimeMillis();
boolean done = runWithOptTempDisplayHandle( new DisplayImpl.DisplayRunnable() {
+ @Override
public Boolean run(long dpy) {
return Boolean.valueOf( rAndR.setCurrentMonitorMode(dpy, ScreenDriver.this, monitor, mode) );
}
@@ -205,6 +208,7 @@ public class ScreenDriver extends ScreenImpl {
}
private DisplayImpl.DisplayRunnable xineramaEnabledQueryWithTemp = new DisplayImpl.DisplayRunnable() {
+ @Override
public Boolean run(long dpy) {
return new Boolean(X11Util.XineramaIsEnabled(dpy));
} };
@@ -236,6 +240,7 @@ public class ScreenDriver extends ScreenImpl {
} } );
} else */ {
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Object run(long dpy) {
vOriginSize.set(0, 0, getWidth0(dpy, screen_idx), getHeight0(dpy, screen_idx));
return null;
diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
index 02f80c0c3..5e1f7a6ed 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
@@ -176,6 +176,7 @@ public class WindowDriver extends WindowImpl {
final int fflags = flags;
final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Object run(long dpy) {
reconfigureWindow0( dpy, getScreenIndex(),
getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
@@ -202,6 +203,7 @@ public class WindowDriver extends WindowImpl {
}
final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Object run(long dpy) {
reconfigureWindow0( dpy, getScreenIndex(),
getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
@@ -223,6 +225,7 @@ public class WindowDriver extends WindowImpl {
@Override
protected void requestFocusImpl(final boolean force) {
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Object run(long dpy) {
requestFocus0(dpy, getWindowHandle(), force);
return null;
@@ -233,6 +236,7 @@ public class WindowDriver extends WindowImpl {
@Override
protected void setTitleImpl(final String title) {
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Object run(long dpy) {
setTitle0(dpy, getWindowHandle(), title);
return null;
@@ -243,6 +247,7 @@ public class WindowDriver extends WindowImpl {
@Override
protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Boolean run(long dpy) {
return Boolean.valueOf(setPointerVisible0(dpy, getWindowHandle(), pointerVisible));
}
@@ -252,6 +257,7 @@ public class WindowDriver extends WindowImpl {
@Override
protected boolean confinePointerImpl(final boolean confine) {
return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Boolean run(long dpy) {
return Boolean.valueOf(confinePointer0(dpy, getWindowHandle(), confine));
}
@@ -261,6 +267,7 @@ public class WindowDriver extends WindowImpl {
@Override
protected void warpPointerImpl(final int x, final int y) {
runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Object run(long dpy) {
warpPointer0(dpy, getWindowHandle(), x, y);
return null;
@@ -271,6 +278,7 @@ public class WindowDriver extends WindowImpl {
@Override
protected Point getLocationOnScreenImpl(final int x, final int y) {
return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable() {
+ @Override
public Point run(long dpy) {
return X11Lib.GetRelativeLocation(dpy, getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
}
diff --git a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
index 08eacdee5..db89690f4 100644
--- a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
@@ -54,6 +54,7 @@ public class SWTEDTUtil implements EDTUtil {
this.threadGroup = Thread.currentThread().getThreadGroup();
this.name=Thread.currentThread().getName()+"-SWTDisplay-"+newtDisplay.getFQName()+"-EDT-";
this.dispatchMessages = new Runnable() {
+ @Override
public void run() {
((jogamp.newt.DisplayImpl) newtDisplay).dispatchMessages();
} };
@@ -252,6 +253,7 @@ public class SWTEDTUtil implements EDTUtil {
}
try {
swtDisplay.syncExec(new Runnable() {
+ @Override
public void run() { }
});
} catch (Exception e) { }
--
cgit v1.2.3