Cleaning up Visual::Base 91/84091/1
authorDavid Steele <david.steele@samsung.com>
Tue, 16 Aug 2016 13:53:06 +0000 (14:53 +0100)
committerDavid Steele <david.steele@samsung.com>
Tue, 16 Aug 2016 13:53:06 +0000 (14:53 +0100)
Change-Id: Iad693ca22062c43a4b2be7a94876d02c68a00116

18 files changed:
dali-toolkit/devel-api/visual-factory/visual-base.cpp
dali-toolkit/internal/visuals/border/border-visual.cpp
dali-toolkit/internal/visuals/border/border-visual.h
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.h
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/gradient/gradient-visual.h
dali-toolkit/internal/visuals/image/batch-image-visual.cpp
dali-toolkit/internal/visuals/image/batch-image-visual.h
dali-toolkit/internal/visuals/mesh/mesh-visual.cpp
dali-toolkit/internal/visuals/mesh/mesh-visual.h
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/primitive/primitive-visual.cpp
dali-toolkit/internal/visuals/primitive/primitive-visual.h
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h

index 0b3193f..072ea6b 100644 (file)
@@ -27,69 +27,66 @@ namespace Dali
 namespace Toolkit
 {
 
-namespace Visual
-{
-
-Base::Base()
+Visual::Base::Base()
 {
 }
 
-Base::~Base()
+Visual::Base::~Base()
 {
 }
 
-Base::Base( const Base& handle )
+Visual::Base::Base( const Visual::Base& handle )
 : BaseHandle( handle )
 {
 }
 
-Base& Base::operator=( const Base& handle )
+Visual::Base& Visual::Base::operator=( const Visual::Base& handle )
 {
   BaseHandle::operator=( handle );
   return *this;
 }
 
-Base::Base(Internal::Visual::Base *impl)
+Visual::Base::Base(Internal::Visual::Base *impl)
 : BaseHandle( impl )
 {
 }
 
-void Base::SetSize( const Vector2& size )
+void Visual::Base::SetSize( const Vector2& size )
 {
   GetImplementation( *this ).SetSize( size );
 }
 
-const Vector2& Base::GetSize() const
+const Vector2& Visual::Base::GetSize() const
 {
   return GetImplementation( *this ).GetSize();
 }
 
-void Base::GetNaturalSize(Vector2& naturalSize ) const
+void Visual::Base::GetNaturalSize(Vector2& naturalSize ) const
 {
   GetImplementation( *this ).GetNaturalSize( naturalSize );
 }
 
-void Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( float index )
 {
   GetImplementation( *this ).SetDepthIndex( index );
 }
 
-float Base::GetDepthIndex() const
+float Visual::Base::GetDepthIndex() const
 {
   return GetImplementation( *this ).GetDepthIndex();
 }
 
-void Base::SetOnStage( Actor& actor )
+void Visual::Base::SetOnStage( Actor& actor )
 {
   GetImplementation( *this ).SetOnStage( actor );
 }
 
-void Base::SetOffStage( Actor& actor )
+void Visual::Base::SetOffStage( Actor& actor )
 {
   GetImplementation( *this ).SetOffStage( actor );
 }
 
-void Base::RemoveAndReset( Actor& actor )
+void Visual::Base::RemoveAndReset( Actor& actor )
 {
   if( actor && *this )
   {
@@ -98,13 +95,11 @@ void Base::RemoveAndReset( Actor& actor )
   Reset();
 }
 
-void Base::CreatePropertyMap( Property::Map& map ) const
+void Visual::Base::CreatePropertyMap( Property::Map& map ) const
 {
   GetImplementation( *this ).CreatePropertyMap( map );
 }
 
-} // namespace Visual
-
 } // namespace Toolkit
 
 } // namespace Dali
index cc00fc7..f5d8053 100644 (file)
@@ -137,13 +137,6 @@ void BorderVisual::DoInitialize( Actor& actor, const Property::Map& propertyMap
   }
 }
 
-void BorderVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
 void BorderVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
index 6973a79..b7ca048 100644 (file)
@@ -61,13 +61,6 @@ public:
    */
   virtual ~BorderVisual();
 
-public:  // from Visual
-
-  /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
 protected:
 
   /**
index 9f0dc4e..572220b 100644 (file)
@@ -91,18 +91,6 @@ void ColorVisual::SetSize( const Vector2& size )
   // ToDo: renderer responds to the size change
 }
 
-void ColorVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
-void ColorVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 void ColorVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
index f458152..9367ffa 100644 (file)
@@ -63,16 +63,6 @@ public:  // from Visual
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index 22f9026..1588b83 100644 (file)
@@ -229,18 +229,6 @@ void GradientVisual::SetSize( const Vector2& size )
   Visual::Base::SetSize( size );
 }
 
-void GradientVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
-void GradientVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 void GradientVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
index be191be..9f2cad4 100644 (file)
@@ -99,16 +99,6 @@ public:  // from Visual
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index 5e24418..30eeeda 100644 (file)
@@ -168,11 +168,6 @@ void BatchImageVisual::GetNaturalSize( Vector2& naturalSize ) const
   naturalSize = Vector2::ZERO;
 }
 
-void BatchImageVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-}
-
 void BatchImageVisual::InitializeRenderer( const std::string& imageUrl )
 {
   if( imageUrl.empty() )
index 71f85f9..646dad7 100644 (file)
@@ -61,11 +61,6 @@ public:  // from Visual
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::Base::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
    * @copydoc Visual::Base::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index 597de7b..2c56eae 100644 (file)
@@ -369,18 +369,6 @@ void MeshVisual::SetSize( const Vector2& size )
   // ToDo: renderer responds to the size change
 }
 
-void MeshVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
-void MeshVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 void MeshVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
index b801ce8..67e1fe1 100644 (file)
@@ -75,16 +75,6 @@ public:  // from Visual
   virtual void SetSize( const Vector2& size );
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index 7ef3a6e..5dc9e04 100644 (file)
@@ -254,17 +254,6 @@ void NPatchVisual::GetNaturalSize( Vector2& naturalSize ) const
   }
 }
 
-void NPatchVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-  //ToDo: renderer responds to the clipRect change
-}
-
-void NPatchVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 Geometry NPatchVisual::CreateGeometry()
 {
   Geometry geometry;
index d8ad11c..498bcc2 100644 (file)
@@ -73,16 +73,6 @@ public:  // from Visual
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index 6a02087..1955db5 100644 (file)
@@ -367,18 +367,6 @@ void PrimitiveVisual::GetNaturalSize( Vector2& naturalSize ) const
   naturalSize.y = mObjectDimensions.y;
 }
 
-void PrimitiveVisual::SetClipRect( const Rect<int>& clipRect )
-{
-  Visual::Base::SetClipRect( clipRect );
-
-  //ToDo: renderer responds to the clipRect change
-}
-
-void PrimitiveVisual::SetOffset( const Vector2& offset )
-{
-  //ToDo: renderer applies the offset
-}
-
 void PrimitiveVisual::DoSetOnStage( Actor& actor )
 {
   InitializeRenderer();
index 01b5885..45b536b 100644 (file)
@@ -121,16 +121,6 @@ public:  // from Visual
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * @copydoc Visual::SetClipRect
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   * @copydoc Visual::SetOffset
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Visual::CreatePropertyMap
    */
   virtual void DoCreatePropertyMap( Property::Map& map ) const;
index fb8ae32..524057e 100644 (file)
@@ -65,7 +65,6 @@ struct Base::Impl
   CustomShader* mCustomShader;
 
   Vector2   mSize;
-  Vector2   mOffset;
   float     mDepthIndex;
   int       mFlags;
 
index 9d0c964..58e4d38 100644 (file)
@@ -36,21 +36,18 @@ namespace Toolkit
 namespace Internal
 {
 
-namespace Visual
-{
-
-Base::Base( VisualFactoryCache& factoryCache )
+Visual::Base::Base( VisualFactoryCache& factoryCache )
 : mImpl( new Impl() ),
   mFactoryCache( factoryCache )
 {
 }
 
-Base::~Base()
+Visual::Base::~Base()
 {
   delete mImpl;
 }
 
-void Base::SetCustomShader( const Property::Map& shaderMap )
+void Visual::Base::SetCustomShader( const Property::Map& shaderMap )
 {
   if( mImpl->mCustomShader )
   {
@@ -62,7 +59,7 @@ void Base::SetCustomShader( const Property::Map& shaderMap )
   }
 }
 
-void Base::Initialize( Actor& actor, const Property::Map& propertyMap )
+void Visual::Base::Initialize( Actor& actor, const Property::Map& propertyMap )
 {
   Property::Value* customShaderValue = propertyMap.Find( Toolkit::Visual::Property::SHADER, CUSTOM_SHADER );
   if( customShaderValue )
@@ -77,31 +74,22 @@ void Base::Initialize( Actor& actor, const Property::Map& propertyMap )
   DoInitialize( actor, propertyMap );
 }
 
-void Base::SetSize( const Vector2& size )
+void Visual::Base::SetSize( const Vector2& size )
 {
   mImpl->mSize = size;
 }
 
-const Vector2& Base::GetSize() const
+const Vector2& Visual::Base::GetSize() const
 {
   return mImpl->mSize;
 }
 
-void Base::GetNaturalSize( Vector2& naturalSize ) const
+void Visual::Base::GetNaturalSize( Vector2& naturalSize ) const
 {
   naturalSize = Vector2::ZERO;
 }
 
-void Base::SetClipRect( const Rect<int>& clipRect )
-{
-}
-
-void Base::SetOffset( const Vector2& offset )
-{
-  mImpl->mOffset = offset;
-}
-
-void Base::SetDepthIndex( float index )
+void Visual::Base::SetDepthIndex( float index )
 {
   mImpl->mDepthIndex = index;
   if( mImpl->mRenderer )
@@ -110,12 +98,12 @@ void Base::SetDepthIndex( float index )
   }
 }
 
-float Base::GetDepthIndex() const
+float Visual::Base::GetDepthIndex() const
 {
   return mImpl->mDepthIndex;
 }
 
-void Base::SetOnStage( Actor& actor )
+void Visual::Base::SetOnStage( Actor& actor )
 {
   DoSetOnStage( actor );
 
@@ -126,7 +114,7 @@ void Base::SetOnStage( Actor& actor )
   mImpl->mFlags |= Impl::IS_ON_STAGE;
 }
 
-void Base::SetOffStage( Actor& actor )
+void Visual::Base::SetOffStage( Actor& actor )
 {
   if( GetIsOnStage() )
   {
@@ -136,7 +124,7 @@ void Base::SetOffStage( Actor& actor )
   }
 }
 
-void Base::EnablePreMultipliedAlpha( bool preMultipled )
+void Visual::Base::EnablePreMultipliedAlpha( bool preMultipled )
 {
   if(preMultipled)
   {
@@ -153,22 +141,22 @@ void Base::EnablePreMultipliedAlpha( bool preMultipled )
   }
 }
 
-bool Base::IsPreMultipliedAlphaEnabled() const
+bool Visual::Base::IsPreMultipliedAlphaEnabled() const
 {
   return mImpl->mFlags & Impl::IS_PREMULTIPLIED_ALPHA;
 }
 
-void Base::DoSetOnStage( Actor& actor )
+void Visual::Base::DoSetOnStage( Actor& actor )
 {
 }
 
-void Base::DoSetOffStage( Actor& actor )
+void Visual::Base::DoSetOffStage( Actor& actor )
 {
   actor.RemoveRenderer( mImpl->mRenderer );
   mImpl->mRenderer.Reset();
 }
 
-void Base::CreatePropertyMap( Property::Map& map ) const
+void Visual::Base::CreatePropertyMap( Property::Map& map ) const
 {
   DoCreatePropertyMap( map );
 
@@ -178,18 +166,16 @@ void Base::CreatePropertyMap( Property::Map& map ) const
   }
 }
 
-bool Base::GetIsOnStage() const
+bool Visual::Base::GetIsOnStage() const
 {
   return mImpl->mFlags & Impl::IS_ON_STAGE;
 }
 
-bool Base::GetIsFromCache() const
+bool Visual::Base::GetIsFromCache() const
 {
   return mImpl->mFlags & Impl::IS_FROM_CACHE;
 }
 
-} // namespace Visual
-
 } // namespace Internal
 
 } // namespace Toolkit
index da15492..8068dd8 100644 (file)
@@ -90,25 +90,6 @@ public:
   virtual void GetNaturalSize( Vector2& naturalSize ) const;
 
   /**
-   * ToDo: Add this function to Toolkit::Visual when it is fully implemented.
-   *
-   * Set the clip rectangular of this visual.
-   * The contents of the visual will not be visible outside this rectangular.
-   *
-   * @param [in] clipRect The clipping rectangular.
-   */
-  virtual void SetClipRect( const Rect<int>& clipRect );
-
-  /**
-   *ToDo: Add this function to Toolkit::Visual when it is fully implemented.
-   *
-   * Reposition this visual with a 2D offset.
-   *
-   * @param[in] offset The offset to reposition the visual.
-   */
-  virtual void SetOffset( const Vector2& offset );
-
-  /**
    * @copydoc Toolkit::Visual::Base::SetDepthIndex
    */
   void SetDepthIndex( float index );