X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fborder%2Fborder-visual.h;h=42ebe6960d62083e4671c8a4d62d21bd7d37120c;hp=3fce5d6434b6241eb8f7f05ca6647e941ea77b1c;hb=HEAD;hpb=c211a7d84885dca19c90b4656055002865e6fce2 diff --git a/dali-toolkit/internal/visuals/border/border-visual.h b/dali-toolkit/internal/visuals/border/border-visual.h index 3fce5d6..42ebe69 100644 --- a/dali-toolkit/internal/visuals/border/border-visual.h +++ b/dali-toolkit/internal/visuals/border/border-visual.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_BORDER_VISUAL_H /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,23 +19,20 @@ */ // EXTERNAL INCLUDES -#include #include +#include // INTERNAL INCLUDES #include namespace Dali { - namespace Toolkit { - namespace Internal { - class BorderVisual; -typedef IntrusivePtr< BorderVisual > BorderVisualPtr; +typedef IntrusivePtr BorderVisualPtr; /** * The visual which renders a solid color to the control's quad border fixed to a specified size. @@ -51,23 +48,22 @@ typedef IntrusivePtr< BorderVisual > BorderVisualPtr; class BorderVisual : public Visual::Base { public: - /** * @brief Create a new border visual. * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object + * @param[in] properties A Property::Map containing settings for this visual * @return A smart-pointer to the newly allocated visual. */ - static BorderVisualPtr New( VisualFactoryCache& factoryCache ); + static BorderVisualPtr New(VisualFactoryCache& factoryCache, const Property::Map& properties); protected: - /** * @brief Constructor. * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object */ - BorderVisual( VisualFactoryCache& factoryCache ); + BorderVisual(VisualFactoryCache& factoryCache); /** * @brief A reference counted object may only be deleted by calling Unreference(). @@ -75,57 +71,36 @@ protected: virtual ~BorderVisual(); /** - * @copydoc Visual::Base::DoInitialize + * @copydoc Visual::Base::OnInitialize */ - virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ); + void OnInitialize() override; /** - * @copydoc Visual::Base::DoSetOnStage + * @copydoc Visual::Base::DoSetProperties */ - virtual void DoSetOnStage( Actor& actor ); + void DoSetProperties(const Property::Map& propertyMap) override; /** - * @copydoc Visual::Base::CreatePropertyMap - */ - virtual void DoCreatePropertyMap( Property::Map& map ) const; - - /** - * @copydoc Visual::Base::DoSetProperty + * @copydoc Visual::Base::DoSetOnScene */ - virtual void DoSetProperty( Dali::Property::Index index, const Dali::Property::Value& propertyValue ); + void DoSetOnScene(Actor& actor) override; /** - * @copydoc Visual::Base::DoGetProperty - */ - virtual Dali::Property::Value DoGetProperty( Dali::Property::Index index ); - -public: - - /** - * Set the color of the border. - * @param[in] color The border color. + * @copydoc Visual::Base::CreatePropertyMap */ - void SetBorderColor( const Vector4& color); + void DoCreatePropertyMap(Property::Map& map) const override; /** - * Set the size of the border. - * @param[in] size The border size. + * @copydoc Visual::Base::CreateInstancePropertyMap */ - void SetBorderSize( float size ); + void DoCreateInstancePropertyMap(Property::Map& map) const override; /** - * Enable/Disable the anti-aliasing. - * @param[in] enable Whether the anti-aliasing be enabled or not. + * @copydoc Visual::Base::OnSetTransform */ - void RequireAntiAliasing( bool antiAliasing ); + void OnSetTransform() override; private: - - /** - * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing. - */ - void InitializeRenderer(); - /** * Request the border shader from the factory cache. If fail, create tha shader and add it to cache. * @return The border shader. @@ -138,14 +113,20 @@ private: */ Geometry CreateBorderGeometry(); + /** + * Helper method to set individual values by index key. + * @param[in] index The index key of the value + * @param[in] value The value + */ + void DoSetProperty(Property::Index index, const Property::Value& value); + // Undefined - BorderVisual( const BorderVisual& borderRenderer ); + BorderVisual(const BorderVisual& borderRenderer); // Undefined - BorderVisual& operator=( const BorderVisual& borderRenderer ); + BorderVisual& operator=(const BorderVisual& borderRenderer); private: - Vector4 mBorderColor; float mBorderSize;