f61247d5c0084b02d6aed05842bd891a56db7954
[winnie] / src / window.h
1 #ifndef WINDOW_H_
2 #define WINDOW_H_
3
4 #include "geom.h"
5 #include "event.h"
6
7 class Window {
8 private:
9         char *title;
10         Rect rect;
11         Callbacks callbacks;
12
13         bool dirty;
14
15 public:
16         Window();
17         ~Window();
18
19         const Rect &get_rect() const;
20
21         void move(int x, int y);
22         void resize(int x, int y);
23
24         void set_title(const char *s);
25         const char *get_title() const;
26
27         /* mark this window as dirty, and notify the window manager
28          * to repaint it, and anything it used to cover.
29          */
30         void invalidate();
31
32         void draw();
33
34         unsigned char *get_win_start_on_fb();
35         int get_scanline_width();
36
37         void set_display_callback(DisplayFuncType func);
38         void set_keyboard_callback(KeyboardFuncType func);
39         void set_mouse_button_callback(MouseButtonFuncType func);
40         void set_mouse_motion_callback(MouseMotionFuncType func);
41
42         const DisplayFuncType get_display_callback() const;
43         const KeyboardFuncType get_keyboard_callback() const;
44         const MouseButtonFuncType get_mouse_button_callback() const;
45         const MouseMotionFuncType get_mouse_motion_callback() const;
46
47         // XXX remove if not needed
48         friend class WindowManager;
49 };
50
51 #endif  // WINDOW_H_