X-Git-Url: http://git.mutantstargoat.com?a=blobdiff_plain;f=src%2Fwindow.h;h=ecbee9e2edcf0077656219ff0a83125460bc456f;hb=15e07ead145a859762b48ac9062a07cddf826151;hp=040f6b578f47a1ab08333402fa9c4e95b73acf49;hpb=a43297a61d69ca5fa5bb7ae8407757da978b4dd4;p=winnie diff --git a/src/window.h b/src/window.h index 040f6b5..ecbee9e 100644 --- a/src/window.h +++ b/src/window.h @@ -7,9 +7,16 @@ #include "event.h" class Window { +public: + enum State {STATE_NORMAL, STATE_MINIMIZED, STATE_MAXIMIZED, STATE_SHADED}; + private: char *title; + State state; + Rect rect; + Rect normal_rect; // normal state rectangle managed by the wm + Callbacks callbacks; std::vector children; @@ -17,12 +24,14 @@ private: bool dirty; bool managed; // whether the wm manages (+decorates) this win + bool focusable; public: Window(); ~Window(); const Rect &get_rect() const; + Rect get_absolute_rect() const; bool contains_point(int ptr_x, int ptr_y); void move(int x, int y); @@ -36,7 +45,7 @@ public: */ void invalidate(); - void draw(const Rect &dirty_region); + void draw(Rect *dirty_region); void draw_children(const Rect &dirty_region); unsigned char *get_win_start_on_fb(); @@ -45,6 +54,11 @@ public: 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); @@ -59,9 +73,15 @@ public: 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(); + void set_state(State state); + State get_state() const; + // XXX remove if not needed friend class WindowManager; };