diff --git a/examples/graphics/source/main.cpp b/examples/graphics/source/main.cpp index ba35c31e..310a5a30 100644 --- a/examples/graphics/source/main.cpp +++ b/examples/graphics/source/main.cpp @@ -30,7 +30,7 @@ //============================================================================== -class CustomSlider : public juce::Component +class CustomSlider : public yup::Component { int index = 0; @@ -40,53 +40,53 @@ class CustomSlider : public juce::Component { } - void mouseDown (const juce::MouseEvent& event) override + void mouseDown (const yup::MouseEvent& event) override { origin = event.getPosition(); } - void mouseUp (const juce::MouseEvent& event) override + void mouseUp (const yup::MouseEvent& event) override { } - void mouseDrag (const juce::MouseEvent& event) override + void mouseDrag (const yup::MouseEvent& event) override { //auto [x, y] = event.getPosition(); const float distance = origin.distanceX (event.getPosition()) * 0.005f; origin = event.getPosition(); - value = juce::jlimit (0.0f, 1.0f, value + distance); + value = yup::jlimit (0.0f, 1.0f, value + distance); } - void paint (juce::Graphics& g, float frameRate) override + void paint (yup::Graphics& g, float frameRate) override { auto bounds = getLocalBounds().reduced (proportionOfWidth (0.1f)); - juce::Path path; + yup::Path path; path.addEllipse (bounds.reduced (proportionOfWidth (0.1f))); - g.setColor (juce::Color (0xff3d3d3d)); + g.setColor (yup::Color (0xff3d3d3d)); g.fillPath (path); - g.setColor (juce::Color (0xff2b2b2b)); - g.drawPath (path, proportionOfWidth (0.01f)); + g.setColor (yup::Color (0xff2b2b2b)); + g.drawPath (path, proportionOfWidth (0.015f)); - const auto fromRadians = juce::degreesToRadians(135.0f); - const auto toRadians = fromRadians + juce::degreesToRadians(270.0f); - const auto toCurrentRadians = fromRadians + juce::degreesToRadians(270.0f) * value; + const auto fromRadians = yup::degreesToRadians(135.0f); + const auto toRadians = fromRadians + yup::degreesToRadians(270.0f); + const auto toCurrentRadians = fromRadians + yup::degreesToRadians(270.0f) * value; const auto center = bounds.to().getCenter(); - juce::Path arc; + yup::Path arc; { arc.addCenteredArc (center, bounds.getWidth() / 2.0f, bounds.getHeight() / 2.0f, 0.0f, fromRadians, toRadians, true); - g.setStrokeCap (juce::StrokeCap::Butt); - g.setColor (juce::Color (0xff636363)); + g.setStrokeCap (yup::StrokeCap::Butt); + g.setColor (yup::Color (0xff636363)); g.drawPath (arc, proportionOfWidth (0.1f)); } @@ -96,8 +96,8 @@ class CustomSlider : public juce::Component bounds.getWidth() / 2.0f, bounds.getHeight() / 2.0f, 0.0f, fromRadians, toCurrentRadians, true); - g.setStrokeCap (juce::StrokeCap::Round); - g.setColor (juce::Color (0xff4ebfff)); + g.setStrokeCap (yup::StrokeCap::Round); + g.setColor (yup::Color (0xff4ebfff)); g.drawPath (arc, proportionOfWidth (0.1f)); } @@ -110,24 +110,24 @@ class CustomSlider : public juce::Component toCurrentRadians); arc.clear(); - arc.addLine (juce::Line (pos, center).keepOnlyStart (0.2f)); + arc.addLine (yup::Line (pos, center).keepOnlyStart (0.2f)); - g.setStrokeCap (juce::StrokeCap::Round); - g.setColor (juce::Color (0xffffffff)); + g.setStrokeCap (yup::StrokeCap::Round); + g.setColor (yup::Color (0xffffffff)); g.drawPath (arc, proportionOfWidth (0.04f)); } } private: - juce::Point origin; + yup::Point origin; float value = 0.0f; }; //============================================================================== -class CustomWindow : public juce::DocumentWindow +class CustomWindow : public yup::DocumentWindow { - juce::OwnedArray sliders; + yup::OwnedArray sliders; int totalRows = 4; int totalColumns = 4; @@ -155,13 +155,13 @@ class CustomWindow : public juce::DocumentWindow } } - void paint (juce::Graphics& g, float frameRate) override + void paint (yup::Graphics& g, float frameRate) override { - const double time = juce::Time::getMillisecondCounterHiRes() / 1000.0; + const double time = yup::Time::getMillisecondCounterHiRes() / 1000.0; updateFrameTime (time); } - void mouseDown (const juce::MouseEvent& event) override + void mouseDown (const yup::MouseEvent& event) override { auto [x, y] = event.getPosition(); @@ -180,15 +180,15 @@ class CustomWindow : public juce::DocumentWindow } } - void mouseUp (const juce::MouseEvent& event) override + void mouseUp (const yup::MouseEvent& event) override { } - void mouseMove (const juce::MouseEvent& event) override + void mouseMove (const yup::MouseEvent& event) override { } - void mouseDrag (const juce::MouseEvent& event) override + void mouseDrag (const yup::MouseEvent& event) override { auto [x, y] = event.getPosition(); @@ -204,20 +204,20 @@ class CustomWindow : public juce::DocumentWindow } } - void keyDown (const juce::KeyPress& keys, double x, double y) override + void keyDown (const yup::KeyPress& keys, double x, double y) override { switch (keys.getKey()) { - case juce::KeyPress::escapeKey: + case yup::KeyPress::escapeKey: userTriedToCloseWindow(); break; - case juce::KeyPress::textAKey: + case yup::KeyPress::textAKey: forceAtomicMode = !forceAtomicMode; fpsLastTime = 0; break; - case juce::KeyPress::textDKey: + case yup::KeyPress::textDKey: printf ("static float scale = %f;\n", scale); printf ("static float2 translate = {%f, %f};\n", translate.x, translate.y); printf ("static float2 pts[] = {"); @@ -232,35 +232,35 @@ class CustomWindow : public juce::DocumentWindow fflush(stdout); break; - case juce::KeyPress::number1Key: + case yup::KeyPress::number1Key: strokeWidth /= 1.5f; break; - case juce::KeyPress::number2Key: + case yup::KeyPress::number2Key: strokeWidth *= 1.5f; break; - case juce::KeyPress::textWKey: + case yup::KeyPress::textWKey: wireframe = !wireframe; break; - case juce::KeyPress::textCKey: + case yup::KeyPress::textCKey: cap = static_cast ((static_cast (cap) + 1) % 3); break; - case juce::KeyPress::textOKey: + case yup::KeyPress::textOKey: doClose = !doClose; break; - case juce::KeyPress::textSKey: + case yup::KeyPress::textSKey: disableStroke = !disableStroke; break; - case juce::KeyPress::textFKey: + case yup::KeyPress::textFKey: disableFill = !disableFill; break; - case juce::KeyPress::textZKey: + case yup::KeyPress::textZKey: setFullScreen (!isFullScreen()); break; } @@ -268,7 +268,7 @@ class CustomWindow : public juce::DocumentWindow void userTriedToCloseWindow() override { - juce::JUCEApplication::getInstance()->systemRequestedQuit(); + yup::JUCEApplication::getInstance()->systemRequestedQuit(); } private: @@ -286,10 +286,10 @@ class CustomWindow : public juce::DocumentWindow void updateWindowTitle() { - juce::String title; + yup::String title; if (currentFps != 0) - title << "[" << juce::String (currentFps, 1) << " FPS]"; + title << "[" << yup::String (currentFps, 1) << " FPS]"; title << " | " << "YUP On Rive Renderer"; @@ -334,23 +334,23 @@ class CustomWindow : public juce::DocumentWindow //============================================================================== -struct Application : juce::JUCEApplication +struct Application : yup::JUCEApplication { Application() = default; - const juce::String getApplicationName() override + const yup::String getApplicationName() override { return "yup graphics!"; } - const juce::String getApplicationVersion() override + const yup::String getApplicationVersion() override { return "1.0"; } - void initialise (const juce::String& commandLineParameters) override + void initialise (const yup::String& commandLineParameters) override { - juce::Logger::outputDebugString ("Starting app " + commandLineParameters); + yup::Logger::outputDebugString ("Starting app " + commandLineParameters); window = std::make_unique(); window->centreWithSize ({ 800, 800 }); @@ -359,7 +359,7 @@ struct Application : juce::JUCEApplication void shutdown() override { - juce::Logger::outputDebugString ("Shutting down"); + yup::Logger::outputDebugString ("Shutting down"); window.reset(); } diff --git a/examples/render/source/main.cpp b/examples/render/source/main.cpp index efc68189..2f67c2e7 100644 --- a/examples/render/source/main.cpp +++ b/examples/render/source/main.cpp @@ -35,7 +35,7 @@ //============================================================================== -class CustomWindow : public juce::DocumentWindow +class CustomWindow : public yup::DocumentWindow { public: CustomWindow() @@ -43,16 +43,16 @@ class CustomWindow : public juce::DocumentWindow rive::Factory* factory = getNativeComponent()->getFactory(); if (factory == nullptr) { - juce::Logger::outputDebugString ("Failed to create a graphics context"); + yup::Logger::outputDebugString ("Failed to create a graphics context"); - juce::JUCEApplicationBase::getInstance()->systemRequestedQuit(); + yup::JUCEApplicationBase::getInstance()->systemRequestedQuit(); return; } #if JUCE_WASM - juce::File riveFilePath = juce::File ("/data"); + yup::File riveFilePath = yup::File ("/data"); #else - juce::File riveFilePath = juce::File (__FILE__).getParentDirectory().getSiblingFile("data"); + yup::File riveFilePath = yup::File (__FILE__).getParentDirectory().getSiblingFile("data"); #endif riveFilePath = riveFilePath.getChildFile("alien.riv"); @@ -60,7 +60,7 @@ class CustomWindow : public juce::DocumentWindow { if (auto is = riveFilePath.createInputStream(); is != nullptr && is->openedOk()) { - juce::MemoryBlock mb; + yup::MemoryBlock mb; is->readIntoMemoryBlock (mb); rivFile = rive::File::import( { static_cast (mb.getData()), mb.getSize() }, factory); @@ -68,7 +68,7 @@ class CustomWindow : public juce::DocumentWindow } } - void mouseDown(const juce::MouseEvent& event) override + void mouseDown(const yup::MouseEvent& event) override { if (scenes.empty() || ! event.isLeftButtoDown()) return; @@ -80,7 +80,7 @@ class CustomWindow : public juce::DocumentWindow scene->pointerDown (xy); } - void mouseUp (const juce::MouseEvent& event) override + void mouseUp (const yup::MouseEvent& event) override { if (scenes.empty() || ! event.isLeftButtoDown()) return; @@ -92,7 +92,7 @@ class CustomWindow : public juce::DocumentWindow scene->pointerUp (xy); } - void mouseMove (const juce::MouseEvent& event) override + void mouseMove (const yup::MouseEvent& event) override { if (scenes.empty()) return; @@ -104,7 +104,7 @@ class CustomWindow : public juce::DocumentWindow scene->pointerMove (xy); } - void mouseDrag (const juce::MouseEvent& event) override + void mouseDrag (const yup::MouseEvent& event) override { if (scenes.empty() || ! event.isLeftButtoDown()) return; @@ -116,63 +116,63 @@ class CustomWindow : public juce::DocumentWindow scene->pointerMove (xy); } - void keyDown (const juce::KeyPress& keys, double x, double y) override + void keyDown (const yup::KeyPress& keys, double x, double y) override { const bool shift = keys.getModifiers().isShiftDown(); switch (keys.getKey()) { - case juce::KeyPress::escapeKey: + case yup::KeyPress::escapeKey: userTriedToCloseWindow(); break; - case juce::KeyPress::textAKey: + case yup::KeyPress::textAKey: forceAtomicMode = !forceAtomicMode; fpsLastTime = 0; fpsFrames = 0; needsTitleUpdate = true; break; - case juce::KeyPress::textDKey: + case yup::KeyPress::textDKey: printf ("static float scale = %f;\n", scale); printf ("static float2 translate = {%f, %f};\n", translate.x, translate.y); fflush(stdout); break; - case juce::KeyPress::textWKey: + case yup::KeyPress::textWKey: wireframe = !wireframe; break; - case juce::KeyPress::textPKey: + case yup::KeyPress::textPKey: paused = !paused; break; - case juce::KeyPress::textHKey: + case yup::KeyPress::textHKey: if (!shift) ++horzRepeat; else if (horzRepeat > 0) --horzRepeat; break; - case juce::KeyPress::textKKey: + case yup::KeyPress::textKKey: if (!shift) ++upRepeat; else if (upRepeat > 0) --upRepeat; break; - case juce::KeyPress::textJKey: + case yup::KeyPress::textJKey: if (!shift) ++downRepeat; else if (downRepeat > 0) --downRepeat; break; - case juce::KeyPress::textZKey: + case yup::KeyPress::textZKey: setFullScreen (!isFullScreen()); break; - case juce::KeyPress::upKey: + case yup::KeyPress::upKey: { float oldScale = scale; scale *= 1.25; @@ -181,7 +181,7 @@ class CustomWindow : public juce::DocumentWindow break; } - case juce::KeyPress::downKey: + case yup::KeyPress::downKey: { float oldScale = scale; scale /= 1.25; @@ -192,9 +192,9 @@ class CustomWindow : public juce::DocumentWindow } } - void paint (juce::Graphics& g, float frameRate) override + void paint (yup::Graphics& g, float frameRate) override { - double time = juce::Time::getMillisecondCounterHiRes() / 1000.0; + double time = yup::Time::getMillisecondCounterHiRes() / 1000.0; auto [width, height] = getContentSize(); if (lastWidth != width || lastHeight != height) @@ -265,7 +265,7 @@ class CustomWindow : public juce::DocumentWindow void userTriedToCloseWindow() override { - juce::JUCEApplication::getInstance()->systemRequestedQuit(); + yup::JUCEApplication::getInstance()->systemRequestedQuit(); } private: @@ -313,10 +313,10 @@ class CustomWindow : public juce::DocumentWindow void updateWindowTitle (double fps, int instances, int width, int height) { - juce::String title; + yup::String title; if (fps != 0) - title << "[" << juce::String (fps, 1) << " FPS]"; + title << "[" << yup::String (fps, 1) << " FPS]"; if (instances > 1) title << " (x" << instances << " instances)"; @@ -378,23 +378,23 @@ class CustomWindow : public juce::DocumentWindow //============================================================================== -struct Application : juce::JUCEApplication +struct Application : yup::JUCEApplication { Application() = default; - const juce::String getApplicationName() override + const yup::String getApplicationName() override { return "yup!"; } - const juce::String getApplicationVersion() override + const yup::String getApplicationVersion() override { return "1.0"; } - void initialise (const juce::String& commandLineParameters) override + void initialise (const yup::String& commandLineParameters) override { - juce::Logger::outputDebugString ("Starting app " + commandLineParameters); + yup::Logger::outputDebugString ("Starting app " + commandLineParameters); window = std::make_unique(); window->centreWithSize ({ 1280, 866 }); @@ -403,7 +403,7 @@ struct Application : juce::JUCEApplication void shutdown() override { - juce::Logger::outputDebugString ("Shutting down"); + yup::Logger::outputDebugString ("Shutting down"); window.reset(); } diff --git a/modules/juce_audio_basics/native/juce_CoreAudioLayouts_mac.h b/modules/juce_audio_basics/native/juce_CoreAudioLayouts_mac.h index 2a6b7177..2c65da91 100644 --- a/modules/juce_audio_basics/native/juce_CoreAudioLayouts_mac.h +++ b/modules/juce_audio_basics/native/juce_CoreAudioLayouts_mac.h @@ -123,7 +123,12 @@ struct CoreAudioLayouts List { kAudioChannelLayoutTag_MPEG_5_1_D, { centre, left, right, leftSurround, rightSurround, LFE } }, List { kAudioChannelLayoutTag_MPEG_7_1_B, { centre, leftCentre, rightCentre, left, right, leftSurround, rightSurround, LFE } }, List { kAudioChannelLayoutTag_Emagic_Default_7_1, { left, right, leftSurround, rightSurround, centre, LFE, leftCentre, rightCentre } }, + + // Suppressing clang-analyzer-optin.core.EnumCastOutOfRange + #ifndef __clang_analyzer__ List { kAudioChannelLayoutTag_SMPTE_DTV, { left, right, centre, LFE, leftSurround, rightSurround, discreteChannel0 /* leftMatrixTotal */, (ChannelType) (discreteChannel0 + 1) /* rightMatrixTotal */} }, + #endif + List { kAudioChannelLayoutTag_ITU_2_2, { left, right, leftSurround, rightSurround } }, List { kAudioChannelLayoutTag_DVD_4, { left, right, LFE } }, List { kAudioChannelLayoutTag_DVD_5, { left, right, LFE, centreSurround } }, @@ -244,10 +249,13 @@ struct CoreAudioLayouts for (UInt32 i = 0; i < layout.mNumberChannelDescriptions; ++i) channels.addIfNotAlreadyThere (getChannelTypeFromAudioChannelLabel (layout.mChannelDescriptions[i].mChannelLabel)); + // Suppressing clang-analyzer-optin.core.EnumCastOutOfRange + #ifndef __clang_analyzer__ // different speaker mappings may point to the same JUCE speaker so fill up // this array with discrete channels for (int j = 0; channels.size() < static_cast (layout.mNumberChannelDescriptions); ++j) channels.addIfNotAlreadyThere (static_cast (AudioChannelSet::discreteChannel0 + j)); + #endif return channels; } @@ -290,8 +298,11 @@ struct CoreAudioLayouts return AudioChannelSet::ambisonic (ambisonicOrder).getChannelTypes(); } + // Suppressing clang-analyzer-optin.core.EnumCastOutOfRange + #ifndef __clang_analyzer__ for (UInt32 i = 0; i < numChannels; ++i) speakers.add (static_cast (AudioChannelSet::discreteChannel0 + i)); + #endif return speakers; } diff --git a/modules/juce_audio_devices/native/juce_WASAPI_windows.cpp b/modules/juce_audio_devices/native/juce_WASAPI_windows.cpp index 31ab40a0..e3d4b73d 100644 --- a/modules/juce_audio_devices/native/juce_WASAPI_windows.cpp +++ b/modules/juce_audio_devices/native/juce_WASAPI_windows.cpp @@ -628,9 +628,8 @@ class WASAPIDeviceBase if (audioSessionControl != nullptr) { - sessionEventCallback = new SessionEventCallback (*this); + sessionEventCallback = becomeComSmartPtrOwner (new SessionEventCallback (*this)); audioSessionControl->RegisterAudioSessionNotification (sessionEventCallback); - sessionEventCallback->Release(); // (required because ComBaseClassHelper objects are constructed with a ref count of 1) } } @@ -1836,7 +1835,7 @@ class WASAPIAudioIODeviceType final : public AudioIODeviceType { public: explicit ChangeNotificationClient (WASAPIAudioIODeviceType* d) - : ComBaseClassHelper (0), device (d) {} + : device (d) {} JUCE_COMRESULT OnDeviceAdded (LPCWSTR) override { return notify(); } JUCE_COMRESULT OnDeviceRemoved (LPCWSTR) override { return notify(); } @@ -1864,10 +1863,10 @@ class WASAPIAudioIODeviceType final : public AudioIODeviceType static String getDefaultEndpoint (IMMDeviceEnumerator* enumerator, bool forCapture) { String s; - IMMDevice* dev = nullptr; + ComSmartPtr dev; if (check (enumerator->GetDefaultAudioEndpoint (forCapture ? eCapture : eRender, - eMultimedia, &dev))) + eMultimedia, dev.resetAndGetPointerAddress()))) { WCHAR* deviceId = nullptr; @@ -1876,8 +1875,6 @@ class WASAPIAudioIODeviceType final : public AudioIODeviceType s = deviceId; CoTaskMemFree (deviceId); } - - dev->Release(); } return s; @@ -1891,7 +1888,7 @@ class WASAPIAudioIODeviceType final : public AudioIODeviceType if (! check (enumerator.CoCreateInstance (__uuidof (MMDeviceEnumerator)))) return {}; - notifyClient = new ChangeNotificationClient (this); + notifyClient = becomeComSmartPtrOwner (new ChangeNotificationClient (this)); enumerator->RegisterEndpointNotificationCallback (notifyClient); } diff --git a/modules/juce_core/javascript/juce_JSON.cpp b/modules/juce_core/javascript/juce_JSON.cpp index a69ae70e..b8a8bd15 100644 --- a/modules/juce_core/javascript/juce_JSON.cpp +++ b/modules/juce_core/javascript/juce_JSON.cpp @@ -447,7 +447,7 @@ void JSON::writeToStream (OutputStream& out, const var& v, const FormatOptions& if (juce_isfinite (d)) { - out << serialiseDouble (d); + out << serialiseDouble (d, opt.getMaxDecimalPlaces()); } else { diff --git a/modules/juce_core/misc/juce_ConsoleApplication.h b/modules/juce_core/misc/juce_ConsoleApplication.h index e253847c..6598b8c2 100644 --- a/modules/juce_core/misc/juce_ConsoleApplication.h +++ b/modules/juce_core/misc/juce_ConsoleApplication.h @@ -319,7 +319,7 @@ struct ConsoleApplication and a return code which will be returned from main(). @see ConsoleApplication::invokeCatchingFailures() */ - static void fail (String errorMessage, int returnCode = 1); + [[noreturn]] static void fail (String errorMessage, int returnCode = 1); /** Invokes a function, catching any fail() calls that it might trigger, and handling them by printing their error message and returning their error code. diff --git a/modules/juce_core/network/juce_URL.cpp b/modules/juce_core/network/juce_URL.cpp index ef00bc85..e802afdb 100644 --- a/modules/juce_core/network/juce_URL.cpp +++ b/modules/juce_core/network/juce_URL.cpp @@ -453,6 +453,18 @@ int URL::getPort() const return colonPos > 0 ? url.substring (colonPos + 1).getIntValue() : 0; } +String URL::getOrigin() const +{ + const auto schemeAndDomain = getScheme() + "://" + getDomain(); + + const auto colonPos = url.indexOfChar (URLHelpers::findStartOfNetLocation (url), ':'); + + if (colonPos > 0) + return schemeAndDomain + ":" + String { getPort() }; + + return schemeAndDomain; +} + URL URL::withNewDomainAndPath (const String& newURL) const { URL u (*this); diff --git a/modules/juce_core/network/juce_URL.h b/modules/juce_core/network/juce_URL.h index 289ab6e3..f91afb6d 100644 --- a/modules/juce_core/network/juce_URL.h +++ b/modules/juce_core/network/juce_URL.h @@ -159,6 +159,13 @@ class JUCE_API URL */ int getPort() const; + /** Returns the origin of a resource reachable on this URL. + + In the context of cross-origin resource sharing (CORS) a script downloaded from this URL + would only be allowed to reach resources from the returned origin. + */ + String getOrigin() const; + /** Returns a new version of this URL with a different domain and path. e.g. if the URL is "http://www.xyz.com/foo?x=1" and you call this with diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 0b9fa385..e3e5f5c5 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -2274,20 +2274,25 @@ static String reduceLengthOfFloatString (const String& input) return input; } -static String serialiseDouble (double input) +/* maxDecimalPlaces <= 0 means "use as many decimal places as necessary" +*/ +static String serialiseDouble (double input, int maxDecimalPlaces = 0) { auto absInput = std::abs (input); if (absInput >= 1.0e6 || absInput <= 1.0e-5) - return reduceLengthOfFloatString ({ input, 15, true }); + return reduceLengthOfFloatString ({ input, maxDecimalPlaces > 0 ? maxDecimalPlaces : 15, true }); int intInput = (int) input; if (exactlyEqual ((double) intInput, input)) return { input, 1 }; - auto numberOfDecimalPlaces = [absInput] + auto numberOfDecimalPlaces = [absInput, maxDecimalPlaces] { + if (maxDecimalPlaces > 0) + return maxDecimalPlaces; + if (absInput < 1.0) { if (absInput >= 1.0e-3) diff --git a/modules/juce_events/native/juce_Messaging_android.cpp b/modules/juce_events/native/juce_Messaging_android.cpp index 76959737..ab92f91b 100644 --- a/modules/juce_events/native/juce_Messaging_android.cpp +++ b/modules/juce_events/native/juce_Messaging_android.cpp @@ -272,7 +272,7 @@ class JuceAppLifecycle final : public ActivityLifecycleCallbacks JUCEApplicationBase::createInstance = createApplicationSymbol; - initialiseJuce_GUI(); + initialiser.emplace(); if (! JUCEApplicationBase::createInstance()) jassertfalse; // you must supply an application object for an android app! @@ -297,6 +297,7 @@ class JuceAppLifecycle final : public ActivityLifecycleCallbacks } } + std::optional initialiser; GlobalRef myself; juce::JUCEApplicationBase* (*createApplicationSymbol)(); bool hasBeenInitialised = false; diff --git a/modules/juce_events/timers/juce_Timer.cpp b/modules/juce_events/timers/juce_Timer.cpp index 2cf43139..29bd9bf9 100644 --- a/modules/juce_events/timers/juce_Timer.cpp +++ b/modules/juce_events/timers/juce_Timer.cpp @@ -40,21 +40,20 @@ namespace juce { -class Timer::TimerThread final : private Thread +class Timer::TimerThread final : private Thread, + private DeletedAtShutdown { public: using LockType = CriticalSection; // (mysteriously, using a SpinLock here causes problems on some XP machines..) - TimerThread() : Thread ("JUCE Timer") - { - timers.reserve (32); - } + JUCE_DECLARE_SINGLETON (TimerThread, true) ~TimerThread() override { signalThreadShouldExit(); callbackArrived.signal(); stopThread (-1); + clearSingletonInstance(); } void run() override @@ -101,8 +100,7 @@ class Timer::TimerThread final : private Thread void callTimers() { - auto now = Time::getMillisecondCounter(); - auto timeout = now + 100; + auto timeout = Time::getMillisecondCounter() + 100; #if JUCE_WASM auto elapsed = (int) (now >= lastCallTime ? (now - lastCallTime) @@ -235,8 +233,8 @@ class Timer::TimerThread final : private Thread void messageCallback() override { - if (auto instance = SharedResourcePointer::getSharedObjectWithoutCreating()) - (*instance)->callTimers(); + if (auto* instance = TimerThread::getInstanceWithoutCreating()) + instance->callTimers(); } }; @@ -309,8 +307,10 @@ class Timer::TimerThread final : private Thread t.countdownMs -= numMillisecsElapsed; } + TimerThread() : Thread ("JUCE Timer") { timers.reserve (32); } JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TimerThread) }; +JUCE_IMPLEMENT_SINGLETON (Timer::TimerThread) //============================================================================== Timer::Timer() noexcept {} @@ -335,13 +335,16 @@ void Timer::startTimer (int interval) noexcept // running, then you're not going to get any timer callbacks! JUCE_ASSERT_MESSAGE_MANAGER_EXISTS + if (auto* instance = TimerThread::getInstance()) + { bool wasStopped = (timerPeriodMs == 0); timerPeriodMs = jmax (1, interval); if (wasStopped) - timerThread->addTimer (this); + instance->addTimer (this); else - timerThread->resetTimerCounter (this); + instance->resetTimerCounter (this); + } } void Timer::startTimerHz (int timerFrequencyHz) noexcept @@ -356,15 +359,16 @@ void Timer::stopTimer() noexcept { if (timerPeriodMs > 0) { - timerThread->removeTimer (this); + if (auto* instance = TimerThread::getInstanceWithoutCreating()) + instance->removeTimer (this); timerPeriodMs = 0; } } void JUCE_CALLTYPE Timer::callPendingTimersSynchronously() { - if (auto instance = SharedResourcePointer::getSharedObjectWithoutCreating()) - (*instance)->callTimersSynchronously(); + if (auto* instance = TimerThread::getInstanceWithoutCreating()) + instance->callTimersSynchronously(); } struct LambdaInvoker final : private Timer, diff --git a/modules/juce_events/timers/juce_Timer.h b/modules/juce_events/timers/juce_Timer.h index 3905b281..52c37f29 100644 --- a/modules/juce_events/timers/juce_Timer.h +++ b/modules/juce_events/timers/juce_Timer.h @@ -146,7 +146,6 @@ class JUCE_API Timer class TimerThread; size_t positionInQueue = (size_t) -1; int timerPeriodMs = 0; - SharedResourcePointer timerThread; Timer& operator= (const Timer&) = delete; }; diff --git a/modules/yup_graphics/context/yup_GraphicsContext.h b/modules/yup_graphics/context/yup_GraphicsContext.h index 991952de..1a232efb 100644 --- a/modules/yup_graphics/context/yup_GraphicsContext.h +++ b/modules/yup_graphics/context/yup_GraphicsContext.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { class LowLevelRenderContext; @@ -77,4 +77,4 @@ class JUCE_API GraphicsContext static std::unique_ptr createContext (Api graphicsApi, Options options); }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/graphics/yup_Color.h b/modules/yup_graphics/graphics/yup_Color.h index f2ca9b40..105c66c3 100644 --- a/modules/yup_graphics/graphics/yup_Color.h +++ b/modules/yup_graphics/graphics/yup_Color.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -370,4 +370,4 @@ class JUCE_API Color }; }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/graphics/yup_ColorGradient.h b/modules/yup_graphics/graphics/yup_ColorGradient.h index 7f14fc90..d22a7da1 100644 --- a/modules/yup_graphics/graphics/yup_ColorGradient.h +++ b/modules/yup_graphics/graphics/yup_ColorGradient.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -42,7 +42,7 @@ class JUCE_API ColorGradient , finish (color2, x2, y2, 1.0f) { if (type == Radial) - radius = std::sqrt (juce::square (x2 - x1) + juce::square (y2 - y1)); + radius = std::sqrt (square (x2 - x1) + square (y2 - y1)); } ColorGradient (const ColorGradient& other) = default; @@ -143,4 +143,4 @@ class JUCE_API ColorGradient float radius = 0.0f; }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/graphics/yup_Graphics.cpp b/modules/yup_graphics/graphics/yup_Graphics.cpp index fc18d2bd..1e864694 100644 --- a/modules/yup_graphics/graphics/yup_Graphics.cpp +++ b/modules/yup_graphics/graphics/yup_Graphics.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -422,4 +422,4 @@ void Graphics::renderFillPath (rive::RawPath& rawPath, const RenderOptions& opti auto renderPath = factory.makeRenderPath (rawPath, rive::FillRule::nonZero); renderer.drawPath (renderPath.get(), paint.get()); } -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/graphics/yup_Graphics.h b/modules/yup_graphics/graphics/yup_Graphics.h index 9f8d9ef1..f07ccb07 100644 --- a/modules/yup_graphics/graphics/yup_Graphics.h +++ b/modules/yup_graphics/graphics/yup_Graphics.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -161,4 +161,4 @@ class JUCE_API Graphics std::vector renderOptions; }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/graphics/yup_StrokeCap.h b/modules/yup_graphics/graphics/yup_StrokeCap.h index 84fa0f9f..a9fa7f27 100644 --- a/modules/yup_graphics/graphics/yup_StrokeCap.h +++ b/modules/yup_graphics/graphics/yup_StrokeCap.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -30,4 +30,4 @@ enum class StrokeCap : unsigned int Square = 2 }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/graphics/yup_StrokeJoin.h b/modules/yup_graphics/graphics/yup_StrokeJoin.h index 654630df..07dbea3a 100644 --- a/modules/yup_graphics/graphics/yup_StrokeJoin.h +++ b/modules/yup_graphics/graphics/yup_StrokeJoin.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -30,4 +30,4 @@ enum class StrokeJoin : unsigned int Bevel = 2 }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/native/yup_GraphicsContext_d3d.cpp b/modules/yup_graphics/native/yup_GraphicsContext_d3d.cpp index 82f03c66..625603bc 100644 --- a/modules/yup_graphics/native/yup_GraphicsContext_d3d.cpp +++ b/modules/yup_graphics/native/yup_GraphicsContext_d3d.cpp @@ -23,7 +23,7 @@ #include "rive/pls/d3d/pls_render_context_d3d_impl.hpp" #include "rive/pls/d3d/d3d11.hpp" -namespace juce +namespace yup { using namespace rive; @@ -175,4 +175,4 @@ std::unique_ptr juce_constructDirect3DGraphicsContext (Options contextOptions); } -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/native/yup_GraphicsContext_dawn.cpp b/modules/yup_graphics/native/yup_GraphicsContext_dawn.cpp index d183d9d3..6d7e1ee9 100644 --- a/modules/yup_graphics/native/yup_GraphicsContext_dawn.cpp +++ b/modules/yup_graphics/native/yup_GraphicsContext_dawn.cpp @@ -30,7 +30,7 @@ #include #include -namespace juce +namespace yup { using namespace rive; @@ -262,17 +262,17 @@ std::unique_ptr juce_constructDawnGraphicsContext (GraphicsCont return std::make_unique (options); } -} // namespace juce +} // namespace yup #else -namespace juce { +namespace yup { std::unique_ptr juce_constructDawnGraphicsContext (GraphicsContext::Options options) { return nullptr; } -} // namespace juce +} // namespace yup #endif diff --git a/modules/yup_graphics/native/yup_GraphicsContext_dawn_helper.cpp b/modules/yup_graphics/native/yup_GraphicsContext_dawn_helper.cpp index b492ca14..150eb154 100644 --- a/modules/yup_graphics/native/yup_GraphicsContext_dawn_helper.cpp +++ b/modules/yup_graphics/native/yup_GraphicsContext_dawn_helper.cpp @@ -47,7 +47,7 @@ #include -namespace juce +namespace yup { float GetDawnWindowBackingScaleFactor(GLFWwindow* window, bool retina) @@ -79,6 +79,6 @@ std::unique_ptr SetupDawnWindowAndGetSurfaceDescriptor(GLFW } } -} // namespace juce +} // namespace yup #endif diff --git a/modules/yup_graphics/native/yup_GraphicsContext_gl.cpp b/modules/yup_graphics/native/yup_GraphicsContext_gl.cpp index 54e01200..4bf6f1e8 100644 --- a/modules/yup_graphics/native/yup_GraphicsContext_gl.cpp +++ b/modules/yup_graphics/native/yup_GraphicsContext_gl.cpp @@ -29,7 +29,7 @@ #include #endif -namespace juce +namespace yup { using namespace rive; @@ -175,4 +175,4 @@ std::unique_ptr juce_constructOpenGLGraphicsContext (GraphicsCo return std::make_unique(); } -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/native/yup_GraphicsContext_impl.cpp b/modules/yup_graphics/native/yup_GraphicsContext_impl.cpp index 4a4670a7..4400452d 100644 --- a/modules/yup_graphics/native/yup_GraphicsContext_impl.cpp +++ b/modules/yup_graphics/native/yup_GraphicsContext_impl.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce { +namespace yup { std::unique_ptr GraphicsContext::createContext (Options options) { @@ -48,12 +48,12 @@ std::unique_ptr GraphicsContext::createContext (Api graphicsApi case Api::Dawn: return juce_constructDawnGraphicsContext (options); default: - juce::Logger::outputDebugString ("Invalid API requested for current platform"); + Logger::outputDebugString ("Invalid API requested for current platform"); return nullptr; } - juce::Logger::outputDebugString ("Failed to create the graphics context"); + Logger::outputDebugString ("Failed to create the graphics context"); return nullptr; } -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/native/yup_GraphicsContext_metal.cpp b/modules/yup_graphics/native/yup_GraphicsContext_metal.cpp index f367f75c..be518671 100644 --- a/modules/yup_graphics/native/yup_GraphicsContext_metal.cpp +++ b/modules/yup_graphics/native/yup_GraphicsContext_metal.cpp @@ -22,7 +22,7 @@ #include "rive/pls/pls_renderer.hpp" #include "rive/pls/metal/pls_render_context_metal_impl.h" -namespace juce +namespace yup { using namespace rive; @@ -135,4 +135,4 @@ std::unique_ptr juce_constructMetalGraphicsContext (GraphicsCon return std::make_unique (fiddleOptions); } -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/primitives/yup_Line.h b/modules/yup_graphics/primitives/yup_Line.h index e19c188f..11b0441c 100644 --- a/modules/yup_graphics/primitives/yup_Line.h +++ b/modules/yup_graphics/primitives/yup_Line.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { template @@ -163,19 +163,19 @@ ValueType get (const Line& line) return {}; // TODO - error } -} // namespace juce +} // namespace yup namespace std { template -struct tuple_size> +struct tuple_size> { inline static constexpr std::size_t value = 4; }; template -struct tuple_element> +struct tuple_element> { using type = ValueType; }; diff --git a/modules/yup_graphics/primitives/yup_Path.cpp b/modules/yup_graphics/primitives/yup_Path.cpp index 1e33500e..4c8459f3 100644 --- a/modules/yup_graphics/primitives/yup_Path.cpp +++ b/modules/yup_graphics/primitives/yup_Path.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -304,4 +304,4 @@ void Path::appendPath (const Path& other) } } -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/primitives/yup_Path.h b/modules/yup_graphics/primitives/yup_Path.h index 8168e4b4..cde6a6a2 100644 --- a/modules/yup_graphics/primitives/yup_Path.h +++ b/modules/yup_graphics/primitives/yup_Path.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -179,4 +179,4 @@ class JUCE_API Path int lastSubpathIndex = -1; }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_graphics/primitives/yup_Point.h b/modules/yup_graphics/primitives/yup_Point.h index 7f4b22e2..45a3bad4 100644 --- a/modules/yup_graphics/primitives/yup_Point.h +++ b/modules/yup_graphics/primitives/yup_Point.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { template @@ -174,19 +174,19 @@ ValueType get (const Point& point) return {}; // TODO - error } -} // namespace juce +} // namespace yup namespace std { template -struct tuple_size> +struct tuple_size> { inline static constexpr std::size_t value = 2; }; template -struct tuple_element> +struct tuple_element> { using type = ValueType; }; diff --git a/modules/yup_graphics/primitives/yup_Rectangle.h b/modules/yup_graphics/primitives/yup_Rectangle.h index 46a293af..d199c5a4 100644 --- a/modules/yup_graphics/primitives/yup_Rectangle.h +++ b/modules/yup_graphics/primitives/yup_Rectangle.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { template @@ -403,19 +403,19 @@ ValueType get (const Rectangle& point) return {}; // TODO - error } -} // namespace juce +} // namespace yup namespace std { template -struct tuple_size> +struct tuple_size> { inline static constexpr std::size_t value = 4; }; template -struct tuple_element> +struct tuple_element> { using type = ValueType; }; diff --git a/modules/yup_graphics/primitives/yup_Size.h b/modules/yup_graphics/primitives/yup_Size.h index b9d862e7..9c9b9cb7 100644 --- a/modules/yup_graphics/primitives/yup_Size.h +++ b/modules/yup_graphics/primitives/yup_Size.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { template @@ -134,19 +134,19 @@ ValueType get (const Size& point) return {}; // TODO - error } -} // namespace juce +} // namespace yup namespace std { template -struct tuple_size> +struct tuple_size> { inline static constexpr std::size_t value = 2; }; template -struct tuple_element> +struct tuple_element> { using type = ValueType; }; diff --git a/modules/yup_graphics/yup_graphics.h b/modules/yup_graphics/yup_graphics.h index 5dae531d..1d3431f6 100644 --- a/modules/yup_graphics/yup_graphics.h +++ b/modules/yup_graphics/yup_graphics.h @@ -58,6 +58,10 @@ //============================================================================== +namespace yup { +using namespace ::juce; +} // namespace yup + #include "primitives/yup_Size.h" #include "primitives/yup_Point.h" #include "primitives/yup_Line.h" diff --git a/modules/yup_gui/application/yup_Application.cpp b/modules/yup_gui/application/yup_Application.cpp index adb33f57..57bc5167 100644 --- a/modules/yup_gui/application/yup_Application.cpp +++ b/modules/yup_gui/application/yup_Application.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -68,4 +68,4 @@ void JUCEApplication::unhandledException (const std::exception* ex, ignoreUnused (ex, sourceFilename, lineNumber); } -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/application/yup_Application.h b/modules/yup_gui/application/yup_Application.h index 53936c7c..eeccf2b7 100644 --- a/modules/yup_gui/application/yup_Application.h +++ b/modules/yup_gui/application/yup_Application.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -51,4 +51,4 @@ class JUCE_API JUCEApplication : public JUCEApplicationBase JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JUCEApplication) }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/component/yup_Component.cpp b/modules/yup_gui/component/yup_Component.cpp index 7228f1f6..a50b7de2 100644 --- a/modules/yup_gui/component/yup_Component.cpp +++ b/modules/yup_gui/component/yup_Component.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -528,4 +528,4 @@ void Component::internalUserTriedToCloseWindow() userTriedToCloseWindow(); } -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/component/yup_Component.h b/modules/yup_gui/component/yup_Component.h index 498762fa..f3267404 100644 --- a/modules/yup_gui/component/yup_Component.h +++ b/modules/yup_gui/component/yup_Component.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -162,4 +162,4 @@ class JUCE_API Component JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Component) }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/component/yup_ComponentNative.cpp b/modules/yup_gui/component/yup_ComponentNative.cpp index 680db642..31345f6f 100644 --- a/modules/yup_gui/component/yup_ComponentNative.cpp +++ b/modules/yup_gui/component/yup_ComponentNative.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -86,4 +86,4 @@ void ComponentNative::handleUserTriedToCloseWindow() component.internalUserTriedToCloseWindow(); } -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/component/yup_ComponentNative.h b/modules/yup_gui/component/yup_ComponentNative.h index 64213337..b5cee64d 100644 --- a/modules/yup_gui/component/yup_ComponentNative.h +++ b/modules/yup_gui/component/yup_ComponentNative.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { class Component; @@ -85,4 +85,4 @@ class JUCE_API ComponentNative JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComponentNative) }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/desktop/yup_Desktop.cpp b/modules/yup_gui/desktop/yup_Desktop.cpp index 2dfd3d88..5e13dc95 100644 --- a/modules/yup_gui/desktop/yup_Desktop.cpp +++ b/modules/yup_gui/desktop/yup_Desktop.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { Desktop::Desktop() @@ -51,4 +51,4 @@ Display* Desktop::getPrimaryDisplay() const JUCE_IMPLEMENT_SINGLETON (Desktop) -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/desktop/yup_Desktop.h b/modules/yup_gui/desktop/yup_Desktop.h index 267aa1d2..c3203b2f 100644 --- a/modules/yup_gui/desktop/yup_Desktop.h +++ b/modules/yup_gui/desktop/yup_Desktop.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { class JUCE_API Desktop @@ -41,4 +41,4 @@ class JUCE_API Desktop OwnedArray displays; }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/desktop/yup_Display.h b/modules/yup_gui/desktop/yup_Display.h index ad983b79..febae55a 100644 --- a/modules/yup_gui/desktop/yup_Display.h +++ b/modules/yup_gui/desktop/yup_Display.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { class JUCE_API Display @@ -36,4 +36,4 @@ class JUCE_API Display bool isPrimary = false; }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/keyboard/yup_KeyModifiers.h b/modules/yup_gui/keyboard/yup_KeyModifiers.h index f6d6269c..a8c56378 100644 --- a/modules/yup_gui/keyboard/yup_KeyModifiers.h +++ b/modules/yup_gui/keyboard/yup_KeyModifiers.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -110,4 +110,4 @@ class JUCE_API KeyModifiers int32_t modifiers = 0; }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/keyboard/yup_KeyPress.h b/modules/yup_gui/keyboard/yup_KeyPress.h index 529cfc05..e21f8d00 100644 --- a/modules/yup_gui/keyboard/yup_KeyPress.h +++ b/modules/yup_gui/keyboard/yup_KeyPress.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -204,4 +204,4 @@ class JUCE_API KeyPress KeyModifiers modifiers; }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/mouse/yup_MouseEvent.h b/modules/yup_gui/mouse/yup_MouseEvent.h index 66a5e571..5b290a41 100644 --- a/modules/yup_gui/mouse/yup_MouseEvent.h +++ b/modules/yup_gui/mouse/yup_MouseEvent.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -128,4 +128,4 @@ class JUCE_API MouseEvent Point position; }; -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/native/yup_Windowing_glfw.cpp b/modules/yup_gui/native/yup_Windowing_glfw.cpp index 6ad1463a..db372149 100644 --- a/modules/yup_gui/native/yup_Windowing_glfw.cpp +++ b/modules/yup_gui/native/yup_Windowing_glfw.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -747,4 +747,4 @@ void JUCEApplication::staticFinalisation() glfwTerminate(); } -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/windowing/yup_DocumentWindow.cpp b/modules/yup_gui/windowing/yup_DocumentWindow.cpp index a8cc65e0..a3a48fbe 100644 --- a/modules/yup_gui/windowing/yup_DocumentWindow.cpp +++ b/modules/yup_gui/windowing/yup_DocumentWindow.cpp @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -53,4 +53,4 @@ void DocumentWindow::centreWithSize (const Size& size) } } -} // namespace juce +} // namespace yup diff --git a/modules/yup_gui/windowing/yup_DocumentWindow.h b/modules/yup_gui/windowing/yup_DocumentWindow.h index 30fb2708..9b6c62f3 100644 --- a/modules/yup_gui/windowing/yup_DocumentWindow.h +++ b/modules/yup_gui/windowing/yup_DocumentWindow.h @@ -19,7 +19,7 @@ ============================================================================== */ -namespace juce +namespace yup { //============================================================================== @@ -39,4 +39,4 @@ class JUCE_API DocumentWindow : public Component JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DocumentWindow) }; -} // namespace juce +} // namespace yup