10 rect.width = rect.height = 128;
11 memset(&callbacks, 0, sizeof callbacks);
20 const Rect &Window::get_rect() const
25 void Window::move(int x, int y)
27 invalidate(); // moved, should redraw, MUST BE CALLED FIRST
32 void Window::resize(int x, int y)
34 invalidate(); // resized, should redraw, MUST BE CALLED FIRST
39 void Window::set_title(const char *s)
43 title = new char[strlen(s) + 1];
47 const char *Window::get_title() const
52 void Window::invalidate()
55 wm->invalidate_region(rect);
62 callbacks.display(this);
66 unsigned char *Window::get_win_start_on_fb()
68 unsigned char *fb = get_framebuffer();
69 return fb + get_color_depth() * (get_screen_size().x * rect.y + rect.x) / 8;
72 int Window::get_scanline_width()
74 return get_screen_size().x;
77 void Window::set_display_callback(DisplayFuncType func)
79 callbacks.display = func;
82 void Window::set_keyboard_callback(KeyboardFuncType func)
84 callbacks.keyboard = func;
87 void Window::set_mouse_button_callback(MouseButtonFuncType func)
89 callbacks.button = func;
92 void Window::set_mouse_motion_callback(MouseMotionFuncType func)
94 callbacks.motion = func;
97 const DisplayFuncType Window::get_display_callback() const
99 return callbacks.display;
102 const KeyboardFuncType Window::get_keyboard_callback() const
104 return callbacks.keyboard;
107 const MouseButtonFuncType Window::get_mouse_button_callback() const
109 return callbacks.button;
112 const MouseMotionFuncType Window::get_mouse_motion_callback() const
114 return callbacks.motion;