OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 24 matching lines...) Expand all Loading... |
35 class PlatformEvent { | 35 class PlatformEvent { |
36 public: | 36 public: |
37 enum EventType { | 37 enum EventType { |
38 NoType = 0, | 38 NoType = 0, |
39 | 39 |
40 // PlatformMouseEvent | 40 // PlatformMouseEvent |
41 MouseMoved, | 41 MouseMoved, |
42 MousePressed, | 42 MousePressed, |
43 MouseReleased, | 43 MouseReleased, |
44 MouseScroll, | 44 MouseScroll, |
45 | |
46 // PlatformTouchEvent | |
47 TouchStart, | |
48 TouchMove, | |
49 TouchEnd, | |
50 TouchCancel, | |
51 TouchScrollStarted, | |
52 }; | 45 }; |
53 | 46 |
54 // These values are direct mappings of the values in WebInputEvent so the | 47 // These values are direct mappings of the values in WebInputEvent so the |
55 // values can be cast between the enumerations. static_asserts checking this | 48 // values can be cast between the enumerations. static_asserts checking this |
56 // are in web/WebInputEventConversion.cpp. | 49 // are in web/WebInputEventConversion.cpp. |
57 enum Modifiers { | 50 enum Modifiers { |
58 NoModifiers = 0, | 51 NoModifiers = 0, |
59 ShiftKey = 1 << 0, | 52 ShiftKey = 1 << 0, |
60 CtrlKey = 1 << 1, | 53 CtrlKey = 1 << 1, |
61 AltKey = 1 << 2, | 54 AltKey = 1 << 2, |
(...skipping 22 matching lines...) Expand all Loading... |
84 | 77 |
85 // The set of non-stateful modifiers that specifically change the | 78 // The set of non-stateful modifiers that specifically change the |
86 // interpretation of the key being pressed. For example; IsLeft, | 79 // interpretation of the key being pressed. For example; IsLeft, |
87 // IsRight, IsComposing don't change the meaning of the key | 80 // IsRight, IsComposing don't change the meaning of the key |
88 // being pressed. NumLockOn, ScrollLockOn, CapsLockOn are stateful | 81 // being pressed. NumLockOn, ScrollLockOn, CapsLockOn are stateful |
89 // and don't indicate explicit depressed state. | 82 // and don't indicate explicit depressed state. |
90 KeyModifiers = | 83 KeyModifiers = |
91 SymbolKey | FnKey | AltGrKey | MetaKey | AltKey | CtrlKey | ShiftKey, | 84 SymbolKey | FnKey | AltGrKey | MetaKey | AltKey | CtrlKey | ShiftKey, |
92 }; | 85 }; |
93 | 86 |
94 enum RailsMode { | |
95 RailsModeFree = 0, | |
96 RailsModeHorizontal = 1, | |
97 RailsModeVertical = 2, | |
98 }; | |
99 | |
100 // These values are direct mappings of the values in WebInputEvent | |
101 // so the values can be cast between the enumerations. static_asserts | |
102 // checking this are in web/WebInputEventConversion.cpp. | |
103 enum DispatchType { | |
104 Blocking, | |
105 EventNonBlocking, | |
106 // All listeners are passive. | |
107 ListenersNonBlockingPassive, | |
108 // This value represents a state which would have normally blocking | |
109 // but was forced to be non-blocking during fling; not cancelable. | |
110 ListenersForcedNonBlockingDueToFling, | |
111 }; | |
112 | 87 |
113 EventType type() const { return static_cast<EventType>(m_type); } | 88 EventType type() const { return static_cast<EventType>(m_type); } |
114 | 89 |
115 bool shiftKey() const { return m_modifiers & ShiftKey; } | 90 bool shiftKey() const { return m_modifiers & ShiftKey; } |
116 bool ctrlKey() const { return m_modifiers & CtrlKey; } | 91 bool ctrlKey() const { return m_modifiers & CtrlKey; } |
117 bool altKey() const { return m_modifiers & AltKey; } | 92 bool altKey() const { return m_modifiers & AltKey; } |
118 bool metaKey() const { return m_modifiers & MetaKey; } | 93 bool metaKey() const { return m_modifiers & MetaKey; } |
119 | 94 |
120 Modifiers getModifiers() const { return static_cast<Modifiers>(m_modifiers); } | 95 Modifiers getModifiers() const { return static_cast<Modifiers>(m_modifiers); } |
121 | 96 |
(...skipping 12 matching lines...) Expand all Loading... |
134 ~PlatformEvent() {} | 109 ~PlatformEvent() {} |
135 | 110 |
136 unsigned m_type; | 111 unsigned m_type; |
137 unsigned m_modifiers; | 112 unsigned m_modifiers; |
138 TimeTicks m_timestamp; | 113 TimeTicks m_timestamp; |
139 }; | 114 }; |
140 | 115 |
141 } // namespace blink | 116 } // namespace blink |
142 | 117 |
143 #endif // PlatformEvent_h | 118 #endif // PlatformEvent_h |
OLD | NEW |