From a62dc57b01b08ebcfd0aed24afc8f156fbe7c619 Mon Sep 17 00:00:00 2001 From: suhyung Eom Date: Thu, 10 Nov 2016 16:51:50 +0900 Subject: [PATCH] Apply deprecate macro and LOG Signed-off-by: suhyung Eom Change-Id: If9e0583d52cab9a036da0a93dd924c8a02bec999 --- dali/integration-api/debug.h | 2 ++ dali/internal/event/actors/actor-impl.cpp | 1 - dali/public-api/actors/actor.cpp | 6 ++++++ dali/public-api/actors/actor.h | 6 +++--- dali/public-api/actors/custom-actor-impl.h | 2 +- dali/public-api/common/dali-common.h | 6 ++++++ dali/public-api/common/stage.cpp | 2 ++ dali/public-api/common/stage.h | 2 +- dali/public-api/events/touch-event.cpp | 10 ++++++++++ dali/public-api/events/touch-event.h | 10 +++++----- dali/public-api/object/property-map.cpp | 7 +++++++ dali/public-api/object/property-map.h | 6 +++--- 12 files changed, 46 insertions(+), 14 deletions(-) diff --git a/dali/integration-api/debug.h b/dali/integration-api/debug.h index 8b17e38..828aa3a 100644 --- a/dali/integration-api/debug.h +++ b/dali/integration-api/debug.h @@ -90,6 +90,8 @@ DALI_IMPORT_API void UninstallLogFunction(); #define DALI_LOG_ERROR_NOFN(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugError, format, ## args) +#define DALI_LOG_WARNING_NOFN(format, args...) Dali::Integration::Log::LogMessage(Dali::Integration::Log::DebugWarning, format, ## args) + /** * Provides unfiltered logging for fps monitor */ diff --git a/dali/internal/event/actors/actor-impl.cpp b/dali/internal/event/actors/actor-impl.cpp index 753bf7a..ccbf532 100644 --- a/dali/internal/event/actors/actor-impl.cpp +++ b/dali/internal/event/actors/actor-impl.cpp @@ -1883,7 +1883,6 @@ bool Actor::EmitWheelEventSignal( const WheelEvent& event ) Dali::Actor::TouchSignalType& Actor::TouchedSignal() { - DALI_LOG_WARNING( "Deprecated: Use TouchSignal() instead\n" ); return mTouchedSignal; } diff --git a/dali/public-api/actors/actor.cpp b/dali/public-api/actors/actor.cpp index 25628ee..b96283f 100644 --- a/dali/public-api/actors/actor.cpp +++ b/dali/public-api/actors/actor.cpp @@ -247,11 +247,15 @@ Vector3 Actor::GetCurrentWorldPosition() const void Actor::SetPositionInheritanceMode( PositionInheritanceMode mode ) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetPositionInheritanceMode() is deprecated and will be removed from next release. Use SetInheritPosition() instead.\n" ); + GetImplementation(*this).SetPositionInheritanceMode( mode ); } PositionInheritanceMode Actor::GetPositionInheritanceMode() const { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetPositionInheritanceMode() is deprecated and will be removed from next release. Use IsPositionInherited() instead.\n" ); + return GetImplementation(*this).GetPositionInheritanceMode(); } @@ -536,6 +540,8 @@ int Actor::GetHierarchyDepth() Actor::TouchSignalType& Actor::TouchedSignal() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchedSignal() is deprecated and will be removed from next release. Use TouchSignal() instead.\n" ); + return GetImplementation(*this).TouchedSignal(); } diff --git a/dali/public-api/actors/actor.h b/dali/public-api/actors/actor.h index 7f4b1ad..b36b899 100644 --- a/dali/public-api/actors/actor.h +++ b/dali/public-api/actors/actor.h @@ -771,7 +771,7 @@ public: * @pre The Actor has been initialized. * @see PositionInheritanceMode */ - void SetPositionInheritanceMode( PositionInheritanceMode mode ); + void SetPositionInheritanceMode( PositionInheritanceMode mode ) DALI_DEPRECATED_API; /** * @brief Set whether a child actor inherits it's parent's position. @@ -795,7 +795,7 @@ public: * @return Return the position inheritance mode. * @pre The Actor has been initialized. */ - PositionInheritanceMode GetPositionInheritanceMode() const; + PositionInheritanceMode GetPositionInheritanceMode() const DALI_DEPRECATED_API; /** * @brief Returns whether the actor inherits its parent's position. @@ -1448,7 +1448,7 @@ public: // Signals * @return The signal to connect to. * @pre The Actor has been initialized. */ - TouchSignalType& TouchedSignal(); + TouchSignalType& TouchedSignal() DALI_DEPRECATED_API; /** * @brief This signal is emitted when touch input is received. diff --git a/dali/public-api/actors/custom-actor-impl.h b/dali/public-api/actors/custom-actor-impl.h index fadf9b5..b447244 100644 --- a/dali/public-api/actors/custom-actor-impl.h +++ b/dali/public-api/actors/custom-actor-impl.h @@ -174,7 +174,7 @@ public: * @return True if the event should be consumed. * @note CustomActorImpl::REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ). */ - virtual bool OnTouchEvent(const TouchEvent& event) = 0; + virtual bool OnTouchEvent(const TouchEvent& event) DALI_DEPRECATED_API = 0; /** * @brief Called after a hover-event is received by the owning actor. diff --git a/dali/public-api/common/dali-common.h b/dali/public-api/common/dali-common.h index 8879ce0..c49d4ca 100644 --- a/dali/public-api/common/dali-common.h +++ b/dali/public-api/common/dali-common.h @@ -53,6 +53,12 @@ # define DALI_INTERNAL #endif +#ifdef DEPRECATION_WARNING +#define DALI_DEPRECATED_API __attribute__((__visibility__("default"), deprecated)) +#else +#define DALI_DEPRECATED_API +#endif + #if defined (__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L) // C++0x support #define _CPP11 diff --git a/dali/public-api/common/stage.cpp b/dali/public-api/common/stage.cpp index 3d809a0..13825ff 100644 --- a/dali/public-api/common/stage.cpp +++ b/dali/public-api/common/stage.cpp @@ -146,6 +146,8 @@ Stage::EventProcessingFinishedSignalType& Stage::EventProcessingFinishedSignal() Stage::TouchedSignalType& Stage::TouchedSignal() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchedSignal() is deprecated and will be removed from next release. Use TouchSignal() instead.\n" ); + return GetImplementation(*this).TouchedSignal(); } diff --git a/dali/public-api/common/stage.h b/dali/public-api/common/stage.h index 06d4416..61bdfda 100644 --- a/dali/public-api/common/stage.h +++ b/dali/public-api/common/stage.h @@ -285,7 +285,7 @@ public: * @return The touch signal to connect to. * @note Motion events are not emitted. */ - TouchedSignalType& TouchedSignal(); + TouchedSignalType& TouchedSignal() DALI_DEPRECATED_API; /** * @brief This signal is emitted when the screen is touched and when the touch ends diff --git a/dali/public-api/events/touch-event.cpp b/dali/public-api/events/touch-event.cpp index 8090d74..acb8496 100644 --- a/dali/public-api/events/touch-event.cpp +++ b/dali/public-api/events/touch-event.cpp @@ -18,6 +18,9 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include @@ -27,24 +30,31 @@ namespace Dali TouchEvent::TouchEvent() : time(0) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchEvent() is deprecated and will be removed from next release. Use TouchData instead.\n" ); } TouchEvent::TouchEvent(unsigned long time) : time(time) { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: TouchEvent() is deprecated and will be removed from next release. Use TouchData instead.\n" ); } TouchEvent::~TouchEvent() { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: ~TouchEvent() is deprecated and will be removed from next release. Use TouchData instead.\n" ); } unsigned int TouchEvent::GetPointCount() const { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetPointCount() is deprecated and will be removed from next release. Use TouchData instead.\n" ); + return points.size(); } const TouchPoint& TouchEvent::GetPoint(unsigned int point) const { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetPoint() is deprecated and will be removed from next release. Use TouchData instead.\n" ); + DALI_ASSERT_ALWAYS( point < points.size() && "No point at index" ); return points[point]; } diff --git a/dali/public-api/events/touch-event.h b/dali/public-api/events/touch-event.h index 92b6988..45d6498 100644 --- a/dali/public-api/events/touch-event.h +++ b/dali/public-api/events/touch-event.h @@ -47,7 +47,7 @@ struct DALI_IMPORT_API TouchEvent * @brief Default constructor * @SINCE_1_0.0 */ - TouchEvent(); + TouchEvent() DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.37 @@ -55,14 +55,14 @@ struct DALI_IMPORT_API TouchEvent * @SINCE_1_0.0 * @param[in] time The time the event occurred */ - TouchEvent(unsigned long time); + TouchEvent(unsigned long time) DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.37 * @brief Destructor * @SINCE_1_0.0 */ - ~TouchEvent(); + ~TouchEvent() DALI_DEPRECATED_API; // Data @@ -90,7 +90,7 @@ struct DALI_IMPORT_API TouchEvent * @SINCE_1_0.0 * @return Total number of Points. */ - unsigned int GetPointCount() const; + unsigned int GetPointCount() const DALI_DEPRECATED_API; /** * @DEPRECATED_1_1.37 @@ -104,7 +104,7 @@ struct DALI_IMPORT_API TouchEvent * @note "point" should be less than the value returned by GetPointCount(). * If out of range, then program asserts. */ - const TouchPoint& GetPoint(unsigned int point) const; + const TouchPoint& GetPoint(unsigned int point) const DALI_DEPRECATED_API; }; /** diff --git a/dali/public-api/object/property-map.cpp b/dali/public-api/object/property-map.cpp index f6d7775..2c2732d 100644 --- a/dali/public-api/object/property-map.cpp +++ b/dali/public-api/object/property-map.cpp @@ -18,6 +18,9 @@ // CLASS HEADER #include +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include @@ -90,6 +93,8 @@ Property::Value& Property::Map::GetValue( SizeType position ) const const std::string& Property::Map::GetKey( SizeType position ) const { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetKey() is deprecated and will be removed from next release.\n" ); + DALI_ASSERT_ALWAYS( position < mImpl->mStringValueContainer.size() && "position out-of-bounds" ); return mImpl->mStringValueContainer[ position ].first; @@ -97,6 +102,8 @@ const std::string& Property::Map::GetKey( SizeType position ) const StringValuePair& Property::Map::GetPair( SizeType position ) const { + DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetPair() is deprecated and will be removed from next release.\n" ); + DALI_ASSERT_ALWAYS( position < mImpl->mStringValueContainer.size() && "position out-of-bounds" ); return mImpl->mStringValueContainer[ position ]; diff --git a/dali/public-api/object/property-map.h b/dali/public-api/object/property-map.h index 41b807b..43029b1 100644 --- a/dali/public-api/object/property-map.h +++ b/dali/public-api/object/property-map.h @@ -135,7 +135,7 @@ public: * * @note Will assert if position >= Count() */ - const std::string& GetKey( SizeType position ) const; + const std::string& GetKey( SizeType position ) const DALI_DEPRECATED_API; /** * DEPRECATED_1_1.39 Position based retrieval is no longer supported after extending the key type to both Index and String. @@ -146,9 +146,9 @@ public: * @param[in] position The specified position * @return A reference to the pair of key and value at the specified position. * - * @note Will assert if position >= Count() + * @note Will assert if position >= Count() or key at position is an index key. */ - StringValuePair& GetPair( SizeType position ) const; + StringValuePair& GetPair( SizeType position ) const DALI_DEPRECATED_API; /** * @brief Finds the value for the specified key if it exists. -- 2.7.4