| 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 #ifndef UI_EVENTS_EVENT_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
| 6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_EVENTS_EVENT_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 // TODO(tdresser): Always return floating point location. See | 248 // TODO(tdresser): Always return floating point location. See |
| 249 // crbug.com/337824. | 249 // crbug.com/337824. |
| 250 gfx::Point location() const { return gfx::ToFlooredPoint(location_); } | 250 gfx::Point location() const { return gfx::ToFlooredPoint(location_); } |
| 251 gfx::PointF location_f() const { return location_; } | 251 gfx::PointF location_f() const { return location_; } |
| 252 void set_root_location(const gfx::PointF& root_location) { | 252 void set_root_location(const gfx::PointF& root_location) { |
| 253 root_location_ = root_location; | 253 root_location_ = root_location; |
| 254 } | 254 } |
| 255 gfx::Point root_location() const { | 255 gfx::Point root_location() const { |
| 256 return gfx::ToFlooredPoint(root_location_); | 256 return gfx::ToFlooredPoint(root_location_); |
| 257 } | 257 } |
| 258 gfx::PointF root_location_f() const { |
| 259 return root_location_; |
| 260 } |
| 258 | 261 |
| 259 // Transform the locations using |inverted_root_transform|. | 262 // Transform the locations using |inverted_root_transform|. |
| 260 // This is applied to both |location_| and |root_location_|. | 263 // This is applied to both |location_| and |root_location_|. |
| 261 virtual void UpdateForRootTransform( | 264 virtual void UpdateForRootTransform( |
| 262 const gfx::Transform& inverted_root_transform); | 265 const gfx::Transform& inverted_root_transform); |
| 263 | 266 |
| 264 template <class T> void ConvertLocationToTarget(T* source, T* target) { | 267 template <class T> void ConvertLocationToTarget(T* source, T* target) { |
| 265 if (!target || target == source) | 268 if (!target || target == source) |
| 266 return; | 269 return; |
| 267 // TODO(tdresser): Rewrite ConvertPointToTarget to use PointF. See | 270 // TODO(tdresser): Rewrite ConvertPointToTarget to use PointF. See |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 // The set of indices of ones in the binary representation of | 673 // The set of indices of ones in the binary representation of |
| 671 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. | 674 // touch_ids_bitfield_ is the set of touch_ids associate with this gesture. |
| 672 // This value is stored as a bitfield because the number of touch ids varies, | 675 // This value is stored as a bitfield because the number of touch ids varies, |
| 673 // but we currently don't need more than 32 touches at a time. | 676 // but we currently don't need more than 32 touches at a time. |
| 674 const unsigned int touch_ids_bitfield_; | 677 const unsigned int touch_ids_bitfield_; |
| 675 }; | 678 }; |
| 676 | 679 |
| 677 } // namespace ui | 680 } // namespace ui |
| 678 | 681 |
| 679 #endif // UI_EVENTS_EVENT_H_ | 682 #endif // UI_EVENTS_EVENT_H_ |
| OLD | NEW |