OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/base/events.h" | 5 #include "ui/base/events.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #include <X11/extensions/XInput.h> | 8 #include <X11/extensions/XInput.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
827 #else | 827 #else |
828 if (!factory->ExtractTouchParam( | 828 if (!factory->ExtractTouchParam( |
829 *xev, ui::TouchFactory::TP_SLOT_ID, &slot)) | 829 *xev, ui::TouchFactory::TP_SLOT_ID, &slot)) |
830 LOG(ERROR) << "Could not get the slot ID for the event. Using 0."; | 830 LOG(ERROR) << "Could not get the slot ID for the event. Using 0."; |
831 #endif | 831 #endif |
832 return slot; | 832 return slot; |
833 } | 833 } |
834 | 834 |
835 float GetTouchRadiusX(const base::NativeEvent& native_event) { | 835 float GetTouchRadiusX(const base::NativeEvent& native_event) { |
836 return GetTouchParamFromXEvent(native_event, | 836 return GetTouchParamFromXEvent(native_event, |
837 ui::TouchFactory::TP_TOUCH_MAJOR, 2.0) / 2.0; | 837 ui::TouchFactory::TP_TOUCH_MAJOR, 0.0) / 2.0; |
838 } | 838 } |
839 | 839 |
840 float GetTouchRadiusY(const base::NativeEvent& native_event) { | 840 float GetTouchRadiusY(const base::NativeEvent& native_event) { |
841 return GetTouchParamFromXEvent(native_event, | 841 return GetTouchParamFromXEvent(native_event, |
842 ui::TouchFactory::TP_TOUCH_MINOR, 2.0) / 2.0; | 842 ui::TouchFactory::TP_TOUCH_MINOR, 0.0) / 2.0; |
843 } | 843 } |
844 | 844 |
845 float GetTouchAngle(const base::NativeEvent& native_event) { | 845 float GetTouchAngle(const base::NativeEvent& native_event) { |
846 return GetTouchParamFromXEvent(native_event, | 846 return GetTouchParamFromXEvent(native_event, |
847 ui::TouchFactory::TP_ORIENTATION, 0.0) / 2.0; | 847 ui::TouchFactory::TP_ORIENTATION, 0.0) / 2.0; |
848 } | 848 } |
849 | 849 |
850 float GetTouchForce(const base::NativeEvent& native_event) { | 850 float GetTouchForce(const base::NativeEvent& native_event) { |
851 float force = 0.0; | 851 float force = 0.0; |
852 force = GetTouchParamFromXEvent(native_event, ui::TouchFactory::TP_PRESSURE, | 852 force = GetTouchParamFromXEvent(native_event, ui::TouchFactory::TP_PRESSURE, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 noop->xclient.format = 8; | 909 noop->xclient.format = 8; |
910 DCHECK(!noop->xclient.display); | 910 DCHECK(!noop->xclient.display); |
911 } | 911 } |
912 // Make sure we use atom from current xdisplay, which may | 912 // Make sure we use atom from current xdisplay, which may |
913 // change during the test. | 913 // change during the test. |
914 noop->xclient.message_type = GetNoopEventAtom(); | 914 noop->xclient.message_type = GetNoopEventAtom(); |
915 return noop; | 915 return noop; |
916 } | 916 } |
917 | 917 |
918 } // namespace ui | 918 } // namespace ui |
OLD | NEW |