From fa6dd63e38408ee6b9d888a4a0b0aaa44700eb5e Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Tue, 3 Feb 2015 15:10:50 +0100 Subject: Some cleanup in OOFPosAbsLikeMgr. --- dw/oofpositionedmgr.cc | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'dw/oofpositionedmgr.cc') diff --git a/dw/oofpositionedmgr.cc b/dw/oofpositionedmgr.cc index db5cc5e6..afc2b945 100644 --- a/dw/oofpositionedmgr.cc +++ b/dw/oofpositionedmgr.cc @@ -31,6 +31,21 @@ namespace dw { namespace oof { +OOFPositionedMgr::Child::Child (core::Widget *widget, OOFAwareWidget *generator, + int externalIndex) +{ + this->widget = widget; + this->generator = generator; + this->externalIndex = externalIndex; + + x = y = 0; + + // Initially, this child does not actually have been considered, + // but since adding a new element will force a size/extremes + // calculation, this is equivalent. + consideredForSize = consideredForExtremes = true; +} + OOFPositionedMgr::OOFPositionedMgr (OOFAwareWidget *container) { DBG_OBJ_CREATE ("dw::OOFPositionedMgr"); @@ -267,6 +282,22 @@ bool OOFPositionedMgr::getPosBorder (style::Length cssValue, int refLength, return false; } +bool OOFPositionedMgr::allChildrenConsideredForSize () +{ + for (int i = 0; i < children->size(); i++) + if (!children->get(i)->consideredForSize) + return false; + return true; +} + +bool OOFPositionedMgr::allChildrenConsideredForExtremes () +{ + for (int i = 0; i < children->size(); i++) + if (!children->get(i)->consideredForExtremes) + return false; + return true; +} + } // namespace oof } // namespace dw -- cgit v1.2.3