summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2011-02-28 19:45:47 +0000
committerFelipe Heidrich <fheidric>2011-02-28 19:45:47 +0000
commit8363b351626987482f14440efdccfc6d188eeac8 (patch)
treeb4ea3d28612f38b900e749cd70672718e7f9cd1d
parenta73c79701168d17f089f2c9df8354048c88e3bd6 (diff)
downloadeclipse.platform.swt-8363b351626987482f14440efdccfc6d188eeac8.tar.gz
eclipse.platform.swt-8363b351626987482f14440efdccfc6d188eeac8.tar.xz
eclipse.platform.swt-8363b351626987482f14440efdccfc6d188eeac8.zip
Bug 338448 - Control.setTouchEventsEnabled(boolean)/isTouchEnabled() not consistent
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java21
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java46
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java23
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java47
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java21
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java44
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java19
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java46
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java21
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Display.java21
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java60
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Display.java21
16 files changed, 287 insertions, 269 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
index 3d15a9cd76..07a49df176 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Control.java
@@ -477,7 +477,7 @@ public void addPaintListener(PaintListener listener) {
* one of the messages defined in the <code>TouchListener</code>
* interface.
* <p>
- * NOTE: You must also call <code>setTouchEventsEnabled</code> to notify the
+ * NOTE: You must also call <code>setTouchEnabled</code> to notify the
* windowing toolkit that you want touch events to be generated.
* </p>
*
@@ -1499,6 +1499,27 @@ public String getToolTipText () {
return toolTipText;
}
+/**
+ * Returns <code>true</code> if this control is receiving OS-level touch events,
+ * otherwise <code>false</code>
+ * <p>
+ * Note that this method will return false if the current platform does not support touch-based input.
+ * If this method does return true, gesture events will not be sent to the control.
+ *
+ * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkWidget();
+ return false;
+}
+
float getThemeAlpha () {
return 1 * parent.getThemeAlpha ();
}
@@ -1969,27 +1990,6 @@ boolean isTabItem () {
}
/**
- * Returns <code>true</code> if this control is receiving OS-level touch events,
- * otherwise <code>false</code>
- * <p>
- * Note that this method will return false if the current platform does not support touch-based input.
- * If this method does return true, gesture events will not be sent to the control.
- *
- * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- checkWidget();
- return false;
-}
-
-/**
* Returns <code>true</code> if the receiver is visible and all
* ancestors up to and including the receiver's nearest ancestor
* shell are visible. Otherwise, <code>false</code> is returned.
@@ -4017,7 +4017,7 @@ public void setToolTipText (String string) {
*
* @since 3.7
*/
-public void setTouchEventsEnabled(boolean enabled) {
+public void setTouchEnabled(boolean enabled) {
checkWidget();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java
index ce17f62829..f8af9ea2e2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Display.java
@@ -2175,6 +2175,17 @@ public Thread getThread () {
}
}
+/**
+ * Returns true if a touch-aware input device is attached to the system,
+ * enabled, and ready for use.
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkDevice();
+ return false;
+}
+
Widget getWidget (int handle) {
if (handle == 0) return null;
property [0] = 0;
@@ -2539,16 +2550,6 @@ boolean isBundled () {
return false;
}
-/**
- * Returns true if a touch-aware input device is attached to the system,
- * enabled, and ready for use.
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- return false;
-}
-
static boolean isValidClass (Class clazz) {
String name = clazz.getName ();
int index = name.lastIndexOf ('.');
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
index d1a920475d..ea7bb21e96 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
@@ -662,7 +662,7 @@ void addTraits(NSMutableDictionary dict, Font font) {
* one of the messages defined in the <code>TouchListener</code>
* interface.
* <p>
- * NOTE: You must also call <code>setTouchEventsEnabled</code> to notify the
+ * NOTE: You must also call <code>setTouchEnabled</code> to notify the
* windowing toolkit that you want touch events to be generated.
* </p>
*
@@ -1916,6 +1916,27 @@ public String getToolTipText () {
}
/**
+ * Returns <code>true</code> if this control is receiving OS-level touch events,
+ * otherwise <code>false</code>
+ * <p>
+ * Note that this method will return false if the current platform does not support touch-based input.
+ * If this method does return true, gesture events will not be sent to the control.
+ *
+ * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkWidget();
+ return display.getTouchEnabled() && touchEnabled;
+}
+
+/**
* Returns <code>true</code> if the receiver is visible, and
* <code>false</code> otherwise.
* <p>
@@ -2263,27 +2284,6 @@ boolean isTabItem () {
return (code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) != 0;
}
-/**
- * Returns <code>true</code> if this control is receiving OS-level touch events,
- * otherwise <code>false</code>
- * <p>
- * Note that this method will return false if the current platform does not support touch-based input.
- * If this method does return true, gesture events will not be sent to the control.
- *
- * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- checkWidget();
- return display.isTouchEnabled() && touchEnabled;
-}
-
boolean isTransparent() {
if (background != null) return false;
return parent.isTransparent();
@@ -4079,7 +4079,7 @@ public void setToolTipText (String string) {
*
* @since 3.7
*/
-public void setTouchEventsEnabled(boolean enabled) {
+public void setTouchEnabled(boolean enabled) {
checkWidget();
eventView().setAcceptsTouchEvents(enabled);
touchEnabled = enabled;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
index bca5bab759..2d3223c18b 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Display.java
@@ -2026,6 +2026,18 @@ public Thread getThread () {
}
}
+/**
+ * Returns true if a touch-aware input device is attached to the system,
+ * enabled, and ready for use.
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkDevice();
+ // Gestures are available on OS X 10.5.3 and later. Touch events are only available on 10.6 and later.
+ return (OS.VERSION > 0x1053);
+}
+
int getToolTipTime () {
checkDevice ();
//TODO get OS value (NSTooltipManager?)
@@ -2962,17 +2974,6 @@ boolean isBundled () {
return false;
}
-/**
- * Returns true if a touch-aware input device is attached to the system,
- * enabled, and ready for use.
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- // Gestures are available on OS X 10.5.3 and later. Touch events are only available on 10.6 and later.
- return (OS.VERSION > 0x1053);
-}
-
static boolean isValidClass (Class clazz) {
String name = clazz.getName ();
int index = name.lastIndexOf ('.');
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
index b81d7eb3e9..b03bc8220d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java
@@ -1090,27 +1090,6 @@ boolean isFocusHandle (int /*long*/ widget) {
}
/**
- * Returns <code>true</code> if this control is receiving OS-level touch events,
- * otherwise <code>false</code>
- * <p>
- * Note that this method will return false if the current platform does not support touch-based input.
- * If this method does return true, gesture events will not be sent to the control.
- *
- * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- checkWidget();
- return false;
-}
-
-/**
* Moves the receiver above the specified control in the
* drawing order. If the argument is null, then the receiver
* is moved to the top of the drawing order. The control at
@@ -1674,7 +1653,7 @@ void addRelation (Control control) {
* one of the messages defined in the <code>TouchListener</code>
* interface.
* <p>
- * NOTE: You must also call <code>setTouchEventsEnabled</code> to notify the
+ * NOTE: You must also call <code>setTouchEnabled</code> to notify the
* windowing toolkit that you want touch events to be generated.
* </p>
*
@@ -2691,6 +2670,28 @@ public String getToolTipText () {
checkWidget();
return toolTipText;
}
+
+/**
+ * Returns <code>true</code> if this control is receiving OS-level touch events,
+ * otherwise <code>false</code>
+ * <p>
+ * Note that this method will return false if the current platform does not support touch-based input.
+ * If this method does return true, gesture events will not be sent to the control.
+ *
+ * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkWidget();
+ return false;
+}
+
/**
* Returns <code>true</code> if the receiver is visible, and
* <code>false</code> otherwise.
@@ -4265,7 +4266,7 @@ void setToolTipText (Shell shell, String newString) {
*
* @since 3.7
*/
-public void setTouchEventsEnabled(boolean enabled) {
+public void setTouchEnabled(boolean enabled) {
checkWidget();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 26b926a2e2..419ce07c73 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -2354,6 +2354,17 @@ public Thread getThread () {
}
}
+/**
+ * Returns true if a touch-aware input device is attached to the system,
+ * enabled, and ready for use.
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkDevice();
+ return false;
+}
+
Widget getWidget (int /*long*/ handle) {
if (handle == 0) return null;
if (lastWidget != null && lastHandle == handle) return lastWidget;
@@ -2706,16 +2717,6 @@ public int /*long*/ internal_new_GC (GCData data) {
return gdkGC;
}
-/**
- * Returns true if a touch-aware input device is attached to the system,
- * enabled, and ready for use.
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- return false;
-}
-
boolean isValidThread () {
return thread == Thread.currentThread ();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java
index 76abdf1de1..f9b9ee1947 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Control.java
@@ -423,7 +423,7 @@ public void addPaintListener(PaintListener listener) {
* one of the messages defined in the <code>TouchListener</code>
* interface.
* <p>
- * NOTE: You must also call <code>setTouchEventsEnabled</code> to notify the
+ * NOTE: You must also call <code>setTouchEnabled</code> to notify the
* windowing toolkit that you want touch events to be generated.
* </p>
*
@@ -1380,6 +1380,26 @@ public String getToolTipText () {
return toolTipText;
}
/**
+ * Returns <code>true</code> if this control is receiving OS-level touch events,
+ * otherwise <code>false</code>
+ * <p>
+ * Note that this method will return false if the current platform does not support touch-based input.
+ * If this method does return true, gesture events will not be sent to the control.
+ *
+ * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkWidget();
+ return false;
+}
+/**
* Returns <code>true</code> if the receiver is visible, and
* <code>false</code> otherwise.
* <p>
@@ -1620,26 +1640,6 @@ boolean isTabItem () {
return (code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) != 0;
}
/**
- * Returns <code>true</code> if this control is receiving OS-level touch events,
- * otherwise <code>false</code>
- * <p>
- * Note that this method will return false if the current platform does not support touch-based input.
- * If this method does return true, gesture events will not be sent to the control.
- *
- * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- checkWidget();
- return false;
-}
-/**
* Returns <code>true</code> if the receiver is visible and all
* ancestors up to and including the receiver's nearest ancestor
* shell are visible. Otherwise, <code>false</code> is returned.
@@ -3147,7 +3147,7 @@ public void setToolTipText (String string) {
*
* @since 3.7
*/
-public void setTouchEventsEnabled(boolean enabled) {
+public void setTouchEnabled(boolean enabled) {
checkWidget();
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java
index f12bddd792..7c01c80a99 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Display.java
@@ -2021,6 +2021,16 @@ public Thread getThread () {
return thread;
}
}
+/**
+ * Returns true if a touch-aware input device is attached to the system,
+ * enabled, and ready for use.
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkDevice();
+ return false;
+}
Widget getWidget (int handle) {
if (handle == 0) return null;
if (OS.XtIsSubclass (handle, OS.shellWidgetClass ())) {
@@ -2514,15 +2524,6 @@ public int internal_new_GC (GCData data) {
public void internal_dispose_GC (int gc, GCData data) {
OS.XFreeGC(xDisplay, gc);
}
-/**
- * Returns true if a touch-aware input device is attached to the system,
- * enabled, and ready for use.
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- return false;
-}
boolean isValidThread () {
return thread == Thread.currentThread ();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
index c7e2567969..1b8805a6b3 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Control.java
@@ -437,7 +437,7 @@ public void addPaintListener (PaintListener listener) {
* one of the messages defined in the <code>TouchListener</code>
* interface.
* <p>
- * NOTE: You must also call <code>setTouchEventsEnabled</code> to notify the
+ * NOTE: You must also call <code>setTouchEnabled</code> to notify the
* windowing toolkit that you want touch events to be generated.
* </p>
*
@@ -1214,6 +1214,27 @@ public String getToolTipText () {
return toolTipText;
}
+/**
+ * Returns <code>true</code> if this control is receiving OS-level touch events,
+ * otherwise <code>false</code>
+ * <p>
+ * Note that this method will return false if the current platform does not support touch-based input.
+ * If this method does return true, gesture events will not be sent to the control.
+ *
+ * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkWidget();
+ return false;
+}
+
/**
* Returns the region that defines the shape of the control,
* or null if the control has the default shape.
@@ -1460,27 +1481,6 @@ boolean isTabItem () {
}
/**
- * Returns <code>true</code> if this control is receiving OS-level touch events,
- * otherwise <code>false</code>
- * <p>
- * Note that this method will return false if the current platform does not support touch-based input.
- * If this method does return true, gesture events will not be sent to the control.
- *
- * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- checkWidget();
- return false;
-}
-
-/**
* Returns <code>true</code> if the receiver is visible and all
* ancestors up to and including the receiver's nearest ancestor
* shell are visible. Otherwise, <code>false</code> is returned.
@@ -3046,7 +3046,7 @@ public void setSize (int width, int height) {
*
* @since 3.7
*/
-public void setTouchEventsEnabled(boolean enabled) {
+public void setTouchEnabled(boolean enabled) {
checkWidget();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java
index 95b3a6a372..1c124f22ec 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Display.java
@@ -1456,6 +1456,17 @@ public Thread getThread () {
}
}
+/**
+ * Returns true if a touch-aware input device is attached to the system,
+ * enabled, and ready for use.
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkDevice();
+ return false;
+}
+
int hotkeyProc (int handle, int data, int info) {
Widget widget = WidgetTable.get (handle);
if (widget == null) return OS.Pt_CONTINUE;
@@ -1764,16 +1775,6 @@ public void internal_dispose_GC (int phGC, GCData data) {
OS.PgDestroyGC(phGC);
}
-/**
- * Returns true if a touch-aware input device is attached to the system,
- * enabled, and ready for use.
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- return false;
-}
-
boolean isValidThread () {
return thread == Thread.currentThread ();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java
index 482cc053b6..a253cfe83a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Control.java
@@ -743,7 +743,7 @@ public abstract class Control extends Widget implements Drawable {
* one of the messages defined in the <code>TouchListener</code>
* interface.
* <p>
- * NOTE: You must also call <code>setTouchEventsEnabled</code> to notify the
+ * NOTE: You must also call <code>setTouchEnabled</code> to notify the
* windowing toolkit that you want touch events to be generated.
* </p>
*
@@ -1659,6 +1659,27 @@ public abstract class Control extends Widget implements Drawable {
return getQWidget().toolTip();
}
+ /**
+ * Returns <code>true</code> if this control is receiving OS-level touch events,
+ * otherwise <code>false</code>
+ * <p>
+ * Note that this method will return false if the current platform does not support touch-based input.
+ * If this method does return true, gesture events will not be sent to the control.
+ *
+ * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.7
+ */
+ public boolean getTouchEnabled() {
+ checkWidget();
+ return false;
+ }
+
boolean hasFocus() {
return getQWidget().hasFocus();
}
@@ -1863,27 +1884,6 @@ public abstract class Control extends Widget implements Drawable {
}
/**
- * Returns <code>true</code> if this control is receiving OS-level touch events,
- * otherwise <code>false</code>
- * <p>
- * Note that this method will return false if the current platform does not support touch-based input.
- * If this method does return true, gesture events will not be sent to the control.
- *
- * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.7
- */
- public boolean isTouchEnabled() {
- checkWidget();
- return false;
- }
-
- /**
* Returns <code>true</code> if the receiver is visible and all ancestors up
* to and including the receiver's nearest ancestor shell are visible.
* Otherwise, <code>false</code> is returned.
@@ -1945,7 +1945,7 @@ public abstract class Control extends Widget implements Drawable {
*
* @since 3.7
*/
- public void setTouchEventsEnabled(boolean enabled) {
+ public void setTouchEnabled(boolean enabled) {
checkWidget();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Display.java
index 7a3f43aea2..556a9398a9 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/qt/org/eclipse/swt/widgets/Display.java
@@ -1020,16 +1020,6 @@ public class Display extends Device {
}
}
- /**
- * Returns true if a touch-aware input device is attached to the system,
- * enabled, and ready for use.
- *
- * @since 3.7
- */
- public boolean isTouchEnabled() {
- return false;
- }
-
static boolean isValidClass(Class<?> clazz) {
String name = clazz.getName();
int index = name.lastIndexOf('.');
@@ -1611,6 +1601,17 @@ public class Display extends Device {
}
}
+ /**
+ * Returns true if a touch-aware input device is attached to the system,
+ * enabled, and ready for use.
+ *
+ * @since 3.7
+ */
+ public boolean getTouchEnabled() {
+ checkDevice();
+ return false;
+ }
+
/**
* Invokes platform specific functionality to allocate a new GC handle.
* <p>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
index 20ae18382a..335581eada 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Control.java
@@ -455,7 +455,11 @@ public void addPaintListener (PaintListener listener) {
* be notified when touch events occur, by sending it
* one of the messages defined in the <code>TouchListener</code>
* interface.
- *
+ * <p>
+ * NOTE: You must also call <code>setTouchEnabled</code> to notify the
+ * windowing toolkit that you want touch events to be generated.
+ * </p>
+ *
* @param listener the listener which should be notified
*
* @exception IllegalArgumentException <ul>
@@ -466,10 +470,10 @@ public void addPaintListener (PaintListener listener) {
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
- * @since 3.7
- *
* @see TouchListener
* @see #removeTouchListener
+ *
+ * @since 3.7
*/
public void addTouchListener (TouchListener listener) {
checkWidget();
@@ -1584,6 +1588,27 @@ public String getToolTipText () {
}
/**
+ * Returns <code>true</code> if this control is receiving OS-level touch events,
+ * otherwise <code>false</code>
+ * <p>
+ * Note that this method will return false if the current platform does not support touch-based input.
+ * If this method does return true, gesture events will not be sent to the control.
+ *
+ * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled () {
+ checkWidget ();
+ return OS.IsTouchWindow (handle, null);
+}
+
+/**
* Returns <code>true</code> if the receiver is visible, and
* <code>false</code> otherwise.
* <p>
@@ -1871,27 +1896,6 @@ boolean isTabItem () {
}
/**
- * Returns <code>true</code> if this control is receiving OS-level touch events,
- * otherwise <code>false</code>
- * <p>
- * Note that this method will return false if the current platform does not support touch-based input.
- * If this method does return true, gesture events will not be sent to the control.
- *
- * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.7
- */
-public boolean isTouchEnabled () {
- checkWidget ();
- return OS.IsTouchWindow (handle, null);
-}
-
-/**
* Returns <code>true</code> if the receiver is visible and all
* ancestors up to and including the receiver's nearest ancestor
* shell are visible. Otherwise, <code>false</code> is returned.
@@ -2744,11 +2748,11 @@ public void removePaintListener(PaintListener listener) {
* <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
* </ul>
*
- * @since 3.7
- *
* @see TouchListener
* @see #addTouchListener
-*/
+ *
+ * @since 3.7
+ */
public void removeTouchListener(TouchListener listener) {
checkWidget();
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
@@ -3675,7 +3679,7 @@ void setToolTipText (Shell shell, String string) {
*
* @since 3.7
*/
-public void setTouchEventsEnabled(boolean enabled) {
+public void setTouchEnabled(boolean enabled) {
checkWidget();
if (enabled) {
OS.RegisterTouchWindow(handle, 0);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
index 003cfbdf8e..6ae8316615 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Display.java
@@ -2583,6 +2583,23 @@ public Thread getThread () {
}
}
+/**
+ * Returns true if a touch-aware input device is attached to the system,
+ * enabled, and ready for use.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * <li>ERROR_DEVICE_DISPOSED - if the receiver has been disposed</li>
+ * </ul>
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled () {
+ checkDevice();
+ int value = OS.GetSystemMetrics (OS.SM_DIGITIZER);
+ return (value & (OS.NID_READY | OS.NID_MULTI_INPUT)) != 0;
+}
+
int /*long*/ hButtonTheme () {
if (hButtonTheme != 0) return hButtonTheme;
return hButtonTheme = OS.OpenThemeData (hwndMessage, BUTTON);
@@ -2812,17 +2829,6 @@ public void internal_dispose_GC (int /*long*/ hDC, GCData data) {
OS.ReleaseDC (0, hDC);
}
-/**
- * Returns true if a touch-aware input device is attached to the system,
- * enabled, and ready for use.
- *
- * @since 3.7
- */
-public boolean isTouchEnabled () {
- int value = OS.GetSystemMetrics (OS.SM_DIGITIZER);
- return (value & (OS.NID_READY | OS.NID_MULTI_INPUT)) != 0;
-}
-
boolean isXMouseActive () {
/*
* NOTE: X-Mouse is active when bit 1 of the UserPreferencesMask is set.
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java
index 339e496897..d119470b39 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Control.java
@@ -444,7 +444,7 @@ public void addPaintListener (PaintListener listener) {
* one of the messages defined in the <code>TouchListener</code>
* interface.
* <p>
- * NOTE: You must also call <code>setTouchEventsEnabled</code> to notify the
+ * NOTE: You must also call <code>setTouchEnabled</code> to notify the
* windowing toolkit that you want touch events to be generated.
* </p>
*
@@ -1303,6 +1303,27 @@ public String getToolTipText () {
}
/**
+ * Returns <code>true</code> if this control is receiving OS-level touch events,
+ * otherwise <code>false</code>
+ * <p>
+ * Note that this method will return false if the current platform does not support touch-based input.
+ * If this method does return true, gesture events will not be sent to the control.
+ *
+ * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
+ *
+ * @exception SWTException <ul>
+ * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
+ * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
+ * </ul>
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkWidget();
+ return false;
+}
+
+/**
* WARNING: THIS API IS UNDER CONSTRUCTION AND SHOULD NOT BE USED
*/
public Transform getTransform () {
@@ -1823,27 +1844,6 @@ boolean isTabItem () {
}
/**
- * Returns <code>true</code> if this control is receiving OS-level touch events,
- * otherwise <code>false</code>
- * <p>
- * Note that this method will return false if the current platform does not support touch-based input.
- * If this method does return true, gesture events will not be sent to the control.
- *
- * @return <code>true</code> if the widget is currently receiving touch events; <code>false</code> otherwise.
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- checkWidget();
- return false;
-}
-
-/**
* Returns <code>true</code> if the receiver is visible and all
* ancestors up to and including the receiver's nearest ancestor
* shell are visible. Otherwise, <code>false</code> is returned.
@@ -3290,7 +3290,7 @@ public void setTransform (Transform t) {
*
* @since 3.7
*/
-public void setTouchEventsEnabled(boolean enabled) {
+public void setTouchEnabled(boolean enabled) {
checkWidget();
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Display.java
index 87229864ad..f04f18a902 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/wpf/org/eclipse/swt/widgets/Display.java
@@ -1129,16 +1129,6 @@ public static Display getDefault () {
}
}
-/**
- * Returns true if a touch-aware input device is attached to the system,
- * enabled, and ready for use.
- *
- * @since 3.7
- */
-public boolean isTouchEnabled() {
- return false;
-}
-
static boolean isValidClass (Class clazz) {
String name = clazz.getName ();
int index = name.lastIndexOf ('.');
@@ -1723,6 +1713,17 @@ public Thread getThread () {
}
/**
+ * Returns true if a touch-aware input device is attached to the system,
+ * enabled, and ready for use.
+ *
+ * @since 3.7
+ */
+public boolean getTouchEnabled() {
+ checkDevice();
+ return false;
+}
+
+/**
* Invokes platform specific functionality to allocate a new GC handle.
* <p>
* <b>IMPORTANT:</b> This method is <em>not</em> part of the public