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

Side by Side Diff: public/web/WebInputEvent.h

Issue 1018183002: Add rails to input wheel events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More plumbing and tests Created 5 years, 9 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 | « Source/web/tests/WebInputEventConversionTest.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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 // into WebCore, so round-tripping from WebInputEvent to a WebCore 166 // into WebCore, so round-tripping from WebInputEvent to a WebCore
167 // event and back will not preserve these flags. 167 // event and back will not preserve these flags.
168 CapsLockOn = 1 << 9, 168 CapsLockOn = 1 << 9,
169 NumLockOn = 1 << 10, 169 NumLockOn = 1 << 10,
170 170
171 // Left/right modifiers for keyboard events. 171 // Left/right modifiers for keyboard events.
172 IsLeft = 1 << 11, 172 IsLeft = 1 << 11,
173 IsRight = 1 << 12, 173 IsRight = 1 << 12,
174 }; 174 };
175 175
176 // The rail mode for a wheel event specifies the axis on which scrolling is
177 // expected to stick. If this axis is set to Free, then scrolling is not
178 // stuck to any axis.
179 enum RailsMode {
180 RailsModeFree = 0,
181 RailsModeHorizontal = 1,
182 RailsModeVertical = 2,
183 };
184
176 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey; 185 static const int InputModifiers = ShiftKey | ControlKey | AltKey | MetaKey;
177 186
178 double timeStampSeconds; // Seconds since epoch. 187 double timeStampSeconds; // Seconds since epoch.
179 unsigned size; // The size of this structure, for serialization. 188 unsigned size; // The size of this structure, for serialization.
180 Type type; 189 Type type;
181 int modifiers; 190 int modifiers;
182 191
183 // Returns true if the WebInputEvent |type| is a mouse event. 192 // Returns true if the WebInputEvent |type| is a mouse event.
184 static bool isMouseEventType(int type) 193 static bool isMouseEventType(int type)
185 { 194 {
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 392
384 bool scrollByPage; 393 bool scrollByPage;
385 bool hasPreciseScrollingDeltas; 394 bool hasPreciseScrollingDeltas;
386 395
387 // When false, this wheel event should not trigger scrolling (or any other d efault 396 // When false, this wheel event should not trigger scrolling (or any other d efault
388 // action) if the event goes unhandled by JavaScript. This is used, for exam ple, 397 // action) if the event goes unhandled by JavaScript. This is used, for exam ple,
389 // when the browser decides the default behavior for Ctrl+Wheel should be to zoom 398 // when the browser decides the default behavior for Ctrl+Wheel should be to zoom
390 // instead of scroll. 399 // instead of scroll.
391 bool canScroll; 400 bool canScroll;
392 401
402 RailsMode railsMode;
403
393 WebMouseWheelEvent() 404 WebMouseWheelEvent()
394 : WebMouseEvent(sizeof(WebMouseWheelEvent)) 405 : WebMouseEvent(sizeof(WebMouseWheelEvent))
395 , deltaX(0.0f) 406 , deltaX(0.0f)
396 , deltaY(0.0f) 407 , deltaY(0.0f)
397 , wheelTicksX(0.0f) 408 , wheelTicksX(0.0f)
398 , wheelTicksY(0.0f) 409 , wheelTicksY(0.0f)
399 , accelerationRatioX(1.0f) 410 , accelerationRatioX(1.0f)
400 , accelerationRatioY(1.0f) 411 , accelerationRatioY(1.0f)
401 , phase(PhaseNone) 412 , phase(PhaseNone)
402 , momentumPhase(PhaseNone) 413 , momentumPhase(PhaseNone)
403 , canRubberbandLeft(true) 414 , canRubberbandLeft(true)
404 , canRubberbandRight(true) 415 , canRubberbandRight(true)
405 , scrollByPage(false) 416 , scrollByPage(false)
406 , hasPreciseScrollingDeltas(false) 417 , hasPreciseScrollingDeltas(false)
407 , canScroll(true) 418 , canScroll(true)
419 , railsMode(RailsModeFree)
408 { 420 {
409 } 421 }
410 }; 422 };
411 423
412 // WebGestureEvent ------------------------------------------------------------- - 424 // WebGestureEvent ------------------------------------------------------------- -
413 425
414 class WebGestureEvent : public WebInputEvent { 426 class WebGestureEvent : public WebInputEvent {
415 public: 427 public:
416 int x; 428 int x;
417 int y; 429 int y;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 , uniqueTouchEventId(0) 543 , uniqueTouchEventId(0)
532 { 544 {
533 } 545 }
534 }; 546 };
535 547
536 #pragma pack(pop) 548 #pragma pack(pop)
537 549
538 } // namespace blink 550 } // namespace blink
539 551
540 #endif 552 #endif
OLDNEW
« no previous file with comments | « Source/web/tests/WebInputEventConversionTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698