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 and entire Window and accepts
18 input from it. When created, a Root widget will take its size from the window
19 it is created for. The size can be changed, but a Root should always be
20 rendered to fill the window in order to get coordinates mapped correctly.
22 class Root: public Panel, public sigc::trackable
25 sigc::signal<std::string, int, int> signal_tooltip;
28 const Resources &resources;
29 Graphics::Window &window;
30 Input::Keyboard keyboard;
35 Time::TimeStamp tooltip_timeout;
36 Widget *tooltip_target;
39 Root(const Resources &, Graphics::Window &);
41 virtual const char *get_class() const { return "root"; }
43 const Resources &get_resources() const { return resources; }
44 virtual unsigned get_width() const { return geom.w; }
45 virtual unsigned get_height() const { return geom.h; }
51 void button_press_event(unsigned);
52 void button_release_event(unsigned);
53 void axis_motion_event(unsigned, float, float);
54 void key_press_event(unsigned);
55 void key_release_event(unsigned);
56 void character_event(StringCodec::unichar);
58 void get_pointer(int &, int &);