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.h" | 5 #include "ui/events/event.h" |
6 | 6 |
7 #if defined(USE_X11) | 7 #if defined(USE_X11) |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #include <X11/keysym.h> | 10 #include <X11/keysym.h> |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 : MouseEvent(type, location, location, flags, 0), | 943 : MouseEvent(type, location, location, flags, 0), |
944 x_offset_(x_offset), | 944 x_offset_(x_offset), |
945 y_offset_(y_offset), | 945 y_offset_(y_offset), |
946 x_offset_ordinal_(x_offset_ordinal), | 946 x_offset_ordinal_(x_offset_ordinal), |
947 y_offset_ordinal_(y_offset_ordinal), | 947 y_offset_ordinal_(y_offset_ordinal), |
948 finger_count_(finger_count) { | 948 finger_count_(finger_count) { |
949 set_time_stamp(time_stamp); | 949 set_time_stamp(time_stamp); |
950 CHECK(IsScrollEvent()); | 950 CHECK(IsScrollEvent()); |
951 } | 951 } |
952 | 952 |
| 953 ScrollEvent::ScrollEvent(EventType type, |
| 954 const gfx::PointF& location, |
| 955 const gfx::PointF& root_location, |
| 956 base::TimeDelta time_stamp, |
| 957 int flags, |
| 958 float x_offset, |
| 959 float y_offset, |
| 960 float x_offset_ordinal, |
| 961 float y_offset_ordinal, |
| 962 int finger_count) |
| 963 : MouseEvent(type, location, root_location, flags, 0), |
| 964 x_offset_(x_offset), |
| 965 y_offset_(y_offset), |
| 966 x_offset_ordinal_(x_offset_ordinal), |
| 967 y_offset_ordinal_(y_offset_ordinal), |
| 968 finger_count_(finger_count) { |
| 969 set_time_stamp(time_stamp); |
| 970 CHECK(IsScrollEvent()); |
| 971 } |
| 972 |
953 void ScrollEvent::Scale(const float factor) { | 973 void ScrollEvent::Scale(const float factor) { |
954 x_offset_ *= factor; | 974 x_offset_ *= factor; |
955 y_offset_ *= factor; | 975 y_offset_ *= factor; |
956 x_offset_ordinal_ *= factor; | 976 x_offset_ordinal_ *= factor; |
957 y_offset_ordinal_ *= factor; | 977 y_offset_ordinal_ *= factor; |
958 } | 978 } |
959 | 979 |
960 //////////////////////////////////////////////////////////////////////////////// | 980 //////////////////////////////////////////////////////////////////////////////// |
961 // GestureEvent | 981 // GestureEvent |
962 | 982 |
963 GestureEvent::GestureEvent(float x, | 983 GestureEvent::GestureEvent(float x, |
964 float y, | 984 float y, |
965 int flags, | 985 int flags, |
966 base::TimeDelta time_stamp, | 986 base::TimeDelta time_stamp, |
967 const GestureEventDetails& details) | 987 const GestureEventDetails& details) |
968 : LocatedEvent(details.type(), | 988 : LocatedEvent(details.type(), |
969 gfx::PointF(x, y), | 989 gfx::PointF(x, y), |
970 gfx::PointF(x, y), | 990 gfx::PointF(x, y), |
971 time_stamp, | 991 time_stamp, |
972 flags | EF_FROM_TOUCH), | 992 flags | EF_FROM_TOUCH), |
973 details_(details) { | 993 details_(details) { |
974 } | 994 } |
975 | 995 |
976 GestureEvent::~GestureEvent() { | 996 GestureEvent::~GestureEvent() { |
977 } | 997 } |
978 | 998 |
979 } // namespace ui | 999 } // namespace ui |
OLD | NEW |