diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..2b58022a --- /dev/null +++ b/.clang-format @@ -0,0 +1,7 @@ +IndentWidth: 4 +UseTab: Always +TabWidth: 4 +BasedOnStyle: LLVM +IndentAccessModifiers: false +AccessModifierOffset: -4 +PointerAlignment: Left diff --git a/.editorconfig b/.editorconfig index ecb1e74d..96127524 100644 --- a/.editorconfig +++ b/.editorconfig @@ -23,6 +23,10 @@ indent_size = 4 indent_style = space indent_size = 2 +[*.qml] +indent_style = space +indent_size = 4 + [*.qrc] indent_style = space indent_size = 4 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..202e28ba --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: monthly + labels: + - "Building" + #reviewers: + # - carstene1ns + commit-message: + prefix: "CI" diff --git a/.github/gcc_comment_matcher.json b/.github/gcc_comment_matcher.json new file mode 100644 index 00000000..81995b45 --- /dev/null +++ b/.github/gcc_comment_matcher.json @@ -0,0 +1,17 @@ +{ + "problemMatcher": [ + { + "owner": "gcc-problem-matcher", + "pattern": [ + { + "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + ] + } + ] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/stable-compilation.yml similarity index 51% rename from .github/workflows/ci.yml rename to .github/workflows/stable-compilation.yml index 400f0015..b7333404 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/stable-compilation.yml @@ -18,19 +18,19 @@ jobs: name: "Flatpak" runs-on: ubuntu-latest container: - image: bilelmoussaoui/flatpak-github-actions:kde-5.15-21.08 + image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.10 options: --privileged steps: - - uses: actions/checkout@v2 - - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v4 + - uses: actions/checkout@v4 + - uses: bilelmoussaoui/flatpak-github-actions/flatpak-builder@v6 with: bundle: EasyRPG-Editor.flatpak manifest-path: builds/flatpak/org.easyrpg.editor.yml cache-key: flatpak-builder-${{ github.sha }} docker: - name: ${{ matrix.image }} - runs-on: ubuntu-latest + name: ${{ matrix.image }} (${{ matrix.os.arch }}) + runs-on: ${{ matrix.os.name }} container: image: ${{ matrix.image }} @@ -38,10 +38,14 @@ jobs: fail-fast: false matrix: image: - - ubuntu:20.04 # LTS | CMake 3.16.3 | G++ 9.3.0 | QT 5.12.8 - - ubuntu:22.04 # LTS | CMake 3.22.1 | G++ 11.2.0 | QT 5.15.3 - - debian:12 # stable | CMake 3.25.1 | G++ 12.2.0 | QT 5.15.8 - - ubuntu:24.04 # LTS | CMake 3.28.3 | G++ 13.2.0 | QT 5.15.13 + # version of: # CMake | g++ | Qt | support end # + # ------------------------------------------------------------- + - ubuntu:24.04 # 3.28.3 | 13.2.0 | (too old) | LTS (4/29) # + os: + - arch: x86_64 + name: ubuntu-latest + - arch: arm64 + name: ubuntu-24.04-arm steps: - name: Cancel Previous Runs @@ -53,8 +57,18 @@ jobs: apt-get update apt-get install -yqq --no-install-recommends --no-install-suggests \ ca-certificates build-essential cmake ninja-build git \ - libicu-dev libexpat1-dev libinih-dev qttools5-dev-tools \ - qtbase5-dev-tools qtbase5-dev qtmultimedia5-dev libqt5svg5-dev + curl zip unzip tar tzdata + + - name: Install Qt6 + uses: jurplel/install-qt-action@v4 + with: + version: '6.10.1' + install-deps: 'nosudo' + modules: 'qtmultimedia qtshadertools' + + - name: Install vcpkg + run: | + git clone https://github.com/Microsoft/vcpkg.git ../vcpkg - name: Clone Repository uses: actions/checkout@v2 @@ -65,13 +79,17 @@ jobs: with: ref: ${{ github.event.inputs.git-ref }} + - name: Use gcc problem matcher + run: echo "::add-matcher::.github/gcc_comment_matcher.json" + - name: Compile run: | - cmake -G Ninja . -B build-ga \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr \ - -DEDITOR_BUILD_LIBLCF=ON - cmake --build build-ga + export VCPKG_ROOT=$PWD/../vcpkg + export Qt6_Path=$QT_ROOT_DIR + cmake --preset vcpkg-liblcf-release -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_PREFIX_PATH=$QT_ROOT_DIR -DLIBLCF_WITH_ICU=OFF + cmake --build --preset vcpkg-liblcf-release - name: Install run: | - cmake --install build-ga + cmake --build --preset vcpkg-liblcf-release --target install diff --git a/.gitignore b/.gitignore index 4779056d..a10c1e96 100644 --- a/.gitignore +++ b/.gitignore @@ -30,6 +30,7 @@ Makefile* # flatpak /.flatpak-builder +/local-repo # liblcf lib/liblcf @@ -41,8 +42,9 @@ CMakeCache.txt CMakeFiles/ cmake_install.cmake *automoc.cpp -.cmake/ cmake-build-*/ +build/ +install/ # Ninja *.ninja @@ -53,6 +55,7 @@ cmake-build-*/ # Visual Studio Code .vscode/ +.cache/ # Mac .DS_Store diff --git a/CMakeLists.txt b/CMakeLists.txt index f3e43d30..cea25999 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,24 @@ cmake_policy(SET CMP0091 NEW) # Support MSVC_RUNTIME_LIBRARY project(EasyRPG_Editor VERSION 0.1.0 LANGUAGES CXX) +# Qt6 and KF6 required +set(REQUIRED_QT_VERSION "6.11.0") +set(KF_DEP_VERSION "6.11.0") + # Extra CMake Module files -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules") -include(ConfigureWindows) +find_package(ECM ${KF_DEP_VERSION} REQUIRED) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/builds/cmake/Modules" ${ECM_MODULE_PATH}) +include(EditorConfigureWindows) + +# Dependencies provided by CMake Presets +option(EDITOR_FIND_ROOT_PATH_APPEND "When enabled the items from CMAKE_PREFIX_PATH are added to CMAKE_FIND_ROOT_PATH. Works around problematic CMake Toolchain files" OFF) +list(APPEND CMAKE_PREFIX_PATH "${EDITOR_PREFIX_PATH_APPEND}") +if(EDITOR_FIND_ROOT_PATH_APPEND) + list(APPEND CMAKE_FIND_ROOT_PATH "${CMAKE_PREFIX_PATH}") +endif() # C++17 is required -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -267,8 +279,6 @@ set(EDITOR_SOURCES src/ui/other/import_project_dialog.cpp src/ui/other/import_project_dialog.h src/ui/other/import_project_dialog.ui - src/ui/other/musicplayer.cpp - src/ui/other/musicplayer.h src/ui/other/new_project_dialog.cpp src/ui/other/new_project_dialog.h src/ui/other/new_project_dialog.ui @@ -287,8 +297,6 @@ set(EDITOR_SOURCES src/ui/other/search_dialog.cpp src/ui/other/search_dialog.h src/ui/other/search_dialog.ui - src/ui/other/volumebutton.cpp - src/ui/other/volumebutton.h src/ui/picker/picker_audio_widget.cpp src/ui/picker/picker_audio_widget.h src/ui/picker/picker_audio_widget.ui @@ -317,6 +325,26 @@ set(EDITOR_SOURCES src/ui/viewer/stat_curve_graphics_item.h ) +set(EDITOR_QML_UI + src/ui/MainWindow.qml +) + +set(EDITOR_QML_INTERFACE + src/qmlbinding/empty.h +) + +# Dependencies +find_package(Qt6 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg QuickControls2) +find_package(Qt6LinguistTools CONFIG QUIET) +find_package(ZLIB REQUIRED) +find_package(glaze REQUIRED) +find_package(KF6 ${KF_DEP_VERSION} REQUIRED COMPONENTS Kirigami) + +qt_standard_project_setup( + REQUIRES "6.10.1" +) + +# Executable if(APPLE) # Do not code sign set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO") @@ -329,13 +357,13 @@ if(APPLE) set(EXE_NAME "EasyRPG-Editor.app") set(EXE_OUTPUT_NAME "EasyRPG Editor") - add_executable(${EXE_NAME} MACOSX_BUNDLE "src/main.cpp" ${EDITOR_SOURCES} ${EDITOR_BUNDLE_ICON}) + qt_add_executable(${EXE_NAME} MACOSX_BUNDLE "src/main.cpp" ${EDITOR_SOURCES} ${EDITOR_BUNDLE_ICON} MANUAL_FINALIZATION) set_target_properties(${EXE_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/resources/app/Info.plist.in") set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME ${EXE_OUTPUT_NAME}) else() # Executable set(EXE_NAME ${PROJECT_NAME}) - add_executable(${EXE_NAME} WIN32 "src/main.cpp" ${EDITOR_SOURCES}) + qt_add_executable(${EXE_NAME} WIN32 "src/main.cpp" ${EDITOR_SOURCES} MANUAL_FINALIZATION) if(WIN32) # Open console for Debug builds if(CMAKE_BUILD_TYPE MATCHES "Debug") @@ -344,15 +372,23 @@ else() set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "Editor") # Add icon target_sources(${EXE_NAME} PRIVATE "resources/Resources.rc") + # Set Visual Studio startup project + set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${EXE_NAME}) else() set_target_properties(${EXE_NAME} PROPERTIES OUTPUT_NAME "easyrpg-editor") endif() + + # QML Debugger support + if(CMAKE_BUILD_TYPE MATCHES "Debug") + target_compile_definitions(${EXE_NAME} PRIVATE QT_QML_DEBUG=1) + endif() endif() # Include directories target_include_directories(${EXE_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/src + ${CMAKE_CURRENT_SOURCE_DIR}/src/qmlbinding # Required by QML build step INTERFACE $ ) @@ -377,10 +413,21 @@ set_target_properties(${EXE_NAME} PROPERTIES ) set(CMAKE_INCLUDE_CURRENT_DIR ON) -# Dependencies -find_package(Qt5 CONFIG REQUIRED COMPONENTS Widgets Core Multimedia Gui Svg) -find_package(Qt5LinguistTools CONFIG QUIET) -find_package(ZLIB REQUIRED) +include(ECMQmlModule) +include(ECMFindQmlModule) + +ecm_add_qml_module(${EXE_NAME} + URI "org.easyrpg.editor" + VERSION 1.0 + GENERATE_PLUGIN_SOURCE + SOURCES + ${EDITOR_QML_INTERFACE} +) + +ecm_target_qml_sources(${EXE_NAME} + SOURCES ${EDITOR_QML_UI} +) + # liblcf option(EDITOR_BUILD_LIBLCF "Instead of detecting liblcf the liblcf repository is cloned into lib/liblcf and built together with the Player. This is convenient for development" OFF) set(EDITOR_BUILD_LIBLCF_GIT "https://github.com/EasyRPG/liblcf.git" CACHE STRING "Git repository of liblcf to clone when building liblcf. Requires EDITOR_BUILD_LIBLCF=ON.") @@ -405,29 +452,30 @@ if(EDITOR_BUILD_LIBLCF) add_subdirectory(${LIBLCF_PATH}) endfunction() add_liblcf() - target_link_libraries(${EXE_NAME} lcf) + target_link_libraries(${EXE_NAME} PRIVATE lcf) else() # Use system package find_package(liblcf REQUIRED) - target_link_libraries(${EXE_NAME} liblcf::liblcf) + target_link_libraries(${EXE_NAME} PRIVATE liblcf::liblcf) endif() # Libraries -target_link_libraries(${EXE_NAME} +target_link_libraries(${EXE_NAME} PRIVATE ZLIB::ZLIB - Qt5::Widgets - Qt5::Gui - Qt5::Core - Qt5::Multimedia - Qt5::Svg - Qt5::QSvgIconPlugin + glaze::glaze + Qt6::Widgets + Qt6::Gui + Qt6::Core + Qt6::Multimedia + Qt6::Svg + Qt6::QuickControls2 ) # Add resources target_sources(${EXE_NAME} PRIVATE "resources/Resources.qrc") # Translations -if(TARGET Qt5::lrelease) +if(TARGET Qt6::lrelease) set(TRANSLATION_SOURCES translations/editor_de.ts ) @@ -435,11 +483,11 @@ if(TARGET Qt5::lrelease) configure_file(translations/editor.qrc ${TRANSLATION_RES} COPYONLY) set_source_files_properties(${TRANSLATION_SOURCES} PROPERTIES OUTPUT_LOCATION "translations") - qt5_add_translation(EDITOR_TRANSLATIONS ${TRANSLATION_SOURCES} + qt_add_translation(EDITOR_TRANSLATIONS ${TRANSLATION_SOURCES} OPTIONS -compress -nounfinished -removeidentical) target_sources(${EXE_NAME} PRIVATE ${TRANSLATION_RES} ${EDITOR_TRANSLATIONS}) add_custom_target(translations - COMMAND ${Qt5_LUPDATE_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src -ts ${TRANSLATION_SOURCES} + COMMAND ${Qt6_LUPDATE_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/src -ts ${TRANSLATION_SOURCES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Create/Update translations..." COMMAND_EXPAND_LISTS VERBATIM) @@ -447,30 +495,21 @@ else() message(STATUS "Disabling translation support") endif() +# Kirigami QML import path to make developing easier when using vcpkg +if (DEFINED VCPKG_TARGET_TRIPLET) + target_compile_options(${EXE_NAME} PUBLIC "-DQML_EXTRA_IMPORT_PATHS=\"${VCPKG_DIR}/lib/qml\"") +endif() + +qt_finalize_target(${EXE_NAME}) + # Installation include(GNUInstallDirs) + if(APPLE) - # Find Qt deployment apps - get_target_property(_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION) - get_filename_component(_QT_BIN_DIR "${_QMAKE_EXECUTABLE}" DIRECTORY) - find_program(MACDEPLOYQT_EXECUTABLE macdeployqt HINTS "${_QT_BIN_DIR}") - - set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}) - install(TARGETS ${EXE_NAME} RUNTIME DESTINATION BUNDLE DESTINATION "${CMAKE_BINARY_DIR}/Package") - # Run macdeployqt - install(CODE " - execute_process(COMMAND - ${MACDEPLOYQT_EXECUTABLE} - \"${CMAKE_BINARY_DIR}/Package/${EXE_OUTPUT_NAME}.app\" - -always-overwrite - ) - ") - # Run cmake fixup_bundle to fix runpath for any non-Qt dylibs and to verify - install(CODE " - include(BundleUtilities) - set(BU_CHMOD_BUNDLE_ITEMS TRUE) - fixup_bundle(\"${CMAKE_BINARY_DIR}/Package/${EXE_OUTPUT_NAME}.app\" \"\" \"\") - " COMPONENT RUNTIME) + install(TARGETS ${EXE_NAME} + BUNDLE DESTINATION . + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) else() install(TARGETS ${EXE_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} @@ -492,3 +531,36 @@ else() # DESTINATION ${CMAKE_INSTALL_DATADIR}/appdata) endif() endif() + +# Generate a deployment script to be executed at install time +if(WIN32 OR APPLE) + # The script fails on Linux currently + # On macOS the generated app does not run due to unsigned plugins + qt_generate_deploy_qml_app_script( + TARGET ${EXE_NAME} + OUTPUT_SCRIPT deploy_script + ) + install(SCRIPT ${deploy_script}) +endif() + +if(WIN32) + # Copy DLL dependencies + install( + DIRECTORY ${VCPKG_DIR}/bin/ + DESTINATION ${CMAKE_INSTALL_BINDIR} + FILES_MATCHING + PATTERN "*.dll" + ) + # Copy Kirigami QML + install(DIRECTORY ${VCPKG_DIR}/lib/qml/ DESTINATION qml) + + # Environment for the MSVC Debugger + set_target_properties(${EXE_NAME} + PROPERTIES VS_DEBUGGER_ENVIRONMENT + "PATH=${VCPKG_DIR}/bin;$ENV{Qt6_Path}/bin;%PATH%" + ) + + # Other dev environments + configure_file("builds/cmake/setup_env.cmd.in" "setup_env.cmd") + message(STATUS "When not using Visual Studio for development run setup_env.cmd to configure the environment") +endif() diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 00000000..4c18309c --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,532 @@ +{ + "vendor": { + "README": { + "line1": "!!! GENERATED FILE. DO NOT EDIT !!!", + "line2": "Modify builds/cmake/CMakePresets.json.template instead", + "line3": "and run gen-cmake-presets.py to regenerate this file." + } + }, + "version": 4, + "cmakeMinimumRequired": { + "major": 3, + "minor": 23, + "patch": 0 + }, + "include": [ + "builds/cmake/CMakePresetsUser.json" + ], + "configurePresets": [ + { + "name": "parent", + "hidden": true, + "inherits": "base-user" + }, + { + "name": "debug", + "displayName": "System environment (Debug)", + "inherits": [ + "parent", + "type-debug" + ] + }, + { + "name": "relwithdebinfo", + "displayName": "System environment (RelWithDebInfo)", + "inherits": [ + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "release", + "displayName": "System environment (Release)", + "inherits": [ + "parent", + "type-release" + ] + }, + { + "name": "liblcf-debug", + "displayName": "System environment (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "parent", + "type-debug" + ] + }, + { + "name": "liblcf-relwithdebinfo", + "displayName": "System environment (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "liblcf-release", + "displayName": "System environment (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "parent", + "type-release" + ] + }, + { + "name": "vcpkg-debug", + "displayName": "System environment (install deps with vcpkg, Debug)", + "inherits": [ + "build-vcpkg", + "parent", + "type-debug" + ] + }, + { + "name": "vcpkg-relwithdebinfo", + "displayName": "System environment (install deps with vcpkg, RelWithDebInfo)", + "inherits": [ + "build-vcpkg", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "vcpkg-release", + "displayName": "System environment (install deps with vcpkg, Release)", + "inherits": [ + "build-vcpkg", + "parent", + "type-release" + ] + }, + { + "name": "vcpkg-liblcf-debug", + "displayName": "System environment (install deps with vcpkg + build liblcf, Debug)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-debug" + ] + }, + { + "name": "vcpkg-liblcf-relwithdebinfo", + "displayName": "System environment (install deps with vcpkg + build liblcf, RelWithDebInfo)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "vcpkg-liblcf-release", + "displayName": "System environment (install deps with vcpkg + build liblcf, Release)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-release" + ] + }, + { + "name": "windows-parent", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "hidden": true + }, + { + "name": "windows-debug", + "displayName": "Windows (Debug)", + "inherits": [ + "windows-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-relwithdebinfo", + "displayName": "Windows (RelWithDebInfo)", + "inherits": [ + "windows-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-release", + "displayName": "Windows (Release)", + "inherits": [ + "windows-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "windows-liblcf-debug", + "displayName": "Windows (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-liblcf-relwithdebinfo", + "displayName": "Windows (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-liblcf-release", + "displayName": "Windows (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "windows-x64-vs2022-parent", + "generator": "Visual Studio 17 2022", + "architecture": "x64", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "hidden": true + }, + { + "name": "windows-x64-vs2022-debug", + "displayName": "Windows (x64) using Visual Studio 2022 (Debug)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-x64-vs2022-relwithdebinfo", + "displayName": "Windows (x64) using Visual Studio 2022 (RelWithDebInfo)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-release", + "displayName": "Windows (x64) using Visual Studio 2022 (Release)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "windows-x64-vs2022-liblcf-debug", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-x64-vs2022-liblcf-relwithdebinfo", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-liblcf-release", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "macos-parent", + "cacheVariables": { + "EDITOR_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15", + "CMAKE_OSX_ARCHITECTURES": "arm64" + }, + "environment": { + "Qt6_Path": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "hidden": true, + "inherits": "base-user" + }, + { + "name": "macos-debug", + "displayName": "macOS (Debug)", + "inherits": [ + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-relwithdebinfo", + "displayName": "macOS (RelWithDebInfo)", + "inherits": [ + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-release", + "displayName": "macOS (Release)", + "inherits": [ + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-liblcf-debug", + "displayName": "macOS (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-liblcf-relwithdebinfo", + "displayName": "macOS (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-liblcf-release", + "displayName": "macOS (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-vcpkg-debug", + "displayName": "macOS (install deps with vcpkg, Debug)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-vcpkg-relwithdebinfo", + "displayName": "macOS (install deps with vcpkg, RelWithDebInfo)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-vcpkg-release", + "displayName": "macOS (install deps with vcpkg, Release)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-vcpkg-liblcf-debug", + "displayName": "macOS (install deps with vcpkg + build liblcf, Debug)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-vcpkg-liblcf-relwithdebinfo", + "displayName": "macOS (install deps with vcpkg + build liblcf, RelWithDebInfo)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-vcpkg-liblcf-release", + "displayName": "macOS (install deps with vcpkg + build liblcf, Release)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-release" + ] + } + ], + "buildPresets": [ + { + "name": "debug", + "configurePreset": "debug" + }, + { + "name": "relwithdebinfo", + "configurePreset": "relwithdebinfo" + }, + { + "name": "release", + "configurePreset": "release" + }, + { + "name": "liblcf-debug", + "configurePreset": "liblcf-debug" + }, + { + "name": "liblcf-relwithdebinfo", + "configurePreset": "liblcf-relwithdebinfo" + }, + { + "name": "liblcf-release", + "configurePreset": "liblcf-release" + }, + { + "name": "vcpkg-debug", + "configurePreset": "vcpkg-debug" + }, + { + "name": "vcpkg-relwithdebinfo", + "configurePreset": "vcpkg-relwithdebinfo" + }, + { + "name": "vcpkg-release", + "configurePreset": "vcpkg-release" + }, + { + "name": "vcpkg-liblcf-debug", + "configurePreset": "vcpkg-liblcf-debug" + }, + { + "name": "vcpkg-liblcf-relwithdebinfo", + "configurePreset": "vcpkg-liblcf-relwithdebinfo" + }, + { + "name": "vcpkg-liblcf-release", + "configurePreset": "vcpkg-liblcf-release" + }, + { + "name": "windows-debug", + "configurePreset": "windows-debug" + }, + { + "name": "windows-relwithdebinfo", + "configurePreset": "windows-relwithdebinfo" + }, + { + "name": "windows-release", + "configurePreset": "windows-release" + }, + { + "name": "windows-liblcf-debug", + "configurePreset": "windows-liblcf-debug" + }, + { + "name": "windows-liblcf-relwithdebinfo", + "configurePreset": "windows-liblcf-relwithdebinfo" + }, + { + "name": "windows-liblcf-release", + "configurePreset": "windows-liblcf-release" + }, + { + "name": "windows-x64-vs2022-debug", + "configurePreset": "windows-x64-vs2022-debug" + }, + { + "name": "windows-x64-vs2022-relwithdebinfo", + "configurePreset": "windows-x64-vs2022-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-release", + "configurePreset": "windows-x64-vs2022-release" + }, + { + "name": "windows-x64-vs2022-liblcf-debug", + "configurePreset": "windows-x64-vs2022-liblcf-debug" + }, + { + "name": "windows-x64-vs2022-liblcf-relwithdebinfo", + "configurePreset": "windows-x64-vs2022-liblcf-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-liblcf-release", + "configurePreset": "windows-x64-vs2022-liblcf-release" + }, + { + "name": "macos-debug", + "configurePreset": "macos-debug" + }, + { + "name": "macos-relwithdebinfo", + "configurePreset": "macos-relwithdebinfo" + }, + { + "name": "macos-release", + "configurePreset": "macos-release" + }, + { + "name": "macos-liblcf-debug", + "configurePreset": "macos-liblcf-debug" + }, + { + "name": "macos-liblcf-relwithdebinfo", + "configurePreset": "macos-liblcf-relwithdebinfo" + }, + { + "name": "macos-liblcf-release", + "configurePreset": "macos-liblcf-release" + }, + { + "name": "macos-vcpkg-debug", + "configurePreset": "macos-vcpkg-debug" + }, + { + "name": "macos-vcpkg-relwithdebinfo", + "configurePreset": "macos-vcpkg-relwithdebinfo" + }, + { + "name": "macos-vcpkg-release", + "configurePreset": "macos-vcpkg-release" + }, + { + "name": "macos-vcpkg-liblcf-debug", + "configurePreset": "macos-vcpkg-liblcf-debug" + }, + { + "name": "macos-vcpkg-liblcf-relwithdebinfo", + "configurePreset": "macos-vcpkg-liblcf-relwithdebinfo" + }, + { + "name": "macos-vcpkg-liblcf-release", + "configurePreset": "macos-vcpkg-liblcf-release" + } + ], + "testPresets": [] +} diff --git a/README.adoc b/README.adoc index c9ce60d1..e4710793 100644 --- a/README.adoc +++ b/README.adoc @@ -2,7 +2,7 @@ // hide ugly links behind atributes to not interrupt plain text flow :docs: link:docs[docs folder] :liblcf: https://github.com/EasyRPG/liblcf[liblcf] -:qt5: https://www.qt.io[Qt 5] +:qt6: https://www.qt.io[Qt 6] :translation: link:docs/Translation.adoc[Translation] :irc-channel: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat/#easyrpg?nick=rpgguest?? :authors-doc: link:docs/AUTHORS.adoc[AUTHORS document] @@ -25,7 +25,7 @@ https://wiki.easyrpg.org == Requirements - {liblcf} for RPG Maker data reading. -- {qt5} (>= 5.11) +- {qt6} (>= 6.10) - Qt Multimedia - Qt SVG - Qt Linguist (optional, for translation) diff --git a/bin/README b/bin/README deleted file mode 100644 index 02516286..00000000 --- a/bin/README +++ /dev/null @@ -1,15 +0,0 @@ -This application needs the following shared libraries -to work in windows platform: - -icudt51.dll -icuin51.dll -icuuc51.dll -libEGL.dll -libGLESv2.dll -Qt5Core.dll -Qt5Gui.dll -Qt5Multimedia.dll -Qt5Network.dll -Qt5Widgets.dll -Qt5WinExtras.dll -platforms/qwindows.dll \ No newline at end of file diff --git a/builds/CMakePresets.json b/builds/CMakePresets.json new file mode 100644 index 00000000..4c18309c --- /dev/null +++ b/builds/CMakePresets.json @@ -0,0 +1,532 @@ +{ + "vendor": { + "README": { + "line1": "!!! GENERATED FILE. DO NOT EDIT !!!", + "line2": "Modify builds/cmake/CMakePresets.json.template instead", + "line3": "and run gen-cmake-presets.py to regenerate this file." + } + }, + "version": 4, + "cmakeMinimumRequired": { + "major": 3, + "minor": 23, + "patch": 0 + }, + "include": [ + "builds/cmake/CMakePresetsUser.json" + ], + "configurePresets": [ + { + "name": "parent", + "hidden": true, + "inherits": "base-user" + }, + { + "name": "debug", + "displayName": "System environment (Debug)", + "inherits": [ + "parent", + "type-debug" + ] + }, + { + "name": "relwithdebinfo", + "displayName": "System environment (RelWithDebInfo)", + "inherits": [ + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "release", + "displayName": "System environment (Release)", + "inherits": [ + "parent", + "type-release" + ] + }, + { + "name": "liblcf-debug", + "displayName": "System environment (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "parent", + "type-debug" + ] + }, + { + "name": "liblcf-relwithdebinfo", + "displayName": "System environment (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "liblcf-release", + "displayName": "System environment (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "parent", + "type-release" + ] + }, + { + "name": "vcpkg-debug", + "displayName": "System environment (install deps with vcpkg, Debug)", + "inherits": [ + "build-vcpkg", + "parent", + "type-debug" + ] + }, + { + "name": "vcpkg-relwithdebinfo", + "displayName": "System environment (install deps with vcpkg, RelWithDebInfo)", + "inherits": [ + "build-vcpkg", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "vcpkg-release", + "displayName": "System environment (install deps with vcpkg, Release)", + "inherits": [ + "build-vcpkg", + "parent", + "type-release" + ] + }, + { + "name": "vcpkg-liblcf-debug", + "displayName": "System environment (install deps with vcpkg + build liblcf, Debug)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-debug" + ] + }, + { + "name": "vcpkg-liblcf-relwithdebinfo", + "displayName": "System environment (install deps with vcpkg + build liblcf, RelWithDebInfo)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-relwithdebinfo" + ] + }, + { + "name": "vcpkg-liblcf-release", + "displayName": "System environment (install deps with vcpkg + build liblcf, Release)", + "inherits": [ + "build-vcpkg-liblcf", + "parent", + "type-release" + ] + }, + { + "name": "windows-parent", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "hidden": true + }, + { + "name": "windows-debug", + "displayName": "Windows (Debug)", + "inherits": [ + "windows-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-relwithdebinfo", + "displayName": "Windows (RelWithDebInfo)", + "inherits": [ + "windows-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-release", + "displayName": "Windows (Release)", + "inherits": [ + "windows-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "windows-liblcf-debug", + "displayName": "Windows (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-liblcf-relwithdebinfo", + "displayName": "Windows (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-liblcf-release", + "displayName": "Windows (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "windows-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "windows-x64-vs2022-parent", + "generator": "Visual Studio 17 2022", + "architecture": "x64", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "hidden": true + }, + { + "name": "windows-x64-vs2022-debug", + "displayName": "Windows (x64) using Visual Studio 2022 (Debug)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-x64-vs2022-relwithdebinfo", + "displayName": "Windows (x64) using Visual Studio 2022 (RelWithDebInfo)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-release", + "displayName": "Windows (x64) using Visual Studio 2022 (Release)", + "inherits": [ + "windows-x64-vs2022-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "windows-x64-vs2022-liblcf-debug", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-debug" + ], + "binaryDir": "${sourceDir}/build/win-debug" + }, + { + "name": "windows-x64-vs2022-liblcf-relwithdebinfo", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-relwithdebinfo" + ], + "binaryDir": "${sourceDir}/build/win-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-liblcf-release", + "displayName": "Windows (x64) using Visual Studio 2022 (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "windows-x64-vs2022-parent", + "type-release" + ], + "binaryDir": "${sourceDir}/build/win-release" + }, + { + "name": "macos-parent", + "cacheVariables": { + "EDITOR_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15", + "CMAKE_OSX_ARCHITECTURES": "arm64" + }, + "environment": { + "Qt6_Path": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "hidden": true, + "inherits": "base-user" + }, + { + "name": "macos-debug", + "displayName": "macOS (Debug)", + "inherits": [ + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-relwithdebinfo", + "displayName": "macOS (RelWithDebInfo)", + "inherits": [ + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-release", + "displayName": "macOS (Release)", + "inherits": [ + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-liblcf-debug", + "displayName": "macOS (build liblcf, Debug)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-liblcf-relwithdebinfo", + "displayName": "macOS (build liblcf, RelWithDebInfo)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-liblcf-release", + "displayName": "macOS (build liblcf, Release)", + "inherits": [ + "build-liblcf", + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-vcpkg-debug", + "displayName": "macOS (install deps with vcpkg, Debug)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-vcpkg-relwithdebinfo", + "displayName": "macOS (install deps with vcpkg, RelWithDebInfo)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-vcpkg-release", + "displayName": "macOS (install deps with vcpkg, Release)", + "inherits": [ + "build-vcpkg", + "macos-parent", + "type-release" + ] + }, + { + "name": "macos-vcpkg-liblcf-debug", + "displayName": "macOS (install deps with vcpkg + build liblcf, Debug)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-debug" + ] + }, + { + "name": "macos-vcpkg-liblcf-relwithdebinfo", + "displayName": "macOS (install deps with vcpkg + build liblcf, RelWithDebInfo)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-relwithdebinfo" + ] + }, + { + "name": "macos-vcpkg-liblcf-release", + "displayName": "macOS (install deps with vcpkg + build liblcf, Release)", + "inherits": [ + "build-vcpkg-liblcf", + "macos-parent", + "type-release" + ] + } + ], + "buildPresets": [ + { + "name": "debug", + "configurePreset": "debug" + }, + { + "name": "relwithdebinfo", + "configurePreset": "relwithdebinfo" + }, + { + "name": "release", + "configurePreset": "release" + }, + { + "name": "liblcf-debug", + "configurePreset": "liblcf-debug" + }, + { + "name": "liblcf-relwithdebinfo", + "configurePreset": "liblcf-relwithdebinfo" + }, + { + "name": "liblcf-release", + "configurePreset": "liblcf-release" + }, + { + "name": "vcpkg-debug", + "configurePreset": "vcpkg-debug" + }, + { + "name": "vcpkg-relwithdebinfo", + "configurePreset": "vcpkg-relwithdebinfo" + }, + { + "name": "vcpkg-release", + "configurePreset": "vcpkg-release" + }, + { + "name": "vcpkg-liblcf-debug", + "configurePreset": "vcpkg-liblcf-debug" + }, + { + "name": "vcpkg-liblcf-relwithdebinfo", + "configurePreset": "vcpkg-liblcf-relwithdebinfo" + }, + { + "name": "vcpkg-liblcf-release", + "configurePreset": "vcpkg-liblcf-release" + }, + { + "name": "windows-debug", + "configurePreset": "windows-debug" + }, + { + "name": "windows-relwithdebinfo", + "configurePreset": "windows-relwithdebinfo" + }, + { + "name": "windows-release", + "configurePreset": "windows-release" + }, + { + "name": "windows-liblcf-debug", + "configurePreset": "windows-liblcf-debug" + }, + { + "name": "windows-liblcf-relwithdebinfo", + "configurePreset": "windows-liblcf-relwithdebinfo" + }, + { + "name": "windows-liblcf-release", + "configurePreset": "windows-liblcf-release" + }, + { + "name": "windows-x64-vs2022-debug", + "configurePreset": "windows-x64-vs2022-debug" + }, + { + "name": "windows-x64-vs2022-relwithdebinfo", + "configurePreset": "windows-x64-vs2022-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-release", + "configurePreset": "windows-x64-vs2022-release" + }, + { + "name": "windows-x64-vs2022-liblcf-debug", + "configurePreset": "windows-x64-vs2022-liblcf-debug" + }, + { + "name": "windows-x64-vs2022-liblcf-relwithdebinfo", + "configurePreset": "windows-x64-vs2022-liblcf-relwithdebinfo" + }, + { + "name": "windows-x64-vs2022-liblcf-release", + "configurePreset": "windows-x64-vs2022-liblcf-release" + }, + { + "name": "macos-debug", + "configurePreset": "macos-debug" + }, + { + "name": "macos-relwithdebinfo", + "configurePreset": "macos-relwithdebinfo" + }, + { + "name": "macos-release", + "configurePreset": "macos-release" + }, + { + "name": "macos-liblcf-debug", + "configurePreset": "macos-liblcf-debug" + }, + { + "name": "macos-liblcf-relwithdebinfo", + "configurePreset": "macos-liblcf-relwithdebinfo" + }, + { + "name": "macos-liblcf-release", + "configurePreset": "macos-liblcf-release" + }, + { + "name": "macos-vcpkg-debug", + "configurePreset": "macos-vcpkg-debug" + }, + { + "name": "macos-vcpkg-relwithdebinfo", + "configurePreset": "macos-vcpkg-relwithdebinfo" + }, + { + "name": "macos-vcpkg-release", + "configurePreset": "macos-vcpkg-release" + }, + { + "name": "macos-vcpkg-liblcf-debug", + "configurePreset": "macos-vcpkg-liblcf-debug" + }, + { + "name": "macos-vcpkg-liblcf-relwithdebinfo", + "configurePreset": "macos-vcpkg-liblcf-relwithdebinfo" + }, + { + "name": "macos-vcpkg-liblcf-release", + "configurePreset": "macos-vcpkg-liblcf-release" + } + ], + "testPresets": [] +} diff --git a/builds/cmake/CMakePresets.json.template b/builds/cmake/CMakePresets.json.template new file mode 100644 index 00000000..348b0f49 --- /dev/null +++ b/builds/cmake/CMakePresets.json.template @@ -0,0 +1,58 @@ +{ + "version": 4, + "cmakeMinimumRequired": { + "major": 3, + "minor": 23, + "patch": 0 + }, + "include": [ + "builds/cmake/CMakePresetsUser.json" + ], + "configurePresets": [ + { + "name": "", + "displayName": "System environment", + "easyrpg_platforms": ["liblcf", "vcpkg", "vcpkg-liblcf"] + }, + { + "name": "windows", + "displayName": "Windows", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "$env{VSCMD_ARG_TGT_ARCH}-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "easyrpg_platforms": ["liblcf"] + }, + { + "name": "windows-x64-vs2022", + "displayName": "Windows (x64) using Visual Studio 2022", + "generator": "Visual Studio 17 2022", + "architecture": "x64", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows-static-easyrpgeditor" + }, + "inherits": "win-user", + "easyrpg_platforms": ["liblcf"] + }, + { + "name": "macos", + "displayName": "macOS", + "cacheVariables": { + "EDITOR_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos", + "CMAKE_OSX_DEPLOYMENT_TARGET": "10.15", + "CMAKE_OSX_ARCHITECTURES": "arm64" + }, + "environment": { + "Qt6_Path": "$env{EASYRPG_BUILDSCRIPTS}/macos/qt/6.10.1/macos" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "easyrpg_platforms": ["liblcf", "vcpkg", "vcpkg-liblcf"] + } + ], + "buildPresets": [], + "testPresets": [] +} diff --git a/builds/cmake/CMakePresetsBase.json b/builds/cmake/CMakePresetsBase.json new file mode 100644 index 00000000..71cb8115 --- /dev/null +++ b/builds/cmake/CMakePresetsBase.json @@ -0,0 +1,82 @@ +{ + "version": 4, + "configurePresets": [ + { + "name": "base", + "displayName": "base preset", + "hidden": true, + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "installDir": "${sourceDir}/install/${presetName}", + "cacheVariables": { + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + } + }, + { + "name": "type-debug", + "displayName": "build Debug", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "type-relwithdebinfo", + "displayName": "build RelWithDebInfo", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "type-release", + "displayName": "build release", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "win-base", + "displayName": "windows base preset", + "hidden": true, + "toolchainFile": "$env{EASYRPG_BUILDSCRIPTS}/windows/vcpkg/scripts/buildsystems/vcpkg.cmake", + "cacheVariables": { + "EDITOR_PREFIX_PATH_APPEND": "$env{EASYRPG_BUILDSCRIPTS}/windows/qt/6.10.1/msvc2022_64", + "VCPKG_OVERLAY_PORTS": "${sourceDir}/builds/vcpkg_overlay" + }, + "environment": { + "Qt6_Path": "$env{EASYRPG_BUILDSCRIPTS}/windows/qt/6.10.1/msvc2022_64" + }, + "inherits": ["base"], + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "build-liblcf", + "displayName": "build liblcf dependency", + "hidden": true, + "cacheVariables": { + "EDITOR_BUILD_LIBLCF": "ON" + } + }, + { + "name": "build-vcpkg", + "displayName": "build dependencies with vcpkg", + "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "hidden": true, + "cacheVariables": { + "VCPKG_OVERLAY_PORTS": "${sourceDir}/builds/vcpkg_overlay" + } + }, + { + "name": "build-vcpkg-liblcf", + "displayName": "build liblcf + dependencies with vcpkg", + "hidden": true, + "inherits": ["build-liblcf", "build-vcpkg"] + } + ] +} diff --git a/builds/cmake/CMakePresetsUser.json b/builds/cmake/CMakePresetsUser.json new file mode 100644 index 00000000..a553377a --- /dev/null +++ b/builds/cmake/CMakePresetsUser.json @@ -0,0 +1,45 @@ +{ + "version": 4, + "include": [ + "CMakePresetsBase.json" + ], + "configurePresets": [ + { + "name": "base-user", + "displayName": "user overrides", + "hidden": true, + "inherits": ["base"], + "cacheVariables":{ + }, + "environment": { + "#EASYRPG_BUILDSCRIPTS": "/path/to/easyrpg/buildscripts" + }, + "vendor": { + "README": { + "line1": "Instead of setting an environment variable for the buildscripts you can alternatively", + "line2": "provide them here (in 'environment').", + "line3": "To use this remove the # and set the path for EASYRPG_BUILDSCRIPTS." + } + } + }, + { + "name": "win-user", + "displayName": "user overrides for Windows", + "hidden": true, + "cacheVariables": { + "#toolchainFile": "$env{EASYRPG_BUILDSCRIPTS}/windows/vcpkg/scripts/buildsystems/vcpkg.cmake", + "##toolchainFile": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake" + }, + "inherits": ["win-base"], + "vendor": { + "README": { + "line1": "Here you can provide a custom vcpkg root.", + "line2": "Two examples are given (in 'cacheVariables'):", + "line3": "The first is for a vcpkg from our buildscripts (that is the default).", + "line4": "The second is for a vcpkg inside of the Player repository.", + "line5": "To use one of them remove the # and set the path." + } + } + } + ] +} diff --git a/builds/cmake/Modules/EditorConfigureWindows.cmake b/builds/cmake/Modules/EditorConfigureWindows.cmake new file mode 100644 index 00000000..66949686 --- /dev/null +++ b/builds/cmake/Modules/EditorConfigureWindows.cmake @@ -0,0 +1,38 @@ +if(WIN32) + # Target Unicode API + add_compile_definitions(_UNICODE UNICODE) + + # Disable API deprecation warnings + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) + + # Prevent some Windows.h global namespace pollution + add_compile_definitions(NOMINMAX WIN32_LEAN_AND_MEAN) + + # Make math constants available + add_compile_definitions(_USE_MATH_DEFINES) +endif() + +if(MSVC) + # Depends on vcpkg but we don't support anything else + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>DLL" CACHE STRING "") + + option(MSVC_MULTICORE "MSVC: Build using multiple cores (/MP)" ON) + if (MSVC_MULTICORE) + add_compile_options("/MP") + endif() + + # Interpret character literals as UTF-8 + add_compile_options("/utf-8") +endif() + +if (CMAKE_GENERATOR MATCHES "Visual Studio" AND CMAKE_CONFIGURATION_TYPES) + # Multi-Config is not supported due to limitations in the CMake Find Scripts + # Remove all configuration types except the current build type + set(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE}) +endif() + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(VCPKG_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug") +else() + set(VCPKG_DIR "${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}") +endif() diff --git a/builds/cmake/gen-cmake-presets.py b/builds/cmake/gen-cmake-presets.py new file mode 100644 index 00000000..21e2faa9 --- /dev/null +++ b/builds/cmake/gen-cmake-presets.py @@ -0,0 +1,131 @@ +#!/bin/env python3 + +# Script to generate all combinations for the CMakePresets.json +# Edit the CMakePresets.json.template and run this script +# License for the script and all json files including generated: Unlicense +# (c) Ghabry + +from copy import deepcopy +import json +import os + +script_dir = os.path.dirname(os.path.abspath(__file__)) +repo_dir = f"{script_dir}/.." + +with open(f"{script_dir}/CMakePresets.json.template", "r") as f: + j = json.load(f) + +conf_presets = j["configurePresets"] +conf_presets_out = [] + +def append_name(name): + if len(item["name"]) > 0: + item["name"] += "-" + item["name"] += name + +platform_display = dict( + liblcf="build liblcf", + vcpkg="install deps with vcpkg" +) +platform_display["vcpkg-liblcf"] = "install deps with vcpkg + build liblcf" + +# This creates the following configurePresets from the one in the template: +# - As specified in the template +# - For every entry in easyrpg_platforms (N) +# For all of them the build types Debug, RelWithDebInfo and Release are generated. +# Making this (N+1) * 3 entries per preset. + +# The resulting "triplet" is always: +# {name_from_template}-{libretro}-{build_type} +# Omit libretro to disable it + +# The build dirs are always: +# build/{name_from_template}-{libretro}-{build_type} + +for base_item in conf_presets: + if base_item.get("hidden"): + conf_presets_out.append(base_item) + continue + + # Create "base class" the build types inherit from + item = deepcopy(base_item) + append_name("parent") + del item["displayName"] + item["hidden"] = True + + if item.get("inherits") is None: + item["inherits"] = "base-user" + + ep_platforms = ["default"] + if "easyrpg_platforms" in item: + ep_platforms += item["easyrpg_platforms"] + del item["easyrpg_platforms"] + + parent_item = deepcopy(item) + conf_presets_out.append(parent_item) + + for platform in ep_platforms: + # Ugly: Generates a huge amount of configurePresets + # Cannot be improved until limitations in buildPresets are resolved + # (see comment below) + for build_type in ["Debug", "RelWithDebInfo", "Release"]: + item = dict(name=base_item["name"], displayName=base_item["displayName"]) + name = item["name"] + + item["inherits"] = [parent_item["name"]] + + if platform != "default": + append_name(platform) + item["inherits"].insert(0, f"build-{platform}") + item["displayName"] += f" ({platform_display[platform]}, {build_type})" + else: + item["displayName"] += f" ({build_type})" + + if "windows" in name: + # Hack: The MSVC Linker does not support long paths + # Shorten the build folder name to "win" + item["binaryDir"] = "${sourceDir}/build/win-" + build_type.lower() + + item["inherits"] += [f"type-{build_type.lower()}"] + + append_name(build_type.lower()) + + conf_presets_out.append(item) + +j["configurePresets"] = conf_presets_out + +bp = j["buildPresets"] +for item in conf_presets_out: + if item.get("hidden"): + continue + + # Here it would make sense to provide the build types, however this will + # only work for Multi Config generators. + # Instead the build types are generated as part of the configurePreset. + # Code kept for reference in case CMake improves this in a later version. + + #for build_type in ["Debug", "RelWithDebInfo", "Release", "MinSizeRel"]: + # name = item["name"] + f"-{build_type.lower()}" + # conf_preset = item["name"] + # bp.append(dict( + # name=name, + # displayName=build_type, + # configurePreset=conf_preset, + # configuration=build_type)) + + bp.append(dict(name=item["name"], configurePreset=item["name"])) + +# Add note that the file is auto-generated to the beginning +vendor = dict(vendor=dict( + README=dict( + line1="!!! GENERATED FILE. DO NOT EDIT !!!", + line2="Modify builds/cmake/CMakePresets.json.template instead", + line3="and run gen-cmake-presets.py to regenerate this file." + ) +)) + +j = {**vendor, **j} + +with open(f"{repo_dir}/CMakePresets.json", "w") as f: + json.dump(j, f, indent='\t') + f.write("\n") diff --git a/builds/cmake/setup_env.cmd.in b/builds/cmake/setup_env.cmd.in new file mode 100644 index 00000000..261827cb --- /dev/null +++ b/builds/cmake/setup_env.cmd.in @@ -0,0 +1,3 @@ +@echo off +set PATH=${VCPKG_DIR}/bin;$ENV{Qt6_Path}\\bin;%PATH% +echo Environment configured for EasyRPG Editor \ No newline at end of file diff --git a/builds/flatpak/org.easyrpg.editor.yml b/builds/flatpak/org.easyrpg.editor.yml index 371c897a..b7bb9cae 100644 --- a/builds/flatpak/org.easyrpg.editor.yml +++ b/builds/flatpak/org.easyrpg.editor.yml @@ -1,6 +1,6 @@ app-id: org.easyrpg.editor runtime: org.kde.Sdk -runtime-version: '5.15-21.08' +runtime-version: '6.10' sdk: org.kde.Sdk command: easyrpg-editor rename-desktop-file: easyrpg-editor.desktop @@ -33,6 +33,53 @@ modules: url: https://github.com/benhoyt/inih.git tag: 58 commit: 5cc5e2c24642513aaa5b19126aad42d0e4e0923e + - name: libexpat + buildsystem: cmake-ninja + builddir: true + subdir: expat + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + - -DEXPAT_BUILD_TOOLS=OFF + - -DEXPAT_BUILD_EXAMPLES=OFF + - -DEXPAT_BUILD_TESTS=OFF + - -DEXPAT_BUILD_DOCS=OFF + sources: + - type: url + url: https://github.com/libexpat/libexpat.git + branch: R_2_7_4 + cleanup: + - /share + - name: glaze + buildsystem: cmake-ninja + builddir: true + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + - -Dglaze_DEVELOPER_MODE=OFF + - -Dglaze_BUILD_EXAMPLES=OFF + sources: + - type: git + url: https://github.com/stephenberry/glaze.git + branch: v7.0.2 + cleanup: + - /share + - name: kddockwidgets + buildsystem: cmake-ninja + builddir: true + config-opts: + - -DKDDockWidgets_QT6=ON + - -DKDDockWidgets_FRONTENDS=qtquick + - -DKDDockWidgets_PYTHON_BINDINGS=OFF + - -DKDDockWidgets_TESTS=OFF + - -DKDDockWidgets_EXAMPLES=OFF + - -DCMAKE_DISABLE_FIND_PACKAGE_spdlog=ON + - -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON + - -DCMAKE_DISABLE_FIND_PACKAGE_nlohmann_json=ON + sources: + - type: git + url: https://github.com/KDAB/KDDockWidgets.git + branch: v2.4.0 + cleanup: + - /share # own libraries - name: liblcf buildsystem: cmake-ninja @@ -40,7 +87,6 @@ modules: config-opts: - -DCMAKE_BUILD_TYPE=RelWithDebInfo - -DLIBLCF_ENABLE_TOOLS=OFF - - -DLIBLCF_WITH_XML=OFF - -DLIBLCF_ENABLE_TESTS=OFF - -DLIBLCF_UPDATE_MIMEDB=OFF sources: @@ -53,5 +99,5 @@ modules: config-opts: - -DCMAKE_BUILD_TYPE=RelWithDebInfo sources: - - type: git - url: https://github.com/EasyRPG/Editor.git + - type: dir + path: "../../" diff --git a/builds/vcpkg_overlay/ecm/portfile.cmake b/builds/vcpkg_overlay/ecm/portfile.cmake new file mode 100644 index 00000000..7f7f14cd --- /dev/null +++ b/builds/vcpkg_overlay/ecm/portfile.cmake @@ -0,0 +1,30 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/extra-cmake-modules + REF "v${VERSION}" + SHA512 fe00d410764a335385c960b0f4c55ef8650e70d9a843ea291aa67653d002d6234198d0e71f0cec390a335134272fbc75434b1c997c1b34abf3f800107767b4d7 + HEAD_REF master +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_HTML_DOCS=OFF + -DBUILD_MAN_DOCS=OFF + -DBUILD_QTHELP_DOCS=OFF + -DBUILD_TESTING=OFF +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH share/ECM/cmake) + +# Remove debug files +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") + +file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +# Handle copyright +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING-CMAKE-SCRIPTS") + +# Allow empty include directory +set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled) diff --git a/builds/vcpkg_overlay/ecm/usage b/builds/vcpkg_overlay/ecm/usage new file mode 100644 index 00000000..42821829 --- /dev/null +++ b/builds/vcpkg_overlay/ecm/usage @@ -0,0 +1,9 @@ +ecm provides CMake files: + + find_package(ECM CONFIG REQUIRED NO_MODULE) + list(INSERT CMAKE_MODULE_PATH 0 ${ECM_MODULE_PATH}) + include(KDEInstallDirs) + include(KDECompilerSettings) + include(KDECMakeSettings) + +For more infomation, see https://api.kde.org/ecm/ diff --git a/builds/vcpkg_overlay/ecm/vcpkg.json b/builds/vcpkg_overlay/ecm/vcpkg.json new file mode 100644 index 00000000..40d89c40 --- /dev/null +++ b/builds/vcpkg_overlay/ecm/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "ecm", + "version": "6.20.0", + "port-version": 1, + "description": "Extra CMake Modules (ECM), extra modules and scripts for CMake", + "homepage": "https://github.com/KDE/extra-cmake-modules", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/builds/vcpkg_overlay/kddockwidgets/portfile.cmake b/builds/vcpkg_overlay/kddockwidgets/portfile.cmake new file mode 100644 index 00000000..b259123f --- /dev/null +++ b/builds/vcpkg_overlay/kddockwidgets/portfile.cmake @@ -0,0 +1,66 @@ +if("qtwidgets" IN_LIST FEATURES) + list(APPEND FRONTEND_LIST "qtwidgets") +endif() + +if("qtquick" IN_LIST FEATURES) + list(APPEND FRONTEND_LIST "qtquick") +endif() + +if(FRONTEND_LIST) + list(JOIN FRONTEND_LIST ";" FRONTENDS) +else() + message(FATAL_ERROR "No front-ends selected for ${PORT}, cannot build package") +endif() + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDAB/KDDockWidgets + REF "v${VERSION}" + SHA512 1e220c5cf608c5bb9242b530eb1e45a15dae462b126c12d253483a1213e72374baa75943d8734c5dc79e34b03b480d1a87cd59cb945996abc0ab20b5d649a5cb + HEAD_REF master +) +file(REMOVE_RECURSE + "${SOURCE_PATH}/src/3rdparty" +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" KD_STATIC) + +if(VCPKG_CROSSCOMPILING) + list(APPEND _qarg_OPTIONS + "-DQT_HOST_PATH=${CURRENT_HOST_INSTALLED_DIR}" + "-DQT_HOST_PATH_CMAKE_DIR:PATH=${CURRENT_HOST_INSTALLED_DIR}/share" + ) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${_qarg_OPTIONS} + -DKDDockWidgets_QT6=ON + "-DKDDockWidgets_FRONTENDS=${FRONTENDS}" + -DKDDockWidgets_STATIC=${KD_STATIC} + -DKDDockWidgets_PYTHON_BINDINGS=OFF + -DKDDockWidgets_TESTS=OFF + -DKDDockWidgets_EXAMPLES=OFF + # https://github.com/KDAB/KDDockWidgets/blob/v2.1.0/CMakeLists.txt#L301 + -DCMAKE_DISABLE_FIND_PACKAGE_spdlog=ON + -DCMAKE_DISABLE_FIND_PACKAGE_fmt=ON + -DCMAKE_REQUIRE_FIND_PACKAGE_nlohmann_json=ON + "-DCMAKE_PREFIX_PATH=$ENV{Qt6_Path}" +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/KDDockWidgets-qt6" PACKAGE_NAME kddockwidgets-qt6) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_install_copyright(FILE_LIST + "${SOURCE_PATH}/LICENSE.txt" + "${SOURCE_PATH}/LICENSES/GPL-2.0-only.txt" + "${SOURCE_PATH}/LICENSES/GPL-3.0-only.txt" +) diff --git a/builds/vcpkg_overlay/kddockwidgets/vcpkg.json b/builds/vcpkg_overlay/kddockwidgets/vcpkg.json new file mode 100644 index 00000000..d35d21bf --- /dev/null +++ b/builds/vcpkg_overlay/kddockwidgets/vcpkg.json @@ -0,0 +1,41 @@ +{ + "name": "kddockwidgets", + "version": "2.4.0", + "port-version": 1, + "description": "KDAB's Dock Widget Framework for Qt", + "homepage": "https://www.kdab.com/development-resources/qt-tools/kddockwidgets/", + "license": "GPL-2.0-only OR GPL-3.0-only", + "supports": "!android & !ios", + "dependencies": [ + "kdbindings", + "nlohmann-json", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "qtwidgets" + ], + "features": { + "qtquick": { + "description": "Build for Qt Quick frontend" + }, + "qtwidgets": { + "description": "Build for Qt Widgets frontend", + "dependencies": [ + { + "name": "qtbase", + "default-features": false, + "features": [ + "widgets" + ] + } + ] + } + } +} diff --git a/builds/vcpkg_overlay/kirigami/portfile.cmake b/builds/vcpkg_overlay/kirigami/portfile.cmake new file mode 100644 index 00000000..ea0309d9 --- /dev/null +++ b/builds/vcpkg_overlay/kirigami/portfile.cmake @@ -0,0 +1,46 @@ +vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO KDE/kirigami + REF "v${VERSION}" + SHA512 89bd4131bb92804c45f1db095df27e79121aebd5054efea60605f590b64f9e6b718037f800d5133ac78f2dfb6fbd22e694e5fa266f61ef57b375154b5b098cda + HEAD_REF master +) + +vcpkg_replace_string("${SOURCE_PATH}/CMakeLists.txt" "configure_file(qmllint.ini.in" "#configure_file(qmllint.ini.in") + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_EXAMPLES=OFF + -DCMAKE_PREFIX_PATH="$ENV{Qt6_Path}" +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(PACKAGE_NAME KF6Kirigami CONFIG_PATH lib/cmake/KF6Kirigami DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(PACKAGE_NAME KF6Kirigami2 CONFIG_PATH lib/cmake/KF6Kirigami2 DO_NOT_DELETE_PARENT_CONFIG_PATH) +vcpkg_cmake_config_fixup(PACKAGE_NAME KF6KirigamiPlatform CONFIG_PATH lib/cmake/KF6KirigamiPlatform) + +# Remove debug files +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") +endif() + +# Handle copyright +vcpkg_install_copyright(FILE_LIST + "${SOURCE_PATH}/LICENSES/BSD-2-Clause.txt" + "${SOURCE_PATH}/LICENSES/BSD-3-Clause.txt" + "${SOURCE_PATH}/LICENSES/CC0-1.0.txt" + "${SOURCE_PATH}/LICENSES/FSFAP.txt" + "${SOURCE_PATH}/LICENSES/GPL-2.0-or-later.txt" + "${SOURCE_PATH}/LICENSES/LGPL-2.0-or-later.txt" + "${SOURCE_PATH}/LICENSES/LGPL-2.1-only.txt" + "${SOURCE_PATH}/LICENSES/LGPL-3.0-only.txt" + "${SOURCE_PATH}/LICENSES/LicenseRef-KDE-Accepted-LGPL.txt" + "${SOURCE_PATH}/LICENSES/MIT.txt" +) diff --git a/builds/vcpkg_overlay/kirigami/vcpkg.json b/builds/vcpkg_overlay/kirigami/vcpkg.json new file mode 100644 index 00000000..dc4f0f64 --- /dev/null +++ b/builds/vcpkg_overlay/kirigami/vcpkg.json @@ -0,0 +1,21 @@ +{ + "name": "kirigami", + "version": "6.20.0", + "port-version": 1, + "description": " A QtQuick based components set ", + "homepage": "https://github.com/KDE/kirigami", + "dependencies": [ + { + "name": "qtbase", + "default-features": false + }, + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/builds/vcpkg_overlay/qtbase/portfile.cmake b/builds/vcpkg_overlay/qtbase/portfile.cmake new file mode 100644 index 00000000..4c3fe431 --- /dev/null +++ b/builds/vcpkg_overlay/qtbase/portfile.cmake @@ -0,0 +1,4 @@ +# SPDX-FileCopyrightText: 2024 Klarälvdalens Datakonsult AB, a KDAB Group company +# SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only + +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/builds/vcpkg_overlay/qtbase/vcpkg.json b/builds/vcpkg_overlay/qtbase/vcpkg.json new file mode 100644 index 00000000..8b1c8d97 --- /dev/null +++ b/builds/vcpkg_overlay/qtbase/vcpkg.json @@ -0,0 +1,10 @@ +{ + "name": "qtbase", + "version": "6.8.0", + "port-version": 2, + "features": { + "widgets": { + "description": "" + } + } +} diff --git a/cmake/Modules/ConfigureWindows.cmake b/cmake/Modules/ConfigureWindows.cmake deleted file mode 100644 index cfded2a6..00000000 --- a/cmake/Modules/ConfigureWindows.cmake +++ /dev/null @@ -1,59 +0,0 @@ -if(WIN32) - # Target Unicode API - add_definitions(-D_UNICODE) - add_definitions(-DUNICODE) - - # Disable API deprecation warnings - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - - # Prevent some Windows.h global namespace pollution - add_definitions(-DNOMINMAX) - add_definitions(-DWIN32_LEAN_AND_MEAN) -endif() - -if(MSVC) - if(${CMAKE_VERSION} VERSION_LESS "3.15.0") - message(WARNING "Your CMake version is older than 3.15") - message(WARNING "For proper MSVC runtime library support upgrade to a newer version") - - option(SHARED_RUNTIME "Windows: Build using the shared runtime library (/MD), disable for static runtime (/MT)" ON) - - # Set compiler options. - set(variables - CMAKE_C_FLAGS_DEBUG - CMAKE_C_FLAGS_MINSIZEREL - CMAKE_C_FLAGS_RELEASE - CMAKE_C_FLAGS_RELWITHDEBINFO - CMAKE_CXX_FLAGS_DEBUG - CMAKE_CXX_FLAGS_MINSIZEREL - CMAKE_CXX_FLAGS_RELEASE - CMAKE_CXX_FLAGS_RELWITHDEBINFO - ) - if(SHARED_RUNTIME) - message(STATUS "Windows: Using dynamic runtime library (/MD)") - foreach(variable ${variables}) - if(${variable} MATCHES "/MT") - string(REGEX REPLACE "/MT" "/MD" ${variable} "${${variable}}") - endif() - endforeach() - else() - message(STATUS "Windows: Using static runtime library (/MT)") - foreach(variable ${variables}) - if(${variable} MATCHES "/MD") - string(REGEX REPLACE "/MD" "/MT" ${variable} "${${variable}}") - endif() - endforeach() - endif() - else() - # Depends on vcpkg but we don't support anything else - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>$<$:DLL>" CACHE STRING "") - endif() - - option(MSVC_MULTICORE "MSVC: Build using multiple cores (/MP)" ON) - if (MSVC_MULTICORE) - add_compile_options("/MP") - endif() - - # Interpret character literals as UTF-8 - add_compile_options("/utf-8") -endif() diff --git a/docs/AUTHORS.adoc b/docs/AUTHORS.adoc index 9df98cb4..339aa689 100644 --- a/docs/AUTHORS.adoc +++ b/docs/AUTHORS.adoc @@ -4,6 +4,7 @@ * Diego Pedraza (zegeri) * Francisco de la Peña (fdelapena) * Gabriel Kind (Ghabry) +* lumiscosity * Marcel Hellwig (hellow554) * Mariano Javier Suligoy (MarianoGNU) * Matthew Fioravante (fmatthew5876) diff --git a/src/common/dbstring.h b/src/common/dbstring.h index f579637e..75c22d8a 100644 --- a/src/common/dbstring.h +++ b/src/common/dbstring.h @@ -25,7 +25,7 @@ inline QString ToQString(const std::string& s) { return QString::fromStdString(s); } -inline QString ToQString(lcf::StringView s) { +inline QString ToQString(std::string_view s) { return QString::fromUtf8(s.data(), s.size()); } diff --git a/src/common/lcf_widget_binding.h b/src/common/lcf_widget_binding.h index 3ea210b8..0921e805 100644 --- a/src/common/lcf_widget_binding.h +++ b/src/common/lcf_widget_binding.h @@ -29,22 +29,22 @@ class QGroupBox; #include #include #include +#include #include #include "ui/common/rpg_combobox.h" #include "signal_blocker.h" template -class LcfObjectHolder : QObject { +class LcfObjectHolder { + public: LcfObjectHolder() = default; + ~LcfObjectHolder() = default; + LcfObjectHolder(const LcfObjectHolder &) = default; LcfObjectHolder(T& obj) : m_obj(&obj) {} - LcfObjectHolder(const LcfObjectHolder& other) : QObject(nullptr) { - m_obj = other.m_obj; - } - T& obj() { return *m_obj; } diff --git a/src/main.cpp b/src/main.cpp index 2d9f2dc9..9d84d270 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,15 +16,14 @@ */ #include "ui/main_window.h" -#include "ui/event/event_page_widget.h" #include #include #include #include #include +#include -int main(int argc, char *argv[]) -{ +int main(int argc, char *argv[]) { QApplication a(argc, argv); // show splash @@ -41,6 +40,17 @@ int main(int argc, char *argv[]) a.setOrganizationName("EasyRPG"); a.setOrganizationDomain("easyrpg.org"); + // setup qml engine + QQmlApplicationEngine engine; +#ifdef QML_EXTRA_IMPORT_PATHS + engine.addImportPath(QML_EXTRA_IMPORT_PATHS); +#endif + engine.loadFromModule("org.easyrpg.editor", "MainWindow"); + + if (engine.rootObjects().isEmpty()) { + return -1; + } + // load translations s.showMessage("Loading translations..."); a.processEvents(); diff --git a/src/model/event_command_list.cpp b/src/model/event_command_list.cpp index 74256b2e..8c8019e1 100644 --- a/src/model/event_command_list.cpp +++ b/src/model/event_command_list.cpp @@ -16,6 +16,7 @@ */ #include "event_command_list.h" +#include EventCommandList::EventCommandList(std::vector& commands, int current_index) : m_commands(&commands), m_current_index(current_index) diff --git a/src/model/project.cpp b/src/model/project.cpp index af4c89e1..8a11d828 100644 --- a/src/model/project.cpp +++ b/src/model/project.cpp @@ -69,11 +69,11 @@ std::shared_ptr Project::load(const QDir& dir) { if (!cfg.isNull()) { lcf::INIReader ini(cfg.toStdString()); - std::string title = ini.GetString("RPG_RT", GAMETITLE, tr("Untitled").toStdString()); + auto title = ini.GetString("RPG_RT", GAMETITLE, tr("Untitled").toStdString()); if (project_type == FileFinder::ProjectType::Legacy) { // Check for game encoding - std::string enc = ini.GetString("EasyRPG", "Encoding", ""); + auto enc = ini.GetString("EasyRPG", "Encoding", ""); if (enc.empty()) { // Only use the title for encoding detection // This is called for all games in the "Open Project" list @@ -81,11 +81,11 @@ std::shared_ptr Project::load(const QDir& dir) { enc = lcf::ReaderUtil::DetectEncoding(title); } - p->setEncoding(QString::fromStdString(enc)); + p->setEncoding(QString::fromStdString(std::string(enc))); title = lcf::ReaderUtil::Recode(title, enc); } - p->setGameTitle(QString::fromStdString(title)); + p->setGameTitle(QString::fromStdString(std::string(title))); } return p; diff --git a/src/qmlbinding/empty.h b/src/qmlbinding/empty.h new file mode 100644 index 00000000..e69de29b diff --git a/src/stringizer.cpp b/src/stringizer.cpp index 60549654..544ee2fc 100644 --- a/src/stringizer.cpp +++ b/src/stringizer.cpp @@ -1092,9 +1092,9 @@ namespace break; case 7: // Vehicle in use condition = Stringizer::tr("Vehicle") + " " - + com.parameters[1] == 0 ? Stringizer::tr("Boat") : + + (com.parameters[1] == 0 ? Stringizer::tr("Boat") : com.parameters[1] == 1 ? Stringizer::tr("Ship") : - com.parameters[1] == 2 ? Stringizer::tr("Airship") : Stringizer::tr("Unknown"); + com.parameters[1] == 2 ? Stringizer::tr("Airship") : Stringizer::tr("Unknown")); break; case 8: // Key decision initiated this event condition = Stringizer::tr("Event Started with Decision Key"); diff --git a/src/ui/MainWindow.qml b/src/ui/MainWindow.qml new file mode 100644 index 00000000..a60d966e --- /dev/null +++ b/src/ui/MainWindow.qml @@ -0,0 +1,18 @@ +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls as Controls +import QtQuick.Dialogs as Dialogs +import org.kde.kirigami as Kirigami +import org.easyrpg.editor as EasyRPG + +Kirigami.ApplicationWindow { + id: root + + width: 1024 + height: 600 + + title: "EasyRPG Editor" + + pageStack { + } +} diff --git a/src/ui/main_window.cpp b/src/ui/main_window.cpp index 93d38369..608246f8 100644 --- a/src/ui/main_window.cpp +++ b/src/ui/main_window.cpp @@ -798,18 +798,7 @@ void MainWindow::on_actionProjectOpen_triggered() void MainWindow::on_actionJukebox_triggered(bool disconnect) { - static MusicPlayer player; - if (disconnect) - { - player.disconnect(); - player.deleteLater(); - player.close(); - } - else - { - player.resize(300, 60); - player.show(); - } + } void MainWindow::on_actionLayerLower_triggered() diff --git a/src/ui/main_window.h b/src/ui/main_window.h index 8675c780..beac8d2d 100644 --- a/src/ui/main_window.h +++ b/src/ui/main_window.h @@ -26,7 +26,6 @@ #include "ui/other/search_dialog.h" #include "ui/map/map_scene.h" #include "ui/common/palette_scene.h" -#include "ui/other/musicplayer.h" namespace Ui { class MainWindow; diff --git a/src/ui/other/musicplayer.cpp b/src/ui/other/musicplayer.cpp deleted file mode 100644 index 7d56df9d..00000000 --- a/src/ui/other/musicplayer.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* - * This file is part of EasyRPG Editor. - * - * EasyRPG Editor is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * EasyRPG Editor is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with EasyRPG Editor. If not, see . - */ - -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "musicplayer.h" -#include "volumebutton.h" - -#include -#include -#include - - -MusicPlayer::MusicPlayer(QWidget *parent) : QWidget(parent), - mediaPlayer(nullptr), - playButton(nullptr), - volumeButton(nullptr), - positionSlider(nullptr), - positionLabel(nullptr), - infoLabel(nullptr) -{ - createWidgets(); - createShortcuts(); - - connect(&mediaPlayer, SIGNAL(positionChanged(qint64)), this, SLOT(updatePosition(qint64))); - connect(&mediaPlayer, SIGNAL(durationChanged(qint64)), this, SLOT(updateDuration(qint64))); - connect(&mediaPlayer, SIGNAL(metaDataAvailableChanged(bool)), this, SLOT(updateInfo())); - connect(&mediaPlayer, SIGNAL(error(QMediaPlayer::Error)), this, SLOT(handleError())); - connect(&mediaPlayer, SIGNAL(stateChanged(QMediaPlayer::State)), - this, SLOT(updateState(QMediaPlayer::State))); -} - -void MusicPlayer::openFile() -{ - static QString path = QDir::homePath(); - QString filePath = QFileDialog::getOpenFileName(this, tr("Open File"), path, tr("All files (*.*)")); - if (!filePath.isEmpty()) { - path = filePath; - playFile(filePath); - } -} - -void MusicPlayer::playFile(const QString &filePath) -{ - playButton->setEnabled(true); - infoLabel->setText(QFileInfo(filePath).fileName()); - - mediaPlayer.setMedia(QUrl::fromLocalFile(filePath)); - mediaPlayer.play(); -} - -void MusicPlayer::togglePlayback() -{ - if (mediaPlayer.mediaStatus() == QMediaPlayer::NoMedia) - openFile(); - else if (mediaPlayer.state() == QMediaPlayer::PlayingState) - mediaPlayer.pause(); - else - mediaPlayer.play(); -} - -void MusicPlayer::seekForward() -{ - positionSlider->triggerAction(QSlider::SliderPageStepAdd); -} - -void MusicPlayer::seekBackward() -{ - positionSlider->triggerAction(QSlider::SliderPageStepSub); -} - -bool MusicPlayer::event(QEvent *event) -{ - return QWidget::event(event); -} - -void MusicPlayer::mousePressEvent(QMouseEvent *event) -{ - offset = event->globalPos() - pos(); - event->accept(); -} - -void MusicPlayer::mouseMoveEvent(QMouseEvent *event) -{ - move(event->globalPos() - offset); - event->accept(); -} - -void MusicPlayer::mouseReleaseEvent(QMouseEvent *event) -{ - offset = QPoint(); - event->accept(); -} - -void MusicPlayer::updateState(QMediaPlayer::State state) -{ - if (state == QMediaPlayer::PlayingState) { - playButton->setToolTip(tr("Pause")); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPause)); - } else { - playButton->setToolTip(tr("Play")); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - } -} - -void MusicPlayer::updatePosition(qint64 position) -{ - positionSlider->setValue(static_cast(position)); - - QTime duration(0, static_cast(position / 60000), qRound((position % 60000) / 1000.0)); - positionLabel->setText(duration.toString(tr("mm:ss"))); -} - -void MusicPlayer::updateDuration(qint64 duration) -{ - positionSlider->setRange(0, static_cast(duration)); - positionSlider->setEnabled(duration > 0); - positionSlider->setPageStep(static_cast(duration / 10)); -} - -void MusicPlayer::setPosition(int position) -{ - // avoid seeking when the slider value change is triggered from updatePosition() - if (qAbs(mediaPlayer.position() - position) > 99) - mediaPlayer.setPosition(position); -} - -void MusicPlayer::updateInfo() -{ - QStringList info; - QString author = mediaPlayer.metaData("Author").toString(); - if (!author.isEmpty()) - info += author; - QString title = mediaPlayer.metaData("Title").toString(); - if (!title.isEmpty()) - info += title; - if (!info.isEmpty()) - infoLabel->setText(info.join(tr(" - "))); -} - -void MusicPlayer::handleError() -{ - playButton->setEnabled(false); - infoLabel->setText(tr("Error: %1").arg(mediaPlayer.errorString())); -} - -void MusicPlayer::createWidgets() -{ - playButton = new QToolButton(this); - playButton->setEnabled(false); - playButton->setToolTip(tr("Play")); - playButton->setIcon(style()->standardIcon(QStyle::SP_MediaPlay)); - connect(playButton, SIGNAL(clicked()), this, SLOT(togglePlayback())); - - QAbstractButton *openButton = new QToolButton(this); - openButton->setText(tr("...")); - openButton->setToolTip(tr("Open a file...")); - openButton->setFixedSize(playButton->sizeHint()); - connect(openButton, SIGNAL(clicked()), this, SLOT(openFile())); - - volumeButton = new VolumeButton(this); - volumeButton->setToolTip(tr("Adjust volume")); - volumeButton->setVolume(mediaPlayer.volume()); - connect(volumeButton, SIGNAL(volumeChanged(int)), &mediaPlayer, SLOT(setVolume(int))); - - positionSlider = new QSlider(Qt::Horizontal, this); - positionSlider->setEnabled(false); - positionSlider->setToolTip(tr("Seek")); - connect(positionSlider, SIGNAL(valueChanged(int)), this, SLOT(setPosition(int))); - - infoLabel = new QLabel(this); - positionLabel = new QLabel(tr("00:00"), this); - positionLabel->setMinimumWidth(positionLabel->sizeHint().width()); - - QBoxLayout *controlLayout = new QHBoxLayout; - controlLayout->setMargin(0); - controlLayout->addWidget(openButton); - controlLayout->addWidget(playButton); - controlLayout->addWidget(positionSlider); - controlLayout->addWidget(positionLabel); - controlLayout->addWidget(volumeButton); - - QBoxLayout *mainLayout = new QVBoxLayout(this); - mainLayout->addWidget(infoLabel); - mainLayout->addLayout(controlLayout); -} - -void MusicPlayer::createShortcuts() -{ - QShortcut *quitShortcut = new QShortcut(QKeySequence::Quit, this); - connect(quitShortcut, SIGNAL(activated()), qApp, SLOT(quit())); - - QShortcut *openShortcut = new QShortcut(QKeySequence::Open, this); - connect(openShortcut, SIGNAL(activated()), this, SLOT(openFile())); - - QShortcut *toggleShortcut = new QShortcut(Qt::Key_Space, this); - connect(toggleShortcut, SIGNAL(activated()), this, SLOT(togglePlayback())); - - QShortcut *forwardShortcut = new QShortcut(Qt::Key_Right, this); - connect(forwardShortcut, SIGNAL(activated()), this, SLOT(seekForward())); - - QShortcut *backwardShortcut = new QShortcut(Qt::Key_Left, this); - connect(backwardShortcut, SIGNAL(activated()), this, SLOT(seekBackward())); - - QShortcut *increaseShortcut = new QShortcut(Qt::Key_Up, this); - connect(increaseShortcut, SIGNAL(activated()), volumeButton, SLOT(increaseVolume())); - - QShortcut *decreaseShortcut = new QShortcut(Qt::Key_Down, this); - connect(decreaseShortcut, SIGNAL(activated()), volumeButton, SLOT(descreaseVolume())); -} diff --git a/src/ui/other/musicplayer.h b/src/ui/other/musicplayer.h deleted file mode 100644 index 92fc7e1b..00000000 --- a/src/ui/other/musicplayer.h +++ /dev/null @@ -1,111 +0,0 @@ -/* - * This file is part of EasyRPG Editor. - * - * EasyRPG Editor is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * EasyRPG Editor is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with EasyRPG Editor. If not, see . - */ - -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#pragma once - -#include -#include - -class VolumeButton; - -QT_FORWARD_DECLARE_CLASS(QLabel) -QT_FORWARD_DECLARE_CLASS(QSlider) -QT_FORWARD_DECLARE_CLASS(QAbstractButton) - -class MusicPlayer : public QWidget -{ - Q_OBJECT -public: - MusicPlayer(QWidget *parent = nullptr); - -public slots: - void openFile(); - void playFile(const QString& filePath); - void togglePlayback(); - void seekForward(); - void seekBackward(); - -protected: - bool event(QEvent *event); - void mousePressEvent(QMouseEvent *event); - void mouseMoveEvent(QMouseEvent *event); - void mouseReleaseEvent(QMouseEvent *event); - -private slots: - void updateState(QMediaPlayer::State state); - void updatePosition(qint64 position); - void updateDuration(qint64 duration); - void setPosition(int position); - void updateInfo(); - void handleError(); - -private: - void createWidgets(); - void createShortcuts(); - void createJumpList(); - void createTaskbar(); - void createThumbnailToolBar(); - - QMediaPlayer mediaPlayer; - QAbstractButton *playButton; - VolumeButton *volumeButton; - QSlider *positionSlider; - QLabel *positionLabel; - QLabel *infoLabel; - QPoint offset; -}; - diff --git a/src/ui/other/volumebutton.cpp b/src/ui/other/volumebutton.cpp deleted file mode 100644 index a7abd1e2..00000000 --- a/src/ui/other/volumebutton.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * This file is part of EasyRPG Editor. - * - * EasyRPG Editor is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * EasyRPG Editor is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with EasyRPG Editor. If not, see . - */ - -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "volumebutton.h" - -#include - -VolumeButton::VolumeButton(QWidget *parent) : - QToolButton(parent), menu(nullptr), label(nullptr), slider(nullptr) -{ - setIcon(style()->standardIcon(QStyle::SP_MediaVolume)); - setPopupMode(QToolButton::InstantPopup); - - QWidget *popup = new QWidget(this); - - slider = new QSlider(Qt::Horizontal, popup); - slider->setRange(0, 100); - connect(slider, SIGNAL(valueChanged(int)), this, SIGNAL(volumeChanged(int))); - - label = new QLabel(popup); - label->setAlignment(Qt::AlignCenter); - label->setNum(100); - label->setMinimumWidth(label->sizeHint().width()); - connect(slider, SIGNAL(valueChanged(int)), label, SLOT(setNum(int))); - - QBoxLayout *popupLayout = new QHBoxLayout(popup); - popupLayout->setMargin(2); - popupLayout->addWidget(slider); - popupLayout->addWidget(label); - - QWidgetAction *action = new QWidgetAction(this); - action->setDefaultWidget(popup); - - menu = new QMenu(this); - menu->addAction(action); - setMenu(menu); -} - -void VolumeButton::increaseVolume() -{ - slider->triggerAction(QSlider::SliderPageStepAdd); -} - -void VolumeButton::descreaseVolume() -{ - slider->triggerAction(QSlider::SliderPageStepSub); -} - -int VolumeButton::volume() const -{ - return slider->value(); -} - -void VolumeButton::setVolume(int volume) -{ - slider->setValue(volume); -} diff --git a/src/ui/other/volumebutton.h b/src/ui/other/volumebutton.h deleted file mode 100644 index 3b8503eb..00000000 --- a/src/ui/other/volumebutton.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * This file is part of EasyRPG Editor. - * - * EasyRPG Editor is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * EasyRPG Editor is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with EasyRPG Editor. If not, see . - */ - -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** You may use this file under the terms of the BSD license as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names -** of its contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#pragma once - -#include - -QT_FORWARD_DECLARE_CLASS(QMenu) -QT_FORWARD_DECLARE_CLASS(QLabel) -QT_FORWARD_DECLARE_CLASS(QSlider) - -class VolumeButton : public QToolButton -{ - Q_OBJECT - Q_PROPERTY(int volume READ volume WRITE setVolume NOTIFY volumeChanged) - -public: - VolumeButton(QWidget *parent = nullptr); - - int volume() const; - -public slots: - void increaseVolume(); - void descreaseVolume(); - void setVolume(int volume); - -signals: - void volumeChanged(int volume); - -private: - QMenu *menu; - QLabel *label; - QSlider *slider; -}; - diff --git a/src/ui/picker/picker_dialog.cpp b/src/ui/picker/picker_dialog.cpp index 54490f28..b0eaff04 100644 --- a/src/ui/picker/picker_dialog.cpp +++ b/src/ui/picker/picker_dialog.cpp @@ -83,7 +83,7 @@ void PickerDialog::buttonClicked(QAbstractButton* button) { } void PickerDialog::setDirectoryAndFile(const QString &dir, const QString& initialFile) { - m_dir = QDir(dir); + m_dir.setPath(dir); QString path = m_project.project().findDirectory(dir); QString file = m_project.project().findFile(dir, initialFile, m_file_type); m_model->setRootPath(path); @@ -92,7 +92,7 @@ void PickerDialog::setDirectoryAndFile(const QString &dir, const QString& initia QModelIndex index = m_model->index(file); ui->filesystemView->setCurrentIndex(index); - m_currentFile = file; + m_currentFile = QFileInfo(file); ui->wrappedWidget->fileChanged(m_currentFile.absoluteFilePath()); diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 00000000..3d756da0 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,16 @@ +{ + "name": "easyrpg-editor", + "version": "1.0.0", + "dependencies": [ + "zlib", + { + "name": "inih", + "features": ["cpp"] + }, + "ecm", + "expat", + "glaze", + "kddockwidgets", + "kirigami" + ] +}