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 {
24  QApplication qa(argc, argv);
25  Q_UNUSED(qa) // application init needed
26 
27  CCrashHandler::instance()->init();
28 
29  // at shutdown the whole application will be "deleted" outside the block
30  // that should already delete all widgets
31  int r = 0;
32  {
33  CSwiftGuiStdApplication a; // application with contexts
34  if (!a.parseCommandLineArgsAndLoadSetup()) { return EXIT_FAILURE; }
35  a.splashScreen(CIcons::swift256());
36  a.setMinimumSizeInCharacters(60, 42); // experimental
37  if (!a.start())
38  {
39  a.gracefulShutdown();
40  return EXIT_FAILURE;
41  }
42 
43  // show window
45  SwiftGuiStd w(windowMode);
46  r = a.exec();
47  }
48 
49  // bye
50  return r;
51 }
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.
static QString scaleFactor(int argc, char *argv[])
Get the scale factor.
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.
static void highDpiScreenSupport(const QString &scaleFactor={})
Support for high DPI screens.
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