6 Root::Root(Resources &r, Window &w):
10 set_geometry(Geometry(0, 0, window.get_width(), window.get_height()));
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));
19 void Root::button_press_event(int x, int y, unsigned btn, unsigned)
21 translate_coords(x, y);
22 button_press(x, y, btn);
25 void Root::button_release_event(int x, int y, unsigned btn, unsigned)
27 translate_coords(x, y);
28 button_release(x, y, btn);
31 void Root::pointer_motion_event(int x, int y)
33 translate_coords(x, y);
37 void Root::translate_coords(int &x, int &y)
39 x=x*geom.w/window.get_width();
40 y=geom.h-1-y*geom.h/window.get_height();