diff options
-rw-r--r-- | dw/outofflowmgr.cc | 36 | ||||
-rw-r--r-- | dw/outofflowmgr.hh | 41 |
2 files changed, 51 insertions, 26 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index 4bd6b7ff..f901d366 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -57,17 +57,6 @@ void OutOfFlowMgr::WidgetInfo::update (bool wasAllocated, int xCB, int yCB, DBG_OBJ_SET_NUM_O (widget, "<WidgetInfo>.height", height); } -void OutOfFlowMgr::WidgetInfo::updateAllocation () -{ - DBG_OBJ_MSG_O ("resize.oofm", 0, widget, "<b>updateAllocation</b> ()"); - DBG_OBJ_MSG_START_O (widget); - - update (isNowAllocated (), getNewXCB (), getNewYCB (), getNewWidth (), - getNewHeight ()); - - DBG_OBJ_MSG_END_O (widget); -} - // ---------------------------------------------------------------------- OutOfFlowMgr::Float::Float (OutOfFlowMgr *oofm, Widget *widget, @@ -92,6 +81,17 @@ OutOfFlowMgr::Float::Float (OutOfFlowMgr *oofm, Widget *widget, } } +void OutOfFlowMgr::Float::updateAllocation () +{ + DBG_OBJ_MSG_O ("resize.oofm", 0, getWidget (), "<b>updateAllocation</b> ()"); + DBG_OBJ_MSG_START_O (getWidget ()); + + update (isNowAllocated (), getNewXCB (), getNewYCB (), getNewWidth (), + getNewHeight ()); + + DBG_OBJ_MSG_END_O (getWidget ()); +} + void OutOfFlowMgr::Float::intoStringBuffer(StringBuffer *sb) { sb->append ("{ widget = "); @@ -446,7 +446,8 @@ OutOfFlowMgr::TBInfo::TBInfo (OutOfFlowMgr *oofm, Textblock *textblock, leftFloatsGB = new SortedFloatsVector (oofm, LEFT, SortedFloatsVector::GB); rightFloatsGB = new SortedFloatsVector (oofm, RIGHT, SortedFloatsVector::GB); - updateAllocation (); + wasAllocated = getWidget()->wasAllocated (); + allocation = *(getWidget()->getAllocation ()); } OutOfFlowMgr::TBInfo::~TBInfo () @@ -455,6 +456,17 @@ OutOfFlowMgr::TBInfo::~TBInfo () delete rightFloatsGB; } +void OutOfFlowMgr::TBInfo::updateAllocation () +{ + DBG_OBJ_MSG_O ("resize.oofm", 0, getWidget (), "<b>updateAllocation</b> ()"); + DBG_OBJ_MSG_START_O (getWidget ()); + + update (isNowAllocated (), getNewXCB (), getNewYCB (), getNewWidth (), + getNewHeight ()); + + DBG_OBJ_MSG_END_O (getWidget ()); +} + OutOfFlowMgr::AbsolutelyPositioned::AbsolutelyPositioned (OutOfFlowMgr *oofm, Widget *widget, Textblock diff --git a/dw/outofflowmgr.hh b/dw/outofflowmgr.hh index 109351d5..1a72f6dc 100644 --- a/dw/outofflowmgr.hh +++ b/dw/outofflowmgr.hh @@ -46,17 +46,8 @@ private: inline int getOldWidth () { return width; } inline int getOldHeight () { return height; } - inline bool isNowAllocated () { return widget->wasAllocated (); } - inline int getNewXCB () { return widget->getAllocation()->x - - oofm->containingBlockAllocation.x; } - inline int getNewYCB () { return widget->getAllocation()->y - - oofm->containingBlockAllocation.y; } - inline int getNewWidth () { return widget->getAllocation()->width; } - inline int getNewHeight () { return widget->getAllocation()->ascent + - widget->getAllocation()->descent; } - + void update (bool wasAllocated, int xCB, int yCB, int width, int height); - void updateAllocation (); inline core::Widget *getWidget () { return widget; } }; @@ -114,6 +105,16 @@ private: Float (OutOfFlowMgr *oofm, core::Widget *widget, Textblock *generatingBlock, int externalIndex); + inline bool isNowAllocated () { return getWidget()->wasAllocated (); } + inline int getNewXCB () { return getWidget()->getAllocation()->x - + getOutOfFlowMgr()->containingBlockAllocation.x; } + inline int getNewYCB () { return getWidget()->getAllocation()->y - + getOutOfFlowMgr()->containingBlockAllocation.y; } + inline int getNewWidth () { return getWidget()->getAllocation()->width; } + inline int getNewHeight () { return getWidget()->getAllocation()->ascent + + getWidget()->getAllocation()->descent; } + void updateAllocation (); + void intoStringBuffer(lout::misc::StringBuffer *sb); bool covers (Textblock *textblock, int y, int h); @@ -188,11 +189,23 @@ private: TBInfo *parent, int parentExtIndex); ~TBInfo (); + inline bool isNowAllocated () { + return getOutOfFlowMgr()->wasAllocated (getTextblock ()); } + inline int getNewXCB () { + return getOutOfFlowMgr()->getAllocation (getTextblock ())->x - + getOutOfFlowMgr()->containingBlockAllocation.x; } + inline int getNewYCB () { + return getOutOfFlowMgr()->getAllocation (getTextblock ())->y - + getOutOfFlowMgr()->containingBlockAllocation.y; } + inline int getNewWidth () { + return getOutOfFlowMgr()->getAllocation (getTextblock ())->width; } + inline int getNewHeight () { + core::Allocation *allocation = + getOutOfFlowMgr()->getAllocation (getTextblock ()); + return allocation->ascent + allocation->descent; } + void updateAllocation (); + inline Textblock *getTextblock () { return (Textblock*)getWidget (); } - inline void updateAllocation () { - wasAllocated = getWidget()->wasAllocated (); - allocation = *(getWidget()->getAllocation ()); - } }; class AbsolutelyPositioned: public lout::object::Object |