mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-09-18 16:32:33 +02:00
Merge remote-tracking branch 'origin/feature/macos' into dev
# Conflicts: # ScreenPlay.pro
This commit is contained in:
commit
e5302d6d00
5
.gitignore
vendored
5
.gitignore
vendored
@ -70,4 +70,7 @@ Thumbs.db
|
||||
|
||||
!ScreenPlay/ThirdParty/**
|
||||
!ScreenPlay/translations/**
|
||||
/build-*/**
|
||||
/build-*/**
|
||||
*_qmlcache.qrc
|
||||
ScreenPlay/ThirdParty/.DS_Store
|
||||
*.DS_Store
|
||||
|
@ -6,6 +6,7 @@ SUBDIRS = \
|
||||
ScreenPlayWindow/ScreenPlayWindow.pro \
|
||||
ScreenPlay/ThirdParty/stomt-qt-sdk/sdk/stomt-qt-sdk.pro \
|
||||
ScreenPlayWidget/ScreenPlayWidget.pro \
|
||||
#ScreenPlay/ThirdParty/qt-google-analytics/qt-google-analytics.pro \
|
||||
|
||||
ScreenPlayWindow.depends = ScreenPlaySDK
|
||||
ScreenPlayWidget.depends = ScreenPlaySDK
|
||||
|
@ -56,16 +56,16 @@ INCLUDEPATH += \
|
||||
$$PWD/ThirdParty/ \
|
||||
$$PWD/src/
|
||||
|
||||
include(ThirdParty/qt-google-analytics/qt-google-analytics.pri)
|
||||
LIBS += -lqt-google-analytics
|
||||
#include(ThirdParty/qt-google-analytics/qt-google-analytics.pri)
|
||||
#LIBS += -lqt-google-analytics
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
install_it.path = $${OUT_PWD}/debug/
|
||||
QMAKE_LIBDIR += $$OUT_PWD/ThirdParty/qt-google-analytics/debug
|
||||
#QMAKE_LIBDIR += $$OUT_PWD/ThirdParty/qt-google-analytics/debug
|
||||
|
||||
} else {
|
||||
install_it.path = $${OUT_PWD}/release/
|
||||
QMAKE_LIBDIR += $$OUT_PWD/ThirdParty/qt-google-analytics/release
|
||||
#QMAKE_LIBDIR += $$OUT_PWD/ThirdParty/qt-google-analytics/release
|
||||
}
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ win32 {
|
||||
install_it.files += ThirdParty\steam\redistributable_bin\win64\steam_api64.dll
|
||||
}
|
||||
|
||||
unix {
|
||||
unix:!macx {
|
||||
LIBS += -L$$PWD/ThirdParty/steam/redistributable_bin/linux64/ -lsteam_api
|
||||
DEPENDPATH += $$PWD/ThirdParty/steam/redistributable_bin/linux64
|
||||
|
||||
@ -131,6 +131,24 @@ unix {
|
||||
install_it.files += ThirdParty\steam\redistributable_bin\linux64\libsteam_api.so
|
||||
}
|
||||
|
||||
macx: {
|
||||
LIBS += -L$$PWD/ThirdParty/steam/redistributable_bin/osx32/ -lsteam_api
|
||||
DEPENDPATH += $$PWD/ThirdParty/steam/redistributable_bin/osx32
|
||||
|
||||
INCLUDEPATH += $$PWD/ThirdParty/steam/
|
||||
DEPENDPATH += $$PWD/ThirdParty/steam/
|
||||
|
||||
LIBS += -L$$PWD/ThirdParty/steam/lib/osx32/ -lsdkencryptedappticket
|
||||
|
||||
steam_data.files += steam_appid.txt
|
||||
steam_data.path = Contents/MacOS
|
||||
steam_data_lib.files += $$PWD/ThirdParty/steam/redistributable_bin/osx32/libsteam_api.dylib
|
||||
steam_data_lib.path = Contents/MacOS/
|
||||
QMAKE_BUNDLE_DATA += steam_data
|
||||
QMAKE_BUNDLE_DATA += steam_data_lib
|
||||
|
||||
}
|
||||
|
||||
DISTFILES += \
|
||||
favicon.ico
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
precision lowp float;
|
||||
|
||||
uniform float time;
|
||||
uniform vec2 resolution;
|
||||
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include <qt_windows.h>
|
||||
#endif
|
||||
|
||||
#include "ThirdParty/qt-google-analytics/ganalytics.h"
|
||||
//#include "ThirdParty/qt-google-analytics/ganalytics.h"
|
||||
#include "src/create.h"
|
||||
#include "src/installedlistfilter.h"
|
||||
#include "src/installedlistmodel.h"
|
||||
@ -90,9 +90,19 @@ int main(int argc, char* argv[])
|
||||
|
||||
#ifdef QT_DEBUG
|
||||
qDebug() << "Starting in Debug mode!";
|
||||
|
||||
if (SPWorkingDir.cdUp()) {
|
||||
#ifdef Q_OS_OSX
|
||||
settings.setScreenPlayWindowPath(QUrl::fromUserInput(SPWorkingDir.path() + "/../../../ScreenPlayWindow/ScreenPlayWindow.app/Contents/MacOS/ScreenPlayWindow").toLocalFile());
|
||||
settings.setScreenPlayWidgetPath(QUrl::fromUserInput(SPWorkingDir.path() + "/../../../ScreenPlayWidget/ScreenPlayWidget.app/Contents/MacOS/ScreenPlayWidget").toLocalFile());
|
||||
qDebug() << "Setting ScreenPlayWindow Path to " << settings.getScreenPlayWindowPath();
|
||||
qDebug() << "Setting ScreenPlayWdiget Path to " << settings.getScreenPlayWidgetPath();
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
settings.setScreenPlayWindowPath(QUrl(SPWorkingDir.path() + "/ScreenPlayWindow/debug/ScreenPlayWindow.exe"));
|
||||
settings.setScreenPlayWidgetPath(QUrl(SPWorkingDir.path() + "/ScreenPlayWidget/debug/ScreenPlayWidget.exe"));
|
||||
#endif
|
||||
}
|
||||
|
||||
// We need to detect the right base path so we can copy later the example projects
|
||||
@ -138,7 +148,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
QQmlApplicationEngine mainWindowEngine;
|
||||
|
||||
qmlRegisterType<GAnalytics>("analytics", 0, 1, "Tracker");
|
||||
//qmlRegisterType<GAnalytics>("analytics", 0, 1, "Tracker");
|
||||
mainWindowEngine.rootContext()->setContextProperty("screenPlay", &screenPlay);
|
||||
mainWindowEngine.rootContext()->setContextProperty("screenPlayCreate", &create);
|
||||
mainWindowEngine.rootContext()->setContextProperty("utility", &qmlUtil);
|
||||
|
@ -4,7 +4,6 @@ import QtQuick.Controls 2.3
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtGraphicalEffects 1.0
|
||||
import Qt.labs.platform 1.0
|
||||
import analytics 0.1
|
||||
|
||||
import "qml/"
|
||||
import "qml/Installed"
|
||||
@ -19,26 +18,16 @@ ApplicationWindow {
|
||||
minimumHeight: 788
|
||||
minimumWidth: 1050
|
||||
|
||||
Tracker {
|
||||
id: tracker
|
||||
Component.onCompleted: tracker.sendScreenView("Installed")
|
||||
trackingID: "UA-43193236-3"
|
||||
sendInterval: 100
|
||||
}
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
tracker.startSession()
|
||||
if (!screenPlaySettings.autostart) {
|
||||
show()
|
||||
}
|
||||
steamWorkshop.initSteam()
|
||||
}
|
||||
Component.onDestruction: {
|
||||
tracker.endSession()
|
||||
}
|
||||
|
||||
function switchPage(name) {
|
||||
tracker.sendScreenView(name)
|
||||
if (name === "Create") {
|
||||
pageLoader.visible = false
|
||||
pageLoaderCreate.setSource("qrc:/qml/Create/Create.qml")
|
||||
|
@ -3,7 +3,7 @@ import QtQml.Models 2.2
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Styles 1.4
|
||||
import QtGraphicalEffects 1.0
|
||||
import analytics 0.1
|
||||
|
||||
|
||||
Item {
|
||||
id: pageInstalled
|
||||
@ -149,12 +149,6 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Tracker {
|
||||
id: tracker
|
||||
trackingID: "UA-43193236-3"
|
||||
sendInterval: 1000
|
||||
}
|
||||
|
||||
function onPageChanged(name) {
|
||||
setSidebarActive(false)
|
||||
if (name === "All") {
|
||||
|
@ -139,14 +139,14 @@ Item {
|
||||
id: screenPlayItemImage
|
||||
anchors.fill: parent
|
||||
sourceImage: Qt.resolvedUrl(
|
||||
"file:///" + screenPlayItem.absoluteStoragePath
|
||||
screenPlayItem.absoluteStoragePath
|
||||
+ "/" + screenPreview)
|
||||
sourceImageGIF: {
|
||||
if (screenPreviewGIF === undefined) {
|
||||
return ""
|
||||
} else {
|
||||
return Qt.resolvedUrl(
|
||||
"file:///" + screenPlayItem.absoluteStoragePath
|
||||
screenPlayItem.absoluteStoragePath
|
||||
+ "/" + screenPreviewGIF)
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ Item {
|
||||
onActiveScreenChanged: {
|
||||
txtHeadline.text = installedListModel.get(activeScreen).screenTitle
|
||||
image.source = Qt.resolvedUrl(
|
||||
"file:///" + installedListModel.absoluteStoragePath + "/"
|
||||
installedListModel.absoluteStoragePath + "/"
|
||||
+ activeScreen + "/" + installedListModel.get(
|
||||
activeScreen).screenPreview)
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ import QtQuick 2.9
|
||||
import QtQuick.Controls 2.3
|
||||
import QtQuick.Controls.Material 2.2
|
||||
import QtGraphicalEffects 1.0
|
||||
import net.aimber.workshop 1.0
|
||||
|
||||
Item {
|
||||
id: workshop
|
||||
|
@ -90,11 +90,11 @@ void InstalledListModel::loadScreens()
|
||||
QJsonDocument jsonProject;
|
||||
QJsonParseError parseError;
|
||||
|
||||
QFileInfoList list = QDir(m_absoluteStoragePath.toString()).entryInfoList(QDir::NoDotAndDotDot | QDir::AllDirs);
|
||||
QFileInfoList list = QDir(m_absoluteStoragePath.toLocalFile()).entryInfoList(QDir::NoDotAndDotDot | QDir::AllDirs);
|
||||
QString tmpPath;
|
||||
|
||||
for (auto&& item : list) {
|
||||
tmpPath = m_absoluteStoragePath.toString() + "/" + item.baseName() + "/project.json";
|
||||
tmpPath = m_absoluteStoragePath.toLocalFile() + "/" + item.baseName() + "/project.json";
|
||||
|
||||
if (!QFile(tmpPath).exists())
|
||||
continue;
|
||||
|
@ -29,7 +29,11 @@ QString QMLUtilities::fixWindowsPath(QString url)
|
||||
void QMLUtilities::openFolderInExplorer(QString url)
|
||||
{
|
||||
QProcess explorer;
|
||||
#ifdef Q_OS_WIN
|
||||
explorer.setProgram("explorer.exe");
|
||||
#elif defined(Q_OS_OSX)
|
||||
explorer.setProgram("open");
|
||||
#endif
|
||||
QStringList args;
|
||||
args.append(QDir::toNativeSeparators(url));
|
||||
explorer.setArguments(args);
|
||||
|
@ -24,9 +24,9 @@ void ScreenPlay::createWallpaper(int monitorIndex, QUrl absoluteStoragePath, QSt
|
||||
m_settings->increaseActiveWallpaperCounter();
|
||||
QVector<int> tmpMonitorIndex;
|
||||
tmpMonitorIndex.append(monitorIndex);
|
||||
m_screenPlayWallpaperList.append(QSharedPointer<ScreenPlayWallpaper>(new ScreenPlayWallpaper(tmpMonitorIndex, absoluteStoragePath.toString(), previewImage, volume, fillMode, type, this)));
|
||||
m_screenPlayWallpaperList.append(QSharedPointer<ScreenPlayWallpaper>(new ScreenPlayWallpaper(tmpMonitorIndex, absoluteStoragePath.toLocalFile(), previewImage, volume, fillMode, type, this)));
|
||||
|
||||
m_mlm->setWallpaperActiveMonitor(m_qGuiApplication->screens().at(monitorIndex), absoluteStoragePath.toString() + "/" + previewImage);
|
||||
m_mlm->setWallpaperActiveMonitor(m_qGuiApplication->screens().at(monitorIndex), absoluteStoragePath.toLocalFile() + "/" + previewImage);
|
||||
}
|
||||
|
||||
void ScreenPlay::createWidget(QUrl absoluteStoragePath, QString previewImage)
|
||||
@ -36,9 +36,9 @@ void ScreenPlay::createWidget(QUrl absoluteStoragePath, QString previewImage)
|
||||
return;
|
||||
}
|
||||
|
||||
QString fullPath = absoluteStoragePath.toString() + "/" + project.m_file.toString();
|
||||
QString fullPath = absoluteStoragePath.toLocalFile() + "/" + project.m_file.toString();
|
||||
|
||||
m_screenPlayWidgetList.append(QSharedPointer<ScreenPlayWidget>(new ScreenPlayWidget(absoluteStoragePath.toString(), previewImage, fullPath, this)));
|
||||
m_screenPlayWidgetList.append(QSharedPointer<ScreenPlayWidget>(new ScreenPlayWidget(absoluteStoragePath.toLocalFile(), previewImage, fullPath, this)));
|
||||
}
|
||||
|
||||
void ScreenPlay::removeAllWallpaper()
|
||||
|
@ -96,6 +96,9 @@ public:
|
||||
proArgs.append(parent->m_settings->decoder());
|
||||
proArgs.append(QString::number(volume));
|
||||
proArgs.append(fillMode);
|
||||
|
||||
qDebug() << proArgs;
|
||||
|
||||
m_process->setArguments(proArgs);
|
||||
m_process->setProgram(parent->settings()->screenPlayWindowPath().toString());
|
||||
m_process->start();
|
||||
@ -212,7 +215,7 @@ public:
|
||||
m_projectPath = projectPath;
|
||||
m_fullPath = fullPath;
|
||||
m_previewImage = previewImage;
|
||||
m_process = new QProcess(this);
|
||||
m_process = new QProcess(this); //PLS LESS BEHINDERT @Elias
|
||||
|
||||
QStringList proArgs;
|
||||
proArgs.append(m_projectPath);
|
||||
@ -223,9 +226,13 @@ public:
|
||||
if (fullPath.endsWith(".exe")) {
|
||||
m_process->setProgram(fullPath);
|
||||
} else if (fullPath.endsWith(".qml")) {
|
||||
m_process->setProgram(parent->m_settings->getScreenPlayWidgetPath().toString());
|
||||
m_process->setProgram(parent->m_settings->getScreenPlayWidgetPath().path());
|
||||
}
|
||||
qDebug() << m_process->program();
|
||||
connect(m_process,&QProcess::errorOccurred, this, [](QProcess::ProcessError error){
|
||||
qDebug() << "error: " << error;
|
||||
|
||||
});
|
||||
m_process->start();
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "settings.h"
|
||||
#include <QGuiApplication>
|
||||
|
||||
#include <QStandardPaths>
|
||||
Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListModel* ilm, SDKConnector* sdkc, AppId_t steamID, QGuiApplication* app, QObject* parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
@ -13,10 +13,10 @@ Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListMo
|
||||
m_qGuiApplication = app;
|
||||
|
||||
QFile configTmp;
|
||||
QString appConfigLocation = QGuiApplication::applicationDirPath();
|
||||
m_localSettingsPath = QUrl(appConfigLocation);
|
||||
QString appConfigLocation = QStandardPaths::writableLocation(QStandardPaths::DataLocation);
|
||||
m_localSettingsPath = QUrl::fromUserInput(appConfigLocation);
|
||||
if (!QDir(appConfigLocation).exists()) {
|
||||
if (!QDir().mkdir(appConfigLocation)) {
|
||||
if (!QDir().mkpath(appConfigLocation)) {
|
||||
qWarning("ERROR: Cloud not create install dir");
|
||||
return;
|
||||
}
|
||||
@ -69,7 +69,7 @@ Settings::Settings(ProfileListModel* plm, MonitorListModel* mlm, InstalledListMo
|
||||
|
||||
m_localStoragePath = steamTmpUrl.path();
|
||||
} else {
|
||||
m_localStoragePath = configObj.value("absoluteStoragePath").toString();
|
||||
m_localStoragePath = QUrl::fromUserInput(configObj.value("absoluteStoragePath").toString());
|
||||
}
|
||||
|
||||
m_ilm->setabsoluteStoragePath(m_localStoragePath);
|
||||
@ -92,7 +92,7 @@ Settings::~Settings()
|
||||
QString Settings::loadProject(QString file)
|
||||
{
|
||||
QFile configTmp;
|
||||
file = file.replace("file:///", "");
|
||||
//file = file.replace("file:///", "");
|
||||
configTmp.setFileName(file);
|
||||
configTmp.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||
return configTmp.readAll();
|
||||
@ -104,7 +104,7 @@ void Settings::loadActiveProfiles()
|
||||
QJsonObject configObj;
|
||||
QJsonArray activeProfilesTmp;
|
||||
QFile configTmp;
|
||||
configTmp.setFileName(m_localSettingsPath.toString() + "/settings.json");
|
||||
configTmp.setFileName(m_localSettingsPath.toLocalFile() + "/settings.json");
|
||||
|
||||
configTmp.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||
QString config = configTmp.readAll();
|
||||
@ -155,7 +155,7 @@ void Settings::writeSingleSettingConfig(QString name, QVariant value)
|
||||
QJsonObject configObj;
|
||||
QFile configTmp;
|
||||
|
||||
configTmp.setFileName(m_localSettingsPath.toString() + "/settings.json");
|
||||
configTmp.setFileName(m_localSettingsPath.toLocalFile() + "/settings.json");
|
||||
configTmp.open(QIODevice::ReadOnly | QIODevice::Text);
|
||||
QString config = configTmp.readAll();
|
||||
configJsonDocument = QJsonDocument::fromJson(config.toUtf8(), &parseError);
|
||||
@ -264,7 +264,7 @@ void Settings::setPlayAll(bool isPlaying)
|
||||
void Settings::createDefaultConfig()
|
||||
{
|
||||
|
||||
QFile file(QGuiApplication::applicationDirPath() + "/settings.json");
|
||||
QFile file(m_localSettingsPath.toLocalFile() + "/settings.json");
|
||||
QFile defaultSettings(":/settings.json");
|
||||
|
||||
file.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
|
@ -227,7 +227,7 @@ public slots:
|
||||
return;
|
||||
|
||||
//Remove: "file:///"
|
||||
QJsonValue cleanedPath = QJsonValue(QString(localStoragePath.toString()).remove(0, 8));
|
||||
QJsonValue cleanedPath = QJsonValue(localStoragePath.toString()); // QJsonValue(QString(localStoragePath.toString()).remove(0, 8));
|
||||
|
||||
writeSingleSettingConfig("absoluteStoragePath", cleanedPath);
|
||||
|
||||
|
@ -17,6 +17,7 @@ void SteamWorkshop::initSteam()
|
||||
m_steamErrorRestart = true;
|
||||
}
|
||||
|
||||
//IF THE FAMILY SHARING IS ENABLED THIS WILL FAIL ! #13
|
||||
if (!SteamAPI_Init()) {
|
||||
qWarning() << "Could not init steam sdk!";
|
||||
m_steamErrorAPIInit = true;
|
||||
|
@ -9,8 +9,9 @@
|
||||
#endif
|
||||
|
||||
// https://github.com/rainmeter/rainmeter/blob/master/Library/MeasureCPU.cpp
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
typedef LONG(WINAPI* FPNTQSI)(UINT, PVOID, ULONG, PULONG);
|
||||
#endif
|
||||
|
||||
class CPU : public QObject {
|
||||
Q_OBJECT
|
||||
@ -69,10 +70,10 @@ private:
|
||||
|
||||
double m_OldTime[2];
|
||||
|
||||
static FPNTQSI c_NtQuerySystemInformation;
|
||||
//static FPNTQSI c_NtQuerySystemInformation;
|
||||
|
||||
static int c_NumOfProcessors;
|
||||
static ULONG c_BufferSize;
|
||||
//static ULONG c_BufferSize;
|
||||
int m_tickRate = 500;
|
||||
QTimer m_updateTimer;
|
||||
};
|
||||
|
@ -47,10 +47,6 @@ QML_IMPORT_PATH =
|
||||
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
||||
QML_DESIGNER_IMPORT_PATH =
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
HEADERS += \
|
||||
src/spwidgetmainwindow.h
|
||||
|
@ -14,7 +14,11 @@
|
||||
#include <QSharedPointer>
|
||||
#include <QString>
|
||||
#include <QWindow>
|
||||
#ifdef Q_OS_WIN
|
||||
#include <qt_windows.h>
|
||||
#else
|
||||
typedef long HWND;
|
||||
#endif
|
||||
|
||||
class SPWidgetmainwindow : public QWindow {
|
||||
Q_OBJECT
|
||||
|
@ -12,6 +12,14 @@ SOURCES += \
|
||||
HEADERS += \
|
||||
src/SPWmainwindow.h
|
||||
|
||||
macx: {
|
||||
QMAKE_LFLAGS += -framework Cocoa
|
||||
SOURCES += src/macintegration.cpp
|
||||
HEADERS += src/macintegration.h \
|
||||
src/macbridge.h
|
||||
OBJECTIVE_SOURCES += src/MacBridge.mm
|
||||
}
|
||||
|
||||
RESOURCES += \
|
||||
SPWResources.qrc
|
||||
|
||||
@ -22,24 +30,37 @@ INCLUDEPATH += \
|
||||
|
||||
include(../ScreenPlaySDK/Screenplaysdk.pri)
|
||||
|
||||
macx: {
|
||||
QMAKE_LIBDIR += $$OUT_PWD/
|
||||
install_it.path = $${OUT_PWD}/../ScreenPlaySDK
|
||||
}
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
LIBS += -lScreenplaysdkd
|
||||
install_it.path = $${OUT_PWD}/debug/
|
||||
QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/debug
|
||||
} else {
|
||||
LIBS += -lScreenplaysdk
|
||||
install_it.path = $${OUT_PWD}/release/
|
||||
QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/release
|
||||
}
|
||||
QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK
|
||||
!macx: {
|
||||
CONFIG(debug, debug|release) {
|
||||
LIBS += -lScreenplaysdkd
|
||||
install_it.path = $${OUT_PWD}/debug/
|
||||
QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/debug
|
||||
} else {
|
||||
LIBS += -lScreenplaysdk
|
||||
install_it.path = $${OUT_PWD}/release/
|
||||
QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK/release
|
||||
}
|
||||
QMAKE_LIBDIR += $$OUT_PWD/../ScreenPlaySDK
|
||||
}
|
||||
|
||||
macx: {
|
||||
html_data.files = index.html
|
||||
html_data.path = Contents/MacOS
|
||||
QMAKE_BUNDLE_DATA += html_data
|
||||
}
|
||||
|
||||
!macx: {
|
||||
install_it.files += index.html \
|
||||
|
||||
INSTALLS += install_it
|
||||
|
||||
DISTFILES += \
|
||||
index.html
|
||||
}
|
||||
|
||||
|
||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||
QML_IMPORT_PATH =
|
||||
@ -54,9 +75,5 @@ QT_QUICK_CONTROLS_STYLE = "Material"
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# Default rules for deployment.
|
||||
qnx: target.path = /tmp/$${TARGET}/bin
|
||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||
!isEmpty(target.path): INSTALLS += target
|
||||
|
||||
|
||||
|
@ -3,16 +3,19 @@
|
||||
<head>
|
||||
<style type="text/css">
|
||||
video {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: fill;
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
background:black;
|
||||
background:black;
|
||||
}
|
||||
body, html{
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
overflow: hidden;
|
||||
background:black;
|
||||
overflow: hidden;
|
||||
background:orange;
|
||||
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
30
ScreenPlayWindow/src/MacBridge.mm
Normal file
30
ScreenPlayWindow/src/MacBridge.mm
Normal file
@ -0,0 +1,30 @@
|
||||
#include "macbridge.h"
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <objc/runtime.h>
|
||||
#include <QApplication>
|
||||
#include <QWindow>
|
||||
|
||||
MacBridge * MacBridge::bridge = NULL;
|
||||
|
||||
MacBridge::MacBridge()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
MacBridge * MacBridge::instance()
|
||||
{
|
||||
if(!bridge)
|
||||
bridge = new MacBridge;
|
||||
return bridge;
|
||||
}
|
||||
|
||||
void MacBridge::SetBackgroundLevel(QWindow* window)
|
||||
{
|
||||
NSView* view = (NSView *) window->winId();
|
||||
NSWindow* nsWindow = (NSWindow*)[view window];
|
||||
|
||||
[nsWindow setLevel:CGWindowLevelForKey(kCGDesktopWindowLevelKey) + 1];
|
||||
[nsWindow setBackgroundColor: [NSColor blackColor]];
|
||||
[nsWindow setAcceptsMouseMovedEvents: false];
|
||||
[nsWindow setMovableByWindowBackground: false];
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
#include "SPWmainwindow.h"
|
||||
#include "macintegration.h"
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
BOOL WINAPI SearchForWorkerWindow(HWND hwnd, LPARAM lparam)
|
||||
@ -15,11 +16,13 @@ BOOL WINAPI SearchForWorkerWindow(HWND hwnd, LPARAM lparam)
|
||||
}
|
||||
#endif
|
||||
|
||||
//for mac https://github.com/silvansky/QtMacApp/search?q=myprivate&unscoped_q=myprivate
|
||||
|
||||
MainWindow::MainWindow(int i, QString projectPath, QString id, QString decoder, QString volume, QString fillmode, QScreen* parent)
|
||||
: QWindow(parent)
|
||||
{
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
|
||||
m_appID = id;
|
||||
m_screenNumber.insert(0, i);
|
||||
@ -89,6 +92,8 @@ MainWindow::MainWindow(int i, QString projectPath, QString id, QString decoder,
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
m_hwnd = (HWND)this->winId();
|
||||
HWND progman_hwnd = FindWindowW(L"Progman", L"Program Manager");
|
||||
|
||||
@ -116,6 +121,17 @@ MainWindow::MainWindow(int i, QString projectPath, QString id, QString decoder,
|
||||
SetWindowLongPtr(m_hwnd, GWL_STYLE, WS_CHILDWINDOW | WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU | WS_POPUP);
|
||||
SetWindowLongPtr(m_hwnd, GWL_EXSTYLE, WS_EX_LEFT | WS_EX_LTRREADING | WS_EX_RIGHTSCROLLBAR | WS_EX_NOACTIVATE | WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
//debug
|
||||
this->setWidth(screen->size().width());
|
||||
this->setHeight(screen->size().height());
|
||||
int x = screen->geometry().x();
|
||||
int y = screen->geometry().y();
|
||||
this->setX(screen->geometry().x());// + offsetX);
|
||||
this->setY(screen->geometry().y());// + offsetY);#endif
|
||||
#endif
|
||||
Qt::WindowFlags flags = this->flags();
|
||||
this->setFlags(flags | Qt::FramelessWindowHint | Qt::WindowStaysOnBottomHint);
|
||||
|
||||
@ -136,7 +152,14 @@ MainWindow::MainWindow(int i, QString projectPath, QString id, QString decoder,
|
||||
}
|
||||
});
|
||||
|
||||
setVisible(true);
|
||||
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
MacIntegration* integration = new MacIntegration(this);
|
||||
integration->SetBackgroundLevel(this);
|
||||
#endif
|
||||
|
||||
}
|
||||
void MainWindow::init()
|
||||
{
|
||||
|
15
ScreenPlayWindow/src/macbridge.h
Normal file
15
ScreenPlayWindow/src/macbridge.h
Normal file
@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
class MacBridge : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
private:
|
||||
static MacBridge* bridge;
|
||||
MacBridge();
|
||||
public:
|
||||
static MacBridge* instance();
|
||||
static void SetBackgroundLevel(QWindow* window);
|
||||
};
|
13
ScreenPlayWindow/src/macintegration.cpp
Normal file
13
ScreenPlayWindow/src/macintegration.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "macintegration.h"
|
||||
#include "macbridge.h"
|
||||
|
||||
MacIntegration::MacIntegration(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
MacBridge::instance();
|
||||
}
|
||||
|
||||
void MacIntegration::SetBackgroundLevel(QWindow* window)
|
||||
{
|
||||
MacBridge::SetBackgroundLevel(window);
|
||||
}
|
15
ScreenPlayWindow/src/macintegration.h
Normal file
15
ScreenPlayWindow/src/macintegration.h
Normal file
@ -0,0 +1,15 @@
|
||||
#ifndef MACINTEGRATION_H
|
||||
#define MACINTEGRATION_H
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
|
||||
class MacIntegration : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MacIntegration(QObject *parent);
|
||||
void SetBackgroundLevel(QWindow* window);
|
||||
};
|
||||
|
||||
#endif // MACINTEGRATION_H
|
Loading…
Reference in New Issue
Block a user