diff options
author | Sebastian Geerken <devnull@localhost> | 2015-01-31 01:13:01 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-01-31 01:13:01 +0100 |
commit | 6a0a8f19b52f80132ae431db1341ca1971b06981 (patch) | |
tree | cbdecdc63055f83406f9cebbec7764563bdeb707 /dw/oofposabslikemgr.hh | |
parent | 3238f21d277704723582ebaf7f5c9d6e0b042bf9 (diff) |
Relative positions, part 3: more on OOFPosAbsLikeMgr; incomplete implementation of OOFPosRelMgr.
Diffstat (limited to 'dw/oofposabslikemgr.hh')
-rw-r--r-- | dw/oofposabslikemgr.hh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/dw/oofposabslikemgr.hh b/dw/oofposabslikemgr.hh index 0c0e7fef..61c3ed8c 100644 --- a/dw/oofposabslikemgr.hh +++ b/dw/oofposabslikemgr.hh @@ -9,9 +9,61 @@ namespace oof { class OOFPosAbsLikeMgr: public OOFPositionedMgr { +protected: + virtual int containerBoxOffsetX () = 0; + virtual int containerBoxOffsetY () = 0; + virtual int containerBoxRestWidth () = 0; + virtual int containerBoxRestHeight () = 0; + + inline int containerBoxDiffWidth () + { return containerBoxOffsetX () + containerBoxRestWidth (); } + inline int containerBoxDiffHeight () + { return containerBoxOffsetY () + containerBoxRestHeight (); } + + enum { NOT_ALLOCATED, IN_ALLOCATION, WAS_ALLOCATED } + containerAllocationState; + + + bool doChildrenExceedContainer (); + bool haveExtremesChanged (); + void sizeAllocateChildren (); + + bool isHPosComplete (Child *child); + bool isVPosComplete (Child *child); + + bool isHPosCalculable (Child *child, bool allocated); + bool isVPosCalculable (Child *child, bool allocated); + + bool isPosCalculable (Child *child, bool allocated); + + void calcPosAndSizeChildOfChild (Child *child, int refWidth, int refHeight, + int *xPtr, int *yPtr, int *widthPtr, + int *ascentPtr, int *descentPtr); + void calcHPosAndSizeChildOfChild (Child *child, int refWidth, + int origChildWidth, int *xPtr, + int *widthPtr); + void calcVPosAndSizeChildOfChild (Child *child, int refHeight, + int origChildAscent, int origChildDescent, + int *yPtr, int *ascentPtr, + int *descentPtr); + + public: OOFPosAbsLikeMgr (OOFAwareWidget *container); ~OOFPosAbsLikeMgr (); + + void calcWidgetRefSize (core::Widget *widget, core::Requisition *size); + + void sizeAllocateStart (OOFAwareWidget *caller, + core::Allocation *allocation); + void sizeAllocateEnd (OOFAwareWidget *caller); + void getSize (core::Requisition *containerReq, int *oofWidth, + int *oofHeight); + void getExtremes (core::Extremes *containerExtr, + int *oofMinWidth, int *oofMaxWidth); + + int getAvailWidthOfChild (core::Widget *child, bool forceValue); + int getAvailHeightOfChild (core::Widget *child, bool forceValue); }; } // namespace oof |