-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathglobalstate.h
49 lines (37 loc) · 1.03 KB
/
globalstate.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
#ifndef _GLOBALSTATE_H_
#define _GLOBALSTATE_H_
#include <QObject>
#include "editor.h"
#include "stitch.h"
class QUndoGroup;
class Color;
class Document;
class MetaColorManager;
class GlobalState : public QObject
{
Q_OBJECT;
public:
static GlobalState* self() { return instance_; }
GlobalState(QObject *parent = NULL);
~GlobalState();
MetaColorManager* colorManager() { return colorManager_; }
RenderingMode renderingMode() { return renderingMode_; }
ToolMode toolMode() { return toolMode_; }
const Color* color() { return color_; }
Document* activeDocument() { return document_; }
QUndoGroup* undoGroup() { return undoGroup_; }
public slots:
void setRenderingMode(RenderingMode mode);
void setToolMode(ToolMode mode);
void setColor(const Color *color);
void setActiveDocument(Document *document);
private:
static GlobalState *instance_;
MetaColorManager *colorManager_;
RenderingMode renderingMode_;
ToolMode toolMode_;
const Color *color_;
Document *document_;
QUndoGroup *undoGroup_;
};
#endif