2 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://floralicense.org/license/
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 #include <dali/internal/event/events/pinch-gesture-detector-impl.h>
21 #include <dali/public-api/events/pinch-gesture.h>
22 #include <dali/public-api/object/type-registry.h>
23 #include <dali/internal/event/events/gesture-event-processor.h>
24 #include <dali/integration-api/debug.h>
36 return Dali::PinchGestureDetector::New();
39 TypeRegistration mType( typeid(Dali::PinchGestureDetector), typeid(Dali::GestureDetector), Create );
41 SignalConnectorType signalConnector1( mType, Dali::PinchGestureDetector::SIGNAL_PINCH_DETECTED, &PinchGestureDetector::DoConnectSignal );
46 PinchGestureDetectorPtr PinchGestureDetector::New()
48 return new PinchGestureDetector;
51 PinchGestureDetector::PinchGestureDetector()
52 : GestureDetector(Gesture::Pinch)
56 PinchGestureDetector::~PinchGestureDetector()
60 void PinchGestureDetector::EmitPinchGestureSignal(Dali::Actor actor, const PinchGesture& pinch)
62 // Guard against destruction during signal emission
63 Dali::PinchGestureDetector handle( this );
65 mDetectedSignalV2.Emit( actor, pinch );
68 bool PinchGestureDetector::DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor )
70 bool connected( true );
71 PinchGestureDetector* gesture = dynamic_cast<PinchGestureDetector*>(object);
73 if ( Dali::PinchGestureDetector::SIGNAL_PINCH_DETECTED == signalName )
75 gesture->DetectedSignal().Connect( tracker, functor );
79 // signalName does not match any signal
86 void PinchGestureDetector::OnActorAttach(Actor& actor)
91 void PinchGestureDetector::OnActorDetach(Actor& actor)
96 void PinchGestureDetector::OnActorDestroyed(Object& object)
101 } // namespace Internal