aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-04-09 23:21:09 +0200
committerSebastian Geerken <devnull@localhost>2014-04-09 23:21:09 +0200
commitb7b6cb6dbe45ae258e19595c805cdf317865674c (patch)
tree1e113d200019118da74fdf5231116aa3603b4740 /dw
parent7a45186914fd6a805127e430d13e51601fcf47b6 (diff)
Finished refactoring.
Diffstat (limited to 'dw')
-rw-r--r--dw/outofflowmgr.cc36
-rw-r--r--dw/outofflowmgr.hh41
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