diff --git a/ScreenPlay/qml/Settings/SettingsView.qml b/ScreenPlay/qml/Settings/SettingsView.qml index 12f0caf4..97ef519c 100644 --- a/ScreenPlay/qml/Settings/SettingsView.qml +++ b/ScreenPlay/qml/Settings/SettingsView.qml @@ -429,7 +429,7 @@ Item { description: qsTr("If your ScreenPlay missbehaves this is a good way to look for answers. This shows all logs and warning during runtime.") buttonText: qsTr("Show Logs") onButtonPressed: { - const logsPath = StandardPaths.writableLocation(StandardPaths.GenericDataLocation) + "/ScreenPlay/Logs"; + const logsPath = QCore.StandardPaths.writableLocation(QCore.StandardPaths.GenericDataLocation) + "/ScreenPlay/Logs"; App.util.openFolderInExplorer(logsPath); } } diff --git a/ScreenPlayShader/CMakeLists.txt b/ScreenPlayShader/CMakeLists.txt index fcf74134..4b7317b8 100644 --- a/ScreenPlayShader/CMakeLists.txt +++ b/ScreenPlayShader/CMakeLists.txt @@ -36,7 +36,7 @@ set(RESOURCES assets/test_image_andras-vas-Bd7gNnWJBkU-unsplash.jpg) qt_add_library(${PROJECT_NAME} STATIC) -target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Quick) +target_link_libraries(${PROJECT_NAME} PUBLIC Qt6::Core Qt6::Quick ScreenPlayUtilplugin) target_include_directories(${PROJECT_NAME} PUBLIC src/) qt_add_qml_module( diff --git a/ScreenPlayShader/src/TestMain.cpp b/ScreenPlayShader/src/TestMain.cpp index 5762ea00..c8712b06 100644 --- a/ScreenPlayShader/src/TestMain.cpp +++ b/ScreenPlayShader/src/TestMain.cpp @@ -5,6 +5,7 @@ #include Q_IMPORT_QML_PLUGIN(ScreenPlayShaderPlugin) +Q_IMPORT_QML_PLUGIN(ScreenPlayUtilPlugin) int main(int argc, char* argv[]) { diff --git a/ScreenPlayUtil/CMakeLists.txt b/ScreenPlayUtil/CMakeLists.txt index 198557b3..7db4816e 100644 --- a/ScreenPlayUtil/CMakeLists.txt +++ b/ScreenPlayUtil/CMakeLists.txt @@ -106,13 +106,14 @@ target_include_directories( # Note making this public is so thatscreenplayutil_qmltyperegistrations.cpp # can find the #include include target_include_directories(${PROJECT_NAME} PUBLIC inc/public/ScreenPlayUtil) - +target_include_directories(${PROJECT_NAME}plugin PUBLIC inc/public/ScreenPlayUtil) target_link_libraries( ${PROJECT_NAME} - PRIVATE Qt6::Core Qt6::Quick PUBLIC - Qt6::Gui + Qt6::Core + Qt6::Quick + Qt6::Gui fmt::fmt-header-only LibArchive::LibArchive QArchive) diff --git a/ScreenPlayUtil/inc/public/ScreenPlayUtil/contenttypes.h b/ScreenPlayUtil/inc/public/ScreenPlayUtil/contenttypes.h index 49c5f1e7..e0f45d44 100644 --- a/ScreenPlayUtil/inc/public/ScreenPlayUtil/contenttypes.h +++ b/ScreenPlayUtil/inc/public/ScreenPlayUtil/contenttypes.h @@ -15,7 +15,7 @@ class ContentTypes : public QObject { QML_ELEMENT Q_CLASSINFO("RegisterEnumClassesUnscoped", "false") /*! - \brief Global enum for search types. Used in the "Installed" tab. + \brief Used in the "Installed" tab. */ public: ContentTypes(QObject* parent = nullptr); @@ -57,7 +57,7 @@ class Video : public QObject { public: Video(QObject* parent = nullptr); /*! - \brief Global enum for fill mode. This is a c++ representation + \brief This is a c++ representation of HTML fill modes. We use "_" instead of "-" for scale down, because c++ forbids "-" in enum names. */ diff --git a/ScreenPlayWallpaper/CMakeLists.txt b/ScreenPlayWallpaper/CMakeLists.txt index 0f47c3c3..8ac4ed99 100644 --- a/ScreenPlayWallpaper/CMakeLists.txt +++ b/ScreenPlayWallpaper/CMakeLists.txt @@ -80,7 +80,8 @@ qt_add_qml_module( target_link_libraries( ${PROJECT_NAME} PRIVATE ScreenPlaySDK - ScreenPlayUtil + ScreenPlayUtil + ScreenPlayUtilplugin ScreenPlayWeatherplugin Qt6::Quick Qt6::Gui diff --git a/ScreenPlayWallpaper/main.cpp b/ScreenPlayWallpaper/main.cpp index c16f3df3..1092705a 100644 --- a/ScreenPlayWallpaper/main.cpp +++ b/ScreenPlayWallpaper/main.cpp @@ -23,10 +23,11 @@ Q_IMPORT_QML_PLUGIN(ScreenPlaySysInfoPlugin) #endif Q_IMPORT_QML_PLUGIN(ScreenPlayWeatherPlugin) +Q_IMPORT_QML_PLUGIN(ScreenPlayUtilPlugin) int main(int argc, char* argv[]) { - + using namespace ScreenPlay; // Lets keep using it until: https://bugreports.qt.io/browse/QTBUG-109401 QtWebEngineQuick::initialize(); @@ -83,14 +84,14 @@ int main(int argc, char* argv[]) } else { // 8 parameter + 1 OS working directory as the first default paramter if (argumentList.length() != 9) { - return static_cast(ScreenPlay::WallpaperExit::Code::Invalid_ArgumentSize); + return static_cast(WallpaperExit::Code::Invalid_ArgumentSize); } ScreenPlay::Util util; const auto activeScreensList = util.parseStringToIntegerList(argumentList.at(1)); if (!activeScreensList.has_value()) { qCritical("Could not activeScreensList"); - return static_cast(ScreenPlay::WallpaperExit::Code::Invalid_ActiveScreensList); + return static_cast(WallpaperExit::Code::Invalid_ActiveScreensList); } auto installedType = ScreenPlay::ContentTypes::InstalledType::Unknown; @@ -98,26 +99,26 @@ int main(int argc, char* argv[]) installedType = typeOpt.value(); } else { qCritical() << "Cannot parse Wallpaper type from value" << argumentList.at(6); - return static_cast(ScreenPlay::WallpaperExit::Code::Invalid_InstalledType); + return static_cast(WallpaperExit::Code::Invalid_InstalledType); } bool okParseCheckWallpaperVisible = false; const bool checkWallpaperVisible = argumentList.at(7).toInt(&okParseCheckWallpaperVisible); if (!okParseCheckWallpaperVisible) { qCritical("Could not parse checkWallpaperVisible"); - return static_cast(ScreenPlay::WallpaperExit::Code::Invalid_CheckWallpaperVisible); + return static_cast(WallpaperExit::Code::Invalid_CheckWallpaperVisible); } bool okParseVolume = 0.0f; const float volume = argumentList.at(4).toFloat(&okParseVolume); if (!okParseVolume) { qCritical("Could not parse Volume"); - return static_cast(ScreenPlay::WallpaperExit::Code::Invalid_Volume); + return static_cast(WallpaperExit::Code::Invalid_Volume); } appID = argumentList.at(3); if (!appID.startsWith("appID=")) { qCritical("Invalid appID"); - return static_cast(ScreenPlay::WallpaperExit::Code::Invalid_AppID); + return static_cast(WallpaperExit::Code::Invalid_AppID); } appID = appID.remove("appID="); @@ -132,11 +133,11 @@ int main(int argc, char* argv[]) } const auto setupStatus = window->setup(); - if (setupStatus != ScreenPlay::WallpaperExit::Code::Ok) { + if (setupStatus != WallpaperExit::Code::Ok) { return static_cast(setupStatus); } const auto startStatus = window->start(); - if (startStatus != ScreenPlay::WallpaperExit::Code::Ok) { + if (startStatus != WallpaperExit::Code::Ok) { return static_cast(startStatus); } emit window->qmlStart(); diff --git a/ScreenPlayWallpaper/qml/Wallpaper.qml b/ScreenPlayWallpaper/qml/Wallpaper.qml index 368a0e75..5f725846 100644 --- a/ScreenPlayWallpaper/qml/Wallpaper.qml +++ b/ScreenPlayWallpaper/qml/Wallpaper.qml @@ -20,7 +20,8 @@ Rectangle { // macOS only supports h264 via the native Qt MM if (Qt.platform.os === "osx") { - if ((Wallpaper.videoCodec === Video.VideoCodec.VP8 || Wallpaper.videoCodec === Util.Video.VideoCodec.VP9)) { + print(ContentTypes.InstalledType.VideoWallpaper ) + if ((Wallpaper.videoCodec === Video.VideoCodec.VP8 || Wallpaper.videoCodec === Video.VideoCodec.VP9)) { loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaWebView.qml"; } else { loader.source = "qrc:/qml/ScreenPlayWallpaper/qml/MultimediaView.qml"; diff --git a/ScreenPlayWallpaper/src/basewindow.cpp b/ScreenPlayWallpaper/src/basewindow.cpp index e6bc9f0e..0560f377 100644 --- a/ScreenPlayWallpaper/src/basewindow.cpp +++ b/ScreenPlayWallpaper/src/basewindow.cpp @@ -18,26 +18,27 @@ \brief . */ +namespace ScreenPlay { BaseWindow::BaseWindow() { QGuiApplication::instance()->installEventFilter(this); setOSVersion(QSysInfo::productVersion()); } -ScreenPlay::WallpaperExit::Code BaseWindow::setup() +WallpaperExit::Code BaseWindow::setup() { if (projectPath() == "test") { setType(ScreenPlay::ContentTypes::InstalledType::QMLWallpaper); setProjectSourceFileAbsolute({ "qrc:/qml/ScreenPlayWallpaper/qml/Test.qml" }); setupLiveReloading(); - return ScreenPlay::WallpaperExit::Code::Ok; + return WallpaperExit::Code::Ok; } ScreenPlay::ProjectFile projectFile; projectFile.projectJsonFilePath = QFileInfo(projectPath() + "/project.json"); if (!projectFile.init()) { qWarning() << "Invalid project at " << projectPath(); - return ScreenPlay::WallpaperExit::Code::Invalid_Setup_ProjectParsingError; + return WallpaperExit::Code::Invalid_Setup_ProjectParsingError; } setType(projectFile.type); setProjectSourceFile(projectFile.file); @@ -68,7 +69,7 @@ ScreenPlay::WallpaperExit::Code BaseWindow::setup() sdk()->start(); } - return ScreenPlay::WallpaperExit::Code::Ok; + return WallpaperExit::Code::Ok; } /*! @@ -240,5 +241,6 @@ void BaseWindow::setVideoCodec(ScreenPlay::Video::VideoCodec newVideoCodec) m_videoCodec = newVideoCodec; emit videoCodecChanged(newVideoCodec); } +} #include "moc_basewindow.cpp" diff --git a/ScreenPlayWallpaper/src/basewindow.h b/ScreenPlayWallpaper/src/basewindow.h index c2cb23b0..0db1c384 100644 --- a/ScreenPlayWallpaper/src/basewindow.h +++ b/ScreenPlayWallpaper/src/basewindow.h @@ -19,15 +19,16 @@ #include +namespace ScreenPlay { class BaseWindow : public QObject { Q_OBJECT public: BaseWindow(); - virtual ScreenPlay::WallpaperExit::Code setup() final; + virtual WallpaperExit::Code setup() final; - virtual ScreenPlay::WallpaperExit::Code start() = 0; + virtual WallpaperExit::Code start() = 0; Q_PROPERTY(int width READ width WRITE setWidth NOTIFY widthChanged) Q_PROPERTY(int height READ height WRITE setHeight NOTIFY heightChanged) @@ -357,3 +358,4 @@ protected: QUrl m_projectSourceFileAbsolute; ScreenPlay::Video::VideoCodec m_videoCodec = ScreenPlay::Video::VideoCodec::Unknown; }; +} \ No newline at end of file diff --git a/ScreenPlayWallpaper/src/linuxwaylandwindow.cpp b/ScreenPlayWallpaper/src/linuxwaylandwindow.cpp index 73d453e3..90f82835 100644 --- a/ScreenPlayWallpaper/src/linuxwaylandwindow.cpp +++ b/ScreenPlayWallpaper/src/linuxwaylandwindow.cpp @@ -6,7 +6,8 @@ #include #include -ScreenPlay::WallpaperExitCode LinuxWaylandWindow::start() +namespace ScreenPlay { +WallpaperExit::Code LinuxWaylandWindow::start() { if (!debugMode()) { @@ -31,7 +32,7 @@ ScreenPlay::WallpaperExitCode LinuxWaylandWindow::start() } m_window.show(); - return ScreenPlay::WallpaperExitCode::Ok; + return WallpaperExit::Code::Ok; } void LinuxWaylandWindow::setupWallpaperForOneScreen(int activeScreen) @@ -59,4 +60,5 @@ void LinuxWaylandWindow::destroyThis() void LinuxWaylandWindow::terminate() { QCoreApplication::quit(); +} } \ No newline at end of file diff --git a/ScreenPlayWallpaper/src/linuxwaylandwindow.h b/ScreenPlayWallpaper/src/linuxwaylandwindow.h index 2a949a61..e014c311 100644 --- a/ScreenPlayWallpaper/src/linuxwaylandwindow.h +++ b/ScreenPlayWallpaper/src/linuxwaylandwindow.h @@ -14,11 +14,12 @@ #include "basewindow.h" +namespace ScreenPlay { class LinuxWaylandWindow : public BaseWindow { Q_OBJECT public: - ScreenPlay::WallpaperExitCode start() override; + WallpaperExit::Code start() override; signals: @@ -33,3 +34,4 @@ private: void setupWallpaperForAllScreens(); void setupWallpaperForMultipleScreens(const QVector& activeScreensList); }; +} \ No newline at end of file diff --git a/ScreenPlayWallpaper/src/linuxx11window.cpp b/ScreenPlayWallpaper/src/linuxx11window.cpp index eed0d645..eeb20dc8 100644 --- a/ScreenPlayWallpaper/src/linuxx11window.cpp +++ b/ScreenPlayWallpaper/src/linuxx11window.cpp @@ -24,7 +24,8 @@ #define NAME "xwinwrap" #define ATOM(a) XInternAtom(display, #a, False) -ScreenPlay::WallpaperExitCode LinuxX11Window::start() +namespace ScreenPlay { +WallpaperExit::Code LinuxX11Window::start() { if (!debugMode()) { @@ -111,7 +112,7 @@ ScreenPlay::WallpaperExitCode LinuxX11Window::start() m_window.setResizeMode(QQuickView::ResizeMode::SizeRootObjectToView); m_window.setSource(QUrl("qrc:/qml/ScreenPlayWallpaper/qml/Wallpaper.qml")); m_window.show(); - return ScreenPlay::WallpaperExitCode::Ok; + return WallpaperExit::Code::Ok; } void LinuxX11Window::setupWallpaperForOneScreen(int activeScreen) @@ -139,4 +140,5 @@ void LinuxX11Window::destroyThis() void LinuxX11Window::terminate() { QCoreApplication::quit(); +} } \ No newline at end of file diff --git a/ScreenPlayWallpaper/src/linuxx11window.h b/ScreenPlayWallpaper/src/linuxx11window.h index 26e151dc..0eac4c78 100644 --- a/ScreenPlayWallpaper/src/linuxx11window.h +++ b/ScreenPlayWallpaper/src/linuxx11window.h @@ -13,12 +13,12 @@ #include #include "basewindow.h" - +namespace ScreenPlay { class LinuxX11Window : public BaseWindow { Q_OBJECT public: - ScreenPlay::WallpaperExitCode start() override; + WallpaperExit::Code start() override; signals: @@ -33,3 +33,5 @@ private: void setupWallpaperForAllScreens(); void setupWallpaperForMultipleScreens(const QVector& activeScreensList); }; + +} \ No newline at end of file diff --git a/ScreenPlayWallpaper/src/macwindow.cpp b/ScreenPlayWallpaper/src/macwindow.cpp index a06f5ef6..b4a221aa 100644 --- a/ScreenPlayWallpaper/src/macwindow.cpp +++ b/ScreenPlayWallpaper/src/macwindow.cpp @@ -4,7 +4,8 @@ #include -ScreenPlay::WallpaperExitCode MacWindow::start() +namespace ScreenPlay { +WallpaperExit::Code MacWindow::start() { MacUtils::showDockIcon(false); @@ -31,7 +32,7 @@ ScreenPlay::WallpaperExitCode MacWindow::start() MacIntegration* macIntegration = new MacIntegration(this); macIntegration->SetBackgroundLevel(&m_window); - return ScreenPlay::WallpaperExitCode::Ok; + return WallpaperExit::Code::Ok; } void MacWindow::setVisible(bool show) @@ -53,5 +54,5 @@ void MacWindow::clearComponentCache() { m_window.engine()->clearComponentCache(); } - +} #include "moc_macwindow.cpp" diff --git a/ScreenPlayWallpaper/src/macwindow.h b/ScreenPlayWallpaper/src/macwindow.h index 796fd01a..1af3adac 100644 --- a/ScreenPlayWallpaper/src/macwindow.h +++ b/ScreenPlayWallpaper/src/macwindow.h @@ -15,10 +15,11 @@ #include "basewindow.h" #include "macintegration.h" +namespace ScreenPlay { class MacWindow : public BaseWindow { Q_OBJECT public: - ScreenPlay::WallpaperExitCode start() override; + WallpaperExit::Code start() override; signals: @@ -31,3 +32,4 @@ public slots: private: QQuickView m_window; }; +} \ No newline at end of file diff --git a/ScreenPlayWallpaper/src/winwindow.cpp b/ScreenPlayWallpaper/src/winwindow.cpp index 80905e4e..0ed0549b 100644 --- a/ScreenPlayWallpaper/src/winwindow.cpp +++ b/ScreenPlayWallpaper/src/winwindow.cpp @@ -13,7 +13,9 @@ \brief ScreenPlayWindow used for the Windows implementation. */ -ScreenPlay::WallpaperExit::Code WinWindow::start() +namespace ScreenPlay { + +WallpaperExit::Code WinWindow::start() { connect( &m_window, &QQuickView::statusChanged, this, [this](auto status) { @@ -41,7 +43,7 @@ ScreenPlay::WallpaperExit::Code WinWindow::start() m_windowsIntegration.setWindowHandle(reinterpret_cast(m_window.winId())); if (!IsWindow(m_windowsIntegration.windowHandle())) { qCritical("Could not get a valid window handle!"); - return ScreenPlay::WallpaperExit::Code::Invalid_Start_Windows_HandleError; + return WallpaperExit::Code::Invalid_Start_Windows_HandleError; } qRegisterMetaType(); qRegisterMetaType(); @@ -131,7 +133,7 @@ ScreenPlay::WallpaperExit::Code WinWindow::start() QCoreApplication::postEvent(&m_window, qEvent); }); }); - return ScreenPlay::WallpaperExit::Code::Ok; + return WallpaperExit::Code::Ok; } /*! @@ -415,5 +417,6 @@ void WinWindow::checkForFullScreenWindow() setVisualsPaused(hasFullscreenWindow); } +} #include "moc_winwindow.cpp" diff --git a/ScreenPlayWallpaper/src/winwindow.h b/ScreenPlayWallpaper/src/winwindow.h index b345d72d..a4744236 100644 --- a/ScreenPlayWallpaper/src/winwindow.h +++ b/ScreenPlayWallpaper/src/winwindow.h @@ -20,6 +20,8 @@ #include "windowsdesktopproperties.h" #include "windowsintegration.h" +namespace ScreenPlay { + class WinWindow : public BaseWindow { Q_OBJECT @@ -28,7 +30,7 @@ class WinWindow : public BaseWindow { public: WindowsDesktopProperties* windowsDesktopProperties() const { return m_windowsDesktopProperties.get(); } - ScreenPlay::WallpaperExit::Code start() override; + WallpaperExit::Code start() override; public slots: void setVisible(bool show) override; @@ -67,3 +69,4 @@ private: QTimer m_reconfigureTimer; std::unique_ptr m_windowsDesktopProperties; }; +} diff --git a/ScreenPlayWeather/CMakeLists.txt b/ScreenPlayWeather/CMakeLists.txt index 9b8d71f0..48a1a912 100644 --- a/ScreenPlayWeather/CMakeLists.txt +++ b/ScreenPlayWeather/CMakeLists.txt @@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_AUTOMOC ON) set(CMAKE_CXX_STANDARD_REQUIRED ON) +find_package(LibArchive REQUIRED) find_package( Qt6 COMPONENTS Core Quick @@ -242,7 +243,7 @@ set(RESOURCES assets/icons/wi-windy.svg) qt_add_library(${PROJECT_NAME} STATIC) -target_link_libraries(${PROJECT_NAME} PUBLIC ScreenPlayUtil) +target_link_libraries(${PROJECT_NAME} PUBLIC ScreenPlayUtil ScreenPlayUtilplugin) target_include_directories(${PROJECT_NAME} PUBLIC src/) qt_add_qml_module( diff --git a/ScreenPlayWeather/src/TestMain.cpp b/ScreenPlayWeather/src/TestMain.cpp index ae4115bb..1612e4bf 100644 --- a/ScreenPlayWeather/src/TestMain.cpp +++ b/ScreenPlayWeather/src/TestMain.cpp @@ -4,6 +4,7 @@ #include Q_IMPORT_QML_PLUGIN(ScreenPlayWeatherPlugin) +Q_IMPORT_QML_PLUGIN(ScreenPlayUtilPlugin) int main(int argc, char* argv[]) { diff --git a/ScreenPlayWidget/CMakeLists.txt b/ScreenPlayWidget/CMakeLists.txt index b22883a6..257984b6 100644 --- a/ScreenPlayWidget/CMakeLists.txt +++ b/ScreenPlayWidget/CMakeLists.txt @@ -40,7 +40,8 @@ qt_add_executable( target_link_libraries( ${PROJECT_NAME} PRIVATE ScreenPlaySDK - ScreenPlayUtil + ScreenPlayUtil + ScreenPlayUtilplugin ScreenPlayWeatherplugin Qt6::Quick Qt6::Gui @@ -52,7 +53,7 @@ target_link_libraries( Qt6::WebEngineQuick) if(WIN32) - target_link_libraries(${PROJECT_NAME} PRIVATE ScreenPlaySysInfoplugin) + target_link_libraries(${PROJECT_NAME} PRIVATE ScreenPlaySysInfoplugin ScreenPlayUtilplugin) endif() qt_add_qml_module( diff --git a/ScreenPlayWidget/main.cpp b/ScreenPlayWidget/main.cpp index 50f89732..f7390775 100644 --- a/ScreenPlayWidget/main.cpp +++ b/ScreenPlayWidget/main.cpp @@ -19,6 +19,7 @@ Q_IMPORT_QML_PLUGIN(ScreenPlaySysInfoPlugin) #endif Q_IMPORT_QML_PLUGIN(ScreenPlayWeatherPlugin) +Q_IMPORT_QML_PLUGIN(ScreenPlayUtilPlugin) int main(int argc, char* argv[]) { diff --git a/ScreenPlayWorkshop/CMakeLists.txt b/ScreenPlayWorkshop/CMakeLists.txt index 721754c1..03b3f07c 100644 --- a/ScreenPlayWorkshop/CMakeLists.txt +++ b/ScreenPlayWorkshop/CMakeLists.txt @@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD 20) set(CMAKE_AUTOMOC ON) set(CMAKE_CXX_STANDARD_REQUIRED ON) +find_package(LibArchive REQUIRED) find_package( Qt6 COMPONENTS Core Quick QuickControls2 diff --git a/ScreenPlayWorkshop/src/TestMain.cpp b/ScreenPlayWorkshop/src/TestMain.cpp index 12ae88d7..cff39913 100644 --- a/ScreenPlayWorkshop/src/TestMain.cpp +++ b/ScreenPlayWorkshop/src/TestMain.cpp @@ -6,6 +6,7 @@ #include Q_IMPORT_QML_PLUGIN(ScreenPlayWorkshopPlugin) +Q_IMPORT_QML_PLUGIN(ScreenPlayUtilPlugin) int main(int argc, char* argv[]) {