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

Side by Side Diff: Source/platform/PlatformWheelEvent.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/platform/PlatformEvent.h ('k') | Source/platform/scroll/ScrollAnimator.cpp » ('j') | 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) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 public: 57 public:
58 PlatformWheelEvent() 58 PlatformWheelEvent()
59 : PlatformEvent(PlatformEvent::Wheel) 59 : PlatformEvent(PlatformEvent::Wheel)
60 , m_deltaX(0) 60 , m_deltaX(0)
61 , m_deltaY(0) 61 , m_deltaY(0)
62 , m_wheelTicksX(0) 62 , m_wheelTicksX(0)
63 , m_wheelTicksY(0) 63 , m_wheelTicksY(0)
64 , m_granularity(ScrollByPixelWheelEvent) 64 , m_granularity(ScrollByPixelWheelEvent)
65 , m_hasPreciseScrollingDeltas(false) 65 , m_hasPreciseScrollingDeltas(false)
66 , m_canScroll(true) 66 , m_canScroll(true)
67 , m_railsMode(RailsModeFree)
67 #if OS(MACOSX) 68 #if OS(MACOSX)
68 , m_phase(PlatformWheelEventPhaseNone) 69 , m_phase(PlatformWheelEventPhaseNone)
69 , m_momentumPhase(PlatformWheelEventPhaseNone) 70 , m_momentumPhase(PlatformWheelEventPhaseNone)
70 , m_canRubberbandLeft(true) 71 , m_canRubberbandLeft(true)
71 , m_canRubberbandRight(true) 72 , m_canRubberbandRight(true)
72 #endif 73 #endif
73 { 74 {
74 } 75 }
75 76
76 PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranulari ty granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey) 77 PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX, float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranulari ty granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
77 : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey , 0) 78 : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey , 0)
78 , m_position(position) 79 , m_position(position)
79 , m_globalPosition(globalPosition) 80 , m_globalPosition(globalPosition)
80 , m_deltaX(deltaX) 81 , m_deltaX(deltaX)
81 , m_deltaY(deltaY) 82 , m_deltaY(deltaY)
82 , m_wheelTicksX(wheelTicksX) 83 , m_wheelTicksX(wheelTicksX)
83 , m_wheelTicksY(wheelTicksY) 84 , m_wheelTicksY(wheelTicksY)
84 , m_granularity(granularity) 85 , m_granularity(granularity)
85 , m_hasPreciseScrollingDeltas(false) 86 , m_hasPreciseScrollingDeltas(false)
86 , m_canScroll(true) 87 , m_canScroll(true)
88 , m_railsMode(RailsModeFree)
87 #if OS(MACOSX) 89 #if OS(MACOSX)
88 , m_phase(PlatformWheelEventPhaseNone) 90 , m_phase(PlatformWheelEventPhaseNone)
89 , m_momentumPhase(PlatformWheelEventPhaseNone) 91 , m_momentumPhase(PlatformWheelEventPhaseNone)
90 , m_canRubberbandLeft(true) 92 , m_canRubberbandLeft(true)
91 , m_canRubberbandRight(true) 93 , m_canRubberbandRight(true)
92 #endif 94 #endif
93 { 95 {
94 } 96 }
95 97
96 const IntPoint& position() const { return m_position; } // PlatformWindow co ordinates. 98 const IntPoint& position() const { return m_position; } // PlatformWindow co ordinates.
97 const IntPoint& globalPosition() const { return m_globalPosition; } // Scree n coordinates. 99 const IntPoint& globalPosition() const { return m_globalPosition; } // Scree n coordinates.
98 100
99 float deltaX() const { return m_deltaX; } 101 float deltaX() const { return m_deltaX; }
100 float deltaY() const { return m_deltaY; } 102 float deltaY() const { return m_deltaY; }
101 103
102 float wheelTicksX() const { return m_wheelTicksX; } 104 float wheelTicksX() const { return m_wheelTicksX; }
103 float wheelTicksY() const { return m_wheelTicksY; } 105 float wheelTicksY() const { return m_wheelTicksY; }
104 106
105 PlatformWheelEventGranularity granularity() const { return m_granularity; } 107 PlatformWheelEventGranularity granularity() const { return m_granularity; }
106 108
107 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; } 109 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas; }
108 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; } 110 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b; }
109 bool canScroll() const { return m_canScroll; } 111 bool canScroll() const { return m_canScroll; }
110 void setCanScroll(bool b) { m_canScroll = b; } 112 void setCanScroll(bool b) { m_canScroll = b; }
113 RailsMode railsMode() const { return m_railsMode; }
114
111 #if OS(MACOSX) 115 #if OS(MACOSX)
112 PlatformWheelEventPhase phase() const { return m_phase; } 116 PlatformWheelEventPhase phase() const { return m_phase; }
113 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; } 117 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; }
114 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; } 118 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; }
115 bool canRubberbandLeft() const { return m_canRubberbandLeft; } 119 bool canRubberbandLeft() const { return m_canRubberbandLeft; }
116 bool canRubberbandRight() const { return m_canRubberbandRight; } 120 bool canRubberbandRight() const { return m_canRubberbandRight; }
117 #else 121 #else
118 bool useLatchedEventNode() const { return false; } 122 bool useLatchedEventNode() const { return false; }
119 #endif 123 #endif
120 124
121 protected: 125 protected:
122 IntPoint m_position; 126 IntPoint m_position;
123 IntPoint m_globalPosition; 127 IntPoint m_globalPosition;
124 float m_deltaX; 128 float m_deltaX;
125 float m_deltaY; 129 float m_deltaY;
126 float m_wheelTicksX; 130 float m_wheelTicksX;
127 float m_wheelTicksY; 131 float m_wheelTicksY;
128 PlatformWheelEventGranularity m_granularity; 132 PlatformWheelEventGranularity m_granularity;
129 bool m_hasPreciseScrollingDeltas; 133 bool m_hasPreciseScrollingDeltas;
130 bool m_canScroll; 134 bool m_canScroll;
135 RailsMode m_railsMode;
131 #if OS(MACOSX) 136 #if OS(MACOSX)
132 PlatformWheelEventPhase m_phase; 137 PlatformWheelEventPhase m_phase;
133 PlatformWheelEventPhase m_momentumPhase; 138 PlatformWheelEventPhase m_momentumPhase;
134 bool m_canRubberbandLeft; 139 bool m_canRubberbandLeft;
135 bool m_canRubberbandRight; 140 bool m_canRubberbandRight;
136 #endif 141 #endif
137 }; 142 };
138 143
139 } // namespace blink 144 } // namespace blink
140 145
141 #endif // PlatformWheelEvent_h 146 #endif // PlatformWheelEvent_h
OLDNEW
« no previous file with comments | « Source/platform/PlatformEvent.h ('k') | Source/platform/scroll/ScrollAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698