X-Git-Url: https://eleni.mutantstargoat.com/git/?p=winnie;a=blobdiff_plain;f=src%2Fwindow.h;h=1eebed0469e7e15d6200a35b72890152d645a060;hp=3a9cab0209bba2da8de0b842d9f6f73093bd7233;hb=d114b136897ca569d819da5f9b75bd08f9cbe2c0;hpb=5deac1a20d178aa7d2e8bb5cbc79b6584c6287f5 diff --git a/src/window.h b/src/window.h index 3a9cab0..1eebed0 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,7 +12,12 @@ 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(); @@ -30,11 +37,18 @@ 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; + void set_display_callback(DisplayFuncType func); void set_keyboard_callback(KeyboardFuncType func); void set_mouse_button_callback(MouseButtonFuncType func); @@ -45,6 +59,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; };