gui.h

Tue, 09 Apr 2013 17:41:19 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Tue, 09 Apr 2013 17:41:19 +0300
changeset 79
f8917e9d07f6
parent 78
c190fe218506
child 87
8dbf0fdf3374
permissions
-rw-r--r--

Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)

30
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
1 /*
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
2 * LDForge: LDraw parts authoring CAD
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
3 * Copyright (C) 2013 Santeri `arezey` Piippo
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
4 *
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
5 * This program is free software: you can redistribute it and/or modify
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
6 * it under the terms of the GNU General Public License as published by
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
7 * the Free Software Foundation, either version 3 of the License, or
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
8 * (at your option) any later version.
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
9 *
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
10 * This program is distributed in the hope that it will be useful,
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
13 * GNU General Public License for more details.
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
14 *
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
15 * You should have received a copy of the GNU General Public License
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
17 */
31ff9aabd506 Licensed LDForge GPL3, added some more icons
Santeri Piippo <crimsondusk64@gmail.com>
parents: 29
diff changeset
18
0
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
19 #ifndef __GUI_H__
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
20 #define __GUI_H__
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
21
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
22 #include <QMainWindow>
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
23 #include <QMenu>
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
24 #include <QToolBar>
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
25 #include <QAction>
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
26 #include <QTreeWidget>
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
27 #include <QToolBar>
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
28 #include <QTextEdit>
26
83184d9407c7 Renamed io.cpp to file.cpp, draw.cpp to gldraw.cpp
Santeri Piippo <crimsondusk64@gmail.com>
parents: 25
diff changeset
29 #include "gldraw.h"
78
c190fe218506 Keyboard shortcuts can now be configured.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 77
diff changeset
30 #include "config.h"
0
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
31
39
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
32 // Stuff for dialogs
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
33 #define IMPLEMENT_DIALOG_BUTTONS \
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
34 qButtons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel); \
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
35 connect (qButtons, SIGNAL (accepted ()), this, SLOT (accept ())); \
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
36 connect (qButtons, SIGNAL (rejected ()), this, SLOT (reject ())); \
110669124caf Begin work on dialogs for adding objects. Comments functional!
Santeri Piippo <crimsondusk64@gmail.com>
parents: 30
diff changeset
37
79
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
38 // =============================================================================
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
39 // Metadata for actions
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
40 typedef struct {
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
41 QAction** const qAct;
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
42 keyseqconfig* const conf;
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
43 const char* const sDisplayName, *sIconName, *sDescription;
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
44 void (*const handler) ();
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
45 } actionmeta;
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
46
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
47 extern vector<actionmeta> g_ActionMeta;
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
48
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
49 // =============================================================================
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
51 // =============================================================================
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
52 #define ACTION(NAME, DISPLAYNAME, ICONNAME, DESCR, DEFSHORTCUT) \
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
53 QAction* ACTION_NAME (NAME); \
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
54 cfg (keyseq, key_##NAME, DEFSHORTCUT); \
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
55 static void actionHandler_##NAME (); \
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
56 static ActionAdder ActionAdderInstance_##NAME (&ACTION_NAME(NAME), DISPLAYNAME, \
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
57 ICONNAME, DESCR, &key_##NAME, actionHandler_##NAME); \
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
58 static void actionHandler_##NAME ()
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
59
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
60 #define EXTERN_ACTION(NAME) extern QAction* ACTION_NAME (NAME);
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
61 #define ACTION_NAME(N) (LDForgeAction_##N)
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
62
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
63 // Convenience macros for key sequences.
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
64 #define KEY(N) (Qt::Key_##N)
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
65 #define CTRL(N) (Qt::CTRL | Qt::Key_##N)
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
66 #define SHIFT(N) (Qt::SHIFT | Qt::Key_##N)
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
67 #define CTRL_SHIFT(N) (Qt::CTRL | Qt::SHIFT | Qt::Key_##N)
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
68
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
69 // =============================================================================
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
70 // ActionAdder
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
71 //
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
72 // The ACTION macro expands into - among other stuff - into an instance of this.
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
73 // This class' constructor creates meta for the newly defined action and stores
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
74 // it in g_ActionMeta. It is not supposed to be used directly!
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
75 // =============================================================================
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
76 class ActionAdder {
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
77 public:
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
78 ActionAdder (QAction** qAct, const char* sDisplayName, const char* sIconName,
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
79 const char* sDescription, keyseqconfig* conf, void (*const handler) ())
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
80 {
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
81 actionmeta meta = {qAct, conf, sDisplayName, sIconName, sDescription, handler};
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
82 g_ActionMeta.push_back (meta);
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
83 }
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
84 };
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
85
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
86 // =============================================================================
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
87 // ForgeWindow
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
88 //
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
89 // The one main GUI class. Hosts the renderer, object list, message log. Contains
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
90 // slot_action, which is what all actions connect to. Manages menus and toolbars.
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
91 // Large and in charge.
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
92 // =============================================================================
25
c74bb88f537d Deleted scanner.cpp (don't need it), merged model.cpp into io.cpp. Renamed LDForgeWindow to just ForgeWindow since I want the LD* prefix only be given to LDObject derivatives.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 24
diff changeset
93 class ForgeWindow : public QMainWindow {
0
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
94 Q_OBJECT
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
95
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
96 public:
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
97 renderer* R;
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
98
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
99 // Object list view
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
100 QTreeWidget* qObjList;
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
101 QTextEdit* qMessageLog;
79
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
102 QMenu* qFileMenu, *qEditMenu, *qInsertMenu, *qHelpMenu;
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
103 QToolBar* qFileToolBar, *qEditToolBar, *qInsertToolBar;
0
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
104
79
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
105 str zMessageLogHTML;
0
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
106
25
c74bb88f537d Deleted scanner.cpp (don't need it), merged model.cpp into io.cpp. Renamed LDForgeWindow to just ForgeWindow since I want the LD* prefix only be given to LDObject derivatives.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 24
diff changeset
107 ForgeWindow ();
0
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
108 void buildObjList ();
7
098e3c4949c6 Set window title dynamically based on filename
Santeri Piippo <crimsondusk64@gmail.com>
parents: 0
diff changeset
109 void setTitle ();
29
55406ce7446e Added LDraw path setting dialog
Santeri Piippo <crimsondusk64@gmail.com>
parents: 26
diff changeset
110 void refresh ();
50
7fd213c6b844 Turned the test palette action into a set color action for mass object coloring.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 48
diff changeset
111 std::vector<LDObject*> getSelectedObjects ();
17
5606eebd0b90 Allow addition of dummy lines..
Santeri Piippo <crimsondusk64@gmail.com>
parents: 14
diff changeset
112 ulong getInsertionPoint ();
79
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
113 void deleteSelection ();
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
114
0
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
115 private:
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
116 void createMenuActions ();
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
117 void createMenus ();
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
118 void createToolbars ();
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
119
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
120 private slots:
14
6d9d8efae2f8 this thing got its own reinterpret_cast now. :P Added SetContents action for altering an object by contents and reinterpreting it.
Santeri Piippo <crimsondusk64@gmail.com>
parents: 13
diff changeset
121 void slot_selectionChanged ();
79
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
122 void slot_action ();
0
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
123 };
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
124
79
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
125 // -----------------------------------------------------------------------------
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
126 // Other GUI-related stuff not directly part of ForgeWindow:
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
127 QIcon getIcon (const char* sIconName);
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
128
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
129 // -----------------------------------------------------------------------------
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
130 // Pointer to the instance of ForgeWindow.
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
131 extern ForgeWindow* g_ForgeWindow;
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
132
f8917e9d07f6 Extracted actions from ForgeWindow into their own files. The ACTION macro now manages meta, instances and callback definitions all in one. Too bad I still need to extern these actions in gui.cpp... maybe someday I'll find a way around it :)
Santeri Piippo <crimsondusk64@gmail.com>
parents: 78
diff changeset
133 // Is this still needed?
0
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
134 enum {
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
135 LDOLC_Icon,
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
136 LDOLC_Data,
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
137 NUM_LDOL_Columns
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
138 };
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
139
c51cce84a9ac Initial commit
Santeri Piippo <crimsondusk64@gmail.com>
parents:
diff changeset
140 #endif

mercurial