-
Notifications
You must be signed in to change notification settings - Fork 4
/
globalstate.cpp
51 lines (39 loc) · 916 Bytes
/
globalstate.cpp
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
#include <stdio.h>
#include <QUndoGroup>
#include "colormanager.h"
#include "settings.h"
#include "globalstate.h"
GlobalState* GlobalState::instance_ = NULL;
GlobalState::GlobalState(QObject *parent)
: QObject(parent)
{
instance_ = this;
if (Settings::self()->colorFile().isEmpty())
colorManager_ = new MetaColorManager(COLOR_TABLE, this);
else
colorManager_ = new MetaColorManager(Settings::self()->colorFile());
renderingMode_ = RenderingMode_Full;
toolMode_ = ToolMode_Full;
color_ = NULL;
document_ = NULL;
undoGroup_ = new QUndoGroup(this);
}
GlobalState::~GlobalState()
{
}
void GlobalState::setRenderingMode(RenderingMode mode)
{
renderingMode_ = mode;
}
void GlobalState::setToolMode(ToolMode mode)
{
toolMode_ = mode;
}
void GlobalState::setColor(const Color *color)
{
color_ = color;
}
void GlobalState::setActiveDocument(Document *doc)
{
document_ = doc;
}