1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 08:22:33 +02:00

Add switch between x11 and wayland

Add missing dependencies
This commit is contained in:
Elias Steurer 2023-08-25 13:29:47 +02:00
parent 925899f15d
commit e53f75b59b
2 changed files with 32 additions and 25 deletions

View File

@ -4,6 +4,8 @@
"delgan.qml-format", "delgan.qml-format",
"ms-vscode.cpptools-extension-pack", "ms-vscode.cpptools-extension-pack",
"ms-vscode.cmake-tools", "ms-vscode.cmake-tools",
"seanwu.vscode-qt-for-python" "seanwu.vscode-qt-for-python",
"mhutchie.git-graph",
"vadimcn.vscode-lldb"
] ]
} }

View File

@ -36,14 +36,19 @@ int main(int argc, char* argv[])
#endif #endif
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
std::unique_ptr<BaseWindow> window;
const auto platformName = QGuiApplication::platformName();
#if defined(Q_OS_WIN) #if defined(Q_OS_WIN)
WinWindow window; window = std::make_unique<WinWindow>();
#elif defined(Q_OS_LINUX) #elif defined(Q_OS_LINUX)
//LinuxX11Window window; if(platformName == "xcb"){
LinuxWaylandWindow window; window = std::make_unique<LinuxX11Window>();
} else if(platformName == "wayland"){
window = std::make_unique<LinuxWaylandWindow>();
}
#elif defined(Q_OS_OSX) #elif defined(Q_OS_OSX)
MacWindow window; window = std::make_unique<MacWindow>();
#endif #endif
// If we start with only one argument (app path) // If we start with only one argument (app path)
@ -61,17 +66,17 @@ int main(int argc, char* argv[])
"/wallpaper_video_astronaut_vp9", // 4 "/wallpaper_video_astronaut_vp9", // 4
"/wallpaper_video_nebula_h264" // 5 "/wallpaper_video_nebula_h264" // 5
}; };
const int index = 5; const int index = 1;
QString projectPath = exampleContentPath + contentFolder.at(index); QString projectPath = exampleContentPath + contentFolder.at(index);
window.setActiveScreensList({ 0 }); window->setActiveScreensList({ 0 });
window.setProjectPath(projectPath); window->setProjectPath(projectPath);
window.setAppID("test"); window->setAppID("test");
window.setVolume(1); window->setVolume(1);
window.setFillMode("cover"); window->setFillMode("cover");
window.setType(ScreenPlay::InstalledType::InstalledType::VideoWallpaper); window->setType(ScreenPlay::InstalledType::InstalledType::VideoWallpaper);
window.setCheckWallpaperVisible(true); window->setCheckWallpaperVisible(true);
window.setDebugMode(false); window->setDebugMode(false);
} else { } else {
// 8 parameter + 1 OS working directory as the first default paramter // 8 parameter + 1 OS working directory as the first default paramter
if (argumentList.length() != 9) { if (argumentList.length() != 9) {
@ -113,24 +118,24 @@ int main(int argc, char* argv[])
} }
appID = appID.remove("appID="); appID = appID.remove("appID=");
window.setActiveScreensList(activeScreensList.value()); window->setActiveScreensList(activeScreensList.value());
window.setProjectPath(argumentList.at(2)); window->setProjectPath(argumentList.at(2));
window.setAppID(appID); window->setAppID(appID);
window.setVolume(volume); window->setVolume(volume);
window.setFillMode(argumentList.at(5)); window->setFillMode(argumentList.at(5));
window.setType(installedType); window->setType(installedType);
window.setCheckWallpaperVisible(checkWallpaperVisible); window->setCheckWallpaperVisible(checkWallpaperVisible);
window.setDebugMode(false); window->setDebugMode(false);
} }
const auto setupStatus = window.setup(); const auto setupStatus = window->setup();
if (setupStatus != ScreenPlay::WallpaperExitCode::Ok) { if (setupStatus != ScreenPlay::WallpaperExitCode::Ok) {
return static_cast<int>(setupStatus); return static_cast<int>(setupStatus);
} }
const auto startStatus = window.start(); const auto startStatus = window->start();
if (startStatus != ScreenPlay::WallpaperExitCode::Ok) { if (startStatus != ScreenPlay::WallpaperExitCode::Ok) {
return static_cast<int>(startStatus); return static_cast<int>(startStatus);
} }
emit window.qmlStart(); emit window->qmlStart();
return app.exec(); return app.exec();
} }