}
void
-_Control::InvalidateHierarchyAbsoluteBounds(void)
-{
- struct _Visitor
- : public Visitor
- {
- virtual VisitType Visit(_Control& control)
- {
- control.__needRecalcAbsBounds = true;
- control.__needRecalcAbsBoundsF = true;
-
- return VISIT_DOWNWARD;
- }
- };
-
- _Visitor visitor;
- Accept(visitor);
-}
-
-void
_Control::Draw(bool recursive)
{
ClearLastResult();
{
child.SetParent(this);
child.InvalidateHierarchyRootWindow();
- child.InvalidateHierarchyAbsoluteBounds();
FloatRectangle floatBounds(child.GetBoundsF().x, child.GetBoundsF().y, child.GetBoundsF().width, child.GetBoundsF().height);
}
}
- if (moved || resized)
- {
- InvalidateHierarchyAbsoluteBounds();
- }
-
ClearLastResult();
return E_SUCCESS;
}
Rectangle
_Control::GetAbsoluteBounds(void) const
{
- if (!__needRecalcAbsBounds)
- return __absoluteBounds;
-
Point accumPoint;
Rectangle absoluteBounds;
Rectangle clientBounds;
absoluteBounds.width = __bounds.width;
absoluteBounds.height = __bounds.height;
- const_cast<_Control*>(this)->__absoluteBounds = absoluteBounds;
- const_cast<_Control*>(this)->__needRecalcAbsBounds = false;
-
return absoluteBounds;
}
FloatRectangle
_Control::GetAbsoluteBoundsF(void) const
{
- if (!__needRecalcAbsBoundsF)
- return __absoluteBoundsF;
-
FloatPoint accumPoint;
FloatRectangle absoluteBounds;
FloatRectangle clientBounds;
absoluteBounds.width = __bounds.width;
absoluteBounds.height = __bounds.height;
- const_cast<_Control*>(this)->__absoluteBoundsF = absoluteBounds;
- const_cast<_Control*>(this)->__needRecalcAbsBoundsF = false;
-
return absoluteBounds;
}
// E_SYSTEM
_Control::_Control(void)
: __needRecalcRootWindow(true)
- , __needRecalcAbsBounds(true)
- , __needRecalcAbsBoundsF(true)
, __pRootWindow(null)
, __name(L"")
, __pParent(null)
, __bounds(0.0f, 0.0f, 0.0f, 0.0f)
, __contentAreaBounds(0.0f, 0.0f, 0.0f, 0.0f)
, __clientBounds(0.0f, 0.0f, 0.0f, 0.0f)
- , __absoluteBounds(0, 0, 0, 0)
- , __absoluteBoundsF(0.0f, 0.0f, 0.0f, 0.0f)
+ , __absoluteBounds(0.0f, 0.0f, 0.0f, 0.0f)
, __invalidatedBounds(0.0f, 0.0f, 0.0f, 0.0f)
, __minSize(FloatDimension(0.0f, 0.0f))
, __maxSize(FloatDimension(MAX_LENGTH, MAX_LENGTH))
Tizen::Graphics::FloatRectangle GetClientBoundsF(const Tizen::Graphics::FloatDimension& size) const;
Tizen::Graphics::Rectangle GetAbsoluteBounds(void) const;
Tizen::Graphics::FloatRectangle GetAbsoluteBoundsF(void) const;
- void InvalidateHierarchyAbsoluteBounds(void);
result SetClientBounds(const Tizen::Graphics::Rectangle& bounds);
result SetClientBounds(const Tizen::Graphics::FloatRectangle& bounds);
bool IsCalledSetClientBounds(void);
private:
bool __needRecalcRootWindow;
- bool __needRecalcAbsBounds;
- bool __needRecalcAbsBoundsF;
_Window* __pRootWindow;
_ControlHandle __controlHandle;
Tizen::Graphics::FloatRectangle __bounds;
Tizen::Graphics::FloatRectangle __contentAreaBounds;
Tizen::Graphics::FloatRectangle __clientBounds;
- Tizen::Graphics::Rectangle __absoluteBounds;
- Tizen::Graphics::FloatRectangle __absoluteBoundsF;
+ Tizen::Graphics::FloatRectangle __absoluteBounds;
Tizen::Graphics::FloatRectangle __invalidatedBounds;
Tizen::Graphics::FloatDimension __minSize;
Tizen::Graphics::FloatDimension __maxSize;