diff options
author | Sebastian Geerken <devnull@localhost> | 2015-01-31 17:15:19 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-01-31 17:15:19 +0100 |
commit | 20be26d3698eeeeaf2c0a9e55a28831466fc0bd1 (patch) | |
tree | dd0388e3b11d9a409809609f1bf946964ebb58f4 /dw/oofposrelmgr.hh | |
parent | eac1c960c8c875715fdb8d123e4c19302d93eb00 (diff) |
Relative positions, part 6 (hopefully last): calculating the positions.
Diffstat (limited to 'dw/oofposrelmgr.hh')
-rw-r--r-- | dw/oofposrelmgr.hh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/dw/oofposrelmgr.hh b/dw/oofposrelmgr.hh index 90323094..fa58add3 100644 --- a/dw/oofposrelmgr.hh +++ b/dw/oofposrelmgr.hh @@ -2,6 +2,7 @@ #define __DW_OOFPOSRELMGR_HH__ #include "oofpositionedmgr.hh" +#include "oofawarewidget.hh" namespace dw { @@ -12,6 +13,24 @@ class OOFPosRelMgr: public OOFPositionedMgr protected: bool isReference (core::Widget *widget); + int getChildPosDim (core::style::Length posCssValue, + core::style::Length negCssValue, int refPos, + int refLength); + + inline int getChildPosX (Child *child, int refWidth) + { return getChildPosDim + (child->widget->getStyle()->left, child->widget->getStyle()->right, + child->x, refWidth - child->widget->getStyle()->boxDiffWidth ()); } + inline int getChildPosX (Child *child) + { return getChildPosX (child, container->getAvailWidth (true)); } + + inline int getChildPosY (Child *child, int refHeight) + { return getChildPosDim + (child->widget->getStyle()->top, child->widget->getStyle()->bottom, + child->y, refHeight - child->widget->getStyle()->boxDiffHeight ()); } + inline int getChildPosY (Child *child) + { return getChildPosY (child, container->getAvailHeight (true)); } + public: OOFPosRelMgr (OOFAwareWidget *container); ~OOFPosRelMgr (); |