]> git.tdb.fi Git - libs/gltk.git/blobdiff - source/lineararrangement.h
Rework how widget ownership works in Container
[libs/gltk.git] / source / lineararrangement.h
index a18c849fcafacf210a5381e2e0ce90f98ca89e42..6f3c26ace105f96d4a47c2230d9d1fa930a1e4a0 100644 (file)
@@ -3,40 +3,50 @@
 
 #include <msp/datafile/objectloader.h>
 #include "arrangement.h"
+#include "mspgltk_api.h"
 
 namespace Msp {
 namespace GLtk {
 
-class LinearArrangement: public Arrangement
+class MSPGLTK_API LinearArrangement: public Arrangement
 {
 public:
-       class Loader: public DataFile::ObjectLoader<LinearArrangement>
+       class MSPGLTK_API Loader: public DataFile::ObjectLoader<LinearArrangement>
        {
        public:
                Loader(LinearArrangement &);
+
        private:
                void expand();
+               void spacing(unsigned);
                void split();
+               void uniform(bool);
        };
 
 protected:
-       Side primary;
-       Side opposite;
+       Side primary = RIGHT;
+       Side opposite = static_cast<Side>(primary^2);
        Edge next;
-       bool first;
-       bool split_here;
-       Side gravity;
-       bool internal_aligned;
+       bool first = true;
+       bool split_here = false;
+       Side gravity = opposite;
+       bool internal_aligned = false;
+       bool uniform = false;
+       Widget *uniform_ref = nullptr;
+       int next_spacing = -1;
 
        LinearArrangement(Layout &, Side);
 
 public:
+       void set_uniform(bool);
        void split();
        void expand();
+       void spacing(unsigned);
 
 protected:
-       virtual void process_widget(Widget &, Side, bool);
-       virtual void finish_slot();
+       void process_widget(Widget &, Side, bool) override;
+       void finish_widget(Widget &) override;
+       void finish_slot() override;
 };
 
 } // namespace GLtk