| 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 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WebInputEvent_h | 31 #ifndef WebInputEvent_h |
| 32 #define WebInputEvent_h | 32 #define WebInputEvent_h |
| 33 | 33 |
| 34 #include "../platform/WebCommon.h" | 34 #include "../platform/WebCommon.h" |
| 35 #include "../platform/WebGestureDevice.h" | 35 #include "../platform/WebGestureDevice.h" |
| 36 #include "../platform/WebRect.h" | 36 #include "../platform/WebRect.h" |
| 37 #include "WebMouseProperties.h" |
| 38 #include "WebPointerProperties.h" |
| 37 #include "WebTouchPoint.h" | 39 #include "WebTouchPoint.h" |
| 38 | 40 |
| 39 #include <string.h> | 41 #include <string.h> |
| 40 | 42 |
| 41 namespace blink { | 43 namespace blink { |
| 42 | 44 |
| 43 // The classes defined in this file are intended to be used with | 45 // The classes defined in this file are intended to be used with |
| 44 // WebWidget's handleInputEvent method. These event types are cross- | 46 // WebWidget's handleInputEvent method. These event types are cross- |
| 45 // platform and correspond closely to WebCore's Platform*Event classes. | 47 // platform and correspond closely to WebCore's Platform*Event classes. |
| 46 // | 48 // |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 // Sets keyIdentifier based on the value of windowsKeyCode. This is | 295 // Sets keyIdentifier based on the value of windowsKeyCode. This is |
| 294 // handy for generating synthetic keyboard events. | 296 // handy for generating synthetic keyboard events. |
| 295 BLINK_EXPORT void setKeyIdentifierFromWindowsKeyCode(); | 297 BLINK_EXPORT void setKeyIdentifierFromWindowsKeyCode(); |
| 296 | 298 |
| 297 static int windowsKeyCodeWithoutLocation(int keycode); | 299 static int windowsKeyCodeWithoutLocation(int keycode); |
| 298 static int locationModifiersFromWindowsKeyCode(int keycode); | 300 static int locationModifiersFromWindowsKeyCode(int keycode); |
| 299 }; | 301 }; |
| 300 | 302 |
| 301 // WebMouseEvent -------------------------------------------------------------- | 303 // WebMouseEvent -------------------------------------------------------------- |
| 302 | 304 |
| 303 class WebMouseEvent : public WebInputEvent { | 305 class WebMouseEvent : public WebInputEvent, public WebMouseProperties { |
| 304 public: | 306 public: |
| 305 enum Button { | |
| 306 ButtonNone = -1, | |
| 307 ButtonLeft, | |
| 308 ButtonMiddle, | |
| 309 ButtonRight | |
| 310 }; | |
| 311 | |
| 312 Button button; | |
| 313 int x; | 307 int x; |
| 314 int y; | 308 int y; |
| 315 int windowX; | 309 int windowX; |
| 316 int windowY; | 310 int windowY; |
| 317 int globalX; | 311 int globalX; |
| 318 int globalY; | 312 int globalY; |
| 319 int movementX; | 313 int movementX; |
| 320 int movementY; | 314 int movementY; |
| 321 int clickCount; | 315 int clickCount; |
| 322 | 316 |
| 323 WebMouseEvent() | 317 WebMouseEvent() |
| 324 : WebInputEvent(sizeof(WebMouseEvent)) | 318 : WebInputEvent(sizeof(WebMouseEvent)) |
| 325 , button(ButtonNone) | 319 , WebMouseProperties() |
| 326 , x(0) | 320 , x(0) |
| 327 , y(0) | 321 , y(0) |
| 328 , windowX(0) | 322 , windowX(0) |
| 329 , windowY(0) | 323 , windowY(0) |
| 330 , globalX(0) | 324 , globalX(0) |
| 331 , globalY(0) | 325 , globalY(0) |
| 332 , movementX(0) | 326 , movementX(0) |
| 333 , movementY(0) | 327 , movementY(0) |
| 334 , clickCount(0) | 328 , clickCount(0) |
| 335 { | 329 { |
| 336 } | 330 } |
| 337 | 331 |
| 338 protected: | 332 protected: |
| 339 explicit WebMouseEvent(unsigned sizeParam) | 333 explicit WebMouseEvent(unsigned sizeParam) |
| 340 : WebInputEvent(sizeParam) | 334 : WebInputEvent(sizeParam) |
| 341 , button(ButtonNone) | 335 , WebMouseProperties() |
| 342 , x(0) | 336 , x(0) |
| 343 , y(0) | 337 , y(0) |
| 344 , windowX(0) | 338 , windowX(0) |
| 345 , windowY(0) | 339 , windowY(0) |
| 346 , globalX(0) | 340 , globalX(0) |
| 347 , globalY(0) | 341 , globalY(0) |
| 348 , movementX(0) | 342 , movementX(0) |
| 349 , movementY(0) | 343 , movementY(0) |
| 350 , clickCount(0) | 344 , clickCount(0) |
| 351 { | 345 { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 , canRubberbandLeft(true) | 412 , canRubberbandLeft(true) |
| 419 , canRubberbandRight(true) | 413 , canRubberbandRight(true) |
| 420 , scrollByPage(false) | 414 , scrollByPage(false) |
| 421 , hasPreciseScrollingDeltas(false) | 415 , hasPreciseScrollingDeltas(false) |
| 422 , canScroll(true) | 416 , canScroll(true) |
| 423 , railsMode(RailsModeFree) | 417 , railsMode(RailsModeFree) |
| 424 { | 418 { |
| 425 } | 419 } |
| 426 }; | 420 }; |
| 427 | 421 |
| 422 // WebPointerEvent ------------------------------------------------------------ |
| 423 |
| 424 class WebPointerEvent : public WebMouseEvent, public WebPointerProperties { |
| 425 public: |
| 426 WebPointerEvent() |
| 427 : WebMouseEvent(sizeof(WebPointerEvent)) |
| 428 , WebPointerProperties() |
| 429 { |
| 430 } |
| 431 }; |
| 432 |
| 428 // WebGestureEvent -------------------------------------------------------------
- | 433 // WebGestureEvent -------------------------------------------------------------
- |
| 429 | 434 |
| 430 class WebGestureEvent : public WebInputEvent { | 435 class WebGestureEvent : public WebInputEvent { |
| 431 public: | 436 public: |
| 432 int x; | 437 int x; |
| 433 int y; | 438 int y; |
| 434 int globalX; | 439 int globalX; |
| 435 int globalY; | 440 int globalY; |
| 436 WebGestureDevice sourceDevice; | 441 WebGestureDevice sourceDevice; |
| 437 | 442 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 , y(0) | 520 , y(0) |
| 516 , globalX(0) | 521 , globalX(0) |
| 517 , globalY(0) | 522 , globalY(0) |
| 518 { | 523 { |
| 519 memset(&data, 0, sizeof(data)); | 524 memset(&data, 0, sizeof(data)); |
| 520 } | 525 } |
| 521 }; | 526 }; |
| 522 | 527 |
| 523 // WebTouchEvent -------------------------------------------------------------- | 528 // WebTouchEvent -------------------------------------------------------------- |
| 524 | 529 |
| 530 // TODO(e_hakkinen): Replace with WebPointerEvent. |
| 525 class WebTouchEvent : public WebInputEvent { | 531 class WebTouchEvent : public WebInputEvent { |
| 526 public: | 532 public: |
| 527 // Maximum number of simultaneous touches supported on | 533 // Maximum number of simultaneous touches supported on |
| 528 // Ash/Aura. | 534 // Ash/Aura. |
| 529 enum { touchesLengthCap = 16 }; | 535 enum { touchesLengthCap = 16 }; |
| 530 | 536 |
| 531 unsigned touchesLength; | 537 unsigned touchesLength; |
| 532 // List of all touches, regardless of state. | 538 // List of all touches, regardless of state. |
| 533 WebTouchPoint touches[touchesLengthCap]; | 539 WebTouchPoint touches[touchesLengthCap]; |
| 534 | 540 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 554 , uniqueTouchEventId(0) | 560 , uniqueTouchEventId(0) |
| 555 { | 561 { |
| 556 } | 562 } |
| 557 }; | 563 }; |
| 558 | 564 |
| 559 #pragma pack(pop) | 565 #pragma pack(pop) |
| 560 | 566 |
| 561 } // namespace blink | 567 } // namespace blink |
| 562 | 568 |
| 563 #endif | 569 #endif |
| OLD | NEW |