| 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/events/event_constants.h" | 5 #include "ui/events/event_constants.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.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 <X11/XKBlib.h> | 10 #include <X11/XKBlib.h> |
| (...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 ui::DeviceDataManagerX11::DT_TOUCH_MINOR, 0.0) / 2.0; | 785 ui::DeviceDataManagerX11::DT_TOUCH_MINOR, 0.0) / 2.0; |
| 786 ScaleTouchRadius(native_event, &radius); | 786 ScaleTouchRadius(native_event, &radius); |
| 787 return radius; | 787 return radius; |
| 788 } | 788 } |
| 789 | 789 |
| 790 float GetTouchAngle(const base::NativeEvent& native_event) { | 790 float GetTouchAngle(const base::NativeEvent& native_event) { |
| 791 return GetTouchParamFromXEvent(native_event, | 791 return GetTouchParamFromXEvent(native_event, |
| 792 ui::DeviceDataManagerX11::DT_TOUCH_ORIENTATION, 0.0) / 2.0; | 792 ui::DeviceDataManagerX11::DT_TOUCH_ORIENTATION, 0.0) / 2.0; |
| 793 } | 793 } |
| 794 | 794 |
| 795 float GetTouchTilt(const base::NativeEvent& native_event) { |
| 796 NOTIMPLEMENTED(); |
| 797 return 0.0f; |
| 798 } |
| 799 |
| 800 float GetTouchTiltDirection(const base::NativeEvent& native_event) { |
| 801 NOTIMPLEMENTED(); |
| 802 return 0.0f; |
| 803 } |
| 804 |
| 795 float GetTouchForce(const base::NativeEvent& native_event) { | 805 float GetTouchForce(const base::NativeEvent& native_event) { |
| 796 double force = 0.0; | 806 double force = 0.0; |
| 797 force = GetTouchParamFromXEvent(native_event, | 807 force = GetTouchParamFromXEvent(native_event, |
| 798 ui::DeviceDataManagerX11::DT_TOUCH_PRESSURE, 0.0); | 808 ui::DeviceDataManagerX11::DT_TOUCH_PRESSURE, 0.0); |
| 799 unsigned int deviceid = | 809 unsigned int deviceid = |
| 800 static_cast<XIDeviceEvent*>(native_event->xcookie.data)->sourceid; | 810 static_cast<XIDeviceEvent*>(native_event->xcookie.data)->sourceid; |
| 801 // Force is normalized to fall into [0, 1] | 811 // Force is normalized to fall into [0, 1] |
| 802 if (!ui::DeviceDataManagerX11::GetInstance()->NormalizeData( | 812 if (!ui::DeviceDataManagerX11::GetInstance()->NormalizeData( |
| 803 deviceid, ui::DeviceDataManagerX11::DT_TOUCH_PRESSURE, &force)) | 813 deviceid, ui::DeviceDataManagerX11::DT_TOUCH_PRESSURE, &force)) |
| 804 force = 0.0; | 814 force = 0.0; |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 xievent->detail = | 918 xievent->detail = |
| 909 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); | 919 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); |
| 910 break; | 920 break; |
| 911 } | 921 } |
| 912 default: | 922 default: |
| 913 break; | 923 break; |
| 914 } | 924 } |
| 915 } | 925 } |
| 916 | 926 |
| 917 } // namespace ui | 927 } // namespace ui |
| OLD | NEW |