]> git.tdb.fi Git - libs/gltk.git/blob - source/lineararrangement.h
f0ec2453d02121d445b3caf9b3307948709c0110
[libs/gltk.git] / source / lineararrangement.h
1 #ifndef MSP_GLTK_LINEARARRANGEMENT_H_
2 #define MSP_GLTK_LINEARARRANGEMENT_H_
3
4 #include <msp/datafile/objectloader.h>
5 #include "arrangement.h"
6 #include "mspgltk_api.h"
7
8 namespace Msp {
9 namespace GLtk {
10
11 class MSPGLTK_API LinearArrangement: public Arrangement
12 {
13 public:
14         class MSPGLTK_API Loader: public DataFile::ObjectLoader<LinearArrangement>
15         {
16         public:
17                 Loader(LinearArrangement &);
18         private:
19                 void expand();
20                 void spacing(unsigned);
21                 void split();
22                 void uniform(bool);
23         };
24
25 protected:
26         Side primary = RIGHT;
27         Side opposite = static_cast<Side>(primary^2);
28         Edge next;
29         bool first = true;
30         bool split_here = false;
31         Side gravity = opposite;
32         bool internal_aligned = false;
33         bool uniform = false;
34         Widget *uniform_ref = nullptr;
35         int next_spacing = -1;
36
37         LinearArrangement(Layout &, Side);
38
39 public:
40         void set_uniform(bool);
41         void split();
42         void expand();
43         void spacing(unsigned);
44
45 protected:
46         virtual void process_widget(Widget &, Side, bool);
47         virtual void finish_widget(Widget &);
48         virtual void finish_slot();
49 };
50
51 } // namespace GLtk
52 } // namespace Msp
53
54 #endif