// INTERNAL INCLUDES
#include <dali/integration-api/render-controller.h>
#include <dali/internal/event/common/stage-impl.h>
-#include <dali/internal/event/events/pinch-gesture-detector-impl.h>
+#include <dali/internal/event/events/pinch-gesture/pinch-gesture-detector-impl.h>
#include <dali/internal/update/gestures/scene-graph-pan-gesture.h>
#include <dali/public-api/events/pan-gesture.h>
#include <dali/integration-api/debug.h>
mPanGestureProcessor( updateManager ),
mPinchGestureProcessor(),
mTapGestureProcessor(),
+ mRotationGestureProcessor(),
mRenderController( renderController ),
- mLongPressDetectorCount(0),
- mPanDetectorCount(0),
- mPinchDetectorCount(0),
- mTapDetectorCount(0),
envOptionMinimumPanDistance(-1),
envOptionMinimumPanEvents(-1)
{
void GestureEventProcessor::ProcessTouchEvent( Scene& scene, const Integration::TouchEvent& event)
{
- if( mLongPressDetectorCount > 0 )
- {
- mLongPressGestureProcessor.ProcessTouch(scene, event);
- }
- if( mPanDetectorCount > 0 )
- {
- mPanGestureProcessor.ProcessTouch(scene, event);
- }
- if( mPinchDetectorCount > 0 )
- {
- mPinchGestureProcessor.ProcessTouch(scene, event);
- }
- if( mTapDetectorCount > 0 )
- {
- mTapGestureProcessor.ProcessTouch(scene, event);
- }
+ mLongPressGestureProcessor.ProcessTouch(scene, event);
+ mPanGestureProcessor.ProcessTouch(scene, event);
+ mPinchGestureProcessor.ProcessTouch(scene, event);
+ mTapGestureProcessor.ProcessTouch(scene, event);
+ mRotationGestureProcessor.ProcessTouch(scene, event);
}
void GestureEventProcessor::AddGestureDetector(GestureDetector* gestureDetector, Scene& scene)
{
switch (gestureDetector->GetType())
{
- case Gesture::LongPress:
+ case DevelGesture::LongPress:
{
LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
mLongPressGestureProcessor.AddGestureDetector(longPress, scene);
- mLongPressDetectorCount++;
break;
}
- case Gesture::Pan:
+ case DevelGesture::Pan:
{
PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
mPanGestureProcessor.AddGestureDetector(pan, scene, envOptionMinimumPanDistance, envOptionMinimumPanEvents);
- mPanDetectorCount++;
break;
}
- case Gesture::Pinch:
+ case DevelGesture::Pinch:
{
PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
mPinchGestureProcessor.AddGestureDetector(pinch, scene);
- mPinchDetectorCount++;
break;
}
- case Gesture::Tap:
+ case DevelGesture::Tap:
{
TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
mTapGestureProcessor.AddGestureDetector(tap, scene);
- mTapDetectorCount++;
+ break;
+ }
+
+ case DevelGesture::Rotation:
+ {
+ RotationGestureDetector* rotation = static_cast<RotationGestureDetector*>(gestureDetector);
+ mRotationGestureProcessor.AddGestureDetector(rotation, scene);
break;
}
}
{
switch (gestureDetector->GetType())
{
- case Gesture::LongPress:
+ case DevelGesture::LongPress:
{
LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
mLongPressGestureProcessor.RemoveGestureDetector(longPress);
- mLongPressDetectorCount--;
break;
}
- case Gesture::Pan:
+ case DevelGesture::Pan:
{
PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
mPanGestureProcessor.RemoveGestureDetector(pan);
- mPanDetectorCount--;
break;
}
- case Gesture::Pinch:
+ case DevelGesture::Pinch:
{
PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
mPinchGestureProcessor.RemoveGestureDetector(pinch);
- mPinchDetectorCount--;
break;
}
- case Gesture::Tap:
+ case DevelGesture::Tap:
{
TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
mTapGestureProcessor.RemoveGestureDetector(tap);
- mTapDetectorCount--;
+ break;
+ }
+
+ case DevelGesture::Rotation:
+ {
+ RotationGestureDetector* rotation = static_cast<RotationGestureDetector*>(gestureDetector);
+ mRotationGestureProcessor.RemoveGestureDetector(rotation);
break;
}
}
{
switch (gestureDetector->GetType())
{
- case Gesture::LongPress:
+ case DevelGesture::LongPress:
{
LongPressGestureDetector* longPress = static_cast<LongPressGestureDetector*>(gestureDetector);
mLongPressGestureProcessor.GestureDetectorUpdated(longPress);
break;
}
- case Gesture::Pan:
+ case DevelGesture::Pan:
{
PanGestureDetector* pan = static_cast<PanGestureDetector*>(gestureDetector);
mPanGestureProcessor.GestureDetectorUpdated(pan);
break;
}
- case Gesture::Pinch:
+ case DevelGesture::Pinch:
{
PinchGestureDetector* pinch = static_cast<PinchGestureDetector*>(gestureDetector);
mPinchGestureProcessor.GestureDetectorUpdated(pinch);
break;
}
- case Gesture::Tap:
+ case DevelGesture::Tap:
{
TapGestureDetector* tap = static_cast<TapGestureDetector*>(gestureDetector);
mTapGestureProcessor.GestureDetectorUpdated(tap);
break;
}
+
+ case DevelGesture::Rotation:
+ {
+ // Nothing to do
+ break;
+ }
}
}
{
bool requestUpdate = false;
- switch ( gesture.type )
+ switch ( static_cast< DevelGesture::Type >( gesture.type ) )
{
- case Gesture::Pan:
+ case DevelGesture::Pan:
{
const PanGesture& pan = static_cast< const PanGesture& >( gesture );
requestUpdate = mPanGestureProcessor.SetPanGestureProperties( pan );
break;
}
- case Gesture::LongPress:
- case Gesture::Pinch:
- case Gesture::Tap:
+ case DevelGesture::LongPress:
+ case DevelGesture::Pinch:
+ case DevelGesture::Tap:
+ case DevelGesture::Rotation:
{
DALI_ASSERT_DEBUG( false && "Gesture type does not have scene object\n" );
break;
updateRequired |= mPanGestureProcessor.NeedsUpdate();
updateRequired |= mPinchGestureProcessor.NeedsUpdate();
updateRequired |= mTapGestureProcessor.NeedsUpdate();
+ updateRequired |= mRotationGestureProcessor.NeedsUpdate();
return updateRequired;
}
mPinchGestureProcessor.SetMinimumPinchDistance( value );
}
+void GestureEventProcessor::SetLongPressMinimumHoldingTime( uint32_t value )
+{
+ mLongPressGestureProcessor.SetMinimumHoldingTime( value );
+}
+
+uint32_t GestureEventProcessor::GetLongPressMinimumHoldingTime() const
+{
+ return mLongPressGestureProcessor.GetMinimumHoldingTime();
+}
+
const PanGestureProcessor& GestureEventProcessor::GetPanGestureProcessor()
{
return mPanGestureProcessor;