Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore/Audacity CLA applies
4 : *
5 : * Copyright (C) MuseScore/Audacity and others
6 : *
7 : * This program is free software: you can redistribute it and/or modify
8 : * it under the terms of the GNU General Public License version 3 as
9 : * published by the Free Software Foundation.
10 : *
11 : * This program is distributed in the hope that it will be useful,
12 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : * GNU General Public License for more details.
15 : *
16 : * You should have received a copy of the GNU General Public License
17 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 : */
19 :
20 : #include "rcommandmodule.h"
21 :
22 : #include "interactive/iinteractiveuriregister.h"
23 :
24 : #include "internal/commandsregister.h"
25 : #include "internal/commandsstate.h"
26 : #include "internal/commanddispatcher.h"
27 :
28 : using namespace muse;
29 : using namespace muse::rcommand;
30 :
31 : static const std::string mname("rcommand");
32 :
33 0 : std::string RCommandModule::moduleName() const
34 : {
35 0 : return mname;
36 : }
37 :
38 1 : void RCommandModule::registerExports()
39 : {
40 1 : globalIoc()->registerExport<ICommandsRegister>(mname, new CommandsRegister());
41 1 : }
42 :
43 1 : void RCommandModule::resolveImports()
44 : {
45 1 : auto ir = globalIoc()->resolve<muse::interactive::IInteractiveUriRegister>(mname);
46 1 : if (ir) {
47 0 : ir->registerQmlUri(Uri("muse://diagnostics/rcommand/list"), "Muse.RCommand", "CommandListDialog");
48 : }
49 1 : }
50 :
51 0 : modularity::IContextSetup* RCommandModule::newContext(const muse::modularity::ContextPtr& ctx) const
52 : {
53 0 : return new RCommandContext(ctx);
54 : }
55 :
56 0 : void RCommandContext::registerExports()
57 : {
58 0 : ioc()->registerExport<ICommandsState>(mname, new CommandsState());
59 0 : ioc()->registerExport<ICommandDispatcher>(mname, new CommandDispatcher());
60 0 : }
|