summaryrefslogtreecommitdiff
path: root/qmap/main.cpp
diff options
context:
space:
mode:
authortony mancill <tmancill@debian.org>2023-09-03 19:46:51 -0700
committertony mancill <tmancill@debian.org>2023-09-03 19:46:51 -0700
commit1fc24d9474229c0f382da5def559f5de7b903f86 (patch)
tree8a745660a498dbd6209a198679b821799f107024 /qmap/main.cpp
parent65e5ae53a0358d9a3d040b13e0cf84556a7b4812 (diff)
parent393a486ee1d7e308a49f8e0b8c3a4b2f43223248 (diff)
Update upstream source from tag 'upstream/2.7.0_rc2+repack'
Update to upstream version '2.7.0~rc2+repack' with Debian dir c24f4e90e5ec8585c79007453c538689dc460e86
Diffstat (limited to 'qmap/main.cpp')
-rwxr-xr-xqmap/main.cpp53
1 files changed, 53 insertions, 0 deletions
diff --git a/qmap/main.cpp b/qmap/main.cpp
new file mode 100755
index 00000000..2241df8f
--- /dev/null
+++ b/qmap/main.cpp
@@ -0,0 +1,53 @@
+#include <fftw3.h>
+#ifdef QT5
+#include <QtWidgets>
+#else
+#include <QtGui>
+#endif
+#include <QApplication>
+
+#include "revision_utils.hpp"
+#include "mainwindow.h"
+
+extern "C" {
+ // Fortran procedures we need
+ void four2a_ (_Complex float *, int * nfft, int * ndim, int * isign, int * iform, int len);
+
+ void _gfortran_set_args(int argc, char *argv[]);
+ void _gfortran_set_convert(int conv);
+ void ftninit_(void);
+}
+
+int main(int argc, char *argv[])
+{
+ QApplication a {argc, argv};
+
+// Initialize libgfortran:
+ _gfortran_set_args(argc, argv);
+ _gfortran_set_convert(0);
+ ftninit_();
+
+ // Override programs executable basename as application name.
+ a.setApplicationName ("QMAP");
+ a.setApplicationVersion ("0.2");
+ // switch off as we share an Info.plist file with WSJT-X
+ a.setAttribute (Qt::AA_DontUseNativeMenuBar);
+ MainWindow w;
+ w.show ();
+ QObject::connect (&a, &QApplication::lastWindowClosed, &a, &QApplication::quit);
+ auto result = a.exec ();
+
+ // clean up lazily initialized FFTW3 resources
+ {
+ int nfft {-1};
+ int ndim {1};
+ int isign {1};
+ int iform {1};
+ // free FFT plan resources
+ four2a_ (nullptr, &nfft, &ndim, &isign, &iform, 0);
+ }
+ fftwf_forget_wisdom ();
+ fftwf_cleanup ();
+
+ return result;
+}