X-Git-Url: http://git.mutantstargoat.com?p=winnie;a=blobdiff_plain;f=src%2Fwindow.h;h=040f6b578f47a1ab08333402fa9c4e95b73acf49;hp=f61247d5c0084b02d6aed05842bd891a56db7954;hb=a43297a61d69ca5fa5bb7ae8407757da978b4dd4;hpb=ffd2c0a0f8b898cb4199a0c63aff255a85cc0f11 diff --git a/src/window.h b/src/window.h index f61247d..040f6b5 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,13 +12,18 @@ private: Rect rect; Callbacks callbacks; + std::vector children; + Window* parent; + bool dirty; + bool managed; // whether the wm manages (+decorates) this win public: Window(); ~Window(); const Rect &get_rect() const; + bool contains_point(int ptr_x, int ptr_y); void move(int x, int y); void resize(int x, int y); @@ -29,11 +36,15 @@ 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_display_callback(DisplayFuncType func); void set_keyboard_callback(KeyboardFuncType func); void set_mouse_button_callback(MouseButtonFuncType func); @@ -44,6 +55,13 @@ 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); + + const Window *get_parent() const; + Window *get_parent(); + // XXX remove if not needed friend class WindowManager; };