3 * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
4 * economic rights: Technische Universität Dresden (Germany)
6 * This file is part of TUD:OS and distributed under the terms of the
7 * GNU General Public License 2.
8 * Please see the COPYING-GPL-2 file for details.
12 #include <l4/mag-gfx/geometry>
13 #include <l4/mag-gfx/gfx_colors>
14 #include <l4/mag/server/mode>
15 #include <l4/re/event>
22 namespace Mag_server {
24 using namespace Mag_gfx;
28 class View : public Rect
31 friend class View_stack;
39 void operator = (View const &);
42 explicit View(Rect const &size, unsigned flags = 0)
43 : Rect(size), _flags(flags), _n(0), _pn(0)
46 View *next() const { return _n; }
49 static Rgb32::Color frame_color() { return Rgb32::Color(255, 200, 127); }
50 static Rgb32::Color kill_color() { return Rgb32::Color(255, 0, 0); }
59 void set_geometry(Rect const &p)
60 { this->Rect::operator = (p); }
62 Area size() const { return Area(w(), h()); }
64 bool transparent() const { return _flags & F_transparent; }
65 bool need_frame() const { return _flags & F_need_frame; }
66 bool ignore() const { return _flags & F_ignore; }
67 bool focused() const { return _flags & F_focused; }
69 void set_focus(bool on)
77 virtual void draw(Canvas *, View_stack const *, Mode) const = 0;
78 virtual void handle_event(L4Re::Event_buffer::Event const &, Point const &) {}