| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 // WebKeyboardEvent | 107 // WebKeyboardEvent |
| 108 RawKeyDown, | 108 RawKeyDown, |
| 109 KeyboardTypeFirst = RawKeyDown, | 109 KeyboardTypeFirst = RawKeyDown, |
| 110 KeyDown, | 110 KeyDown, |
| 111 KeyUp, | 111 KeyUp, |
| 112 Char, | 112 Char, |
| 113 KeyboardTypeLast = Char, | 113 KeyboardTypeLast = Char, |
| 114 | 114 |
| 115 // WebGestureEvent | 115 // WebGestureEvent |
| 116 // Note: Gesture scroll events (ScrollBegin ... FlingCancel) must be |
| 117 // kept sequential for isGestureScrollEventType() to work. |
| 116 GestureScrollBegin, | 118 GestureScrollBegin, |
| 117 GestureTypeFirst = GestureScrollBegin, | 119 GestureTypeFirst = GestureScrollBegin, |
| 118 GestureScrollEnd, | 120 GestureScrollEnd, |
| 119 GestureScrollUpdate, | 121 GestureScrollUpdate, |
| 120 GestureFlingStart, | 122 GestureFlingStart, |
| 121 GestureFlingCancel, | 123 GestureFlingCancel, |
| 122 GestureShowPress, | 124 GestureShowPress, |
| 123 GestureTap, | 125 GestureTap, |
| 124 GestureTapUnconfirmed, | 126 GestureTapUnconfirmed, |
| 125 GestureTapDown, | 127 GestureTapDown, |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 { | 224 { |
| 223 return TouchTypeFirst <= type && type <= TouchTypeLast; | 225 return TouchTypeFirst <= type && type <= TouchTypeLast; |
| 224 } | 226 } |
| 225 | 227 |
| 226 // Returns true if the WebInputEvent is a gesture event. | 228 // Returns true if the WebInputEvent is a gesture event. |
| 227 static bool isGestureEventType(int type) | 229 static bool isGestureEventType(int type) |
| 228 { | 230 { |
| 229 return GestureTypeFirst <= type && type <= GestureTypeLast; | 231 return GestureTypeFirst <= type && type <= GestureTypeLast; |
| 230 } | 232 } |
| 231 | 233 |
| 234 // Returns true if the WebInputEvent is a gesture scroll event. |
| 235 static bool isGestureScrollEventType(int type) |
| 236 { |
| 237 return GestureScrollBegin <= type && type <= GestureFlingCancel; |
| 238 } |
| 239 |
| 232 protected: | 240 protected: |
| 233 explicit WebInputEvent(unsigned sizeParam) | 241 explicit WebInputEvent(unsigned sizeParam) |
| 234 { | 242 { |
| 235 memset(this, 0, sizeParam); | 243 memset(this, 0, sizeParam); |
| 236 timeStampSeconds = 0.0; | 244 timeStampSeconds = 0.0; |
| 237 size = sizeParam; | 245 size = sizeParam; |
| 238 type = Undefined; | 246 type = Undefined; |
| 239 modifiers = 0; | 247 modifiers = 0; |
| 240 } | 248 } |
| 241 }; | 249 }; |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 float scale; | 547 float scale; |
| 540 } pinchUpdate; | 548 } pinchUpdate; |
| 541 } data; | 549 } data; |
| 542 | 550 |
| 543 WebGestureEvent() | 551 WebGestureEvent() |
| 544 : WebInputEvent(sizeof(WebGestureEvent)) | 552 : WebInputEvent(sizeof(WebGestureEvent)) |
| 545 , x(0) | 553 , x(0) |
| 546 , y(0) | 554 , y(0) |
| 547 , globalX(0) | 555 , globalX(0) |
| 548 , globalY(0) | 556 , globalY(0) |
| 557 , sourceDevice(WebGestureDeviceUninitialized) |
| 549 , resendingPluginId(-1) | 558 , resendingPluginId(-1) |
| 550 { | 559 { |
| 551 memset(&data, 0, sizeof(data)); | 560 memset(&data, 0, sizeof(data)); |
| 552 } | 561 } |
| 553 }; | 562 }; |
| 554 | 563 |
| 555 // WebTouchEvent -------------------------------------------------------------- | 564 // WebTouchEvent -------------------------------------------------------------- |
| 556 | 565 |
| 557 // TODO(e_hakkinen): Replace with WebPointerEvent. crbug.com/508283 | 566 // TODO(e_hakkinen): Replace with WebPointerEvent. crbug.com/508283 |
| 558 class WebTouchEvent : public WebInputEvent { | 567 class WebTouchEvent : public WebInputEvent { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 587 , uniqueTouchEventId(0) | 596 , uniqueTouchEventId(0) |
| 588 { | 597 { |
| 589 } | 598 } |
| 590 }; | 599 }; |
| 591 | 600 |
| 592 #pragma pack(pop) | 601 #pragma pack(pop) |
| 593 | 602 |
| 594 } // namespace blink | 603 } // namespace blink |
| 595 | 604 |
| 596 #endif | 605 #endif |
| OLD | NEW |