This repository has been archived by the owner on Jun 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
mainwindow.h
92 lines (69 loc) · 2.32 KB
/
mainwindow.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QSharedPointer>
#include <functional>
#include <QScopedPointer>
#include <QHash>
#include <QToolButton>
class Session;
class ToolView;
namespace Ui {
class MainWindow;
}
class ToolController;
class EffectController;
class ColorPickerWindow;
class ColorSamplerView;
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
QSharedPointer<Session> session;
QString currentFilePath;
QScopedPointer<ColorSamplerView> colorSampler;
QWidget *currentToolEditor;
QSharedPointer<ToolView> currentToolView;
QScopedPointer<ColorPickerWindow> primaryColorPickerWindow;
bool modified;
bool closeForced;
QSharedPointer<ToolController> currentTool; // FIXME: is this needed?
QSharedPointer<ToolController> lastTool; // used after effect is done
bool isEffectInstanceActive() const { return lastTool; }
void startEffectInstance(QSharedPointer<EffectController> fx);
void startEffectInstanceInterractive(QSharedPointer<EffectController> fx);
/** true = okay, false = callback() will be called later... */
bool makeSureEffectIsDone(std::function<void(bool)> callback);
QHash<ToolController *, QToolButton *> toolButtons;
void updateUIToolSelection();
bool confirmClose(std::function<void(bool)> callback);
bool saveInteractive(std::function<void(bool)> callback);
void saveAsInteractive(std::function<void(bool)> callback);
bool saveTo(const QString &path, QString &error);
void setSession(QSharedPointer<Session> session);
void updateUI();
protected:
void closeEvent(QCloseEvent *) override;
private slots:
void terrainUpdated();
void toolChanged();
void on_actionShow_View_Options_triggered();
void on_actionAbout_Qt_triggered();
void on_actionAbout_triggered();
void on_actionOpen_triggered();
void on_actionSave_triggered();
void on_actionSaveAs_triggered();
void on_actionNewTerrainPlain_triggered();
void on_actionNewTerrainFractal_triggered();
void primaryColorClicked();
void primaryColorPickerClosed();
void primaryColorEdited();
void effectDone();
void on_action_Erosion_triggered();
};
#endif // MAINWINDOW_H