Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Side by Side Diff: ui/events/event.h

Issue 1294523004: ozone: Handle pressure and tilt for stylus devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new-pe-details
Patch Set: Use PointerDetails directly Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/events/ozone/evdev/device_event_dispatcher_evdev.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 void set_pointer_type(EventPointerType type) { 467 void set_pointer_type(EventPointerType type) {
468 pointer_details_.pointer_type_ = type; 468 pointer_details_.pointer_type_ = type;
469 } 469 }
470 470
471 // Update properties for stylus devices exposed through the Pointer Events 471 // Update properties for stylus devices exposed through the Pointer Events
472 // spec. 472 // spec.
473 void set_force(const float f) { pointer_details_.force_ = f; } 473 void set_force(const float f) { pointer_details_.force_ = f; }
474 void set_tilt_x(const float t) { pointer_details_.tilt_x_ = t; } 474 void set_tilt_x(const float t) { pointer_details_.tilt_x_ = t; }
475 void set_tilt_y(const float t) { pointer_details_.tilt_y_ = t; } 475 void set_tilt_y(const float t) { pointer_details_.tilt_y_ = t; }
476 void set_radius_x(const float r) { pointer_details_.radius_x_ = r; } 476 void set_radius_x(const float r) { pointer_details_.radius_x_ = r; }
477 void set_radius_y(const float r) { pointer_details_.radius_y_ = r; } 477 void set_radius_y(const float r) { pointer_details_.radius_y_ = r; }
sadrul 2015/08/21 19:32:22 These can now go?
478 478
479 // Event details common to MouseEvent and TouchEvent. 479 // Event details common to MouseEvent and TouchEvent.
480 const PointerDetails& pointer_details() { return pointer_details_; } 480 const PointerDetails& pointer_details() { return pointer_details_; }
481 void set_pointer_details(const PointerDetails& details) {
482 pointer_details_ = details;
483 }
481 484
482 private: 485 private:
483 FRIEND_TEST_ALL_PREFIXES(EventTest, DoubleClickRequiresRelease); 486 FRIEND_TEST_ALL_PREFIXES(EventTest, DoubleClickRequiresRelease);
484 FRIEND_TEST_ALL_PREFIXES(EventTest, SingleClickRightLeft); 487 FRIEND_TEST_ALL_PREFIXES(EventTest, SingleClickRightLeft);
485 488
486 // Returns the flags for the mouse buttons. 489 // Returns the flags for the mouse buttons.
487 int button_flags() const { 490 int button_flags() const {
488 return flags() & (EF_LEFT_MOUSE_BUTTON | EF_MIDDLE_MOUSE_BUTTON | 491 return flags() & (EF_LEFT_MOUSE_BUTTON | EF_MIDDLE_MOUSE_BUTTON |
489 EF_RIGHT_MOUSE_BUTTON | EF_BACK_MOUSE_BUTTON | 492 EF_RIGHT_MOUSE_BUTTON | EF_BACK_MOUSE_BUTTON |
490 EF_FORWARD_MOUSE_BUTTON); 493 EF_FORWARD_MOUSE_BUTTON);
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 946
944 const GestureEventDetails& details() const { return details_; } 947 const GestureEventDetails& details() const { return details_; }
945 948
946 private: 949 private:
947 GestureEventDetails details_; 950 GestureEventDetails details_;
948 }; 951 };
949 952
950 } // namespace ui 953 } // namespace ui
951 954
952 #endif // UI_EVENTS_EVENT_H_ 955 #endif // UI_EVENTS_EVENT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/ozone/evdev/device_event_dispatcher_evdev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698