break;
case PRINT_CONTROL_EVAS:
+#ifdef ENABLE_VE_EFL
_VeDebug::DumpEvasTree(pVisualElementImpl, 0);
+#endif
break;
case PRINT_CONTROL_VE_EVAS:
_VeDebug::DumpVeTree(pVisualElementImpl, 0);
+#ifdef ENABLE_VE_EFL
_VeDebug::DumpEvasTree(pVisualElementImpl, 0);
+#endif
break;
default:
}
_NativeLayer* pLayer = pRootVE->GetNativeLayer();
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
-
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
+ _EflLayer* pEflLayer = static_cast<_EflLayer*>(pLayer);
Ecore_Evas* pEcoreEvas = pEflLayer->GetEcoreEvas();
Ecore_X_Window win = (Ecore_X_Window) ecore_evas_window_get(pEcoreEvas);
SceneVisualElement::~SceneVisualElement(void)
{
- _pSceneVisualElementImpl->Destroy();
- _pSceneVisualElementImpl = null;
+
}
result
return;
}
-
+#ifdef ENABLE_VE_EFL
void
_VeDebug::DumpEvasTree(_VisualElementImpl* pElement, int indent)
{
-#ifdef ENABLE_VE_EFL
if (!pElement)
{
- _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
- if (pDisplayManager != null && pDisplayManager->GetLayer(0))
- {
- pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetLayer(0)->GetRootVisualElement());
- }
+ return;
}
bool prevDebugEnabled = IsDebugEnabled();
}
SetDebugEnabled(prevDebugEnabled);
-#endif
+
return;
}
-
-#ifdef ENABLE_VE_EFL
void
_VeDebug::DumpEvasTreeI(Evas_Object* pParent, int indent)
{
SetDebugEnabled(prevDebugEnabled);
}
+#ifdef ENABLE_VE_EFL
void
_VeDebug::DumpEvasTreeGraph(const char* pFilePath, VisualElement* pVisualElement)
{
-#ifdef VE_EFL
_VisualElementImpl* pElement = null;
if (!pVisualElement)
{
- _DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
- if (pDisplayManager != null && pDisplayManager->GetRoot(0))
- {
- pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetRoot(0));
- }
- }
- else
- {
- pElement = _VisualElementImpl::GetInstance(*pVisualElement);
- }
-
- if (!pElement)
- {
return;
}
fprintf(pFile, "}\n\n");
fclose(pFile);
-#endif
+
}
-#ifdef ENABLE_VE_EFL
void
_VeDebug::DumpAllEvas(Evas* pEvas)
{
VeLog(NID_UI_ANIM, "--------------------------[EVAS ALL DUMP IMAGE END]-----------------------------");
}
-
#endif
void
Tizen::Base::String name = pElement->GetName();
if (name.GetLength() > 0)
{
-#ifdef VE_EFL
- snprintf(filename, FILEN_NAME_LEN, "%sVE_%d_%ls_%08x.png", pathPrefix, count++, pElement->GetName().GetPointer(), (unsigned int)pElement->GetPresentationClone());
-#else
snprintf(filename, FILEN_NAME_LEN, "%sVE_%d_%ls_%08x.png", pathPrefix, count++, pElement->GetName().GetPointer(), (unsigned int)pElement->GetRenderObject());
-#endif
}
else
{
-#ifdef VE_EFL
- snprintf(filename, FILEN_NAME_LEN, "%sVE_%d_%08x.png", pathPrefix, count++, (unsigned int)pElement->GetPresentationClone());
-#else
snprintf(filename, FILEN_NAME_LEN, "%sVE_%d_%08x.png", pathPrefix, count++, (unsigned int)pElement->GetRenderObject());
-#endif
}
VisualElementSurface* pSurface = pElement->__pSharedData->pNativeNode->GetSurface();
for (int i = 0; i < pDisplayManager->GetLayerCount(); i++)
{
Tizen::Ui::Animations::_VisualElementImpl* pVisualElementImpl = const_cast<Tizen::Ui::Animations::_VisualElementImpl*>(Tizen::Ui::Animations::_VisualElementImpl::GetInstance(*pDisplayManager->GetLayer(i)->GetRootVisualElement()->AcquirePresentationInstance()));
-#ifndef VE_EFL
+
pVisualElementImpl = pVisualElementImpl->GetRenderObject();
-#endif
+
if (pVisualElementImpl)
{
Tizen::Ui::Animations::_VeDebug::DumpVeLayout(pVisualElementImpl, 0, pFile);
extern "C" _OSP_EXPORT_ void
DumpEvasTree(void)
{
+#ifdef ENABLE_VE_EFL
Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
for (int i = 0; i < pDisplayManager->GetLayerCount(); i++)
{
- Tizen::Ui::Animations::_VisualElementImpl* pVisualElementImpl = Tizen::Ui::Animations::_VisualElementImpl::GetInstance(*pDisplayManager->GetLayer(i)->GetRootVisualElement());
- if (pVisualElementImpl)
+ Tizen::Ui::Animations::_NativeLayer* pLayer = pDisplayManager->GetLayer(i);
+ if (pLayer->GetLayerType() == Tizen::Ui::Animations::_LAYER_TYPE_EFL)
{
- Tizen::Ui::Animations::_VeDebug::DumpEvasTree(pVisualElementImpl, 0);
+ Tizen::Ui::Animations::_VisualElementImpl* pVisualElementImpl = Tizen::Ui::Animations::_VisualElementImpl::GetInstance(*pLayer->GetRootVisualElement());
+ if (pVisualElementImpl)
+ {
+ Tizen::Ui::Animations::_VeDebug::DumpEvasTree(pVisualElementImpl, 0);
+ }
}
}
+#endif
}
extern "C" _OSP_EXPORT_ void
extern "C" _OSP_EXPORT_ void
DumpAllEvas(void)
{
-#ifdef VE_EFL
+#ifdef ENABLE_VE_EFL
Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
for (int i = 0; i < pDisplayManager->GetLayerCount(); i++)
extern "C" _OSP_EXPORT_ void
DumpEvasTreeGraph(void)
{
+#ifdef ENABLE_VE_EFL
Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance();
for (int i = 0; i < pDisplayManager->GetLayerCount(); i++)
{
- char filePath[256];
- snprintf(filePath, sizeof(filePath), "/tmp/graph_%d.dot", i);
- Tizen::Ui::Animations::_VeDebug::DumpEvasTreeGraph(filePath, pDisplayManager->GetLayer(i)->GetRootVisualElement());
+ Tizen::Ui::Animations::_NativeLayer* pLayer = pDisplayManager->GetLayer(i);
+ if (pLayer->GetLayerType() == Tizen::Ui::Animations::_LAYER_TYPE_EFL)
+ {
+ char filePath[256];
+ snprintf(filePath, sizeof(filePath), "/tmp/graph_%d.dot", i);
+
+ Tizen::Ui::Animations::_VeDebug::DumpEvasTreeGraph(filePath, pLayer->GetRootVisualElement());
+ }
}
+#endif
}
#ifdef __i386__
static void SetDebugEnabled(bool enable);
static bool IsDebugEnabled(void);
- static void DumpEvasTree(_VisualElementImpl* pElement, int indent);
#ifdef ENABLE_VE_EFL
+ static void DumpEvasTree(_VisualElementImpl* pElement, int indent);
static void DumpAllEvas(Evas* pEvas);
static void DumpAllEvasImages(Evas* pEvas);
-#endif
-
-#ifdef ENABLE_VE_EFL
static void DumpEvasObjectForGraphI(FILE* pFile, Evas_Object* pEvasObject, int depth, int pos);
static void DumpEvasTreeGraphI(FILE* pFile, Evas_Object* pObject, int depth, int pos);
+ static void DumpEvasTreeGraph(const char* pFilePath, VisualElement* pVisualElement);
#endif
static void DumpVeObjectForGraphI(FILE* pFile, _VisualElementImpl* pVisualElementImpl, int depth, int pos);
static void DumpVeTreeGraphI(FILE* pFile, _VisualElementImpl* pVisualElementImpl, int depth, int pos);
- static void DumpEvasTreeGraph(const char* pFilePath, VisualElement* pVisualElement);
-
private:
_VeDebug(void);
if (likely(pLayer))
{
#ifdef ENABLE_VE_EFL
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
continue;
}
if (likely(pLayer))
{
#ifdef ENABLE_VE_EFL
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
continue;
}
if(pLayer)
{
#ifdef ENABLE_VE_EFL
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
continue;
}
if (likely(pLayer))
{
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
- if(pEflLayer->Render())
- pDisplayManager->PostRender(*pEflLayer, true);
+ if(pLayer->Render())
+ pDisplayManager->PostRender(*pLayer, true);
- pEflLayer->Flush();
+ pLayer->Flush();
}
}
}
if (pNode)
{
_pRootVisualElement = &rootElement;
- return pNode->ReConstruct(*this);
+ return pNode->Construct(*this);
}
return E_SYSTEM;
_EflNode::~_EflNode(void)
{
- Destruct();
-}
+ __pEvas = null;
+ if (__pSmartObject)
+ {
+ evas_object_del(__pSmartObject);
+ __pSmartObject = null;
+ }
-result
-_EflNode::Construct(void)
-{
- return E_SUCCESS;
+ if (__pClipObject)
+ {
+ evas_object_del(__pClipObject);
+ __pClipObject = null;
+ }
+
+ if (__pRectangleObject)
+ {
+ evas_object_del(__pRectangleObject);
+ __pRectangleObject = null;
+ }
+
+ if (__pMap)
+ {
+ evas_map_free(__pMap);
+ __pMap = null;
+ }
+
+ if (__pSurface)
+ {
+ delete __pSurface;
+ __pSurface = null;
+ }
+
+ if (__pSharedSurface)
+ {
+ delete __pSharedSurface;
+ __pSharedSurface = null;
+ }
+
+ if (__pImageHolder)
+ {
+ evas_object_del(__pImageHolder);
+ }
+
+ if (unlikely(__pNativeSmartObject))
+ {
+ evas_object_smart_member_del(__pNativeSmartObject);
+ //__pNativeSmartObject = null;
+ }
}
result
-_EflNode::RebuildIfNeeded(const _INativeNode& parent)
+_EflNode::Construct(const _INativeNode& parent)
{
_EflNode* pParent = dynamic_cast<_EflNode*>(const_cast<_INativeNode*>(&parent));
if (!pParent)
{
- return E_INVALID_ARG;
+ return E_INVALID_ARG; //need?
}
+
if (pParent->__pLayer)
{
- return ReConstruct(*pParent->__pLayer);
+ return Construct(*pParent->__pLayer);
}
+
return E_INVALID_STATE;
-// __pLayer = pParent->pLayer;
- //return ReConstruct(pParent->__pEvas);
}
result
-_EflNode::ReConstruct(const _NativeLayer& layer)
+_EflNode::Construct(const _NativeLayer& layer)
{
if (__pLayer == &layer)
{
return E_INVALID_ARG;
}
__pLayer = pLayer;
- return ReConstruct(pLayer->GetEvas());
-}
-result
-_EflNode::ReConstruct(const Evas* pEvas)
-{
- if (pEvas == null)
+ if (pLayer->GetEvas() == null)
{
return E_INVALID_ARG;
}
- Destruct();
-
- __pEvas = const_cast<Evas*>(pEvas);
-
+ __pEvas = const_cast<Evas*>(pLayer->GetEvas());
if (!__pStaticSmartClass)
{
evas_object_show(__pSmartObject);
-// __pClipObject = evas_object_rectangle_add(pEvas);
-// if (!__pClipObject)
-// goto failure;
-//
-//
-// evas_object_smart_member_add(__pClipObject,__pSmartObject);
-// evas_object_lower(__pClipObject);
-//
-// evas_object_pass_events_set(__pClipObject, EINA_TRUE);
-
// Create map for 3D
if (__pMap)
{
__pSmartObject = null;
-// if (__pClipObject)
-// evas_object_del(__pClipObject);
-//
-// __pClipObject = null;
-
if (__pMap)
{
evas_map_free(__pMap);
return E_SYSTEM;
}
-result
-_EflNode::Destruct(void)
-{
- __pEvas = null;
- if (__pSmartObject)
- {
- evas_object_del(__pSmartObject);
- __pSmartObject = null;
- }
-
- if (__pClipObject)
- {
- evas_object_del(__pClipObject);
- __pClipObject = null;
- }
-
- if (__pRectangleObject)
- {
- evas_object_del(__pRectangleObject);
- __pRectangleObject = null;
- }
-
- if (__pMap)
- {
- evas_map_free(__pMap);
- __pMap = null;
- }
-
- if (__pSurface)
- {
- delete __pSurface;
- __pSurface = null;
- }
-
- if (__pSharedSurface)
- {
- delete __pSharedSurface;
- __pSharedSurface = null;
- }
-
- if (__pImageHolder)
- {
- evas_object_del(__pImageHolder);
- }
-
- if (unlikely(__pNativeSmartObject))
- {
- evas_object_smart_member_del(__pNativeSmartObject);
- //__pNativeSmartObject = null;
- }
-
- return E_SUCCESS;
-}
-
Evas*
_EflNode::GetEvas(void) const
{
result
_GlLayer::Configure(_RootVisualElement& rootElement)
{
+ //_VisualElementImpl* pImpl = _VisualElementImpl::GetInstance(rootElement);
+ //if(!pImpl)
+ // return E_SYSTEM;
- _VisualElementImpl* pImpl = _VisualElementImpl::GetInstance(rootElement);
- if(!pImpl)
- return E_SYSTEM;
+ //_GlNode* pNode = dynamic_cast<_GlNode*>(pImpl->GetNativeNode());
+ //if (pNode)
+ //{
+ // __pRootVisualElement = &rootElement;
- _GlNode* pNode = dynamic_cast<_GlNode*>(pImpl->GetNativeNode());
- if (pNode)
- {
- __pRootVisualElement = &rootElement;
-
- return pNode->ReConstruct(*this);
- }
+ // return pNode->ReConstruct(*this);
+ //}
- return E_SYSTEM;
+ return E_SUCCESS;
}
result
_GlNode::~_GlNode(void)
{
- Destruct();
- __activeLight.RemoveAll();
-}
-
-result
-_GlNode::Construct(void)
-{
- return E_SUCCESS;
-}
-
-result
-_GlNode::ReConstruct(const _NativeLayer& layer)
-{
- return E_SUCCESS;
-}
-
-result
-_GlNode::RebuildIfNeeded(const _INativeNode& parent)
-{
- return E_SUCCESS;
-}
-
-result
-_GlNode::Destruct(void)
-{
if (__pSurface && _VisualElementSurfaceImpl::GetInstance(*__pSurface))
{
delete __pSurface;
__pMaterial = null;
}
+ __activeLight.RemoveAll();
+}
+
+result
+_GlNode::Construct(const _INativeNode& parent)
+{
return E_SUCCESS;
}
_GlNode(void);
virtual ~_GlNode(void);
- virtual result Construct(void);
- virtual result RebuildIfNeeded(const _INativeNode& parent);
-
- result ReConstruct(const _NativeLayer& layer);
+ virtual result Construct(const _INativeNode& parent);
public:
virtual result InsertChild(_INativeNode& child, const _INativeNode* pReference, bool above);
virtual result Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& element, bool surfaceOnly);
virtual VisualElementSurface* GetSurface(void) const;
- _Colorf GetBackgroundColor(void) const;
- result SetBackgroundColor(const _Colorf& backgroundColor);
+ virtual _Colorf GetBackgroundColor(void) const;
+ virtual result SetBackgroundColor(const _Colorf& backgroundColor);
result Capture(Tizen::Graphics::Canvas& destination, const Tizen::Graphics::Point& destPosition, const Tizen::Graphics::Rectangle& bounds);
result SyncStatus(VisualElementSurface* pSurface, _VisualElementImpl& element);
private:
- result Destruct(void);
-
-private:
_GlNode(const _GlNode& rhs); // no impl.
_GlNode& operator =(const _GlNode& rhs); // no impl.
, __needFlush(false)
// , __needUpdateRenderObjects(false)
// , __didSyncPresentation(false)
+ , __type(_LAYER_TYPE_GL)
{
static unsigned long idCount = 0;
__id = idCount++;
result
_NativeLayer::Construct(_NativeWindow* pNativeWindow)
{
-
result r = E_SUCCESS;
if (pNativeWindow)
{
_pWindow = pNativeWindow;
}
+ else
+ {
+ __type = _LAYER_TYPE_EFL;
+ }
SysAssertf(_pRootVisualElement == null, "Already constructed! Calling Construct() twice or more on a same instance is not allowed for this class.");
- _pRootVisualElement = new SceneVisualElement();
+ r = OnConstructed();
+ SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Constructing failed.");
+
+ _pRootVisualElement = new SceneVisualElement();
if (_pRootVisualElement)
{
DisplayContext* pDisplayContext = GetDisplayContext();
_DisplayManager* pDisplayManager = _DisplayManager::GetInstance();
- r = OnConstructed();
- SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Constructing failed.");
-
if (pDisplayManager)
{
pDisplayManager->RegisterLayer(*this);
return __id;
}
+_LayerType
+_NativeLayer::GetLayerType(void) const
+{
+ return __type;
+}
+
}}}
SysTryReturnResult(NID_UI_ANIM, !__pLayer || (__pLayer && pLayer == null), E_INVALID_STATE, "The layer is already assigned to another RootVisualElement instance.");
__pLayer = pLayer;
-#ifdef ENABLE_VE_EFL
- if (useEfl)
- {
- _pVisualElementImpl->GetSharedData().ChangeNativeNode(*_pVisualElementImpl->__pRenderObject, false);
- }
-#endif
+ _pVisualElementImpl->GetSharedData().CreateNativeNode(useEfl);
_RootVisualElement* pPresentation = null;
if (_pVisualElementImpl && _pVisualElementImpl->__pRenderObject)
#include <FBaseSysLog.h>
-#ifdef ENABLE_VE_EFL
-#include "FUiAnim_EflNode.h"
-#endif
-#include "FUiAnim_GlNode.h"
+#include "FUiAnim_INativeNode.h"
#include "FUiAnim_VisualElement.h"
#include "FUiAnim_VisualElementImpl.h"
_Colorf
_VisualElement::GetBackgroundColor(void) const
{
-#ifdef ENABLE_VE_EFL
- _EflNode* pEflNode = dynamic_cast< _EflNode* >(_pVisualElementImpl->GetNativeNode());
- if(pEflNode)
+ _INativeNode* pNode = GetNativeNode();
+ if (pNode)
{
- return pEflNode->GetBackgroundColor();
+ return pNode->GetBackgroundColor();
}
else
-#endif
{
- _GlNode* pGlNode = dynamic_cast< _GlNode* >(_pVisualElementImpl->GetNativeNode());
-
- SysTryReturn(NID_UI, pGlNode, _Colorf(0.0f, 0.0f, 0.0f, 1.0f), E_INVALID_STATE, "[E_INVALID_STATE] No object for background."); // CHECKME: Default BG?
-
- return pGlNode->GetBackgroundColor();
+ return _pVisualElementImpl->GetNativeNodeColor();
}
}
result
_VisualElement::SetBackgroundColor(const _Colorf& color)
{
- result r = E_SUCCESS;
-
-#ifdef ENABLE_VE_EFL
- _EflNode* pEflNode = dynamic_cast< _EflNode* >(_pVisualElementImpl->GetNativeNode());
- if(pEflNode)
+ _INativeNode* pNode = GetNativeNode();
+ if (pNode)
{
- r = pEflNode->SetBackgroundColor(color);
+ return pNode->SetBackgroundColor(color);
}
else
-#endif
{
- _GlNode* pGlNode = dynamic_cast< _GlNode* >(_pVisualElementImpl->GetNativeNode());
-
- SysTryReturnResult(NID_UI, pGlNode, E_INVALID_STATE, "No object for background."); // CHECKME: Default BG?
-
- r = pGlNode->SetBackgroundColor(color);
+ return _pVisualElementImpl->SetNativeNodeColor(color);
}
-// if (_pVisualElementImpl->GetRenderObject()) (_pVisualElementImpl->GetRenderObject())->InvalidateHierarchyProps((int)_VisualElementImpl::HIERARCHY_PROPERTY_NATIVENODE, false, false);
-// if (_pVisualElementImpl->GetRenderObject()) (_pVisualElementImpl->GetRenderObject())->InvalidateHierarchyProps((int)_VisualElementImpl::UPDATED_PROP_CONTENT, false, false);
-
- return r;
}
FloatRectangle
, __renderOperation(VisualElement::RENDER_OPERATION_BLEND)
, __pBoundsChangedCallback(null)
, __pBoundsChangedCallbackData(null)
+ , __hasColor(false)
+ , __color(0.0f, 0.0f, 0.0f, 0.0f)
{
ClearLastResult();
, __renderOperation(modelImpl.__renderOperation)
, __pBoundsChangedCallback(null)
, __pBoundsChangedCallbackData(null)
+ , __hasColor(modelImpl.__hasColor)
+ , __color(modelImpl.__color)
{
ClearLastResult();
SysTryCatch(NID_UI_ANIM, GetSharedData().Construct() == E_SUCCESS, r = E_SYSTEM, E_SYSTEM, "[E_SYSTEM] failed in shared data constructing.");
__pModel = this;
-// __pPresentation = null;
-// __pRenderObject = null;
- //SysLog(NID_UI_ANIM, "Created(efl=%p)", GetSharedData().pNativeNode);
#if 0 // REMOVED : We should invoke property observer method manually.
if (__isPropertyPropagationEnabled)
// Fully invalidate because new surface should be allocated and redrawn
GetSharedData().invalidatedRegion.SetBounds(0.0f, 0.0f, __bounds.width, __bounds.height);
-
RebuildHierarchyProps(0, true, true);
SysTryReturnResult(NID_UI_ANIM, HAVE_SURFACE(this), E_SYSTEM, "Realizing back-buffer surface failed.");
return E_INVALID_ARG;
}
-#if defined (ENABLE_VE_EFL)
- if (GetSharedData().__useEfl && (GetSharedData().__useEfl != child.GetSharedData().__useEfl))
- {
- SysTryReturnResult(NID_UI_ANIM, child.GetSharedData().pSurface == null, E_INVALID_ARG, "can't attach child with surface to EFL parent.");
- ChangeNativeNode(child);
- }
-#endif
-
// TBD: check ownership!!!
if (IS_RENDER_OBJECT(this))
{
}
}
}
- else
+ else if(IS_RENDER_OBJECT(this))
{
if (likely(GetSharedData().pNativeNode) && likely(child.GetSharedData().pNativeNode))
{
__pParent->__pPresentation->ChangeZOrder(*__pPresentation, pReferenceRenderObject, above, _zOrderGroup);
}
-
-
-
}
void
{
__pPresentation->RemoveChild(*child.GetPresentation(), deallocate);
}
-
-
}
result
}
}
}
- else
+ else if (IS_RENDER_OBJECT(this))
{
if (GetSharedData().pNativeNode && pChild->GetSharedData().pNativeNode)
{
return;
}
+ if (likely(parent.GetNativeNode()))
+ {
+ if (unlikely(GetNativeNode()))
+ {
+ //change if type is different
+ if (parent.GetSharedData().__useEfl != GetSharedData().__useEfl)
+ {
+ _INativeNode* pOldParentNode = GetParent()->GetSharedData().pNativeNode;
+ SysAssertf(pOldParentNode, "child has node but there is no parent.");
+ pOldParentNode->RemoveChild(*GetNativeNode());
+ GetSharedData().ChangeNativeNode(parent.GetSharedData().__useEfl);
+ if (__hasColor)
+ {
+ GetNativeNode()->SetBackgroundColor(__color);
+ }
+ }
+
+ }
+ else
+ {
+ // create
+ GetSharedData().CreateNativeNode(parent.GetSharedData().__useEfl);
+ if (__hasColor)
+ {
+ GetNativeNode()->SetBackgroundColor(__color);
+ }
+
+ }
+ }
+ else
+ {
+ if (unlikely(GetNativeNode()))
+ {
+ _INativeNode* pOldParentNode = GetParent()->GetSharedData().pNativeNode;
+ SysAssertf(pOldParentNode, "child has node but there is no parent.");
+ pOldParentNode->RemoveChild(*GetNativeNode());
+
+ delete GetSharedData().pNativeNode;
+ GetSharedData().pNativeNode = null;
+ }
+ }
+
+
_INativeNode* pNode = GetNativeNode();
_INativeNode* pParentNode = parent.GetNativeNode();
return;
}
- pNode->RebuildIfNeeded(*pParentNode);
+ pNode->Construct(*pParentNode);
//TODO : must check ,don't you need to rebuild???
// RebuildCoordinates();
}
result
+_VisualElementImpl::SetNativeNodeColor(const _Colorf& color)
+{
+ __pRenderObject->__hasColor = true;
+ __pRenderObject->__color = color;
+
+ return E_SUCCESS;
+}
+
+_Colorf
+_VisualElementImpl::GetNativeNodeColor(void)
+{
+ return __pRenderObject->__color;
+}
+
+result
_VisualElementImpl::SetMesh(Mesh* pMesh)
{
Mesh* pOldMesh = GetSharedData().geometry.GetMesh();
ClearLastResult();
}
-#ifdef ENABLE_VE_EFL
-void
-_VisualElementImpl::ChangeNativeNode(_VisualElementImpl& child)
-{
- child.GetSharedData().ChangeNativeNode(*(child.__pRenderObject), true);
-
- int count = child.__children.GetCount();
- for (int i = 0; i < count; i++)
- {
- _VisualElementImpl* pChild = child.__children.GetChildAt(i);
- ChangeNativeNode(*pChild);
- }
-}
-#endif
-
}}}
, name(L"")
, toUpdatePropertiesForRenderObject(pModel)
, pUserData(null)
- , __refCount(1)
-#ifdef ENABLE_VE_EFL
, __useEfl(false)
-#endif
-
+ , __refCount(1)
{
memset(extraSurfaceOpacity, 1.0, sizeof(float)*EXTRA_SURFACE_MAX);
memset(pExtraSurfaceList, null, sizeof(VisualElementSurface* )*EXTRA_SURFACE_MAX);
ClearLastResult();
SysAssert(pNativeNode == null);
- pNativeNode = _INativeNode::CreateInstanceN();
- SysTryReturnResult(NID_UI, pNativeNode, E_OUT_OF_MEMORY, "Memory allocation failed.");
+ //pNativeNode = _INativeNode::CreateInstanceN();
+ //SysTryReturnResult(NID_UI, pNativeNode, E_OUT_OF_MEMORY, "Memory allocation failed.");
return E_SUCCESS;
}
pSurface = null;
}
+result
+_VisualElementSharedData::CreateNativeNode(bool useEfl)
+{
+ ClearLastResult();
+
+ pNativeNode = _INativeNode::CreateInstanceN(useEfl);
+ SysTryReturnResult(NID_UI, pNativeNode, E_OUT_OF_MEMORY, "Memory allocation failed.");
+
+ __useEfl = useEfl;
+
+ return E_SUCCESS;
+}
+
#ifdef ENABLE_VE_EFL
result
-_VisualElementSharedData::ChangeNativeNode(_VisualElementImpl& presentation, bool reconfigure)
+_VisualElementSharedData::ChangeNativeNode(bool useEfl)
{
SysTryReturnResult(NID_UI, pNativeNode, E_INVALID_STATE, "The Native Node is invalid.");
SysTryReturnResult(NID_UI, pSurface == null, E_INVALID_STATE, "The surface is exist already.");
+ //need to remove child?
delete pNativeNode;
- pNativeNode = _INativeNode::CreateInstanceN(true);
-
- if (reconfigure)
- {
- pNativeNode->Reconfigure(null, presentation, false);
- }
+ pNativeNode = _INativeNode::CreateInstanceN(useEfl);
- __useEfl = true;
+ __useEfl = useEfl;
return E_SUCCESS;
}
#ifdef ENABLE_VE_EFL
_NativeLayer* pLayer = reinterpret_cast<_NativeLayer*>(handle);
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
unique_ptr<_EflVisualElementSurfaceImpl> pEflImpl(new (std::nothrow) _EflVisualElementSurfaceImpl(handle, size));
SysTryReturn(NID_UI_ANIM, pEflImpl, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The handle is invalid.");
#ifdef ENABLE_VE_EFL
_NativeLayer* pLayer = reinterpret_cast<_NativeLayer*>(handle);
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
unique_ptr<_EflVisualElementSurfaceImpl> pEflImpl(new (std::nothrow) _EflVisualElementSurfaceImpl(handle, size));
SysTryReturn(NID_UI_ANIM, pEflImpl, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The handle is invalid.");
SysTryReturn(NID_UI_ANIM, pLayer != null, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. DisplayContext is invalid.");
#ifdef ENABLE_VE_EFL
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
- unique_ptr<_EflVisualElementSurfaceImpl> pEflImpl(new (std::nothrow) _EflVisualElementSurfaceImpl(reinterpret_cast<Handle>(pEflLayer), handle, size));
+ unique_ptr<_EflVisualElementSurfaceImpl> pEflImpl(new (std::nothrow) _EflVisualElementSurfaceImpl(reinterpret_cast<Handle>(pLayer), handle, size));
SysTryReturn(NID_UI_ANIM, pEflImpl, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. The handle is invalid.");
result r = GetLastResult();
_VisualElementSurfaceImpl* pVisualElementSurfaceImpl = null;
#ifdef ENABLE_VE_EFL
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
pVisualElementSurfaceImpl = new (std::nothrow) _EflVisualElementSurfaceImpl(reinterpret_cast<Handle>(pLayer), size);
}
SysTryReturn(NID_UI_ANIM, pLayer != null, null, E_INVALID_ARG, "[E_INVALID_ARG] Invalid argument(s) is used. DisplayContext is invalid.");
#ifdef ENABLE_VE_EFL
- _EflLayer* pEflLayer = dynamic_cast<_EflLayer*>(pLayer);
- if (pEflLayer)
+ if (pLayer->GetLayerType() == _LAYER_TYPE_EFL)
{
return null;
}
#include <FUiAnimVisualElement.h>
#include <FUiAnimVisualElementSurface.h>
-#include "FUi_Colorf.h"
#include "FUiAnim_INativeNode.h"
_EflNode(void);
virtual ~_EflNode(void);
- virtual result Construct(void);
- virtual result RebuildIfNeeded(const _INativeNode& parent);
+ virtual result Construct(const _INativeNode& parent);
+ result Construct(const _NativeLayer& layer);
public:
virtual Handle GetGroupContainer(void) const;
virtual result Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& element, bool surfaceOnly);
virtual VisualElementSurface* GetSurface(void) const;
- Evas* GetEvas(void) const;
+ virtual _Colorf GetBackgroundColor(void) const;
+ virtual result SetBackgroundColor(const _Colorf& backgroundColor);
- _Colorf GetBackgroundColor(void) const;
- result SetBackgroundColor(const _Colorf& backgroundColor);
+ Evas* GetEvas(void) const;
void AddNativeSmartObject(VisualElement& element, Evas_Object* pSmartObject);
void SetNativeObject(VisualElement& element, Evas_Object* pNativeObject);
void AdjustEvasObjectOrder(void);
bool AdjustImageHolder(bool useHolder);
- result ReConstruct(const Evas* pEvas);
- result ReConstruct(const _NativeLayer& layer);
+ //result ReConstruct(const Evas* pEvas);
+ //result ReConstruct(const _NativeLayer& layer);
- result Destruct(void);
+ //result Destruct(void);
private:
_EflNode(const _EflNode& rhs); // no impl.
friend class _INativeNode;
friend class _VeDebug;
friend class _VisualElementImpl;
- friend class _EflLayer;
}; // _EflNode
#include <FGrpFloatRectangle.h>
+#include "FUi_Colorf.h"
+
namespace Tizen { namespace Ui { namespace Animations
{
//ENABLE_VE_EFL
static _INativeNode* CreateInstanceN(bool useEfl=false);
- virtual result Construct(void) = 0;
- virtual result RebuildIfNeeded(const _INativeNode& parent) = 0;
+ virtual result Construct(const _INativeNode& parent) = 0;
public:
virtual result InsertChild(_INativeNode& child, const _INativeNode* pReference, bool above) = 0;
virtual result Reconfigure(VisualElementSurface* pSurface, _VisualElementImpl& element, bool surfaceOnly) = 0;
virtual VisualElementSurface* GetSurface(void) const = 0;
+ virtual _Colorf GetBackgroundColor(void) const = 0;
+ virtual result SetBackgroundColor(const _Colorf& backgroundColor) = 0;
+
private:
_INativeNode(const _INativeNode& rhs); // no impl.
_INativeNode& operator =(const _INativeNode& rhs); // no impl.
class _INativeNode;
class _NativeWindow;
+enum _LayerType
+{
+ _LAYER_TYPE_GL,
+ _LAYER_TYPE_EFL
+};
+
class _OSP_EXPORT_ _NativeLayer : public Tizen::Base::Object
{
public:
*/
virtual void Flush(void) = 0;
+ /**
+ * Gets the type of this instance.
+ *
+ * @since 3.0
+ * @return the type of Layer
+ */
+ _LayerType GetLayerType(void) const;
+
protected:
virtual result OnConstructed(void) = 0;
// bool __needUpdateRenderObjects;
// bool __didSyncPresentation;
+ _LayerType __type;
friend class _RootVisualElement;
// virtual _VisualElementImpl* CloneN(void);
void InvalidateHierarchyProps(PropertyFlags invalidProps, bool broadcastToChildren, bool propagateToParentsOnly);
+ result SetNativeNodeColor(const _Colorf& color);
+ _Colorf GetNativeNodeColor(void);
+
private:
Tizen::Base::Collection::IList* GetChildListAtN(const Tizen::Graphics::FloatRectangle& selection, VisualElement::SelectionMode mode);
result GetSelectedI(const Tizen::Ui::Animations::_Selection& selection, VisualElement::SelectionMode mode, Tizen::Base::Collection::IList& list);
-#ifdef ENABLE_VE_EFL
- void ChangeNativeNode(_VisualElementImpl& child);
-#endif
-
public:
enum
{
_IVisualElementCaptureProvider* __pCaptureProvider;
+ bool __hasColor;
+ _Colorf __color;
+
friend class _VeDebug;
friend class VisualElement;
friend class _VisualElement;
return (invalidatedNativeProps != 0) || surfaceChanged || geometry.IsUpdated();
}
-#ifdef ENABLE_VE_EFL
- result ChangeNativeNode(_VisualElementImpl& presentation, bool reconfigure);
-#endif
+ result CreateNativeNode(bool useEfl);
+
+ result ChangeNativeNode(bool useEfl);
public:
int invalidatedNativeProps;
Tizen::Base::String name;
+ bool __useEfl;
+
class UpdatePropertiesForRender
{
public:
private:
int __refCount;
-
-#ifdef ENABLE_VE_EFL
-public:
- bool __useEfl;
-#endif
}; // _VisualElementSharedData