added license GPL
[winnie] / src / window.h
index 1eebed0..b5cc360 100644 (file)
@@ -1,3 +1,24 @@
+/*
+winnie - an experimental window system
+
+Copyright (C) 2013 Eleni Maria Stea
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Author: Eleni Maria Stea <elene.mst@gmail.com>
+*/
+
 #ifndef WINDOW_H_
 #define WINDOW_H_
 
@@ -7,9 +28,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<Window*> children;
@@ -24,6 +52,7 @@ public:
        ~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);
@@ -37,7 +66,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();
@@ -49,6 +78,8 @@ public:
        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);
@@ -69,6 +100,9 @@ public:
        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;
 };