From: Adeel Kazmi Date: Tue, 11 Nov 2014 15:50:22 +0000 (+0000) Subject: (Gestures) Pass const refs in callbacks X-Git-Tag: dali_1.0.17~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc069138105cb9e965b842529d57f609d7b203e8;p=platform%2Fcore%2Fuifw%2Fdali-core.git (Gestures) Pass const refs in callbacks Change-Id: I783837af2e3021649c64d78ad63294902029fea7 --- diff --git a/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp index 3fbf425..12740f8 100644 --- a/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-LongPressGestureDetector.cpp @@ -74,7 +74,7 @@ struct GestureReceivedFunctor { GestureReceivedFunctor(SignalData& data) : signalData(data) { } - void operator()(Actor actor, LongPressGesture longPress) + void operator()(Actor actor, const LongPressGesture& longPress) { signalData.functorCalled = true; signalData.receivedGesture = longPress; @@ -98,7 +98,7 @@ struct UnstageActorFunctor : public GestureReceivedFunctor { } - void operator()( Actor actor, LongPressGesture longPress ) + void operator()( Actor actor, const LongPressGesture& longPress ) { GestureReceivedFunctor::operator()( actor, longPress ); diff --git a/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp index f4d7afc..a850887 100644 --- a/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-PanGestureDetector.cpp @@ -83,7 +83,7 @@ struct GestureReceivedFunctor { GestureReceivedFunctor(SignalData& data) : signalData(data) { } - void operator()(Actor actor, PanGesture pan) + void operator()(Actor actor, const PanGesture& pan) { signalData.functorCalled = true; signalData.receivedGesture = pan; @@ -107,7 +107,7 @@ struct UnstageActorFunctor : public GestureReceivedFunctor { } - void operator()( Actor actor, PanGesture pan ) + void operator()( Actor actor, const PanGesture& pan ) { GestureReceivedFunctor::operator()( actor, pan ); diff --git a/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp index 6a137b2..3432e14 100644 --- a/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-PinchGestureDetector.cpp @@ -75,7 +75,7 @@ struct GestureReceivedFunctor { GestureReceivedFunctor(SignalData& data) : signalData(data) { } - void operator()(Actor actor, PinchGesture pinch) + void operator()(Actor actor, const PinchGesture& pinch) { signalData.functorCalled = true; signalData.receivedGesture = pinch; @@ -99,7 +99,7 @@ struct UnstageActorFunctor : public GestureReceivedFunctor { } - void operator()( Actor actor, PinchGesture pinch ) + void operator()( Actor actor, const PinchGesture& pinch ) { GestureReceivedFunctor::operator()( actor, pinch ); diff --git a/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp b/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp index d81fb58..d19bc08 100644 --- a/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp +++ b/automated-tests/src/dali/utc-Dali-TapGestureDetector.cpp @@ -73,7 +73,7 @@ struct GestureReceivedFunctor { GestureReceivedFunctor(SignalData& data) : signalData(data) { } - void operator()(Actor actor, TapGesture tap) + void operator()(Actor actor, const TapGesture& tap) { signalData.functorCalled = true; signalData.receivedGesture = tap; @@ -93,7 +93,7 @@ struct UnstageActorFunctor : public GestureReceivedFunctor { UnstageActorFunctor( SignalData& data ) : GestureReceivedFunctor( data ) { } - void operator()(Actor actor, TapGesture tap) + void operator()(Actor actor, const TapGesture& tap) { GestureReceivedFunctor::operator()( actor, tap ); Stage::GetCurrent().Remove( actor ); diff --git a/dali/public-api/events/long-press-gesture-detector.h b/dali/public-api/events/long-press-gesture-detector.h index bca062d..cb8dab8 100644 --- a/dali/public-api/events/long-press-gesture-detector.h +++ b/dali/public-api/events/long-press-gesture-detector.h @@ -53,7 +53,7 @@ class DALI_IMPORT_API LongPressGestureDetector : public GestureDetector { public: // Typedefs - typedef SignalV2< void (Actor, LongPressGesture) > DetectedSignalV2; ///< Gesture detected signal type + typedef SignalV2< void ( Actor, const LongPressGesture& ) > DetectedSignalV2; ///< Gesture detected signal type //Signal Names static const char* const SIGNAL_LONG_PRESS_DETECTED; ///< name "long-press-detected" @@ -181,7 +181,7 @@ public: // Signals * * A callback of the following type may be connected: * @code - * void YourCallbackName(Actor actor, LongPressGesture gesture); + * void YourCallbackName( Actor actor, const LongPressGesture& gesture ); * @endcode * @pre The gesture detector has been initialized. * @return The signal to connect to. diff --git a/dali/public-api/events/pan-gesture-detector.h b/dali/public-api/events/pan-gesture-detector.h index c99444c..04015b8 100644 --- a/dali/public-api/events/pan-gesture-detector.h +++ b/dali/public-api/events/pan-gesture-detector.h @@ -56,7 +56,7 @@ class DALI_IMPORT_API PanGestureDetector : public GestureDetector public: // Typedefs - typedef SignalV2< void (Actor, PanGesture) > DetectedSignalV2; ///< Pan gesture detected signal type + typedef SignalV2< void ( Actor, const PanGesture& ) > DetectedSignalV2; ///< Pan gesture detected signal type // Directional Pan typedef std::pair< Radian, Radian > AngleThresholdPair; ///< Range of angles for a direction @@ -275,7 +275,7 @@ public: // Signals * * A callback of the following type may be connected: * @code - * void YourCallbackName(Actor actor, PanGesture gesture); + * void YourCallbackName( Actor actor, const PanGesture& gesture ); * @endcode * @pre The gesture detector has been initialized. * @return The signal to connect to. diff --git a/dali/public-api/events/pinch-gesture-detector.h b/dali/public-api/events/pinch-gesture-detector.h index e9974e1..040e249 100644 --- a/dali/public-api/events/pinch-gesture-detector.h +++ b/dali/public-api/events/pinch-gesture-detector.h @@ -55,7 +55,7 @@ public: // Typedefs /** * @brief Signal type. */ - typedef SignalV2< void (Actor, PinchGesture) > DetectedSignalV2; + typedef SignalV2< void ( Actor, const PinchGesture& ) > DetectedSignalV2; //Signal Names static const char* const SIGNAL_PINCH_DETECTED; ///< name "pinch-detected" @@ -115,7 +115,7 @@ public: // Signals * * A callback of the following type may be connected: * @code - * void YourCallbackName(Actor actor, PinchGesture gesture); + * void YourCallbackName( Actor actor, const PinchGesture& gesture ); * @endcode * @pre The gesture detector has been initialized. * @return The signal to connect to. diff --git a/dali/public-api/events/tap-gesture-detector.h b/dali/public-api/events/tap-gesture-detector.h index da01f40..cb9af81 100644 --- a/dali/public-api/events/tap-gesture-detector.h +++ b/dali/public-api/events/tap-gesture-detector.h @@ -57,7 +57,7 @@ public: // Typedefs /** * @brief Signal type for detected signal. */ - typedef SignalV2< void (Actor, TapGesture) > DetectedSignalV2; + typedef SignalV2< void ( Actor, const TapGesture& ) > DetectedSignalV2; //Signal Names static const char* const SIGNAL_TAP_DETECTED; ///< name "tap-detected" @@ -167,7 +167,7 @@ public: // Signals * * A callback of the following type may be connected: * @code - * void YourCallbackName(Actor actor, TapGesture gesture); + * void YourCallbackName( Actor actor, const TapGesture& gesture ); * @endcode * @pre The gesture detector has been initialized. * @return The signal to connect to.