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 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
336 , movementY(0) | 336 , movementY(0) |
337 , clickCount(0) | 337 , clickCount(0) |
338 { | 338 { |
339 } | 339 } |
340 }; | 340 }; |
341 | 341 |
342 // WebMouseWheelEvent --------------------------------------------------------- | 342 // WebMouseWheelEvent --------------------------------------------------------- |
343 | 343 |
344 class WebMouseWheelEvent : public WebMouseEvent { | 344 class WebMouseWheelEvent : public WebMouseEvent { |
345 public: | 345 public: |
346 // The rail mode for a wheel event specifies the axis on which scrolling is | |
347 // expected to stick. If this axis is set to Free, then scrolling is not | |
348 // stuck to any axis. | |
349 enum RailMode { | |
Rick Byers
2015/03/18 23:30:58
We'll want to use this from WebGestureEvent too I
ccameron
2015/03/19 00:05:10
Good point -- done. Did this to the platform event
| |
350 RailModeFree = 0, | |
351 RailModeHorizontal = 1 << 0, | |
Rick Byers
2015/03/18 23:30:58
these don't need to be flags, right? I.e. it's no
ccameron
2015/03/19 00:05:10
The same is true of Phase, so I was guessing this
| |
352 RailModeVertical = 1 << 1, | |
353 }; | |
354 | |
346 enum Phase { | 355 enum Phase { |
347 PhaseNone = 0, | 356 PhaseNone = 0, |
348 PhaseBegan = 1 << 0, | 357 PhaseBegan = 1 << 0, |
349 PhaseStationary = 1 << 1, | 358 PhaseStationary = 1 << 1, |
350 PhaseChanged = 1 << 2, | 359 PhaseChanged = 1 << 2, |
351 PhaseEnded = 1 << 3, | 360 PhaseEnded = 1 << 3, |
352 PhaseCancelled = 1 << 4, | 361 PhaseCancelled = 1 << 4, |
353 PhaseMayBegin = 1 << 5, | 362 PhaseMayBegin = 1 << 5, |
354 }; | 363 }; |
355 | 364 |
(...skipping 27 matching lines...) Expand all Loading... | |
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 RailMode railMode; | |
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 , railMode(RailModeFree) | |
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 Loading... | |
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 |
OLD | NEW |