1
0
Fork 0

Fix includes.

This commit is contained in:
namedkitten 2020-04-22 10:56:45 +01:00
parent 437bebf9a6
commit 84a84fd57d
20 changed files with 207 additions and 153 deletions

View file

@ -1,24 +1,39 @@
#include "src/Backends/MPV/MPVBackend.hpp" #include "src/Backends/MPV/MPVBackend.hpp"
#include "src/utils.hpp" #include <QtCore/qglobal.h>
#include <QApplication> #include <mpv/render_gl.h>
#include <QElapsedTimer> #include <qbytearray.h>
#include <QOpenGLContext> #include <qcoreapplication.h>
#include <QOpenGLFramebufferObject> #include <qguiapplication.h> // IWYU pragma: keep
#include <QQuickWindow> #include <qcoreevent.h>
#include <QSequentialIterable> #include <qdebug.h>
#include <qicon.h>
#include <qmetaobject.h>
#include <qnamespace.h>
#include <qobject.h>
#include <qopenglcontext.h>
#include <qopenglframebufferobject.h>
#include <qquickwindow.h>
#include <stdio.h>
#include <clocale> #include <clocale>
#include <iostream> #include <iostream>
#include <math.h> #include <mpv/qthelper.hpp>
#include <stdbool.h>
#include <stdexcept> #include <stdexcept>
#include <QX11Info>
#include <QtX11Extras/QX11Info>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <qpa/qplatformnativeinterface.h>
#include "src/Backends/MPVCommon/MPVCommon.hpp" #include "src/Backends/MPVCommon/MPVCommon.hpp"
#include "src/utils.hpp"
class QQuickItem;
class QSize;
#if defined(__linux__) || defined(__FreeBSD__)
#ifdef ENABLE_X11
#include <QX11Info> // IWYU pragma: keep
#include <QtX11Extras/QX11Info> // IWYU pragma: keep
#include <qx11info_x11.h> // IWYU pragma: keep
#include <X11/Xlib.h> // IWYU pragma: keep
#include <X11/Xutil.h> // IWYU pragma: keep
#endif
#include <qpa/qplatformnativeinterface.h> // IWYU pragma: keep
#endif
bool usedirect = false; bool usedirect = false;
@ -84,11 +99,14 @@ public:
{ MPV_RENDER_PARAM_INVALID, nullptr }, { MPV_RENDER_PARAM_INVALID, nullptr },
{ 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")) { if (QGuiApplication::platformName().contains("xcb")) {
params[2].type = MPV_RENDER_PARAM_X11_DISPLAY; params[2].type = MPV_RENDER_PARAM_X11_DISPLAY;
params[2].data = QX11Info::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; params[2].type = MPV_RENDER_PARAM_WL_DISPLAY;
auto *native = QGuiApplication::platformNativeInterface(); auto *native = QGuiApplication::platformNativeInterface();
params[2].data = native->nativeResourceForWindow("display", NULL); params[2].data = native->nativeResourceForWindow("display", NULL);

View file

@ -3,19 +3,18 @@
#include <mpv/client.h> #include <mpv/client.h>
#include <mpv/opengl_cb.h> #include <mpv/opengl_cb.h>
#include <mpv/qthelper.hpp> #include <mpv/render.h>
#include <mpv/render_gl.h> #include <qmetatype.h>
#include <qobjectdefs.h>
#include <QObject> #include <qquickframebufferobject.h>
#include <QOpenGLContext> #include <qsettings.h>
#include <QQuickFramebufferObject> #include <qstring.h>
#include <QSettings> #include <qvariant.h>
#include "src/backendinterface.hpp" #include "src/backendinterface.hpp"
#include "src/enums.hpp" #include "src/enums.hpp"
#include "src/utils.hpp" class QEvent;
class QObject;
class MpvRenderer; class QQuickItem;
class MPVBackend class MPVBackend
: public QQuickFramebufferObject : public QQuickFramebufferObject

View file

@ -1,9 +1,24 @@
#include "src/Backends/MPVCommon/MPVCommon.hpp" #include "src/Backends/MPVCommon/MPVCommon.hpp"
#include "src/utils.hpp" #include <qbytearray.h>
#include <QSettings> #include <qcbormap.h> // IWYU pragma: keep
#include <mpv/qthelper.hpp> #include <qcoreapplication.h>
#include <qglobal.h>
#include <qjsonarray.h> // IWYU pragma: keep
#include <qjsonobject.h> // IWYU pragma: keep
#include <qlist.h>
#include <qlocale.h>
#include <qmap.h>
#include <qmetaobject.h>
#include <qobjectdefs.h>
#include <qsettings.h>
#include <spdlog/fmt/fmt.h>
#include <string.h>
#include <exception>
#include <memory>
#include "spdlog/logger.h"
#include "src/backendinterface.hpp"
#include "src/logger.h" #include "src/logger.h"
#include "src/utils.hpp"
auto mpvLogger = initLogger("mpv"); auto mpvLogger = initLogger("mpv");

View file

@ -1,9 +1,14 @@
#ifndef MPVCommon_H #ifndef MPVCommon_H
#define MPVCommon_H #define MPVCommon_H
#include <QString>
#include "src/backendinterface.hpp"
#include <mpv/client.h> #include <mpv/client.h>
#include <qmetatype.h>
#include <qstring.h>
#include <qvariant.h>
#include "src/enums.hpp"
class BackendInterface;
class QMetaMethod;
namespace MPVCommon { namespace MPVCommon {

View file

@ -1,20 +1,22 @@
#include <clocale>
#include <stdbool.h>
#include <stdexcept>
#include "src/Backends/MPVNoFBO/MPVNoFBOBackend.hpp" #include "src/Backends/MPVNoFBO/MPVNoFBOBackend.hpp"
#include <QtCore/qglobal.h>
#include "src/utils.hpp" #include <qapplication.h>
#include <QApplication> #include <qbytearray.h>
#include <QMainWindow> #include <qcoreapplication.h>
#include <QOpenGLContext> #include <qcoreevent.h>
#include <QOpenGLFramebufferObject> #include <qdebug.h>
#include <QQuickWindow> #include <qicon.h>
#include <qmetaobject.h>
#include <QSequentialIterable> #include <qnamespace.h>
#include <math.h> #include <qopenglcontext.h>
#include <qquickwindow.h>
#include <stdio.h>
#include <stdlib.h>
#include <clocale>
#include <mpv/qthelper.hpp>
#include <stdexcept>
#include "src/Backends/MPVCommon/MPVCommon.hpp" #include "src/Backends/MPVCommon/MPVCommon.hpp"
#include "src/utils.hpp"
void void

View file

@ -3,17 +3,21 @@
#include <mpv/client.h> #include <mpv/client.h>
#include <mpv/opengl_cb.h> #include <mpv/opengl_cb.h>
#include <mpv/qthelper.hpp> #include <qevent.h> // IWYU pragma: keep
#include <qmetatype.h>
#include <QObject> #include <qobject.h>
#include <QOpenGLContext> #include <qobjectdefs.h>
#include <QQuickFramebufferObject> #include <qquickitem.h>
#include <QSettings> #include <qquickwindow.h> // IWYU pragma: keep
#include <QWidget> #include <qsettings.h>
#include <qsize.h>
#include <qstring.h>
#include <qvariant.h>
#include "src/backendinterface.hpp" #include "src/backendinterface.hpp"
#include "src/enums.hpp" #include "src/enums.hpp"
class QEvent; // IWYU pragma: keep
class MPVNoFBORenderer : public QObject class MPVNoFBORenderer : public QObject
{ {
Q_OBJECT Q_OBJECT
@ -85,7 +89,6 @@ public slots:
// Just used for adding missing audio devices to list. // Just used for adding missing audio devices to list.
QVariantMap getAudioDevices(const QVariant& drivers) const; QVariantMap getAudioDevices(const QVariant& drivers) const;
bool event(QEvent* event); bool event(QEvent* event);
signals: signals:

View file

@ -1,4 +1,7 @@
#include "Process.h" #include "Process.h"
#include <qstringlist.h>
#include <qvariant.h>
class QObject;
Process::Process(QObject* parent) Process::Process(QObject* parent)
: QProcess(parent) : QProcess(parent)

View file

@ -1,5 +1,8 @@
#include <QProcess> #include <qmetatype.h>
#include <QVariant> #include <qobjectdefs.h>
#include <qprocess.h>
#include <qstring.h>
class QObject;
class Process : public QProcess class Process : public QProcess
{ {

View file

@ -1,6 +1,16 @@
#include "ThumbnailCache.h" #include "ThumbnailCache.h"
#include <QCryptographicHash> #include <qbuffer.h>
#include <QImageReader> #include <qbytearray.h>
#include <qcryptographichash.h>
#include <qfileinfo.h>
#include <qimage.h>
#include <qimagereader.h>
#include <qiodevice.h>
#include <qnetworkaccessmanager.h>
#include <qnetworkreply.h>
#include <qnetworkrequest.h>
#include <qstandardpaths.h>
#include <qurl.h>
ThumbnailCache::ThumbnailCache(QObject* parent) ThumbnailCache::ThumbnailCache(QObject* parent)
: QObject(parent) : QObject(parent)

View file

@ -1,15 +1,8 @@
#include <QApplication> #include <qdir.h>
#include <QGuiApplication> #include <qobject.h>
#include <QJsonDocument> #include <qobjectdefs.h>
#include <QNetworkAccessManager> #include <qstring.h>
#include <QObject> class QNetworkAccessManager;
#include <QProcessEnvironment>
#include <QQmlApplicationEngine>
#include <QSequentialIterable>
#include <QString>
#include <QVariant>
#include <QtCore>
#include <QtNetwork>
class ThumbnailCache : public QObject class ThumbnailCache : public QObject
{ {

View file

@ -1,12 +1,7 @@
#include <QObject>
#include <QOpenGLContext>
#include <QQuickFramebufferObject>
#include "enums.hpp"
#ifndef BackendInterface_H #ifndef BackendInterface_H
#define BackendInterface_H #define BackendInterface_H
#include <QObject>
#include "enums.hpp"
class BackendInterface class BackendInterface
{ {
public: public:

View file

@ -1,8 +1,9 @@
#ifndef ENUMS_HPP #ifndef ENUMS_HPP
#define ENUMS_HPP #define ENUMS_HPP
#include <QObject> #include <qobject.h>
#include <QtGlobal> #include <qobjectdefs.h>
#include <qstring.h>
namespace Enums { namespace Enums {
Q_NAMESPACE Q_NAMESPACE

View file

@ -1,9 +1,22 @@
#include "logger.h" #include <qbytearray.h>
#include <qsettings.h>
#include <QObject> #include <qstring.h>
#include <QSettings> #include <qvariant.h>
#include <QString> #include <spdlog/logger.h>
#include <iostream> #include <iterator>
#include <vector>
#include <iosfwd> // IWYU pragma: keep
#include <memory> // IWYU pragma: keep
#include <spdlog/spdlog.h> // IWYU pragma: export
#include <spdlog/sinks/basic_file_sink.h> // IWYU pragma: export
#include <spdlog/sinks/daily_file_sink.h> // IWYU pragma: export
#include <spdlog/sinks/stdout_color_sinks.h> // 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<spdlog::logger> std::shared_ptr<spdlog::logger>
initLogger(std::string name) initLogger(std::string name)

View file

@ -1,18 +1,11 @@
#ifndef LOGGER_HPP #ifndef LOGGER_HPP
#define LOGGER_HPP #define LOGGER_HPP
#include <spdlog/spdlog.h> #include <iosfwd> // IWYU pragma: keep
#include <memory> // IWYU pragma: keep
#include <spdlog/sinks/basic_file_sink.h> #include <spdlog/spdlog.h> // IWYU pragma: keep
#include <spdlog/sinks/daily_file_sink.h> #include <spdlog/sinks/basic_file_sink.h> // IWYU pragma: keep
#include <spdlog/sinks/stdout_color_sinks.h> #include <spdlog/sinks/daily_file_sink.h> // IWYU pragma: keep
#include <spdlog/sinks/stdout_color_sinks.h> // IWYU pragma: keep
#include <QProcessEnvironment>
#include <QQmlApplicationEngine>
#include <QSequentialIterable>
#include <QString>
#include <QVariant>
#include <QtCore>
#include <QtNetwork>
std::shared_ptr<spdlog::logger> std::shared_ptr<spdlog::logger>
initLogger(std::string name); initLogger(std::string name);

View file

@ -1,28 +1,34 @@
#include "logger.h" #include <QtCore/qglobal.h>
#include <locale.h>
#include <qapplication.h>
#include <qbytearray.h>
#include <qmetatype.h>
#include <qprocess.h>
#include <qqml.h>
#include <qqmlapplicationengine.h>
#include <qsettings.h>
#include <qstring.h>
#include <qstringliteral.h>
#include <qurl.h>
#include <qvariant.h>
#include <spdlog/fmt/fmt.h>
#include <cstdlib>
#include <exception>
#include <iosfwd>
#include <memory>
#include "Backends/MPV/MPVBackend.hpp" #include "Backends/MPV/MPVBackend.hpp"
#include "Backends/MPVNoFBO/MPVNoFBOBackend.hpp" #include "Backends/MPVNoFBO/MPVNoFBOBackend.hpp"
#include "enums.hpp"
#include "qmldebugger.h"
#include "utils.hpp"
#include <cstdlib>
#include "Process.h" #include "Process.h"
#include "ThumbnailCache.h"
#include "enums.hpp" #include "enums.hpp"
#include <QApplication> #include "logger.h"
#include <QProcessEnvironment> #include "qmldebugger.h"
#include <QQmlApplicationEngine> #include "spdlog/logger.h"
#include <QtConcurrent> #include "utils.hpp"
#include <QtCore>
#include <QtQml>
#include <stdbool.h>
#ifdef WIN32 #ifdef WIN32
#include "setenv_mingw.hpp" #include "setenv_mingw.hpp"
#endif #endif
#include "ThumbnailCache.h"
#ifdef __linux__ #ifdef __linux__
#include <initializer_list> #include <initializer_list>
#include <signal.h> #include <signal.h>

View file

@ -1,7 +1,8 @@
#include "qmldebugger.h" #include "qmldebugger.h"
#include <qhash.h>
#include <QMetaObject> #include <qmetaobject.h>
#include <QMetaProperty> #include <qquickitem.h>
#include <qvariant.h>
QString QString
QMLDebugger::properties(QQuickItem* item, bool linebreak) QMLDebugger::properties(QQuickItem* item, bool linebreak)

View file

@ -1,8 +1,10 @@
#ifndef QMLDEBUGGER_H #ifndef QMLDEBUGGER_H
#define QMLDEBUGGER_H #define QMLDEBUGGER_H
#include <QObject> #include <qobject.h>
#include <QQuickItem> #include <qobjectdefs.h>
#include <qstring.h>
class QQuickItem;
class QMLDebugger : public QObject class QMLDebugger : public QObject
{ {

View file

@ -1,25 +1,19 @@
#include "utils.hpp" #include "utils.hpp"
#include <qapplication.h>
#include <qcoreapplication.h>
#include <qguiapplication.h>
#include <qprocess.h>
#include <qstringlist.h>
#include <memory>
#include "logger.h" #include "logger.h"
#include "spdlog/logger.h"
#include <stdbool.h> #if (defined(__linux__) || defined(__FreeBSD__)) && ENABLE_X11
#include <X11/X.h> // IWYU pragma: keep
#include <QApplication> #include <X11/Xlib.h> // IWYU pragma: keep
#include <QGuiApplication> #include <X11/Xutil.h> // IWYU pragma: keep
#include <QJsonDocument> #include <qx11info_x11.h> // IWYU pragma: keep
#include <QProcessEnvironment> #include <QX11Info> // IWYU pragma: keep
#include <QQmlApplicationEngine>
#include <QSequentialIterable>
#include <QString>
#include <QVariant>
#include <QtCore>
#include <QtNetwork>
#if defined(__linux__) || defined(__FreeBSD__)
#ifdef ENABLE_X11
#include <QX11Info>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#endif
#endif #endif
auto utilsLogger = initLogger("utils"); auto utilsLogger = initLogger("utils");
@ -112,8 +106,7 @@ SetDPMS(bool on)
void void
AlwaysOnTop(WId wid, bool on) AlwaysOnTop(WId wid, bool on)
{ {
#if defined(__linux__) || defined(__FreeBSD__) #if (defined(__linux__) || defined(__FreeBSD__)) && ENABLE_X11
#ifdef ENABLE_X11
Display* display = QX11Info::display(); Display* display = QX11Info::display();
XEvent event; XEvent event;
event.xclient.type = ClientMessage; event.xclient.type = ClientMessage;
@ -135,7 +128,6 @@ AlwaysOnTop(WId wid, bool on)
False, False,
SubstructureRedirectMask | SubstructureNotifyMask, SubstructureRedirectMask | SubstructureNotifyMask,
&event); &event);
#endif
#else #else
utilsLogger->error("Can't set on top for platform: {}", utilsLogger->error("Can't set on top for platform: {}",
getPlatformName().toUtf8().constData()); getPlatformName().toUtf8().constData());

View file

@ -1,9 +1,9 @@
#ifndef UTILS_H #ifndef UTILS_H
#define UTILS_H #define UTILS_H
#include <QObject> #include <qobject.h>
#include <QWindow> #include <qobjectdefs.h>
#include <QtGlobal> #include <qstring.h>
#include <stdbool.h> #include <qwindowdefs.h>
namespace Utils { namespace Utils {
Q_NAMESPACE Q_NAMESPACE