diff --git a/src/Backends/MPV/MPVBackend.cpp b/src/Backends/MPV/MPVBackend.cpp index fec6227..c8af69e 100644 --- a/src/Backends/MPV/MPVBackend.cpp +++ b/src/Backends/MPV/MPVBackend.cpp @@ -1,24 +1,39 @@ #include "src/Backends/MPV/MPVBackend.hpp" -#include "src/utils.hpp" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include // IWYU pragma: keep +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include -#include -#include +#include #include - -#include -#include -#include -#include -#include - #include "src/Backends/MPVCommon/MPVCommon.hpp" +#include "src/utils.hpp" +class QQuickItem; +class QSize; + +#if defined(__linux__) || defined(__FreeBSD__) +#ifdef ENABLE_X11 +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#endif +#include // IWYU pragma: keep +#endif + bool usedirect = false; @@ -84,11 +99,14 @@ public: { MPV_RENDER_PARAM_INVALID, nullptr }, { MPV_RENDER_PARAM_INVALID, nullptr } }; -#if defined(__linux__) || defined(__FREEBSD__) +#if defined(__linux__) || defined(__FreeBSD__) +#ifdef ENABLE_X11 if (QGuiApplication::platformName().contains("xcb")) { params[2].type = MPV_RENDER_PARAM_X11_DISPLAY; params[2].data = QX11Info::display(); - } else if (QGuiApplication::platformName().contains("wayland")) { + } +#endif + if (QGuiApplication::platformName().contains("wayland")) { params[2].type = MPV_RENDER_PARAM_WL_DISPLAY; auto *native = QGuiApplication::platformNativeInterface(); params[2].data = native->nativeResourceForWindow("display", NULL); diff --git a/src/Backends/MPV/MPVBackend.hpp b/src/Backends/MPV/MPVBackend.hpp index 71bca91..86a6ef9 100644 --- a/src/Backends/MPV/MPVBackend.hpp +++ b/src/Backends/MPV/MPVBackend.hpp @@ -3,19 +3,18 @@ #include #include -#include -#include - -#include -#include -#include -#include - +#include +#include +#include +#include +#include +#include +#include #include "src/backendinterface.hpp" #include "src/enums.hpp" -#include "src/utils.hpp" - -class MpvRenderer; +class QEvent; +class QObject; +class QQuickItem; class MPVBackend : public QQuickFramebufferObject diff --git a/src/Backends/MPVCommon/MPVCommon.cpp b/src/Backends/MPVCommon/MPVCommon.cpp index 4a86ef5..042eef6 100644 --- a/src/Backends/MPVCommon/MPVCommon.cpp +++ b/src/Backends/MPVCommon/MPVCommon.cpp @@ -1,9 +1,24 @@ #include "src/Backends/MPVCommon/MPVCommon.hpp" -#include "src/utils.hpp" -#include -#include +#include +#include // IWYU pragma: keep +#include +#include +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "spdlog/logger.h" +#include "src/backendinterface.hpp" #include "src/logger.h" - +#include "src/utils.hpp" auto mpvLogger = initLogger("mpv"); diff --git a/src/Backends/MPVCommon/MPVCommon.hpp b/src/Backends/MPVCommon/MPVCommon.hpp index b559bbe..8885515 100644 --- a/src/Backends/MPVCommon/MPVCommon.hpp +++ b/src/Backends/MPVCommon/MPVCommon.hpp @@ -1,9 +1,14 @@ #ifndef MPVCommon_H #define MPVCommon_H -#include -#include "src/backendinterface.hpp" #include +#include +#include +#include +#include "src/enums.hpp" +class BackendInterface; +class QMetaMethod; + namespace MPVCommon { diff --git a/src/Backends/MPVNoFBO/MPVNoFBOBackend.cpp b/src/Backends/MPVNoFBO/MPVNoFBOBackend.cpp index eda7dc2..af5b71b 100644 --- a/src/Backends/MPVNoFBO/MPVNoFBOBackend.cpp +++ b/src/Backends/MPVNoFBO/MPVNoFBOBackend.cpp @@ -1,20 +1,22 @@ -#include -#include -#include - #include "src/Backends/MPVNoFBO/MPVNoFBOBackend.hpp" - -#include "src/utils.hpp" -#include -#include -#include -#include -#include - -#include -#include - +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "src/Backends/MPVCommon/MPVCommon.hpp" +#include "src/utils.hpp" void diff --git a/src/Backends/MPVNoFBO/MPVNoFBOBackend.hpp b/src/Backends/MPVNoFBO/MPVNoFBOBackend.hpp index def48fd..80ac5ca 100644 --- a/src/Backends/MPVNoFBO/MPVNoFBOBackend.hpp +++ b/src/Backends/MPVNoFBO/MPVNoFBOBackend.hpp @@ -3,17 +3,21 @@ #include #include -#include - -#include -#include -#include -#include -#include - +#include // IWYU pragma: keep +#include +#include +#include +#include +#include // IWYU pragma: keep +#include +#include +#include +#include #include "src/backendinterface.hpp" #include "src/enums.hpp" +class QEvent; // IWYU pragma: keep + class MPVNoFBORenderer : public QObject { Q_OBJECT @@ -85,7 +89,6 @@ public slots: // Just used for adding missing audio devices to list. QVariantMap getAudioDevices(const QVariant& drivers) const; - bool event(QEvent* event); signals: diff --git a/src/Process.cpp b/src/Process.cpp index b7e6e8b..e447f3f 100644 --- a/src/Process.cpp +++ b/src/Process.cpp @@ -1,4 +1,7 @@ #include "Process.h" +#include +#include +class QObject; Process::Process(QObject* parent) : QProcess(parent) diff --git a/src/Process.h b/src/Process.h index d90a9f8..7e128d9 100644 --- a/src/Process.h +++ b/src/Process.h @@ -1,5 +1,8 @@ -#include -#include +#include +#include +#include +#include +class QObject; class Process : public QProcess { diff --git a/src/ThumbnailCache.cpp b/src/ThumbnailCache.cpp index dc7378b..c4d7d10 100644 --- a/src/ThumbnailCache.cpp +++ b/src/ThumbnailCache.cpp @@ -1,6 +1,16 @@ #include "ThumbnailCache.h" -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include ThumbnailCache::ThumbnailCache(QObject* parent) : QObject(parent) diff --git a/src/ThumbnailCache.h b/src/ThumbnailCache.h index 14bec86..7c36880 100644 --- a/src/ThumbnailCache.h +++ b/src/ThumbnailCache.h @@ -1,15 +1,8 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +class QNetworkAccessManager; class ThumbnailCache : public QObject { diff --git a/src/backendinterface.hpp b/src/backendinterface.hpp index 1eb9f7e..5c4bc43 100644 --- a/src/backendinterface.hpp +++ b/src/backendinterface.hpp @@ -1,12 +1,7 @@ -#include -#include -#include - -#include "enums.hpp" - #ifndef BackendInterface_H #define BackendInterface_H - +#include +#include "enums.hpp" class BackendInterface { public: diff --git a/src/enums.cpp b/src/enums.cpp index cd52682..90ec0dd 100644 --- a/src/enums.cpp +++ b/src/enums.cpp @@ -1 +1 @@ -#include "enums.hpp" +#include "enums.hpp" \ No newline at end of file diff --git a/src/enums.hpp b/src/enums.hpp index 4daaa7e..6a71ac0 100644 --- a/src/enums.hpp +++ b/src/enums.hpp @@ -1,8 +1,9 @@ #ifndef ENUMS_HPP #define ENUMS_HPP -#include -#include +#include +#include +#include namespace Enums { Q_NAMESPACE diff --git a/src/logger.cpp b/src/logger.cpp index 8b8f411..a53ee5d 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -1,9 +1,22 @@ -#include "logger.h" - -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include "spdlog/common.h" +#include "spdlog/details/file_helper-inl.h" +#include "spdlog/sinks/ansicolor_sink-inl.h" +#include "spdlog/sinks/base_sink-inl.h" +#include "spdlog/sinks/basic_file_sink-inl.h" +#include "spdlog/spdlog-inl.h" std::shared_ptr initLogger(std::string name) diff --git a/src/logger.h b/src/logger.h index 9d1f657..349e339 100644 --- a/src/logger.h +++ b/src/logger.h @@ -1,18 +1,11 @@ #ifndef LOGGER_HPP #define LOGGER_HPP -#include - -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep std::shared_ptr initLogger(std::string name); diff --git a/src/main.cpp b/src/main.cpp index e99c932..ea96891 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,28 +1,34 @@ -#include "logger.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "Backends/MPV/MPVBackend.hpp" #include "Backends/MPVNoFBO/MPVNoFBOBackend.hpp" - - -#include "enums.hpp" -#include "qmldebugger.h" -#include "utils.hpp" -#include - #include "Process.h" +#include "ThumbnailCache.h" #include "enums.hpp" -#include -#include -#include -#include -#include -#include -#include +#include "logger.h" +#include "qmldebugger.h" +#include "spdlog/logger.h" +#include "utils.hpp" + #ifdef WIN32 #include "setenv_mingw.hpp" #endif - -#include "ThumbnailCache.h" - #ifdef __linux__ #include #include diff --git a/src/qmldebugger.cpp b/src/qmldebugger.cpp index 313e1b2..92877cc 100644 --- a/src/qmldebugger.cpp +++ b/src/qmldebugger.cpp @@ -1,7 +1,8 @@ #include "qmldebugger.h" - -#include -#include +#include +#include +#include +#include QString QMLDebugger::properties(QQuickItem* item, bool linebreak) diff --git a/src/qmldebugger.h b/src/qmldebugger.h index 13ed1de..8465e14 100644 --- a/src/qmldebugger.h +++ b/src/qmldebugger.h @@ -1,8 +1,10 @@ #ifndef QMLDEBUGGER_H #define QMLDEBUGGER_H -#include -#include +#include +#include +#include +class QQuickItem; class QMLDebugger : public QObject { diff --git a/src/utils.cpp b/src/utils.cpp index 870bb40..bdffc44 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -1,25 +1,19 @@ #include "utils.hpp" +#include +#include +#include +#include +#include +#include #include "logger.h" +#include "spdlog/logger.h" -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if defined(__linux__) || defined(__FreeBSD__) -#ifdef ENABLE_X11 -#include -#include -#include -#endif +#if (defined(__linux__) || defined(__FreeBSD__)) && ENABLE_X11 +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep +#include // IWYU pragma: keep #endif auto utilsLogger = initLogger("utils"); @@ -112,8 +106,7 @@ SetDPMS(bool on) void AlwaysOnTop(WId wid, bool on) { -#if defined(__linux__) || defined(__FreeBSD__) -#ifdef ENABLE_X11 +#if (defined(__linux__) || defined(__FreeBSD__)) && ENABLE_X11 Display* display = QX11Info::display(); XEvent event; event.xclient.type = ClientMessage; @@ -135,7 +128,6 @@ AlwaysOnTop(WId wid, bool on) False, SubstructureRedirectMask | SubstructureNotifyMask, &event); -#endif #else utilsLogger->error("Can't set on top for platform: {}", getPlatformName().toUtf8().constData()); diff --git a/src/utils.hpp b/src/utils.hpp index 07b7b38..a35afec 100644 --- a/src/utils.hpp +++ b/src/utils.hpp @@ -1,9 +1,9 @@ #ifndef UTILS_H #define UTILS_H -#include -#include -#include -#include +#include +#include +#include +#include namespace Utils { Q_NAMESPACE