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/user_state>
14 void User_state::_assign_mfocus(Widget *e, int force )
16 /* return if mouse focus did not change */
17 if (!force && e == _mfocus)
20 /* tell old mouse focus to release focus */
24 /* assign new current mouse focus */
27 /* notify new mouse focus */
32 /* determine new current link destination */
33 Widget *old_dst = _dst;
35 if (_mfocus && (lt = dynamic_cast<Link_token*>(_mfocus)))
41 /* nofify element tree about new link destination */
43 _root->curr_link_destination(_dst);
47 void User_state::handle_event(Event const &ev)
49 Parent_widget::handle_event(ev);
54 _active->handle_event(re);
59 /* find element under the mouse cursor */
71 if (ev.key_cnt != 1 || !e)
76 _am = e->map_to_parent(Point(0,0));
80 _active->handle_event(re);
96 if (Widget *x = find_child(_m))
99 re.m = x->map_from_parent(ev.m);
107 re.m = e->map_from_parent(ev.m);