| 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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // flag is set, the sender guarantees that no more input events will be | 153 // flag is set, the sender guarantees that no more input events will be |
| 154 // delivered until the next vsync and the receiver can schedule | 154 // delivered until the next vsync and the receiver can schedule |
| 155 // rendering accordingly. If it isn't set, the receiver should not make | 155 // rendering accordingly. If it isn't set, the receiver should not make |
| 156 // any assumptions about the delivery times of future input events | 156 // any assumptions about the delivery times of future input events |
| 157 // w.r.t. vsync. | 157 // w.r.t. vsync. |
| 158 IsLastInputEventForCurrentVSync = 1 << 13, | 158 IsLastInputEventForCurrentVSync = 1 << 13, |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; | 161 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; |
| 162 | 162 |
| 163 double timeStampSeconds; // Seconds since epoch. | 163 double timeStampMS; // Milliseconds since epoch. |
| 164 unsigned size; // The size of this structure, for serialization. | 164 unsigned size; // The size of this structure, for serialization. |
| 165 Type type; | 165 Type type; |
| 166 int modifiers; | 166 int modifiers; |
| 167 | 167 |
| 168 static bool isPointerEventType(int type) | 168 static bool isPointerEventType(int type) |
| 169 { | 169 { |
| 170 return PointerTypeFirst <= type && type <= PointerTypeLast; | 170 return PointerTypeFirst <= type && type <= PointerTypeLast; |
| 171 } | 171 } |
| 172 | 172 |
| 173 // Returns true if the WebInputEvent |type| is a keyboard event. | 173 // Returns true if the WebInputEvent |type| is a keyboard event. |
| 174 static bool isKeyboardEventType(int type) | 174 static bool isKeyboardEventType(int type) |
| 175 { | 175 { |
| 176 return KeyboardTypeFirst <= type && type <= KeyboardTypeLast; | 176 return KeyboardTypeFirst <= type && type <= KeyboardTypeLast; |
| 177 } | 177 } |
| 178 | 178 |
| 179 // Returns true if the WebInputEvent is a gesture event. | 179 // Returns true if the WebInputEvent is a gesture event. |
| 180 static bool isGestureEventType(int type) | 180 static bool isGestureEventType(int type) |
| 181 { | 181 { |
| 182 return GestureTypeFirst <= type && type <= GestureTypeLast; | 182 return GestureTypeFirst <= type && type <= GestureTypeLast; |
| 183 } | 183 } |
| 184 | 184 |
| 185 protected: | 185 protected: |
| 186 explicit WebInputEvent(unsigned sizeParam) | 186 explicit WebInputEvent(unsigned sizeParam) |
| 187 { | 187 { |
| 188 memset(this, 0, sizeParam); | 188 memset(this, 0, sizeParam); |
| 189 timeStampSeconds = 0.0; | 189 timeStampMS = 0.0; |
| 190 size = sizeParam; | 190 size = sizeParam; |
| 191 type = Undefined; | 191 type = Undefined; |
| 192 modifiers = 0; | 192 modifiers = 0; |
| 193 } | 193 } |
| 194 }; | 194 }; |
| 195 | 195 |
| 196 // WebPointerEvent ------------------------------------------------------------ | 196 // WebPointerEvent ------------------------------------------------------------ |
| 197 | 197 |
| 198 class WebPointerEvent : public WebInputEvent { | 198 class WebPointerEvent : public WebInputEvent { |
| 199 public: | 199 public: |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 { | 327 { |
| 328 memset(&data, 0, sizeof(data)); | 328 memset(&data, 0, sizeof(data)); |
| 329 } | 329 } |
| 330 }; | 330 }; |
| 331 | 331 |
| 332 #pragma pack(pop) | 332 #pragma pack(pop) |
| 333 | 333 |
| 334 } // namespace blink | 334 } // namespace blink |
| 335 | 335 |
| 336 #endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBINPUTEVENT_H_ | 336 #endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBINPUTEVENT_H_ |
| OLD | NEW |