diff --git a/CMakeLists.txt b/CMakeLists.txt index b3edef803d6a0..18d9ac04c2ace 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,7 @@ option(BUILD_TELEMETRY_MODULE "Build with telemetry module" ON) set(TELEMETRY_TRACK_ID "" CACHE STRING "Telemetry track id") set(CRASH_REPORT_URL "" CACHE STRING "URL where to send crash reports") +option(BUILD_SHORTCUTS_MODULE "Build shortcuts module" ON) option(BUILD_SYSTEM_MODULE "Build system module" ON) option(BUILD_NETWORK_MODULE "Build network module" ON) option(BUILD_USERSCORES_MODULE "Build userscores module" ON) diff --git a/build/config.h.in b/build/config.h.in index ba186c0b94603..0a4a8db2c8f83 100644 --- a/build/config.h.in +++ b/build/config.h.in @@ -43,6 +43,7 @@ #cmakedefine BUILD_TELEMETRY_MODULE #define TELEMETRY_TRACK_ID "${TELEMETRY_TRACK_ID}" +#cmakedefine BUILD_SHORTCUTS_MODULE #cmakedefine BUILD_SYSTEM_MODULE #cmakedefine BUILD_NETWORK_MODULE #cmakedefine BUILD_USERSCORES_MODULE diff --git a/src/framework/CMakeLists.txt b/src/framework/CMakeLists.txt index 1f1c2b3fa6d24..515409ab34379 100644 --- a/src/framework/CMakeLists.txt +++ b/src/framework/CMakeLists.txt @@ -4,7 +4,10 @@ add_subdirectory(ui) add_subdirectory(uicomponents) add_subdirectory(fonts) add_subdirectory(actions) -add_subdirectory(shortcuts) + +if (BUILD_SHORTCUTS_MODULE) + add_subdirectory(shortcuts) +endif (BUILD_SHORTCUTS_MODULE) if (BUILD_NETWORK_MODULE) add_subdirectory(network) diff --git a/src/main/main.cpp b/src/main/main.cpp index 11a0b37d598f0..31206202ec33b 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -30,7 +30,11 @@ #include "framework/uicomponents/uicomponentsmodule.h" #include "framework/fonts/fontsmodule.h" #include "framework/actions/actionsmodule.h" +#ifdef BUILD_SHORTCUTS_MODULE #include "framework/shortcuts/shortcutsmodule.h" +#else +#include "stubs/framework/shortcuts/shortcutsstubmodule.h" +#endif #ifdef BUILD_SYSTEM_MODULE #include "framework/system/systemmodule.h" @@ -161,7 +165,11 @@ int main(int argc, char** argv) app.addModule(new mu::appshell::AppShellModule()); app.addModule(new mu::context::ContextModule()); +#ifdef BUILD_SHORTCUTS_MODULE app.addModule(new mu::shortcuts::ShortcutsModule()); +#else + app.addModule(new mu::shortcuts::ShortcutsStubModule()); +#endif app.addModule(new mu::audio::AudioModule()); app.addModule(new mu::midi::MidiModule()); diff --git a/src/notation/view/notationpaintview.h b/src/notation/view/notationpaintview.h index 61d98e2450d83..29233162faa2d 100644 --- a/src/notation/view/notationpaintview.h +++ b/src/notation/view/notationpaintview.h @@ -31,7 +31,6 @@ #include "context/iglobalcontext.h" #include "async/asyncable.h" #include "playback/iplaybackcontroller.h" -#include "shortcuts/ishortcutsregister.h" #include "notationviewinputcontroller.h" #include "noteinputcursor.h" @@ -47,7 +46,6 @@ class NotationPaintView : public QQuickPaintedItem, public IControlledView, publ INJECT(notation, context::IGlobalContext, globalContext) INJECT(notation, playback::IPlaybackController, playbackController) INJECT(notation, INotationContextMenu, notationContextMenu) - INJECT(notation, shortcuts::IShortcutsRegister, shortcutsRegister) Q_PROPERTY(qreal startHorizontalScrollPosition READ startHorizontalScrollPosition NOTIFY horizontalScrollChanged) Q_PROPERTY(qreal horizontalScrollSize READ horizontalScrollSize NOTIFY horizontalScrollChanged) diff --git a/src/stubs/framework/CMakeLists.txt b/src/stubs/framework/CMakeLists.txt index e01b2f6fcce4c..1fd72b4a3d0b5 100644 --- a/src/stubs/framework/CMakeLists.txt +++ b/src/stubs/framework/CMakeLists.txt @@ -1,4 +1,8 @@ +if (NOT BUILD_SHORTCUTS_MODULE) + add_subdirectory(shortcuts) +endif (NOT BUILD_SHORTCUTS_MODULE) + if (NOT BUILD_NETWORK_MODULE) add_subdirectory(network) endif (NOT BUILD_NETWORK_MODULE) diff --git a/src/stubs/framework/shortcuts/CMakeLists.txt b/src/stubs/framework/shortcuts/CMakeLists.txt new file mode 100644 index 0000000000000..53bf7c398175a --- /dev/null +++ b/src/stubs/framework/shortcuts/CMakeLists.txt @@ -0,0 +1,42 @@ +#============================================================================= +# MuseScore +# Music Composition & Notation +# +# Copyright (C) 2020 MuseScore BVBA and others +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2. +# +# This program 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 this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#============================================================================= + +set(MODULE shortcuts) + +set(MODULE_QRC shortcuts.qrc) + +set(MODULE_QML_IMPORT ${CMAKE_CURRENT_LIST_DIR}/qml ) + +set(MODULE_SRC + ${CMAKE_CURRENT_LIST_DIR}/shortcutsstubmodule.cpp + ${CMAKE_CURRENT_LIST_DIR}/shortcutsstubmodule.h + ${CMAKE_CURRENT_LIST_DIR}/shortcutsregisterstub.cpp + ${CMAKE_CURRENT_LIST_DIR}/shortcutsregisterstub.h + ${CMAKE_CURRENT_LIST_DIR}/shortcutscontrollerstub.cpp + ${CMAKE_CURRENT_LIST_DIR}/shortcutscontrollerstub.h + ${CMAKE_CURRENT_LIST_DIR}/shortcutsconfigurationstub.cpp + ${CMAKE_CURRENT_LIST_DIR}/shortcutsconfigurationstub.h + ${CMAKE_CURRENT_LIST_DIR}/shortcutcontextresolverstub.cpp + ${CMAKE_CURRENT_LIST_DIR}/shortcutcontextresolverstub.h + ${CMAKE_CURRENT_LIST_DIR}/midiremotestub.cpp + ${CMAKE_CURRENT_LIST_DIR}/midiremotestub.h + ) + +include(${PROJECT_SOURCE_DIR}/build/module.cmake) + diff --git a/src/stubs/framework/shortcuts/midiremotestub.cpp b/src/stubs/framework/shortcuts/midiremotestub.cpp new file mode 100644 index 0000000000000..48d953eaed6bb --- /dev/null +++ b/src/stubs/framework/shortcuts/midiremotestub.cpp @@ -0,0 +1,39 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#include "midiremotestub.h" + +using namespace mu::shortcuts; + +void MidiRemoteStub::setIsSettingMode(bool) +{ +} + +bool MidiRemoteStub::isSettingMode() const +{ + return false; +} + +void MidiRemoteStub::setCurrentActionEvent(const mu::midi::Event&) +{ +} + +mu::Ret MidiRemoteStub::process(const mu::midi::Event&) +{ + return make_ret(Ret::Code::NotSupported); +} diff --git a/src/stubs/framework/shortcuts/midiremotestub.h b/src/stubs/framework/shortcuts/midiremotestub.h new file mode 100644 index 0000000000000..16d51b0b64cbb --- /dev/null +++ b/src/stubs/framework/shortcuts/midiremotestub.h @@ -0,0 +1,37 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#ifndef MU_SHORTCUTS_MIDIREMOTESTUB_H +#define MU_SHORTCUTS_MIDIREMOTESTUB_H + +#include "shortcuts/imidiremote.h" + +namespace mu::shortcuts { +class MidiRemoteStub : public IMidiRemote +{ +public: + void setIsSettingMode(bool arg) override; + bool isSettingMode() const override; + + void setCurrentActionEvent(const midi::Event& ev) override; + + Ret process(const midi::Event& ev) override; +}; +} + +#endif // MU_SHORTCUTS_MIDIREMOTESTUB_H diff --git a/src/stubs/framework/shortcuts/qml/MuseScore/Shortcuts/Shortcuts.qml b/src/stubs/framework/shortcuts/qml/MuseScore/Shortcuts/Shortcuts.qml new file mode 100644 index 0000000000000..0be2380bdf90a --- /dev/null +++ b/src/stubs/framework/shortcuts/qml/MuseScore/Shortcuts/Shortcuts.qml @@ -0,0 +1,3 @@ +import QtQuick 2.15 + +QtObject { } diff --git a/src/stubs/framework/shortcuts/qml/MuseScore/Shortcuts/qmldir b/src/stubs/framework/shortcuts/qml/MuseScore/Shortcuts/qmldir new file mode 100644 index 0000000000000..93d6432b04a09 --- /dev/null +++ b/src/stubs/framework/shortcuts/qml/MuseScore/Shortcuts/qmldir @@ -0,0 +1,2 @@ +module MuseScore.Shortcuts +Shortcuts 1.0 Shortcuts.qml diff --git a/src/stubs/framework/shortcuts/shortcutcontextresolverstub.cpp b/src/stubs/framework/shortcuts/shortcutcontextresolverstub.cpp new file mode 100644 index 0000000000000..a9b38eca41ecd --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutcontextresolverstub.cpp @@ -0,0 +1,26 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#include "shortcutcontextresolverstub.h" + +using namespace mu::shortcuts; + +ShortcutContext ShortcutContextResolverStub::currentShortcutContext() const +{ + return ShortcutContext(); +} diff --git a/src/stubs/framework/shortcuts/shortcutcontextresolverstub.h b/src/stubs/framework/shortcuts/shortcutcontextresolverstub.h new file mode 100644 index 0000000000000..a125b4a75c5c2 --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutcontextresolverstub.h @@ -0,0 +1,32 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#ifndef MU_SHORTCUTS_SHORTCUTCONTEXTRESOLVERSTUB_H +#define MU_SHORTCUTS_SHORTCUTCONTEXTRESOLVERSTUB_H + +#include "shortcuts/ishortcutcontextresolver.h" + +namespace mu::shortcuts { +class ShortcutContextResolverStub : public IShortcutContextResolver +{ +public: + ShortcutContext currentShortcutContext() const override; +}; +} + +#endif // MU_SHORTCUTS_SHORTCUTCONTEXTRESOLVERSTUB_H diff --git a/src/stubs/framework/shortcuts/shortcuts.qrc b/src/stubs/framework/shortcuts/shortcuts.qrc new file mode 100644 index 0000000000000..b242413f71f38 --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcuts.qrc @@ -0,0 +1,6 @@ + + + qml/MuseScore/Shortcuts/qmldir + qml/MuseScore/Shortcuts/Shortcuts.qml + + diff --git a/src/stubs/framework/shortcuts/shortcutsconfigurationstub.cpp b/src/stubs/framework/shortcuts/shortcutsconfigurationstub.cpp new file mode 100644 index 0000000000000..b51fa1bb0fa95 --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutsconfigurationstub.cpp @@ -0,0 +1,31 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#include "shortcutsconfigurationstub.h" + +using namespace mu::shortcuts; + +mu::io::path ShortcutsConfigurationStub::shortcutsUserPath() const +{ + return mu::io::path(); +} + +mu::io::path ShortcutsConfigurationStub::shortcutsDefaultPath() const +{ + return mu::io::path(); +} diff --git a/src/stubs/framework/shortcuts/shortcutsconfigurationstub.h b/src/stubs/framework/shortcuts/shortcutsconfigurationstub.h new file mode 100644 index 0000000000000..f0006ffd63e4e --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutsconfigurationstub.h @@ -0,0 +1,33 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#ifndef MU_SHORTCUTS_SHORTCUTSCONFIGURATIONSTUB_H +#define MU_SHORTCUTS_SHORTCUTSCONFIGURATIONSTUB_H + +#include "shortcuts/ishortcutsconfiguration.h" + +namespace mu::shortcuts { +class ShortcutsConfigurationStub : public IShortcutsConfiguration +{ +public: + io::path shortcutsUserPath() const override; + io::path shortcutsDefaultPath() const override; +}; +} + +#endif // MU_SHORTCUTS_SHORTCUTSCONFIGURATIONSTUB_H diff --git a/src/stubs/framework/shortcuts/shortcutscontrollerstub.cpp b/src/stubs/framework/shortcuts/shortcutscontrollerstub.cpp new file mode 100644 index 0000000000000..72b8fc53a6bbc --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutscontrollerstub.cpp @@ -0,0 +1,25 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#include "shortcutscontrollerstub.h" + +using namespace mu::shortcuts; + +void ShortcutsControllerStub::activate(const std::string&) +{ +} diff --git a/src/stubs/framework/shortcuts/shortcutscontrollerstub.h b/src/stubs/framework/shortcuts/shortcutscontrollerstub.h new file mode 100644 index 0000000000000..4a3184e6ba3e9 --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutscontrollerstub.h @@ -0,0 +1,32 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#ifndef MU_SHORTCUTS_SHORTCUTSCONTROLLERSTUB_H +#define MU_SHORTCUTS_SHORTCUTSCONTROLLERSTUB_H + +#include "shortcuts/ishortcutscontroller.h" + +namespace mu::shortcuts { +class ShortcutsControllerStub : public IShortcutsController +{ +public: + void activate(const std::string& sequence) override; +}; +} + +#endif // MU_SHORTCUTS_SHORTCUTSCONTROLLERSTUB_H diff --git a/src/stubs/framework/shortcuts/shortcutsregisterstub.cpp b/src/stubs/framework/shortcuts/shortcutsregisterstub.cpp new file mode 100644 index 0000000000000..a8d9cb3b3e1e4 --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutsregisterstub.cpp @@ -0,0 +1,37 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#include "shortcutsregisterstub.h" + +using namespace mu::shortcuts; + +const ShortcutList& ShortcutsRegisterStub::shortcuts() const +{ + static const ShortcutList list; + return list; +} + +Shortcut ShortcutsRegisterStub::shortcut(const std::string&) const +{ + return Shortcut(); +} + +ShortcutList ShortcutsRegisterStub::shortcutsForSequence(const std::string&) const +{ + return {}; +} diff --git a/src/stubs/framework/shortcuts/shortcutsregisterstub.h b/src/stubs/framework/shortcuts/shortcutsregisterstub.h new file mode 100644 index 0000000000000..6f5bb6efbc798 --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutsregisterstub.h @@ -0,0 +1,34 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#ifndef MU_SHORTCUTS_SHORTCUTSREGISTERSTUB_H +#define MU_SHORTCUTS_SHORTCUTSREGISTERSTUB_H + +#include "shortcuts/ishortcutsregister.h" + +namespace mu::shortcuts { +class ShortcutsRegisterStub : public IShortcutsRegister +{ +public: + const ShortcutList& shortcuts() const override; + Shortcut shortcut(const std::string& actionCode) const override; + ShortcutList shortcutsForSequence(const std::string& sequence) const override; +}; +} + +#endif // MU_SHORTCUTS_SHORTCUTSREGISTERSTUB_H diff --git a/src/stubs/framework/shortcuts/shortcutsstubmodule.cpp b/src/stubs/framework/shortcuts/shortcutsstubmodule.cpp new file mode 100644 index 0000000000000..7a70fa63e5222 --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutsstubmodule.cpp @@ -0,0 +1,59 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#include "shortcutsstubmodule.h" + +#include "modularity/ioc.h" + +#include "shortcutsregisterstub.h" +#include "shortcutscontrollerstub.h" +#include "midiremotestub.h" +#include "shortcutsconfigurationstub.h" + +#include "ui/iuiengine.h" + +using namespace mu::shortcuts; +using namespace mu::framework; + +static void shortcuts_init_qrc() +{ + Q_INIT_RESOURCE(shortcuts); +} + +std::string ShortcutsStubModule::moduleName() const +{ + return "shortcuts_stub"; +} + +void ShortcutsStubModule::registerExports() +{ + ioc()->registerExport(moduleName(), new ShortcutsRegisterStub()); + ioc()->registerExport(moduleName(), new ShortcutsControllerStub()); + ioc()->registerExport(moduleName(), new MidiRemoteStub()); + ioc()->registerExport(moduleName(), new ShortcutsConfigurationStub()); +} + +void ShortcutsStubModule::registerResources() +{ + shortcuts_init_qrc(); +} + +void ShortcutsStubModule::registerUiTypes() +{ + ioc()->resolve(moduleName())->addSourceImportPath(shortcuts_QML_IMPORT); +} diff --git a/src/stubs/framework/shortcuts/shortcutsstubmodule.h b/src/stubs/framework/shortcuts/shortcutsstubmodule.h new file mode 100644 index 0000000000000..a4756a587d89b --- /dev/null +++ b/src/stubs/framework/shortcuts/shortcutsstubmodule.h @@ -0,0 +1,37 @@ +//============================================================================= +// MuseScore +// Music Composition & Notation +// +// Copyright (C) 2020 MuseScore BVBA and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// This program 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 this program; if not, write to the Free Software +// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= +#ifndef MU_SHORTCUTS_SHORTCUTSSTUBMODULE_H +#define MU_SHORTCUTS_SHORTCUTSSTUBMODULE_H + +#include "modularity/imodulesetup.h" + +namespace mu::shortcuts { +class ShortcutsStubModule : public framework::IModuleSetup +{ +public: + + std::string moduleName() const override; + + void registerExports() override; + void registerResources() override; + void registerUiTypes() override; +}; +} + +#endif // MU_SHORTCUTS_SHORTCUTSSTUBMODULE_H