]> git.tdb.fi Git - libs/gltk.git/blob - source/root.cpp
83042a63f3c8a62339d40b7ae5708306fef398da
[libs/gltk.git] / source / root.cpp
1 #include "root.h"
2
3 namespace Msp {
4 namespace GLtk {
5
6 Root::Root(Resources &r, Window &w):
7         Panel(r),
8         window(w)
9 {
10         set_geometry(Geometry(0, 0, window.get_width(), window.get_height()));
11
12         update_style();
13
14         window.signal_button_press.connect(sigc::mem_fun(this, &Root::button_press_event));
15         window.signal_button_release.connect(sigc::mem_fun(this, &Root::button_release_event));
16         window.signal_pointer_motion.connect(sigc::mem_fun(this, &Root::pointer_motion_event));
17 }
18
19 void Root::button_press_event(int x, int y, unsigned btn, unsigned)
20 {
21         button_press(x, y, btn);
22 }
23
24 void Root::button_release_event(int x, int y, unsigned btn, unsigned)
25 {
26         button_release(x, y, btn);
27 }
28
29 void Root::pointer_motion_event(int x, int y)
30 {
31         pointer_motion(x, y);
32 }
33
34 } // namespace GLtk
35 } // namespace Msp