LMMS
Loading...
Searching...
No Matches
MainApplication.h
Go to the documentation of this file.
1/*
2 * MainApplication.h - Main QApplication handler
3 *
4 * Copyright (c) 2017-2017 Tres Finocchiaro <tres.finocchiaro/at/gmail.com>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_GUI_MAIN_APPLICATION_H
26#define LMMS_GUI_MAIN_APPLICATION_H
27
28#include "lmmsconfig.h"
29
30#include <QApplication>
31
32#ifdef LMMS_BUILD_WIN32
33#include <windows.h>
34#include <QAbstractNativeEventFilter>
35#endif
36
37
38namespace lmms::gui
39{
40
41
42#if defined(LMMS_BUILD_WIN32)
43class MainApplication : public QApplication, public QAbstractNativeEventFilter
44#else
45class MainApplication : public QApplication
46#endif
47{
48public:
49 MainApplication(int& argc, char** argv);
50 bool event(QEvent* event) override;
51#ifdef LMMS_BUILD_WIN32
52#if (QT_VERSION < QT_VERSION_CHECK(6,0,0))
53 using FilterResult = long;
54#else
55 using FilterResult = qintptr;
56#endif // QT6 check
57 bool win32EventFilter(MSG* msg, FilterResult* result);
58 bool nativeEventFilter(const QByteArray& eventType, void* message, FilterResult* result);
59#endif // LMMS_BUILD_WIN32
60 inline QString& queuedFile()
61 {
62 return m_queuedFile;
63 }
64private:
65 QString m_queuedFile;
66};
67
68
69} // namespace lmms::gui
70
71#endif // LMMS_GUI_MAIN_APPLICATION_H
static void message(int level, const char *fmt,...)
Definition adplugdb.cpp:120
Definition MainApplication.h:47
QString m_queuedFile
Definition MainApplication.h:65
QString & queuedFile()
Definition MainApplication.h:60
MainApplication(int &argc, char **argv)
Definition MainApplication.cpp:38
bool event(QEvent *event) override
Definition MainApplication.cpp:60
char * argv[]
Definition unzip.c:738
const char * msg
Definition missing_descriptor.c:20
Definition AudioPortAudio.cpp:223
Definition swell-types.h:254
int result
Definition process.c:1455
int argc
Definition zipinfo.c:455