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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // and don't indicate explicit depressed state. | 115 // and don't indicate explicit depressed state. |
116 KeyModifiers = SymbolKey | FnKey | OSKey | AltGrKey | MetaKey | AltKey |
CtrlKey | ShiftKey, | 116 KeyModifiers = SymbolKey | FnKey | OSKey | AltGrKey | MetaKey | AltKey |
CtrlKey | ShiftKey, |
117 }; | 117 }; |
118 | 118 |
119 enum RailsMode { | 119 enum RailsMode { |
120 RailsModeFree = 0, | 120 RailsModeFree = 0, |
121 RailsModeHorizontal = 1, | 121 RailsModeHorizontal = 1, |
122 RailsModeVertical = 2, | 122 RailsModeVertical = 2, |
123 }; | 123 }; |
124 | 124 |
| 125 // These values are direct mappings of the values in WebInputEvent |
| 126 // so the values can be cast between the enumerations. static_asserts |
| 127 // checking this are in web/WebInputEventConversion.cpp. |
| 128 enum DispatchType { |
| 129 Blocking, |
| 130 EventNonBlocking, |
| 131 // All listeners are passive. |
| 132 ListenersNonBlockingPassive, |
| 133 // This value represents a state which would have normally blocking |
| 134 // but was forced to be non-blocking. |
| 135 ListenersForcedNonBlockingPassive, |
| 136 }; |
| 137 |
125 EventType type() const { return static_cast<EventType>(m_type); } | 138 EventType type() const { return static_cast<EventType>(m_type); } |
126 | 139 |
127 bool shiftKey() const { return m_modifiers & ShiftKey; } | 140 bool shiftKey() const { return m_modifiers & ShiftKey; } |
128 bool ctrlKey() const { return m_modifiers & CtrlKey; } | 141 bool ctrlKey() const { return m_modifiers & CtrlKey; } |
129 bool altKey() const { return m_modifiers & AltKey; } | 142 bool altKey() const { return m_modifiers & AltKey; } |
130 bool metaKey() const { return m_modifiers & MetaKey; } | 143 bool metaKey() const { return m_modifiers & MetaKey; } |
131 | 144 |
132 Modifiers getModifiers() const { return static_cast<Modifiers>(m_modifiers);
} | 145 Modifiers getModifiers() const { return static_cast<Modifiers>(m_modifiers);
} |
133 | 146 |
134 double timestamp() const { return m_timestamp; } | 147 double timestamp() const { return m_timestamp; } |
(...skipping 27 matching lines...) Expand all Loading... |
162 } | 175 } |
163 | 176 |
164 unsigned m_type; | 177 unsigned m_type; |
165 unsigned m_modifiers; | 178 unsigned m_modifiers; |
166 double m_timestamp; | 179 double m_timestamp; |
167 }; | 180 }; |
168 | 181 |
169 } // namespace blink | 182 } // namespace blink |
170 | 183 |
171 #endif // PlatformEvent_h | 184 #endif // PlatformEvent_h |
OLD | NEW |