mirror of
https://gitlab.com/kelteseth/ScreenPlay.git
synced 2024-11-22 02:32:29 +01:00
Add workshop project
This commit is contained in:
parent
8e10948094
commit
368bf83660
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1,2 +1,3 @@
|
||||
*.dll filter=lfs diff=lfs merge=lfs -text
|
||||
*.exe filter=lfs diff=lfs merge=lfs -text
|
||||
*.dylib filter=lfs diff=lfs merge=lfs -text
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -70,3 +70,4 @@ Thumbs.db
|
||||
|
||||
!ScreenPlay/ThirdParty/**
|
||||
!ScreenPlay/translations/**
|
||||
/build-*/**
|
@ -119,9 +119,6 @@
|
||||
<file>settings.json</file>
|
||||
<file>translations/ScreenPlay_de.qm</file>
|
||||
<file>translations/ScreenPlay_en.qm</file>
|
||||
<file>qml/Create/Wizards/CreateWallpaper/Page_0.qml</file>
|
||||
<file>qml/Create/Wizards/CreateWallpaper/Page_1.qml</file>
|
||||
<file>qml/Create/Wizards/CreateWallpaper/Page_2.qml</file>
|
||||
<file>qml/Create/Wizards/CreateWallpaper/NextButton.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
Binary file not shown.
Binary file not shown.
29
ScreenPlayWorkshop/example/WorkshopExample.pro
Normal file
29
ScreenPlayWorkshop/example/WorkshopExample.pro
Normal file
@ -0,0 +1,29 @@
|
||||
QT += quick
|
||||
CONFIG += c++11
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any feature of Qt which as been marked deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
DEFINES += QT_DEPRECATED_WARNINGS
|
||||
|
||||
# You can also make your code fail to compile if you use deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
SOURCES += \
|
||||
main.cpp
|
||||
|
||||
RESOURCES += qml.qrc
|
||||
|
||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||
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
|
32
ScreenPlayWorkshop/example/main.cpp
Normal file
32
ScreenPlayWorkshop/example/main.cpp
Normal file
@ -0,0 +1,32 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
|
||||
QGuiApplication app(argc, argv);
|
||||
|
||||
QQmlApplicationEngine engine;
|
||||
|
||||
const QUrl mainQml(QStringLiteral("qrc:/main.qml"));
|
||||
|
||||
// Catch the objectCreated signal, so that we can determine if the root component was loaded
|
||||
// successfully. If not, then the object created from it will be null. The root component may
|
||||
// get loaded asynchronously.
|
||||
const QMetaObject::Connection connection = QObject::connect(
|
||||
&engine, &QQmlApplicationEngine::objectCreated,
|
||||
&app, [&](QObject *object, const QUrl &url) {
|
||||
if (url != mainQml)
|
||||
return;
|
||||
|
||||
if (!object)
|
||||
app.exit(-1);
|
||||
else
|
||||
QObject::disconnect(connection);
|
||||
}, Qt::QueuedConnection);
|
||||
|
||||
engine.load(mainQml);
|
||||
|
||||
return app.exec();
|
||||
}
|
18
ScreenPlayWorkshop/example/main.qml
Normal file
18
ScreenPlayWorkshop/example/main.qml
Normal file
@ -0,0 +1,18 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Window 2.2
|
||||
import net.aimber.workshop 1.0
|
||||
|
||||
Window {
|
||||
visible: true
|
||||
width: 640
|
||||
height: 360
|
||||
title: qsTr("Workshop Example Widget")
|
||||
|
||||
Component.onCompleted: {
|
||||
|
||||
}
|
||||
|
||||
Workshop {
|
||||
id: test
|
||||
}
|
||||
}
|
5
ScreenPlayWorkshop/example/qml.qrc
Normal file
5
ScreenPlayWorkshop/example/qml.qrc
Normal file
@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>main.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
@ -1,50 +1,6 @@
|
||||
TEMPLATE = lib
|
||||
TARGET = ScreenPlayWorkshop
|
||||
QT += qml quick
|
||||
CONFIG += plugin c++11
|
||||
|
||||
TARGET = $$qtLibraryTarget($$TARGET)
|
||||
uri = net.aimber.workshop
|
||||
|
||||
# Input
|
||||
SOURCES += \
|
||||
screenplayworkshop_plugin.cpp \
|
||||
workshop.cpp
|
||||
|
||||
HEADERS += \
|
||||
screenplayworkshop_plugin.h \
|
||||
workshop.h
|
||||
|
||||
DISTFILES = qmldir
|
||||
|
||||
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
|
||||
copy_qmldir.target = $$OUT_PWD/qmldir
|
||||
copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
|
||||
copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
|
||||
QMAKE_EXTRA_TARGETS += copy_qmldir
|
||||
PRE_TARGETDEPS += $$copy_qmldir.target
|
||||
}
|
||||
|
||||
qmldir.files = qmldir
|
||||
|
||||
installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
|
||||
qmldir.path = $$installPath
|
||||
target.path = $$installPath
|
||||
INSTALLS += target qmldir
|
||||
|
||||
|
||||
win32 {
|
||||
win32: LIBS += -L$$PWD/ThirdParty/Steam/redistributable_bin/win64/ -lsteam_api64
|
||||
DEPENDPATH += $$PWD/ThirdParty/Steam/redistributable_bin/win64
|
||||
}
|
||||
|
||||
unix {
|
||||
LIBS += -L$$PWD/ThirdParty/steam/redistributable_bin/linux64/ -lsteam_api
|
||||
DEPENDPATH += $$PWD/ThirdParty/steam/redistributable_bin/linux64
|
||||
|
||||
INCLUDEPATH += $$PWD/ThirdParty/steam/lib/linux64
|
||||
DEPENDPATH += $$PWD/ThirdParty/steam/lib/linux64s
|
||||
|
||||
LIBS += -L$$PWD/ThirdParty/steam/lib/linux64/ -lsdkencryptedappticket
|
||||
}
|
||||
TEMPLATE = subdirs
|
||||
SUBDIRS = \
|
||||
workshopsdk/ScreenPlayWorkshop.pro \
|
||||
example/WorkshopExample.pro
|
||||
|
||||
WorkshopExample.depends = ScreenPlayWorkshop
|
||||
|
@ -1,15 +0,0 @@
|
||||
#include "workshop.h"
|
||||
|
||||
Workshop::Workshop(QQuickItem *parent):
|
||||
QQuickItem(parent)
|
||||
{
|
||||
// By default, QQuickItem does not draw anything. If you subclass
|
||||
// QQuickItem to create a visual item, you will need to uncomment the
|
||||
// following line and re-implement updatePaintNode()
|
||||
|
||||
// setFlag(ItemHasContents, true);
|
||||
}
|
||||
|
||||
Workshop::~Workshop()
|
||||
{
|
||||
}
|
57
ScreenPlayWorkshop/workshopsdk/ScreenPlayWorkshop.pro
Normal file
57
ScreenPlayWorkshop/workshopsdk/ScreenPlayWorkshop.pro
Normal file
@ -0,0 +1,57 @@
|
||||
TEMPLATE = lib
|
||||
TARGET = ScreenPlayWorkshop
|
||||
QT += qml quick websockets
|
||||
CONFIG += plugin c++11
|
||||
|
||||
TARGET = $$qtLibraryTarget($$TARGET)
|
||||
uri = net.aimber.workshop
|
||||
|
||||
# Input
|
||||
SOURCES += \
|
||||
screenplayworkshop_plugin.cpp \
|
||||
workshop.cpp \
|
||||
aimberapi.cpp
|
||||
|
||||
HEADERS += \
|
||||
screenplayworkshop_plugin.h \
|
||||
workshop.h \
|
||||
aimberapi.h
|
||||
|
||||
DISTFILES = qmldir
|
||||
|
||||
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
|
||||
copy_qmldir.target = $$OUT_PWD/qmldir
|
||||
copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
|
||||
copy_qmldir.commands = $(COPY_FILE) \"$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)\" \"$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)\"
|
||||
QMAKE_EXTRA_TARGETS += copy_qmldir
|
||||
PRE_TARGETDEPS += $$copy_qmldir.target
|
||||
}
|
||||
|
||||
qmldir.files = qmldir
|
||||
|
||||
installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)
|
||||
qmldir.path = $$installPath
|
||||
target.path = $$installPath
|
||||
INSTALLS += target qmldir
|
||||
|
||||
|
||||
win32 {
|
||||
win32: LIBS += -L$$PWD/ThirdParty/Steam/redistributable_bin/win64/ -lsteam_api64
|
||||
DEPENDPATH += $$PWD/ThirdParty/Steam/redistributable_bin/win64
|
||||
}
|
||||
|
||||
unix {
|
||||
LIBS += -L$$PWD/ThirdParty/steam/redistributable_bin/linux64/ -lsteam_api
|
||||
DEPENDPATH += $$PWD/ThirdParty/steam/redistributable_bin/linux64
|
||||
|
||||
INCLUDEPATH += $$PWD/ThirdParty/steam/lib/linux64
|
||||
DEPENDPATH += $$PWD/ThirdParty/steam/lib/linux64s
|
||||
|
||||
LIBS += -L$$PWD/ThirdParty/steam/lib/linux64/ -lsdkencryptedappticket
|
||||
}
|
||||
|
||||
win32 {
|
||||
INCLUDEPATH += "..\..\Common\ProtocolBuffer\google\protobuf\"
|
||||
LIBS += -L"..\..\Common\ProtocolBuffer\google\protobuf\bin" -llibprotobuf.dll
|
||||
}
|
||||
|
3
ScreenPlayWorkshop/workshopsdk/ThirdParty/steam/lib/osx32/libsdkencryptedappticket.dylib
vendored
Normal file
3
ScreenPlayWorkshop/workshopsdk/ThirdParty/steam/lib/osx32/libsdkencryptedappticket.dylib
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b971b18690c37eb5c620f1e7d0772d13fcb7ebc583be0520923da6763b95c7e9
|
||||
size 2127952
|
3
ScreenPlayWorkshop/workshopsdk/ThirdParty/steam/redistributable_bin/osx32/libsteam_api.dylib
vendored
Normal file
3
ScreenPlayWorkshop/workshopsdk/ThirdParty/steam/redistributable_bin/osx32/libsteam_api.dylib
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:41dc3afbe16368e0e54624d561ed45ab85186e7e8641176d81dfdf4b414068f9
|
||||
size 609216
|
39
ScreenPlayWorkshop/workshopsdk/aimberapi.cpp
Normal file
39
ScreenPlayWorkshop/workshopsdk/aimberapi.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#include "aimberapi.h"
|
||||
|
||||
AimberAPI::AimberAPI(QObject* parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void AimberAPI::openConnection()
|
||||
{
|
||||
connect(&m_webSocket, &QWebSocket::connected, this, &AimberAPI::onConnected);
|
||||
connect(&m_webSocket, &QWebSocket::disconnected, this, &AimberAPI::closed);
|
||||
connect(&m_webSocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error),
|
||||
[=](QAbstractSocket::SocketError error){ qDebug() << "ConnectionError"; });
|
||||
|
||||
QString url;
|
||||
url = "ws://localhost:16395";
|
||||
m_webSocket.open(QUrl(url));
|
||||
|
||||
qDebug() << "OpenConnection";
|
||||
}
|
||||
|
||||
void AimberAPI::onConnected()
|
||||
{
|
||||
qDebug() << "Conneceted";
|
||||
|
||||
connect(&m_webSocket, &QWebSocket::textMessageReceived,
|
||||
this, &AimberAPI::onTextMessageReceived);
|
||||
m_webSocket.sendTextMessage(QStringLiteral("Hello, world!"));
|
||||
}
|
||||
|
||||
void AimberAPI::closed()
|
||||
{
|
||||
qDebug() << "Closed";
|
||||
}
|
||||
|
||||
void AimberAPI::onTextMessageReceived()
|
||||
{
|
||||
m_webSocket.close();
|
||||
}
|
22
ScreenPlayWorkshop/workshopsdk/aimberapi.h
Normal file
22
ScreenPlayWorkshop/workshopsdk/aimberapi.h
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include <QDebug>
|
||||
#include <QObject>
|
||||
#include <QtWebSockets/QWebSocket>
|
||||
|
||||
class AimberAPI : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AimberAPI(QObject* parent = nullptr);
|
||||
void openConnection();
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
void onConnected();
|
||||
void closed();
|
||||
|
||||
void onTextMessageReceived();
|
||||
private:
|
||||
QWebSocket m_webSocket;
|
||||
};
|
10
ScreenPlayWorkshop/workshopsdk/workshop.cpp
Normal file
10
ScreenPlayWorkshop/workshopsdk/workshop.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
#include "workshop.h"
|
||||
|
||||
Workshop::Workshop(QQuickItem* parent) : QQuickItem(parent)
|
||||
{
|
||||
m_aimberAPI.openConnection();
|
||||
}
|
||||
|
||||
Workshop::~Workshop()
|
||||
{
|
||||
}
|
@ -2,7 +2,8 @@
|
||||
#define WORKSHOP_H
|
||||
|
||||
#include <QQuickItem>
|
||||
|
||||
#include <QtDebug>
|
||||
#include "aimberapi.h"
|
||||
class Workshop : public QQuickItem
|
||||
{
|
||||
Q_OBJECT
|
||||
@ -11,6 +12,14 @@ class Workshop : public QQuickItem
|
||||
public:
|
||||
Workshop(QQuickItem *parent = nullptr);
|
||||
~Workshop();
|
||||
|
||||
public slots:
|
||||
void hello(){
|
||||
qDebug() << "bla";
|
||||
}
|
||||
signals:
|
||||
private:
|
||||
AimberAPI m_aimberAPI;
|
||||
};
|
||||
|
||||
#endif // WORKSHOP_H
|
Loading…
Reference in New Issue
Block a user