X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fwindow.h;h=028343e2b779c3c657db28f6ccfbb8bd89d12a17;hb=be0a7f10421181033894629afbba677986bb9f44;hp=dae3a42f9a5f9a9c6fddbb96212e25ef1da65508;hpb=52e08b5a5e7d44271d217892372c6c0878484c44;p=winnie diff --git a/src/window.h b/src/window.h index dae3a42..028343e 100644 --- a/src/window.h +++ b/src/window.h @@ -1,6 +1,8 @@ #ifndef WINDOW_H_ #define WINDOW_H_ +#include + #include "geom.h" #include "event.h" @@ -10,14 +12,20 @@ private: Rect rect; Callbacks callbacks; + std::vector children; + Window* parent; + bool dirty; + bool managed; // whether the wm manages (+decorates) this win + bool focusable; public: Window(); ~Window(); const Rect &get_rect() const; - bool contains_ptr(int ptr_x, int ptr_y); + Rect get_absolute_rect() const; + bool contains_point(int ptr_x, int ptr_y); void move(int x, int y); void resize(int x, int y); @@ -30,11 +38,20 @@ public: */ void invalidate(); - void draw(); + void draw(const Rect &dirty_region); + void draw_children(const Rect &dirty_region); unsigned char *get_win_start_on_fb(); int get_scanline_width(); + void set_managed(bool managed); + bool get_managed() const; + + void set_focusable(bool focusable); + bool get_focusable() const; + + bool get_dirty() const; + void set_display_callback(DisplayFuncType func); void set_keyboard_callback(KeyboardFuncType func); void set_mouse_button_callback(MouseButtonFuncType func); @@ -45,6 +62,16 @@ public: const MouseButtonFuncType get_mouse_button_callback() const; const MouseMotionFuncType get_mouse_motion_callback() const; + // win hierarchy + void add_child(Window *win); + void remove_child(Window *win); + + Window **get_children(); + int get_children_count() const; + + const Window *get_parent() const; + Window *get_parent(); + // XXX remove if not needed friend class WindowManager; };