21#include "../lout/debug.hh"
83 "%p, (%d, %d, %d * (%d + %d))",
84 caller, allocation->
x, allocation->
y, allocation->
width,
99 DBG_OBJ_ENTER (
"resize.oofm", 0,
"sizeAllocateEnd",
"%p", caller);
127 bool exceeds =
false;
131 for (
int i = 0; i <
children->size () && !exceeds; i++) {
135 "Does childAlloc = (%d, %d, %d * %d) exceed container "
136 "alloc+req = (%d, %d, %d * %d)?",
137 childAlloc->
x, childAlloc->
y, childAlloc->
width,
142 if (childAlloc->
x + childAlloc->
width
155 DBG_OBJ_MSGF (
"resize.oofm", 1,
"=> %s", exceeds ?
"true" :
"false");
165 for (
int i = 0; i <
children->size(); i++)
166 children->get(i)->widget->containerSizeChanged ();
177 for (
int i = 0; i <
children->size(); i++) {
184 child->
widget->
draw (view, &childArea, context);
199 DBG_OBJ_ENTER (
"construct.oofm", 0,
"addWidgetOOF",
"%p, %p, %d",
200 widget, generator, externalIndex);
202 Child *child =
new Child (widget, generator, externalIndex);
219 int oldStartIndex,
int diff)
221 for (
int i = 0; i <
children->size (); i++) {
244 DBG_OBJ_ENTER (
"events", 0,
"getWidgetAtPoint",
"%d, %d", x, y);
246 Widget *widgetAtPoint = NULL;
248 for (
int i =
children->size() - 1; widgetAtPoint == NULL && i >= 0; i--) {
258 return widgetAtPoint;
267 DBG_OBJ_ENTER (
"resize.oofm", 0,
"tellPosition2",
"%p, %d, %d",
284 Widget *widget,
int x,
int y)
290 Widget *widget,
int x,
int y)
389 for (
int i = 0; i <
children->size(); i++)
390 if (!
children->get(i)->consideredForSize)
397 for (
int i = 0; i <
children->size(); i++)
398 if (!
children->get(i)->consideredForExtremes)
Set at the top when drawing.
Set at the top when getting the widget at the point.
dw::core::Shape implemtation for simple rectangles.
static bool handledByStackingContextMgr(Widget *widget)
bool hasWidgetBeenProcessedAsInterruption(Widget *widget)
An interface to encapsulate platform dependent drawing.
bool consideredForExtremes
OOFAwareWidget * generator
Child(core::Widget *widget, OOFAwareWidget *generator, int externalIndex)
core::Widget * getWidget(int i)
bool allChildrenConsideredForExtremes()
int getLeftBorder(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Get the left border for the vertical position of y, for a height of h", based on floats; relative to ...
void tellPosition1(core::Widget *widget, int x, int y)
Called before tellPosition2, see there for more.
OOFAwareWidget * container
bool hasFloatRight(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Return whether there is a float on the right side.
lout::container::typed::HashTable< lout::object::TypedPointer< dw::core::Widget >, Child > * childrenByWidget
void containerSizeChangedForChildren()
bool affectsRightBorder(core::Widget *widget)
lout::container::typed::Vector< Child > * children
virtual void sizeAllocateChildren()=0
void addWidgetInFlow(OOFAwareWidget *widget, OOFAwareWidget *parent, int externalIndex)
int getLeftFloatHeight(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Assuming there is a float on the left side, return the rest height of it.
bool affectsLeftBorder(core::Widget *widget)
bool getPosBorder(core::style::Length cssValue, int refLength, int *result)
int addWidgetOOF(core::Widget *widget, OOFAwareWidget *generator, int externalIndex)
void markExtremesChange(int ref)
void markSizeChange(int ref)
core::Allocation containerAllocation
void sizeAllocateEnd(OOFAwareWidget *caller)
bool doChildrenExceedContainer()
enum dw::oof::OOFPositionedMgr::@14 containerAllocationState
int getRightFloatHeight(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Assuming there is a float on the right side, return the rest height of it.
void draw(core::View *view, core::Rectangle *area, core::DrawingContext *context)
void tellPosition2(core::Widget *widget, int x, int y)
Called after tellPosition1.
bool containerMustAdjustExtraSpace()
OOFPositionedMgr(OOFAwareWidget *container)
bool mayAffectBordersAtAll()
int getRightBorder(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Get the right border for the vertical position of y, for a height of h, based on floats; relative to ...
int getClearPosition(OOFAwareWidget *widget)
Return value is relative to the calling generator (not container).
void tellIncompletePosition1(core::Widget *generator, core::Widget *widget, int x, int y)
void moveExternalIndices(OOFAwareWidget *generator, int oldStartIndex, int diff)
bool allChildrenConsideredForSize()
bool hasFloatLeft(int y, int h, OOFAwareWidget *lastGen, int lastExtIndex)
Return whether there is a float on the left side.
bool dealingWithSizeOfChild(core::Widget *child)
void tellIncompletePosition2(core::Widget *generator, core::Widget *widget, int x, int y)
void sizeAllocateStart(OOFAwareWidget *caller, core::Allocation *allocation)
core::Widget * getWidgetAtPoint(int x, int y, core::GettingWidgetAtPointContext *context)
Typed version of container::untyped::HashTable.
Typed version of container::untyped::Vector.
A typed version of object::Pointer.
#define DBG_OBJ_ENTER0(aspect, prio, funname)
#define DBG_OBJ_CREATE(klass)
#define DBG_OBJ_MSG_END()
#define DBG_OBJ_MSGF(aspect, prio, fmt,...)
#define DBG_OBJ_SET_NUM(var, val)
#define DBG_OBJ_MSG(aspect, prio, msg)
#define DBG_OBJ_ENTER(aspect, prio, funname, fmt,...)
#define DBG_OBJ_MSG_START()
#define DBG_OBJ_ARRSET_PTR(var, ind, val)
#define DBG_OBJ_SET_NUM_O(obj, var, val)
#define DBG_OBJ_SET_PTR_O(obj, var, val)
Anything related to Dillo Widget styles is defined here.
int multiplyWithPerLength(int x, Length l)
Multiply an int with a percentage length, returning int.
int Length
Type for representing all lengths within dw::core::style.
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.
The core of Dw is defined in this namespace.
Dw is in this namespace, or sub namespaces of this one.
This namespace provides thin wrappers, implemented as C++ templates, to gain type-safety.
Miscellaneous stuff, which does not fit anywhere else.
Here, some common classes (or interfaces) are defined, to standardize the access to other classes.
Represents the allocation, i.e.