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 780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
791 ui::DeviceDataManagerX11::DT_TOUCH_MINOR, 0.0) / 2.0; | 791 ui::DeviceDataManagerX11::DT_TOUCH_MINOR, 0.0) / 2.0; |
792 ScaleTouchRadius(native_event, &radius); | 792 ScaleTouchRadius(native_event, &radius); |
793 return radius; | 793 return radius; |
794 } | 794 } |
795 | 795 |
796 float GetTouchAngle(const base::NativeEvent& native_event) { | 796 float GetTouchAngle(const base::NativeEvent& native_event) { |
797 return GetTouchParamFromXEvent(native_event, | 797 return GetTouchParamFromXEvent(native_event, |
798 ui::DeviceDataManagerX11::DT_TOUCH_ORIENTATION, 0.0) / 2.0; | 798 ui::DeviceDataManagerX11::DT_TOUCH_ORIENTATION, 0.0) / 2.0; |
799 } | 799 } |
800 | 800 |
| 801 float GetTouchTilt(const base::NativeEvent& native_event) { |
| 802 NOTIMPLEMENTED(); |
| 803 return 0.0f; |
| 804 } |
| 805 |
| 806 float GetTouchTiltDirection(const base::NativeEvent& native_event) { |
| 807 NOTIMPLEMENTED(); |
| 808 return 0.0f; |
| 809 } |
| 810 |
801 float GetTouchForce(const base::NativeEvent& native_event) { | 811 float GetTouchForce(const base::NativeEvent& native_event) { |
802 double force = 0.0; | 812 double force = 0.0; |
803 force = GetTouchParamFromXEvent(native_event, | 813 force = GetTouchParamFromXEvent(native_event, |
804 ui::DeviceDataManagerX11::DT_TOUCH_PRESSURE, 0.0); | 814 ui::DeviceDataManagerX11::DT_TOUCH_PRESSURE, 0.0); |
805 unsigned int deviceid = | 815 unsigned int deviceid = |
806 static_cast<XIDeviceEvent*>(native_event->xcookie.data)->sourceid; | 816 static_cast<XIDeviceEvent*>(native_event->xcookie.data)->sourceid; |
807 // Force is normalized to fall into [0, 1] | 817 // Force is normalized to fall into [0, 1] |
808 if (!ui::DeviceDataManagerX11::GetInstance()->NormalizeData( | 818 if (!ui::DeviceDataManagerX11::GetInstance()->NormalizeData( |
809 deviceid, ui::DeviceDataManagerX11::DT_TOUCH_PRESSURE, &force)) | 819 deviceid, ui::DeviceDataManagerX11::DT_TOUCH_PRESSURE, &force)) |
810 force = 0.0; | 820 force = 0.0; |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 xievent->detail = | 924 xievent->detail = |
915 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); | 925 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); |
916 break; | 926 break; |
917 } | 927 } |
918 default: | 928 default: |
919 break; | 929 break; |
920 } | 930 } |
921 } | 931 } |
922 | 932 |
923 } // namespace ui | 933 } // namespace ui |
OLD | NEW |