2 * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
3 * economic rights: Technische Universität Dresden (Germany)
5 * This file is part of TUD:OS and distributed under the terms of the
6 * GNU General Public License 2.
7 * Please see the COPYING-GPL-2 file for details.
9 #include <l4/scout-gfx/widget>
16 _parent->forget(this);
20 Parent_widget::draw(Canvas *c, Point const &p)
22 for (Widget *e = _first; e; e = e->next)
23 e->try_draw(c, e->pos() + p);
26 void Parent_widget::append(Widget *e)
39 void Parent_widget::remove(Widget *e)
50 /* search specified element in the list */
52 for (; ce && ce->next != e; ce = ce->next)
65 void Parent_widget::forget(Widget *e)
67 if (e->parent() == this)
76 Parent_widget::find_child(Point const &p)
78 /* check if position is outside the parent element */
79 if (!geometry().contains(p))
85 for (Widget *e = _first; e; e = e->next)
87 if (e->geometry().contains(np) && e->findable())
95 Widget::find(Point const &p)
97 if (geometry().contains(p) && _flags.findable)
105 Parent_widget::find(Point const &p)
107 /* check if position is outside the parent element */
108 if (!geometry().contains(p))
115 for (Widget *e = _first; e; e = e->next)
117 Widget *res = e->find(np);
126 Widget::redraw_area(Rect const &r) const
128 /* intersect specified area with element geometry */
129 Rect n = (r & Rect(_size));
134 /* propagate redraw request to the parent */
136 _parent->redraw_area(n + _pos);