diff options
Diffstat (limited to 'dw')
-rw-r--r-- | dw/bullet.cc | 5 | ||||
-rw-r--r-- | dw/bullet.hh | 1 | ||||
-rw-r--r-- | dw/image.cc | 5 | ||||
-rw-r--r-- | dw/image.hh | 1 | ||||
-rw-r--r-- | dw/outofflowmgr.cc | 10 | ||||
-rw-r--r-- | dw/outofflowmgr.hh | 1 | ||||
-rw-r--r-- | dw/ruler.cc | 5 | ||||
-rw-r--r-- | dw/ruler.hh | 1 | ||||
-rw-r--r-- | dw/table.cc | 11 | ||||
-rw-r--r-- | dw/table.hh | 1 | ||||
-rw-r--r-- | dw/textblock.cc | 12 | ||||
-rw-r--r-- | dw/textblock.hh | 1 | ||||
-rw-r--r-- | dw/ui.cc | 5 | ||||
-rw-r--r-- | dw/ui.hh | 1 | ||||
-rw-r--r-- | dw/widget.hh | 4 |
15 files changed, 62 insertions, 2 deletions
diff --git a/dw/bullet.cc b/dw/bullet.cc index af7f5451..fbb598ee 100644 --- a/dw/bullet.cc +++ b/dw/bullet.cc @@ -36,6 +36,11 @@ void Bullet::sizeRequestImpl (core::Requisition *requisition) requisition->descent = 0; } +void Bullet::containerSizeChangedForChildren () +{ + // Nothing to do. +} + void Bullet::draw (core::View *view, core::Rectangle *area) { int x, y, l; diff --git a/dw/bullet.hh b/dw/bullet.hh index 98854abb..76451cf7 100644 --- a/dw/bullet.hh +++ b/dw/bullet.hh @@ -15,6 +15,7 @@ class Bullet: public core::Widget { protected: void sizeRequestImpl (core::Requisition *requisition); + void containerSizeChangedForChildren (); void draw (core::View *view, core::Rectangle *area); core::Iterator *iterator (core::Content::Type mask, bool atEnd); diff --git a/dw/image.cc b/dw/image.cc index 9c8e5f00..ae48961f 100644 --- a/dw/image.cc +++ b/dw/image.cc @@ -252,6 +252,11 @@ void Image::sizeAllocateImpl (core::Allocation *allocation) } } +void Image::containerSizeChangedForChildren () +{ + // Nothing to do. +} + void Image::enterNotifyImpl (core::EventCrossing *event) { // BUG: this is wrong for image maps, but the cursor position is unknown. diff --git a/dw/image.hh b/dw/image.hh index a712936e..2d3cafd6 100644 --- a/dw/image.hh +++ b/dw/image.hh @@ -131,6 +131,7 @@ private: protected: void sizeRequestImpl (core::Requisition *requisition); void sizeAllocateImpl (core::Allocation *allocation); + void containerSizeChangedForChildren (); void draw (core::View *view, core::Rectangle *area); diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index 9cb3fc36..c774d0d9 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -641,6 +641,16 @@ void OutOfFlowMgr::sizeAllocateEnd (Textblock *caller) DBG_OBJ_MSG_END (); } +void OutOfFlowMgr::containerSizeChangedForChildren () +{ + for (int i = 0; i < leftFloatsCB->size (); i++) + leftFloatsCB->get(i)->getWidget()->containerSizeChanged (); + for (int i = 0; i < rightFloatsCB->size (); i++) + rightFloatsCB->get(i)->getWidget()->containerSizeChanged (); + for (int i = 0; i < absolutelyPositioned->size(); i++) + absolutelyPositioned->get(i)->widget->containerSizeChanged (); +} + bool OutOfFlowMgr::hasRelationChanged (TBInfo *tbInfo, int *minFloatPos, Widget **minFloat) { diff --git a/dw/outofflowmgr.hh b/dw/outofflowmgr.hh index 441c4408..19205717 100644 --- a/dw/outofflowmgr.hh +++ b/dw/outofflowmgr.hh @@ -394,6 +394,7 @@ public: void sizeAllocateStart (Textblock *caller, core::Allocation *allocation); void sizeAllocateEnd (Textblock *caller); + void containerSizeChangedForChildren (); void draw (core::View *view, core::Rectangle *area); void markSizeChange (int ref); diff --git a/dw/ruler.cc b/dw/ruler.cc index 3d3bc0b8..82cc3299 100644 --- a/dw/ruler.cc +++ b/dw/ruler.cc @@ -51,6 +51,11 @@ bool Ruler::isBlockLevel () return true; } +void Ruler::containerSizeChangedForChildren () +{ + // Nothing to do. +} + bool Ruler::usesAvailWidth () { return true; diff --git a/dw/ruler.hh b/dw/ruler.hh index 1f2e80b0..1f3491bc 100644 --- a/dw/ruler.hh +++ b/dw/ruler.hh @@ -18,6 +18,7 @@ class Ruler: public core::Widget protected: void sizeRequestImpl (core::Requisition *requisition); void getExtremesImpl (core::Extremes *extremes); + void containerSizeChangedForChildren (); bool usesAvailWidth (); void draw (core::View *view, core::Rectangle *area); diff --git a/dw/table.cc b/dw/table.cc index c968627d..7546ffff 100644 --- a/dw/table.cc +++ b/dw/table.cc @@ -255,6 +255,17 @@ int Table::getAvailWidthOfChild (Widget *child, bool forceValue) return width; } +void Table::containerSizeChangedForChildren () +{ + for (int col = 0; col < numCols; col++) { + for (int row = 0; row < numRows; row++) { + int n = row * numCols + col; + if (childDefined (n)) + children->get(n)->cell.widget->containerSizeChanged (); + } + } +} + bool Table::usesAvailWidth () { return true; diff --git a/dw/table.hh b/dw/table.hh index 03eb410d..a1e0ed38 100644 --- a/dw/table.hh +++ b/dw/table.hh @@ -427,6 +427,7 @@ protected: void resizeDrawImpl (); int getAvailWidthOfChild (Widget *child, bool forceValue); + void containerSizeChangedForChildren (); bool usesAvailWidth (); bool isBlockLevel (); diff --git a/dw/textblock.cc b/dw/textblock.cc index 4601a5c4..34e5084b 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -607,6 +607,18 @@ void Textblock::sizeAllocateImpl (core::Allocation *allocation) } } +void Textblock::containerSizeChangedForChildren () +{ + for (int i = 0; i < words->size (); i++) { + Word *word = words->getRef (i); + if (word->content.type == core::Content::WIDGET_IN_FLOW) + word->content.widget->containerSizeChanged (); + } + + if (outOfFlowMgr) + outOfFlowMgr->containerSizeChangedForChildren (); +} + bool Textblock::usesAvailWidth () { return true; diff --git a/dw/textblock.hh b/dw/textblock.hh index 8f38ccc2..48bd424e 100644 --- a/dw/textblock.hh +++ b/dw/textblock.hh @@ -747,6 +747,7 @@ protected: void sizeRequestImpl (core::Requisition *requisition); void getExtremesImpl (core::Extremes *extremes); void sizeAllocateImpl (core::Allocation *allocation); + void containerSizeChangedForChildren (); bool usesAvailWidth (); void resizeDrawImpl (); @@ -64,6 +64,11 @@ void Embed::sizeAllocateImpl (Allocation *allocation) resource->sizeAllocate (allocation); } +void Embed::containerSizeChangedForChildren () +{ + // Nothing to do (as long as all resources return empty iterators). +} + void Embed::enterNotifyImpl (core::EventCrossing *event) { resource->emitEnter(); @@ -231,6 +231,7 @@ protected: void sizeRequestImpl (Requisition *requisition); void getExtremesImpl (Extremes *extremes); void sizeAllocateImpl (Allocation *allocation); + void containerSizeChangedForChildren (); void enterNotifyImpl (core::EventCrossing *event); void leaveNotifyImpl (core::EventCrossing *event); bool buttonPressImpl (core::EventButton *event); diff --git a/dw/widget.hh b/dw/widget.hh index 2e51e32c..814771b5 100644 --- a/dw/widget.hh +++ b/dw/widget.hh @@ -171,8 +171,6 @@ private: { queueResize (ref, extremesChanged, true); } void actualQueueResize (int ref, bool extremesChanged, bool fast); - void containerSizeChanged (); - public: /** * \brief This value is defined by the parent widget, and used for @@ -454,6 +452,8 @@ public: virtual bool isBlockLevel (); virtual bool isPossibleContainer (); + void containerSizeChanged (); + bool intersects (Rectangle *area, Rectangle *intersection); /** Area is given in widget coordinates. */ |