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 
23 #include "pencilerror.h"
24 
28 #define pencil2D \
29  (static_cast<Pencil2D *>(QCoreApplication::instance()))
30 
34 class Pencil2D : public QApplication
35 {
36  Q_OBJECT
37 
38 public:
45  explicit Pencil2D(int &argc, char **argv);
46 
58 
59  bool event(QEvent* event) override;
60 
61 signals:
68  void openFileRequested(QString filename);
69 
70 private:
74  void installTranslators();
80  void prepareGuiStartup(const QString &inputPath);
81 };
82 
83 #endif // PENCIL2D_H
Status handleCommandLineOptions()
Parses supplied command line arguments and performs the appropriate actions, such as running the comm...
Definition: pencil2d.cpp:56
The main application class handling startup as well as the main loop.
Definition: pencil2d.h:34
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:118
void installTranslators()
Sets up translators for the application locale configured by the user or the system locale...
Definition: pencil2d.cpp:98