Chromium Code Reviews| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 RailsModeVertical = 2, | 222 RailsModeVertical = 2, |
| 223 }; | 223 }; |
| 224 | 224 |
| 225 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; | 225 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; |
| 226 | 226 |
| 227 double timeStampSeconds; // Seconds since platform start with microsecond | 227 double timeStampSeconds; // Seconds since platform start with microsecond |
| 228 // resolution. | 228 // resolution. |
| 229 unsigned size; // The size of this structure, for serialization. | 229 unsigned size; // The size of this structure, for serialization. |
| 230 Type type; | 230 Type type; |
| 231 int modifiers; | 231 int modifiers; |
| 232 float frameScale; // Scalar applied at frame time. | |
|
majidvp
2016/12/01 15:46:31
frame time? do you mean frame conversion time?
dtapuska
2016/12/01 16:26:43
Ya this comment needs some work. I mean that when
| |
| 233 float frameTranslateX; // post scale translation x value. | |
| 234 float frameTranslateY; // post scale translation y value. | |
|
majidvp
2016/12/01 15:46:31
should frameTranslateX and frameTranslateY just be
dtapuska
2016/12/01 16:26:43
WebFloatPoint isn't packed. So I might be able to
| |
| 232 | 235 |
| 233 // Returns true if the WebInputEvent |type| is a mouse event. | 236 // Returns true if the WebInputEvent |type| is a mouse event. |
| 234 static bool isMouseEventType(int type) { | 237 static bool isMouseEventType(int type) { |
| 235 return MouseTypeFirst <= type && type <= MouseTypeLast; | 238 return MouseTypeFirst <= type && type <= MouseTypeLast; |
| 236 } | 239 } |
| 237 | 240 |
| 238 // Returns true if the WebInputEvent |type| is a keyboard event. | 241 // Returns true if the WebInputEvent |type| is a keyboard event. |
| 239 static bool isKeyboardEventType(int type) { | 242 static bool isKeyboardEventType(int type) { |
| 240 return KeyboardTypeFirst <= type && type <= KeyboardTypeLast; | 243 return KeyboardTypeFirst <= type && type <= KeyboardTypeLast; |
| 241 } | 244 } |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 264 | 267 |
| 265 BLINK_COMMON_EXPORT static const char* GetName(WebInputEvent::Type); | 268 BLINK_COMMON_EXPORT static const char* GetName(WebInputEvent::Type); |
| 266 | 269 |
| 267 protected: | 270 protected: |
| 268 explicit WebInputEvent(unsigned sizeParam) { | 271 explicit WebInputEvent(unsigned sizeParam) { |
| 269 memset(this, 0, sizeParam); | 272 memset(this, 0, sizeParam); |
| 270 timeStampSeconds = 0.0; | 273 timeStampSeconds = 0.0; |
| 271 size = sizeParam; | 274 size = sizeParam; |
| 272 type = Undefined; | 275 type = Undefined; |
| 273 modifiers = 0; | 276 modifiers = 0; |
| 277 frameScale = 1.0f; | |
| 274 } | 278 } |
| 275 }; | 279 }; |
| 276 | 280 |
| 277 // WebKeyboardEvent ----------------------------------------------------------- | 281 // WebKeyboardEvent ----------------------------------------------------------- |
| 278 | 282 |
| 279 class WebKeyboardEvent : public WebInputEvent { | 283 class WebKeyboardEvent : public WebInputEvent { |
| 280 public: | 284 public: |
| 281 // Caps on string lengths so we can make them static arrays and keep | 285 // Caps on string lengths so we can make them static arrays and keep |
| 282 // them PODs. | 286 // them PODs. |
| 283 static const size_t textLengthCap = 4; | 287 static const size_t textLengthCap = 4; |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 495 movedBeyondSlopRegion(false), | 499 movedBeyondSlopRegion(false), |
| 496 touchStartOrFirstTouchMove(false), | 500 touchStartOrFirstTouchMove(false), |
| 497 uniqueTouchEventId(0) {} | 501 uniqueTouchEventId(0) {} |
| 498 }; | 502 }; |
| 499 | 503 |
| 500 #pragma pack(pop) | 504 #pragma pack(pop) |
| 501 | 505 |
| 502 } // namespace blink | 506 } // namespace blink |
| 503 | 507 |
| 504 #endif | 508 #endif |
| OLD | NEW |