3 * \brief User state manager
5 * \author Norman Feske <norman.feske@genode-labs.com>
9 * Copyright (C) 2005-2009
10 * Genode Labs, Feske & Helmuth Systementwicklung GbR
12 * This file is part of the Genode OS framework, which is distributed
13 * under the terms of the GNU General Public License version 2.
18 #include <l4/scout-gfx/widget>
19 #include <l4/scout-gfx/window>
23 class User_state : public Parent_widget
27 Widget *_mfocus; /* element that owns the current mouse focus */
28 // Widget *_dst; /* current link destination */
29 Widget *_active; /* currently activated element */
31 Point _v; /* current view offset */
34 * Assign new mouse focus element
36 void _assign_mfocus(Widget *e, int force = 0);
44 : _mfocus(0),/* _dst(0),*/ _active(0), _v(Point(0, 0))
50 //Point m() const { return _m; }
51 //Point v() const { return _v; }
54 * Apply input event to mouse focus state
56 Widget *handle_event(Event const &ev);
62 void forget(Widget *e)
64 if (_mfocus == e) _mfocus = 0;
65 // if (_dst == e) _dst = 0;
66 if (_active == e) _active = 0;
69 void draw(Mag_gfx::Canvas *c, Mag_gfx::Point const &p)
71 //Rect r = geometry() + p;
72 Parent_widget::draw(c, p);
75 void size(Mag_gfx::Area const &s) { _size = s; }