-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCanvasMainWindow.h
155 lines (121 loc) · 3.79 KB
/
CanvasMainWindow.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
//
// Copyright 2010-2015 Fabric Software Inc. All rights reserved.
//
#include <QtCore/QSettings>
#include <QtGui/QApplication>
#include <QtGui/QDockWidget>
#include <QtGui/QKeyEvent>
#include <QtGui/QLabel>
#include <QtGui/QMainWindow>
#include <QtGui/QStatusBar>
#include <QtGui/QUndoStack>
#include <FabricUI/DFG/DFGUI.h>
#include <FabricUI/DFG/DFGValueEditor.h>
#include <FabricUI/DFG/DFGUICmdHandler_QUndo.h>
#include <FabricUI/DFG/DFGLogWidget.h>
#include <ASTWrapper/KLASTManager.h>
#include <FabricUI/Viewports/TimeLineWidget.h>
#include <FabricUI/Viewports/GLViewportWidget.h>
#define TimeRange_Default_Frame_In 1
#define TimeRange_Default_Frame_Out 50
using namespace FabricServices;
using namespace FabricUI;
class MainWindow;
class QUndoView;
class MainWindowEventFilter : public QObject
{
public:
MainWindowEventFilter(MainWindow * window);
bool eventFilter(QObject* object, QEvent* event);
private:
MainWindow * m_window;
};
class MainWindow : public DFG::DFGMainWindow
{
Q_OBJECT
friend class MainWindowEventFilter;
public:
MainWindow(
QSettings *settings,
bool unguarded
);
~MainWindow();
void loadGraph( QString const &filePath );
static void CoreStatusCallback( void *userdata, char const *destinationData,
uint32_t destinationLength,
char const *payloadData,
uint32_t payloadLength );
public slots:
void onDirty();
void onValueChanged();
void onStructureChanged();
void onGraphSet(FabricUI::GraphView::Graph * graph);
void onNodeInspectRequested(FabricUI::GraphView::Node * node);
void onNodeEditRequested(FabricUI::GraphView::Node * node);
void onSidePanelInspectRequested();
void onHotkeyPressed(Qt::Key, Qt::KeyboardModifier, QString);
void onNewGraph();
void onLoadGraph();
void onSaveGraph();
void onSaveGraphAs();
void onFrameChanged(int frame);
void updateFPS();
void onPortManipulationRequested(QString portName);
void setBlockCompilations( bool blockCompilations );
void onFileNameChanged(QString fileName);
void enableShortCuts(bool enabled);
private slots:
void onAdditionalMenuActionsRequested(QString name, QMenu * menu, bool prefix);
void autosave();
signals:
void contentChanged();
protected:
void closeEvent( QCloseEvent *event );
bool saveGraph(bool saveAs);
bool checkUnsavedChanged();
bool performSave(
FabricCore::DFGBinding &binding,
QString const &filePath
);
private:
QUndoStack m_qUndoStack;
DFG::DFGUICmdHandler_QUndo m_dfguiCommandHandler;
QSettings *m_settings;
FabricCore::Client m_client;
ASTWrapper::KLASTManager * m_manager;
FabricCore::DFGHost m_host;
FabricCore::RTVal m_evalContext;
DFG::PresetTreeWidget * m_treeWidget;
DFG::DFGWidget * m_dfgWidget;
DFG::DFGValueEditor * m_dfgValueEditor;
FabricUI::GraphView::Graph * m_setGraph;
Viewports::GLViewportWidget * m_viewport;
DFG::DFGLogWidget * m_logWidget;
QUndoView *m_qUndoView;
Viewports::TimeLineWidget * m_timeLine;
int m_timelinePortIndex;
QStatusBar *m_statusBar;
QTimer m_fpsTimer;
QLabel *m_fpsLabel;
QDialog *m_slowOperationDialog;
QLabel *m_slowOperationLabel;
uint32_t m_slowOperationDepth;
QTimer *m_slowOperationTimer;
QAction *m_newGraphAction;
QAction *m_loadGraphAction;
QAction *m_saveGraphAction;
QAction *m_saveGraphAsAction;
QAction *m_quitAction;
QAction *m_manipAction;
QAction * m_setGridVisibleAction;
QAction * m_setUsingStageAction;
QAction * m_resetCameraAction;
QAction * m_clearLogAction;
QAction * m_blockCompilationsAction;
QString m_windowTitle;
QString m_lastFileName;
uint32_t m_lastSavedBindingVersion;
static const uint32_t s_autosaveIntervalSec = 30;
std::string m_autosaveFilename;
uint32_t m_lastAutosaveBindingVersion;
};