aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devdoc/dw-size-request-pos.doc13
-rw-r--r--dw/textblock.cc7
-rw-r--r--dw/textblock.hh3
-rw-r--r--dw/widget.cc12
-rw-r--r--dw/widget.hh6
5 files changed, 27 insertions, 14 deletions
diff --git a/devdoc/dw-size-request-pos.doc b/devdoc/dw-size-request-pos.doc
index b661500d..5db97c7f 100644
--- a/devdoc/dw-size-request-pos.doc
+++ b/devdoc/dw-size-request-pos.doc
@@ -153,10 +153,15 @@ Plan
Issues
======
-- Since the signature of dw::core::Widget::sizeRequestImpl changes
- quite often during the development of *size requisitions depending
- on positions*, a simpler option dw::core::Widget::sizeRequestSimpl
- has been added. May be removed again, after the design is stable.
+- Since the signature of dw::core::Widget::sizeRequestImpl changes quite often
+ during the development of *size requisitions depending on positions*, a
+ simpler option dw::core::Widget::sizeRequestSimpl has been added. May be
+ removed again, after the design is stable.
+
+- As an alternative, passing the references may be done in a new method, which
+ is called *before* dw::core::Widget::sizeRequestImpl. This makes even more
+ sense, after dw::core::Widget::calcExtraSpace and
+ dw::core::Widget::calcExtraSpaceImpl have been extended by references.
- There may be inconsistencies for widget styles; see
[revision f797436687fe](http://flpsed.org/hgweb/dillo_grows/rev/f797436687fe)
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 9d64c2c9..3b7479af 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -738,11 +738,14 @@ void Textblock::sizeAllocateImpl (core::Allocation *allocation)
DBG_OBJ_LEAVE ();
}
-void Textblock::calcExtraSpaceImpl (bool vertical)
+void Textblock::calcExtraSpaceImpl (bool vertical, int numPos,
+ Widget **references, int *x, int *y)
{
DBG_OBJ_ENTER0 ("resize", 0, "Textblock::calcExtraSpaceImpl");
- OOFAwareWidget::calcExtraSpaceImpl (vertical);
+ sizeRequestParams.fill (numPos, references, x, y);
+
+ OOFAwareWidget::calcExtraSpaceImpl (vertical, numPos, references, x, y);
if (vertical) {
int clearPosition = 0;
diff --git a/dw/textblock.hh b/dw/textblock.hh
index 3120b59e..2346f22d 100644
--- a/dw/textblock.hh
+++ b/dw/textblock.hh
@@ -831,7 +831,8 @@ protected:
void sizeAllocateImpl (core::Allocation *allocation);
- void calcExtraSpaceImpl (bool vertical);
+ void calcExtraSpaceImpl (bool vertical, int numPos, Widget **references,
+ int *x, int *y);
int getAvailWidthOfChild (core::Widget *child, bool forceValue);
int getAvailHeightOfChild (core::Widget *child, bool forceValue);
diff --git a/dw/widget.cc b/dw/widget.cc
index 6f021d72..005fa976 100644
--- a/dw/widget.cc
+++ b/dw/widget.cc
@@ -606,7 +606,7 @@ void Widget::sizeRequest (Requisition *requisition, int numPos,
}
if (callImpl) {
- calcExtraSpace (true);
+ calcExtraSpace (true, numPos, references, x, y);
/** \todo Check requisition == &(this->requisition) and do what? */
sizeRequestImpl (requisition, numPos, references, x, y);
this->requisition = *requisition;
@@ -1044,7 +1044,7 @@ void Widget::getExtremes (Extremes *extremes, int numPos, Widget **references,
}
if (callImpl) {
- calcExtraSpace (false);
+ calcExtraSpace (false, numPos, references, x, y);
// For backward compatibility (part 1/2):
extremes->minWidthIntrinsic = extremes->maxWidthIntrinsic = -1;
@@ -1084,12 +1084,13 @@ void Widget::getExtremes (Extremes *extremes, int numPos, Widget **references,
* If `vertical` is false, only horizontal dimensions are calculated. (This is
* used for extremes.)
*/
-void Widget::calcExtraSpace (bool vertical)
+void Widget::calcExtraSpace (bool vertical, int numPos, Widget **references,
+ int *x, int *y)
{
DBG_OBJ_ENTER0 ("resize", 0, "calcExtraSpace");
extraSpace.top = extraSpace.right = extraSpace.bottom = extraSpace.left = 0;
- calcExtraSpaceImpl (vertical);
+ calcExtraSpaceImpl (vertical, numPos, references, x, y);
if (vertical) {
DBG_OBJ_SET_NUM ("extraSpace.top", extraSpace.top);
@@ -1649,7 +1650,8 @@ void Widget::sizeAllocateImpl (Allocation *allocation)
* If `vertical` is false, only horizontal dimensions are calculated. (This is
* used for extremes.)
*/
-void Widget::calcExtraSpaceImpl (bool vertical)
+void Widget::calcExtraSpaceImpl (bool vertical, int numPos, Widget **references,
+ int *x, int *y)
{
}
diff --git a/dw/widget.hh b/dw/widget.hh
index d2665343..94b8b7ec 100644
--- a/dw/widget.hh
+++ b/dw/widget.hh
@@ -303,7 +303,8 @@ protected:
*/
virtual void getExtremesSimpl (Extremes *extremes);
- virtual void calcExtraSpaceImpl (bool vertical);
+ virtual void calcExtraSpaceImpl (bool vertical, int numPos,
+ Widget **references, int *x, int *y);
/**
* \brief See \ref dw-widget-sizes.
@@ -485,7 +486,8 @@ public:
Widget **references = NULL, int *x = NULL, int *y = NULL);
void sizeAllocate (Allocation *allocation);
- void calcExtraSpace (bool vertical);
+ void calcExtraSpace (bool vertical, int numPos, Widget **references,
+ int *x, int *y);
int getAvailWidth (bool forceValue);
int getAvailHeight (bool forceValue);