diff options
Diffstat (limited to 'dw/stackingcontextmgr.hh')
-rw-r--r-- | dw/stackingcontextmgr.hh | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/dw/stackingcontextmgr.hh b/dw/stackingcontextmgr.hh new file mode 100644 index 00000000..ee062fba --- /dev/null +++ b/dw/stackingcontextmgr.hh @@ -0,0 +1,50 @@ +#ifndef __DW_STACKINGCONTEXTMGR_HH__ +#define __DW_STACKINGCONTEXTMGR_HH__ + +#ifndef __INCLUDED_FROM_DW_CORE_HH__ +# error Do not include this file directly, use "core.hh" instead. +#endif + +#include "../lout/container.hh" + +#include <limits.h> + +namespace dw { + +namespace core { + +class OOFAwareWidget; + +/** + * \brief ... + */ +class StackingContextMgr +{ +private: + lout::container::typed::Vector<Widget> *scWidgets; + int minZIndex, maxZIndex; + + void draw (View *view, Rectangle *area, int startZIndex, int endZIndex); + +public: + StackingContextMgr (Widget *widget); + ~StackingContextMgr (); + + inline static bool isEstablishingStackingContext (Widget *widget) { + return widget->getStyle()->position != style::POSITION_STATIC && + widget->getStyle()->zIndex != style::Z_INDEX_AUTO; + } + + void addChildSCWidget (Widget *widget); + + inline void drawBottom (View *view, Rectangle *area) + { draw (view, area, INT_MIN, -1); } + inline void drawTop (View *view, Rectangle *area) + { draw (view, area, 0, INT_MAX); } +}; + +} // namespace core + +} // namespace dw + +#endif // __DW_STACKINGCONTEXTMGR_HH__ |