From b9542ccc4ce88fa74053b53a0540302af6d77f4a Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 25 Aug 2021 10:08:55 +0100 Subject: [PATCH] Update code to use C++14 [[deprecated]] attribute This commit removes the various compiler-specific JUCE_DEPRECATED macros and replaces them with C++14's deprecated attribute. It also removes the JUCE_CATCH_DEPRECATED_CODE_MISUSE flag as we can rely on the override specifier catching usage of these old virtual methods, and tidies up the DOXYGEN preprocessor checks as they were inconsistent across the codebase. --- examples/Assets/DSPDemos_Common.h | 2 +- examples/Audio/AudioPlaybackDemo.h | 2 +- examples/DSP/SIMDRegisterDemo.h | 16 ++--- examples/Utilities/NetworkingDemo.h | 7 ++- .../Source/Plugins/InternalPlugins.cpp | 2 +- .../buffers/juce_AudioDataConverters.cpp | 6 ++ .../buffers/juce_AudioDataConverters.h | 7 ++- .../midi/juce_MidiBuffer.cpp | 8 ++- .../juce_audio_basics/midi/juce_MidiBuffer.h | 19 +++--- .../juce_audio_basics/midi/juce_MidiMessage.h | 9 ++- .../native/juce_mac_CoreAudioLayouts.h | 2 +- .../synthesisers/juce_Synthesiser.h | 8 --- .../utilities/juce_SmoothedValue.h | 11 ++-- .../audio_io/juce_AudioDeviceManager.h | 14 +++-- .../audio_io/juce_AudioIODeviceType.h | 6 +- .../midi_io/juce_MidiDevices.h | 16 +++-- .../codecs/juce_FlacAudioFormat.h | 2 +- .../codecs/juce_LAMEEncoderAudioFormat.h | 2 +- .../codecs/juce_OggVorbisAudioFormat.h | 2 +- .../RTAS/juce_RTAS_Wrapper.cpp | 6 +- .../format_types/juce_AU_Shared.h | 2 +- .../format_types/juce_VST3Common.h | 4 +- .../format_types/juce_VST3PluginFormat.h | 15 ++--- .../processors/juce_AudioPluginInstance.h | 35 ++++++----- .../processors/juce_AudioProcessor.h | 61 +++++++++---------- .../juce_AudioProcessorParameterGroup.h | 10 +-- .../juce_GenericAudioProcessorEditor.h | 6 +- .../scanning/juce_KnownPluginList.h | 20 +++--- .../juce_AudioProcessorValueTreeState.h | 49 ++++++++------- .../audio_cd/juce_AudioCDReader.h | 1 - .../gui/juce_MidiKeyboardComponent.h | 7 --- modules/juce_core/containers/juce_Array.h | 6 +- .../juce_core/containers/juce_DynamicObject.h | 5 -- .../juce_core/containers/juce_OwnedArray.h | 6 +- .../containers/juce_ReferenceCountedArray.h | 6 +- modules/juce_core/containers/juce_Variant.cpp | 15 ++++- modules/juce_core/containers/juce_Variant.h | 17 +++--- .../files/juce_DirectoryIterator.cpp | 18 ------ .../juce_core/files/juce_DirectoryIterator.h | 31 +++++++--- modules/juce_core/files/juce_File.cpp | 15 ++++- modules/juce_core/files/juce_File.h | 10 +-- .../files/juce_RangedDirectoryIterator.cpp | 12 ++-- .../files/juce_RangedDirectoryIterator.h | 7 +++ modules/juce_core/maths/juce_MathsFunctions.h | 33 ++++------ modules/juce_core/memory/juce_Atomic.h | 7 +-- modules/juce_core/memory/juce_ByteOrder.h | 2 +- modules/juce_core/memory/juce_HeapBlock.h | 2 +- modules/juce_core/memory/juce_MemoryBlock.h | 9 +-- .../memory/juce_ReferenceCountedObject.h | 7 ++- modules/juce_core/memory/juce_ScopedPointer.h | 27 +++++--- modules/juce_core/misc/juce_Uuid.h | 2 +- modules/juce_core/misc/juce_WindowsRegistry.h | 8 ++- .../juce_core/native/juce_posix_SharedCode.h | 12 +++- modules/juce_core/native/juce_win32_Files.cpp | 12 +++- modules/juce_core/network/juce_URL.h | 5 +- .../juce_core/streams/juce_URLInputSource.cpp | 7 ++- .../juce_core/system/juce_CompilerSupport.h | 2 +- modules/juce_core/system/juce_PlatformDefs.h | 50 ++------------- .../juce_core/system/juce_StandardHeader.h | 7 --- modules/juce_core/system/juce_SystemStats.h | 6 +- .../juce_core/text/juce_CharPointer_UTF16.h | 2 +- .../juce_core/text/juce_CharacterFunctions.h | 4 +- modules/juce_core/text/juce_String.cpp | 15 ++++- modules/juce_core/text/juce_String.h | 21 +++---- modules/juce_core/threads/juce_Process.h | 6 +- modules/juce_core/threads/juce_Thread.h | 2 +- modules/juce_core/xml/juce_XmlElement.h | 50 +++++++-------- .../zip/juce_GZIPDecompressorInputStream.h | 5 -- .../values/juce_ValueTree.cpp | 14 ++++- .../values/juce_ValueTree.h | 9 +-- .../processors/juce_StateVariableFilter.h | 22 +++---- .../messages/juce_ApplicationBase.h | 2 +- .../messages/juce_Initialisation.h | 2 +- .../juce_MountedVolumeListChangeDetector.h | 2 +- modules/juce_graphics/fonts/juce_Font.h | 9 +-- .../geometry/juce_AffineTransform.cpp | 2 +- .../geometry/juce_AffineTransform.h | 13 ++-- .../juce_graphics/geometry/juce_Rectangle.h | 4 +- modules/juce_graphics/images/juce_Image.cpp | 15 ++++- modules/juce_graphics/images/juce_Image.h | 10 +-- modules/juce_gui_basics/buttons/juce_Button.h | 7 ++- .../juce_gui_basics/buttons/juce_TextButton.h | 7 +-- .../commands/juce_ApplicationCommandManager.h | 6 -- .../components/juce_Component.h | 23 ++----- .../juce_gui_basics/desktop/juce_Displays.h | 13 ++-- .../juce_gui_basics/menus/juce_PopupMenu.h | 11 ++-- .../mouse/juce_DragAndDropContainer.h | 7 --- .../mouse/juce_MouseInputSource.h | 14 +++-- .../juce_gui_basics/widgets/juce_ComboBox.h | 11 ++-- .../juce_gui_basics/widgets/juce_ListBox.h | 14 ++--- modules/juce_gui_basics/widgets/juce_Slider.h | 29 ++++----- .../widgets/juce_TableListBox.h | 6 -- .../juce_gui_basics/widgets/juce_TreeView.h | 5 -- .../windows/juce_AlertWindow.h | 11 ++-- .../windows/juce_ResizableWindow.h | 22 ++++--- .../windows/juce_TooltipWindow.h | 5 -- .../juce_gui_extra/misc/juce_ColourSelector.h | 6 -- .../misc/juce_LiveConstantEditor.h | 2 +- .../misc/juce_SystemTrayIconComponent.h | 7 +-- modules/juce_opengl/juce_opengl.h | 2 +- .../native/juce_OpenGLExtensions.h | 13 ++-- .../in_app_purchases/juce_InAppPurchases.h | 28 +++++---- .../marketplace/juce_OnlineUnlockStatus.cpp | 4 +- .../juce_video/capture/juce_CameraDevice.h | 1 - 104 files changed, 579 insertions(+), 587 deletions(-) diff --git a/examples/Assets/DSPDemos_Common.h b/examples/Assets/DSPDemos_Common.h index 5fb76707e9..07a2bd7c58 100644 --- a/examples/Assets/DSPDemos_Common.h +++ b/examples/Assets/DSPDemos_Common.h @@ -418,7 +418,7 @@ public: #endif { if (newReader == nullptr) - newReader = formatManager.createReaderFor (fileToPlay.createInputStream (false)); + newReader = formatManager.createReaderFor (fileToPlay.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress))); } reader.reset (newReader); diff --git a/examples/Audio/AudioPlaybackDemo.h b/examples/Audio/AudioPlaybackDemo.h index deeb4673a6..e62dc93c59 100644 --- a/examples/Audio/AudioPlaybackDemo.h +++ b/examples/Audio/AudioPlaybackDemo.h @@ -456,7 +456,7 @@ private: #endif { if (reader == nullptr) - reader = formatManager.createReaderFor (audioURL.createInputStream (false)); + reader = formatManager.createReaderFor (audioURL.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress))); } if (reader != nullptr) diff --git a/examples/DSP/SIMDRegisterDemo.h b/examples/DSP/SIMDRegisterDemo.h index 3bf5e8a8cb..cf613fcbb0 100644 --- a/examples/DSP/SIMDRegisterDemo.h +++ b/examples/DSP/SIMDRegisterDemo.h @@ -80,26 +80,26 @@ struct SIMDRegisterDemoDSP auto& input = context.getInputBlock(); auto& output = context.getOutputBlock(); - auto n = input.getNumSamples(); + auto n = (int) input.getNumSamples(); auto* inout = channelPointers.getData(); - for (size_t ch = 0; ch < SIMDRegister::size(); ++ch) inout[ch] = (ch < input.getNumChannels() ? const_cast (input.getChannelPointer (ch)) : zero.getChannelPointer (ch)); - AudioDataConverters::interleaveSamples (inout, reinterpret_cast (interleaved.getChannelPointer (0)), - static_cast (n), static_cast (SIMDRegister::size())); + using DstSampleType = AudioData::Pointer; + using SrcSampleType = AudioData::Pointer; + DstSampleType dstData (interleaved.getChannelPointer (0), (int) interleaved.getNumChannels()); + SrcSampleType srcData (inout); + + dstData.convertSamples (srcData, n); iir->process (ProcessContextReplacing> (interleaved)); - for (size_t ch = 0; ch < input.getNumChannels(); ++ch) inout[ch] = output.getChannelPointer (ch); - AudioDataConverters::deinterleaveSamples (reinterpret_cast (interleaved.getChannelPointer (0)), - const_cast (inout), - static_cast (n), static_cast (SIMDRegister::size())); + srcData.convertSamples (dstData, n); } void reset() diff --git a/examples/Utilities/NetworkingDemo.h b/examples/Utilities/NetworkingDemo.h index 3677e4619b..03d3851aa5 100644 --- a/examples/Utilities/NetworkingDemo.h +++ b/examples/Utilities/NetworkingDemo.h @@ -103,9 +103,10 @@ public: StringPairArray responseHeaders; int statusCode = 0; - if (auto stream = std::unique_ptr (url.createInputStream (false, nullptr, nullptr, {}, - 10000, // timeout in millisecs - &responseHeaders, &statusCode))) + if (auto stream = url.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress) + .withConnectionTimeoutMs(10000) + .withResponseHeaders (&responseHeaders) + .withStatusCode (&statusCode))) { return (statusCode != 0 ? "Status code: " + String (statusCode) + newLine : String()) + "Response headers: " + newLine diff --git a/extras/AudioPluginHost/Source/Plugins/InternalPlugins.cpp b/extras/AudioPluginHost/Source/Plugins/InternalPlugins.cpp index 7c167ce559..654a4f4d5b 100644 --- a/extras/AudioPluginHost/Source/Plugins/InternalPlugins.cpp +++ b/extras/AudioPluginHost/Source/Plugins/InternalPlugins.cpp @@ -232,7 +232,7 @@ private: double cyclesPerSecond = MidiMessage::getMidiNoteInHertz (midiNoteNumber); double cyclesPerSample = cyclesPerSecond / getSampleRate(); - angleDelta = cyclesPerSample * 2.0 * double_Pi; + angleDelta = cyclesPerSample * 2.0 * MathConstants::pi; } void stopNote (float /*velocity*/, bool allowTailOff) override diff --git a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp index b6e7ee8343..42c872f911 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp +++ b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.cpp @@ -23,6 +23,9 @@ namespace juce { +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + void AudioDataConverters::convertFloatToInt16LE (const float* source, void* dest, int numSamples, int destBytesPerSample) { auto maxVal = (double) 0x7fff; @@ -595,4 +598,7 @@ static AudioConversionTests audioConversionUnitTests; #endif +JUCE_END_IGNORE_WARNINGS_MSVC +JUCE_END_IGNORE_WARNINGS_GCC_LIKE + } // namespace juce diff --git a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h index 64ad8ec47e..43fd6a1bf4 100644 --- a/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h +++ b/modules/juce_audio_basics/buffers/juce_AudioDataConverters.h @@ -644,6 +644,8 @@ public: //============================================================================== +#ifndef DOXYGEN + /** A set of routines to convert buffers of 32-bit floating point data to and from various integer formats. @@ -653,7 +655,7 @@ public: @tags{Audio} */ -class JUCE_API AudioDataConverters +class [[deprecated]] JUCE_API AudioDataConverters { public: //============================================================================== @@ -710,7 +712,8 @@ public: private: AudioDataConverters(); - JUCE_DECLARE_NON_COPYABLE (AudioDataConverters) }; +#endif + } // namespace juce diff --git a/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp b/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp index 1636f73b90..dfdf41eee4 100644 --- a/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp +++ b/modules/juce_audio_basics/midi/juce_MidiBuffer.cpp @@ -209,13 +209,14 @@ MidiBufferIterator MidiBuffer::findNextSamplePosition (int samplePosition) const } //============================================================================== +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + MidiBuffer::Iterator::Iterator (const MidiBuffer& b) noexcept : buffer (b), iterator (b.data.begin()) { } -MidiBuffer::Iterator::~Iterator() noexcept {} - void MidiBuffer::Iterator::setNextSamplePosition (int samplePosition) noexcept { iterator = buffer.findNextSamplePosition (samplePosition); @@ -244,6 +245,9 @@ bool MidiBuffer::Iterator::getNextEvent (MidiMessage& result, int& samplePositio return true; } +JUCE_END_IGNORE_WARNINGS_MSVC +JUCE_END_IGNORE_WARNINGS_GCC_LIKE + //============================================================================== //============================================================================== #if JUCE_UNIT_TESTS diff --git a/modules/juce_audio_basics/midi/juce_MidiBuffer.h b/modules/juce_audio_basics/midi/juce_MidiBuffer.h index 4cf927250f..583c93efb8 100644 --- a/modules/juce_audio_basics/midi/juce_MidiBuffer.h +++ b/modules/juce_audio_basics/midi/juce_MidiBuffer.h @@ -273,7 +273,9 @@ public: MidiBufferIterator findNextSamplePosition (int samplePosition) const noexcept; //============================================================================== - /** + #ifndef DOXYGEN + /** This class is now deprecated in favour of MidiBufferIterator. + Used to iterate through the events in a MidiBuffer. Note that altering the buffer while an iterator is using it will produce @@ -281,20 +283,12 @@ public: @see MidiBuffer */ - class JUCE_API Iterator + class [[deprecated]] JUCE_API Iterator { public: //============================================================================== - /** Creates an Iterator for this MidiBuffer. - This class has been deprecated in favour of MidiBufferIterator. - */ - JUCE_DEPRECATED (Iterator (const MidiBuffer&) noexcept); - - /** Creates a copy of an iterator. */ - Iterator (const Iterator&) = default; - - /** Destructor. */ - ~Iterator() noexcept; + /** Creates an Iterator for this MidiBuffer. */ + Iterator (const MidiBuffer& b) noexcept; //============================================================================== /** Repositions the iterator so that the next event retrieved will be the first @@ -336,6 +330,7 @@ public: const MidiBuffer& buffer; MidiBufferIterator iterator; }; + #endif /** The raw data holding this buffer. Obviously access to this data is provided at your own risk. Its internal format could diff --git a/modules/juce_audio_basics/midi/juce_MidiMessage.h b/modules/juce_audio_basics/midi/juce_MidiMessage.h index 1ab4afb984..0384f553c7 100644 --- a/modules/juce_audio_basics/midi/juce_MidiMessage.h +++ b/modules/juce_audio_basics/midi/juce_MidiMessage.h @@ -857,17 +857,16 @@ public: //============================================================================== + #ifndef DOXYGEN /** Reads a midi variable-length integer. - This signature has been deprecated in favour of the safer - readVariableLengthValue. - The `data` argument indicates the data to read the number from, and `numBytesUsed` is used as an out-parameter to indicate the number of bytes that were read. */ - JUCE_DEPRECATED (static int readVariableLengthVal (const uint8* data, - int& numBytesUsed) noexcept); + [[deprecated ("This signature has been deprecated in favour of the safer readVariableLengthValue.")]] + static int readVariableLengthVal (const uint8* data, int& numBytesUsed) noexcept; + #endif /** Holds information about a variable-length value which was parsed from a stream of bytes. diff --git a/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h b/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h index ac5ce32da2..11168fb6e3 100644 --- a/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h +++ b/modules/juce_audio_basics/native/juce_mac_CoreAudioLayouts.h @@ -23,7 +23,7 @@ namespace juce { -#if ! DOXYGEN && (JUCE_MAC || JUCE_IOS) +#if ! defined (DOXYGEN) && (JUCE_MAC || JUCE_IOS) struct CoreAudioLayouts { diff --git a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h index aa8e33ab14..53d6900682 100644 --- a/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h +++ b/modules/juce_audio_basics/synthesisers/juce_Synthesiser.h @@ -631,14 +631,6 @@ private: template void processNextBlock (AudioBuffer&, const MidiBuffer&, int startSample, int numSamples); - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // Note the new parameters for these methods. - virtual int findFreeVoice (const bool) const { return 0; } - virtual int noteOff (int, int, int) { return 0; } - virtual int findFreeVoice (SynthesiserSound*, const bool) { return 0; } - virtual int findVoiceToSteal (SynthesiserSound*) const { return 0; } - #endif - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Synthesiser) }; diff --git a/modules/juce_audio_basics/utilities/juce_SmoothedValue.h b/modules/juce_audio_basics/utilities/juce_SmoothedValue.h index 36682c6842..5ee6cd6510 100644 --- a/modules/juce_audio_basics/utilities/juce_SmoothedValue.h +++ b/modules/juce_audio_basics/utilities/juce_SmoothedValue.h @@ -330,9 +330,8 @@ public: } //============================================================================== - /** THIS FUNCTION IS DEPRECATED. - - Use `setTargetValue (float)` and `setCurrentAndTargetValue()` instead: + #ifndef DOXYGEN + /** Using the new methods: lsv.setValue (x, false); -> lsv.setTargetValue (x); lsv.setValue (x, true); -> lsv.setCurrentAndTargetValue (x); @@ -340,7 +339,8 @@ public: @param newValue The new target value @param force If true, the value will be set immediately, bypassing the ramp */ - JUCE_DEPRECATED_WITH_BODY (void setValue (FloatType newValue, bool force = false) noexcept, + [[deprecated ("Use setTargetValue and setCurrentAndTargetValue instead.")]] + void setValue (FloatType newValue, bool force = false) noexcept { if (force) { @@ -349,7 +349,8 @@ public: } setTargetValue (newValue); - }) + } + #endif private: //============================================================================== diff --git a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h index 293e9ca6d9..28b9df01b1 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h +++ b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.h @@ -471,18 +471,20 @@ public: int getXRunCount() const noexcept; //============================================================================== - /** Deprecated. */ + #ifndef DOXYGEN + [[deprecated ("Use setMidiInputDeviceEnabled instead.")]] void setMidiInputEnabled (const String&, bool); - /** Deprecated. */ + [[deprecated ("Use isMidiInputDeviceEnabled instead.")]] bool isMidiInputEnabled (const String&) const; - /** Deprecated. */ + [[deprecated ("Use addMidiInputDeviceCallback instead.")]] void addMidiInputCallback (const String&, MidiInputCallback*); - /** Deprecated. */ + [[deprecated ("Use removeMidiInputDeviceCallback instead.")]] void removeMidiInputCallback (const String&, MidiInputCallback*); - /** Deprecated. */ + [[deprecated ("Use setDefaultMidiOutputDevice instead.")]] void setDefaultMidiOutput (const String&); - /** Deprecated. */ + [[deprecated ("Use getDefaultMidiOutputIdentifier instead.")]] const String& getDefaultMidiOutputName() const noexcept { return defaultMidiOutputDeviceInfo.name; } + #endif private: //============================================================================== diff --git a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h index 683d038a68..6015bc2b7e 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h +++ b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.h @@ -167,8 +167,10 @@ public: /** Creates a Bela device type if it's available on this platform, or returns null. */ static AudioIODeviceType* createAudioIODeviceType_Bela(); - /** This method has been deprecated. You should call the method which takes a WASAPIDeviceMode instead. */ - JUCE_DEPRECATED (static AudioIODeviceType* createAudioIODeviceType_WASAPI (bool exclusiveMode)); + #ifndef DOXYGEN + [[deprecated ("You should call the method which takes a WASAPIDeviceMode instead.")]] + static AudioIODeviceType* createAudioIODeviceType_WASAPI (bool exclusiveMode); + #endif protected: explicit AudioIODeviceType (const String& typeName); diff --git a/modules/juce_audio_devices/midi_io/juce_MidiDevices.h b/modules/juce_audio_devices/midi_io/juce_MidiDevices.h index 3a5f48bc80..d30de65698 100644 --- a/modules/juce_audio_devices/midi_io/juce_MidiDevices.h +++ b/modules/juce_audio_devices/midi_io/juce_MidiDevices.h @@ -157,12 +157,14 @@ public: void setName (const String& newName) noexcept { deviceInfo.name = newName; } //============================================================================== - /** Deprecated. */ + #ifndef DOXYGEN + [[deprecated ("Use getAvailableDevices instead.")]] static StringArray getDevices(); - /** Deprecated. */ + [[deprecated ("Use getDefaultDevice instead.")]] static int getDefaultDeviceIndex(); - /** Deprecated. */ + [[deprecated ("Use openDevice that takes a device identifier instead.")]] static std::unique_ptr openDevice (int, MidiInputCallback*); + #endif /** @internal */ class Pimpl; @@ -347,12 +349,14 @@ public: bool isBackgroundThreadRunning() const noexcept { return isThreadRunning(); } //============================================================================== - /** Deprecated. */ + #ifndef DOXYGEN + [[deprecated ("Use getAvailableDevices instead.")]] static StringArray getDevices(); - /** Deprecated. */ + [[deprecated ("Use getDefaultDevice instead.")]] static int getDefaultDeviceIndex(); - /** Deprecated. */ + [[deprecated ("Use openDevice that takes a device identifier instead.")]] static std::unique_ptr openDevice (int); + #endif /** @internal */ class Pimpl; diff --git a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h index d39465c0d4..258efca27e 100644 --- a/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_FlacAudioFormat.h @@ -26,7 +26,7 @@ namespace juce { -#if JUCE_USE_FLAC || defined (DOXYGEN) +#if JUCE_USE_FLAC || DOXYGEN //============================================================================== /** diff --git a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h index 68b3fa13ad..c0c08c5543 100644 --- a/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_LAMEEncoderAudioFormat.h @@ -26,7 +26,7 @@ namespace juce { -#if JUCE_USE_LAME_AUDIO_FORMAT || defined (DOXYGEN) +#if JUCE_USE_LAME_AUDIO_FORMAT || DOXYGEN //============================================================================== /** diff --git a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h index db4786d2f1..1e82d4572c 100644 --- a/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h +++ b/modules/juce_audio_formats/codecs/juce_OggVorbisAudioFormat.h @@ -26,7 +26,7 @@ namespace juce { -#if JUCE_USE_OGGVORBIS || defined (DOXYGEN) +#if JUCE_USE_OGGVORBIS || DOXYGEN //============================================================================== /** diff --git a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp index 7836bf1179..702ed46d4d 100644 --- a/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/RTAS/juce_RTAS_Wrapper.cpp @@ -162,15 +162,15 @@ class JucePlugInProcess : public CEffectProcessMIDI, { public: //============================================================================== - // RTAS builds will be removed from JUCE in the next release - JUCE_DEPRECATED_WITH_BODY (JucePlugInProcess(), + [[deprecated ("RTAS builds will be removed from JUCE in the next release.")]] + JucePlugInProcess() { juceFilter.reset (createPluginFilterOfType (AudioProcessor::wrapperType_RTAS)); AddChunk (juceChunkType, "Juce Audio Plugin Data"); ++numInstances; - }) + } ~JucePlugInProcess() { diff --git a/modules/juce_audio_processors/format_types/juce_AU_Shared.h b/modules/juce_audio_processors/format_types/juce_AU_Shared.h index 86f33b1fe2..0025af7037 100644 --- a/modules/juce_audio_processors/format_types/juce_AU_Shared.h +++ b/modules/juce_audio_processors/format_types/juce_AU_Shared.h @@ -549,6 +549,6 @@ struct AudioUnitHelpers } }; -#endif // ! DOXYGEN +#endif } // namespace juce diff --git a/modules/juce_audio_processors/format_types/juce_VST3Common.h b/modules/juce_audio_processors/format_types/juce_VST3Common.h index 4e9e6851ea..c832670659 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3Common.h +++ b/modules/juce_audio_processors/format_types/juce_VST3Common.h @@ -23,7 +23,7 @@ ============================================================================== */ -#if ! DOXYGEN +#ifndef DOXYGEN namespace juce { @@ -1225,4 +1225,4 @@ JUCE_END_NO_SANITIZE } // namespace juce -#endif // ! DOXYGEN +#endif diff --git a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h index 88ebeba29b..9c2be59493 100644 --- a/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h +++ b/modules/juce_audio_processors/format_types/juce_VST3PluginFormat.h @@ -43,16 +43,17 @@ public: ~VST3PluginFormat() override; //============================================================================== - /** Instead of using this function, use AudioPluginInstance::getExtensions() - to visit the ExtensionsVisitor::VST3 struct for the instance, if it exists. - Then, call ExtensionsVisitor::VST3::setPreset() to set the state using the - contents of a vstpreset file. - - Attempts to reload a VST3 plugin's state from some preset file data. + #ifndef DOXYGEN + /** Attempts to reload a VST3 plugin's state from some preset file data. @see VSTPluginFormat::loadFromFXBFile */ - JUCE_DEPRECATED (static bool setStateFromVSTPresetFile (AudioPluginInstance*, const MemoryBlock&)); + [[deprecated ("Instead of using this function, use AudioPluginInstance::getExtensions() " + "to visit the ExtensionsVisitor::VST3 struct for the instance, if it exists. " + "Then, call ExtensionsVisitor::VST3::setPreset() to set the state using the " + "contents of a vstpreset file.")]] + static bool setStateFromVSTPresetFile (AudioPluginInstance*, const MemoryBlock&); + #endif //============================================================================== static String getFormatName() { return "VST3"; } diff --git a/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h b/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h index 260a604ac4..e89efd08ce 100644 --- a/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h +++ b/modules/juce_audio_processors/processors/juce_AudioPluginInstance.h @@ -125,13 +125,15 @@ public: */ HostedParameter* getHostedParameter (int index) const; + #ifndef DOXYGEN /** Use the new typesafe visitor-based interface rather than this function. Returns a pointer to some kind of platform-specific data about the plugin. E.g. For a VST, this value can be cast to an AEffect*. For an AudioUnit, it can be cast to an AudioUnit handle. */ - JUCE_DEPRECATED (virtual void* getPlatformSpecificData()); + [[deprecated ("Use the new typesafe visitor-based interface rather than this function.")]] + virtual void* getPlatformSpecificData(); // Rather than using these methods you should call the corresponding methods // on the AudioProcessorParameter objects returned from getParameters(). @@ -140,21 +142,22 @@ public: // // In addition to being marked as deprecated these methods will assert on // the first call. - JUCE_DEPRECATED (String getParameterID (int index) override); - JUCE_DEPRECATED (float getParameter (int parameterIndex) override); - JUCE_DEPRECATED (void setParameter (int parameterIndex, float newValue) override); - JUCE_DEPRECATED (const String getParameterName (int parameterIndex) override); - JUCE_DEPRECATED (String getParameterName (int parameterIndex, int maximumStringLength) override); - JUCE_DEPRECATED (const String getParameterText (int parameterIndex) override); - JUCE_DEPRECATED (String getParameterText (int parameterIndex, int maximumStringLength) override); - JUCE_DEPRECATED (int getParameterNumSteps (int parameterIndex) override); - JUCE_DEPRECATED (bool isParameterDiscrete (int parameterIndex) const override); - JUCE_DEPRECATED (bool isParameterAutomatable (int parameterIndex) const override); - JUCE_DEPRECATED (float getParameterDefaultValue (int parameterIndex) override); - JUCE_DEPRECATED (String getParameterLabel (int parameterIndex) const override); - JUCE_DEPRECATED (bool isParameterOrientationInverted (int parameterIndex) const override); - JUCE_DEPRECATED (bool isMetaParameter (int parameterIndex) const override); - JUCE_DEPRECATED (AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const override); + [[deprecated]] String getParameterID (int index) override; + [[deprecated]] float getParameter (int parameterIndex) override; + [[deprecated]] void setParameter (int parameterIndex, float newValue) override; + [[deprecated]] const String getParameterName (int parameterIndex) override; + [[deprecated]] String getParameterName (int parameterIndex, int maximumStringLength) override; + [[deprecated]] const String getParameterText (int parameterIndex) override; + [[deprecated]] String getParameterText (int parameterIndex, int maximumStringLength) override; + [[deprecated]] int getParameterNumSteps (int parameterIndex) override; + [[deprecated]] bool isParameterDiscrete (int parameterIndex) const override; + [[deprecated]] bool isParameterAutomatable (int parameterIndex) const override; + [[deprecated]] float getParameterDefaultValue (int parameterIndex) override; + [[deprecated]] String getParameterLabel (int parameterIndex) const override; + [[deprecated]] bool isParameterOrientationInverted (int parameterIndex) const override; + [[deprecated]] bool isMetaParameter (int parameterIndex) const override; + [[deprecated]] AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const override; + #endif protected: //============================================================================== diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessor.h b/modules/juce_audio_processors/processors/juce_AudioProcessor.h index 07f68c8402..edb9ccf06d 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessor.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessor.h @@ -1378,41 +1378,40 @@ protected: /** @internal */ void sendParamChangeMessageToListeners (int parameterIndex, float newValue); - //============================================================================== - #ifndef DOXYGEN public: + #ifndef DOXYGEN // These methods are all deprecated in favour of using AudioProcessorParameter // and AudioProcessorParameterGroup - JUCE_DEPRECATED (virtual int getNumParameters()); - JUCE_DEPRECATED (virtual const String getParameterName (int parameterIndex)); - JUCE_DEPRECATED (virtual String getParameterID (int index)); - JUCE_DEPRECATED (virtual float getParameter (int parameterIndex)); - JUCE_DEPRECATED (virtual String getParameterName (int parameterIndex, int maximumStringLength)); - JUCE_DEPRECATED (virtual const String getParameterText (int parameterIndex)); - JUCE_DEPRECATED (virtual String getParameterText (int parameterIndex, int maximumStringLength)); - JUCE_DEPRECATED (virtual int getParameterNumSteps (int parameterIndex)); - JUCE_DEPRECATED (virtual bool isParameterDiscrete (int parameterIndex) const); - JUCE_DEPRECATED (virtual float getParameterDefaultValue (int parameterIndex)); - JUCE_DEPRECATED (virtual String getParameterLabel (int index) const); - JUCE_DEPRECATED (virtual bool isParameterOrientationInverted (int index) const); - JUCE_DEPRECATED (virtual void setParameter (int parameterIndex, float newValue)); - JUCE_DEPRECATED (virtual bool isParameterAutomatable (int parameterIndex) const); - JUCE_DEPRECATED (virtual bool isMetaParameter (int parameterIndex) const); - JUCE_DEPRECATED (virtual AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const); - JUCE_DEPRECATED (void beginParameterChangeGesture (int parameterIndex)); - JUCE_DEPRECATED (void endParameterChangeGesture (int parameterIndex)); - JUCE_DEPRECATED (void setParameterNotifyingHost (int parameterIndex, float newValue)); + [[deprecated]] virtual int getNumParameters(); + [[deprecated]] virtual const String getParameterName (int parameterIndex); + [[deprecated]] virtual String getParameterID (int index); + [[deprecated]] virtual float getParameter (int parameterIndex); + [[deprecated]] virtual String getParameterName (int parameterIndex, int maximumStringLength); + [[deprecated]] virtual const String getParameterText (int parameterIndex); + [[deprecated]] virtual String getParameterText (int parameterIndex, int maximumStringLength); + [[deprecated]] virtual int getParameterNumSteps (int parameterIndex); + [[deprecated]] virtual bool isParameterDiscrete (int parameterIndex) const; + [[deprecated]] virtual float getParameterDefaultValue (int parameterIndex); + [[deprecated]] virtual String getParameterLabel (int index) const; + [[deprecated]] virtual bool isParameterOrientationInverted (int index) const; + [[deprecated]] virtual void setParameter (int parameterIndex, float newValue); + [[deprecated]] virtual bool isParameterAutomatable (int parameterIndex) const; + [[deprecated]] virtual bool isMetaParameter (int parameterIndex) const; + [[deprecated]] virtual AudioProcessorParameter::Category getParameterCategory (int parameterIndex) const; + [[deprecated]] void beginParameterChangeGesture (int parameterIndex); + [[deprecated]] void endParameterChangeGesture (int parameterIndex); + [[deprecated]] void setParameterNotifyingHost (int parameterIndex, float newValue); // These functions are deprecated: your audio processor can inform the host // on its bus and channel layouts and names using the AudioChannelSet and various bus classes. - JUCE_DEPRECATED_WITH_BODY (int getNumInputChannels() const noexcept, { return getTotalNumInputChannels(); }) - JUCE_DEPRECATED_WITH_BODY (int getNumOutputChannels() const noexcept, { return getTotalNumOutputChannels(); }) - JUCE_DEPRECATED_WITH_BODY (const String getInputSpeakerArrangement() const noexcept, { return cachedInputSpeakerArrString; }) - JUCE_DEPRECATED_WITH_BODY (const String getOutputSpeakerArrangement() const noexcept, { return cachedOutputSpeakerArrString; }) - JUCE_DEPRECATED (virtual const String getInputChannelName (int channelIndex) const); - JUCE_DEPRECATED (virtual const String getOutputChannelName (int channelIndex) const); - JUCE_DEPRECATED (virtual bool isInputChannelStereoPair (int index) const); - JUCE_DEPRECATED (virtual bool isOutputChannelStereoPair (int index) const); + [[deprecated]] int getNumInputChannels() const noexcept { return getTotalNumInputChannels(); } + [[deprecated]] int getNumOutputChannels() const noexcept { return getTotalNumOutputChannels(); } + [[deprecated]] const String getInputSpeakerArrangement() const noexcept { return cachedInputSpeakerArrString; } + [[deprecated]] const String getOutputSpeakerArrangement() const noexcept { return cachedOutputSpeakerArrString; } + [[deprecated]] virtual const String getInputChannelName (int channelIndex) const; + [[deprecated]] virtual const String getOutputChannelName (int channelIndex) const; + [[deprecated]] virtual bool isInputChannelStereoPair (int index) const; + [[deprecated]] virtual bool isOutputChannelStereoPair (int index) const; #endif private: @@ -1511,8 +1510,8 @@ private: friend class AudioProcessorParameter; friend class LADSPAPluginInstance; - // This method is no longer used - you can delete it from your AudioProcessor classes. - JUCE_DEPRECATED_WITH_BODY (virtual bool silenceInProducesSilenceOut() const, { return false; }) + [[deprecated ("This method is no longer used - you can delete it from your AudioProcessor classes.")]] + virtual bool silenceInProducesSilenceOut() const { return false; } JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AudioProcessor) }; diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorParameterGroup.h b/modules/juce_audio_processors/processors/juce_AudioProcessorParameterGroup.h index 7f26bb4f7a..46ae9225a1 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorParameterGroup.h +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorParameterGroup.h @@ -227,11 +227,11 @@ public: } #ifndef DOXYGEN - // This class now has a move operator, so if you're trying to move them around, you - // should use that, or if you really need to swap two groups, just call std::swap. - // However, remember that swapping a group that's already owned by an AudioProcessor - // will most likely crash the host, so don't do that. - JUCE_DEPRECATED_WITH_BODY (void swapWith (AudioProcessorParameterGroup& other), { std::swap (*this, other); }) + [[deprecated ("This class now has a move operator, so if you're trying to move them around, you " + "should use that, or if you really need to swap two groups, just call std::swap. " + "However, remember that swapping a group that's already owned by an AudioProcessor " + "will most likely crash the host, so don't do that.")]] + void swapWith (AudioProcessorParameterGroup& other) { std::swap (*this, other); } #endif private: diff --git a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h index b56216e0b1..ce003b193b 100644 --- a/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h +++ b/modules/juce_audio_processors/processors/juce_GenericAudioProcessorEditor.h @@ -49,8 +49,10 @@ public: void paint (Graphics&) override; void resized() override; - // This constructor has been changed to take a reference instead of a pointer - JUCE_DEPRECATED_WITH_BODY (GenericAudioProcessorEditor (AudioProcessor* p), : GenericAudioProcessorEditor (*p) {}) + #ifndef DOXYGEN + [[deprecated ("This constructor has been changed to take a reference instead of a pointer.")]] + GenericAudioProcessorEditor (AudioProcessor* p) : GenericAudioProcessorEditor (*p) {} + #endif private: //============================================================================== diff --git a/modules/juce_audio_processors/scanning/juce_KnownPluginList.h b/modules/juce_audio_processors/scanning/juce_KnownPluginList.h index 9d9106a58e..b6e48120f4 100644 --- a/modules/juce_audio_processors/scanning/juce_KnownPluginList.h +++ b/modules/juce_audio_processors/scanning/juce_KnownPluginList.h @@ -209,21 +209,23 @@ public: void setCustomScanner (std::unique_ptr newScanner); //============================================================================== + #ifndef DOXYGEN // These methods have been deprecated! When getting the list of plugin types you should instead use // the getTypes() method which returns a copy of the internal PluginDescription array and can be accessed // in a thread-safe way. - JUCE_DEPRECATED_WITH_BODY (PluginDescription* getType (int index) noexcept, { return &types.getReference (index); }) - JUCE_DEPRECATED_WITH_BODY (const PluginDescription* getType (int index) const noexcept, { return &types.getReference (index); }) - JUCE_DEPRECATED_WITH_BODY (PluginDescription** begin() noexcept, { jassertfalse; return nullptr; }) - JUCE_DEPRECATED_WITH_BODY (PluginDescription* const* begin() const noexcept, { jassertfalse; return nullptr; }) - JUCE_DEPRECATED_WITH_BODY (PluginDescription** end() noexcept, { jassertfalse; return nullptr; }) - JUCE_DEPRECATED_WITH_BODY (PluginDescription* const* end() const noexcept, { jassertfalse; return nullptr; }) + [[deprecated]] PluginDescription* getType (int index) noexcept { return &types.getReference (index); } + [[deprecated]] const PluginDescription* getType (int index) const noexcept { return &types.getReference (index); } + [[deprecated]] PluginDescription** begin() noexcept { jassertfalse; return nullptr; } + [[deprecated]] PluginDescription* const* begin() const noexcept { jassertfalse; return nullptr; } + [[deprecated]] PluginDescription** end() noexcept { jassertfalse; return nullptr; } + [[deprecated]] PluginDescription* const* end() const noexcept { jassertfalse; return nullptr; } // These methods have been deprecated in favour of their static counterparts. You should call getTypes() // to store the plug-in list at a point in time and use it when calling these methods. - JUCE_DEPRECATED (void addToMenu (PopupMenu& menu, SortMethod sortMethod, const String& currentlyTickedPluginID = {}) const); - JUCE_DEPRECATED (int getIndexChosenByMenu (int menuResultCode) const); - JUCE_DEPRECATED (std::unique_ptr createTree (const SortMethod sortMethod) const); + [[deprecated]] void addToMenu (PopupMenu& menu, SortMethod sortMethod, const String& currentlyTickedPluginID = {}) const; + [[deprecated]] int getIndexChosenByMenu (int menuResultCode) const; + [[deprecated]] std::unique_ptr createTree (const SortMethod sortMethod) const; + #endif private: //============================================================================== diff --git a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h index 156e3ea002..e9b9999927 100644 --- a/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h +++ b/modules/juce_audio_processors/utilities/juce_AudioProcessorValueTreeState.h @@ -222,9 +222,8 @@ public: ~AudioProcessorValueTreeState() override; //============================================================================== - /** This function is deprecated and will be removed in a future version of JUCE! - - Previous calls to + #ifndef DOXYGEN + /** Previous calls to @code createAndAddParameter (paramID1, paramName1, ...); @@ -256,18 +255,21 @@ public: Calling this will create and add a special type of AudioProcessorParameter to the AudioProcessor to which this state is attached. */ - JUCE_DEPRECATED (RangedAudioParameter* createAndAddParameter (const String& parameterID, - const String& parameterName, - const String& labelText, - NormalisableRange valueRange, - float defaultValue, - std::function valueToTextFunction, - std::function textToValueFunction, - bool isMetaParameter = false, - bool isAutomatableParameter = true, - bool isDiscrete = false, - AudioProcessorParameter::Category parameterCategory = AudioProcessorParameter::genericParameter, - bool isBoolean = false)); + [[deprecated ("This function is deprecated and will be removed in a future version of JUCE! " + "See the method docs for a code example of the replacement methods.")]] + RangedAudioParameter* createAndAddParameter (const String& parameterID, + const String& parameterName, + const String& labelText, + NormalisableRange valueRange, + float defaultValue, + std::function valueToTextFunction, + std::function textToValueFunction, + bool isMetaParameter = false, + bool isAutomatableParameter = true, + bool isDiscrete = false, + AudioProcessorParameter::Category parameterCategory = AudioProcessorParameter::genericParameter, + bool isBoolean = false); + #endif /** This function adds a parameter to the attached AudioProcessor and that parameter will be managed by this AudioProcessorValueTreeState object. @@ -499,18 +501,18 @@ public: private: //============================================================================== - /** This method was introduced to allow you to use AudioProcessorValueTreeState parameters in - an AudioProcessorParameterGroup, but there is now a much nicer way to achieve this. + /** Code that looks like this: - Code that looks like this @code auto paramA = apvts.createParameter ("a", "Parameter A", {}, { -100, 100 }, ...); auto paramB = apvts.createParameter ("b", "Parameter B", {}, { 0, 5 }, ...); addParameterGroup (std::make_unique ("g1", "Group 1", " | ", std::move (paramA), std::move (paramB))); apvts.state = ValueTree (Identifier ("PARAMETERS")); @endcode + can instead create the APVTS like this, avoiding the two-step initialization process and leveraging one of JUCE's - pre-built parameter types (or your own custom type derived from RangedAudioParameter) + pre-built parameter types (or your own custom type derived from RangedAudioParameter): + @code using Parameter = AudioProcessorValueTreeState::Parameter; YourAudioProcessor() @@ -520,9 +522,12 @@ private: std::make_unique ("b", "Parameter B", "", NormalisableRange (0, 5), ...)) }) @endcode */ - JUCE_DEPRECATED (std::unique_ptr createParameter (const String&, const String&, const String&, NormalisableRange, - float, std::function, std::function, - bool, bool, bool, AudioProcessorParameter::Category, bool)); + [[deprecated ("This method was introduced to allow you to use AudioProcessorValueTreeState parameters in " + "an AudioProcessorParameterGroup, but there is now a much nicer way to achieve this. See the " + "method docs for a code example.")]] + std::unique_ptr createParameter (const String&, const String&, const String&, NormalisableRange, + float, std::function, std::function, + bool, bool, bool, AudioProcessorParameter::Category, bool); //============================================================================== #if JUCE_UNIT_TESTS diff --git a/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h b/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h index 8d7d30e829..11ec80462f 100644 --- a/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h +++ b/modules/juce_audio_utils/audio_cd/juce_AudioCDReader.h @@ -28,7 +28,6 @@ namespace juce #if JUCE_USE_CDREADER || DOXYGEN - //============================================================================== /** A type of AudioFormatReader that reads from an audio CD. diff --git a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h index 0eb799fbfd..c76f489d22 100644 --- a/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h +++ b/modules/juce_audio_utils/gui/juce_MidiKeyboardComponent.h @@ -433,13 +433,6 @@ private: void repaintNote (int midiNoteNumber); void setLowestVisibleKeyFloat (float noteNumber); - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // Note that the parameters for these method have changed - virtual int getKeyPosition (int, float, int&, int&) const { return 0; } - virtual int drawWhiteNote (int, Graphics&, int, int, int, int, bool, bool, const Colour&, const Colour&) { return 0; } - virtual int drawBlackNote (int, Graphics&, int, int, int, int, bool, bool, const Colour&) { return 0; } - #endif - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (MidiKeyboardComponent) }; diff --git a/modules/juce_core/containers/juce_Array.h b/modules/juce_core/containers/juce_Array.h index 64013f11db..0692a15978 100644 --- a/modules/juce_core/containers/juce_Array.h +++ b/modules/juce_core/containers/juce_Array.h @@ -1125,9 +1125,9 @@ public: //============================================================================== #ifndef DOXYGEN - // Note that the swapWithArray method has been replaced by a more flexible templated version, - // and renamed "swapWith" to be more consistent with the names used in other classes. - JUCE_DEPRECATED_WITH_BODY (void swapWithArray (Array& other) noexcept, { swapWith (other); }) + [[deprecated ("This method has been replaced by a more flexible templated version and renamed " + "to swapWith to be more consistent with the names used in other classes.")]] + void swapWithArray (Array& other) noexcept { swapWith (other); } #endif private: diff --git a/modules/juce_core/containers/juce_DynamicObject.h b/modules/juce_core/containers/juce_DynamicObject.h index debc5d450b..df68c5295a 100644 --- a/modules/juce_core/containers/juce_DynamicObject.h +++ b/modules/juce_core/containers/juce_DynamicObject.h @@ -121,11 +121,6 @@ private: //============================================================================== NamedValueSet properties; - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // This method has been deprecated - use var::invoke instead - virtual void invokeMethod (const Identifier&, const var*, int) {} - #endif - JUCE_LEAK_DETECTOR (DynamicObject) }; diff --git a/modules/juce_core/containers/juce_OwnedArray.h b/modules/juce_core/containers/juce_OwnedArray.h index 166a737074..85c2c9c4a3 100644 --- a/modules/juce_core/containers/juce_OwnedArray.h +++ b/modules/juce_core/containers/juce_OwnedArray.h @@ -843,9 +843,9 @@ public: //============================================================================== #ifndef DOXYGEN - // Note that the swapWithArray method has been replaced by a more flexible templated version, - // and renamed "swapWith" to be more consistent with the names used in other classes. - JUCE_DEPRECATED_WITH_BODY (void swapWithArray (OwnedArray& other) noexcept, { swapWith (other); }) + [[deprecated ("This method has been replaced by a more flexible templated version and renamed " + "to swapWith to be more consistent with the names used in other classes.")]] + void swapWithArray (OwnedArray& other) noexcept { swapWith (other); } #endif private: diff --git a/modules/juce_core/containers/juce_ReferenceCountedArray.h b/modules/juce_core/containers/juce_ReferenceCountedArray.h index 13fa55d336..f6e90900ed 100644 --- a/modules/juce_core/containers/juce_ReferenceCountedArray.h +++ b/modules/juce_core/containers/juce_ReferenceCountedArray.h @@ -876,9 +876,9 @@ public: //============================================================================== #ifndef DOXYGEN - // Note that the swapWithArray method has been replaced by a more flexible templated version, - // and renamed "swapWith" to be more consistent with the names used in other classes. - JUCE_DEPRECATED_WITH_BODY (void swapWithArray (ReferenceCountedArray& other) noexcept, { swapWith (other); }) + [[deprecated ("This method has been replaced by a more flexible templated version and renamed " + "to swapWith to be more consistent with the names used in other classes.")]] + void swapWithArray (ReferenceCountedArray& other) noexcept { swapWith (other); } #endif private: diff --git a/modules/juce_core/containers/juce_Variant.cpp b/modules/juce_core/containers/juce_Variant.cpp index dbb57b288d..e714dec715 100644 --- a/modules/juce_core/containers/juce_Variant.cpp +++ b/modules/juce_core/containers/juce_Variant.cpp @@ -510,8 +510,6 @@ var::var() noexcept : type (&Instance::attributesVoid) {} var::var (const VariantType& t) noexcept : type (&t) {} var::~var() noexcept { type->cleanUp (value); } -JUCE_DECLARE_DEPRECATED_STATIC (const var var::null;) - //============================================================================== var::var (const var& valueToCopy) : type (valueToCopy.type) { @@ -895,4 +893,17 @@ var::NativeFunctionArgs::NativeFunctionArgs (const var& t, const var* args, int { } +//============================================================================== +#if JUCE_ALLOW_STATIC_NULL_VARIABLES + +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + +const var var::null; + +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC + +#endif + } // namespace juce diff --git a/modules/juce_core/containers/juce_Variant.h b/modules/juce_core/containers/juce_Variant.h index e5a933fdf9..27324ea6f2 100644 --- a/modules/juce_core/containers/juce_Variant.h +++ b/modules/juce_core/containers/juce_Variant.h @@ -271,15 +271,14 @@ public: */ static var readFromStream (InputStream& input); - /* This was a static empty var object, but is now deprecated as it's too easy to accidentally - use it indirectly during a static constructor, leading to hard-to-find order-of-initialisation - problems. - @deprecated If you need a default-constructed var, just use var() or {}. - The only time you might miss having var::null available might be if you need to return an - empty var from a function by reference, but if you need to do that, it's easy enough to use - a function-local static var and return that, avoiding any order-of-initialisation issues. - */ - JUCE_DEPRECATED_STATIC (static const var null;) + //============================================================================== + #if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN) + [[deprecated ("This was a static empty var object, but is now deprecated as it's too easy to accidentally " + "use it indirectly during a static constructor leading to hard-to-find order-of-initialisation " + "problems. Use var() or {} instead. For returning an empty var from a function by reference, " + "use a function-local static var and return that.")]] + static const var null; + #endif private: //============================================================================== diff --git a/modules/juce_core/files/juce_DirectoryIterator.cpp b/modules/juce_core/files/juce_DirectoryIterator.cpp index 37452e8c76..767a3ac480 100644 --- a/modules/juce_core/files/juce_DirectoryIterator.cpp +++ b/modules/juce_core/files/juce_DirectoryIterator.cpp @@ -23,24 +23,6 @@ namespace juce { -DirectoryIterator::DirectoryIterator (const File& directory, bool recursive, - const String& pattern, int type) - : wildCards (parseWildcards (pattern)), - fileFinder (directory, (recursive || wildCards.size() > 1) ? "*" : pattern), - wildCard (pattern), - path (File::addTrailingSeparator (directory.getFullPathName())), - whatToLookFor (type), - isRecursive (recursive) -{ - // you have to specify the type of files you're looking for! - jassert ((type & (File::findFiles | File::findDirectories)) != 0); - jassert (type > 0 && type <= 7); -} - -DirectoryIterator::~DirectoryIterator() -{ -} - StringArray DirectoryIterator::parseWildcards (const String& pattern) { StringArray s; diff --git a/modules/juce_core/files/juce_DirectoryIterator.h b/modules/juce_core/files/juce_DirectoryIterator.h index 0988306eaf..8b99b3bfe2 100644 --- a/modules/juce_core/files/juce_DirectoryIterator.h +++ b/modules/juce_core/files/juce_DirectoryIterator.h @@ -23,6 +23,8 @@ namespace juce { +#ifndef DOXYGEN + //============================================================================== /** This class is now deprecated in favour of RangedDirectoryIterator. @@ -50,9 +52,7 @@ class JUCE_API DirectoryIterator final { public: //============================================================================== - /** This class is now deprecated in favour of RangedDirectoryIterator. - - Creates a DirectoryIterator for a given directory. + /** Creates a DirectoryIterator for a given directory. After creating one of these, call its next() method to get the first file - e.g. @code @@ -69,13 +69,22 @@ public: @see RangedDirectoryIterator */ - JUCE_DEPRECATED (DirectoryIterator (const File& directory, - bool isRecursive, - const String& wildCard = "*", - int whatToLookFor = File::findFiles)); - - /** Destructor. */ - ~DirectoryIterator(); + [[deprecated ("This class is now deprecated in favour of RangedDirectoryIterator.")]] + DirectoryIterator (const File& directory, + bool recursive, + const String& pattern = "*", + int type = File::findFiles) + : wildCards (parseWildcards (pattern)), + fileFinder (directory, (recursive || wildCards.size() > 1) ? "*" : pattern), + wildCard (pattern), + path (File::addTrailingSeparator (directory.getFullPathName())), + whatToLookFor (type), + isRecursive (recursive) + { + // you have to specify the type of files you're looking for! + jassert ((whatToLookFor & (File::findFiles | File::findDirectories)) != 0); + jassert (whatToLookFor > 0 && whatToLookFor <= 7); + } /** Moves the iterator along to the next file. @@ -150,4 +159,6 @@ private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectoryIterator) }; +#endif + } // namespace juce diff --git a/modules/juce_core/files/juce_File.cpp b/modules/juce_core/files/juce_File.cpp index f0b416ed31..e17e57633f 100644 --- a/modules/juce_core/files/juce_File.cpp +++ b/modules/juce_core/files/juce_File.cpp @@ -63,8 +63,6 @@ File& File::operator= (File&& other) noexcept return *this; } -JUCE_DECLARE_DEPRECATED_STATIC (const File File::nonexistent{};) - //============================================================================== static String removeEllipsis (const String& path) { @@ -1009,6 +1007,19 @@ File File::getLinkedTarget() const } #endif +//============================================================================== +#if JUCE_ALLOW_STATIC_NULL_VARIABLES + +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + +const File File::nonexistent{}; + +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC + +#endif + //============================================================================== MemoryMappedFile::MemoryMappedFile (const File& file, MemoryMappedFile::AccessMode mode, bool exclusive) : range (0, file.getSize()) diff --git a/modules/juce_core/files/juce_File.h b/modules/juce_core/files/juce_File.h index 9c7cf115ff..ac38105ea6 100644 --- a/modules/juce_core/files/juce_File.h +++ b/modules/juce_core/files/juce_File.h @@ -20,7 +20,7 @@ ============================================================================== */ -#if ! DOXYGEN && (JUCE_MAC || JUCE_IOS) +#if ! defined (DOXYGEN) && (JUCE_MAC || JUCE_IOS) #if __LP64__ using OSType = unsigned int; #else @@ -1106,14 +1106,16 @@ public: bool foldersFirst; }; + #if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN) /* These static objects are deprecated because it's too easy to accidentally use them indirectly during a static constructor, which leads to very obscure order-of-initialisation bugs. Use File::getSeparatorChar() and File::getSeparatorString(), and instead of File::nonexistent, just use File() or {}. */ - JUCE_DEPRECATED_STATIC (static const juce_wchar separator;) - JUCE_DEPRECATED_STATIC (static const StringRef separatorString;) - JUCE_DEPRECATED_STATIC (static const File nonexistent;) + [[deprecated]] static const juce_wchar separator; + [[deprecated]] static const StringRef separatorString; + [[deprecated]] static const File nonexistent; + #endif private: //============================================================================== diff --git a/modules/juce_core/files/juce_RangedDirectoryIterator.cpp b/modules/juce_core/files/juce_RangedDirectoryIterator.cpp index 43eac299ab..cbf3dbd618 100644 --- a/modules/juce_core/files/juce_RangedDirectoryIterator.cpp +++ b/modules/juce_core/files/juce_RangedDirectoryIterator.cpp @@ -23,6 +23,9 @@ namespace juce { +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + float DirectoryEntry::getEstimatedProgress() const { if (auto it = iterator.lock()) @@ -31,9 +34,6 @@ float DirectoryEntry::getEstimatedProgress() const return 0.0f; } -JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") -JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) - // We implement this in terms of the deprecated DirectoryIterator, // but the old DirectoryIterator might go away in the future! RangedDirectoryIterator::RangedDirectoryIterator (const File& directory, @@ -49,9 +49,6 @@ RangedDirectoryIterator::RangedDirectoryIterator (const File& directory, increment(); } -JUCE_END_IGNORE_WARNINGS_GCC_LIKE -JUCE_END_IGNORE_WARNINGS_MSVC - bool RangedDirectoryIterator::next() { const auto result = iterator->next (&entry.directory, @@ -74,4 +71,7 @@ void RangedDirectoryIterator::increment() iterator = nullptr; } +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC + } // namespace juce diff --git a/modules/juce_core/files/juce_RangedDirectoryIterator.h b/modules/juce_core/files/juce_RangedDirectoryIterator.h index 416217f7f6..0c2ba66454 100644 --- a/modules/juce_core/files/juce_RangedDirectoryIterator.h +++ b/modules/juce_core/files/juce_RangedDirectoryIterator.h @@ -24,6 +24,9 @@ namespace juce { //============================================================================== +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + /** Describes the attributes of a file or folder. @@ -178,4 +181,8 @@ inline RangedDirectoryIterator begin (const RangedDirectoryIterator& it) { retur */ inline RangedDirectoryIterator end (const RangedDirectoryIterator&) { return {}; } + +JUCE_END_IGNORE_WARNINGS_MSVC +JUCE_END_IGNORE_WARNINGS_GCC_LIKE + } // namespace juce diff --git a/modules/juce_core/maths/juce_MathsFunctions.h b/modules/juce_core/maths/juce_MathsFunctions.h index 58ee199968..e74e5487d1 100644 --- a/modules/juce_core/maths/juce_MathsFunctions.h +++ b/modules/juce_core/maths/juce_MathsFunctions.h @@ -395,18 +395,12 @@ struct MathConstants }; #ifndef DOXYGEN -/** A double-precision constant for pi. - @deprecated This is deprecated in favour of MathConstants::pi. - The reason is that "double_Pi" was a confusing name, and many people misused it, - wrongly thinking it meant 2 * pi ! -*/ +/** A double-precision constant for pi. */ +[[deprecated ("This is deprecated in favour of MathConstants::pi.")]] const constexpr double double_Pi = MathConstants::pi; -/** A single-precision constant for pi. - @deprecated This is deprecated in favour of MathConstants::pi. - The reason is that "double_Pi" was a confusing name, and many people misused it, - wrongly thinking it meant 2 * pi ! -*/ +/** A single-precision constant for pi. */ +[[deprecated ("This is deprecated in favour of MathConstants::pi.")]] const constexpr float float_Pi = MathConstants::pi; #endif @@ -609,7 +603,7 @@ uint32 readLittleEndianBitsInBuffer (const void* sourceBuffer, uint32 startBit, //============================================================================== -#if JUCE_INTEL || defined (DOXYGEN) +#if JUCE_INTEL || DOXYGEN /** This macro can be applied to a float variable to check whether it contains a denormalised value, and to normalise it if necessary. On CPUs that aren't vulnerable to denormalisation problems, this will have no effect. @@ -637,7 +631,7 @@ namespace TypeHelpers */ template struct ParameterType { using type = const Type&; }; - #if ! DOXYGEN + #ifndef DOXYGEN template struct ParameterType { using type = Type&; }; template struct ParameterType { using type = Type*; }; template <> struct ParameterType { using type = char; }; @@ -662,7 +656,7 @@ namespace TypeHelpers */ template struct SmallestFloatType { using type = float; }; - #if ! DOXYGEN + #ifndef DOXYGEN template <> struct SmallestFloatType { using type = double; }; #endif @@ -673,7 +667,7 @@ namespace TypeHelpers */ template struct UnsignedTypeWithSize {}; - #if ! DOXYGEN + #ifndef DOXYGEN template <> struct UnsignedTypeWithSize<1> { using type = uint8; }; template <> struct UnsignedTypeWithSize<2> { using type = uint16; }; template <> struct UnsignedTypeWithSize<4> { using type = uint32; }; @@ -682,13 +676,10 @@ namespace TypeHelpers } //============================================================================== -#if ! DOXYGEN - // These old functions are deprecated: Just use roundToInt instead. - JUCE_DEPRECATED_ATTRIBUTE inline int roundDoubleToInt (double value) noexcept { return roundToInt (value); } - JUCE_DEPRECATED_ATTRIBUTE inline int roundFloatToInt (float value) noexcept { return roundToInt (value); } - - // This old function isn't needed - just use std::abs() instead - JUCE_DEPRECATED_ATTRIBUTE inline int64 abs64 (int64 n) noexcept { return std::abs (n); } +#ifndef DOXYGEN + [[deprecated ("Use roundToInt instead.")]] inline int roundDoubleToInt (double value) noexcept { return roundToInt (value); } + [[deprecated ("Use roundToInt instead.")]] inline int roundFloatToInt (float value) noexcept { return roundToInt (value); } + [[deprecated ("Use std::abs() instead.")]] inline int64 abs64 (int64 n) noexcept { return std::abs (n); } #endif } // namespace juce diff --git a/modules/juce_core/memory/juce_Atomic.h b/modules/juce_core/memory/juce_Atomic.h index 9ef5c402ac..bf1d031579 100644 --- a/modules/juce_core/memory/juce_Atomic.h +++ b/modules/juce_core/memory/juce_Atomic.h @@ -136,10 +136,9 @@ struct Atomic final //============================================================================== #ifndef DOXYGEN - /* This method has been deprecated as there is no equivalent method in - std::atomic. Use compareAndSetBool instead. - */ - JUCE_DEPRECATED (Type compareAndSetValue (Type, Type) noexcept); + [[deprecated ("This method has been deprecated as there is no equivalent method in " + "std::atomic. Use compareAndSetBool instead.")]] + Type compareAndSetValue (Type, Type) noexcept; #endif }; diff --git a/modules/juce_core/memory/juce_ByteOrder.h b/modules/juce_core/memory/juce_ByteOrder.h index 84ecad96b3..d1295b38b3 100644 --- a/modules/juce_core/memory/juce_ByteOrder.h +++ b/modules/juce_core/memory/juce_ByteOrder.h @@ -20,7 +20,7 @@ ============================================================================== */ -#if ! DOXYGEN && (JUCE_MAC || JUCE_IOS) +#if ! defined (DOXYGEN) && (JUCE_MAC || JUCE_IOS) #include #endif diff --git a/modules/juce_core/memory/juce_HeapBlock.h b/modules/juce_core/memory/juce_HeapBlock.h index 61a1493b32..41cfdebe11 100644 --- a/modules/juce_core/memory/juce_HeapBlock.h +++ b/modules/juce_core/memory/juce_HeapBlock.h @@ -23,7 +23,7 @@ namespace juce { -#if ! (defined (DOXYGEN) || JUCE_EXCEPTIONS_DISABLED) +#if ! (DOXYGEN || JUCE_EXCEPTIONS_DISABLED) namespace HeapBlockHelper { template diff --git a/modules/juce_core/memory/juce_MemoryBlock.h b/modules/juce_core/memory/juce_MemoryBlock.h index 359cd40eac..d42f8440c0 100644 --- a/modules/juce_core/memory/juce_MemoryBlock.h +++ b/modules/juce_core/memory/juce_MemoryBlock.h @@ -269,13 +269,14 @@ public: bool fromBase64Encoding (StringRef encodedString); //============================================================================== - // This method has been deprecated in favour of the replaceAll() method which will - // also replace the data when `numBytes == 0` - JUCE_DEPRECATED_WITH_BODY (void replaceWith (const void* srcData, size_t numBytes), + #ifndef DOXYGEN + [[deprecated ("Use the replaceAll method instead, which will also replace the data when numBytes == 0.")]] + void replaceWith (const void* srcData, size_t numBytes) { if (numBytes > 0) replaceAll (srcData, numBytes); - }) + } + #endif private: //============================================================================== diff --git a/modules/juce_core/memory/juce_ReferenceCountedObject.h b/modules/juce_core/memory/juce_ReferenceCountedObject.h index b4b01e33be..12c7aef893 100644 --- a/modules/juce_core/memory/juce_ReferenceCountedObject.h +++ b/modules/juce_core/memory/juce_ReferenceCountedObject.h @@ -428,9 +428,10 @@ public: operator ReferencedType*() const noexcept { return referencedObject; } #endif - - // This old method is deprecated in favour of the shorter and more standard get() method. - JUCE_DEPRECATED_WITH_BODY (ReferencedType* getObject() const, { return get(); }) + #ifndef DOXYGEN + [[deprecated ("Use the get method instead.")]] + ReferencedType* getObject() const { return get(); } + #endif private: //============================================================================== diff --git a/modules/juce_core/memory/juce_ScopedPointer.h b/modules/juce_core/memory/juce_ScopedPointer.h index aa030863d6..8d60f6d4ea 100644 --- a/modules/juce_core/memory/juce_ScopedPointer.h +++ b/modules/juce_core/memory/juce_ScopedPointer.h @@ -30,30 +30,28 @@ namespace juce This class is deprecated. You should use std::unique_ptr instead. */ template -class ScopedPointer +class [[deprecated]] ScopedPointer { public: //============================================================================== - // ScopedPointer is deprecated! You should use std::unique_ptr instead. - JUCE_DEPRECATED_ATTRIBUTE inline ScopedPointer() = default; + JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") + JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) - // ScopedPointer is deprecated! You should use std::unique_ptr instead. - JUCE_DEPRECATED_ATTRIBUTE inline ScopedPointer (decltype (nullptr)) noexcept {} + inline ScopedPointer() {} - // ScopedPointer is deprecated! You should use std::unique_ptr instead. - JUCE_DEPRECATED_ATTRIBUTE inline ScopedPointer (ObjectType* objectToTakePossessionOf) noexcept + inline ScopedPointer (decltype (nullptr)) noexcept {} + + inline ScopedPointer (ObjectType* objectToTakePossessionOf) noexcept : object (objectToTakePossessionOf) { } - // ScopedPointer is deprecated! You should use std::unique_ptr instead. ScopedPointer (ScopedPointer& objectToTransferFrom) noexcept : object (objectToTransferFrom.release()) { } - // ScopedPointer is deprecated! You should use std::unique_ptr instead. - JUCE_DEPRECATED_ATTRIBUTE inline ~ScopedPointer() { reset(); } + inline ~ScopedPointer() { reset(); } ScopedPointer& operator= (ScopedPointer& objectToTransferFrom) { @@ -143,9 +141,15 @@ private: ScopedPointer (const ScopedPointer&) = delete; ScopedPointer& operator= (const ScopedPointer&) = delete; #endif + + JUCE_END_IGNORE_WARNINGS_MSVC + JUCE_END_IGNORE_WARNINGS_GCC_LIKE }; //============================================================================== +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + template bool operator== (ObjectType1* pointer1, const ScopedPointer& pointer2) noexcept { @@ -212,6 +216,9 @@ template void deleteAndZero (ScopedPointer&) { static_assert (sizeof (Type) == 12345, "Attempt to call deleteAndZero() on a ScopedPointer"); } +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC + } // namespace juce #endif diff --git a/modules/juce_core/misc/juce_Uuid.h b/modules/juce_core/misc/juce_Uuid.h index cb36c84ba4..99cddd193d 100644 --- a/modules/juce_core/misc/juce_Uuid.h +++ b/modules/juce_core/misc/juce_Uuid.h @@ -136,7 +136,7 @@ private: } // namespace juce -#if ! DOXYGEN +#ifndef DOXYGEN namespace std { template <> struct hash diff --git a/modules/juce_core/misc/juce_WindowsRegistry.h b/modules/juce_core/misc/juce_WindowsRegistry.h index c8d955efbd..121bf617fd 100644 --- a/modules/juce_core/misc/juce_WindowsRegistry.h +++ b/modules/juce_core/misc/juce_WindowsRegistry.h @@ -123,10 +123,12 @@ public: bool registerForCurrentUserOnly, WoW64Mode mode = WoW64_Default); + #ifndef DOXYGEN // DEPRECATED: use the other methods with a WoW64Mode parameter of WoW64_64bit instead. - JUCE_DEPRECATED (static String getValueWow64 (const String&, const String& defaultValue = String())); - JUCE_DEPRECATED (static bool valueExistsWow64 (const String&)); - JUCE_DEPRECATED (static bool keyExistsWow64 (const String&)); + [[deprecated]] static String getValueWow64 (const String&, const String& defaultValue = String()); + [[deprecated]] static bool valueExistsWow64 (const String&); + [[deprecated]] static bool keyExistsWow64 (const String&); + #endif private: WindowsRegistry() = delete; diff --git a/modules/juce_core/native/juce_posix_SharedCode.h b/modules/juce_core/native/juce_posix_SharedCode.h index ac7c1990af..59f9a30eeb 100644 --- a/modules/juce_core/native/juce_posix_SharedCode.h +++ b/modules/juce_core/native/juce_posix_SharedCode.h @@ -99,8 +99,16 @@ static MaxNumFileHandlesInitialiser maxNumFileHandlesInitialiser; #endif //============================================================================== -JUCE_DECLARE_DEPRECATED_STATIC (const juce_wchar File::separator = '/';) -JUCE_DECLARE_DEPRECATED_STATIC (const StringRef File::separatorString ("/");) +#if JUCE_ALLOW_STATIC_NULL_VARIABLES + +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") + +const juce_wchar File::separator = '/'; +const StringRef File::separatorString ("/"); + +JUCE_END_IGNORE_WARNINGS_GCC_LIKE + +#endif juce_wchar File::getSeparatorChar() { return '/'; } StringRef File::getSeparatorString() { return "/"; } diff --git a/modules/juce_core/native/juce_win32_Files.cpp b/modules/juce_core/native/juce_win32_Files.cpp index 4451355101..6e7754878e 100644 --- a/modules/juce_core/native/juce_win32_Files.cpp +++ b/modules/juce_core/native/juce_win32_Files.cpp @@ -162,8 +162,16 @@ namespace WindowsFileHelpers } //============================================================================== -JUCE_DECLARE_DEPRECATED_STATIC (const juce_wchar File::separator = '\\';) -JUCE_DECLARE_DEPRECATED_STATIC (const StringRef File::separatorString ("\\");) +#if JUCE_ALLOW_STATIC_NULL_VARIABLES + +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + +const juce_wchar File::separator = '\\'; +const StringRef File::separatorString ("\\"); + +JUCE_END_IGNORE_WARNINGS_MSVC + +#endif juce_wchar File::getSeparatorChar() { return '\\'; } StringRef File::getSeparatorString() { return "\\"; } diff --git a/modules/juce_core/network/juce_URL.h b/modules/juce_core/network/juce_URL.h index c72a22a34b..2623bb977a 100644 --- a/modules/juce_core/network/juce_URL.h +++ b/modules/juce_core/network/juce_URL.h @@ -659,14 +659,14 @@ public: static URL createWithoutParsing (const String& url); //============================================================================== + #ifndef DOXYGEN using OpenStreamProgressCallback = bool (void* context, int bytesSent, int totalBytes); /** This method has been deprecated. - New code should use the method which takes an InputStreamOptions argument instead. - @see InputStreamOptions */ + [[deprecated ("New code should use the method which takes an InputStreamOptions argument instead.")]] std::unique_ptr createInputStream (bool doPostLikeRequest, OpenStreamProgressCallback* progressCallback = nullptr, void* progressCallbackContext = nullptr, @@ -676,6 +676,7 @@ public: int* statusCode = nullptr, int numRedirectsToFollow = 5, String httpRequestCmd = {}) const; + #endif private: //============================================================================== diff --git a/modules/juce_core/streams/juce_URLInputSource.cpp b/modules/juce_core/streams/juce_URLInputSource.cpp index 07768f0828..1f9017b601 100644 --- a/modules/juce_core/streams/juce_URLInputSource.cpp +++ b/modules/juce_core/streams/juce_URLInputSource.cpp @@ -39,7 +39,7 @@ URLInputSource::~URLInputSource() InputStream* URLInputSource::createInputStream() { - return u.createInputStream (false).release(); + return u.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)).release(); } InputStream* URLInputSource::createInputStreamFor (const String& relatedItemPath) @@ -48,7 +48,10 @@ InputStream* URLInputSource::createInputStreamFor (const String& relatedItemPath auto parent = sub.containsChar (L'/') ? sub.upToLastOccurrenceOf ("/", false, false) : String (); - return u.withNewSubPath (parent).getChildURL (relatedItemPath).createInputStream (false).release(); + return u.withNewSubPath (parent) + .getChildURL (relatedItemPath) + .createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress)) + .release(); } int64 URLInputSource::hashCode() const diff --git a/modules/juce_core/system/juce_CompilerSupport.h b/modules/juce_core/system/juce_CompilerSupport.h index 4a65c76276..72e889a8ac 100644 --- a/modules/juce_core/system/juce_CompilerSupport.h +++ b/modules/juce_core/system/juce_CompilerSupport.h @@ -92,7 +92,7 @@ #endif //============================================================================== -#if ! DOXYGEN +#ifndef DOXYGEN // These are old flags that are now supported on all compatible build targets #define JUCE_COMPILER_SUPPORTS_OVERRIDE_AND_FINAL 1 #define JUCE_COMPILER_SUPPORTS_VARIADIC_TEMPLATES 1 diff --git a/modules/juce_core/system/juce_PlatformDefs.h b/modules/juce_core/system/juce_PlatformDefs.h index 5fee628625..8da365521f 100644 --- a/modules/juce_core/system/juce_PlatformDefs.h +++ b/modules/juce_core/system/juce_PlatformDefs.h @@ -117,7 +117,7 @@ namespace juce #endif //============================================================================== -#if JUCE_MSVC && ! DOXYGEN +#if JUCE_MSVC && ! defined (DOXYGEN) #define JUCE_BLOCK_WITH_FORCED_SEMICOLON(x) \ __pragma(warning(push)) \ __pragma(warning(disable:4127)) \ @@ -187,7 +187,7 @@ namespace juce #endif //============================================================================== -#if ! DOXYGEN +#ifndef DOXYGEN #define JUCE_JOIN_MACRO_HELPER(a, b) a ## b #define JUCE_STRINGIFY_MACRO_HELPER(a) #a #endif @@ -298,49 +298,7 @@ namespace juce #endif //============================================================================== -// Cross-compiler deprecation macros.. -#ifdef DOXYGEN - /** This macro can be used to wrap a function which has been deprecated. */ - #define JUCE_DEPRECATED(functionDef) - #define JUCE_DEPRECATED_WITH_BODY(functionDef, body) -#elif JUCE_MSVC && ! JUCE_NO_DEPRECATION_WARNINGS - #define JUCE_DEPRECATED_ATTRIBUTE __declspec(deprecated) - #define JUCE_DEPRECATED(functionDef) JUCE_DEPRECATED_ATTRIBUTE functionDef - #define JUCE_DEPRECATED_WITH_BODY(functionDef, body) JUCE_DEPRECATED_ATTRIBUTE functionDef body -#elif (JUCE_GCC || JUCE_CLANG) && ! JUCE_NO_DEPRECATION_WARNINGS - #define JUCE_DEPRECATED_ATTRIBUTE __attribute__ ((deprecated)) - #define JUCE_DEPRECATED(functionDef) functionDef JUCE_DEPRECATED_ATTRIBUTE - #define JUCE_DEPRECATED_WITH_BODY(functionDef, body) functionDef JUCE_DEPRECATED_ATTRIBUTE body -#else - #define JUCE_DEPRECATED_ATTRIBUTE - #define JUCE_DEPRECATED(functionDef) functionDef - #define JUCE_DEPRECATED_WITH_BODY(functionDef, body) functionDef body -#endif - -#if JUCE_ALLOW_STATIC_NULL_VARIABLES - #if ! (defined (DOXYGEN) || defined (JUCE_GCC) || (JUCE_MSVC && _MSC_VER <= 1900)) - #define JUCE_DEPRECATED_STATIC(valueDef) JUCE_DEPRECATED_ATTRIBUTE valueDef - - #if JUCE_MSVC - #define JUCE_DECLARE_DEPRECATED_STATIC(valueDef) \ - __pragma(warning(push)) \ - __pragma(warning(disable:4996)) \ - valueDef \ - __pragma(warning(pop)) - #else - #define JUCE_DECLARE_DEPRECATED_STATIC(valueDef) valueDef - #endif - #else - #define JUCE_DEPRECATED_STATIC(valueDef) valueDef - #define JUCE_DECLARE_DEPRECATED_STATIC(valueDef) valueDef - #endif -#else - #define JUCE_DEPRECATED_STATIC(valueDef) - #define JUCE_DECLARE_DEPRECATED_STATIC(valueDef) -#endif - -//============================================================================== -#if JUCE_ANDROID && ! DOXYGEN +#if JUCE_ANDROID && ! defined (DOXYGEN) #define JUCE_MODAL_LOOPS_PERMITTED 0 #elif ! defined (JUCE_MODAL_LOOPS_PERMITTED) /** Some operating environments don't provide a modal loop mechanism, so this flag can be @@ -351,7 +309,7 @@ namespace juce //============================================================================== #if JUCE_GCC || JUCE_CLANG #define JUCE_PACKED __attribute__((packed)) -#elif ! DOXYGEN +#elif ! defined (DOXYGEN) #define JUCE_PACKED #endif diff --git a/modules/juce_core/system/juce_StandardHeader.h b/modules/juce_core/system/juce_StandardHeader.h index 21b9d2b0de..bb48373b24 100644 --- a/modules/juce_core/system/juce_StandardHeader.h +++ b/modules/juce_core/system/juce_StandardHeader.h @@ -153,13 +153,6 @@ JUCE_END_IGNORE_WARNINGS_MSVC /** This macro is added to all JUCE public function declarations. */ #define JUCE_PUBLIC_FUNCTION JUCE_API JUCE_CALLTYPE -#if (! defined (JUCE_CATCH_DEPRECATED_CODE_MISUSE)) && JUCE_DEBUG && ! DOXYGEN - /** This turns on some non-essential bits of code that should prevent old code from compiling - in cases where method signatures have changed, etc. - */ - #define JUCE_CATCH_DEPRECATED_CODE_MISUSE 1 -#endif - #ifndef DOXYGEN #define JUCE_NAMESPACE juce // This old macro is deprecated: you should just use the juce namespace directly. #endif diff --git a/modules/juce_core/system/juce_SystemStats.h b/modules/juce_core/system/juce_SystemStats.h index 788802f028..09ed101af8 100644 --- a/modules/juce_core/system/juce_SystemStats.h +++ b/modules/juce_core/system/juce_SystemStats.h @@ -234,8 +234,10 @@ public: //============================================================================== - // This method was spelt wrong! Please change your code to use getCpuSpeedInMegahertz() instead - JUCE_DEPRECATED_WITH_BODY (static int getCpuSpeedInMegaherz(), { return getCpuSpeedInMegahertz(); }) + #ifndef DOXYGEN + [[deprecated ("This method was spelt wrong! Please change your code to use getCpuSpeedInMegahertz instead.")]] + static int getCpuSpeedInMegaherz() { return getCpuSpeedInMegahertz(); } + #endif private: SystemStats() = delete; // uses only static methods diff --git a/modules/juce_core/text/juce_CharPointer_UTF16.h b/modules/juce_core/text/juce_CharPointer_UTF16.h index bf58ec0a47..d08f1c0a4b 100644 --- a/modules/juce_core/text/juce_CharPointer_UTF16.h +++ b/modules/juce_core/text/juce_CharPointer_UTF16.h @@ -344,7 +344,7 @@ public: return CharacterFunctions::compareIgnoreCaseUpTo (*this, other, maxChars); } - #if JUCE_MSVC && ! DOXYGEN + #if JUCE_MSVC && ! defined (DOXYGEN) int compareIgnoreCase (CharPointer_UTF16 other) const noexcept { return _wcsicmp (data, other.data); diff --git a/modules/juce_core/text/juce_CharacterFunctions.h b/modules/juce_core/text/juce_CharacterFunctions.h index cafe918e52..f5ddbb8f69 100644 --- a/modules/juce_core/text/juce_CharacterFunctions.h +++ b/modules/juce_core/text/juce_CharacterFunctions.h @@ -24,7 +24,7 @@ namespace juce { //============================================================================== -#if JUCE_WINDOWS && ! DOXYGEN +#if JUCE_WINDOWS && ! defined (DOXYGEN) #define JUCE_NATIVE_WCHAR_IS_UTF8 0 #define JUCE_NATIVE_WCHAR_IS_UTF16 1 #define JUCE_NATIVE_WCHAR_IS_UTF32 0 @@ -60,7 +60,7 @@ namespace juce #define T(stringLiteral) JUCE_T(stringLiteral) #endif -#if ! DOXYGEN +#ifndef DOXYGEN //============================================================================== // GNU libstdc++ does not have std::make_unsigned diff --git a/modules/juce_core/text/juce_String.cpp b/modules/juce_core/text/juce_String.cpp index 2f1b2aeed0..b98ae31dce 100644 --- a/modules/juce_core/text/juce_String.cpp +++ b/modules/juce_core/text/juce_String.cpp @@ -237,8 +237,6 @@ private: } }; -JUCE_DECLARE_DEPRECATED_STATIC (const String String::empty;) - //============================================================================== String::String() noexcept : text (&(emptyString.text)) { @@ -2195,7 +2193,6 @@ StringRef::StringRef (const String& string) noexcept : text (string.getCharPoi StringRef::StringRef (const std::string& string) : StringRef (string.c_str()) {} //============================================================================== - static String reduceLengthOfFloatString (const String& input) { const auto start = input.getCharPointer(); @@ -2309,6 +2306,18 @@ static String serialiseDouble (double input) return reduceLengthOfFloatString (String (input, numberOfDecimalPlaces)); } +//============================================================================== +#if JUCE_ALLOW_STATIC_NULL_VARIABLES + +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + +const String String::empty; + +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC + +#endif //============================================================================== //============================================================================== diff --git a/modules/juce_core/text/juce_String.h b/modules/juce_core/text/juce_String.h index ed833481f8..66f7e7c985 100644 --- a/modules/juce_core/text/juce_String.h +++ b/modules/juce_core/text/juce_String.h @@ -20,7 +20,7 @@ ============================================================================== */ -#if ! DOXYGEN && (JUCE_MAC || JUCE_IOS) +#if ! defined (DOXYGEN) && (JUCE_MAC || JUCE_IOS) // Annoyingly we can only forward-declare a typedef by forward-declaring the // aliased type #if __has_attribute(objc_bridge) @@ -1326,15 +1326,13 @@ public: int getReferenceCount() const noexcept; //============================================================================== - /* This was a static empty string object, but is now deprecated as it's too easy to accidentally - use it indirectly during a static constructor, leading to hard-to-find order-of-initialisation - problems. - @deprecated If you need an empty String object, just use String() or {}. - The only time you might miss having String::empty available might be if you need to return an - empty string from a function by reference, but if you need to do that, it's easy enough to use - a function-local static String object and return that, avoiding any order-of-initialisation issues. - */ - JUCE_DEPRECATED_STATIC (static const String empty;) + #if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN) + [[deprecated ("This was a static empty string object, but is now deprecated as it's too easy to accidentally " + "use it indirectly during a static constructor, leading to hard-to-find order-of-initialisation " + "problems. If you need an empty String object, just use String() or {}. For returning an empty " + "String from a function by reference, use a function-local static String object and return that.")]] + static const String empty; + #endif private: //============================================================================== @@ -1349,7 +1347,6 @@ private: explicit String (const PreallocationBytes&); // This constructor preallocates a certain amount of memory size_t getByteOffsetOfEnd() const noexcept; - JUCE_DEPRECATED (String (const String&, size_t)); // This private cast operator should prevent strings being accidentally cast // to bools (this is possible because the compiler can add an implicit cast @@ -1499,7 +1496,7 @@ JUCE_API OutputStream& JUCE_CALLTYPE operator<< (OutputStream& stream, StringRef } // namespace juce -#if ! DOXYGEN +#ifndef DOXYGEN namespace std { template <> struct hash diff --git a/modules/juce_core/threads/juce_Process.h b/modules/juce_core/threads/juce_Process.h index e4f92c8896..66ee79e075 100644 --- a/modules/juce_core/threads/juce_Process.h +++ b/modules/juce_core/threads/juce_Process.h @@ -106,8 +106,8 @@ public: const String& bodyText, const StringArray& filesToAttach); - #if JUCE_WINDOWS || DOXYGEN //============================================================================== + #if JUCE_WINDOWS || DOXYGEN /** WINDOWS ONLY - This returns the HINSTANCE of the current module. The return type is a void* to avoid being dependent on windows.h - just cast @@ -133,14 +133,14 @@ public: static void JUCE_CALLTYPE setCurrentModuleInstanceHandle (void* newHandle) noexcept; #endif - #if (JUCE_MAC && JUCE_MODULE_AVAILABLE_juce_gui_basics) || DOXYGEN //============================================================================== + #if (JUCE_MAC && JUCE_MODULE_AVAILABLE_juce_gui_basics) || DOXYGEN /** OSX ONLY - Shows or hides the OSX dock icon for this app. */ static void setDockIconVisible (bool isVisible); #endif - #if JUCE_MAC || JUCE_LINUX || JUCE_BSD || DOXYGEN //============================================================================== + #if JUCE_MAC || JUCE_LINUX || JUCE_BSD || DOXYGEN /** UNIX ONLY - Attempts to use setrlimit to change the maximum number of file handles that the app can open. Pass 0 or less as the parameter to mean 'infinite'. Returns true if it succeeds. diff --git a/modules/juce_core/threads/juce_Thread.h b/modules/juce_core/threads/juce_Thread.h index 1f39e1e519..5db90efcb9 100644 --- a/modules/juce_core/threads/juce_Thread.h +++ b/modules/juce_core/threads/juce_Thread.h @@ -338,7 +338,7 @@ public: */ static void JUCE_CALLTYPE setCurrentThreadName (const String& newThreadName); - #if JUCE_ANDROID || defined (DOXYGEN) + #if JUCE_ANDROID || DOXYGEN //============================================================================== /** Initialises the JUCE subsystem for projects not created by the Projucer diff --git a/modules/juce_core/xml/juce_XmlElement.h b/modules/juce_core/xml/juce_XmlElement.h index 7c01853e53..109ea384b4 100644 --- a/modules/juce_core/xml/juce_XmlElement.h +++ b/modules/juce_core/xml/juce_XmlElement.h @@ -732,33 +732,31 @@ public: return Iterator { getChildByName (name), name }; } - /** This allows us to trigger a warning inside deprecated macros. */ #ifndef DOXYGEN - JUCE_DEPRECATED_WITH_BODY (void macroBasedForLoop() const noexcept, {}) + [[deprecated]] void macroBasedForLoop() const noexcept {} + + [[deprecated ("This has been deprecated in favour of the toString method.")]] + String createDocument (StringRef dtdToUse, + bool allOnOneLine = false, + bool includeXmlHeader = true, + StringRef encodingType = "UTF-8", + int lineWrapLength = 60) const; + + [[deprecated ("This has been deprecated in favour of the writeTo method.")]] + void writeToStream (OutputStream& output, + StringRef dtdToUse, + bool allOnOneLine = false, + bool includeXmlHeader = true, + StringRef encodingType = "UTF-8", + int lineWrapLength = 60) const; + + [[deprecated ("This has been deprecated in favour of the writeTo method.")]] + bool writeToFile (const File& destinationFile, + StringRef dtdToUse, + StringRef encodingType = "UTF-8", + int lineWrapLength = 60) const; #endif - //============================================================================== - /** This has been deprecated in favour of the toString() method. */ - JUCE_DEPRECATED (String createDocument (StringRef dtdToUse, - bool allOnOneLine = false, - bool includeXmlHeader = true, - StringRef encodingType = "UTF-8", - int lineWrapLength = 60) const); - - /** This has been deprecated in favour of the writeTo() method. */ - JUCE_DEPRECATED (void writeToStream (OutputStream& output, - StringRef dtdToUse, - bool allOnOneLine = false, - bool includeXmlHeader = true, - StringRef encodingType = "UTF-8", - int lineWrapLength = 60) const); - - /** This has been deprecated in favour of the writeTo() method. */ - JUCE_DEPRECATED (bool writeToFile (const File& destinationFile, - StringRef dtdToUse, - StringRef encodingType = "UTF-8", - int lineWrapLength = 60) const); - private: //============================================================================== struct XmlAttributeNode @@ -801,6 +799,8 @@ private: }; //============================================================================== +#ifndef DOXYGEN + /** DEPRECATED: A handy macro to make it easy to iterate all the child elements in an XmlElement. New code should avoid this macro, and instead use getChildIterator directly. @@ -852,4 +852,6 @@ private: #define forEachXmlChildElementWithTagName(parentXmlElement, childElementVariableName, requiredTagName) \ for (auto* (childElementVariableName) : ((parentXmlElement).macroBasedForLoop(), (parentXmlElement).getChildWithTagNameIterator ((requiredTagName)))) +#endif + } // namespace juce diff --git a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h index 14edf85e3e..ae3b30f947 100644 --- a/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h +++ b/modules/juce_core/zip/juce_GZIPDecompressorInputStream.h @@ -92,11 +92,6 @@ private: class GZIPDecompressHelper; std::unique_ptr helper; - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // The arguments to this method have changed! Please pass a Format enum instead of the old dontWrap bool. - GZIPDecompressorInputStream (InputStream*, bool, bool, int64 x = -1); - #endif - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GZIPDecompressorInputStream) }; diff --git a/modules/juce_data_structures/values/juce_ValueTree.cpp b/modules/juce_data_structures/values/juce_ValueTree.cpp index 0d79f9e8dc..f55ddeb8bd 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.cpp +++ b/modules/juce_data_structures/values/juce_ValueTree.cpp @@ -579,8 +579,6 @@ ValueTree::ValueTree() noexcept { } -JUCE_DECLARE_DEPRECATED_STATIC (const ValueTree ValueTree::invalid;) - ValueTree::ValueTree (const Identifier& type) : object (new ValueTree::SharedObject (type)) { jassert (type.toString().isNotEmpty()); // All objects must be given a sensible type name! @@ -1097,6 +1095,18 @@ void ValueTree::Listener::valueTreeChildOrderChanged (ValueTree&, int, int) void ValueTree::Listener::valueTreeParentChanged (ValueTree&) {} void ValueTree::Listener::valueTreeRedirected (ValueTree&) {} +//============================================================================== +#if JUCE_ALLOW_STATIC_NULL_VARIABLES + +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + +const ValueTree ValueTree::invalid; + +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC + +#endif //============================================================================== //============================================================================== diff --git a/modules/juce_data_structures/values/juce_ValueTree.h b/modules/juce_data_structures/values/juce_ValueTree.h index 27e1826a96..ae4b7931d0 100644 --- a/modules/juce_data_structures/values/juce_ValueTree.h +++ b/modules/juce_data_structures/values/juce_ValueTree.h @@ -606,10 +606,11 @@ public: */ int getReferenceCount() const noexcept; - /* An invalid ValueTree that can be used if you need to return one as an error condition, etc. - @deprecated If you need an empty ValueTree object, just use ValueTree() or {}. - */ - JUCE_DEPRECATED_STATIC (static const ValueTree invalid;) + #if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN) + /* An invalid ValueTree that can be used if you need to return one as an error condition, etc. */ + [[deprecated ("If you need an empty ValueTree object, just use ValueTree() or {}.")]] + static const ValueTree invalid; + #endif private: //============================================================================== diff --git a/modules/juce_dsp/processors/juce_StateVariableFilter.h b/modules/juce_dsp/processors/juce_StateVariableFilter.h index c549763247..bf1645e153 100644 --- a/modules/juce_dsp/processors/juce_StateVariableFilter.h +++ b/modules/juce_dsp/processors/juce_StateVariableFilter.h @@ -70,19 +70,17 @@ namespace StateVariableFilter using ParametersPtr = typename Parameters::Ptr; //============================================================================== - /** Creates a filter with default parameters. + #ifndef DOXYGEN + /** Creates a filter with default parameters. */ + [[deprecated ("The classes in the StateVariableFilter namespace are deprecated. you should " + "use the equivalent functionality in the StateVariableTPTFilter class.")]] + Filter() : parameters (new Parameters) { reset(); } - The classes in the StateVariableFilter namespace are deprecated. you should - use the equivalent functionality in the StateVariableTPTFilter class. - */ - JUCE_DEPRECATED_WITH_BODY (Filter(), : parameters (new Parameters) { reset(); }) - - /** Creates a filter using some parameters. - - The classes in the StateVariableFilter namespace are deprecated. you should - use the equivalent functionality in the StateVariableTPTFilter class. - */ - JUCE_DEPRECATED_WITH_BODY (Filter (ParametersPtr parametersToUse), : parameters (std::move (parametersToUse)) { reset(); }) + /** Creates a filter using some parameters. */ + [[deprecated ("The classes in the StateVariableFilter namespace are deprecated. you should " + "use the equivalent functionality in the StateVariableTPTFilter class.")]] + Filter (ParametersPtr parametersToUse) : parameters (std::move (parametersToUse)) { reset(); } + #endif /** Creates a copy of another filter. */ Filter (const Filter&) = default; diff --git a/modules/juce_events/messages/juce_ApplicationBase.h b/modules/juce_events/messages/juce_ApplicationBase.h index db2531f35d..efb639d27b 100644 --- a/modules/juce_events/messages/juce_ApplicationBase.h +++ b/modules/juce_events/messages/juce_ApplicationBase.h @@ -309,7 +309,7 @@ private: //============================================================================== -#if JUCE_CATCH_UNHANDLED_EXCEPTIONS || defined (DOXYGEN) +#if JUCE_CATCH_UNHANDLED_EXCEPTIONS || DOXYGEN /** The JUCE_TRY/JUCE_CATCH_EXCEPTION wrappers can be used to pass any uncaught exceptions to the JUCEApplicationBase::sendUnhandledException() method. diff --git a/modules/juce_events/messages/juce_Initialisation.h b/modules/juce_events/messages/juce_Initialisation.h index bcfaf21e85..0ddd0508b1 100644 --- a/modules/juce_events/messages/juce_Initialisation.h +++ b/modules/juce_events/messages/juce_Initialisation.h @@ -84,7 +84,7 @@ public: See the JUCEApplication and JUCEApplicationBase class documentation for more details. */ -#ifdef DOXYGEN +#if DOXYGEN #define START_JUCE_APPLICATION(AppClass) #else #if JUCE_WINDOWS && ! defined (_CONSOLE) diff --git a/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h b/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h index 93f4f0020f..0c32696bc5 100644 --- a/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h +++ b/modules/juce_events/messages/juce_MountedVolumeListChangeDetector.h @@ -23,7 +23,7 @@ namespace juce { -#if JUCE_MAC || JUCE_WINDOWS || defined (DOXYGEN) +#if JUCE_MAC || JUCE_WINDOWS || DOXYGEN //============================================================================== /** diff --git a/modules/juce_graphics/fonts/juce_Font.h b/modules/juce_graphics/fonts/juce_Font.h index cb82613ce4..befd42f0ff 100644 --- a/modules/juce_graphics/fonts/juce_Font.h +++ b/modules/juce_graphics/fonts/juce_Font.h @@ -395,14 +395,15 @@ public: void getGlyphPositions (const String& text, Array& glyphs, Array& xOffsets) const; //============================================================================== - /** This is unsafe, use getTypefacePtr() instead. - - Returns the typeface used by this font. + #ifndef DOXYGEN + /** Returns the typeface used by this font. Note that the object returned may go out of scope if this font is deleted or has its style changed. */ - JUCE_DEPRECATED (Typeface* getTypeface() const); + [[deprecated ("This method is unsafe, use getTypefacePtr() instead.")]] + Typeface* getTypeface() const; + #endif /** Returns the typeface used by this font. */ Typeface::Ptr getTypefacePtr() const; diff --git a/modules/juce_graphics/geometry/juce_AffineTransform.cpp b/modules/juce_graphics/geometry/juce_AffineTransform.cpp index b70945ef02..86713c85b3 100644 --- a/modules/juce_graphics/geometry/juce_AffineTransform.cpp +++ b/modules/juce_graphics/geometry/juce_AffineTransform.cpp @@ -59,7 +59,7 @@ bool AffineTransform::isIdentity() const noexcept && mat11 == 1.0f; } -JUCE_DECLARE_DEPRECATED_STATIC (const AffineTransform AffineTransform::identity (1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);) +const AffineTransform AffineTransform::identity (1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f); //============================================================================== AffineTransform AffineTransform::followedBy (const AffineTransform& other) const noexcept diff --git a/modules/juce_graphics/geometry/juce_AffineTransform.h b/modules/juce_graphics/geometry/juce_AffineTransform.h index f37ff50655..56f2faac80 100644 --- a/modules/juce_graphics/geometry/juce_AffineTransform.h +++ b/modules/juce_graphics/geometry/juce_AffineTransform.h @@ -266,6 +266,8 @@ public: /** Returns the determinant of the transform. */ float getDeterminant() const noexcept; + //============================================================================== + #ifndef DOXYGEN /** This method has been deprecated. You can calculate the scale factor using: @@ -279,12 +281,13 @@ public: Obviously a length may be scaled by entirely different amounts depending on its direction, so this is only appropriate as a rough guide. */ - JUCE_DEPRECATED (float getScaleFactor() const noexcept); + [[deprecated ("This method produces incorrect values for transforms containing rotations. " + "See the method docs for a code example on how to calculate the correct scale factor.")]] + float getScaleFactor() const noexcept; - /* A ready-to-use identity transform - now deprecated. - @deprecated If you need an identity transform, just use AffineTransform() or {}. - */ - JUCE_DEPRECATED_STATIC (static const AffineTransform identity;) + [[deprecated ("If you need an identity transform, just use AffineTransform() or {}.")]] + static const AffineTransform identity; + #endif //============================================================================== /* The transform matrix is: diff --git a/modules/juce_graphics/geometry/juce_Rectangle.h b/modules/juce_graphics/geometry/juce_Rectangle.h index ac1fa8d329..357904d736 100644 --- a/modules/juce_graphics/geometry/juce_Rectangle.h +++ b/modules/juce_graphics/geometry/juce_Rectangle.h @@ -957,8 +957,8 @@ public: } #ifndef DOXYGEN - // This has been renamed by transformedBy, in order to match the method names used in the Point class. - JUCE_DEPRECATED_WITH_BODY (Rectangle transformed (const AffineTransform& t) const noexcept, { return transformedBy (t); }) + [[deprecated ("This has been renamed to transformedBy in order to match the method names used in the Point class.")]] + Rectangle transformed (const AffineTransform& t) const noexcept { return transformedBy (t); } #endif private: diff --git a/modules/juce_graphics/images/juce_Image.cpp b/modules/juce_graphics/images/juce_Image.cpp index 36d4ad0a6d..10213980ed 100644 --- a/modules/juce_graphics/images/juce_Image.cpp +++ b/modules/juce_graphics/images/juce_Image.cpp @@ -265,8 +265,6 @@ Image::~Image() { } -JUCE_DECLARE_DEPRECATED_STATIC (const Image Image::null;) - int Image::getReferenceCount() const noexcept { return image == nullptr ? 0 : image->getSharedCount(); } int Image::getWidth() const noexcept { return image == nullptr ? 0 : image->width; } int Image::getHeight() const noexcept { return image == nullptr ? 0 : image->height; } @@ -684,4 +682,17 @@ void Image::moveImageSection (int dx, int dy, } } +//============================================================================== +#if JUCE_ALLOW_STATIC_NULL_VARIABLES + +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wdeprecated-declarations") +JUCE_BEGIN_IGNORE_WARNINGS_MSVC (4996) + +const Image Image::null; + +JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_END_IGNORE_WARNINGS_MSVC + +#endif + } // namespace juce diff --git a/modules/juce_graphics/images/juce_Image.h b/modules/juce_graphics/images/juce_Image.h index 4170d3e33d..714472304f 100644 --- a/modules/juce_graphics/images/juce_Image.h +++ b/modules/juce_graphics/images/juce_Image.h @@ -413,10 +413,12 @@ public: /** @internal */ explicit Image (ReferenceCountedObjectPtr) noexcept; - /* A null Image object that can be used when you need to return an invalid image. - @deprecated If you need a default-constructed var, just use Image() or {}. - */ - JUCE_DEPRECATED_STATIC (static const Image null;) + //============================================================================== + #if JUCE_ALLOW_STATIC_NULL_VARIABLES && ! defined (DOXYGEN) + /* A null Image object that can be used when you need to return an invalid image. */ + [[deprecated ("If you need a default-constructed var, just use Image() or {}.")]] + static const Image null; + #endif private: //============================================================================== diff --git a/modules/juce_gui_basics/buttons/juce_Button.h b/modules/juce_gui_basics/buttons/juce_Button.h index ec521bce63..22f7b59dd7 100644 --- a/modules/juce_gui_basics/buttons/juce_Button.h +++ b/modules/juce_gui_basics/buttons/juce_Button.h @@ -394,8 +394,11 @@ public: bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) = 0; }; - // This method's parameters have changed - see the new version. - JUCE_DEPRECATED (void setToggleState (bool, bool)); + //============================================================================== + #ifndef DOXYGEN + [[deprecated ("This method's parameters have changed.")]] + void setToggleState (bool, bool); + #endif protected: //============================================================================== diff --git a/modules/juce_gui_basics/buttons/juce_TextButton.h b/modules/juce_gui_basics/buttons/juce_TextButton.h index 5ae1cffe01..c424cae23d 100644 --- a/modules/juce_gui_basics/buttons/juce_TextButton.h +++ b/modules/juce_gui_basics/buttons/juce_TextButton.h @@ -102,12 +102,7 @@ public: /** @internal */ void colourChanged() override; -private: - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // Note that this method has been removed - instead, see LookAndFeel::getTextButtonFont() - virtual int getFont() { return 0; } - #endif - + //============================================================================== JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TextButton) }; diff --git a/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h b/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h index 0965e3d5d8..b3a4032000 100644 --- a/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h +++ b/modules/juce_gui_basics/commands/juce_ApplicationCommandManager.h @@ -312,12 +312,6 @@ private: void globalFocusChanged (Component*) override; ApplicationCommandInfo* getMutableCommandForID (CommandID) const noexcept; - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // This is just here to cause a compile error in old code that hasn't been changed to use the new - // version of this method. - virtual short getFirstCommandTarget() { return 0; } - #endif - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ApplicationCommandManager) }; diff --git a/modules/juce_gui_basics/components/juce_Component.h b/modules/juce_gui_basics/components/juce_Component.h index 53ef3c7875..6837fd9d3d 100644 --- a/modules/juce_gui_basics/components/juce_Component.h +++ b/modules/juce_gui_basics/components/juce_Component.h @@ -2442,13 +2442,15 @@ public: //============================================================================== #ifndef DOXYGEN - // This method has been deprecated in favour of the setFocusContainerType() method - // that takes a more descriptive enum. - JUCE_DEPRECATED_WITH_BODY (void setFocusContainer (bool shouldBeFocusContainer) noexcept, + [[deprecated ("Use the setFocusContainerType that takes a more descriptive enum.")]] + void setFocusContainer (bool shouldBeFocusContainer) noexcept { setFocusContainerType (shouldBeFocusContainer ? FocusContainerType::keyboardFocusContainer : FocusContainerType::none); - }) + } + + [[deprecated ("Use the contains that takes a Point.")]] + void contains (int, int) = delete; #endif private: @@ -2584,19 +2586,6 @@ private: */ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Component) - //============================================================================== - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // This is included here just to cause a compile error if your code is still handling - // drag-and-drop with this method. If so, just update it to use the new FileDragAndDropTarget - // class, which is easy (just make your class inherit from FileDragAndDropTarget, and - // implement its methods instead of this Component method). - virtual void filesDropped (const StringArray&, int, int) {} - - // This is included here to cause an error if you use or overload it - it has been deprecated in - // favour of contains (Point) - void contains (int, int) = delete; - #endif - protected: //============================================================================== /** @internal */ diff --git a/modules/juce_gui_basics/desktop/juce_Displays.h b/modules/juce_gui_basics/desktop/juce_Displays.h index cebb42ca7f..6bdc71e71d 100644 --- a/modules/juce_gui_basics/desktop/juce_Displays.h +++ b/modules/juce_gui_basics/desktop/juce_Displays.h @@ -168,15 +168,16 @@ public: void refresh(); /** @internal */ ~Displays() = default; - // This method has been deprecated - use the getDisplayForPoint() or getDisplayForRect() methods instead - // as they can deal with converting between logical and physical pixels - JUCE_DEPRECATED (const Display& getDisplayContaining (Point position) const noexcept); + + [[deprecated ("Use the getDisplayForPoint or getDisplayForRect methods instead " + "as they can deal with converting between logical and physical pixels.")]] + const Display& getDisplayContaining (Point position) const noexcept; // These methods have been deprecated - use the methods which return a Display* instead as they will return // nullptr on headless systems with no connected displays - JUCE_DEPRECATED (const Display& findDisplayForRect (Rectangle, bool isPhysical = false) const noexcept); - JUCE_DEPRECATED (const Display& findDisplayForPoint (Point, bool isPhysical = false) const noexcept); - JUCE_DEPRECATED (const Display& getMainDisplay() const noexcept); + [[deprecated]] const Display& findDisplayForRect (Rectangle, bool isPhysical = false) const noexcept; + [[deprecated]] const Display& findDisplayForPoint (Point, bool isPhysical = false) const noexcept; + [[deprecated]] const Display& getMainDisplay() const noexcept; #endif private: diff --git a/modules/juce_gui_basics/menus/juce_PopupMenu.h b/modules/juce_gui_basics/menus/juce_PopupMenu.h index 5781531957..5e84306533 100644 --- a/modules/juce_gui_basics/menus/juce_PopupMenu.h +++ b/modules/juce_gui_basics/menus/juce_PopupMenu.h @@ -1006,6 +1006,12 @@ public: virtual int getPopupMenuColumnSeparatorWidthWithOptions (const Options&) = 0; }; + //============================================================================== + #ifndef DOXYGEN + [[deprecated ("Use the new method.")]] + int drawPopupMenuItem (Graphics&, int, int, bool, bool, bool, bool, bool, const String&, const String&, Image*, const Colour*) { return 0; } + #endif + private: //============================================================================== JUCE_PUBLIC_IN_DLL_BUILD (struct HelperClasses) @@ -1021,11 +1027,6 @@ private: static void setItem (CustomComponent&, const Item*); - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // These methods have new implementations now - see its new definition - int drawPopupMenuItem (Graphics&, int, int, bool, bool, bool, bool, bool, const String&, const String&, Image*, const Colour*) { return 0; } - #endif - JUCE_LEAK_DETECTOR (PopupMenu) }; diff --git a/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h b/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h index f1c6d5ad75..4be1ca6c9c 100644 --- a/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h +++ b/modules/juce_gui_basics/mouse/juce_DragAndDropContainer.h @@ -238,13 +238,6 @@ private: const MouseInputSource* getMouseInputSourceForDrag (Component* sourceComponent, const MouseInputSource* inputSourceCausingDrag); bool isAlreadyDragging (Component* sourceComponent) const noexcept; - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // This is just here to cause a compile error in old code that hasn't been changed to use the new - // version of this method. - virtual int dragOperationStarted() { return 0; } - virtual int dragOperationEnded() { return 0; } - #endif - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DragAndDropContainer) }; diff --git a/modules/juce_gui_basics/mouse/juce_MouseInputSource.h b/modules/juce_gui_basics/mouse/juce_MouseInputSource.h index 0763b09435..736b8ec7ad 100644 --- a/modules/juce_gui_basics/mouse/juce_MouseInputSource.h +++ b/modules/juce_gui_basics/mouse/juce_MouseInputSource.h @@ -241,13 +241,15 @@ public: */ static const Point offscreenMousePos; - #if ! DOXYGEN - // This method has been deprecated and replaced with the isLongPressOrDrag() and hasMovedSignificantlySincePressed() - // methods. If you want the same behaviour you should use isLongPressOrDrag() which accounts for the amount of time - // that the input source has been held down for, but if you only want to know whether it has been moved use - // hasMovedSignificantlySincePressed() instead. - JUCE_DEPRECATED (bool hasMouseMovedSignificantlySincePressed() const noexcept); + //============================================================================== + #ifndef DOXYGEN + [[deprecated ("This method has been replaced with the isLongPressOrDrag and hasMovedSignificantlySincePressed " + "methods. If you want the same behaviour you should use isLongPressOrDrag which accounts for the " + "amount of time that the input source has been held down for, but if you only want to know whether " + "it has been moved use hasMovedSignificantlySincePressed instead.")]] + bool hasMouseMovedSignificantlySincePressed() const noexcept; #endif + private: //============================================================================== friend class ComponentPeer; diff --git a/modules/juce_gui_basics/widgets/juce_ComboBox.h b/modules/juce_gui_basics/widgets/juce_ComboBox.h index 4c3e9569d0..8275b8f0ca 100644 --- a/modules/juce_gui_basics/widgets/juce_ComboBox.h +++ b/modules/juce_gui_basics/widgets/juce_ComboBox.h @@ -420,11 +420,14 @@ public: /** @internal */ void parentHierarchyChanged() override; + //============================================================================== + #ifndef DOXYGEN // These methods' bool parameters have changed: see their new method signatures. - JUCE_DEPRECATED (void clear (bool)); - JUCE_DEPRECATED (void setSelectedId (int, bool)); - JUCE_DEPRECATED (void setSelectedItemIndex (int, bool)); - JUCE_DEPRECATED (void setText (const String&, bool)); + [[deprecated]] void clear (bool); + [[deprecated]] void setSelectedId (int, bool); + [[deprecated]] void setSelectedItemIndex (int, bool); + [[deprecated]] void setText (const String&, bool); + #endif private: //============================================================================== diff --git a/modules/juce_gui_basics/widgets/juce_ListBox.h b/modules/juce_gui_basics/widgets/juce_ListBox.h index 683fd78ca1..ae8ae8434c 100644 --- a/modules/juce_gui_basics/widgets/juce_ListBox.h +++ b/modules/juce_gui_basics/widgets/juce_ListBox.h @@ -572,6 +572,12 @@ public: void startDragAndDrop (const MouseEvent&, const SparseSet& rowsToDrag, const var& dragDescription, bool allowDraggingToOtherWindows); + //============================================================================== + #ifndef DOXYGEN + [[deprecated ("This method's bool parameter has changed: see the new method signature.")]] + void setSelectedRows (const SparseSet&, bool); + #endif + private: //============================================================================== JUCE_PUBLIC_IN_DLL_BUILD (class ListViewport) @@ -593,14 +599,6 @@ private: void selectRowInternal (int rowNumber, bool dontScrollToShowThisRow, bool deselectOthersFirst, bool isMouseClick); - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // This method's bool parameter has changed: see the new method signature. - JUCE_DEPRECATED (void setSelectedRows (const SparseSet&, bool)); - // This method has been replaced by the more flexible method createSnapshotOfRows. - // Please call createSnapshotOfRows (getSelectedRows(), x, y) to get the same behaviour. - JUCE_DEPRECATED (virtual void createSnapshotOfSelectedRows (int&, int&)) {} - #endif - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ListBox) }; diff --git a/modules/juce_gui_basics/widgets/juce_Slider.h b/modules/juce_gui_basics/widgets/juce_Slider.h index 162dc59de0..a7616b151c 100644 --- a/modules/juce_gui_basics/widgets/juce_Slider.h +++ b/modules/juce_gui_basics/widgets/juce_Slider.h @@ -992,6 +992,21 @@ public: /** @internal */ void mouseEnter (const MouseEvent&) override; + //============================================================================== + #ifndef DOXYGEN + // These methods' bool parameters have changed: see the new method signature. + [[deprecated]] void setValue (double, bool); + [[deprecated]] void setValue (double, bool, bool); + [[deprecated]] void setMinValue (double, bool, bool, bool); + [[deprecated]] void setMinValue (double, bool, bool); + [[deprecated]] void setMinValue (double, bool); + [[deprecated]] void setMaxValue (double, bool, bool, bool); + [[deprecated]] void setMaxValue (double, bool, bool); + [[deprecated]] void setMaxValue (double, bool); + [[deprecated]] void setMinAndMaxValues (double, double, bool, bool); + [[deprecated]] void setMinAndMaxValues (double, double, bool); + #endif + private: //============================================================================== JUCE_PUBLIC_IN_DLL_BUILD (class Pimpl) @@ -1000,20 +1015,6 @@ private: std::unique_ptr createAccessibilityHandler() override; void init (SliderStyle, TextEntryBoxPosition); - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // These methods' bool parameters have changed: see the new method signature. - JUCE_DEPRECATED (void setValue (double, bool)); - JUCE_DEPRECATED (void setValue (double, bool, bool)); - JUCE_DEPRECATED (void setMinValue (double, bool, bool, bool)); - JUCE_DEPRECATED (void setMinValue (double, bool, bool)); - JUCE_DEPRECATED (void setMinValue (double, bool)); - JUCE_DEPRECATED (void setMaxValue (double, bool, bool, bool)); - JUCE_DEPRECATED (void setMaxValue (double, bool, bool)); - JUCE_DEPRECATED (void setMaxValue (double, bool)); - JUCE_DEPRECATED (void setMinAndMaxValues (double, double, bool, bool)); - JUCE_DEPRECATED (void setMinAndMaxValues (double, double, bool)); - #endif - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (Slider) }; diff --git a/modules/juce_gui_basics/widgets/juce_TableListBox.h b/modules/juce_gui_basics/widgets/juce_TableListBox.h index 856c361c11..4402665701 100644 --- a/modules/juce_gui_basics/widgets/juce_TableListBox.h +++ b/modules/juce_gui_basics/widgets/juce_TableListBox.h @@ -186,12 +186,6 @@ public: @see getDragSourceCustomData, DragAndDropContainer::startDragging */ virtual var getDragSourceDescription (const SparseSet& currentlySelectedRows); - -private: - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // This method's signature has changed to take a MouseEvent parameter - please update your code! - JUCE_DEPRECATED_WITH_BODY (virtual int backgroundClicked(), { return 0; }) - #endif }; diff --git a/modules/juce_gui_basics/widgets/juce_TreeView.h b/modules/juce_gui_basics/widgets/juce_TreeView.h index e83942e297..aa4547bbe6 100644 --- a/modules/juce_gui_basics/widgets/juce_TreeView.h +++ b/modules/juce_gui_basics/widgets/juce_TreeView.h @@ -946,11 +946,6 @@ private: int indentSize = -1; bool defaultOpenness = false, rootItemVisible = true, multiSelectEnabled = false, openCloseButtonsVisible = true; - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // this method has been deprecated - see the new version.. - virtual int paintOpenCloseButton (Graphics&, int, int, bool) { return 0; } - #endif - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (TreeView) }; diff --git a/modules/juce_gui_basics/windows/juce_AlertWindow.h b/modules/juce_gui_basics/windows/juce_AlertWindow.h index 6b59875f3a..8048454b60 100644 --- a/modules/juce_gui_basics/windows/juce_AlertWindow.h +++ b/modules/juce_gui_basics/windows/juce_AlertWindow.h @@ -414,9 +414,7 @@ public: #endif //============================================================================== - #if JUCE_MODAL_LOOPS_PERMITTED - // This has been deprecated, use the NativeMessageBox methods instead for more options. - + #if JUCE_MODAL_LOOPS_PERMITTED && ! defined (DOXYGEN) /** Shows an operating-system native dialog box. @param title the title to use at the top @@ -425,9 +423,10 @@ public: it'll show a box with just an ok button @returns true if the ok button was pressed, false if they pressed cancel. */ - JUCE_DEPRECATED (static bool JUCE_CALLTYPE showNativeDialogBox (const String& title, - const String& bodyText, - bool isOkCancel)); + [[deprecated ("Use the NativeMessageBox methods instead for more options")]] + static bool JUCE_CALLTYPE showNativeDialogBox (const String& title, + const String& bodyText, + bool isOkCancel); #endif diff --git a/modules/juce_gui_basics/windows/juce_ResizableWindow.h b/modules/juce_gui_basics/windows/juce_ResizableWindow.h index d67303595c..e185adde45 100644 --- a/modules/juce_gui_basics/windows/juce_ResizableWindow.h +++ b/modules/juce_gui_basics/windows/juce_ResizableWindow.h @@ -313,10 +313,13 @@ public: }; //============================================================================== - // Deprecated: use setContentOwned() and setContentNonOwned() instead. - JUCE_DEPRECATED (void setContentComponent (Component* newContentComponent, - bool deleteOldOne = true, - bool resizeToFit = false)); + #ifndef DOXYGEN + [[deprecated ("use setContentOwned and setContentNonOwned instead.")]] + void setContentComponent (Component* newContentComponent, + bool deleteOldOne = true, + bool resizeToFit = false); + #endif + using TopLevelWindow::addToDesktop; //============================================================================== @@ -381,6 +384,11 @@ protected: std::unique_ptr resizableCorner; std::unique_ptr resizableBorder; + //============================================================================== + // The parameters for these methods have changed - please update your code! + void getBorderThickness (int& left, int& top, int& right, int& bottom); + void getContentComponentBorder (int& left, int& top, int& right, int& bottom); + private: //============================================================================== Component::SafePointer contentComponent, splashScreen; @@ -399,12 +407,6 @@ private: void setContent (Component*, bool takeOwnership, bool resizeToFit); void updatePeerConstrainer(); - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // The parameters for these methods have changed - please update your code! - JUCE_DEPRECATED (void getBorderThickness (int& left, int& top, int& right, int& bottom)); - JUCE_DEPRECATED (void getContentComponentBorder (int& left, int& top, int& right, int& bottom)); - #endif - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ResizableWindow) }; diff --git a/modules/juce_gui_basics/windows/juce_TooltipWindow.h b/modules/juce_gui_basics/windows/juce_TooltipWindow.h index 1a240d7d96..36c1cb3c91 100644 --- a/modules/juce_gui_basics/windows/juce_TooltipWindow.h +++ b/modules/juce_gui_basics/windows/juce_TooltipWindow.h @@ -121,11 +121,6 @@ public: /** returns the bounds for a tooltip at the given screen coordinate, constrained within the given desktop area. */ virtual Rectangle getTooltipBounds (const String& tipText, Point screenPos, Rectangle parentArea) = 0; virtual void drawTooltip (Graphics&, const String& text, int width, int height) = 0; - - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // This method has been replaced by getTooltipBounds() - virtual int getTooltipSize (const String&, int&, int&) { return 0; } - #endif }; //============================================================================== diff --git a/modules/juce_gui_extra/misc/juce_ColourSelector.h b/modules/juce_gui_extra/misc/juce_ColourSelector.h index 5804c94a85..892f79c995 100644 --- a/modules/juce_gui_extra/misc/juce_ColourSelector.h +++ b/modules/juce_gui_extra/misc/juce_ColourSelector.h @@ -162,12 +162,6 @@ private: void resized() override; JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ColourSelector) - - #if JUCE_CATCH_DEPRECATED_CODE_MISUSE - // This constructor is here temporarily to prevent old code compiling, because the parameters - // have changed - if you get an error here, update your code to use the new constructor instead.. - ColourSelector (bool); - #endif }; } // namespace juce diff --git a/modules/juce_gui_extra/misc/juce_LiveConstantEditor.h b/modules/juce_gui_extra/misc/juce_LiveConstantEditor.h index 85d9ad102d..3c0f946446 100644 --- a/modules/juce_gui_extra/misc/juce_LiveConstantEditor.h +++ b/modules/juce_gui_extra/misc/juce_LiveConstantEditor.h @@ -26,7 +26,7 @@ namespace juce { -#if JUCE_ENABLE_LIVE_CONSTANT_EDITOR && ! DOXYGEN +#if JUCE_ENABLE_LIVE_CONSTANT_EDITOR && ! defined (DOXYGEN) //============================================================================== /** You can safely ignore all the stuff in this namespace - it's a bunch of boilerplate diff --git a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h index b3fa298f2a..bf58a6a760 100644 --- a/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h +++ b/modules/juce_gui_extra/misc/juce_SystemTrayIconComponent.h @@ -28,7 +28,6 @@ namespace juce #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD || JUCE_MAC || DOXYGEN - //============================================================================== /** This component sits in the taskbar tray as a small icon. @@ -106,14 +105,12 @@ private: JUCE_PUBLIC_IN_DLL_BUILD (class Pimpl) std::unique_ptr pimpl; - // The new setIconImage function signature requires different images for macOS - // and the other platforms - JUCE_DEPRECATED (void setIconImage (const Image& newImage)); + [[deprecated ("The new setIconImage function signature requires different images for macOS and the other platforms.")]] + void setIconImage (const Image& newImage); JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SystemTrayIconComponent) }; - #endif } // namespace juce diff --git a/modules/juce_opengl/juce_opengl.h b/modules/juce_opengl/juce_opengl.h index daf5403ffa..e7f4c19d7b 100644 --- a/modules/juce_opengl/juce_opengl.h +++ b/modules/juce_opengl/juce_opengl.h @@ -71,7 +71,7 @@ #include //============================================================================== -#if JUCE_OPENGL_ES || defined (DOXYGEN) +#if JUCE_OPENGL_ES || DOXYGEN /** This macro is a helper for use in GLSL shader code which needs to compile on both GLES and desktop GL. Since it's mandatory in GLES to mark a variable with a precision, but the keywords don't exist in normal GLSL, these macros define the various precision keywords only on GLES. diff --git a/modules/juce_opengl/native/juce_OpenGLExtensions.h b/modules/juce_opengl/native/juce_OpenGLExtensions.h index 457300023d..9689fe92f2 100644 --- a/modules/juce_opengl/native/juce_OpenGLExtensions.h +++ b/modules/juce_opengl/native/juce_OpenGLExtensions.h @@ -108,13 +108,14 @@ namespace juce */ struct OpenGLExtensionFunctions { - /** A more complete set of GL commands can be found in the juce::gl namespace. + //============================================================================== + #ifndef DOXYGEN + [[deprecated ("A more complete set of GL commands can be found in the juce::gl namespace. " + "You should use juce::gl::loadFunctions() to load GL functions.")]] + static void initialise(); + #endif - You should use juce::gl::loadFunctions() to load GL functions. - */ - JUCE_DEPRECATED (static void initialise()); - - #if JUCE_WINDOWS && ! DOXYGEN + #if JUCE_WINDOWS && ! defined (DOXYGEN) typedef char GLchar; typedef pointer_sized_int GLsizeiptr; typedef pointer_sized_int GLintptr; diff --git a/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h b/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h index 6dcaa09b34..6044968b8e 100644 --- a/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h +++ b/modules/juce_product_unlocking/in_app_purchases/juce_InAppPurchases.h @@ -256,20 +256,22 @@ public: void cancelDownloads (const Array& downloads); //============================================================================== - // On Android, it is no longer necessary to specify whether the product being purchased is a subscription - // and only a single subscription can be upgraded/downgraded. Use the updated purchaseProduct() method - // which takes a single String argument. - JUCE_DEPRECATED_WITH_BODY (void purchaseProduct (const String& productIdentifier, - bool isSubscription, - const StringArray& upgradeOrDowngradeFromSubscriptionsWithProductIdentifiers = {}, - bool creditForUnusedSubscription = true), - { + #ifndef DOXYGEN + [[deprecated ("On Android, it is no longer necessary to specify whether the product being purchased is a subscription " + "and only a single subscription can be upgraded/downgraded. Use the updated purchaseProduct method " + "which takes a single String argument.")]] + void purchaseProduct (const String& productIdentifier, + bool isSubscription, + const StringArray& upgradeOrDowngradeFromSubscriptionsWithProductIdentifiers = {}, + bool creditForUnusedSubscription = true) + { - ignoreUnused (isSubscription); - purchaseProduct (productIdentifier, - upgradeOrDowngradeFromSubscriptionsWithProductIdentifiers[0], - creditForUnusedSubscription); - }) + ignoreUnused (isSubscription); + purchaseProduct (productIdentifier, + upgradeOrDowngradeFromSubscriptionsWithProductIdentifiers[0], + creditForUnusedSubscription); + } + #endif private: //============================================================================== diff --git a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp index 4d47bee7d7..994c4e7e44 100644 --- a/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp +++ b/modules/juce_product_unlocking/marketplace/juce_OnlineUnlockStatus.cpp @@ -380,8 +380,8 @@ bool OnlineUnlockStatus::applyKeyFile (String keyFileContent) static bool canConnectToWebsite (const URL& url) { - std::unique_ptr in (url.createInputStream (false, nullptr, nullptr, String(), 2000, nullptr)); - return in != nullptr; + return url.createInputStream (URL::InputStreamOptions (URL::ParameterHandling::inAddress) + .withConnectionTimeoutMs (2000)) != nullptr; } static bool areMajorWebsitesAvailable() diff --git a/modules/juce_video/capture/juce_CameraDevice.h b/modules/juce_video/capture/juce_CameraDevice.h index 302b01aca5..9216d63307 100644 --- a/modules/juce_video/capture/juce_CameraDevice.h +++ b/modules/juce_video/capture/juce_CameraDevice.h @@ -28,7 +28,6 @@ namespace juce #if JUCE_USE_CAMERA || DOXYGEN - //============================================================================== /** Controls any video capture devices that might be available.