From 8363b351626987482f14440efdccfc6d188eeac8 Mon Sep 17 00:00:00 2001 From: Felipe Heidrich Date: Mon, 28 Feb 2011 19:45:47 +0000 Subject: Bug 338448 - Control.setTouchEventsEnabled(boolean)/isTouchEnabled() not consistent --- .../carbon/org/eclipse/swt/widgets/Control.java | 46 ++++++++--------- .../carbon/org/eclipse/swt/widgets/Display.java | 21 ++++---- .../cocoa/org/eclipse/swt/widgets/Control.java | 46 ++++++++--------- .../cocoa/org/eclipse/swt/widgets/Display.java | 23 +++++---- .../gtk/org/eclipse/swt/widgets/Control.java | 47 ++++++++--------- .../gtk/org/eclipse/swt/widgets/Display.java | 21 ++++---- .../motif/org/eclipse/swt/widgets/Control.java | 44 ++++++++-------- .../motif/org/eclipse/swt/widgets/Display.java | 19 +++---- .../photon/org/eclipse/swt/widgets/Control.java | 46 ++++++++--------- .../photon/org/eclipse/swt/widgets/Display.java | 21 ++++---- .../qt/org/eclipse/swt/widgets/Control.java | 46 ++++++++--------- .../qt/org/eclipse/swt/widgets/Display.java | 21 ++++---- .../win32/org/eclipse/swt/widgets/Control.java | 60 ++++++++++++---------- .../win32/org/eclipse/swt/widgets/Display.java | 28 ++++++---- .../wpf/org/eclipse/swt/widgets/Control.java | 46 ++++++++--------- .../wpf/org/eclipse/swt/widgets/Display.java | 21 ++++---- 16 files changed, 287 insertions(+), 269 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT') 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 TouchListener * interface. *

- * NOTE: You must also call setTouchEventsEnabled to notify the + * NOTE: You must also call setTouchEnabled to notify the * windowing toolkit that you want touch events to be generated. *

* @@ -1499,6 +1499,27 @@ public String getToolTipText () { return toolTipText; } +/** + * Returns true if this control is receiving OS-level touch events, + * otherwise false + *

+ * 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 true if the widget is currently receiving touch events; false otherwise. + * + * @exception SWTException

+ * + * @since 3.7 + */ +public boolean getTouchEnabled() { + checkWidget(); + return false; +} + float getThemeAlpha () { return 1 * parent.getThemeAlpha (); } @@ -1968,27 +1989,6 @@ boolean isTabItem () { return (code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) != 0; } -/** - * Returns true if this control is receiving OS-level touch events, - * otherwise false - *

- * 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 true if the widget is currently receiving touch events; false otherwise. - * - * @exception SWTException

- * - * @since 3.7 - */ -public boolean isTouchEnabled() { - checkWidget(); - return false; -} - /** * Returns true if the receiver is visible and all * ancestors up to and including the receiver's nearest ancestor @@ -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 TouchListener * interface. *

- * NOTE: You must also call setTouchEventsEnabled to notify the + * NOTE: You must also call setTouchEnabled to notify the * windowing toolkit that you want touch events to be generated. *

* @@ -1915,6 +1915,27 @@ public String getToolTipText () { return toolTipText; } +/** + * Returns true if this control is receiving OS-level touch events, + * otherwise false + *

+ * 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 true if the widget is currently receiving touch events; false otherwise. + * + * @exception SWTException

+ * + * @since 3.7 + */ +public boolean getTouchEnabled() { + checkWidget(); + return display.getTouchEnabled() && touchEnabled; +} + /** * Returns true if the receiver is visible, and * false otherwise. @@ -2263,27 +2284,6 @@ boolean isTabItem () { return (code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) != 0; } -/** - * Returns true if this control is receiving OS-level touch events, - * otherwise false - *

- * 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 true if the widget is currently receiving touch events; false otherwise. - * - * @exception SWTException

- * - * @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 @@ -1089,27 +1089,6 @@ boolean isFocusHandle (int /*long*/ widget) { return widget == focusHandle (); } -/** - * Returns true if this control is receiving OS-level touch events, - * otherwise false - *

- * 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 true if the widget is currently receiving touch events; false otherwise. - * - * @exception SWTException

- * - * @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 @@ -1674,7 +1653,7 @@ void addRelation (Control control) { * one of the messages defined in the TouchListener * interface. *

- * NOTE: You must also call setTouchEventsEnabled to notify the + * NOTE: You must also call setTouchEnabled to notify the * windowing toolkit that you want touch events to be generated. *

* @@ -2691,6 +2670,28 @@ public String getToolTipText () { checkWidget(); return toolTipText; } + +/** + * Returns true if this control is receiving OS-level touch events, + * otherwise false + *

+ * 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 true if the widget is currently receiving touch events; false otherwise. + * + * @exception SWTException

+ * + * @since 3.7 + */ +public boolean getTouchEnabled() { + checkWidget(); + return false; +} + /** * Returns true if the receiver is visible, and * false 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 TouchListener * interface. *

- * NOTE: You must also call setTouchEventsEnabled to notify the + * NOTE: You must also call setTouchEnabled to notify the * windowing toolkit that you want touch events to be generated. *

* @@ -1379,6 +1379,26 @@ public String getToolTipText () { checkWidget(); return toolTipText; } +/** + * Returns true if this control is receiving OS-level touch events, + * otherwise false + *

+ * 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 true if the widget is currently receiving touch events; false otherwise. + * + * @exception SWTException

+ * + * @since 3.7 + */ +public boolean getTouchEnabled() { + checkWidget(); + return false; +} /** * Returns true if the receiver is visible, and * false otherwise. @@ -1619,26 +1639,6 @@ boolean isTabItem () { int code = traversalCode (0, null); return (code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) != 0; } -/** - * Returns true if this control is receiving OS-level touch events, - * otherwise false - *

- * 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 true if the widget is currently receiving touch events; false otherwise. - * - * @exception SWTException

- * - * @since 3.7 - */ -public boolean isTouchEnabled() { - checkWidget(); - return false; -} /** * Returns true if the receiver is visible and all * ancestors up to and including the receiver's nearest ancestor @@ -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 TouchListener * interface. *

- * NOTE: You must also call setTouchEventsEnabled to notify the + * NOTE: You must also call setTouchEnabled to notify the * windowing toolkit that you want touch events to be generated. *

* @@ -1214,6 +1214,27 @@ public String getToolTipText () { return toolTipText; } +/** + * Returns true if this control is receiving OS-level touch events, + * otherwise false + *

+ * 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 true if the widget is currently receiving touch events; false otherwise. + * + * @exception SWTException

+ * + * @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. @@ -1459,27 +1480,6 @@ boolean isTabItem () { return (code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) != 0; } -/** - * Returns true if this control is receiving OS-level touch events, - * otherwise false - *

- * 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 true if the widget is currently receiving touch events; false otherwise. - * - * @exception SWTException

- * - * @since 3.7 - */ -public boolean isTouchEnabled() { - checkWidget(); - return false; -} - /** * Returns true if the receiver is visible and all * ancestors up to and including the receiver's nearest ancestor @@ -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 TouchListener * interface. *

- * NOTE: You must also call setTouchEventsEnabled to notify the + * NOTE: You must also call setTouchEnabled to notify the * windowing toolkit that you want touch events to be generated. *

* @@ -1659,6 +1659,27 @@ public abstract class Control extends Widget implements Drawable { return getQWidget().toolTip(); } + /** + * Returns true if this control is receiving OS-level touch events, + * otherwise false + *

+ * 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 true if the widget is currently receiving touch events; false otherwise. + * + * @exception SWTException

+ * + * @since 3.7 + */ + public boolean getTouchEnabled() { + checkWidget(); + return false; + } + boolean hasFocus() { return getQWidget().hasFocus(); } @@ -1862,27 +1883,6 @@ public abstract class Control extends Widget implements Drawable { return FocusPolicy.TabFocus.equals(getQWidget().focusPolicy()); } - /** - * Returns true if this control is receiving OS-level touch events, - * otherwise false - *

- * 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 true if the widget is currently receiving touch events; false otherwise. - * - * @exception SWTException

- * - * @since 3.7 - */ - public boolean isTouchEnabled() { - checkWidget(); - return false; - } - /** * Returns true if the receiver is visible and all ancestors up * to and including the receiver's nearest ancestor shell are visible. @@ -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. *

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 TouchListener * interface. - * + *

+ * NOTE: You must also call setTouchEnabled to notify the + * windowing toolkit that you want touch events to be generated. + *

+ * * @param listener the listener which should be notified * * @exception IllegalArgumentException * - * @since 3.7 - * * @see TouchListener * @see #removeTouchListener + * + * @since 3.7 */ public void addTouchListener (TouchListener listener) { checkWidget(); @@ -1583,6 +1587,27 @@ public String getToolTipText () { return toolTipText; } +/** + * Returns true if this control is receiving OS-level touch events, + * otherwise false + *

+ * 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 true if the widget is currently receiving touch events; false otherwise. + * + * @exception SWTException

+ * + * @since 3.7 + */ +public boolean getTouchEnabled () { + checkWidget (); + return OS.IsTouchWindow (handle, null); +} + /** * Returns true if the receiver is visible, and * false otherwise. @@ -1870,27 +1895,6 @@ boolean isTabItem () { return true; } -/** - * Returns true if this control is receiving OS-level touch events, - * otherwise false - *

- * 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 true if the widget is currently receiving touch events; false otherwise. - * - * @exception SWTException

- * - * @since 3.7 - */ -public boolean isTouchEnabled () { - checkWidget (); - return OS.IsTouchWindow (handle, null); -} - /** * Returns true if the receiver is visible and all * ancestors up to and including the receiver's nearest ancestor @@ -2744,11 +2748,11 @@ public void removePaintListener(PaintListener listener) { *
  • ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
  • * * - * @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 + * + * @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 TouchListener * interface. *

    - * NOTE: You must also call setTouchEventsEnabled to notify the + * NOTE: You must also call setTouchEnabled to notify the * windowing toolkit that you want touch events to be generated. *

    * @@ -1302,6 +1302,27 @@ public String getToolTipText () { return toolTipText; } +/** + * Returns true if this control is receiving OS-level touch events, + * otherwise false + *

    + * 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 true if the widget is currently receiving touch events; false otherwise. + * + * @exception SWTException

    + * + * @since 3.7 + */ +public boolean getTouchEnabled() { + checkWidget(); + return false; +} + /** * WARNING: THIS API IS UNDER CONSTRUCTION AND SHOULD NOT BE USED */ @@ -1822,27 +1843,6 @@ boolean isTabItem () { return (code & (SWT.TRAVERSE_ARROW_PREVIOUS | SWT.TRAVERSE_ARROW_NEXT)) != 0; } -/** - * Returns true if this control is receiving OS-level touch events, - * otherwise false - *

    - * 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 true if the widget is currently receiving touch events; false otherwise. - * - * @exception SWTException

    - * - * @since 3.7 - */ -public boolean isTouchEnabled() { - checkWidget(); - return false; -} - /** * Returns true if the receiver is visible and all * ancestors up to and including the receiver's nearest ancestor @@ -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 ('.'); @@ -1722,6 +1712,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. *

    -- cgit