diff --git a/distrho/src/DistrhoPluginVST3.cpp b/distrho/src/DistrhoPluginVST3.cpp index a0fe123b..67de1c5b 100644 --- a/distrho/src/DistrhoPluginVST3.cpp +++ b/distrho/src/DistrhoPluginVST3.cpp @@ -302,6 +302,7 @@ const void* GetPluginFactory(void); const void* GetPluginFactory(void) { + USE_NAMESPACE_DISTRHO; static const struct v3_plugin_factory_2* const factory = (v3_plugin_factory_2*)&dpf_factory; return &factory; } @@ -309,41 +310,38 @@ const void* GetPluginFactory(void) // -------------------------------------------------------------------------------------------------------------------- // OS specific module load -#ifdef DISTRHO_OS_MAC -DISTRHO_PLUGIN_EXPORT bool bundleEntry(CFBundleRef); -DISTRHO_PLUGIN_EXPORT bool bundleExit(void); -bool bundleEntry(CFBundleRef) -{ - gPluginInit(); - return true; -} -bool bundleExit(void) -{ - gPluginInfo = nullptr; - return true; -} +#if defined(DISTRHO_OS_MAC) +# define ENTRYFNNAME bundleEntry +# define EXITFNNAME bundleExit +#elif defined(DISTRHO_OS_WINDOWS) +# define ENTRYFNNAME InitDll +# define EXITFNNAME ExitDll #else -# ifdef DISTRHO_OS_WINDOWS -# define ENTRYFNNAME InitDll -# define EXITFNNAME ExitDll -# else -# define ENTRYFNNAME ModuleEntry -# define EXITFNNAME ModuleExit -# endif -DISTRHO_PLUGIN_EXPORT bool ENTRYFNNAME(void*); -DISTRHO_PLUGIN_EXPORT bool EXITFNNAME(void); +# define ENTRYFNNAME ModuleEntry +# define EXITFNNAME ModuleExit +#endif + +DISTRHO_PLUGIN_EXPORT +bool ENTRYFNNAME(void*); + bool ENTRYFNNAME(void*) { + USE_NAMESPACE_DISTRHO; gPluginInit(); return true; } + +DISTRHO_PLUGIN_EXPORT +bool EXITFNNAME(void); + bool EXITFNNAME(void) { + USE_NAMESPACE_DISTRHO; gPluginInfo = nullptr; return true; } -# undef ENTRYFNNAME -# undef EXITFNNAME -#endif + +#undef ENTRYFNNAME +#undef EXITFNNAME // -------------------------------------------------------------------------------------------------------------------- diff --git a/examples/CairoUI/CairoExampleUI.cpp b/examples/CairoUI/CairoExampleUI.cpp index f02810ab..25d39834 100644 --- a/examples/CairoUI/CairoExampleUI.cpp +++ b/examples/CairoUI/CairoExampleUI.cpp @@ -23,6 +23,14 @@ START_NAMESPACE_DISTRHO +/** + We need a few classes from DGL. + */ +using DGL_NAMESPACE::CairoGraphicsContext; +using DGL_NAMESPACE::CairoImage; +using DGL_NAMESPACE::CairoImageButton; +using DGL_NAMESPACE::CairoImageKnob; + class CairoExampleUI : public UI { public: diff --git a/examples/FileHandling/FileHandlingUI.cpp b/examples/FileHandling/FileHandlingUI.cpp index 5f5ab6bc..1983ee7b 100644 --- a/examples/FileHandling/FileHandlingUI.cpp +++ b/examples/FileHandling/FileHandlingUI.cpp @@ -23,6 +23,8 @@ START_NAMESPACE_DISTRHO +using DGL_NAMESPACE::Button; + const char* kStateKeys[kStateCount] = { "file1", "file2", diff --git a/examples/FileHandling/NanoButton.cpp b/examples/FileHandling/NanoButton.cpp index 6b77dccd..71e4ceb4 100644 --- a/examples/FileHandling/NanoButton.cpp +++ b/examples/FileHandling/NanoButton.cpp @@ -20,7 +20,7 @@ #include "NanoButton.hpp" #include "Window.hpp" -START_NAMESPACE_DISTRHO +START_NAMESPACE_DGL Button::Button(Widget *parent, Callback *cb) : NanoWidget(parent), @@ -101,4 +101,4 @@ bool Button::onMouse(const MouseEvent &ev) return false; } -END_NAMESPACE_DISTRHO +END_NAMESPACE_DGL diff --git a/examples/FileHandling/NanoButton.hpp b/examples/FileHandling/NanoButton.hpp index 5aeb756d..c1efd40d 100644 --- a/examples/FileHandling/NanoButton.hpp +++ b/examples/FileHandling/NanoButton.hpp @@ -25,9 +25,9 @@ #include -START_NAMESPACE_DISTRHO +START_NAMESPACE_DGL -class Button : public NanoWidget +class Button : public NanoSubWidget { public: class Callback @@ -55,6 +55,6 @@ private: DISTRHO_LEAK_DETECTOR(Button) }; -END_NAMESPACE_DISTRHO +END_NAMESPACE_DGL #endif diff --git a/examples/Info/InfoExampleUI.cpp b/examples/Info/InfoExampleUI.cpp index a1638484..80d87673 100644 --- a/examples/Info/InfoExampleUI.cpp +++ b/examples/Info/InfoExampleUI.cpp @@ -20,6 +20,8 @@ START_NAMESPACE_DISTRHO +using DGL_NAMESPACE::ResizeHandle; + // ----------------------------------------------------------------------------------------------------------- class InfoExampleUI : public UI diff --git a/examples/Parameters/ExampleUIParameters.cpp b/examples/Parameters/ExampleUIParameters.cpp index 7b5e2c49..34629d47 100644 --- a/examples/Parameters/ExampleUIParameters.cpp +++ b/examples/Parameters/ExampleUIParameters.cpp @@ -20,13 +20,10 @@ START_NAMESPACE_DISTRHO /** - We need the Color class from DGL. + We need a few classes from DGL. */ using DGL_NAMESPACE::Color; - -/** - We need the rectangle class from DGL. - */ +using DGL_NAMESPACE::GraphicsContext; using DGL_NAMESPACE::Rectangle; // ----------------------------------------------------------------------------------------------------------- diff --git a/examples/SendNote/SendNoteExampleUI.cpp b/examples/SendNote/SendNoteExampleUI.cpp index ef08576c..8d945758 100644 --- a/examples/SendNote/SendNoteExampleUI.cpp +++ b/examples/SendNote/SendNoteExampleUI.cpp @@ -23,10 +23,13 @@ START_NAMESPACE_DISTRHO /** - We need the rectangle class from DGL. + We need a few classes from DGL. */ +using DGL_NAMESPACE::Color; +using DGL_NAMESPACE::GraphicsContext; using DGL_NAMESPACE::Rectangle; + // ----------------------------------------------------------------------------------------------------------- class SendNoteExampleUI : public UI diff --git a/examples/States/ExampleUIStates.cpp b/examples/States/ExampleUIStates.cpp index 4d271fc9..3e2d0770 100644 --- a/examples/States/ExampleUIStates.cpp +++ b/examples/States/ExampleUIStates.cpp @@ -20,13 +20,10 @@ START_NAMESPACE_DISTRHO /** - We need the Color class from DGL. + We need a few classes from DGL. */ using DGL_NAMESPACE::Color; - -/** - We need the rectangle class from DGL. - */ +using DGL_NAMESPACE::GraphicsContext; using DGL_NAMESPACE::Rectangle; // -----------------------------------------------------------------------------------------------------------