1 #ifndef MSP_GLTK_ROOT_H_
2 #define MSP_GLTK_ROOT_H_
4 #include <sigc++/trackable.h>
5 #include <msp/graphics/window.h>
6 #include <msp/input/keyboard.h>
7 #include <msp/input/mouse.h>
8 #include <msp/time/timestamp.h>
17 A Root is a special type of Panel that covers the entire viewport and receives
18 input from keyboard and mouse.
20 class Root: public Panel, public sigc::trackable
23 sigc::signal<std::string, int, int> signal_tooltip;
26 const Resources &resources;
27 Input::Keyboard *keyboard;
33 Time::TimeStamp tooltip_timeout;
34 Widget *tooltip_target;
37 /** Creates a Root widget for a window. The geometry is set to match the
38 window's size, and input devices are created automatically. */
39 Root(const Resources &, Graphics::Window &);
41 Root(const Resources &, Input::Keyboard *, Input::Mouse *);
47 virtual const char *get_class() const { return "root"; }
49 const Resources &get_resources() const { return resources; }
50 virtual unsigned get_width() const { return geom.w; }
51 virtual unsigned get_height() const { return geom.h; }
57 void button_press_event(unsigned);
58 void button_release_event(unsigned);
59 void axis_motion_event(unsigned, float, float);
60 void key_press_event(unsigned);
61 void key_release_event(unsigned);
62 void character_event(StringCodec::unichar);
64 void get_pointer(int &, int &);