OLD | NEW |
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 class PlatformWheelEvent : public PlatformEvent { | 56 class PlatformWheelEvent : public PlatformEvent { |
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 #if OS(MACOSX) | 67 #if OS(MACOSX) |
67 , m_phase(PlatformWheelEventPhaseNone) | 68 , m_phase(PlatformWheelEventPhaseNone) |
68 , m_momentumPhase(PlatformWheelEventPhaseNone) | 69 , m_momentumPhase(PlatformWheelEventPhaseNone) |
69 , m_canRubberbandLeft(true) | 70 , m_canRubberbandLeft(true) |
70 , m_canRubberbandRight(true) | 71 , m_canRubberbandRight(true) |
71 #endif | 72 #endif |
72 { | 73 { |
73 } | 74 } |
74 | 75 |
75 PlatformWheelEvent(IntPoint position, IntPoint globalPosition, float deltaX,
float deltaY, float wheelTicksX, float wheelTicksY, PlatformWheelEventGranulari
ty granularity, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey) | 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) |
76 : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey
, 0) | 77 : PlatformEvent(PlatformEvent::Wheel, shiftKey, ctrlKey, altKey, metaKey
, 0) |
77 , m_position(position) | 78 , m_position(position) |
78 , m_globalPosition(globalPosition) | 79 , m_globalPosition(globalPosition) |
79 , m_deltaX(deltaX) | 80 , m_deltaX(deltaX) |
80 , m_deltaY(deltaY) | 81 , m_deltaY(deltaY) |
81 , m_wheelTicksX(wheelTicksX) | 82 , m_wheelTicksX(wheelTicksX) |
82 , m_wheelTicksY(wheelTicksY) | 83 , m_wheelTicksY(wheelTicksY) |
83 , m_granularity(granularity) | 84 , m_granularity(granularity) |
84 , m_hasPreciseScrollingDeltas(false) | 85 , m_hasPreciseScrollingDeltas(false) |
| 86 , m_canScroll(true) |
85 #if OS(MACOSX) | 87 #if OS(MACOSX) |
86 , m_phase(PlatformWheelEventPhaseNone) | 88 , m_phase(PlatformWheelEventPhaseNone) |
87 , m_momentumPhase(PlatformWheelEventPhaseNone) | 89 , m_momentumPhase(PlatformWheelEventPhaseNone) |
88 , m_canRubberbandLeft(true) | 90 , m_canRubberbandLeft(true) |
89 , m_canRubberbandRight(true) | 91 , m_canRubberbandRight(true) |
90 #endif | 92 #endif |
91 { | 93 { |
92 } | 94 } |
93 | 95 |
94 const IntPoint& position() const { return m_position; } // PlatformWindow co
ordinates. | 96 const IntPoint& position() const { return m_position; } // PlatformWindow co
ordinates. |
95 const IntPoint& globalPosition() const { return m_globalPosition; } // Scree
n coordinates. | 97 const IntPoint& globalPosition() const { return m_globalPosition; } // Scree
n coordinates. |
96 | 98 |
97 float deltaX() const { return m_deltaX; } | 99 float deltaX() const { return m_deltaX; } |
98 float deltaY() const { return m_deltaY; } | 100 float deltaY() const { return m_deltaY; } |
99 | 101 |
100 float wheelTicksX() const { return m_wheelTicksX; } | 102 float wheelTicksX() const { return m_wheelTicksX; } |
101 float wheelTicksY() const { return m_wheelTicksY; } | 103 float wheelTicksY() const { return m_wheelTicksY; } |
102 | 104 |
103 PlatformWheelEventGranularity granularity() const { return m_granularity; } | 105 PlatformWheelEventGranularity granularity() const { return m_granularity; } |
104 | 106 |
105 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas;
} | 107 bool hasPreciseScrollingDeltas() const { return m_hasPreciseScrollingDeltas;
} |
106 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b;
} | 108 void setHasPreciseScrollingDeltas(bool b) { m_hasPreciseScrollingDeltas = b;
} |
| 109 bool canScroll() const { return m_canScroll; } |
| 110 void setCanScroll(bool b) { m_canScroll = b; } |
107 #if OS(MACOSX) | 111 #if OS(MACOSX) |
108 PlatformWheelEventPhase phase() const { return m_phase; } | 112 PlatformWheelEventPhase phase() const { return m_phase; } |
109 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; } | 113 PlatformWheelEventPhase momentumPhase() const { return m_momentumPhase; } |
110 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv
entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; } | 114 bool useLatchedEventNode() const { return m_momentumPhase == PlatformWheelEv
entPhaseBegan || m_momentumPhase == PlatformWheelEventPhaseChanged; } |
111 bool canRubberbandLeft() const { return m_canRubberbandLeft; } | 115 bool canRubberbandLeft() const { return m_canRubberbandLeft; } |
112 bool canRubberbandRight() const { return m_canRubberbandRight; } | 116 bool canRubberbandRight() const { return m_canRubberbandRight; } |
113 #else | 117 #else |
114 bool useLatchedEventNode() const { return false; } | 118 bool useLatchedEventNode() const { return false; } |
115 #endif | 119 #endif |
116 | 120 |
117 protected: | 121 protected: |
118 IntPoint m_position; | 122 IntPoint m_position; |
119 IntPoint m_globalPosition; | 123 IntPoint m_globalPosition; |
120 float m_deltaX; | 124 float m_deltaX; |
121 float m_deltaY; | 125 float m_deltaY; |
122 float m_wheelTicksX; | 126 float m_wheelTicksX; |
123 float m_wheelTicksY; | 127 float m_wheelTicksY; |
124 PlatformWheelEventGranularity m_granularity; | 128 PlatformWheelEventGranularity m_granularity; |
125 bool m_hasPreciseScrollingDeltas; | 129 bool m_hasPreciseScrollingDeltas; |
| 130 bool m_canScroll; |
126 #if OS(MACOSX) | 131 #if OS(MACOSX) |
127 PlatformWheelEventPhase m_phase; | 132 PlatformWheelEventPhase m_phase; |
128 PlatformWheelEventPhase m_momentumPhase; | 133 PlatformWheelEventPhase m_momentumPhase; |
129 bool m_canRubberbandLeft; | 134 bool m_canRubberbandLeft; |
130 bool m_canRubberbandRight; | 135 bool m_canRubberbandRight; |
131 #endif | 136 #endif |
132 }; | 137 }; |
133 | 138 |
134 } // namespace blink | 139 } // namespace blink |
135 | 140 |
136 #endif // PlatformWheelEvent_h | 141 #endif // PlatformWheelEvent_h |
OLD | NEW |