]> git.tdb.fi Git - libs/gltk.git/blob - source/grid.h
Style and comment updates
[libs/gltk.git] / source / grid.h
1 #ifndef MSP_GLTK_GRID_H_
2 #define MSP_GLTK_GRID_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 Grid: public Arrangement
12 {
13 public:
14         class Loader: public DataFile::ObjectLoader<Grid>
15         {
16         public:
17                 Loader(Grid &);
18
19         private:
20                 void next_row();
21                 void skip();
22         };
23
24 private:
25         struct Column
26         {
27                 Edge left;
28                 Edge right;
29         };
30
31         std::vector<Column> columns;
32         Edge row_top;
33         Edge row_bottom;
34         bool first_row = true;
35         std::size_t column = 0;
36
37 public:
38         Grid(Layout &, std::size_t);
39
40         void skip();
41         void next_row();
42
43 private:
44         void process_widget(Widget &, Side, bool) override;
45         void finish_widget(Widget &) override;
46         void finish_slot() override;
47         void finish_row();
48 };
49
50 } // namespace GLtk
51 } // namespace Msp
52
53 #endif