diff --git a/extras/Introjucer/Source/Application/jucer_Application.h b/extras/Introjucer/Source/Application/jucer_Application.h index 739ce34a2f..abe5a8aae5 100644 --- a/extras/Introjucer/Source/Application/jucer_Application.h +++ b/extras/Introjucer/Source/Application/jucer_Application.h @@ -311,7 +311,6 @@ public: for (int i = 0; i < numDocs; ++i) { OpenDocumentManager::Document* doc = getApp().openDocumentManager.getOpenDocument(i); - menu.addItem (activeDocumentsBaseID + i, doc->getName()); } diff --git a/extras/Introjucer/Source/Utility/jucer_CodeHelpers.cpp b/extras/Introjucer/Source/Utility/jucer_CodeHelpers.cpp index 785943d86b..bb81c83037 100644 --- a/extras/Introjucer/Source/Utility/jucer_CodeHelpers.cpp +++ b/extras/Introjucer/Source/Utility/jucer_CodeHelpers.cpp @@ -62,8 +62,7 @@ namespace CodeHelpers else s = s.replaceCharacters (".,;/@", "_____"); - int i; - for (i = s.length(); --i > 0;) + for (int i = s.length(); --i > 0;) if (CharacterFunctions::isLetter (s[i]) && CharacterFunctions::isLetter (s[i - 1]) && CharacterFunctions::isUpperCase (s[i]) @@ -86,7 +85,7 @@ namespace CodeHelpers if (capitalise) n = n.toLowerCase(); - for (i = 1; i < words.size(); ++i) + for (int i = 1; i < words.size(); ++i) { if (capitalise && words[i].length() > 1) n << words[i].substring (0, 1).toUpperCase() diff --git a/extras/JuceDemo/Source/demos/WidgetsDemo.cpp b/extras/JuceDemo/Source/demos/WidgetsDemo.cpp index 8a8d4a75df..1c7fd3a9c2 100644 --- a/extras/JuceDemo/Source/demos/WidgetsDemo.cpp +++ b/extras/JuceDemo/Source/demos/WidgetsDemo.cpp @@ -284,8 +284,7 @@ static Component* createSlidersPage() const int numSliders = 11; Slider* sliders [numSliders]; - int i; - for (i = 0; i < numSliders; ++i) + for (int i = 0; i < numSliders; ++i) { if (i == 2) page->addAndMakeVisible (sliders[i] = new SnappingSlider ("slider")); @@ -347,7 +346,7 @@ static Component* createSlidersPage() sliders[10]->setSliderStyle (Slider::ThreeValueVertical); sliders[10]->setBounds (440, 110, 40, 160); - for (i = 7; i <= 10; ++i) + for (int i = 7; i <= 10; ++i) { sliders[i]->setTextBoxStyle (Slider::NoTextBox, false, 0, 0); sliders[i]->setPopupDisplayEnabled (true, page); @@ -362,7 +361,7 @@ static Component* createSlidersPage() */ Value sharedValue; sharedValue = Random::getSystemRandom().nextDouble() * 100; - for (i = 0; i < 7; ++i) + for (int i = 0; i < 7; ++i) sliders[i]->getValueObject().referTo (sharedValue); // ..and now we'll do the same for all our min/max slider values.. @@ -370,7 +369,7 @@ static Component* createSlidersPage() sharedValueMin = Random::getSystemRandom().nextDouble() * 40.0; sharedValueMax = Random::getSystemRandom().nextDouble() * 40.0 + 60.0; - for (i = 7; i <= 10; ++i) + for (int i = 7; i <= 10; ++i) { sliders[i]->getMaxValueObject().referTo (sharedValueMax); sliders[i]->getMinValueObject().referTo (sharedValueMin); @@ -513,8 +512,8 @@ public: db = new DrawableButton ("Button 4", DrawableButton::ImageOnButtonBackground); db->setImages (&normal, &over, &down); db->setClickingTogglesState (true); - db->setColour (TextButton::buttonColourId, Colours::white); - db->setColour (TextButton::buttonOnColourId, Colours::yellow); + db->setColour (DrawableButton::backgroundColourId, Colours::white); + db->setColour (DrawableButton::backgroundOnColourId, Colours::yellow); db->setBounds (200, 70, 50, 50); db->setTooltip ("this is a DrawableButton on a standard button background"); db->addListener (buttonListener); diff --git a/modules/juce_audio_basics/effects/juce_Reverb.h b/modules/juce_audio_basics/effects/juce_Reverb.h index e4daa01c5e..2f1f54e0f6 100644 --- a/modules/juce_audio_basics/effects/juce_Reverb.h +++ b/modules/juce_audio_basics/effects/juce_Reverb.h @@ -104,14 +104,13 @@ public: const int stereoSpread = 23; const int intSampleRate = (int) sampleRate; - int i; - for (i = 0; i < numCombs; ++i) + for (int i = 0; i < numCombs; ++i) { comb[0][i].setSize ((intSampleRate * combTunings[i]) / 44100); comb[1][i].setSize ((intSampleRate * (combTunings[i] + stereoSpread)) / 44100); } - for (i = 0; i < numAllPasses; ++i) + for (int i = 0; i < numAllPasses; ++i) { allPass[0][i].setSize ((intSampleRate * allPassTunings[i]) / 44100); allPass[1][i].setSize ((intSampleRate * (allPassTunings[i] + stereoSpread)) / 44100); @@ -125,11 +124,10 @@ public: { for (int j = 0; j < numChannels; ++j) { - int i; - for (i = 0; i < numCombs; ++i) + for (int i = 0; i < numCombs; ++i) comb[j][i].clear(); - for (i = 0; i < numAllPasses; ++i) + for (int i = 0; i < numAllPasses; ++i) allPass[j][i].clear(); } } @@ -148,14 +146,13 @@ public: const float input = (left[i] + right[i]) * gain; float outL = 0, outR = 0; - int j; - for (j = 0; j < numCombs; ++j) // accumulate the comb filters in parallel + for (int j = 0; j < numCombs; ++j) // accumulate the comb filters in parallel { outL += comb[0][j].process (input); outR += comb[1][j].process (input); } - for (j = 0; j < numAllPasses; ++j) // run the allpass filters in series + for (int j = 0; j < numAllPasses; ++j) // run the allpass filters in series { outL = allPass[0][j].process (outL); outR = allPass[1][j].process (outR); diff --git a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp index a385ee2aad..d1b242691b 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp +++ b/modules/juce_audio_devices/audio_io/juce_AudioDeviceManager.cpp @@ -204,8 +204,7 @@ String AudioDeviceManager::initialise (const int numInputChannelsNeeded, StringArray outs (type->getDeviceNames (false)); - int i; - for (i = 0; i < outs.size(); ++i) + for (int i = 0; i < outs.size(); ++i) { if (outs[i].matchesWildcard (preferredDefaultDeviceName, true)) { @@ -216,7 +215,7 @@ String AudioDeviceManager::initialise (const int numInputChannelsNeeded, StringArray ins (type->getDeviceNames (true)); - for (i = 0; i < ins.size(); ++i) + for (int i = 0; i < ins.size(); ++i) { if (ins[i].matchesWildcard (preferredDefaultDeviceName, true)) { diff --git a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp index 51ad00e397..202debe4ff 100644 --- a/modules/juce_audio_devices/native/juce_linux_ALSA.cpp +++ b/modules/juce_audio_devices/native/juce_linux_ALSA.cpp @@ -662,11 +662,10 @@ private: getDeviceProperties (inputId, dummy, dummy, minChansIn, maxChansIn, sampleRates); getDeviceProperties (outputId, minChansOut, maxChansOut, dummy, dummy, sampleRates); - unsigned int i; - for (i = 0; i < maxChansOut; ++i) + for (unsigned int i = 0; i < maxChansOut; ++i) channelNamesOut.add ("channel " + String ((int) i + 1)); - for (i = 0; i < maxChansIn; ++i) + for (unsigned int i = 0; i < maxChansIn; ++i) channelNamesIn.add ("channel " + String ((int) i + 1)); } diff --git a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp index ac2090685d..968ee666d7 100644 --- a/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp +++ b/modules/juce_audio_devices/native/juce_mac_CoreAudio.cpp @@ -560,14 +560,13 @@ public: void audioCallback (const AudioBufferList* inInputData, AudioBufferList* outOutputData) { - int i; const ScopedLock sl (callbackLock); if (callback != nullptr) { if (inputDevice == 0) { - for (i = numInputChans; --i >= 0;) + for (int i = numInputChans; --i >= 0;) { const CallbackDetailsForChannel& info = inputChannelInfo[i]; float* dest = tempInputBuffers [i]; @@ -612,7 +611,7 @@ public: bufferSize); } - for (i = numOutputChans; --i >= 0;) + for (int i = numOutputChans; --i >= 0;) { const CallbackDetailsForChannel& info = outputChannelInfo[i]; const float* src = tempOutputBuffers [i]; @@ -633,7 +632,7 @@ public: } else { - for (i = jmin (numOutputChans, numOutputChannelInfos); --i >= 0;) + for (int i = jmin (numOutputChans, numOutputChannelInfos); --i >= 0;) { const CallbackDetailsForChannel& info = outputChannelInfo[i]; float* dest = ((float*) outOutputData->mBuffers[info.streamNum].mData) diff --git a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp index 8bf1790996..76b373594b 100644 --- a/modules/juce_audio_devices/native/juce_win32_ASIO.cpp +++ b/modules/juce_audio_devices/native/juce_win32_ASIO.cpp @@ -464,8 +464,7 @@ public: bool isSourceSet = false; // careful not to remove this loop because it does more than just logging! - int i; - for (i = 0; i < numSources; ++i) + for (int i = 0; i < numSources; ++i) { String s ("clock: "); s += clocks[i].name; @@ -561,8 +560,7 @@ public: numActiveOutputChans = 0; ASIOBufferInfo* info = bufferInfos; - int i; - for (i = 0; i < totalNumInputChans; ++i) + for (int i = 0; i < totalNumInputChans; ++i) { if (inputChannels[i]) { @@ -575,7 +573,7 @@ public: } } - for (i = 0; i < totalNumOutputChans; ++i) + for (int i = 0; i < totalNumOutputChans; ++i) { if (outputChannels[i]) { @@ -623,7 +621,7 @@ public: Array types; currentBitDepth = 16; - for (i = 0; i < jmin ((int) totalNumInputChans, (int) maxASIOChannels); ++i) + for (int i = 0; i < jmin ((int) totalNumInputChans, (int) maxASIOChannels); ++i) { if (inputChannels[i]) { @@ -645,7 +643,7 @@ public: jassert (numActiveInputChans == n); n = 0; - for (i = 0; i < jmin ((int) totalNumOutputChans, (int) maxASIOChannels); ++i) + for (int i = 0; i < jmin ((int) totalNumOutputChans, (int) maxASIOChannels); ++i) { if (outputChannels[i]) { @@ -666,14 +664,14 @@ public: jassert (numActiveOutputChans == n); - for (i = types.size(); --i >= 0;) + for (int i = types.size(); --i >= 0;) { log ("channel format: " + String (types[i])); } jassert (n <= totalBuffers); - for (i = 0; i < numActiveOutputChans; ++i) + for (int i = 0; i < numActiveOutputChans; ++i) { outputFormat[i].clear (bufferInfos [numActiveInputChans + i].buffers[0], currentBlockSizeSamples); outputFormat[i].clear (bufferInfos [numActiveInputChans + i].buffers[1], currentBlockSizeSamples); @@ -1300,8 +1298,7 @@ private: if (currentCallback != nullptr) { - int i; - for (i = 0; i < numActiveInputChans; ++i) + for (int i = 0; i < numActiveInputChans; ++i) { jassert (inBuffers[i]!= nullptr); inputFormat[i].convertToFloat (infos[i].buffers[bi], inBuffers[i], samps); @@ -1310,7 +1307,7 @@ private: currentCallback->audioDeviceIOCallback ((const float**) inBuffers, numActiveInputChans, outBuffers, numActiveOutputChans, samps); - for (i = 0; i < numActiveOutputChans; ++i) + for (int i = 0; i < numActiveOutputChans; ++i) { jassert (outBuffers[i] != nullptr); outputFormat[i].convertFromFloat (outBuffers[i], infos [numActiveInputChans + i].buffers[bi], samps); diff --git a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp index 810d266441..5c353dc93e 100644 --- a/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp @@ -2002,11 +2002,10 @@ private: const int jsbound = (frame.mode == 1) ? (frame.modeExt << 2) + 4 : frame.layer2SubBandLimit; const AllocationTable* allocTable = frame.allocationTable; uint8 scfsi[32][2]; - int i; if (frame.numChannels == 2) { - for (i = 0; i < jsbound; ++i) + for (int i = 0; i < jsbound; ++i) { const int16 step = allocTable->bits; allocTable += (1 << step); @@ -2014,7 +2013,7 @@ private: si.allocation[i][1] = getBitsUint8 (step); } - for (i = jsbound; i < sblimit; ++i) + for (int i = jsbound; i < sblimit; ++i) { const int16 step = allocTable->bits; const uint8 b0 = getBitsUint8 (step); @@ -2023,7 +2022,7 @@ private: si.allocation[i][1] = b0; } - for (i = 0; i < sblimit; ++i) + for (int i = 0; i < sblimit; ++i) { scfsi[i][0] = si.allocation[i][0] ? getBitsUint8 (2) : 0; scfsi[i][1] = si.allocation[i][1] ? getBitsUint8 (2) : 0; @@ -2031,18 +2030,18 @@ private: } else { - for (i = 0; i < sblimit; ++i) + for (int i = 0; i < sblimit; ++i) { const int16 step = allocTable->bits; allocTable += (1 << step); si.allocation[i][0] = getBitsUint8 (step); } - for (i = 0; i < sblimit; ++i) + for (int i = 0; i < sblimit; ++i) scfsi[i][0] = si.allocation[i][0] ? getBitsUint8 (2) : 0; } - for (i = 0; i < sblimit; ++i) + for (int i = 0; i < sblimit; ++i) { for (int ch = 0; ch < frame.numChannels; ++ch) { @@ -2084,9 +2083,8 @@ private: { const AllocationTable* allocTable = frame.allocationTable; const int jsbound = (frame.mode == 1) ? (frame.modeExt << 2) + 4 : frame.layer2SubBandLimit; - int i; - for (i = 0; i < jsbound; ++i) + for (int i = 0; i < jsbound; ++i) { const int16 step = allocTable->bits; @@ -2124,7 +2122,7 @@ private: allocTable += (1 << step); } - for (i = jsbound; i < frame.layer2SubBandLimit; ++i) + for (int i = jsbound; i < frame.layer2SubBandLimit; ++i) { const int16 step = allocTable->bits; const uint8 ba = si.allocation[i][0]; @@ -2176,7 +2174,7 @@ private: } for (int ch = 0; ch < frame.numChannels; ++ch) - for (i = frame.layer2SubBandLimit; i < 32; ++i) + for (int i = frame.layer2SubBandLimit; i < 32; ++i) fraction[ch][0][i] = fraction[ch][1][i] = fraction[ch][2][i] = 0; } diff --git a/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp b/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp index a4bda4c4a1..847abc2b80 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp @@ -117,14 +117,13 @@ String AudioFormatManager::getWildcardForAllFormats() const { StringArray extensions; - int i; - for (i = 0; i < getNumKnownFormats(); ++i) + for (int i = 0; i < getNumKnownFormats(); ++i) extensions.addArray (getKnownFormat(i)->getFileExtensions()); extensions.trim(); extensions.removeEmptyStrings(); - for (i = 0; i < extensions.size(); ++i) + for (int i = 0; i < extensions.size(); ++i) extensions.set (i, (extensions[i].startsWithChar ('.') ? "*" : "*.") + extensions[i]); extensions.removeDuplicates (true); diff --git a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp index 85ec7403c8..b3a947ae59 100644 --- a/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST/juce_VST_Wrapper.cpp @@ -460,15 +460,14 @@ public: const int numOut = numOutChans; AudioSampleBuffer temp (numIn, numSamples); - int i; - for (i = numIn; --i >= 0;) + for (int i = numIn; --i >= 0;) memcpy (temp.getSampleData (i), outputs[i], sizeof (float) * numSamples); processReplacing (inputs, outputs, numSamples); AudioSampleBuffer dest (outputs, numOut, numSamples); - for (i = jmin (numIn, numOut); --i >= 0;) + for (int i = jmin (numIn, numOut); --i >= 0;) dest.addFrom (i, 0, temp, i, 0, numSamples); } diff --git a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp index 8c6578bcff..5e74e16529 100644 --- a/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp +++ b/modules/juce_audio_processors/processors/juce_AudioProcessorGraph.cpp @@ -665,8 +665,7 @@ private: void markAnyUnusedBuffersAsFree (const int stepIndex) { - int i; - for (i = 0; i < nodeIds.size(); ++i) + for (int i = 0; i < nodeIds.size(); ++i) { if (isNodeBusy (nodeIds.getUnchecked(i)) && ! isBufferNeededLater (stepIndex, -1, @@ -677,7 +676,7 @@ private: } } - for (i = 0; i < midiNodeIds.size(); ++i) + for (int i = 0; i < midiNodeIds.size(); ++i) { if (isNodeBusy (midiNodeIds.getUnchecked(i)) && ! isBufferNeededLater (stepIndex, -1, @@ -1296,8 +1295,7 @@ void AudioProcessorGraph::processBlock (AudioSampleBuffer& buffer, MidiBuffer& m currentMidiInputBuffer = &midiMessages; currentMidiOutputBuffer.clear(); - int i; - for (i = 0; i < renderingOps.size(); ++i) + for (int i = 0; i < renderingOps.size(); ++i) { GraphRenderingOps::AudioGraphRenderingOp* const op = (GraphRenderingOps::AudioGraphRenderingOp*) renderingOps.getUnchecked(i); @@ -1305,7 +1303,7 @@ void AudioProcessorGraph::processBlock (AudioSampleBuffer& buffer, MidiBuffer& m op->perform (renderingBuffers, midiBuffers, numSamples); } - for (i = 0; i < buffer.getNumChannels(); ++i) + for (int i = 0; i < buffer.getNumChannels(); ++i) buffer.copyFrom (i, 0, currentAudioOutputBuffer, i, 0, numSamples); midiMessages.clear(); diff --git a/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp b/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp index 06413cfe0e..f279a0dc24 100644 --- a/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp +++ b/modules/juce_audio_processors/scanning/juce_KnownPluginList.cpp @@ -291,8 +291,7 @@ public: void addToMenu (PopupMenu& m, const OwnedArray & allPlugins) const { - int i; - for (i = 0; i < subFolders.size(); ++i) + for (int i = 0; i < subFolders.size(); ++i) { const PluginFilesystemTree* const sub = subFolders.getUnchecked(i); @@ -307,7 +306,7 @@ public: #endif } - for (i = 0; i < plugins.size(); ++i) + for (int i = 0; i < plugins.size(); ++i) { PluginDescription* const plugin = plugins.getUnchecked(i); diff --git a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp index 88265c45d0..b361ea8e1d 100644 --- a/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_AudioDeviceSelectorComponent.cpp @@ -842,8 +842,7 @@ public: BigInteger& original = (type == audioInputType ? config.inputChannels : config.outputChannels); - int i; - for (i = 0; i < 256; i += 2) + for (int i = 0; i < 256; i += 2) bits.setBit (i / 2, original [i] || original [i + 1]); if (type == audioInputType) @@ -857,7 +856,7 @@ public: flipBit (bits, row, setup.minNumOutputChannels / 2, setup.maxNumOutputChannels / 2); } - for (i = 0; i < 256; ++i) + for (int i = 0; i < 256; ++i) original.setBit (i, bits [i / 2]); } else diff --git a/modules/juce_browser_plugin/wrapper/juce_NPAPI_GlueCode.cpp b/modules/juce_browser_plugin/wrapper/juce_NPAPI_GlueCode.cpp index f9c3cbe6fd..e469d247ab 100644 --- a/modules/juce_browser_plugin/wrapper/juce_NPAPI_GlueCode.cpp +++ b/modules/juce_browser_plugin/wrapper/juce_NPAPI_GlueCode.cpp @@ -671,8 +671,7 @@ public: { HeapBlock params (numParameters); - int i; - for (i = 0; i < numParameters; ++i) + for (int i = 0; i < numParameters; ++i) createNPVariantFromValue (npp, params[i], parameters[i]); if (browser.invoke (npp, source, getIdentifierFromString (methodName), @@ -682,7 +681,7 @@ public: browser.releasevariantvalue (&result); } - for (i = 0; i < numParameters; ++i) + for (int i = 0; i < numParameters; ++i) browser.releasevariantvalue (¶ms[i]); } else diff --git a/modules/juce_core/containers/juce_AbstractFifo.cpp b/modules/juce_core/containers/juce_AbstractFifo.cpp index 705e76121d..239b6c5529 100644 --- a/modules/juce_core/containers/juce_AbstractFifo.cpp +++ b/modules/juce_core/containers/juce_AbstractFifo.cpp @@ -165,11 +165,10 @@ public: jassert (size1 == 0 || (start1 >= 0 && start1 < fifo.getTotalSize())); jassert (size2 == 0 || (start2 >= 0 && start2 < fifo.getTotalSize())); - int i; - for (i = 0; i < size1; ++i) + for (int i = 0; i < size1; ++i) buffer [start1 + i] = n++; - for (i = 0; i < size2; ++i) + for (int i = 0; i < size2; ++i) buffer [start2 + i] = n++; fifo.finishedWrite (size1 + size2); diff --git a/modules/juce_core/containers/juce_SparseSet.h b/modules/juce_core/containers/juce_SparseSet.h index 1e3f1a2005..db1d37e5e0 100644 --- a/modules/juce_core/containers/juce_SparseSet.h +++ b/modules/juce_core/containers/juce_SparseSet.h @@ -221,13 +221,12 @@ public: SparseSet newItems; newItems.addRange (range); - int i; - for (i = getNumRanges(); --i >= 0;) + for (int i = getNumRanges(); --i >= 0;) newItems.removeRange (getRange (i)); removeRange (range); - for (i = newItems.getNumRanges(); --i >= 0;) + for (int i = newItems.getNumRanges(); --i >= 0;) addRange (newItems.getRange(i)); } diff --git a/modules/juce_core/network/juce_URL.cpp b/modules/juce_core/network/juce_URL.cpp index 2460626bf4..c664504281 100644 --- a/modules/juce_core/network/juce_URL.cpp +++ b/modules/juce_core/network/juce_URL.cpp @@ -160,8 +160,7 @@ namespace URLHelpers data << "--" << boundary; - int i; - for (i = 0; i < url.getParameterNames().size(); ++i) + for (int i = 0; i < url.getParameterNames().size(); ++i) { data << "\r\nContent-Disposition: form-data; name=\"" << url.getParameterNames() [i] @@ -171,7 +170,7 @@ namespace URLHelpers << boundary; } - for (i = 0; i < url.getFilesToUpload().size(); ++i) + for (int i = 0; i < url.getFilesToUpload().size(); ++i) { const File file (url.getFilesToUpload().getAllValues() [i]); const String paramName (url.getFilesToUpload().getAllKeys() [i]); diff --git a/modules/juce_graphics/geometry/juce_PathStrokeType.cpp b/modules/juce_graphics/geometry/juce_PathStrokeType.cpp index 3004dbb2a3..059974a2a1 100644 --- a/modules/juce_graphics/geometry/juce_PathStrokeType.cpp +++ b/modules/juce_graphics/geometry/juce_PathStrokeType.cpp @@ -455,8 +455,7 @@ namespace PathStrokeHelpers addLineEnd (destPath, endStyle, firstLine.rx2, firstLine.ry2, lastX1, lastY1, width); } - int i; - for (i = 1; i < subPath.size(); ++i) + for (int i = 1; i < subPath.size(); ++i) { const LineSection& l = subPath.getReference (i); @@ -503,7 +502,7 @@ namespace PathStrokeHelpers lastX2 = lastLine.rx2; lastY2 = lastLine.ry2; - for (i = subPath.size() - 1; --i >= 0;) + for (int i = subPath.size() - 1; --i >= 0;) { const LineSection& l = subPath.getReference (i); diff --git a/modules/juce_graphics/geometry/juce_RectangleList.cpp b/modules/juce_graphics/geometry/juce_RectangleList.cpp index f5b9dc790d..0ee30d3469 100644 --- a/modules/juce_graphics/geometry/juce_RectangleList.cpp +++ b/modules/juce_graphics/geometry/juce_RectangleList.cpp @@ -340,8 +340,7 @@ void RectangleList::swapWith (RectangleList& otherList) noexcept //============================================================================== void RectangleList::consolidate() { - int i; - for (i = 0; i < getNumRectangles() - 1; ++i) + for (int i = 0; i < getNumRectangles() - 1; ++i) { Rectangle& r = rects.getReference (i); const int rx1 = r.pos.x; @@ -394,7 +393,7 @@ void RectangleList::consolidate() } } - for (i = 0; i < rects.size() - 1; ++i) + for (int i = 0; i < rects.size() - 1; ++i) { Rectangle& r = rects.getReference (i); diff --git a/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp b/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp index c4eaf93812..0ba366d09c 100644 --- a/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp +++ b/modules/juce_gui_basics/keyboard/juce_KeyboardFocusTraverser.cpp @@ -57,8 +57,7 @@ namespace KeyboardFocusHelpers Array localComps; ScreenPositionComparator comparator; - int i; - for (i = parent->getNumChildComponents(); --i >= 0;) + for (int i = parent->getNumChildComponents(); --i >= 0;) { Component* const c = parent->getChildComponent (i); @@ -66,7 +65,7 @@ namespace KeyboardFocusHelpers localComps.addSorted (comparator, c); } - for (i = 0; i < localComps.size(); ++i) + for (int i = 0; i < localComps.size(); ++i) { Component* const c = localComps.getUnchecked (i); diff --git a/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.cpp b/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.cpp index 0a6ae3a41f..6f8f6eb686 100644 --- a/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.cpp +++ b/modules/juce_gui_basics/layout/juce_StretchableLayoutManager.cpp @@ -232,11 +232,10 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, int startPos) { // calculate the total sizes - int i; double totalIdealSize = 0.0; int totalMinimums = 0; - for (i = startIndex; i < endIndex; ++i) + for (int i = startIndex; i < endIndex; ++i) { ItemLayoutProperties* const layout = items.getUnchecked (i); @@ -258,7 +257,7 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, int numHavingTakenExtraSpace = 0; // first figure out how many comps want a slice of the extra space.. - for (i = startIndex; i < endIndex; ++i) + for (int i = startIndex; i < endIndex; ++i) { ItemLayoutProperties* const layout = items.getUnchecked (i); @@ -274,7 +273,7 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, } // ..share out the extra space.. - for (i = startIndex; i < endIndex; ++i) + for (int i = startIndex; i < endIndex; ++i) { ItemLayoutProperties* const layout = items.getUnchecked (i); @@ -307,7 +306,7 @@ int StretchableLayoutManager::fitComponentsIntoSpace (const int startIndex, } // ..and calculate the end position - for (i = startIndex; i < endIndex; ++i) + for (int i = startIndex; i < endIndex; ++i) { ItemLayoutProperties* const layout = items.getUnchecked(i); startPos += layout->currentSize; diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp index 4bde86fb9b..23464dd406 100644 --- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp @@ -1806,7 +1806,7 @@ private: } { - ScopedPointer context (peer->component.getLookAndFeel() + ScopedPointer context (peer->getComponent().getLookAndFeel() .createGraphicsContext (image, -totalArea.getPosition(), adjustedList)); peer->handlePaint (*context); } diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index 447371f95c..e5ee394af6 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -1821,7 +1821,7 @@ void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDis if (peer->hasNativeTitleBar()) { [peer->window setStyleMask: (NSViewComponentPeer::getNSWindowStyleMask (peer->getStyleFlags()))]; - peer->setTitle (peer->component.getName()); // required to force the OS to update the title + peer->setTitle (peer->getComponent().getName()); // required to force the OS to update the title } [NSApp setPresentationOptions: NSApplicationPresentationDefault]; diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index cbec63fd5c..7be3cfff09 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -477,6 +477,7 @@ public: : ComponentPeer (comp, windowStyleFlags), dontRepaint (false), currentRenderingEngine (softwareRenderingEngine), + lastPaintTime (0), fullScreen (false), isDragging (false), isMouseOver (false), @@ -805,9 +806,9 @@ public: // Must be careful not to try to put a topmost window behind a normal one, or Windows // promotes the normal one to be topmost! - if (component.isAlwaysOnTop() == otherPeer->component.isAlwaysOnTop()) + if (component.isAlwaysOnTop() == otherPeer->getComponent().isAlwaysOnTop()) SetWindowPos (hwnd, otherPeer->hwnd, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); - else if (otherPeer->component.isAlwaysOnTop()) + else if (otherPeer->getComponent().isAlwaysOnTop()) SetWindowPos (hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOSENDCHANGING); } } @@ -1071,6 +1072,7 @@ private: #if JUCE_DIRECT2D ScopedPointer direct2DContext; #endif + uint32 lastPaintTime; bool fullScreen, isDragging, isMouseOver, hasCreatedCaret, constrainerIsResizing; BorderSize windowBorder; HICON currentWindowIcon; diff --git a/modules/juce_gui_basics/positioning/juce_MarkerList.cpp b/modules/juce_gui_basics/positioning/juce_MarkerList.cpp index cbf6e0524a..a62e99d279 100644 --- a/modules/juce_gui_basics/positioning/juce_MarkerList.cpp +++ b/modules/juce_gui_basics/positioning/juce_MarkerList.cpp @@ -263,8 +263,7 @@ void MarkerList::ValueTreeWrapper::applyTo (MarkerList& markerList) StringArray updatedMarkers; - int i; - for (i = 0; i < numMarkers; ++i) + for (int i = 0; i < numMarkers; ++i) { const ValueTree marker (state.getChild (i)); const String name (marker [nameProperty].toString()); @@ -272,7 +271,7 @@ void MarkerList::ValueTreeWrapper::applyTo (MarkerList& markerList) updatedMarkers.add (name); } - for (i = markerList.getNumMarkers(); --i >= 0;) + for (int i = markerList.getNumMarkers(); --i >= 0;) if (! updatedMarkers.contains (markerList.getMarker (i)->name)) markerList.removeMarker (i); } diff --git a/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp b/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp index 9e04dc79d8..b42f873e81 100644 --- a/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp +++ b/modules/juce_gui_basics/positioning/juce_RelativeCoordinatePositioner.cpp @@ -325,11 +325,10 @@ void RelativeCoordinatePositionerBase::registerMarkerListListener (MarkerList* c void RelativeCoordinatePositionerBase::unregisterListeners() { - int i; - for (i = sourceComponents.size(); --i >= 0;) + for (int i = sourceComponents.size(); --i >= 0;) sourceComponents.getUnchecked(i)->removeComponentListener (this); - for (i = sourceMarkerLists.size(); --i >= 0;) + for (int i = sourceMarkerLists.size(); --i >= 0;) sourceMarkerLists.getUnchecked(i)->removeListener (this); sourceComponents.clear(); diff --git a/modules/juce_gui_basics/widgets/juce_ListBox.cpp b/modules/juce_gui_basics/widgets/juce_ListBox.cpp index 7c5e08fda2..58e9d32dae 100644 --- a/modules/juce_gui_basics/widgets/juce_ListBox.cpp +++ b/modules/juce_gui_basics/widgets/juce_ListBox.cpp @@ -865,8 +865,7 @@ Image ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY) Rectangle imageArea; const int firstRow = getRowContainingPosition (0, 0); - int i; - for (i = getNumRowsOnScreen() + 2; --i >= 0;) + for (int i = getNumRowsOnScreen() + 2; --i >= 0;) { Component* rowComp = viewport->getComponentForRowIfOnscreen (firstRow + i); @@ -883,7 +882,7 @@ Image ListBox::createSnapshotOfSelectedRows (int& imageX, int& imageY) imageY = imageArea.getY(); Image snapshot (Image::ARGB, imageArea.getWidth(), imageArea.getHeight(), true); - for (i = getNumRowsOnScreen() + 2; --i >= 0;) + for (int i = getNumRowsOnScreen() + 2; --i >= 0;) { Component* rowComp = viewport->getComponentForRowIfOnscreen (firstRow + i); diff --git a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp index 7ed5b2afe8..37f667e2d3 100644 --- a/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp +++ b/modules/juce_gui_basics/widgets/juce_TableHeaderComponent.cpp @@ -322,8 +322,7 @@ void TableHeaderComponent::resizeColumnsToFit (int firstColumnIndex, int targetT targetTotalWidth = jmax (targetTotalWidth, 0); StretchableObjectResizer sor; - int i; - for (i = firstColumnIndex; i < columns.size(); ++i) + for (int i = firstColumnIndex; i < columns.size(); ++i) { ColumnInfo* const ci = columns.getUnchecked(i); @@ -334,7 +333,7 @@ void TableHeaderComponent::resizeColumnsToFit (int firstColumnIndex, int targetT sor.resizeToFit (targetTotalWidth); int visIndex = 0; - for (i = firstColumnIndex; i < columns.size(); ++i) + for (int i = firstColumnIndex; i < columns.size(); ++i) { ColumnInfo* const ci = columns.getUnchecked(i); diff --git a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp index e502aa28ff..5a397758ad 100644 --- a/modules/juce_gui_basics/widgets/juce_TextEditor.cpp +++ b/modules/juce_gui_basics/widgets/juce_TextEditor.cpp @@ -145,11 +145,10 @@ public: if (index == indexToBreakAt) { - int j; - for (j = i; j < atoms.size(); ++j) + for (int j = i; j < atoms.size(); ++j) section2->atoms.add (getAtom (j)); - for (j = atoms.size(); --j >= i;) + for (int j = atoms.size(); --j >= i;) atoms.remove (j); break; @@ -168,11 +167,10 @@ public: atom->width = font.getStringWidthFloat (atom->getText (passwordCharacter)); atom->numChars = (uint16) (indexToBreakAt - index); - int j; - for (j = i + 1; j < atoms.size(); ++j) + for (int j = i + 1; j < atoms.size(); ++j) section2->atoms.add (getAtom (j)); - for (j = atoms.size(); --j > i;) + for (int j = atoms.size(); --j > i;) atoms.remove (j); break; diff --git a/modules/juce_gui_basics/widgets/juce_Toolbar.cpp b/modules/juce_gui_basics/widgets/juce_Toolbar.cpp index f8cbc9637c..186d0ed72e 100644 --- a/modules/juce_gui_basics/widgets/juce_Toolbar.cpp +++ b/modules/juce_gui_basics/widgets/juce_Toolbar.cpp @@ -441,8 +441,7 @@ void Toolbar::updateAllItemPositions (const bool animate) { StretchableObjectResizer resizer; - int i; - for (i = 0; i < items.size(); ++i) + for (int i = 0; i < items.size(); ++i) { ToolbarItemComponent* const tc = items.getUnchecked(i); @@ -473,7 +472,7 @@ void Toolbar::updateAllItemPositions (const bool animate) int totalLength = 0; - for (i = 0; i < resizer.getNumItems(); ++i) + for (int i = 0; i < resizer.getNumItems(); ++i) totalLength += (int) resizer.getItemSize (i); const bool itemsOffTheEnd = totalLength > getLength(); @@ -495,7 +494,7 @@ void Toolbar::updateAllItemPositions (const bool animate) : getLength(); int pos = 0, activeIndex = 0; - for (i = 0; i < items.size(); ++i) + for (int i = 0; i < items.size(); ++i) { ToolbarItemComponent* const tc = items.getUnchecked(i); diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp index 514f76f783..28dd40b6f7 100644 --- a/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp +++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.cpp @@ -23,9 +23,6 @@ ============================================================================== */ -//#define JUCE_ENABLE_REPAINT_DEBUGGING 1 - -//============================================================================== static Array heavyweightPeers; static uint32 lastUniqueID = 1; @@ -33,7 +30,6 @@ static uint32 lastUniqueID = 1; ComponentPeer::ComponentPeer (Component& component_, const int styleFlags_) : component (component_), styleFlags (styleFlags_), - lastPaintTime (0), constrainer (nullptr), lastDragAndDropCompUnderMouse (nullptr), uniqueID (lastUniqueID += 2), // increment by 2 so that this can never hit 0 @@ -84,7 +80,8 @@ void ComponentPeer::updateCurrentModifiers() noexcept } //============================================================================== -void ComponentPeer::handleMouseEvent (const int touchIndex, const Point& positionWithinPeer, const ModifierKeys& newMods, const int64 time) +void ComponentPeer::handleMouseEvent (const int touchIndex, const Point& positionWithinPeer, + const ModifierKeys& newMods, const int64 time) { MouseInputSource* const mouse = Desktop::getInstance().getMouseSource (touchIndex); jassert (mouse != nullptr); // not enough sources! @@ -92,7 +89,8 @@ void ComponentPeer::handleMouseEvent (const int touchIndex, const Point& po mouse->handleEvent (this, positionWithinPeer, time, newMods); } -void ComponentPeer::handleMouseWheel (const int touchIndex, const Point& positionWithinPeer, const int64 time, const MouseWheelDetails& wheel) +void ComponentPeer::handleMouseWheel (const int touchIndex, const Point& positionWithinPeer, + const int64 time, const MouseWheelDetails& wheel) { MouseInputSource* const mouse = Desktop::getInstance().getMouseSource (touchIndex); jassert (mouse != nullptr); // not enough sources! @@ -142,36 +140,27 @@ Component* ComponentPeer::getTargetForKeyPress() if (c == nullptr) c = &component; + if (c->isCurrentlyBlockedByAnotherModalComponent()) + if (Component* const currentModalComp = Component::getCurrentlyModalComponent()) + c = currentModalComp; + return c; } bool ComponentPeer::handleKeyPress (const int keyCode, const juce_wchar textCharacter) { updateCurrentModifiers(); - - Component* target = getTargetForKeyPress(); - - if (target->isCurrentlyBlockedByAnotherModalComponent()) - { - Component* const currentModalComp = Component::getCurrentlyModalComponent(); - - if (currentModalComp != nullptr) - target = currentModalComp; - } + bool keyWasUsed = false; const KeyPress keyInfo (keyCode, - ModifierKeys::getCurrentModifiers().getRawFlags() - & ModifierKeys::allKeyboardModifiers, + ModifierKeys::getCurrentModifiers().withoutMouseButtons(), textCharacter); - bool keyWasUsed = false; - - while (target != nullptr) + for (Component* target = getTargetForKeyPress(); target != nullptr; target = target->getParentComponent()) { const WeakReference deletionChecker (target); - const Array * const keyListeners = target->keyListeners; - if (keyListeners != nullptr) + if (const Array * const keyListeners = target->keyListeners) { for (int i = keyListeners->size(); --i >= 0;) { @@ -189,9 +178,7 @@ bool ComponentPeer::handleKeyPress (const int keyCode, const juce_wchar textChar if (keyWasUsed || deletionChecker == nullptr) break; - Component* const currentlyFocused = Component::getCurrentlyFocusedComponent(); - - if (currentlyFocused != nullptr) + if (Component* const currentlyFocused = Component::getCurrentlyFocusedComponent()) { const bool isTab = (keyInfo == KeyPress::tabKey); const bool isShiftTab = (keyInfo == KeyPress (KeyPress::tabKey, ModifierKeys::shiftModifier, 0)); @@ -203,8 +190,6 @@ bool ComponentPeer::handleKeyPress (const int keyCode, const juce_wchar textChar break; } } - - target = target->getParentComponent(); } return keyWasUsed; @@ -213,20 +198,9 @@ bool ComponentPeer::handleKeyPress (const int keyCode, const juce_wchar textChar bool ComponentPeer::handleKeyUpOrDown (const bool isKeyDown) { updateCurrentModifiers(); - - Component* target = getTargetForKeyPress(); - - if (target->isCurrentlyBlockedByAnotherModalComponent()) - { - Component* const currentModalComp = Component::getCurrentlyModalComponent(); - - if (currentModalComp != nullptr) - target = currentModalComp; - } - bool keyWasUsed = false; - while (target != nullptr) + for (Component* target = getTargetForKeyPress(); target != nullptr; target = target->getParentComponent()) { const WeakReference deletionChecker (target); @@ -235,9 +209,7 @@ bool ComponentPeer::handleKeyUpOrDown (const bool isKeyDown) if (keyWasUsed || deletionChecker == nullptr) break; - const Array * const keyListeners = target->keyListeners; - - if (keyListeners != nullptr) + if (const Array * const keyListeners = target->keyListeners) { for (int i = keyListeners->size(); --i >= 0;) { @@ -249,8 +221,6 @@ bool ComponentPeer::handleKeyUpOrDown (const bool isKeyDown) i = jmin (i, keyListeners->size()); } } - - target = target->getParentComponent(); } return keyWasUsed; @@ -275,19 +245,16 @@ void ComponentPeer::handleModifierKeysChange() TextInputTarget* ComponentPeer::findCurrentTextInputTarget() { Component* const c = Component::getCurrentlyFocusedComponent(); + if (component.isParentOf (c)) - { - TextInputTarget* const ti = dynamic_cast (c); - if (ti != nullptr && ti->isTextInputActive()) - return ti; - } + if (TextInputTarget* const ti = dynamic_cast (c)) + if (ti->isTextInputActive()) + return ti; return nullptr; } -void ComponentPeer::dismissPendingTextInput() -{ -} +void ComponentPeer::dismissPendingTextInput() {} //============================================================================== void ComponentPeer::handleBroughtToFront() @@ -431,7 +398,7 @@ namespace DragHelpers : dynamic_cast (target)->isInterestedInTextDrag (info.text); } - static Component* findDragAndDropTarget (Component* c, const ComponentPeer::DragInfo& info, Component* lastOne) + static Component* findDragAndDropTarget (Component* c, const ComponentPeer::DragInfo& info, Component* const lastOne) { for (; c != nullptr; c = c->getParentComponent()) if (isSuitableTarget (info, c) && (c == lastOne || isInterested (info, c))) @@ -445,18 +412,16 @@ namespace DragHelpers class AsyncDropMessage : public CallbackMessage { public: - AsyncDropMessage (Component* target_, const ComponentPeer::DragInfo& info_) - : target (target_), info (info_) - {} + AsyncDropMessage (Component* c, const ComponentPeer::DragInfo& d) : target (c), info (d) {} void messageCallback() { - if (target.get() != nullptr) + if (Component* const c = target.get()) { if (isFileDrag (info)) - dynamic_cast (target.get())->filesDropped (info.files, info.position.x, info.position.y); + dynamic_cast (c)->filesDropped (info.files, info.position.x, info.position.y); else - dynamic_cast (target.get())->textDropped (info.text, info.position.x, info.position.y); + dynamic_cast (c)->textDropped (info.text, info.position.x, info.position.y); } } @@ -474,7 +439,7 @@ bool ComponentPeer::handleDragMove (const ComponentPeer::DragInfo& info) Component* const compUnderMouse = component.getComponentAt (info.position); - Component* const lastTarget = dragAndDropTargetComponent.get(); + Component* const lastTarget = dragAndDropTargetComponent; Component* newTarget = nullptr; if (compUnderMouse != lastDragAndDropCompUnderMouse) @@ -539,9 +504,7 @@ bool ComponentPeer::handleDragDrop (const ComponentPeer::DragInfo& info) { handleDragMove (info); - Component* const targetComp = dragAndDropTargetComponent; - - if (targetComp != nullptr) + if (Component* const targetComp = dragAndDropTargetComponent) { dragAndDropTargetComponent = nullptr; lastDragAndDropCompUnderMouse = nullptr; @@ -586,16 +549,6 @@ void ComponentPeer::addMaskedRegion (const Rectangle& area) } //============================================================================== -StringArray ComponentPeer::getAvailableRenderingEngines() -{ - return StringArray ("Software Renderer"); -} - -int ComponentPeer::getCurrentRenderingEngine() const -{ - return 0; -} - -void ComponentPeer::setCurrentRenderingEngine (int /*index*/) -{ -} +StringArray ComponentPeer::getAvailableRenderingEngines() { return StringArray ("Software Renderer"); } +int ComponentPeer::getCurrentRenderingEngine() const { return 0; } +void ComponentPeer::setCurrentRenderingEngine (int index) { jassert (index == 0); (void) index; } diff --git a/modules/juce_gui_basics/windows/juce_ComponentPeer.h b/modules/juce_gui_basics/windows/juce_ComponentPeer.h index 83a7a72d28..42c17b9bc6 100644 --- a/modules/juce_gui_basics/windows/juce_ComponentPeer.h +++ b/modules/juce_gui_basics/windows/juce_ComponentPeer.h @@ -96,7 +96,6 @@ public: Component& getComponent() noexcept { return component; } /** Returns the set of style flags that were set when the window was created. - @see Component::addToDesktop */ int getStyleFlags() const noexcept { return styleFlags; } @@ -130,7 +129,6 @@ public: virtual void setPosition (int x, int y) = 0; /** Resizes the window without changing its position. - This should result in a callback to handleMovedOrResized(). */ virtual void setSize (int w, int h) = 0; @@ -184,12 +182,10 @@ public: /** Returns the size to restore to if fullscreen mode is turned off. */ const Rectangle& getNonFullScreenBounds() const noexcept; - /** Attempts to change the icon associated with this window. - */ + /** Attempts to change the icon associated with this window. */ virtual void setIcon (const Image& newIcon) = 0; /** Sets a constrainer to use if the peer can resize itself. - The constrainer won't be deleted by this object, so the caller must manage its lifetime. */ void setConstrainer (ComponentBoundsConstrainer* newConstrainer) noexcept; @@ -206,21 +202,18 @@ public: virtual bool contains (const Point& position, bool trueIfInAChildWindow) const = 0; /** Returns the size of the window frame that's around this window. - Whether or not the window has a normal window frame depends on the flags that were set when the window was created by Component::addToDesktop() */ virtual BorderSize getFrameSize() const = 0; /** This is called when the window's bounds change. - A peer implementation must call this when the window is moved and resized, so that this method can pass the message on to the component. */ void handleMovedOrResized(); /** This is called if the screen resolution changes. - A peer implementation must call this if the monitor arrangement changes or the available screen size changes. */ @@ -232,7 +225,6 @@ public: //============================================================================== /** Sets this window to either be always-on-top or normal. - Some kinds of window might not be able to do this, so should return false. */ virtual bool setAlwaysOnTop (bool alwaysOnTop) = 0; @@ -263,7 +255,6 @@ public: Component* getLastFocusedSubcomponent() const noexcept; /** Called when a key is pressed. - For keycode info, see the KeyPress class. Returns true if the keystroke was used. */ @@ -351,12 +342,14 @@ public: */ static ComponentPeer* getPeer (int index) noexcept; + /** Returns the peer that's attached to the given component, or nullptr if there isn't one. */ + static ComponentPeer* getPeerFor (const Component*) noexcept; + /** Checks if this peer object is valid. @see getNumPeers */ static bool isValidPeer (const ComponentPeer* peer) noexcept; - //============================================================================== virtual StringArray getAvailableRenderingEngines(); virtual int getCurrentRenderingEngine() const; @@ -368,7 +361,6 @@ protected: const int styleFlags; RectangleList maskedRegion; Rectangle lastNonFullscreenBounds; - uint32 lastPaintTime; ComponentBoundsConstrainer* constrainer; static void updateCurrentModifiers() noexcept; @@ -378,16 +370,9 @@ private: WeakReference lastFocusedComponent, dragAndDropTargetComponent; Component* lastDragAndDropCompUnderMouse; const uint32 uniqueID; - bool fakeMouseMessageSent : 1, isWindowMinimised : 1; - - friend class Component; - friend class Desktop; - static ComponentPeer* getPeerFor (const Component*) noexcept; + bool fakeMouseMessageSent, isWindowMinimised; Component* getTargetForKeyPress(); - void setLastDragDropTarget (Component*); - bool finishDrag (bool); - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ComponentPeer); };