2 winnie - an experimental window system
4 Copyright (C) 2013 Eleni Maria Stea
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 Author: Eleni Maria Stea <elene.mst@gmail.com>
32 enum State {STATE_NORMAL, STATE_MINIMIZED, STATE_MAXIMIZED, STATE_SHADED};
39 Rect normal_rect; // normal state rectangle managed by the wm
43 std::vector<Window*> children;
47 bool managed; // whether the wm manages (+decorates) this win
54 const Rect &get_rect() const;
55 Rect get_absolute_rect() const;
56 bool contains_point(int ptr_x, int ptr_y);
58 void move(int x, int y);
59 void resize(int x, int y);
61 void set_title(const char *s);
62 const char *get_title() const;
64 /* mark this window as dirty, and notify the window manager
65 * to repaint it, and anything it used to cover.
69 void draw(Rect *dirty_region);
70 void draw_children(const Rect &dirty_region);
72 unsigned char *get_win_start_on_fb();
73 int get_scanline_width();
75 void set_managed(bool managed);
76 bool get_managed() const;
78 void set_focusable(bool focusable);
79 bool get_focusable() const;
81 bool get_dirty() const;
83 void set_display_callback(DisplayFuncType func);
84 void set_keyboard_callback(KeyboardFuncType func);
85 void set_mouse_button_callback(MouseButtonFuncType func);
86 void set_mouse_motion_callback(MouseMotionFuncType func);
88 const DisplayFuncType get_display_callback() const;
89 const KeyboardFuncType get_keyboard_callback() const;
90 const MouseButtonFuncType get_mouse_button_callback() const;
91 const MouseMotionFuncType get_mouse_motion_callback() const;
94 void add_child(Window *win);
95 void remove_child(Window *win);
97 Window **get_children();
98 int get_children_count() const;
100 const Window *get_parent() const;
101 Window *get_parent();
103 void set_state(State state);
104 State get_state() const;
106 // XXX remove if not needed
107 friend class WindowManager;