| 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_BASE_EVENTS_EVENT_H_ | 5 #ifndef UI_BASE_EVENTS_EVENT_H_ |
| 6 #define UI_BASE_EVENTS_EVENT_H_ | 6 #define UI_BASE_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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 262 } |
| 263 gfx::Point root_location() const { return root_location_; } | 263 gfx::Point root_location() const { return root_location_; } |
| 264 | 264 |
| 265 bool valid_system_location() const { return valid_system_location_; } | 265 bool valid_system_location() const { return valid_system_location_; } |
| 266 void set_system_location(const gfx::Point& loc) { | 266 void set_system_location(const gfx::Point& loc) { |
| 267 valid_system_location_ = true; | 267 valid_system_location_ = true; |
| 268 system_location_ = loc; | 268 system_location_ = loc; |
| 269 } | 269 } |
| 270 const gfx::Point& system_location() const { return system_location_; } | 270 const gfx::Point& system_location() const { return system_location_; } |
| 271 | 271 |
| 272 // Applies |root_transform| to the event. | 272 // Transform the locations using |inverted_root_transform|. |
| 273 // This is applied to both |location_| and |root_location_|. | 273 // This is applied to both |location_| and |root_location_|. |
| 274 virtual void UpdateForRootTransform(const gfx::Transform& root_transform); | 274 virtual void UpdateForRootTransform( |
| 275 const gfx::Transform& inverted_root_transform); |
| 275 | 276 |
| 276 template <class T> void ConvertLocationToTarget(T* source, T* target) { | 277 template <class T> void ConvertLocationToTarget(T* source, T* target) { |
| 277 if (target && target != source) | 278 if (target && target != source) |
| 278 T::ConvertPointToTarget(source, target, &location_); | 279 T::ConvertPointToTarget(source, target, &location_); |
| 279 } | 280 } |
| 280 | 281 |
| 281 protected: | 282 protected: |
| 282 explicit LocatedEvent(const base::NativeEvent& native_event); | 283 explicit LocatedEvent(const base::NativeEvent& native_event); |
| 283 | 284 |
| 284 // Create a new LocatedEvent which is identical to the provided model. | 285 // Create a new LocatedEvent which is identical to the provided model. |
| (...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 // This value is stored as a bitfield because the number of touch ids varies, | 710 // This value is stored as a bitfield because the number of touch ids varies, |
| 710 // but we currently don't need more than 32 touches at a time. | 711 // but we currently don't need more than 32 touches at a time. |
| 711 const unsigned int touch_ids_bitfield_; | 712 const unsigned int touch_ids_bitfield_; |
| 712 | 713 |
| 713 DISALLOW_COPY_AND_ASSIGN(GestureEvent); | 714 DISALLOW_COPY_AND_ASSIGN(GestureEvent); |
| 714 }; | 715 }; |
| 715 | 716 |
| 716 } // namespace ui | 717 } // namespace ui |
| 717 | 718 |
| 718 #endif // UI_BASE_EVENTS_EVENT_H_ | 719 #endif // UI_BASE_EVENTS_EVENT_H_ |
| OLD | NEW |