]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/container.h
Make font size a property of Style
[libs/gltk.git] / source / container.h
index 32e8157dd15dec6afe64b90a3cf177b9c8bd2760..d1120cd8c36bb1e25fb845f6a20831cc264c057c 100644 (file)
@@ -1,20 +1,22 @@
-/* $Id$
-
-This file is part of libmspgltk
-Copyright © 2009  Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_GLTK_CONTAINER_H_
 #define MSP_GLTK_CONTAINER_H_
 
 #include <list>
+#include <stdexcept>
 #include <sigc++/trackable.h>
 #include "widget.h"
 
 namespace Msp {
 namespace GLtk {
 
+class hierarchy_error: public std::logic_error
+{
+public:
+       hierarchy_error(const std::string &);
+       virtual ~hierarchy_error() throw() { }
+};
+
+
 class Container: virtual public Widget
 {
 protected:
@@ -33,12 +35,15 @@ protected:
        Widget *click_focus;
        unsigned click_button;
 
-       Container(const Resources &);
+       Container();
 public:
        virtual ~Container();
 
        void add(Widget &);
        void remove(Widget &);
+protected:
+       virtual Child *create_child(Widget *);
+public:
        std::list<Widget *> get_children() const;
        Widget *get_child_at(int, int);
        Widget *get_descendant_at(int, int);
@@ -48,7 +53,9 @@ public:
        virtual void pointer_motion(int, int);
        virtual void pointer_leave();
 protected:
-       virtual Child *create_child(Widget *);
+       virtual void on_reparent();
+       virtual void on_child_added(Widget &) { }
+       virtual void on_child_removed(Widget &) { }
 };
 
 } // namespace GLtk