Pencil2D Animation
Download
Community
News
Docs
Contribute
Overview
Articles
Code
Class List
Class Index
Class Hierarchy
Class Members
File List
Loading...
Searching...
No Matches
app
src
mainwindow2.h
1
/*
2
3
Pencil2D - Traditional Animation Software
4
Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5
Copyright (C) 2008-2009 Mj Mendoza IV
6
Copyright (C) 2012-2020 Matthew Chiawen Chang
7
8
This program is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; version 2 of the License.
11
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
*/
18
#ifndef MAINWINDOW2_H
19
#define MAINWINDOW2_H
20
21
#include <QMainWindow>
22
#include "preferencemanager.h"
23
24
25
template
<
typename
T>
class
QList
;
26
class
QActionGroup
;
27
class
QToolBar
;
28
class
Object
;
29
class
Editor
;
30
class
ScribbleArea
;
31
class
BaseDockWidget
;
32
class
ColorPaletteWidget
;
33
class
OnionSkinWidget
;
34
class
ToolOptionWidget
;
35
class
TimeLine
;
36
class
ToolBoxWidget
;
37
class
PreferencesDialog
;
38
class
PreviewWidget;
39
class
ColorBox
;
40
class
ColorInspector
;
41
class
RecentFileMenu
;
42
class
ActionCommands
;
43
class
ImportImageSeqDialog
;
44
class
UndoRedoCommand
;
45
class
LayerOpacityDialog
;
46
class
PegBarAlignmentDialog
;
47
class
RepositionFramesDialog
;
48
class
StatusBar
;
49
enum class
SETTING;
50
51
52
namespace
Ui
53
{
54
class
MainWindow2
;
55
}
56
57
class
MainWindow2
:
public
QMainWindow
58
{
59
Q_OBJECT
60
61
public
:
62
explicit
MainWindow2
(
QWidget
*
parent
=
nullptr
);
63
~MainWindow2
()
override
;
64
65
Editor
* mEditor =
nullptr
;
66
67
public
slots:
68
void
updateBackupActionState();
69
void
updateSaveState();
70
void
openPegAlignDialog();
71
void
openRepositionDialog();
72
void
closeRepositionDialog();
73
void
openLayerOpacityDialog();
74
void
currentLayerChanged();
75
void
selectionChanged();
76
void
viewFlipped();
77
78
public
:
79
void
newDocument();
80
void
openDocument();
81
bool
saveDocument();
82
bool
saveAsNewDocument();
83
bool
maybeSave();
84
bool
autoSave();
85
void
emptyDocumentWhenErrorOccurred();
86
87
// import
88
void
importImage();
89
void
importImageSequence();
90
void
importPredefinedImageSet();
91
void
importLayers();
92
void
importMovieVideo();
93
void
importAnimatedImage();
94
95
void
lockWidgets(
bool
shouldLock);
96
97
void
setOpacity(
int
opacity);
98
void
preferences();
99
100
void
openStartupFile(
const
QString
& filename);
101
void
openFile(
const
QString
& filename);
102
103
void
displayMessageBox(
const
QString
& title,
const
QString
& body);
104
void
displayMessageBoxNoTitle(
const
QString
& body);
105
106
signals:
108
void
windowActivated
();
109
110
protected
:
111
void
tabletEvent(
QTabletEvent
*)
override
;
112
void
closeEvent(
QCloseEvent
*)
override
;
113
bool
event(
QEvent
*)
override
;
114
115
private
slots:
116
void
updateCopyCutPasteEnabled();
117
void
updateLayerMenu();
118
private
:
119
void
newObject();
120
bool
newObjectFromPresets(
int
presetIndex);
121
bool
openObject(
const
QString
& strFilename);
122
bool
saveObject(
QString
strFileName);
123
void
closeDialogs();
124
125
void
createDockWidgets();
126
void
createMenus();
127
void
replaceUndoRedoActions();
128
void
setupKeyboardShortcuts();
129
void
clearKeyboardShortcuts();
130
bool
loadMostRecent();
131
bool
tryLoadPreset();
132
133
void
openPalette();
134
void
importPalette();
135
void
exportPalette();
136
137
void
readSettings();
138
void
writeSettings();
139
void
resetAndDockAllSubWidgets();
140
141
void
changePlayState(
bool
isPlaying);
142
143
void
makeConnections(
Editor
*);
144
void
makeConnections(
Editor
*,
ColorBox
* colorBox);
145
void
makeConnections(
Editor
*,
ColorInspector
*);
146
void
makeConnections(
Editor
*,
ScribbleArea
*);
147
void
makeConnections(
Editor
*,
ColorPaletteWidget
*);
148
void
makeConnections(
Editor
*,
TimeLine
*);
149
void
makeConnections(
Editor
*,
ToolOptionWidget
*);
150
void
makeConnections(
Editor
*,
OnionSkinWidget
*);
151
void
makeConnections(
Editor
*,
StatusBar
*);
152
153
bool
tryRecoverUnsavedProject();
154
void
startProjectRecovery(
int
result);
155
156
// UI: Dock widgets
157
ColorBox
* mColorBox =
nullptr
;
158
ColorPaletteWidget
* mColorPalette =
nullptr
;
159
ToolOptionWidget
* mToolOptions =
nullptr
;
160
ToolBoxWidget
* mToolBox =
nullptr
;
161
RecentFileMenu
* mRecentFileMenu =
nullptr
;
162
PreferencesDialog
* mPrefDialog =
nullptr
;
163
//PreviewWidget* mPreview = nullptr;
164
TimeLine
* mTimeLine =
nullptr
;
165
ColorInspector
* mColorInspector =
nullptr
;
166
OnionSkinWidget
* mOnionSkinWidget =
nullptr
;
167
QToolBar
* mMainToolbar =
nullptr
;
168
QToolBar
* mViewToolbar =
nullptr
;
169
QToolBar
* mOverlayToolbar =
nullptr
;
170
171
PegBarAlignmentDialog
* mPegAlign =
nullptr
;
172
RepositionFramesDialog
* mReposDialog =
nullptr
;
173
LayerOpacityDialog
* mLayerOpacityDialog =
nullptr
;
174
175
void
createToolbars();
176
private
:
177
ActionCommands
* mCommands =
nullptr
;
178
QList<BaseDockWidget*>
mDockWidgets;
179
QList<QToolBar*>
mToolbars;
180
181
QIcon
mStartIcon;
182
QIcon
mStopIcon;
183
184
// a hack for MacOS because closeEvent fires twice
185
bool
m2ndCloseEvent =
false
;
186
187
// Whether to suppress the auto save dialog due to internal work
188
bool
mSuppressAutoSaveDialog =
false
;
189
190
Ui::MainWindow2* ui =
nullptr
;
191
};
192
193
#endif
// MAINWINDOW2_H
ActionCommands
Definition:
actioncommands.h:30
BaseDockWidget
Definition:
basedockwidget.h:27
ColorBox
Definition:
colorbox.h:24
ColorInspector
Definition:
colorinspector.h:27
ColorPaletteWidget
Definition:
colorpalettewidget.h:39
Editor
Definition:
editor.h:70
ImportImageSeqDialog
Definition:
importimageseqdialog.h:45
LayerOpacityDialog
Definition:
layeropacitydialog.h:22
MainWindow2
Definition:
mainwindow2.h:58
MainWindow2::windowActivated
void windowActivated()
Emitted when window regains focus.
Object
Definition:
object.h:42
OnionSkinWidget
Definition:
onionskinwidget.h:32
PegBarAlignmentDialog
Definition:
pegbaralignmentdialog.h:29
PreferencesDialog
Definition:
preferencesdialog.h:30
RecentFileMenu
Definition:
recentfilemenu.h:30
RepositionFramesDialog
Definition:
repositionframesdialog.h:16
ScribbleArea
Definition:
scribblearea.h:52
StatusBar
The status bar of Pencil2D's main window.
Definition:
statusbar.h:34
TimeLine
Definition:
timeline.h:32
ToolBoxWidget
Definition:
toolbox.h:36
ToolOptionWidget
Definition:
tooloptionwidget.h:41
UndoRedoCommand
Definition:
undoredocommand.h:38
QActionGroup
QCloseEvent
QEvent
QIcon
QList
QMainWindow
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QString
QTabletEvent
QToolBar
QWidget