diff options
author | Sebastian Geerken <devnull@localhost> | 2013-05-20 18:03:41 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-05-20 18:03:41 +0200 |
commit | e28feeecc314bbcee1ca701de84ccabe96d0cd09 (patch) | |
tree | b7828430724e071a377e91837bf3eabccd80850d | |
parent | b96d8d3f2a791e161a28fed2ebdf2460a6bcda1c (diff) |
Some more data for OutOfFlowMgr::addWidgetInFlow.
-rw-r--r-- | dw/outofflowmgr.cc | 20 | ||||
-rw-r--r-- | dw/outofflowmgr.hh | 9 | ||||
-rw-r--r-- | dw/textblock.cc | 3 |
3 files changed, 25 insertions, 7 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index 759b1c9c..f2c3b216 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -275,9 +275,13 @@ void OutOfFlowMgr::SortedFloatsVector::put (Float *vloat) vloat->inCBList = type == CB; } -OutOfFlowMgr::TBInfo::TBInfo (OutOfFlowMgr *oofm, Textblock *textblock) +OutOfFlowMgr::TBInfo::TBInfo (OutOfFlowMgr *oofm, Textblock *textblock, + TBInfo *parent, int parentExtIndex) { this->textblock = textblock; + this->parent = parent; + this->parentExtIndex = parentExtIndex; + leftFloatsGB = new SortedFloatsVector (oofm, LEFT, SortedFloatsVector::GB); rightFloatsGB = new SortedFloatsVector (oofm, RIGHT, SortedFloatsVector::GB); } @@ -313,7 +317,7 @@ OutOfFlowMgr::OutOfFlowMgr (Textblock *containingBlock) if (containingBlockWasAllocated) containingBlockAllocation = *(containingBlock->getAllocation()); - addWidgetInFlow (containingBlock); + addWidgetInFlow (containingBlock, NULL, 0); } OutOfFlowMgr::~OutOfFlowMgr () @@ -596,9 +600,17 @@ bool OutOfFlowMgr::isWidgetOutOfFlow (core::Widget *widget) return widget->getStyle()->vloat != FLOAT_NONE; } -void OutOfFlowMgr::addWidgetInFlow (Textblock *textblock) +void OutOfFlowMgr::addWidgetInFlow (Textblock *textblock, + Textblock *parentBlock, int externalIndex) { - TBInfo *tbInfo = new TBInfo (this, textblock); + //printf ("[%p] addWidgetInFlow (%p, %p, %d)\n", + // containingBlock, textblock, parentBlock, externalIndex); + + TBInfo *tbInfo = + new TBInfo (this, textblock, + parentBlock ? getTextblock (parentBlock) : NULL, + externalIndex); + tbInfo->wasAllocated = false; tbInfo->index = tbInfos->size(); diff --git a/dw/outofflowmgr.hh b/dw/outofflowmgr.hh index ef330e7c..f4c18972 100644 --- a/dw/outofflowmgr.hh +++ b/dw/outofflowmgr.hh @@ -121,11 +121,15 @@ private: int index; // position within "tbInfos" Textblock *textblock; // for debugging; may be removed again + TBInfo *parent; + int parentExtIndex; + // These two lists store all floats generated by this textblock, // as long as this textblock is not allocates. SortedFloatsVector *leftFloatsGB, *rightFloatsGB; - TBInfo (OutOfFlowMgr *oofm, Textblock *textblock); + TBInfo (OutOfFlowMgr *oofm, Textblock *textblock, + TBInfo *parent, int parentExtIndex); ~TBInfo (); }; @@ -230,7 +234,8 @@ public: core::Widget *getWidgetAtPoint (int x, int y, int level); static bool isWidgetOutOfFlow (core::Widget *widget); - void addWidgetInFlow (Textblock *textblock); + void addWidgetInFlow (Textblock *textblock, Textblock *parentBlock, + int externalIndex); void addWidgetOOF (core::Widget *widget, Textblock *generatingBlock, int externalIndex); void moveExternalIndices (Textblock *generatingBlock, int oldStartIndex, diff --git a/dw/textblock.cc b/dw/textblock.cc index 2f51378e..817eb187 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -1908,7 +1908,8 @@ void Textblock::addWidget (core::Widget *widget, core::style::Style *style) // TODO Replace (perhaps) later "textblock" by "OOF aware widget". if (widget->instanceOf (Textblock::CLASS_ID)) - containingBlock->outOfFlowMgr->addWidgetInFlow ((Textblock*)widget); + containingBlock->outOfFlowMgr->addWidgetInFlow ((Textblock*)widget, + this, words->size ()); core::Requisition size; calcWidgetSize (widget, &size); |