summaryrefslogtreecommitdiff
path: root/dw/stackingcontextmgr.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-10-14 20:08:26 +0200
committerSebastian Geerken <devnull@localhost>2014-10-14 20:08:26 +0200
commit6c5f32b8ec8f9a01ca0ab6107779bfa2eda5299b (patch)
treeab26c5b2c487f61dd1aa2a1cf218b76c1c016460 /dw/stackingcontextmgr.cc
parentd81d40e6849263a18281a5d64b95c2479ee9f120 (diff)
Widget::stackingContextWidget; as well as some cleanup and debug messages.
Diffstat (limited to 'dw/stackingcontextmgr.cc')
-rw-r--r--dw/stackingcontextmgr.cc29
1 files changed, 16 insertions, 13 deletions
diff --git a/dw/stackingcontextmgr.cc b/dw/stackingcontextmgr.cc
index e57c73f0..373756e2 100644
--- a/dw/stackingcontextmgr.cc
+++ b/dw/stackingcontextmgr.cc
@@ -31,30 +31,33 @@ namespace core {
StackingContextMgr::StackingContextMgr (Widget *widget)
{
DBG_OBJ_CREATE ("dw::core::StackingContextMgr");
- scWidgets = new Vector<Widget> (1, false);
- DBG_OBJ_SET_NUM ("scWidgets.size", scWidgets->size());
+
+ this->widget = widget;
+
+ childSCWidgets = new Vector<Widget> (1, false);
+ DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets->size());
minZIndex = maxZIndex = 0; // Just to have some defined values.
}
StackingContextMgr::~StackingContextMgr ()
{
- delete scWidgets;
+ delete childSCWidgets;
DBG_OBJ_DELETE ();
}
void StackingContextMgr::addChildSCWidget (Widget *widget)
{
- if (scWidgets->size () == 0)
+ if (childSCWidgets->size () == 0)
minZIndex = maxZIndex = widget->getStyle()->zIndex;
else {
minZIndex = min (minZIndex, widget->getStyle()->zIndex);
maxZIndex = max (maxZIndex, widget->getStyle()->zIndex);
}
- scWidgets->put (widget);
- DBG_OBJ_SET_NUM ("scWidgets.size", scWidgets->size());
- DBG_OBJ_ARRSET_PTR ("scWidgets", scWidgets->size() - 1, widget);
+ childSCWidgets->put (widget);
+ DBG_OBJ_SET_NUM ("childSCWidgets.size", childSCWidgets->size());
+ DBG_OBJ_ARRSET_PTR ("childSCWidgets", childSCWidgets->size() - 1, widget);
}
void StackingContextMgr::drawBottom (View *view, Rectangle *area)
@@ -85,8 +88,8 @@ void StackingContextMgr::draw (View *view, Rectangle *area, int startZIndex,
DBG_OBJ_MSGF ("draw", 1, "drawing zIndex = %d", zIndex);
DBG_OBJ_MSG_START ();
- for (int i = 0; i < scWidgets->size (); i++) {
- Widget *child = scWidgets->get (i);
+ for (int i = 0; i < childSCWidgets->size (); i++) {
+ Widget *child = childSCWidgets->get (i);
DBG_OBJ_MSGF ("draw", 2, "widget %p has zIndex = %d",
child, child->getStyle()->zIndex);
Rectangle childArea;
@@ -132,12 +135,13 @@ Widget *StackingContextMgr::getWidgetAtPoint (int x, int y, int startZIndex,
DBG_OBJ_MSGF ("events", 1, "searching zIndex = %d", zIndex);
DBG_OBJ_MSG_START ();
- for (int i = 0; i < scWidgets->size () && widgetAtPoint == NULL; i++) {
- Widget *child = scWidgets->get (i);
+ for (int i = 0; i < childSCWidgets->size () && widgetAtPoint == NULL;
+ i++) {
+ Widget *child = childSCWidgets->get (i);
DBG_OBJ_MSGF ("events", 2, "widget %p has zIndex = %d",
child, child->getStyle()->zIndex);
if (child->getStyle()->zIndex == zIndex && child->wasAllocated ())
- widgetAtPoint = scWidgets->get(i)->getWidgetAtPoint (x, y);
+ widgetAtPoint = childSCWidgets->get(i)->getWidgetAtPoint (x, y);
}
DBG_OBJ_MSG_END ();
@@ -148,7 +152,6 @@ Widget *StackingContextMgr::getWidgetAtPoint (int x, int y, int startZIndex,
return widgetAtPoint;
}
-
} // namespace core
} // namespace dw