52 for (
int i = 0; i <
children->size(); i++) {
55 int x, y, width, ascent, descent;
62 childAllocation.
width = width;
63 childAllocation.
ascent = ascent;
64 childAllocation.
descent = descent;
79 *oofWidth = *oofHeight = 0;
84 for (
int i = 0; i <
children->size(); i++) {
90 int x, y, width, ascent, descent;
108 DBG_OBJ_ENTER (
"resize.oofm", 0,
"getExtremes",
"(%d / %d), ...",
111 *oofMinWidth = *oofMaxWidth = 0;
113 for (
int i = 0; i <
children->size(); i++) {
138 *oofMinWidth =
max (*oofMinWidth, x + width);
142 *oofMaxWidth =
max (*oofMaxWidth, x + width);
152 DBG_OBJ_MSGF (
"resize.oofm", 0,
"=> %d / %d", *oofMinWidth, *oofMaxWidth);
159 "OOFPositionedMgr/getAvailWidthOfChild",
"%p, %s",
160 child, forceValue ?
"true" :
"false");
169 DBG_OBJ_MSG (
"resize.oofm", 1,
"no specification");
174 if (!
getPosLeft (child, availWidth, &left)) left = 0;
175 if (!
getPosRight (child, availWidth, &right)) right = 0;
202 "OOFPositionedMgr/getAvailHeightOfChild",
"%p, %s",
203 child, forceValue ?
"true" :
"false");
212 DBG_OBJ_MSG (
"resize.oofm", 1,
"no specification");
217 if (!
getPosTop (child, availHeight, &top)) top = 0;
218 if (!
getPosBottom (child, availHeight, &bottom)) bottom = 0;
265 int refHeight,
int *xPtr,
266 int *yPtr,
int *widthPtr,
272 DBG_OBJ_ENTER (
"resize.oofm", 0,
"calcPosAndSizeChildOfChild",
273 "[%p], %d, %d, ...", child->
widget, refWidth, refHeight);
286 childRequisition.
descent, yPtr, ascentPtr,
294 int *xPtr,
int *widthPtr)
296 assert (refWidth != -1 || (xPtr == NULL && widthPtr == NULL));
307 DBG_OBJ_MSGF (
"resize.oofm", 1,
"percentage width: %g%%",
315 DBG_OBJ_MSG (
"resize.oofm", 1,
"width not specified");
316 width = origChildWidth;
317 widthDefined =
false;
324 "=> left = %d, right = %d, width = %d (defined: %s)",
325 left, right, width, widthDefined ?
"true" :
"false");
328 if (!leftDefined && !rightDefined)
331 if (!leftDefined && rightDefined)
333 else if (leftDefined && !rightDefined)
339 DBG_OBJ_MSGF (
"resize.oofm", 0,
"=> width (corrected) = %d",
354 int origChildDescent,
355 int *yPtr,
int *ascentPtr,
358 assert (refHeight != -1 ||
359 (yPtr == NULL && ascentPtr == NULL && descentPtr == NULL));
361 int ascent = origChildAscent, descent = origChildDescent;
365 DBG_OBJ_MSGF (
"resize.oofm", 1,
"absolute height: %dpx",
370 heightDefined =
true;
372 DBG_OBJ_MSGF (
"resize.oofm", 1,
"percentage height: %g%%",
380 heightDefined =
true;
382 DBG_OBJ_MSG (
"resize.oofm", 1,
"height not specified");
383 heightDefined =
false;
390 "=> top = %d, bottom = %d, height = %d + %d (defined: %s)",
391 top, bottom, ascent, descent,
392 heightDefined ?
"true" :
"false");
395 if (!topDefined && !bottomDefined)
398 if (!topDefined && bottomDefined)
399 *yPtr = refHeight - (ascent + descent) - bottom
401 else if (topDefined && !bottomDefined)
405 if (!heightDefined) {
410 "=> ascent + descent (corrected) = %d + %d",
422 *descentPtr = descent;
void calcVPosAndSizeChildOfChild(Child *child, int refHeight, int origChildAscent, int origChildDescent, int *yPtr, int *ascentPtr, int *descentPtr)
void getSize(core::Requisition *containerReq, int *oofWidth, int *oofHeight)
int getAvailHeightOfChild(core::Widget *child, bool forceValue)
virtual int containerBoxOffsetY()=0
void calcPosAndSizeChildOfChild(Child *child, int refWidth, int refHeight, int *xPtr, int *yPtr, int *widthPtr, int *ascentPtr, int *descentPtr)
void getExtremes(core::Extremes *containerExtr, int *oofMinWidth, int *oofMaxWidth)
int containerBoxDiffHeight()
bool posXAbsolute(Child *child)
void calcWidgetRefSize(core::Widget *widget, core::Requisition *size)
virtual int containerBoxRestWidth()=0
void calcHPosAndSizeChildOfChild(Child *child, int refWidth, int origChildWidth, int *xPtr, int *widthPtr)
int getAvailWidthOfChild(core::Widget *child, bool forceValue)
virtual int containerBoxOffsetX()=0
int containerBoxDiffWidth()
bool posYAbsolute(Child *child)
void sizeAllocateChildren()
OOFPosAbsLikeMgr(OOFAwareWidget *container)
bool consideredForExtremes
OOFAwareWidget * container
bool posXDefined(Child *child)
bool posYDefined(Child *child)
lout::container::typed::Vector< Child > * children
bool getPosLeft(core::Widget *child, int availWidth, int *result)
int generatorPosX(Child *child)
int generatorPosY(Child *child)
bool getPosRight(core::Widget *child, int availWidth, int *result)
core::Allocation containerAllocation
bool getPosTop(core::Widget *child, int availHeight, int *result)
bool getPosBottom(core::Widget *child, int availHeight, int *result)
#define DBG_OBJ_ENTER0(aspect, prio, funname)
#define DBG_OBJ_CREATE(klass)
#define DBG_OBJ_MSGF(aspect, prio, fmt,...)
#define DBG_OBJ_MSG(aspect, prio, msg)
#define DBG_OBJ_ENTER(aspect, prio, funname, fmt,...)
#define DBG_OBJ_LEAVE_VAL(fmt,...)
int multiplyWithPerLength(int x, Length l)
Multiply an int with a percentage length, returning int.
double perLengthVal_useThisOnlyForDebugging(Length l)
Returns the value of a percentage, relative to 1, as a double.
bool isPerLength(Length l)
Returns true if l is a percentage.
bool isAbsLength(Length l)
Returns true if l is an absolute length.
int absLengthVal(Length l)
Returns the value of a length in pixels, as an integer.
@ LENGTH_AUTO
Represents "auto" lengths.
The core of Dw is defined in this namespace.
void splitHeightPreserveAscent(int height, int *ascent, int *descent)
Dw is in this namespace, or sub namespaces of this one.
Miscellaneous stuff, which does not fit anywhere else.
const char * boolToStr(bool b)
Represents the allocation, i.e.