Pan gesture recognizer. More...
#include <PanRecognizer.h>


Public Member Functions | |
| const IntPoint & | panPos () const |
| Get the pan position. | |
| int | panOffsetX () const |
| Get the horizontal pan offset. | |
| int | panOffsetY () const |
| Get the vertical pan offset. | |
| int | panSpeedX () const |
| Get the horizontal pan speed. | |
| int | panSpeedY () const |
| Get the horizontal pan speed. | |
| virtual void | reset () |
| Reset the gesture. | |
| virtual void | touchEvent (const PlatformTouchEvent &) |
| Feed new data. | |
Private Member Functions | |
| IntPoint | calcPanPos (const Vector< PlatformTouchPoint > &ps) |
| Calculates pan position. | |
Private Attributes | |
| IntPoint | m_panPos |
| int | m_panOffsetX |
| int | m_panOffsetY |
| GestureSpeedCalc | m_speedX |
| GestureSpeedCalc | m_speedY |
Pan gesture recognizer.
Definition at line 30 of file PanRecognizer.h.
| IntPoint WebCore::PanRecognizer::calcPanPos | ( | const Vector< PlatformTouchPoint > & | ps | ) | [private] |
Calculates pan position.
Calculates the pan position using the supplied touch points. If the touch event only contains one touch point, its coordinates are used as the pan position. Otherwise the pan position is in the middle of the first two touch points.
| ps | Touch point(s) to calculate from. |
Definition at line 85 of file PanRecognizer.cpp.
References WebCore::GestureRecognizer::m_id1i, and WebCore::GestureRecognizer::m_id2i.
| WebCore::PanRecognizer::panOffsetX | ( | ) | const [inline] |
Get the horizontal pan offset.
Definition at line 35 of file PanRecognizer.h.
References m_panOffsetX.
| WebCore::PanRecognizer::panOffsetY | ( | ) | const [inline] |
Get the vertical pan offset.
Definition at line 36 of file PanRecognizer.h.
References m_panOffsetY.
| WebCore::PanRecognizer::panPos | ( | ) | const [inline] |
Get the pan position.
Definition at line 34 of file PanRecognizer.h.
References m_panPos.
| WebCore::PanRecognizer::panSpeedX | ( | ) | const [inline] |
Get the horizontal pan speed.
Definition at line 37 of file PanRecognizer.h.
References m_speedX, and WebCore::GestureSpeedCalc::speed().

| WebCore::PanRecognizer::panSpeedY | ( | ) | const [inline] |
Get the horizontal pan speed.
Definition at line 38 of file PanRecognizer.h.
References m_speedY, and WebCore::GestureSpeedCalc::speed().

| void WebCore::PanRecognizer::reset | ( | ) | [virtual] |
Reset the gesture.
Resets the gesture data e.g. when the gesture starts over.
Reimplemented from WebCore::GestureRecognizer.
Definition at line 32 of file PanRecognizer.cpp.
References m_panOffsetX, m_panOffsetY, m_panPos, and WebCore::GestureRecognizer::m_refresh.
| void WebCore::PanRecognizer::touchEvent | ( | const PlatformTouchEvent & | ev | ) | [virtual] |
Feed new data.
Processes a new touch event and calculates new data for the pan gesture.
| ev | Platform touch event. |
Implements WebCore::GestureRecognizer.
Definition at line 46 of file PanRecognizer.cpp.
References calcPanPos(), WebCore::GestureSpeedCalc::firstSample(), WebCore::GestureSpeedCalc::insertSample(), m_panOffsetX, m_panOffsetY, m_panPos, WebCore::GestureRecognizer::m_refresh, m_speedX, m_speedY, WebCore::GestureRecognizer::selectValidPoints(), and WebCore::GestureRecognizer::updateRefreshState().

int WebCore::PanRecognizer::m_panOffsetX [private] |
Definition at line 47 of file PanRecognizer.h.
int WebCore::PanRecognizer::m_panOffsetY [private] |
Definition at line 48 of file PanRecognizer.h.
IntPoint WebCore::PanRecognizer::m_panPos [private] |
Definition at line 46 of file PanRecognizer.h.
Definition at line 49 of file PanRecognizer.h.
Definition at line 50 of file PanRecognizer.h.
1.6.2-20100208