All Classes Namespaces Functions Variables Enumerations Properties Pages
pencil2d.h
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2020 Matthew Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 */
17 
18 #ifndef PENCIL2D_H
19 #define PENCIL2D_H
20 
21 #include <QApplication>
22 #include <memory>
23 #include "pencilerror.h"
24 
25 class MainWindow2;
26 
30 #define pencil2D \
31  (static_cast<Pencil2D *>(QCoreApplication::instance()))
32 
36 class Pencil2D : public QApplication
37 {
38  Q_OBJECT
39 
40 public:
47  explicit Pencil2D(int &argc, char **argv);
48  ~Pencil2D() override;
49 
61 
62  bool event(QEvent* event) override;
63 
64 signals:
71  void openFileRequested(QString filename);
72 
73 private:
77  void installTranslators();
83  void prepareGuiStartup(const QString &inputPath);
84 
85  std::unique_ptr<MainWindow2> mainWindow;
86 };
87 
88 #endif // PENCIL2D_H
Status handleCommandLineOptions()
Parses supplied command line arguments and performs the appropriate actions, such as running the comm...
Definition: pencil2d.cpp:63
The main application class handling startup as well as the main loop.
Definition: pencil2d.h:36
Pencil2D(int &argc, char **argv)
Initializes the application with the given command line arguments.
Definition: pencil2d.cpp:35
void openFileRequested(QString filename)
Emitted when the operating system requests that a file should be opened.
Q_OBJECTQ_OBJECT
void prepareGuiStartup(const QString &inputPath)
Readies the graphical UI for entering the main loop.
Definition: pencil2d.cpp:126
void installTranslators()
Sets up translators for the application locale configured by the user or the system locale...
Definition: pencil2d.cpp:106