X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcontainer.h;h=d1120cd8c36bb1e25fb845f6a20831cc264c057c;hb=c1faa54a3218b53757b8b55de0ff8aa64412253b;hp=0384521d4c8657a9a6282618b90f7b6de7dafa38;hpb=91997dd3189b93a67179822ec2fed5f2a7bddb74;p=libs%2Fgltk.git diff --git a/source/container.h b/source/container.h index 0384521..d1120cd 100644 --- a/source/container.h +++ b/source/container.h @@ -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 +#include #include #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: @@ -39,6 +41,9 @@ public: void add(Widget &); void remove(Widget &); +protected: + virtual Child *create_child(Widget *); +public: std::list get_children() const; Widget *get_child_at(int, int); Widget *get_descendant_at(int, int); @@ -48,8 +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