OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 IsComposing = 1 << 14, | 182 IsComposing = 1 << 14, |
183 | 183 |
184 AltGrKey = 1 << 15, | 184 AltGrKey = 1 << 15, |
185 OSKey = 1 << 16, | 185 OSKey = 1 << 16, |
186 FnKey = 1 << 17, | 186 FnKey = 1 << 17, |
187 SymbolKey = 1 << 18, | 187 SymbolKey = 1 << 18, |
188 | 188 |
189 ScrollLockOn = 1 << 19, | 189 ScrollLockOn = 1 << 19, |
190 }; | 190 }; |
191 | 191 |
192 // These values are direct mappings of the values in PlatformEvent | |
Rick Byers
2016/04/20 15:30:26
nit: add a comment above this describing briefly t
dtapuska
2016/04/20 19:38:11
Done.
| |
193 // so the values can be cast between the enumerations. static_asserts | |
194 // checking this are in web/WebInputEventConversion.cpp. | |
195 enum DispatchType { | |
196 Blocking, | |
Rick Byers
2016/04/20 15:30:26
nit: add comment saying "i.e. can be canceled"
dtapuska
2016/04/20 19:38:12
Done.
| |
197 EventNonBlocking, | |
198 // All listeners are passive. | |
199 ListenersNonBlockingPassive, | |
200 // This value represents a state which would have normally blocking | |
201 // but was forced to be non-blocking. | |
202 ListenersForcedNonBlockingPassive, | |
203 }; | |
204 | |
192 // The rail mode for a wheel event specifies the axis on which scrolling is | 205 // The rail mode for a wheel event specifies the axis on which scrolling is |
193 // expected to stick. If this axis is set to Free, then scrolling is not | 206 // expected to stick. If this axis is set to Free, then scrolling is not |
194 // stuck to any axis. | 207 // stuck to any axis. |
195 enum RailsMode { | 208 enum RailsMode { |
196 RailsModeFree = 0, | 209 RailsModeFree = 0, |
197 RailsModeHorizontal = 1, | 210 RailsModeHorizontal = 1, |
198 RailsModeVertical = 2, | 211 RailsModeVertical = 2, |
199 }; | 212 }; |
200 | 213 |
201 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; | 214 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
595 class WebTouchEvent : public WebInputEvent { | 608 class WebTouchEvent : public WebInputEvent { |
596 public: | 609 public: |
597 // Maximum number of simultaneous touches supported on | 610 // Maximum number of simultaneous touches supported on |
598 // Ash/Aura. | 611 // Ash/Aura. |
599 enum { touchesLengthCap = 16 }; | 612 enum { touchesLengthCap = 16 }; |
600 | 613 |
601 unsigned touchesLength; | 614 unsigned touchesLength; |
602 // List of all touches, regardless of state. | 615 // List of all touches, regardless of state. |
603 WebTouchPoint touches[touchesLengthCap]; | 616 WebTouchPoint touches[touchesLengthCap]; |
604 | 617 |
605 // Whether the event can be canceled (with preventDefault). If true then the browser | 618 // Whether the event is blocking, non-blocking, all event |
606 // must wait for an ACK for this event. If false then no ACK IPC is expected . | 619 // listeners were passive or was forced to be non-blocking. |
607 bool cancelable; | 620 DispatchType dispatchType; |
608 | 621 |
609 // For a single touch, this is true after the touch-point has moved beyond | 622 // For a single touch, this is true after the touch-point has moved beyond |
610 // the platform slop region. For a multitouch, this is true after any | 623 // the platform slop region. For a multitouch, this is true after any |
611 // touch-point has moved (by whatever amount). | 624 // touch-point has moved (by whatever amount). |
612 bool movedBeyondSlopRegion; | 625 bool movedBeyondSlopRegion; |
613 | 626 |
614 // A unique identifier for the touch event. | 627 // A unique identifier for the touch event. |
615 uint32_t uniqueTouchEventId; | 628 uint32_t uniqueTouchEventId; |
616 | 629 |
617 WebTouchEvent() | 630 WebTouchEvent() |
618 : WebInputEvent(sizeof(WebTouchEvent)) | 631 : WebInputEvent(sizeof(WebTouchEvent)) |
619 , touchesLength(0) | 632 , touchesLength(0) |
620 , cancelable(true) | 633 , dispatchType(Blocking) |
621 , movedBeyondSlopRegion(false) | 634 , movedBeyondSlopRegion(false) |
622 , uniqueTouchEventId(0) | 635 , uniqueTouchEventId(0) |
623 { | 636 { |
624 } | 637 } |
625 }; | 638 }; |
626 | 639 |
627 #pragma pack(pop) | 640 #pragma pack(pop) |
628 | 641 |
629 } // namespace blink | 642 } // namespace blink |
630 | 643 |
631 #endif | 644 #endif |
OLD | NEW |