*work in progress*
[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         // XXX remove if not needed
43         friend class WindowManager;
44 };
45
46 #endif  // WINDOW_H_