/
GridManager.h
68 lines (46 loc) · 1.35 KB
/
GridManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#include "GridItem.h"
#include "icommandsystem.h"
#include "ipreferencesystem.h"
#include <list>
namespace ui
{
class GridManager :
public IGridManager
{
private:
typedef std::pair<const std::string, GridItem> NamedGridItem;
typedef std::list<NamedGridItem> GridItems;
GridItems _gridItems;
// The currently active grid size
GridSize _activeGridSize;
sigc::signal<void> _sigGridChanged;
public:
GridManager();
sigc::signal<void> signal_gridChanged() const override;
void gridUp() override;
void gridDown() override;
void setGridSize(GridSize gridSize) override;
float getGridSize() const override;
int getGridPower() const override;
GridLook getMajorLook() const override;
GridLook getMinorLook() const override;
public:
// RegisterableModule implementation
const std::string& getName() const override;
const StringSet& getDependencies() const override;
void initialiseModule(const ApplicationContext& ctx) override;
void shutdownModule() override;
private:
void gridChangeNotify();
void loadDefaultValue();
void populateGridItems();
void registerCommands();
ComboBoxValueList getGridList();
void constructPreferences();
void setGridCmd(const cmd::ArgumentList& args);
void gridUpCmd(const cmd::ArgumentList& args);
void gridDownCmd(const cmd::ArgumentList& args);
static GridLook getLookFromNumber(int i);
};
}