aboutsummaryrefslogtreecommitdiff
path: root/dw/stackingcontextmgr.hh
blob: ee062fbaf248ff5c6e74ee1f227ce62ec13b620e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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__