, __decomposedTransform()
, __childrenTransform()
, __decomposedChildrenTransform()
-#ifdef OLD
- , __childrenNeedsUpdateProps(HIERARCHY_PROPERTY_MASK & ~HIERARCHY_PROPERTY_CONTENT)
- , __invalidatedProps(HIERARCHY_PROPERTY_MASK& ~HIERARCHY_PROPERTY_CONTENT)
-#else
, __childrenNeedsUpdateProps(HIERARCHY_PROPERTY_MASK)
, __invalidatedProps(HIERARCHY_PROPERTY_MASK)
-#endif
, __matrixFromTopValid(false)
, __matrixFromTopInvertible(true)
, __matrixToSuperValid(false)
, __decomposedTransform(modelImpl.__decomposedTransform)
, __childrenTransform(modelImpl.__childrenTransform)
, __decomposedChildrenTransform(modelImpl.__decomposedChildrenTransform)
-#ifdef OLD
- , __childrenNeedsUpdateProps(HIERARCHY_PROPERTY_MASK & ~HIERARCHY_PROPERTY_CONTENT)
- , __invalidatedProps(HIERARCHY_PROPERTY_MASK & ~HIERARCHY_PROPERTY_CONTENT)
-#else
, __childrenNeedsUpdateProps(HIERARCHY_PROPERTY_MASK)
, __invalidatedProps(HIERARCHY_PROPERTY_MASK)
-#endif
, __matrixFromTopValid(false)
, __matrixFromTopInvertible(true)
, __matrixToSuperValid(false)
{
ClearLastResult();
- //GetSharedData().AddRef();
-
__children.Construct();
-
- //GetSharedData().invalidatedNativeProps = HIERARCHY_PROPERTY_MASK;
-
- // for MODEL object
- //modelImpl.__pPresentation = this;
}
_VisualElementImpl::~_VisualElementImpl(void)
{
__pDestroyedCallback(__pDestroyedCallbackData);
}
-
-
- // Remove property observer finally
-// if (IsPropertyChangeEventListenerAdded())
-// {
-// RemovePropertyChangeEventListener(_VisualElementModelObserver::GetInstance());
-// }
}
void
pElement->GetSharedData().childrenSurfaceChanged = true;
pElement = pElement->__pParent;
}
-#ifdef OLD
- __pPresentation->InvalidateHierarchyProps(HIERARCHY_PROPERTY_SURFACE, false, false);
-#endif
}
}
else
pElement->GetSharedData().childrenSurfaceChanged = true;
pElement = pElement->__pParent;
}
-#ifdef OLD
- InvalidateHierarchyProps(HIERARCHY_PROPERTY_SURFACE, false, false);
-#endif
}
}
_VisualElementImpl::SetContentBounds(const FloatRectangle& contentBounds)
{
SysTryReturnResult(NID_UI_ANIM, IS_MODEL(this), E_INVALID_OPERATION, "VisualElement is not Model object.");
-#if 0
- return SetContentBoundsI(contentBounds);
-#else
result r = InvokeOnSetPropertyRequested(*pVePropContentBounds, Variant(contentBounds));
SysTryLog(NID_UI_ANIM, r == E_SUCCESS, "[%s] Propagating.", GetErrorMessage(r));
return r;
-#endif
}
FloatRectangle
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- bool isImplicitAnimationEnabled = InvokeOnGetPropertyRequested(*pVePropImplicitAnimationEnabled).ToBool();
- if (GetLastResult() != E_SUCCESS)
- return false;
-
- return isImplicitAnimationEnabled;
-#else
return __isImplicitAnimationEnabled;
-#endif
}
result
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- FloatRectangle bounds = InvokeOnGetPropertyRequested(*pVePropBounds).ToFloatRectangle();
- if (GetLastResult() != E_SUCCESS)
- {
- return FloatRectangle();
- }
-
- return bounds;
-#else
return __bounds;
-#endif
}
result
if (unlikely(!NEED_SURFACE(this)))
InvalidateVisibleRectToRenderTarget(null);
- // if (sizeChanged)
- // SysLog(NID_UI_ANIM, "size changing to " VELOGRECTTAG, VELOGRECT(boundsAdjusted));
-
__bounds.x = boundsAdjusted.Left();
__bounds.y = boundsAdjusted.Top();
__bounds.width = newWidth;
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- float zPosition = (const_cast< _VisualElementImpl* >(this))->InvokeOnGetPropertyRequested(*pVePropZPosition).ToFloat();
- if (GetLastResult() != E_SUCCESS)
- {
- return 0.0f;
- }
-
- return zPosition;
-#else
return __zPosition;
-#endif
}
result
return IsVisibleI();
}
-#if 0
-bool
-_VisualElementImpl::IsVisibleI(void) const
-{
-#if 0
- const _VisualElementImpl* pElement = this;
- const _VisualElementImpl* pRoot = GetRoot();
-
- if (unlikely(!pRoot))
- return false;
-
- while (pElement)
- {
- if (!VE_VISIBLE(pElement))
- {
- return false;
- }
-
-#if 0
- if (!pElement->__pParent)
- {
- if (dynamic_cast< const _RootVisualElement* >(pElement) == null)
- {
- return false;
- }
- }
-#else
- if (!pElement->__pParent && pElement != pRoot)
- return false;
-#endif
-
- pElement = pElement->__pParent;
- }
-
- return true;
-#else
- if (unlikely(IsPropsInvalidated(HIERARCHY_PROPERTY_COORDINATES)))
- {
- const_cast< _VisualElementImpl* >(this)->RebuildCoordinates();
- }
-
- return __isVisible;
-#endif
-}
-#endif
-
bool
_VisualElementImpl::GetShowState(void) const
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropShowState).ToBool();
-#else
return VE_VISIBLE(this);
-#endif
}
result
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropContentOpacity).ToFloat();
-#else
return __contentOpacity;
-#endif
}
result
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropOpacity).ToFloat();
-#else
return __opacity;
-#endif
}
result
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropAnchor).ToFloatPoint();
-#else
return __anchor;
-#endif
}
result
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropAnchorZ).ToFloat();
-#else
return __anchorZ;
-#endif
}
result
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropTransform).ToFloatMatrix4();
-#else
return __transform;
-#endif
}
result
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropChildrenTransform).ToFloatMatrix4();
-#else
return __childrenTransform;
-#endif
}
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropClipToParent).ToBool();
-#else
return false;
-#endif
}
// TBD: clipToParent is not animatable, right??
{
ClearLastResult();
- // TBD: forward using property or direct return ?
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropSurfaceOpaque).ToBool();
-#else
return GetSharedData().isSurfaceOpaque;
-#endif
}
result
{
ClearLastResult();
-#if 0
- return InvokeOnGetPropertyRequested(*pVePropName).ToString();
-#else
return GetSharedData().name;
-#endif
}
result
// WARNING:
// Even when surface exists, the size might be invalidated by changing bounds.
//
-#if 0
- RebuildHierarchyProps(HIERARCHY_PROPERTY_MASK & (~HIERARCHY_PROPERTY_CONTENT), true);
- if (!HAVE_SURFACE(this))
- {
- return __visibleRect;
- }
-#endif
if (HAVE_SURFACE(this) && GetSharedData().fixedSurfaceSize)
{
return FloatRectangle(0.0f, 0.0f, GetSharedData().pSurface->GetSizeF().width, GetSharedData().pSurface->GetSizeF().height);
if (unlikely(!__boundingBoxValid))
{
-#if 0
- float x[4] = { 0.0f, __bounds.width, 0.0f, __bounds.width };
- float y[4] = { 0.0f, 0.0f, __bounds.height, __bounds.height };
- float z[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
-
- for (int i = 0; i < 4; i++)
- {
- _MatrixUtilTransform(GetMatrixToTop(), &x[i], &y[i], &z[i]);
- }
-
- pThis->__boundingBox.SetBounds(x[0], y[0], x[0], y[0]);
-
- float l = x[0];
- float r = x[0];
- float t = y[0];
- float b = y[0];
- for (int i = 1; i < 4; i++)
- {
- if (x[i] < l)
- {
- l = x[i];
- }
-
- if (y[i] < t)
- {
- t = y[i];
- }
-
- if (x[i] > r)
- {
- r = x[i];
- }
-
- if (y[i] > b)
- {
- b = y[i];
- }
- }
-
- pThis->__boundingBox.SetBounds(l, t, r - l, b - t);
-#else
float x[4] = { 0.0f, __bounds.width, 0.0f, __bounds.width };
float y[4] = { 0.0f, 0.0f, __bounds.height, __bounds.height };
CalculateBoundingBox(x, y, pThis->__boundingBox);
-#endif
pThis->__boundingBoxValid = true;
}
return;
}
-#ifdef OLD
- if (unlikely(props & HIERARCHY_PROPERTY_SURFACE) && unlikely(IsPropsInvalidated(HIERARCHY_PROPERTY_SURFACE)))
- {
- SetPropsValidaty(HIERARCHY_PROPERTY_SURFACE, 0);
- }
-#endif
-
if (likely(props & HIERARCHY_PROPERTY_CONTENTBOUNDS) && likely(IsPropsInvalidated(HIERARCHY_PROPERTY_CONTENTBOUNDS)))
{
SetPropsValidaty(HIERARCHY_PROPERTY_CONTENTBOUNDS, 0);
{
// WARNING:
// HIERARCHY_PROPERTY_CONTENT is not handled here, but in drawing logic.
-#ifdef OLD
- const int mask = HIERARCHY_PROPERTY_MASK & (~HIERARCHY_PROPERTY_CONTENT);
-#else
const int mask = HIERARCHY_PROPERTY_MASK;
-#endif
if (unlikely((__childrenNeedsUpdateProps & mask) == 0 && GetSharedData().childrenSurfaceChanged == false))
return;
{
InvalidateRectangleI(pDirtyRectangle);
}
-#if 0 // exposing object without content changes is not needed for EFL
- else
- {
- SetFlushNeeded();
- }
-#endif
}
result
result
_VisualElementImpl::InvalidateRectangle(const FloatRectangle* pRectangle)
{
-//!!! don't have to check attached state
-// SysTryReturnResult(NID_UI_ANIM, IS_ATTACHED(this), E_INVALID_STATE, "Invalidating VisualElement should be attached to the root tree.");
-
return InvalidateRectangleI(pRectangle);
}
GetSharedData().invalidatedRegion = invRect;
-#ifdef OLD
- InvalidateHierarchyProps(HIERARCHY_PROPERTY_CONTENT, false, false);
-#else
_VisualElementImpl* pElement = this;
while (pElement)
{
pElement->GetSharedData().childrenInvalidated = true;
pElement = pElement->GetParent();
}
-#endif
SetRootNeedsContentUpdate();
return E_SUCCESS;
// if (IS_PRESENTATION(this))
// __UpdateHierarchyProps();
-#ifdef OLD
- if (unlikely((__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0))
-#else
if (unlikely(GetSharedData().childrenInvalidated))
-#endif
{
// if (unlikely(!IS_PRESENTATION(this)))
// __UpdateHierarchyProps();
return E_SUCCESS;
}
-#ifdef OLD
- if (unlikely((__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0))
-#else
if (unlikely(GetSharedData().childrenInvalidated))
-#endif
{
_VisualElementImpl* pRenderTarget = GetRenderTarget();
pRenderTarget->DrawRectangle(GetSharedData().invalidatedRegion);
-#ifdef OLD
- if (likely((__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0))
-#else
if (likely(GetSharedData().childrenInvalidated == false))
-#endif
{
return E_SUCCESS;
}
for (int i = 0; i < count; i++)
{
pChild = __children.GetChildAt(i);
-#ifdef OLD
- if (!pChild || (pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0)
-#else
if (!pChild || (pChild->GetSharedData().childrenInvalidated == false))
-#endif
{
continue;
}
pChild->DrawForAnimation();
-#ifdef OLD
- if ((pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0)
-#else
if ((pChild->GetSharedData().childrenInvalidated))
-#endif
{
childrenNeedUpdate = true;
}
// update 'needUpdate' flag regarding children only if no invalidated-region
if (GetSharedData().invalidatedRegion.IsEmpty())
{
-#ifdef OLD
- SetPropsValidaty(HIERARCHY_PROPERTY_CONTENT, 0);
- if (childrenNeedUpdate)
- {
- __childrenNeedsUpdateProps |= HIERARCHY_PROPERTY_CONTENT;
- }
- else
- {
- __childrenNeedsUpdateProps &= ~HIERARCHY_PROPERTY_CONTENT;
- }
-#else
if (childrenNeedUpdate)
{
GetSharedData().childrenInvalidated = true;
}
-#endif
}
}
void
_VisualElementImpl::DrawRectangleIfNeeded(const FloatRectangle& drawRect)
{
-#ifdef OLD
- if (unlikely(!IsVisibleI()) || (__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0)
-#else
if (unlikely(!IsVisibleI()) || GetSharedData().childrenInvalidated == false)
-#endif
{
return;
}
// needUpdate flag may be 'true' after drawring invalidated region.
// This means that some children still need to be updated !
//
-#ifdef OLD
- if (likely((__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0))
-#else
if (likely(GetSharedData().childrenInvalidated == false))
-#endif
{
return;
}
for (int i = 0; i < count; i++)
{
pChild = __children.GetChildAt(i);
-#ifdef OLD
- if (!pChild || (pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) == 0)
-#else
if (!pChild || pChild->GetSharedData().childrenInvalidated == false)
-#endif
{
continue;
}
pChild->DrawRectangleIfNeeded(updateRect);
}
-#ifdef OLD
- if ((pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0)
-#else
if (pChild->GetSharedData().childrenInvalidated)
-#endif
{
childrenNeedUpdate = true;
}
// update 'needUpdate' flag regarding children only if no invalidated-region
if (GetSharedData().invalidatedRegion.IsEmpty())
{
-#ifdef OLD
- SetPropsValidaty(HIERARCHY_PROPERTY_CONTENT, 0);
- if (childrenNeedUpdate)
- {
- __childrenNeedsUpdateProps |= HIERARCHY_PROPERTY_CONTENT;
- }
- else
- {
- __childrenNeedsUpdateProps &= ~HIERARCHY_PROPERTY_CONTENT;
- }
-#else
- if (childrenNeedUpdate)
- {
- GetSharedData().childrenInvalidated = true;
- }
-#endif
+ if (childrenNeedUpdate)
+ {
+ GetSharedData().childrenInvalidated = true;
+ }
}
}
// Clear *BEFORE* drawing because 'OnDraw' may add invalidated regions...
//
GetSharedData().invalidatedRegion.SetBounds(0.0f, 0.0f, 0.0f, 0.0f); // SetEmpty()
-
-#ifdef OLD
- SetPropsValidaty(HIERARCHY_PROPERTY_CONTENT, 0);
- __childrenNeedsUpdateProps &= ~HIERARCHY_PROPERTY_CONTENT;
-#else
GetSharedData().childrenInvalidated = false;
-#endif
}
pChild->DrawRectangle(drawRectVisible);
}
-#ifdef OLD
- if ((pChild->__childrenNeedsUpdateProps & HIERARCHY_PROPERTY_CONTENT) != 0)
-#else
if (pChild->GetSharedData().childrenInvalidated)
-#endif
{
childrenNeedUpdate = true;
}
//
if (childrenNeedUpdate)
{
-#ifdef OLD
- __childrenNeedsUpdateProps |= HIERARCHY_PROPERTY_CONTENT;
-#else
GetSharedData().childrenInvalidated = true;
-#endif
}
}