Loading...
Searching...
No Matches
juce_Initialisation.h
/*
==============================================================================
This file is part of the JUCE library.
Copyright (c) 2022 - Raw Material Software Limited
JUCE is an open source library subject to commercial or open-source
licensing.
The code included in this file is provided under the terms of the ISC license
http://www.isc.org/downloads/software-support-policy/isc-license. Permission
To use, copy, modify, and/or distribute this software for any purpose with or
without fee is hereby granted provided that the above copyright notice and
this permission notice appear in all copies.
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
DISCLAIMED.
==============================================================================
*/
namespace juce
{
//==============================================================================
JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI();
JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI();
//==============================================================================
class JUCE_API ScopedJuceInitialiser_GUI final
{
public:
ScopedJuceInitialiser_GUI();
~ScopedJuceInitialiser_GUI();
JUCE_DECLARE_NON_COPYABLE (ScopedJuceInitialiser_GUI)
JUCE_DECLARE_NON_MOVEABLE (ScopedJuceInitialiser_GUI)
};
//==============================================================================
#if DOXYGEN
#define START_JUCE_APPLICATION(AppClass)
#else
#if JUCE_WINDOWS && ! defined (_CONSOLE)
#define JUCE_MAIN_FUNCTION \
JUCE_BEGIN_IGNORE_WARNINGS_MSVC (28251) \
int __stdcall WinMain (struct HINSTANCE__*, struct HINSTANCE__*, char*, int) \
JUCE_END_IGNORE_WARNINGS_MSVC
#define JUCE_MAIN_FUNCTION_ARGS
#else
#define JUCE_MAIN_FUNCTION int main (int argc, char* argv[])
#define JUCE_MAIN_FUNCTION_ARGS argc, (const char**) argv
#endif
#if JUCE_IOS
#define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes") \
juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); } \
void* juce_GetIOSCustomDelegateClass() { return nullptr; } \
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#define JUCE_CREATE_APPLICATION_DEFINE_CUSTOM_DELEGATE(AppClass, DelegateClass) \
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes") \
juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); } \
void* juce_GetIOSCustomDelegateClass() { return [DelegateClass class]; } \
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#define JUCE_MAIN_FUNCTION_DEFINITION \
extern "C" JUCE_MAIN_FUNCTION \
{ \
juce::JUCEApplicationBase::createInstance = &juce_CreateApplication; \
juce::JUCEApplicationBase::iOSCustomDelegate = juce_GetIOSCustomDelegateClass(); \
return juce::JUCEApplicationBase::main (JUCE_MAIN_FUNCTION_ARGS); \
}
#elif JUCE_ANDROID
#define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
extern "C" juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); }
#define JUCE_MAIN_FUNCTION_DEFINITION
#else
#define JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
juce::JUCEApplicationBase* juce_CreateApplication(); \
juce::JUCEApplicationBase* juce_CreateApplication() { return new AppClass(); }
#define JUCE_MAIN_FUNCTION_DEFINITION \
extern "C" JUCE_MAIN_FUNCTION \
{ \
juce::JUCEApplicationBase::createInstance = &juce_CreateApplication; \
return juce::JUCEApplicationBase::main (JUCE_MAIN_FUNCTION_ARGS); \
}
#endif
#if JucePlugin_Build_Standalone
#if JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP
#define START_JUCE_APPLICATION(AppClass) JUCE_CREATE_APPLICATION_DEFINE(AppClass)
#if JUCE_IOS
#define START_JUCE_APPLICATION_WITH_CUSTOM_DELEGATE(AppClass, DelegateClass) JUCE_CREATE_APPLICATION_DEFINE_CUSTOM_DELEGATE(AppClass, DelegateClass)
#endif
#else
#define START_JUCE_APPLICATION(AppClass) static_assert(false, "You are trying to use START_JUCE_APPLICATION in an audio plug-in. Define JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1 if you want to use a custom standalone target app.");
#if JUCE_IOS
#define START_JUCE_APPLICATION_WITH_CUSTOM_DELEGATE(AppClass, DelegateClass) static_assert(false, "You are trying to use START_JUCE_APPLICATION in an audio plug-in. Define JUCE_USE_CUSTOM_PLUGIN_STANDALONE_APP=1 if you want to use a custom standalone target app.");
#endif
#endif
#else
#define START_JUCE_APPLICATION(AppClass) \
JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wmissing-prototypes") \
JUCE_CREATE_APPLICATION_DEFINE(AppClass) \
JUCE_MAIN_FUNCTION_DEFINITION \
JUCE_END_IGNORE_WARNINGS_GCC_LIKE
#if JUCE_IOS
#define START_JUCE_APPLICATION_WITH_CUSTOM_DELEGATE(AppClass, DelegateClass) \
JUCE_CREATE_APPLICATION_DEFINE_CUSTOM_DELEGATE(AppClass, DelegateClass) \
JUCE_MAIN_FUNCTION_DEFINITION
#endif
#endif
#endif
} // namespace juce
juce::ScopedJuceInitialiser_GUI::ScopedJuceInitialiser_GUI
ScopedJuceInitialiser_GUI()
Definition juce_MessageManager.cpp:514