aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
Diffstat (limited to 'dw')
-rw-r--r--dw/outofflowmgr.cc57
-rw-r--r--dw/outofflowmgr.hh17
-rw-r--r--dw/textblock.cc4
3 files changed, 44 insertions, 34 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc
index 0a8af968..ab6c6314 100644
--- a/dw/outofflowmgr.cc
+++ b/dw/outofflowmgr.cc
@@ -435,7 +435,7 @@ OutOfFlowMgr::TBInfo::~TBInfo ()
}
OutOfFlowMgr::AbsolutelyPositioned::AbsolutelyPositioned (OutOfFlowMgr *oofm,
- core::Widget *widget,
+ Widget *widget,
Textblock
*generatingBlock,
int externalIndex)
@@ -950,7 +950,7 @@ void OutOfFlowMgr::drawFloats (SortedFloatsVector *list, View *view,
// found below the area.
for (int i = 0; i < list->size(); i++) {
Float *vloat = list->get(i);
- core::Rectangle childArea;
+ Rectangle childArea;
if (vloat->getWidget()->intersects (area, &childArea))
vloat->getWidget()->draw (view, &childArea);
}
@@ -960,7 +960,7 @@ void OutOfFlowMgr::drawAbsolutelyPositioned (View *view, Rectangle *area)
{
for (int i = 0; i < absolutelyPositioned->size(); i++) {
AbsolutelyPositioned *abspos = absolutelyPositioned->get(i);
- core::Rectangle childArea;
+ Rectangle childArea;
if (abspos->widget->intersects (area, &childArea))
abspos->widget->draw (view, &childArea);
}
@@ -971,15 +971,15 @@ void OutOfFlowMgr::drawAbsolutelyPositioned (View *view, Rectangle *area)
* dillo, so that the containing block is determined correctly, which
* leads sometimes to a cleaner rendering.
*/
-bool OutOfFlowMgr::isWidgetOutOfFlow (core::Widget *widget)
+bool OutOfFlowMgr::isWidgetOutOfFlow (Widget *widget)
{
return
- widget->getStyle()->vloat != core::style::FLOAT_NONE ||
- widget->getStyle()->position == core::style::POSITION_ABSOLUTE ||
- widget->getStyle()->position == core::style::POSITION_FIXED;
+ widget->getStyle()->vloat != FLOAT_NONE ||
+ widget->getStyle()->position == POSITION_ABSOLUTE ||
+ widget->getStyle()->position == POSITION_FIXED;
}
-bool OutOfFlowMgr::isWidgetHandledByOOFM (core::Widget *widget)
+bool OutOfFlowMgr::isWidgetHandledByOOFM (Widget *widget)
{
// May be extended for fixed (and relative?) positions.
return isWidgetFloat (widget);
@@ -1392,17 +1392,17 @@ void OutOfFlowMgr::getFloatsListsAndSide (Float *vloat,
}
}
-void OutOfFlowMgr::getSize (int *oofWidth, int *oofHeight)
+void OutOfFlowMgr::getSize (Requisition *cbReq, int *oofWidth, int *oofHeight)
{
DBG_OBJ_MSG ("resize.oofm", 0, "<b>getSize</b> ()");
DBG_OBJ_MSG_START ();
int oofWidthAbsPos, oofHeightAbsPos;
- getAbsolutelyPositionedSize (&oofWidthAbsPos, &oofHeightAbsPos);
+ getAbsolutelyPositionedSize (cbReq, &oofWidthAbsPos, &oofHeightAbsPos);
int oofWidthtLeft, oofWidthRight, oofHeightLeft, oofHeightRight;
- getFloatsSize (LEFT, &oofWidthtLeft, &oofHeightLeft);
- getFloatsSize (RIGHT, &oofWidthRight, &oofHeightRight);
+ getFloatsSize (cbReq, LEFT, &oofWidthtLeft, &oofHeightLeft);
+ getFloatsSize (cbReq, RIGHT, &oofWidthRight, &oofHeightRight);
*oofWidth = max (oofWidthtLeft, oofWidthRight, oofWidthAbsPos);
*oofHeight = max (oofHeightLeft, oofHeightRight, oofHeightAbsPos);
@@ -1414,7 +1414,8 @@ void OutOfFlowMgr::getSize (int *oofWidth, int *oofHeight)
DBG_OBJ_MSG_END ();
}
-void OutOfFlowMgr::getFloatsSize (Side side, int *width, int *height)
+void OutOfFlowMgr::getFloatsSize (Requisition *cbReq, Side side, int *width,
+ int *height)
{
DBG_OBJ_MSGF ("resize.oofm", 0, "<b>getFloatsSize</b> (%s, ...)",
side == LEFT ? "LEFT" : "RIGHT");
@@ -1454,17 +1455,19 @@ void OutOfFlowMgr::getFloatsSize (Side side, int *width, int *height)
DBG_OBJ_MSG_END ();
}
-void OutOfFlowMgr::getExtremes (int *oofMinWidth, int *oofMaxWidth)
+void OutOfFlowMgr::getExtremes (Extremes *cbExtr, int *oofMinWidth,
+ int *oofMaxWidth)
{
DBG_OBJ_MSG ("resize.oofm", 0, "<b>getExtremes</b> ()");
DBG_OBJ_MSG_START ();
int oofMinWidthAbsPos, oofMaxWidthAbsPos;
- getAbsolutelyPositionedExtremes (&oofMinWidthAbsPos, &oofMaxWidthAbsPos);
+ getAbsolutelyPositionedExtremes (cbExtr, &oofMinWidthAbsPos,
+ &oofMaxWidthAbsPos);
int oofMinWidthtLeft, oofMinWidthRight, oofMaxWidthLeft, oofMaxWidthRight;
- getFloatsExtremes (LEFT, &oofMinWidthtLeft, &oofMaxWidthLeft);
- getFloatsExtremes (RIGHT, &oofMinWidthRight, &oofMaxWidthRight);
+ getFloatsExtremes (cbExtr, LEFT, &oofMinWidthtLeft, &oofMaxWidthLeft);
+ getFloatsExtremes (cbExtr, RIGHT, &oofMinWidthRight, &oofMaxWidthRight);
*oofMinWidth = max (oofMinWidthtLeft, oofMinWidthRight, oofMinWidthAbsPos);
*oofMaxWidth = max (oofMaxWidthLeft, oofMaxWidthRight, oofMaxWidthAbsPos);
@@ -1477,7 +1480,8 @@ void OutOfFlowMgr::getExtremes (int *oofMinWidth, int *oofMaxWidth)
DBG_OBJ_MSG_END ();
}
-void OutOfFlowMgr::getFloatsExtremes (Side side, int *minWidth, int *maxWidth)
+void OutOfFlowMgr::getFloatsExtremes (Extremes *cbExtr, Side side,
+ int *minWidth, int *maxWidth)
{
// Idea for a faster implementation: use incremental resizing?
*minWidth = *maxWidth = 0;
@@ -1676,10 +1680,10 @@ int OutOfFlowMgr::getClearPosition (Textblock *tb)
if (tb->getStyle()) {
bool left = false, right = false;
switch (tb->getStyle()->clear) {
- case core::style::CLEAR_NONE: break;
- case core::style::CLEAR_LEFT: left = true; break;
- case core::style::CLEAR_RIGHT: right = true; break;
- case core::style::CLEAR_BOTH: left = right = true; break;
+ case CLEAR_NONE: break;
+ case CLEAR_LEFT: left = true; break;
+ case CLEAR_RIGHT: right = true; break;
+ case CLEAR_BOTH: left = right = true; break;
default: assertNotReached ();
}
@@ -1828,14 +1832,15 @@ void OutOfFlowMgr::ensureFloatSize (Float *vloat)
}
}
-void OutOfFlowMgr::getAbsolutelyPositionedSize (int *oofWidthAbsPos,
- int *oofHeightAbsPos)
+void OutOfFlowMgr::getAbsolutelyPositionedSize (Requisition *cbReq, int *width,
+ int *height)
{
// TODO
- *oofWidthAbsPos = *oofHeightAbsPos = 0;
+ *width = *height = 0;
}
-void OutOfFlowMgr::getAbsolutelyPositionedExtremes (int *minWidth,
+void OutOfFlowMgr::getAbsolutelyPositionedExtremes (Extremes *cbExtr,
+ int *minWidth,
int *maxWidth)
{
// TODO
diff --git a/dw/outofflowmgr.hh b/dw/outofflowmgr.hh
index 88e3afb4..8484cad7 100644
--- a/dw/outofflowmgr.hh
+++ b/dw/outofflowmgr.hh
@@ -272,8 +272,10 @@ private:
void getFloatsListsAndSide (Float *vloat, SortedFloatsVector **listSame,
SortedFloatsVector **listOpp, Side *side);
- void getFloatsSize (Side side, int *width, int *height);
- void getFloatsExtremes (Side side, int *minWidth, int *maxWidth);
+ void getFloatsSize (core::Requisition *cbReq, Side side, int *width,
+ int *height);
+ void getFloatsExtremes (core::Extremes *cbExtr, Side side, int *minWidth,
+ int *maxWidth);
TBInfo *getTextblock (Textblock *textblock);
int getBorder (Textblock *textblock, Side side, int y, int h,
@@ -289,8 +291,10 @@ private:
void tellFloatPosition (core::Widget *widget, int yReq);
- void getAbsolutelyPositionedSize (int *oofWidthAbsPos, int *oofHeightAbsPos);
- void getAbsolutelyPositionedExtremes (int *minWidth, int *maxWidth);
+ void getAbsolutelyPositionedSize (core::Requisition *cbReq, int *width,
+ int *height);
+ void getAbsolutelyPositionedExtremes (core::Extremes *cbExtr, int *minWidth,
+ int *maxWidth);
void ensureAbsolutelyPositionedSizeAndPosition (AbsolutelyPositioned
*abspos);
int calcValueForAbsolutelyPositioned (AbsolutelyPositioned *abspos,
@@ -376,8 +380,9 @@ public:
void tellPosition (core::Widget *widget, int yReq);
- void getSize (int *oofWidth, int *oofHeight);
- void getExtremes (int *oofMinWidth, int *oofMaxWidth);
+ void getSize (core::Requisition *cbReq, int *oofWidth, int *oofHeight);
+ void getExtremes (core::Extremes *cbExtr,
+ int *oofMinWidth, int *oofMaxWidth);
int getLeftBorder (Textblock *textblock, int y, int h, Textblock *lastGB,
int lastExtIndex);
diff --git a/dw/textblock.cc b/dw/textblock.cc
index ece23491..1d123bfd 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -390,7 +390,7 @@ void Textblock::sizeRequestImpl (core::Requisition *requisition)
if (outOfFlowMgr) {
int oofWidth, oofHeight;
- outOfFlowMgr->getSize (&oofWidth, &oofHeight);
+ outOfFlowMgr->getSize (requisition, &oofWidth, &oofHeight);
requisition->width = misc::max (requisition->width, oofWidth);
if (oofHeight > requisition->ascent + requisition->descent)
requisition->descent = oofHeight - requisition->ascent;
@@ -472,7 +472,7 @@ void Textblock::getExtremesImpl (core::Extremes *extremes)
if (outOfFlowMgr) {
int oofMinWidth, oofMaxWidth;
- outOfFlowMgr->getExtremes (&oofMinWidth, &oofMaxWidth);
+ outOfFlowMgr->getExtremes (extremes, &oofMinWidth, &oofMaxWidth);
DBG_OBJ_MSGF ("resize", 1, "extremes: %d / %d, corrected: %d / %d",
extremes->minWidth, extremes->maxWidth,