+
+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;
+}