1 #ifndef MSP_GLTK_ARRANGEMENT_H_
2 #define MSP_GLTK_ARRANGEMENT_H_
6 #include <msp/core/noncopyable.h>
8 #include "mspgltk_api.h"
15 class MSPGLTK_API arrangement_error: public std::logic_error
18 arrangement_error(const std::string &w): std::logic_error(w) { }
21 class MSPGLTK_API Arrangement: public NonCopyable
34 std::list<Widget *> widgets;
37 bool empty() { return widgets.empty(); }
39 void add(Widget &, bool);
44 Arrangement *parent = nullptr;
47 Arrangement(Layout &);
49 virtual ~Arrangement();
51 void arrange(Widget &);
52 void arrange(Arrangement &);
55 virtual void process_widget(Widget &, Side, bool) = 0;
56 virtual void finish_widget(Widget &) = 0;
57 virtual void finish_slot() = 0;
58 const Edge &get_edge(Side s) const { return edges[s]; }
59 void add_constraint(Widget &, Layout::ConstraintType, Side, int = -1);
60 void add_constraint(Widget &, Layout::ConstraintType, const Edge &, int = -1);
62 static Layout::ConstraintType get_order_constraint(Side, bool);
63 static Layout::ConstraintType get_align_constraint(Side);