src/mainwindow.h

Wed, 14 Mar 2018 12:08:03 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 14 Mar 2018 12:08:03 +0200
changeset 1283
3c3a5eb965f7
parent 1257
0d42a1ebd954
child 1291
9c570a30c98a
permissions
-rw-r--r--

added an MVC interface to the primitives tree

655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
1 /*
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
2 * LDForge: LDraw parts authoring CAD
1072
9ce9496427f2 Happy new year 2017!
Teemu Piippo <teemu@hecknology.net>
parents: 1043
diff changeset
3 * Copyright (C) 2013 - 2017 Teemu Piippo
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
4 *
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
5 * This program is free software: you can redistribute it and/or modify
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
6 * it under the terms of the GNU General Public License as published by
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
8 * (at your option) any later version.
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
9 *
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
10 * This program is distributed in the hope that it will be useful,
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
13 * GNU General Public License for more details.
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
14 *
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
17 */
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
18
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #pragma once
806
4240f47aa2d4 - moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents: 804
diff changeset
20 #include <functional>
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21 #include <QMainWindow>
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 #include <QAction>
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 #include <QListWidget>
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 #include <QRadioButton>
963
c1526d1877d7 More through removal of the vertex object
Teemu Piippo <crimsondusk64@gmail.com>
parents: 962
diff changeset
25 #include <QTreeWidget>
969
b1742ee91d5b Split actions.cpp and actionsEdit.cpp into toolsets.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 968
diff changeset
26 #include <QMetaMethod>
1147
a26568aa3cce Renamed ldObject.cpp → linetypes/modelobject.cpp
Teemu Piippo <teemu@hecknology.net>
parents: 1124
diff changeset
27 #include "linetypes/modelobject.h"
795
195fa1fff9c3 - changed all color usage to use LDColor classes instead of color indices. Added support for direct colors.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 794
diff changeset
28 #include "colors.h"
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
29
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
30 class MessageManager;
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31 class QToolButton;
1103
ac7db4c076c3 Created a new GLRenderer derivative class "Canvas" and made MainWindow use it
Teemu Piippo <teemu@hecknology.net>
parents: 1097
diff changeset
32 class Canvas;
969
b1742ee91d5b Split actions.cpp and actionsEdit.cpp into toolsets.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 968
diff changeset
33 class Toolset;
1017
fc1c13db9618 Renamed ConfigurationValueBag to Configuration and added a pointer to it into HierarchyElement. This helps with the fight against global variables.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1014
diff changeset
34 class Configuration;
1018
49358df9495b Transformed primitive management into a new class PrimitiveManager that is a member of MainWindow
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1017
diff changeset
35 class PrimitiveManager;
1023
9450ac3cd930 Split grid stuff into a new class Grid in grid.cpp/grid.h
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1018
diff changeset
36 class Grid;
1024
67ba0ee049eb Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1023
diff changeset
37 class MathFunctions;
1159
6ad8cdcd88d9 print() is no longer a global function but is tied to HierarchyElement.
Teemu Piippo <teemu@hecknology.net>
parents: 1157
diff changeset
38 class DocumentManager;
6ad8cdcd88d9 print() is no longer a global function but is tied to HierarchyElement.
Teemu Piippo <teemu@hecknology.net>
parents: 1157
diff changeset
39 class LDDocument;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
40
1010
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
41 class ColorToolbarItem
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
42 {
1010
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
43 public:
1043
0091a761daf2 Refactor GuiUtilities
Teemu Piippo <teemu@hecknology.net>
parents: 1031
diff changeset
44 ColorToolbarItem (LDColor color = LDColor{}, QToolButton* toolButton = nullptr);
1010
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
45 LDColor color() const;
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
46 bool isSeparator() const;
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
47 void setColor (LDColor color);
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
48 void setToolButton (QToolButton* value);
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
49 QToolButton* toolButton() const;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
50
1010
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
51 static ColorToolbarItem makeSeparator();
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
52
1010
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
53 private:
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
54 LDColor m_color;
969b48eddd6b A bit more cleanup. Finally removed the PROPERTY macro. (now let's see about making a new one sometime that isn't so terrible?)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 998
diff changeset
55 QToolButton* m_toolButton;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
56 };
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
57
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 790
diff changeset
58 // LDForge's main GUI class.
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
59 class MainWindow : public QMainWindow
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
60 {
806
4240f47aa2d4 - moved most of LDColorData API into LDColor
Santeri Piippo <crimsondusk64@gmail.com>
parents: 804
diff changeset
61 Q_OBJECT
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
62
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 790
diff changeset
63 public:
1017
fc1c13db9618 Renamed ConfigurationValueBag to Configuration and added a pointer to it into HierarchyElement. This helps with the fight against global variables.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1014
diff changeset
64 explicit MainWindow(Configuration& config, QWidget* parent = nullptr, Qt::WindowFlags flags = 0);
857
e62983881460 - fixed crash-on-exit (simply by not running full destruction processing during program termination)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 844
diff changeset
65 ~MainWindow();
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
66
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
67 void addMessage (QString msg);
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
68 void applyToActions (std::function<void(QAction*)> function);
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
69 void changeDocument (LDDocument* f);
1256
3fea6bc1519b removed LDDocument::clearSelection and replaced it with a MainWindow implementation
Santeri Piippo
parents: 1251
diff changeset
70 void clearSelection();
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
71 void closeInitialDocument();
1017
fc1c13db9618 Renamed ConfigurationValueBag to Configuration and added a pointer to it into HierarchyElement. This helps with the fight against global variables.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1014
diff changeset
72 Configuration* config();
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
73 void createBlankDocument();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
74 LDDocument* currentDocument();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
75 void currentDocumentClosed();
1257
0d42a1ebd954 more selection rework
Santeri Piippo
parents: 1256
diff changeset
76 QItemSelectionModel* currentSelectionModel();
997
1b49f34e533d Commit work done on document manager. Happy 3rd birthday LDForge!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 988
diff changeset
77 QKeySequence defaultShortcut (QAction* act);
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
78 void deleteByColor (LDColor color);
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
79 int deleteSelection();
997
1b49f34e533d Commit work done on document manager. Happy 3rd birthday LDForge!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 988
diff changeset
80 DocumentManager* documents() { return m_documents; }
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
81 void doFullRefresh();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
82 void endAction();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
83 class ExtProgramToolset* externalPrograms();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
84 QVariant getConfigValue (QString name);
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
85 class QSettings* getSettings() { return m_settings; }
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
86 LDColor getUniformSelectedColor();
1103
ac7db4c076c3 Created a new GLRenderer derivative class "Canvas" and made MainWindow use it
Teemu Piippo <teemu@hecknology.net>
parents: 1097
diff changeset
87 Canvas* getRendererForDocument(LDDocument* document);
1023
9450ac3cd930 Split grid stuff into a new class Grid in grid.cpp/grid.h
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1018
diff changeset
88 Grid* grid();
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
89 class GuiUtilities* guiUtilities();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
90 void loadShortcuts();
1024
67ba0ee049eb Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1023
diff changeset
91 MathFunctions* mathFunctions() const;
1097
9a9e6ce0c5dc Made a new renderer be created for each document, instead of reusing the same renderer for all documents.
Teemu Piippo <teemu@hecknology.net>
parents: 1090
diff changeset
92 MessageManager* messageLog() const;
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
93 LDDocument* newDocument (bool cache = false);
1090
ed73c4f48ca4 The current document pointer may no longer be null.
Teemu Piippo <teemu@hecknology.net>
parents: 1073
diff changeset
94 void openDocumentForEditing(LDDocument* document);
1018
49358df9495b Transformed primitive management into a new class PrimitiveManager that is a member of MainWindow
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1017
diff changeset
95 PrimitiveManager* primitives();
1103
ac7db4c076c3 Created a new GLRenderer derivative class "Canvas" and made MainWindow use it
Teemu Piippo <teemu@hecknology.net>
parents: 1097
diff changeset
96 Canvas* renderer();
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
97 void refresh();
1257
0d42a1ebd954 more selection rework
Santeri Piippo
parents: 1256
diff changeset
98 void replaceSelection(const QItemSelection& selection);
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
99 bool ringToolHiRes() const;
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
100 int ringToolSegments() const;
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
101 bool save (LDDocument* doc, bool saveAs);
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
102 void saveShortcuts();
1257
0d42a1ebd954 more selection rework
Santeri Piippo
parents: 1256
diff changeset
103 void select(const QModelIndex& objectIndex);
1250
e2755ccf3667 more work on mvc
Santeri Piippo
parents: 1246
diff changeset
104 QModelIndexList selectedIndexes() const;
e2755ccf3667 more work on mvc
Santeri Piippo
parents: 1246
diff changeset
105 QSet<LDObject*> selectedObjects() const;
1043
0091a761daf2 Refactor GuiUtilities
Teemu Piippo <teemu@hecknology.net>
parents: 1031
diff changeset
106 void setQuickColors (const QVector<ColorToolbarItem> &colors);
1031
55c0d3beea0d removed removeDuplicates in favor of QSet, and the unused ObjectList class
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1024
diff changeset
107 void spawnContextMenu (const QPoint& position);
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
108 int suggestInsertPoint();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
109 void syncSettings();
983
05ba93066194 Refactor edit history
Teemu Piippo <crimsondusk64@gmail.com>
parents: 981
diff changeset
110 Q_SLOT void updateActions();
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
111 void updateColorToolbar();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
112 void updateDocumentList();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
113 void updateDocumentListItem (LDDocument* doc);
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
114 void updateEditModeActions();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
115 void updateGridToolBar();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
116 void updateRecentFilesMenu();
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 790
diff changeset
117 void updateTitle();
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
118
1157
1d6d244bdabd Moved GetIcon and makeSettings into the MainWindow namespace as static methods.
Teemu Piippo <teemu@hecknology.net>
parents: 1156
diff changeset
119 static QPixmap getIcon(QString iconName);
1d6d244bdabd Moved GetIcon and makeSettings into the MainWindow namespace as static methods.
Teemu Piippo <teemu@hecknology.net>
parents: 1156
diff changeset
120 static class QSettings* makeSettings(QObject* parent = nullptr);
1d6d244bdabd Moved GetIcon and makeSettings into the MainWindow namespace as static methods.
Teemu Piippo <teemu@hecknology.net>
parents: 1156
diff changeset
121
1159
6ad8cdcd88d9 print() is no longer a global function but is tied to HierarchyElement.
Teemu Piippo <teemu@hecknology.net>
parents: 1157
diff changeset
122 template<typename... Args>
6ad8cdcd88d9 print() is no longer a global function but is tied to HierarchyElement.
Teemu Piippo <teemu@hecknology.net>
parents: 1157
diff changeset
123 void print(QString formatString, Args... args)
6ad8cdcd88d9 print() is no longer a global function but is tied to HierarchyElement.
Teemu Piippo <teemu@hecknology.net>
parents: 1157
diff changeset
124 {
6ad8cdcd88d9 print() is no longer a global function but is tied to HierarchyElement.
Teemu Piippo <teemu@hecknology.net>
parents: 1157
diff changeset
125 formatHelper(formatString, args...);
6ad8cdcd88d9 print() is no longer a global function but is tied to HierarchyElement.
Teemu Piippo <teemu@hecknology.net>
parents: 1157
diff changeset
126 addMessage(formatString);
6ad8cdcd88d9 print() is no longer a global function but is tied to HierarchyElement.
Teemu Piippo <teemu@hecknology.net>
parents: 1157
diff changeset
127 }
6ad8cdcd88d9 print() is no longer a global function but is tied to HierarchyElement.
Teemu Piippo <teemu@hecknology.net>
parents: 1157
diff changeset
128
1113
5f3139c802bf Cleaned up GLCompiler. Among other changes, the compiler no longer has to be told what to compile.
Teemu Piippo <teemu@hecknology.net>
parents: 1103
diff changeset
129 signals:
5f3139c802bf Cleaned up GLCompiler. Among other changes, the compiler no longer has to be told what to compile.
Teemu Piippo <teemu@hecknology.net>
parents: 1103
diff changeset
130 void gridChanged();
5f3139c802bf Cleaned up GLCompiler. Among other changes, the compiler no longer has to be told what to compile.
Teemu Piippo <teemu@hecknology.net>
parents: 1103
diff changeset
131
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 790
diff changeset
132 public slots:
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
133 void actionTriggered();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
134 void circleToolSegmentsChanged();
798
88d4973cfe1a - added close buttons to tabs
Santeri Piippo <crimsondusk64@gmail.com>
parents: 795
diff changeset
135 void closeTab (int tabindex);
983
05ba93066194 Refactor edit history
Teemu Piippo <crimsondusk64@gmail.com>
parents: 981
diff changeset
136 void historyTraversed();
866
4951b737f8cb - now able to spawn partial circular primitives
Teemu Piippo <crimsondusk64@gmail.com>
parents: 865
diff changeset
137 void ringToolHiResClicked (bool clicked);
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
138 void tabSelected();
1097
9a9e6ce0c5dc Made a new renderer be created for each document, instead of reusing the same renderer for all documents.
Teemu Piippo <teemu@hecknology.net>
parents: 1090
diff changeset
139 void documentClosed(LDDocument* document);
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
140
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 790
diff changeset
141 protected:
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 790
diff changeset
142 void closeEvent (QCloseEvent* ev);
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
143
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 790
diff changeset
144 private:
1124
bd151d5c42e6 Moved definition of MainWindow::ToolInfo into mainwindow.cpp
Teemu Piippo <teemu@hecknology.net>
parents: 1113
diff changeset
145 struct ToolInfo;
969
b1742ee91d5b Split actions.cpp and actionsEdit.cpp into toolsets.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 968
diff changeset
146
1017
fc1c13db9618 Renamed ConfigurationValueBag to Configuration and added a pointer to it into HierarchyElement. This helps with the fight against global variables.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1014
diff changeset
147 Configuration& m_config;
974
b2fa5f89798a Added a GuiUtilities class to contain useful non-MainWindow-related GUI functions
Teemu Piippo <crimsondusk64@gmail.com>
parents: 971
diff changeset
148 class GuiUtilities* m_guiUtilities;
1097
9a9e6ce0c5dc Made a new renderer be created for each document, instead of reusing the same renderer for all documents.
Teemu Piippo <teemu@hecknology.net>
parents: 1090
diff changeset
149 MessageManager* m_messageLog = nullptr;
1103
ac7db4c076c3 Created a new GLRenderer derivative class "Canvas" and made MainWindow use it
Teemu Piippo <teemu@hecknology.net>
parents: 1097
diff changeset
150 QMap<LDDocument*, Canvas*> m_renderers;
1246
0054d13ed614 used mvc selection models
Santeri Piippo
parents: 1243
diff changeset
151 QMap<LDDocument*, QItemSelectionModel*> m_selections;
1018
49358df9495b Transformed primitive management into a new class PrimitiveManager that is a member of MainWindow
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1017
diff changeset
152 PrimitiveManager* m_primitives;
1023
9450ac3cd930 Split grid stuff into a new class Grid in grid.cpp/grid.h
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1018
diff changeset
153 Grid* m_grid;
1024
67ba0ee049eb Moved rotation point handling to ldObjectMath.cpp and encapsulated it into new class MathFunctions
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1023
diff changeset
154 MathFunctions* m_mathFunctions;
1043
0091a761daf2 Refactor GuiUtilities
Teemu Piippo <teemu@hecknology.net>
parents: 1031
diff changeset
155 QVector<ColorToolbarItem> m_quickColors;
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 790
diff changeset
156 QList<QToolButton*> m_colorButtons;
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
157 QList<QAction*> m_recentFiles;
965
d1b0aa40db91 MainWindow: "ui->" -> "ui."
Teemu Piippo <crimsondusk64@gmail.com>
parents: 964
diff changeset
158 class Ui_MainWindow& ui;
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
159 QTabBar* m_tabs;
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
160 bool m_updatingTabs;
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
161 QVector<Toolset*> m_toolsets;
969
b1742ee91d5b Split actions.cpp and actionsEdit.cpp into toolsets.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 968
diff changeset
162 QMap<QAction*, ToolInfo> m_toolmap;
970
c8aae45afd85 Commit configuration rework (doesn't work yet, more than most probably doesn't compile either)
Teemu Piippo <crimsondusk64@gmail.com>
parents: 969
diff changeset
163 class ExtProgramToolset* m_externalPrograms;
971
c00f9665a9f8 Now compiles and links but crashes shortly after startup.
Teemu Piippo <crimsondusk64@gmail.com>
parents: 970
diff changeset
164 class QSettings* m_settings;
997
1b49f34e533d Commit work done on document manager. Happy 3rd birthday LDForge!
Teemu Piippo <crimsondusk64@gmail.com>
parents: 988
diff changeset
165 DocumentManager* m_documents;
978
4603d8fd063e Make documents members of the main window
Teemu Piippo <crimsondusk64@gmail.com>
parents: 974
diff changeset
166 LDDocument* m_currentDocument;
998
5be0ce31ce60 Now compiles again
Teemu Piippo <crimsondusk64@gmail.com>
parents: 997
diff changeset
167 QMap<QAction*, QKeySequence> m_defaultShortcuts;
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
168
794
c254ddc6618b - source reformat
Santeri Piippo <crimsondusk64@gmail.com>
parents: 790
diff changeset
169 private slots:
1018
49358df9495b Transformed primitive management into a new class PrimitiveManager that is a member of MainWindow
Teemu Piippo <crimsondusk64@gmail.com>
parents: 1017
diff changeset
170 void finishInitialization();
981
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
171 void recentFileClicked();
5d5d84ab2c48 Refactor MainWindow's API
Teemu Piippo <crimsondusk64@gmail.com>
parents: 978
diff changeset
172 void quickColorClicked();
655
b376645315ab - renamed files to camelCase
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
173 };

mercurial