CanvasRenderer: Refactoring tvgObject management
[platform/core/uifw/dali-adaptor.git] / dali / internal / canvas-renderer / common / drawable-impl.cpp
index d60e550..3856e06 100644 (file)
@@ -29,149 +29,158 @@ Drawable::Drawable() = default;
 
 Drawable::~Drawable()
 {
-  if(pImpl)
+  if(mImpl)
   {
-    delete pImpl;
+    delete mImpl;
   }
 }
 
 void Drawable::Create()
 {
-  if(!pImpl)
+  if(!mImpl)
   {
-    pImpl = Internal::Adaptor::DrawableFactory::New();
+    mImpl = Internal::Adaptor::DrawableFactory::New();
   }
 }
 
 bool Drawable::SetOpacity(float opacity)
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return false;
   }
-  return pImpl->SetOpacity(opacity);
+  return mImpl->SetOpacity(opacity);
 }
 
 float Drawable::GetOpacity() const
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return 0.0f;
   }
-  return pImpl->GetOpacity();
+  return mImpl->GetOpacity();
 }
 
 bool Drawable::Rotate(Degree degree)
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return false;
   }
-  return pImpl->Rotate(degree);
+  return mImpl->Rotate(degree);
 }
 
 bool Drawable::Scale(float factor)
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return false;
   }
-  return pImpl->Scale(factor);
+  return mImpl->Scale(factor);
 }
 
 bool Drawable::Translate(Vector2 translate)
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return false;
   }
-  return pImpl->Translate(translate);
+  return mImpl->Translate(translate);
 }
 
 bool Drawable::Transform(const Dali::Matrix3& matrix)
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return false;
   }
-  return pImpl->Transform(matrix);
+  return mImpl->Transform(matrix);
 }
 
-void Drawable::SetDrawableAdded(bool added)
+Rect<float> Drawable::GetBoundingBox() const
 {
-  if(!pImpl)
+  if(!mImpl)
+  {
+    return Rect<float>(0, 0, 0, 0);
+  }
+  return mImpl->GetBoundingBox();
+}
+
+void Drawable::SetAdded(bool added)
+{
+  if(!mImpl)
   {
     return;
   }
-  pImpl->SetDrawableAdded(added);
+  mImpl->SetAdded(added);
 }
 
-bool Drawable::IsDrawableAdded()
+bool Drawable::IsAdded() const
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return false;
   }
-  return pImpl->IsDrawableAdded();
+  return mImpl->IsAdded();
 }
 
 void* Drawable::GetObject() const
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return nullptr;
   }
-  return pImpl->GetObject();
+  return mImpl->GetObject();
 }
 
 void Drawable::SetObject(const void* object)
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return;
   }
-  pImpl->SetObject(object);
+  mImpl->SetObject(object);
 }
 
 void Drawable::SetChanged(bool changed)
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return;
   }
-  pImpl->SetChanged(changed);
+  mImpl->SetChanged(changed);
 }
 
 bool Drawable::GetChanged() const
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return false;
   }
-  return pImpl->GetChanged();
+  return mImpl->GetChanged();
 }
 
-void Drawable::SetDrawableType(Drawable::DrawableTypes type)
+void Drawable::SetType(Drawable::Types type)
 {
-  if(!pImpl)
+  if(!mImpl)
   {
     return;
   }
-  pImpl->SetDrawableType(type);
+  mImpl->SetType(type);
 }
 
-Drawable::DrawableTypes Drawable::GetDrawableType() const
+Drawable::Types Drawable::GetType() const
 {
-  if(!pImpl)
+  if(!mImpl)
   {
-    return Drawable::DrawableTypes::NONE;
+    return Drawable::Types::NONE;
   }
-  return pImpl->GetDrawableType();
+  return mImpl->GetType();
 }
 
 Dali::Internal::Adaptor::Drawable* Drawable::GetImplementation()
 {
-  return pImpl;
+  return mImpl;
 }
 
 } // namespace Adaptor