*work in progress*
[winnie] / src / window.cc
index af30e3c..84d1004 100644 (file)
@@ -22,6 +22,17 @@ const Rect &Window::get_rect() const
        return rect;
 }
 
+bool Window::contains_point(int ptr_x, int ptr_y)
+{
+       if((rect.x <= ptr_x) && ((rect.x + rect.width) >= ptr_x)) {
+               if((rect.y <= ptr_y) && (ptr_y <= (rect.y + rect.height))) {
+                       return true;
+               }
+       }
+
+       return false;
+}
+
 void Window::move(int x, int y)
 {
        invalidate();   // moved, should redraw, MUST BE CALLED FIRST
@@ -93,3 +104,23 @@ void Window::set_mouse_motion_callback(MouseMotionFuncType func)
 {
        callbacks.motion = func;
 }
+
+const DisplayFuncType Window::get_display_callback() const
+{
+       return callbacks.display;
+}
+
+const KeyboardFuncType Window::get_keyboard_callback() const
+{
+       return callbacks.keyboard;
+}
+
+const MouseButtonFuncType Window::get_mouse_button_callback() const
+{
+       return callbacks.button;
+}
+
+const MouseMotionFuncType Window::get_mouse_motion_callback() const
+{
+       return callbacks.motion;
+}