| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // So, for what it's worth, our Linux and Mac front-ends emulate our | 79 // So, for what it's worth, our Linux and Mac front-ends emulate our |
| 80 // Windows front-end. To emulate our Windows front-end, we can share | 80 // Windows front-end. To emulate our Windows front-end, we can share |
| 81 // our back-end code among Windows, Linux, and Mac. | 81 // our back-end code among Windows, Linux, and Mac. |
| 82 // TODO(hbono): Issue 18064: remove the KeyDown type since it isn't | 82 // TODO(hbono): Issue 18064: remove the KeyDown type since it isn't |
| 83 // used in Chrome any longer. | 83 // used in Chrome any longer. |
| 84 | 84 |
| 85 enum Type { | 85 enum Type { |
| 86 Undefined = -1, | 86 Undefined = -1, |
| 87 TypeFirst = Undefined, | 87 TypeFirst = Undefined, |
| 88 | 88 |
| 89 // WebPointerEvent |
| 90 PointerDown, |
| 91 PointerUp, |
| 92 PointerMove, |
| 93 PointerCancel, |
| 94 |
| 89 // WebMouseEvent | 95 // WebMouseEvent |
| 90 MouseDown, | 96 MouseDown, |
| 91 MouseTypeFirst = MouseDown, | 97 MouseTypeFirst = MouseDown, |
| 92 MouseUp, | 98 MouseUp, |
| 93 MouseMove, | 99 MouseMove, |
| 94 MouseEnter, | 100 MouseEnter, |
| 95 MouseLeave, | 101 MouseLeave, |
| 96 MouseTypeLast = MouseLeave, | 102 MouseTypeLast = MouseLeave, |
| 97 | 103 |
| 98 // WebMouseWheelEvent | 104 // WebMouseWheelEvent |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 explicit WebInputEvent(unsigned sizeParam) | 215 explicit WebInputEvent(unsigned sizeParam) |
| 210 { | 216 { |
| 211 memset(this, 0, sizeParam); | 217 memset(this, 0, sizeParam); |
| 212 timeStampSeconds = 0.0; | 218 timeStampSeconds = 0.0; |
| 213 size = sizeParam; | 219 size = sizeParam; |
| 214 type = Undefined; | 220 type = Undefined; |
| 215 modifiers = 0; | 221 modifiers = 0; |
| 216 } | 222 } |
| 217 }; | 223 }; |
| 218 | 224 |
| 225 // WebPointerEvent ------------------------------------------------------------ |
| 226 |
| 227 class WebPointerEvent : public WebInputEvent { |
| 228 public: |
| 229 enum Kind { |
| 230 Touch, |
| 231 Mouse, |
| 232 Stylus, |
| 233 }; |
| 234 |
| 235 int pointer = 0; |
| 236 Kind kind = Touch; |
| 237 double x = 0; |
| 238 double y = 0; |
| 239 double dx = 0; |
| 240 double dy = 0; |
| 241 int buttons = 0; |
| 242 double pressure = 0; |
| 243 double pressureMin = 0; |
| 244 double pressureMax = 0; |
| 245 double distance = 0; |
| 246 double distanceMin = 0; |
| 247 double distanceMax = 0; |
| 248 double radiusMajor = 0; |
| 249 double radiusMinor = 0; |
| 250 double radiusMin = 0; |
| 251 double radiusMax = 0; |
| 252 double orientation = 0; |
| 253 double tilt = 0; |
| 254 |
| 255 WebPointerEvent() : WebInputEvent(sizeof(WebPointerEvent)) {} |
| 256 }; |
| 257 |
| 219 // WebKeyboardEvent ----------------------------------------------------------- | 258 // WebKeyboardEvent ----------------------------------------------------------- |
| 220 | 259 |
| 221 class WebKeyboardEvent : public WebInputEvent { | 260 class WebKeyboardEvent : public WebInputEvent { |
| 222 public: | 261 public: |
| 223 // Caps on string lengths so we can make them static arrays and keep | 262 // Caps on string lengths so we can make them static arrays and keep |
| 224 // them PODs. | 263 // them PODs. |
| 225 static const size_t textLengthCap = 4; | 264 static const size_t textLengthCap = 4; |
| 226 | 265 |
| 227 // http://www.w3.org/TR/DOM-Level-3-Events/keyset.html lists the | 266 // http://www.w3.org/TR/DOM-Level-3-Events/keyset.html lists the |
| 228 // identifiers. The longest is 18 characters, so we round up to the | 267 // identifiers. The longest is 18 characters, so we round up to the |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 , cancelable(true) | 549 , cancelable(true) |
| 511 { | 550 { |
| 512 } | 551 } |
| 513 }; | 552 }; |
| 514 | 553 |
| 515 #pragma pack(pop) | 554 #pragma pack(pop) |
| 516 | 555 |
| 517 } // namespace blink | 556 } // namespace blink |
| 518 | 557 |
| 519 #endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBINPUTEVENT_H_ | 558 #endif // SKY_ENGINE_PUBLIC_PLATFORM_WEBINPUTEVENT_H_ |
| OLD | NEW |