+
+void Window::set_managed(bool managed)
+{
+ this->managed = managed;
+}
+
+bool Window::get_managed() const
+{
+ return managed;
+}
+
+void Window::set_focusable(bool focusable)
+{
+ this->focusable = focusable;
+}
+
+bool Window::get_focusable() const
+{
+ return focusable;
+}
+
+bool Window::get_dirty() const
+{
+ return dirty;
+}
+
+void Window::set_display_callback(DisplayFuncType func)
+{
+ callbacks.display = func;
+}
+
+void Window::set_keyboard_callback(KeyboardFuncType func)
+{
+ callbacks.keyboard = func;
+}
+
+void Window::set_mouse_button_callback(MouseButtonFuncType func)
+{
+ callbacks.button = func;
+}
+
+void Window::set_mouse_motion_callback(MouseMotionFuncType func)
+{
+ callbacks.motion = func;
+}
+
+const DisplayFuncType Window::get_display_callback() const
+{
+ return callbacks.display;
+}
+
+const KeyboardFuncType Window::get_keyboard_callback() const
+{
+ return callbacks.keyboard;
+}
+
+const MouseButtonFuncType Window::get_mouse_button_callback() const
+{
+ return callbacks.button;
+}
+
+const MouseMotionFuncType Window::get_mouse_motion_callback() const
+{
+ return callbacks.motion;
+}
+
+void Window::add_child(Window *win)
+{
+ children.push_back(win);
+ if(win->parent) {
+ win->parent->remove_child(win);
+ }
+ win->parent = this;
+}
+
+void Window::remove_child(Window *win)
+{
+ std::vector<Window*>::iterator it;
+ it = std::find(children.begin(), children.end(), win);
+ if(it != children.end()) {
+ children.erase(it);
+ win->parent = 0;
+ }
+}
+
+Window **Window::get_children()
+{
+ if(children.empty()) {
+ return 0;
+ }
+ return &children[0];
+}
+
+int Window::get_children_count() const
+{
+ return (int)children.size();
+}
+
+const Window *Window::get_parent() const
+{
+ return parent;
+}
+
+Window *Window::get_parent()
+{
+ return parent;
+}
+
+void Window::set_state(State state)
+{
+ this->state = state;
+}
+
+Window::State Window::get_state() const
+{
+ return state;
+}