This commit is contained in:
Chris Cochrun 2025-07-25 15:19:21 -05:00
parent 92f2b18a20
commit 504b4bc944
24 changed files with 289 additions and 175 deletions

View file

@ -30,7 +30,10 @@ include(ECMPoQmTools)
kde_enable_exceptions()
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Core5Compat Quick Test Gui Qml QuickControls2 Widgets Sql QmlImportScanner WebEngineQuick)
set(CXXQT_QTCOMPONENTS Core Gui Qml QuickControls2 QuickTest Test)
set(CXXQT_QTCOMPONENTS ${CXXQT_QTCOMPONENTS} QmlImportScanner)
find_package(Qt6 ${QT_MIN_VERSION} REQUIRED NO_MODULE COMPONENTS Core Core5Compat Quick Test Gui Qml QuickControls2 Widgets Sql QmlImportScanner WebEngineQuick Multimedia)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS Kirigami CoreAddons I18n)
# find_package(KF6FileMetaData ${KF6_MIN_VERSION})
@ -57,45 +60,70 @@ set_package_properties(Ytdlp PROPERTIES TYPE RUNTIME)
# execute_process(COMMAND ${XDG-DESKTOP-MENU_EXECUTABLE} install --novender librepresenter.desktop)
get_target_property(QMAKE Qt::qmake IMPORTED_LOCATION)
find_package(Corrosion QUIET)
if(NOT Corrosion_FOUND)
find_package(CxxQt QUIET)
if(NOT CxxQt_FOUND)
include(FetchContent)
FetchContent_Declare(
Corrosion
GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
GIT_TAG v0.3.0
CxxQt
GIT_REPOSITORY https://github.com/kdab/cxx-qt-cmake.git
GIT_TAG v0.7.0
)
FetchContent_MakeAvailable(Corrosion)
FetchContent_MakeAvailable(CxxQt)
endif()
add_subdirectory(src)
# find_package(Corrosion QUIET)
# if(NOT Corrosion_FOUND)
# include(FetchContent)
# FetchContent_Declare(
# Corrosion
# GIT_REPOSITORY https://github.com/corrosion-rs/corrosion.git
# GIT_TAG v0.3.0
# )
# FetchContent_MakeAvailable(Corrosion)
# endif()
set(CRATE liblumina)
# CXX-Qt (using Corrosion) creates a CMake target with the same name as the crate.
cxx_qt_import_crate(
MANIFEST_PATH Cargo.toml
CRATES liblumina
QT_MODULES Qt::Core Qt::Gui Qt::Qml Qt::QuickControls2 Qt::WebEngineQuick)
cxx_qt_import_qml_module(liblumina_qml_module
URI "org.presenter"
SOURCE_CRATE liblumina)
# Corrosion creates a CMake target with the same name as the crate.
corrosion_import_crate(MANIFEST_PATH Cargo.toml CRATES ${CRATE})
# corrosion_import_crate(MANIFEST_PATH Cargo.toml CRATES ${CRATE})
# The Rust library's build script needs to be told where to output the
# generated headers so CMake can find them. To do this, tell Corrosion
# to set the CXXQT_EXPORT_DIR environment variable when calling `cargo build`.
# Also, set the QMAKE environment variable to ensure the Rust library uses
# the same installation of Qt as CMake.
set(CXXQT_EXPORT_DIR "${CMAKE_CURRENT_BINARY_DIR}/cxxqt")
corrosion_set_env_vars(${CRATE}
"CXXQT_EXPORT_DIR=${CXXQT_EXPORT_DIR}"
"QMAKE=${QMAKE}"
)
# set(CXXQT_EXPORT_DIR "${CMAKE_CURRENT_BINARY_DIR}/cxxqt")
# corrosion_set_env_vars(${CRATE}
# "CXXQT_EXPORT_DIR=${CXXQT_EXPORT_DIR}"
# "QMAKE=${QMAKE}"
# )
add_library(${APP_NAME}_lib INTERFACE)
add_subdirectory(src)
# Include the headers generated by the Rust library's build script. Each
# crate gets its own subdirectory under CXXQT_EXPORT_DIR. This allows you
# to include headers generated by multiple crates without risk of one crate
# overwriting another's files.
target_include_directories(${APP_NAME}_lib INTERFACE "${CXXQT_EXPORT_DIR}/${CRATE}")
target_include_directories(liblumina INTERFACE "${CXXQT_EXPORT_DIR}/${CRATE}")
# Link the Rust INTERFACE library target to Qt. Do this on the library target
# rather than the main executable. This way, CMake targets besides the main
# executable which link the Rust library, for example tests, will also link Qt.
target_link_libraries(${APP_NAME}_lib INTERFACE
target_link_libraries(liblumina INTERFACE
"$<LINK_LIBRARY:WHOLE_ARCHIVE,${CRATE}-static>"
Qt6::Quick
Qt6::Qml
@ -104,6 +132,7 @@ target_link_libraries(${APP_NAME}_lib INTERFACE
Qt6::Widgets
Qt6::Sql
Qt6::WebEngineQuick
Qt6::Multimedia
KF6::Kirigami
KF6::I18n
KF6::CoreAddons
@ -114,8 +143,9 @@ target_link_libraries(${APP_NAME}_lib INTERFACE
crypto
)
# Link to the Rust library
target_link_libraries(${APP_NAME} PRIVATE ${APP_NAME}_lib)
target_link_libraries(${APP_NAME} PRIVATE liblumina)
# If we are using a statically linked Qt then we need to import any qml plugins
qt_import_qml_plugins(${APP_NAME})

97
Cargo.lock generated
View file

@ -1,6 +1,6 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
version = 4
[[package]]
name = "addr2line"
@ -338,6 +338,19 @@ dependencies = [
"serde",
]
[[package]]
name = "blah"
version = "0.1.0"
dependencies = [
"cxx",
"cxx-qt",
"cxx-qt-build",
"cxx-qt-lib",
"cxx-qt-lib-extras",
"markdown",
"qt-build-utils",
]
[[package]]
name = "block"
version = "0.1.6"
@ -372,24 +385,12 @@ version = "3.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "bytemuck"
version = "1.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6b1fc10dbac614ebc03540c9dbd60e83887fda27794998c6528f1782047d540"
[[package]]
name = "byteorder"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "byteorder-lite"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495"
[[package]]
name = "bytes"
version = "1.7.1"
@ -421,10 +422,8 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401"
dependencies = [
"android-tzdata",
"iana-time-zone",
"js-sys",
"num-traits",
"serde",
"wasm-bindgen",
"windows-targets 0.52.6",
]
@ -474,12 +473,6 @@ dependencies = [
"tracing-error",
]
[[package]]
name = "color_quant"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
[[package]]
name = "concurrent-queue"
version = "2.5.0"
@ -651,19 +644,22 @@ version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f116c5d982bbf3be707acf97f566802c30454d52ca319c745ed39a04834e8bc6"
dependencies = [
"bytes",
"chrono",
"cxx",
"cxx-qt",
"cxx-qt-build",
"http 1.1.0",
"image 0.24.9",
"image 0.25.5",
"qt-build-utils",
"rgb",
"serde",
"time",
"url",
]
[[package]]
name = "cxx-qt-lib-extras"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe1aaed6391a224d746e314104f33b4031138291ebd368170a2109b6008ace2"
dependencies = [
"cxx",
"cxx-qt",
"cxx-qt-build",
"cxx-qt-lib",
]
[[package]]
@ -1355,29 +1351,6 @@ dependencies = [
"unicode-normalization",
]
[[package]]
name = "image"
version = "0.24.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d"
dependencies = [
"bytemuck",
"byteorder",
"color_quant",
"num-traits",
]
[[package]]
name = "image"
version = "0.25.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd6f44aed642f18953a158afeb30206f4d50da59fbc66ecb53c66488de73563b"
dependencies = [
"bytemuck",
"byteorder-lite",
"num-traits",
]
[[package]]
name = "indenter"
version = "0.3.3"
@ -1617,6 +1590,15 @@ dependencies = [
"libc",
]
[[package]]
name = "markdown"
version = "1.0.0-alpha.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21e27d6220ce21f80ce5c4201f23a37c6f1ad037c72c9d1ff215c2919605a5d6"
dependencies = [
"unicode-id",
]
[[package]]
name = "matchers"
version = "0.1.0"
@ -2315,9 +2297,6 @@ name = "rgb"
version = "0.8.50"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a"
dependencies = [
"bytemuck",
]
[[package]]
name = "rsa"
@ -3244,6 +3223,12 @@ version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
[[package]]
name = "unicode-id"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10103c57044730945224467c09f71a4db0071c123a0648cc3e818913bde6b561"
[[package]]
name = "unicode-ident"
version = "1.0.12"

View file

@ -1,5 +1,5 @@
[workspace]
members = ["src/rust/core"]
members = [ "smdview/blah","src/rust/core"]
[package]
name = "liblumina"
@ -28,7 +28,7 @@ serde_derive = "1.0.152"
quote = "1.0.27"
cxx = "1.0.83"
cxx-qt = "0.7.1"
cxx-qt-lib = { version = "0.7.1", features = [ "full" ] }
cxx-qt-lib = { version = "0.7.1", features = [ "qt_full" ] }
# home = "0.5.4"
dirs = "5.0.0"
# libsqlite3-sys = { version = ">=0.17.2", features = ["bundled"] }

View file

@ -4,7 +4,8 @@
:CATEGORY: dev
:END:
* Tasks [63%] [55/86]
* Tasks [63%] [55/87]
** TODO [#A] REWRITE FOR ALL RUST AND BUILD WITH CARGO
** TODO [#A] Plugin architecture with steel or some scheme as an extension language
** TODO [#A] Server client architecture
** TODO [#A] Organize and layout structure of rust code :maintenance:

92
flake.lock generated
View file

@ -6,11 +6,33 @@
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1741675036,
"narHash": "sha256-sb0mRPmUK//i6F6hhjJg2fShlha452ipS94fQDxqWgw=",
"lastModified": 1753252982,
"narHash": "sha256-brrpvP+4GRXLHjvnDr1j1/yA4117hzs6t9IT60JuSI8=",
"owner": "nix-community",
"repo": "fenix",
"rev": "f2c879a1319e0eb6b842a68791f3ae625bfc8724",
"rev": "8546562a84feb5370ce57493277b6f2c3cbdc432",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"fenix_2": {
"inputs": {
"nixpkgs": [
"naersk",
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src_2"
},
"locked": {
"lastModified": 1752475459,
"narHash": "sha256-z6QEu4ZFuHiqdOPbYss4/Q8B0BFhacR8ts6jO/F/aOU=",
"owner": "nix-community",
"repo": "fenix",
"rev": "bf0d6f70f4c9a9cf8845f992105652173f4b617f",
"type": "github"
},
"original": {
@ -24,11 +46,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1710146030,
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
@ -39,14 +61,15 @@
},
"naersk": {
"inputs": {
"fenix": "fenix_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1721727458,
"narHash": "sha256-r/xppY958gmZ4oTfLiHN0ZGuQ+RSTijDblVgVLFi1mw=",
"lastModified": 1752689277,
"narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=",
"owner": "nix-community",
"repo": "naersk",
"rev": "3fb418eaf352498f6b6c30592e3beb63df42ef11",
"rev": "0e72363d0938b0208d6c646d10649164c43f4d64",
"type": "github"
},
"original": {
@ -57,11 +80,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1741513245,
"narHash": "sha256-7rTAMNTY1xoBwz0h7ZMtEcd8LELk9R5TzBPoHuhNSCk=",
"lastModified": 1752950548,
"narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e3e32b642a31e6714ec1b712de8c91a3352ce7e1",
"rev": "c87b95e25065c028d31a94f06a62927d18763fdf",
"type": "github"
},
"original": {
@ -73,23 +96,27 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 0,
"narHash": "sha256-+yj+xgsfZaErbfYM3T+QvEE2hU7UuE+Jf0fJCJ8uPS0=",
"path": "/nix/store/6inj491lsap4ia7mmvn2gbh53jb27zq0-source",
"type": "path"
"lastModified": 1752077645,
"narHash": "sha256-HM791ZQtXV93xtCY+ZxG1REzhQenSQO020cu6rHtAPk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "be9e214982e20b8310878ac2baa063a961c1bdf6",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1725634671,
"narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=",
"lastModified": 1752950548,
"narHash": "sha256-NS6BLD0lxOrnCiEOcvQCDVPXafX1/ek1dfJHX1nUIzc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c",
"rev": "c87b95e25065c028d31a94f06a62927d18763fdf",
"type": "github"
},
"original": {
@ -110,11 +137,28 @@
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1741630355,
"narHash": "sha256-8icmsH+PAqJbhYjor1rWLZGWII3z4MqXfLGS3rIxQnk=",
"lastModified": 1753204114,
"narHash": "sha256-xH8EIod+Hwog4P9OwX9hdtk6Nqr54M0tzMI71yGNOYI=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "44f18c3d05dab7505ac0689e690f3c47f3be1418",
"rev": "b40fce3ccdc5f94453c6aca4da8b64174a03a5ad",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"rust-analyzer-src_2": {
"flake": false,
"locked": {
"lastModified": 1752428706,
"narHash": "sha256-EJcdxw3aXfP8Ex1Nm3s0awyH9egQvB2Gu+QEnJn2Sfg=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "591e3b7624be97e4443ea7b5542c191311aa141d",
"type": "github"
},
"original": {

View file

@ -70,7 +70,7 @@
kdePackages.qqc2-desktop-style
# libsForQt5.kirigami-addons
# libsForQt5.ki18n
# libsForQt5.kcoreaddons
kdePackages.kcoreaddons
# libsForQt5.kguiaddons
# libsForQt5.kconfig

View file

@ -1,31 +1,31 @@
#include <QApplication>
#include <QQmlApplicationEngine>
// #include <QApplication>
#include <QtQml/QQmlApplicationEngine>
#include <QtCore/qstringliteral.h>
#include <QtQml>
#include <QUrl>
#include <QDebug>
#include <KLocalizedContext>
#include <KLocalizedString>
#include <KAboutData>
#include <QtQml/QtQml>
#include <QtCore/QUrl>
#include <QtCore/QDebug>
// #include <K/KLocalizedContext>
// #include <KLocalizedString>
// #include <KAboutData>
#include <iostream>
#include <QQmlEngine>
#include <QtWebEngineQuick>
#include <QObject>
#include <QtGlobal>
#include <QOpenGLContext>
#include <QGuiApplication>
#include <QQuickStyle>
#include <QSurfaceFormat>
#include <QtQml/QQmlEngine>
#include <QtWebEngineQuick/QtWebEngineQuick>
#include <QtCore/QObject>
#include <QtCore/QtGlobal>
#include <QtGui/QOpenGLContext>
#include <QtGui/QGuiApplication>
#include <QtQuickControls2/QQuickStyle>
// #include <QSurfaceFormat>
#include <QtQuick/QQuickWindow>
#include <QtQuick/QQuickView>
#include <qapplication.h>
#include <qcoreapplication.h>
#include <qdir.h>
#include <qglobal.h>
#include <qguiapplication.h>
#include <qqml.h>
#include <qquickstyle.h>
#include <qstringliteral.h>
// #include <qapplication.h>
#include <QtCore/qcoreapplication.h>
#include <QtCore/qdir.h>
#include <QtCore/qglobal.h>
#include <QtGui/qguiapplication.h>
#include <QtQml/qqml.h>
#include <QtQuickControls2/qquickstyle.h>
#include <QtCore/qstringliteral.h>
// #include <MpvAbstractItem>
// #include "cpp/mpv/mpvitem.h"
// #include "cpp/mpv/mpvproperties.h"
@ -60,22 +60,22 @@ int main(int argc, char *argv[])
QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("video-display")));
QtWebEngineQuick::initialize();
QGuiApplication app(argc, argv);
KLocalizedString::setApplicationDomain("lumina");
KAboutData about;
about.setComponentName(QStringLiteral("lumina"));
about.setDisplayName(i18n("lumina"));
about.setVersion(QByteArray("0.1"));
about.setShortDescription(i18n("A churchpresentation app build with KDE tech."));
about.setLicense(KAboutLicense::GPL_V3);
// KLocalizedString::setApplicationDomain("lumina");
// KAboutData about;
// about.setComponentName(QStringLiteral("lumina"));
// about.setDisplayName(i18n("lumina"));
// about.setVersion(QByteArray("0.1"));
// about.setShortDescription(i18n("A churchpresentation app build with KDE tech."));
// about.setLicense(KAboutLicense::GPL_V3);
// overwrite default-generated values of organizationDomain & desktopFileName
about.setOrganizationDomain("tfcconnection.org");
about.setDesktopFileName(QStringLiteral("org.tfcconneciton.lumina"));
// about.setOrganizationDomain("tfcconnection.org");
// about.setDesktopFileName(QStringLiteral("org.tfcconneciton.lumina"));
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
// set the application metadata
KAboutData::setApplicationData(about);
// KAboutData::setApplicationData(about);
QCoreApplication::setOrganizationName(QStringLiteral("lumina"));
QCoreApplication::setOrganizationDomain(QStringLiteral("tfcconnection.org"));
QCoreApplication::setApplicationName(QStringLiteral("lumina"));
@ -93,7 +93,7 @@ int main(int argc, char *argv[])
// qDebug() << QQuickStyle::availableStyles();
qDebug() << QIcon::themeName();
qDebug() << QApplication::platformName();
// qDebug() << QApplication::platformName();
//Need to instantiate our slide
QScopedPointer<SlideModel> slideModel(new SlideModel);
@ -108,6 +108,7 @@ int main(int argc, char *argv[])
settings->setup();
QQuickView *PresWindow = new QQuickView;
PresWindow->setSource(QUrl(QStringLiteral("qrc:qml/presenter/PresentationWindow.qml")));
qDebug() << PresWindow;
qDebug() << PresWindow->isVisible();
@ -169,9 +170,9 @@ int main(int argc, char *argv[])
qmlRegisterSingletonInstance("org.presenter", 1, 0, "SlideModel", slideModel.get());
qmlRegisterSingletonInstance("org.presenter", 1, 0, "Utils", utils);
qmlRegisterSingletonInstance("org.presenter", 1, 0, "SlideObject", slideobject.get());
qmlRegisterSingletonInstance("org.presenter", 1, 0, "PresWindow", PresWindow);
qmlRegisterSingletonInstance("org.presenter", 1, 0, "RSettings", settings);
qmlRegisterSingletonInstance("org.presenter", 1, 0, "ObsModel", obsModel.get());
qmlRegisterSingletonInstance("org.presenter", 1, 0, "PresWindow", PresWindow);
// This is the same slideobject, however to enusre that the PresWindow can have it
// we need to set it as a separate context so that it can change it's slides too.
@ -184,7 +185,7 @@ int main(int argc, char *argv[])
QQmlApplicationEngine engine;
qDebug() << app.allWindows();
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
// engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
engine.load(QUrl(QStringLiteral("qrc:qml/main.qml")));
qDebug() << "Engine loaded";

View file

@ -252,6 +252,7 @@ Item {
}
function isDragFile(item) {
console.log(item);
console.log(item.toString());
var extension = item.toString().split('.').pop();
var valid = false;

View file

@ -188,6 +188,10 @@ Controls.Page {
songModel: songModel
}
Presenter.PresentationWindow {
id: presWindow
}
Connections {
target: ServiceItemModel
function onSaveProgressChanged() {
@ -352,19 +356,20 @@ Controls.Page {
function present(present) {
if (present)
{
PresWindow.showFullScreen();
PresWindow.setSource("qrc:qml/presenter/PresentationWindow.qml")
console.log(PresWindow);
/* presWindow.slideObj = SlideObject; */
presWindow.showFullScreen();
/* presWindow.setSource("qrc:qml/presenter/PresentationWindow.qml") */
console.log(presWindow);
/* presWinLoader.active = true; */
}
else {
PresWindow.close();
presWindow.close();
/* presWinLoader.active = false; */
}
}
function closeAll() { PresWindow.close() }
function closeAll() { presWindow.close() }
function changeVidPos(pos) {
presentation.slide.seek(pos);

View file

@ -479,6 +479,11 @@ FocusScope {
previewSlide.stopVideo()
}
function playVideo() {
/* showPassiveNotification("Stopping Video") */
previewSlide.playVideo()
}
function nextSlideAction() {
keyHandler.forceActiveFocus();
SlideModel.next()

View file

@ -6,13 +6,13 @@ import org.kde.kirigami 2.13 as Kirigami
import "./" as Presenter
import org.presenter 1.0
Item {
Window {
id: presentationWindow
property Item slide: presentationSlide
/* property var slideObj */
/* property var SlideObject: SlideObject; */
property var pWin
anchors.fill: parent
/* anchors.fill: parent */
/* title: "presentation-window" */
/* height: maximumHeight */
@ -25,7 +25,7 @@ Item {
/* onClosing: { */
/* presentationSlide.stopVideo(); */
/* SlideObj.pause(); */
/* SlideObject.pause(); */
/* presentationSlide.stopAudio(); */
/* presenting = false; */
/* } */
@ -34,7 +34,7 @@ Item {
target: PresWindow
function onClosing() {
presentationSlide.stopVideo();
SlideObj.pause();
SlideObject.pause();
presentationSlide.stopAudio();
presenting = false;
}
@ -48,25 +48,25 @@ Item {
Presenter.Slide {
id: presentationSlide
anchors.fill: parent
imageSource: SlideObj.html ? "" : SlideObj.imageBackground
webSource: SlideObj.html ? SlideObj.imageBackground : ""
htmlVisible: SlideObj.html
videoSource: presentationWindow.visible ? SlideObj.videoBackground : ""
audioSource: SlideObj.audio
text: SlideObj.text
chosenFont: SlideObj.font
textSize: SlideObj.fontSize
pdfIndex: SlideObj.slideIndex
itemType: SlideObj.ty
vidLoop: SlideObj.looping
vidStartTime: SlideObj.videoStartTime
vidEndTime: SlideObj.videoEndTime
imageSource: SlideObject.html ? "" : SlideObject.imageBackground
webSource: SlideObject.html ? SlideObject.imageBackground : ""
htmlVisible: SlideObject.html
videoSource: presentationWindow.visible ? SlideObject.videoBackground : ""
audioSource: SlideObject.audio
text: SlideObject.text
chosenFont: SlideObject.font
textSize: SlideObject.fontSize
pdfIndex: SlideObject.slideIndex
itemType: SlideObject.ty
vidLoop: SlideObject.looping
vidStartTime: SlideObject.videoStartTime
vidEndTime: SlideObject.videoEndTime
}
Connections {
target: SlideObj
target: SlideObject
function onVideoBackgroundChanged() {
if (SlideObj.videoBackground === "")
if (SlideObject.videoBackground === "")
stopVideo();
else {
loadVideo();
@ -74,12 +74,12 @@ Item {
}
}
function onIsPlayingChanged() {
if(SlideObj.isPlaying)
if(SlideObject.isPlaying)
presentationSlide.playVideo();
pauseVideo();
}
function onLoopingChanged() {
if(SlideObj.looping)
if(SlideObject.looping)
presentationSlide.loopVideo();
}
function onAudioChanged() {

View file

@ -21,6 +21,7 @@ Kirigami.OverlaySheet {
Kirigami.FormLayout {
implicitHeight: Kirigami.Units.gridUnit * 30
implicitWidth: Kirigami.Units.gridUnit * 30
Controls.ComboBox {
id: screenSelectionField
Kirigami.FormData.label: i18nc("@label:textbox", "Presentation Screen:")

View file

@ -10,6 +10,9 @@ mod file_helper {
// include!("cxx-qt-lib/qvariant.h");
// type QVariant = cxx_qt_lib::QVariant;
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[qml_element]
@ -96,7 +99,9 @@ impl file_helper::FileHelper {
QUrl::from(string.as_str())
}
} else {
error!("There was an error, is xdg-desktop-portals correctly setup?");
error!(
"There was an error, is xdg-desktop-portals correctly setup?"
);
QUrl::default()
}
}
@ -145,7 +150,9 @@ impl file_helper::FileHelper {
QUrl::from(string.as_str())
}
} else {
error!("Couldn't load file, is xdg-desktop-portals correctly setup?");
error!(
"Couldn't load file, is xdg-desktop-portals correctly setup?"
);
QUrl::default()
}
}

View file

@ -32,6 +32,8 @@ pub mod image_model {
Title,
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[base = QAbstractListModel]
@ -83,6 +85,8 @@ pub mod image_model {
impl cxx_qt::Threading for ImageModel {}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[inherit]
#[cxx_name = "beginInsertRows"]

View file

@ -1,8 +1,8 @@
use core::fmt;
use cxx_qt::CxxQtType;
use cxx_qt_lib::{QString, QStringList};
use obws::responses::scenes::{CurrentProgramScene, Scenes};
use obws::Client;
use obws::responses::scenes::{CurrentProgramScene, Scenes};
use std::{error::Error, pin::Pin};
use tracing::{debug, error};
@ -127,6 +127,8 @@ mod obs {
type QList_QString = cxx_qt_lib::QList<QString>;
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[qml_element]

View file

@ -34,6 +34,8 @@ pub mod presentation_model {
PageCount,
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[base = QAbstractListModel]
@ -101,6 +103,8 @@ pub mod presentation_model {
impl cxx_qt::Threading for PresentationModel {}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[inherit]
#[cxx_name = "beginInsertRows"]

View file

@ -44,6 +44,8 @@ mod service_item_model {
Id,
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[base = QAbstractListModel]
@ -193,6 +195,8 @@ mod service_item_model {
impl cxx_qt::Threading for ServiceItemModel {}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[inherit]
#[cxx_name = "beginInsertRows"]

View file

@ -7,6 +7,8 @@ mod settings {
type QUrl = cxx_qt_lib::QUrl;
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[qml_element]

View file

@ -19,16 +19,16 @@ pub mod slide_model {
type QVector_i32 = cxx_qt_lib::QVector<i32>;
include!("cxx-qt-lib/qlist.h");
type QList_QString = cxx_qt_lib::QList<QString>;
include!("src/rust/slide_object.cxxqt.h");
include!("liblumina/src/rust/slide_object.cxxqt.h");
type SlideObject = crate::slide_object::qobject::SlideObject;
include!("src/rust/songs/song_model.cxxqt.h");
include!("liblumina/src/rust/songs/song_model.cxxqt.h");
type SongModel =
crate::songs::song_model::song_model::SongModel;
include!("src/rust/video_model.cxxqt.h");
include!("liblumina/src/rust/video_model.cxxqt.h");
type VideoModel = crate::video_model::video_model::VideoModel;
include!("src/rust/image_model.cxxqt.h");
include!("liblumina/src/rust/image_model.cxxqt.h");
type ImageModel = crate::image_model::image_model::ImageModel;
include!("src/rust/presentation_model.cxxqt.h");
include!("liblumina/src/rust/presentation_model.cxxqt.h");
type PresentationModel = crate::presentation_model::presentation_model::PresentationModel;
}
@ -60,6 +60,8 @@ pub mod slide_model {
ObsScene,
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[base = QAbstractListModel]
@ -158,6 +160,8 @@ pub mod slide_model {
impl cxx_qt::Threading for SlideModel {}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[inherit]
#[cxx_name = "beginInsertRows"]

View file

@ -10,6 +10,8 @@ pub mod qobject {
// type SlideModel = crate::slide_model::slide_model::SlideModel;
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[qml_element]

View file

@ -15,11 +15,13 @@ pub mod song_editor {
include!("cxx-qt-lib/qlist.h");
type QList_QString = cxx_qt_lib::QList<QString>;
include!("src/rust/songs/song_model.cxxqt.h");
include!("liblumina/src/rust/songs/song_model.cxxqt.h");
type SongModel =
crate::songs::song_model::song_model::SongModel;
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[qml_element]

View file

@ -40,6 +40,8 @@ pub mod song_model {
FontSize,
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[base = QAbstractListModel]
@ -168,6 +170,8 @@ pub mod song_model {
impl cxx_qt::Threading for SongModel {}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[inherit]
#[cxx_name = "beginInsertRows"]

View file

@ -35,6 +35,8 @@ pub mod video_model {
Looping,
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[base = QAbstractListModel]
@ -104,6 +106,8 @@ pub mod video_model {
impl cxx_qt::Threading for VideoModel {}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[inherit]
#[cxx_name = "beginInsertRows"]

View file

@ -7,6 +7,8 @@ mod ytdl {
type QString = cxx_qt_lib::QString;
}
#[auto_cxx_name]
#[auto_rust_name]
unsafe extern "RustQt" {
#[qobject]
#[qml_element]