]> git.tdb.fi Git - libs/gltk.git/blob - source/lineararrangement.h
Style and comment updates
[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
19         private:
20                 void expand();
21                 void spacing(unsigned);
22                 void split();
23                 void uniform(bool);
24         };
25
26 protected:
27         Side primary = RIGHT;
28         Side opposite = static_cast<Side>(primary^2);
29         Edge next;
30         bool first = true;
31         bool split_here = false;
32         Side gravity = opposite;
33         bool internal_aligned = false;
34         bool uniform = false;
35         Widget *uniform_ref = nullptr;
36         int next_spacing = -1;
37
38         LinearArrangement(Layout &, Side);
39
40 public:
41         void set_uniform(bool);
42         void split();
43         void expand();
44         void spacing(unsigned);
45
46 protected:
47         void process_widget(Widget &, Side, bool) override;
48         void finish_widget(Widget &) override;
49         void finish_slot() override;
50 };
51
52 } // namespace GLtk
53 } // namespace Msp
54
55 #endif