Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Side by Side Diff: sky/engine/public/platform/WebInputEvent.h

Issue 845313011: Add blink::WebPointerEvent (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/events/PointerEvent.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « sky/engine/core/events/PointerEvent.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698