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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 { | 239 { |
240 return TouchTypeFirst <= type && type <= TouchTypeLast; | 240 return TouchTypeFirst <= type && type <= TouchTypeLast; |
241 } | 241 } |
242 | 242 |
243 // Returns true if the WebInputEvent is a gesture event. | 243 // Returns true if the WebInputEvent is a gesture event. |
244 static bool isGestureEventType(int type) | 244 static bool isGestureEventType(int type) |
245 { | 245 { |
246 return GestureTypeFirst <= type && type <= GestureTypeLast; | 246 return GestureTypeFirst <= type && type <= GestureTypeLast; |
247 } | 247 } |
248 | 248 |
| 249 bool isSameEventClass(const WebInputEvent& other) const |
| 250 { |
| 251 if (isMouseEventType(type)) |
| 252 return isMouseEventType(other.type); |
| 253 if (isGestureEventType(type)) |
| 254 return isGestureEventType(other.type); |
| 255 if (isTouchEventType(type)) |
| 256 return isTouchEventType(other.type); |
| 257 if (isKeyboardEventType(type)) |
| 258 return isKeyboardEventType(other.type); |
| 259 return type == other.type; |
| 260 } |
| 261 |
249 protected: | 262 protected: |
250 explicit WebInputEvent(unsigned sizeParam) | 263 explicit WebInputEvent(unsigned sizeParam) |
251 { | 264 { |
252 memset(this, 0, sizeParam); | 265 memset(this, 0, sizeParam); |
253 timeStampSeconds = 0.0; | 266 timeStampSeconds = 0.0; |
254 size = sizeParam; | 267 size = sizeParam; |
255 type = Undefined; | 268 type = Undefined; |
256 modifiers = 0; | 269 modifiers = 0; |
257 } | 270 } |
258 }; | 271 }; |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 , uniqueTouchEventId(0) | 656 , uniqueTouchEventId(0) |
644 { | 657 { |
645 } | 658 } |
646 }; | 659 }; |
647 | 660 |
648 #pragma pack(pop) | 661 #pragma pack(pop) |
649 | 662 |
650 } // namespace blink | 663 } // namespace blink |
651 | 664 |
652 #endif | 665 #endif |
OLD | NEW |