swift
main.cpp
1 // SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
4 #include <cstdlib>
5 
6 #include <QApplication>
7 
8 #include "swiftguistd.h"
10 
12 #include "gui/guiapplication.h"
13 #include "gui/guiutility.h"
14 #include "misc/crashhandler.h"
15 
16 using namespace swift::gui;
17 using namespace swift::misc;
18 using namespace swift::misc::audio;
19 using namespace swift::core;
20 
21 int main(int argc, char *argv[])
22 {
23  QApplication qa(argc, argv);
24  Q_UNUSED(qa) // application init needed
25 
26  CCrashHandler::instance()->init();
27 
28  // at shutdown the whole application will be "deleted" outside the block
29  // that should already delete all widgets
30  int r = 0;
31  {
32  CSwiftGuiStdApplication a; // application with contexts
33  if (!a.parseCommandLineArgsAndLoadSetup()) { return EXIT_FAILURE; }
34  a.splashScreen(CIcons::swift256());
35  a.setMinimumSizeInCharacters(60, 42); // experimental
36  if (!a.start())
37  {
38  a.gracefulShutdown();
39  return EXIT_FAILURE;
40  }
41 
42  // show window
44  SwiftGuiStd w(windowMode);
45  r = a.exec();
46  }
47 
48  // bye
49  return r;
50 }
Specialized GUI application for swift pilot client.
swift GUI
Definition: swiftguistd.h:63
bool parseCommandLineArgsAndLoadSetup()
Combined function that does a startup check, parses the command line arguments and loads the setup.
virtual bool start()
Start services, if not yet parsed call CApplication::parse.
int exec()
Finishes initialization and executes the event loop.
CEnableForFramelessWindow::WindowMode getWindowMode() const
Window mode (window flags)
void splashScreen(const QPixmap &pixmap)
Add a splash screen based on resource, empty means remove splash screen.
void gracefulShutdown()
Graceful shutdown.
void setMinimumSizeInCharacters(int widthChars, int heightChars)
Set minimum width/height in characters.
Backend services of the swift project, like dealing with the network or the simulators.
Definition: actionbind.cpp:7
GUI related classes.
Free functions in swift::misc.
int main(int argc, char *argv[])
main
Definition: main.cpp:20