2 ==============================================================================
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
7 JUCE is an open source library subject to commercial or open-source
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
23 ==============================================================================
29 JUCEApplication::JUCEApplication() {}
30 JUCEApplication::~JUCEApplication() {}
32 //==============================================================================
33 JUCEApplication
* JUCE_CALLTYPE
JUCEApplication::getInstance() noexcept
35 return dynamic_cast<JUCEApplication
*> (JUCEApplicationBase::getInstance());
38 bool JUCEApplication::moreThanOneInstanceAllowed() { return true; }
39 void JUCEApplication::anotherInstanceStarted (const String
&) {}
41 void JUCEApplication::suspended() {}
42 void JUCEApplication::resumed() {}
44 void JUCEApplication::systemRequestedQuit() { quit(); }
46 void JUCEApplication::unhandledException (const std::exception
*, const String
&, int)
51 //==============================================================================
52 ApplicationCommandTarget
* JUCEApplication::getNextCommandTarget()
57 void JUCEApplication::getAllCommands (Array
<CommandID
>& commands
)
59 commands
.add (StandardApplicationCommandIDs::quit
);
62 void JUCEApplication::getCommandInfo (const CommandID commandID
, ApplicationCommandInfo
& result
)
64 if (commandID
== StandardApplicationCommandIDs::quit
)
66 result
.setInfo (TRANS("Quit"),
67 TRANS("Quits the application"),
70 result
.defaultKeypresses
.add (KeyPress ('q', ModifierKeys::commandModifier
, 0));
74 bool JUCEApplication::perform (const InvocationInfo
& info
)
76 if (info
.commandID
== StandardApplicationCommandIDs::quit
)
78 systemRequestedQuit();
85 //==============================================================================
87 extern void juce_initialiseMacMainMenu();
90 bool JUCEApplication::initialiseApp()
92 if (JUCEApplicationBase::initialiseApp())
95 juce_initialiseMacMainMenu(); // (needs to get the app's name)