]> git.tdb.fi Git - libs/gltk.git/blob - source/root.h
Add icon support to Button
[libs/gltk.git] / source / root.h
1 /* $Id$
2
3 This file is part of libmspgltk
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GLTK_ROOT_H_
9 #define MSP_GLTK_ROOT_H_
10
11 #include <msp/gbase/window.h>
12 #include "panel.h"
13
14 namespace Msp {
15 namespace GLtk {
16
17 /**
18 A Root is a special type of Panel that covers and entire Window and accepts
19 input from it.  When created, a Root widget will take its size from the window
20 it is created for.  The size can be changed, but a Root should always be
21 rendered to fill the window in order to get coordinates mapped correctly.
22 */
23 class Root: public Panel
24 {
25 private:
26         Graphics::Window &window;
27
28 public:
29         Root(const Resources &, Graphics::Window &);
30 private:
31         virtual const char *get_class() const { return "root"; }
32         void button_press_event(int, int, unsigned, unsigned);
33         void button_release_event(int, int, unsigned, unsigned);
34         void pointer_motion_event(int, int);
35         void key_press_event(unsigned, unsigned, wchar_t);
36         void key_release_event(unsigned, unsigned);
37         void translate_coords(int &, int &);
38 };
39
40 } // namespace GLtk
41 } // namespace Msp
42
43 #endif