diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp index 30249c0a53..e6db9f1969 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.cpp @@ -40,8 +40,6 @@ AudioProcessorEditor::AudioProcessorEditor (AudioProcessor* p) noexcept : proce AudioProcessorEditor::~AudioProcessorEditor() { - splashScreen.deleteAndZero(); - // if this fails, then the wrapper hasn't called editorBeingDeleted() on the // filter for some reason.. jassert (processor.getActiveEditor() != this); @@ -56,23 +54,6 @@ void AudioProcessorEditor::hostMIDIControllerIsAvailable (bool) { void AudioProcessorEditor::initialise() { - /* - ========================================================================== - In accordance with the terms of the JUCE 6 End-Use License Agreement, the - JUCE Code in SECTION A cannot be removed, changed or otherwise rendered - ineffective unless you have a JUCE Indie or Pro license, or are using - JUCE under the GPL v3 license. - - End User License Agreement: www.juce.com/juce-6-licence - ========================================================================== - */ - - // BEGIN SECTION A - - splashScreen = new JUCESplashScreen (*this); - - // END SECTION A - setConstrainer (&defaultConstrainer); resizeListener.reset (new AudioProcessorEditorListener (*this)); addComponentListener (resizeListener.get()); diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h index c925540c90..a472f39e1f 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorEditor.h @@ -218,7 +218,6 @@ private: bool resizableByHost = false; ComponentBoundsConstrainer defaultConstrainer; ComponentBoundsConstrainer* constrainer = nullptr; - Component::SafePointer splashScreen; AffineTransform hostScaleTransform; JUCE_DECLARE_NON_COPYABLE (AudioProcessorEditor) diff --git a/modules/juce_gui_basics/juce_gui_basics.cpp b/modules/juce_gui_basics/juce_gui_basics.cpp index 12a815f6ba..bda0fd972c 100644 --- a/modules/juce_gui_basics/juce_gui_basics.cpp +++ b/modules/juce_gui_basics/juce_gui_basics.cpp @@ -219,7 +219,6 @@ namespace juce #include "application/juce_Application.cpp" #include "misc/juce_BubbleComponent.cpp" #include "misc/juce_DropShadower.cpp" -#include "misc/juce_JUCESplashScreen.cpp" #include "layout/juce_FlexBox.cpp" #include "layout/juce_GridItem.cpp" diff --git a/modules/juce_gui_basics/juce_gui_basics.h b/modules/juce_gui_basics/juce_gui_basics.h index a9258b86de..def87c2e0c 100644 --- a/modules/juce_gui_basics/juce_gui_basics.h +++ b/modules/juce_gui_basics/juce_gui_basics.h @@ -250,7 +250,6 @@ namespace juce #include "menus/juce_BurgerMenuComponent.h" #include "buttons/juce_ToolbarButton.h" #include "misc/juce_DropShadower.h" -#include "misc/juce_JUCESplashScreen.h" #include "widgets/juce_TreeView.h" #include "windows/juce_TopLevelWindow.h" #include "windows/juce_AlertWindow.h" diff --git a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp deleted file mode 100644 index 4276326619..0000000000 --- a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* - ============================================================================== - - This file is part of the JUCE library. - Copyright (c) 2020 - Raw Material Software Limited - - JUCE is an open source library subject to commercial or open-source - licensing. - - By using JUCE, you agree to the terms of both the JUCE 6 End-User License - Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). - - End User License Agreement: www.juce.com/juce-6-licence - Privacy Policy: www.juce.com/juce-privacy-policy - - Or: You may also use this code under the terms of the GPL v3 (see - www.gnu.org/licenses). - - 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 -{ - -/* - ============================================================================== - - In accordance with the terms of the JUCE 6 End-Use License Agreement, the - JUCE Code in SECTION A cannot be removed, changed or otherwise rendered - ineffective unless you have a JUCE Indie or Pro license, or are using JUCE - under the GPL v3 license. - - End User License Agreement: www.juce.com/juce-6-licence - - ============================================================================== -*/ - -// BEGIN SECTION A - -#if ! defined (JUCE_DISPLAY_SPLASH_SCREEN) - #define JUCE_DISPLAY_SPLASH_SCREEN 1 -#endif - -#if ! defined (JUCE_USE_DARK_SPLASH_SCREEN) - #define JUCE_USE_DARK_SPLASH_SCREEN 1 -#endif - -static const int millisecondsToDisplaySplash = 2000, splashScreenFadeOutTime = 2000; -static const int splashScreenLogoWidth = 123, splashScreenLogoHeight = 63; -static uint32 splashDisplayTime = 0; -static bool splashHasStartedFading = false; - -static Rectangle getLogoArea (Rectangle parentRect) -{ - return parentRect.reduced (6.0f) - .removeFromRight ((float) splashScreenLogoWidth) - .removeFromBottom ((float) splashScreenLogoHeight); -} - -//============================================================================== -JUCESplashScreen::JUCESplashScreen (Component& parent) -{ - ignoreUnused (parent); - - #if JUCE_DISPLAY_SPLASH_SCREEN - if (splashDisplayTime == 0 - || Time::getMillisecondCounter() < splashDisplayTime + (uint32) millisecondsToDisplaySplash) - { - content = getSplashScreenLogo(); - - setAlwaysOnTop (true); - parent.addAndMakeVisible (this); - } - else - #endif - { - startTimer (1); - } -} - -std::unique_ptr JUCESplashScreen::getSplashScreenLogo() -{ - const char* svgData = R"JUCESPLASHSCREEN( - - - - - - - - - - " - R"JUCESPLASHSCREEN( - - - - - - - - - - - - - - - - )JUCESPLASHSCREEN"; - - auto svgXml = parseXML (svgData); - jassert (svgXml != nullptr); - return Drawable::createFromSVG (*svgXml); -} - -void JUCESplashScreen::paint (Graphics& g) -{ - auto r = getLocalBounds().toFloat(); - Point bottomRight (0.9f * r.getWidth(), - 0.9f * r.getHeight()); - - ColourGradient cg (Colour (0x00000000), Line (0.0f, r.getHeight(), r.getWidth(), 0.0f) - .findNearestPointTo (bottomRight), - Colour (0xff000000), bottomRight, false); - cg.addColour (0.25f, Colour (0x10000000)); - cg.addColour (0.50f, Colour (0x30000000)); - cg.addColour (0.75f, Colour (0x70000000)); - g.setFillType (cg); - g.fillAll(); - - content->drawWithin (g, getLogoArea (r), RectanglePlacement::centred, 1.0f); - - if (splashDisplayTime == 0) - splashDisplayTime = Time::getMillisecondCounter(); - - if (! isTimerRunning()) - startTimer (millisecondsToDisplaySplash); -} - -void JUCESplashScreen::timerCallback() -{ - #if JUCE_DISPLAY_SPLASH_SCREEN - if (isVisible() && ! splashHasStartedFading) - { - splashHasStartedFading = true; - fader.animateComponent (this, getBounds(), 0.0f, splashScreenFadeOutTime, false, 0, 0); - } - - if (splashHasStartedFading && ! fader.isAnimating()) - #endif - delete this; -} - -void JUCESplashScreen::parentSizeChanged() -{ - if (auto* p = getParentComponent()) - setBounds (p->getLocalBounds().removeFromBottom (splashScreenLogoHeight * 3) - .removeFromRight (splashScreenLogoWidth * 3)); -} - -void JUCESplashScreen::parentHierarchyChanged() -{ - toFront (false); -} - -bool JUCESplashScreen::hitTest (int x, int y) -{ - if (! splashHasStartedFading) - return getLogoArea (getLocalBounds().toFloat()).contains ((float) x, (float) y); - - return false; -} - -void JUCESplashScreen::mouseUp (const MouseEvent&) -{ - URL juceWebsite ("https://juce.com"); - juceWebsite.launchInDefaultBrowser(); -} - -// END SECTION A - -} // namespace juce diff --git a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h b/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h deleted file mode 100644 index 3767fc3017..0000000000 --- a/modules/juce_gui_basics/misc/juce_JUCESplashScreen.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - ============================================================================== - - This file is part of the JUCE library. - Copyright (c) 2020 - Raw Material Software Limited - - JUCE is an open source library subject to commercial or open-source - licensing. - - By using JUCE, you agree to the terms of both the JUCE 6 End-User License - Agreement and JUCE Privacy Policy (both effective as of the 16th June 2020). - - End User License Agreement: www.juce.com/juce-6-licence - Privacy Policy: www.juce.com/juce-privacy-policy - - Or: You may also use this code under the terms of the GPL v3 (see - www.gnu.org/licenses). - - JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER - EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE - DISCLAIMED. - - ============================================================================== -*/ - -/* - ============================================================================== - - In accordance with the terms of the JUCE 6 End-Use License Agreement, the - JUCE Code in SECTION A cannot be removed, changed or otherwise rendered - ineffective unless you have a JUCE Indie or Pro license, or are using JUCE - under the GPL v3 license. - - End User License Agreement: www.juce.com/juce-6-licence - - ============================================================================== -*/ - -// BEGIN SECTION A - -namespace juce -{ - -/** - The standard JUCE splash screen component. - - @tags{GUI} -*/ -class JUCE_API JUCESplashScreen : public Component, - private Timer, - private DeletedAtShutdown -{ -public: - JUCESplashScreen (Component& parentToAddTo); - - static std::unique_ptr getSplashScreenLogo(); - -private: - void paint (Graphics&) override; - void timerCallback() override; - void parentSizeChanged() override; - void parentHierarchyChanged() override; - bool hitTest (int, int) override; - void mouseUp (const MouseEvent&) override; - - std::unique_ptr content; - ComponentAnimator fader; - - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (JUCESplashScreen) -}; - -// END SECTION A - -} // namespace juce diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp index d2360e5f4e..42bd2d9d9d 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.cpp @@ -41,8 +41,6 @@ ResizableWindow::ResizableWindow (const String& name, Colour bkgnd, bool shouldA ResizableWindow::~ResizableWindow() { - splashScreen.deleteAndZero(); - // Don't delete or remove the resizer components yourself! They're managed by the // ResizableWindow, and you should leave them alone! You may have deleted them // accidentally by careless use of deleteAllChildren()..? @@ -60,27 +58,6 @@ ResizableWindow::~ResizableWindow() void ResizableWindow::initialise (const bool shouldAddToDesktop) { - /* - ========================================================================== - - In accordance with the terms of the JUCE 6 End-Use License Agreement, the - JUCE Code in SECTION A cannot be removed, changed or otherwise rendered - ineffective unless you have a JUCE Indie or Pro license, or are using - JUCE under the GPL v3 license. - - End User License Agreement: www.juce.com/juce-6-licence - - ========================================================================== - */ - - // BEGIN SECTION A - - #if ! JucePlugin_Build_Standalone - splashScreen = new JUCESplashScreen (*this); - #endif - - // END SECTION A - defaultConstrainer.setMinimumOnscreenAmounts (0x10000, 16, 24, 16); lastNonFullScreenPos.setBounds (50, 50, 256, 256); diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.h b/modules/juce_gui_basics/windows/juce_ResizableWindow.h index d67303595c..e59f620c19 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.h +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.h @@ -383,7 +383,7 @@ protected: private: //============================================================================== - Component::SafePointer contentComponent, splashScreen; + Component::SafePointer contentComponent; bool ownsContentComponent = false, resizeToFitContent = false, fullscreen = false, canDrag = true, dragStarted = false; ComponentDragger dragger; Rectangle lastNonFullScreenPos;