1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Changed some pass-by-references to pass-by-value to improve compiler optimisation.

This commit is contained in:
jules 2013-05-22 23:05:53 -06:00
parent 51df5143bf
commit c7506df13f
140 changed files with 757 additions and 756 deletions

View file

@ -155,7 +155,7 @@ void SourceCodeEditor::setEditor (CodeEditorComponent* newEditor)
editor->getDocument().addListener (this);
}
void SourceCodeEditor::scrollToKeepRangeOnScreen (const Range<int>& range)
void SourceCodeEditor::scrollToKeepRangeOnScreen (Range<int> range)
{
const int space = jmin (10, editor->getNumLinesOnScreen() / 3);
const CodeDocument::Position start (editor->getDocument(), range.getStart());
@ -164,7 +164,7 @@ void SourceCodeEditor::scrollToKeepRangeOnScreen (const Range<int>& range)
editor->scrollToKeepLinesOnScreen (Range<int> (start.getLineNumber() - space, end.getLineNumber() + space));
}
void SourceCodeEditor::highlight (const Range<int>& range, bool cursorAtStart)
void SourceCodeEditor::highlight (Range<int> range, bool cursorAtStart)
{
scrollToKeepRangeOnScreen (range);

View file

@ -146,8 +146,8 @@ public:
void createEditor (CodeDocument& codeDocument);
void setEditor (CodeEditorComponent*);
void scrollToKeepRangeOnScreen (const Range<int>& range);
void highlight (const Range<int>& range, bool cursorAtStart);
void scrollToKeepRangeOnScreen (Range<int> range);
void highlight (Range<int> range, bool cursorAtStart);
ScopedPointer<CodeEditorComponent> editor;

View file

@ -231,7 +231,7 @@ void PaintElementPath::rescalePoint (RelativePositionedRectangle& pos, int dx, i
}
//==============================================================================
static void drawArrow (Graphics& g, const Point<float>& p1, const Point<float>& p2)
static void drawArrow (Graphics& g, const Point<float> p1, const Point<float> p2)
{
g.drawArrow (Line<float> (p1.x, p1.y, (p1.x + p2.x) * 0.5f, (p1.y + p2.y) * 0.5f), 1.0f, 8.0f, 10.0f);
g.drawLine (p1.x + (p2.x - p1.x) * 0.49f, p1.y + (p2.y - p1.y) * 0.49f, p2.x, p2.y);

View file

@ -71,22 +71,22 @@ public:
class BigEndian
{
public:
template <class SampleFormatType> static inline float getAsFloat (SampleFormatType& s) noexcept { return s.getAsFloatBE(); }
template <class SampleFormatType> static inline void setAsFloat (SampleFormatType& s, float newValue) noexcept { s.setAsFloatBE (newValue); }
template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType& s) noexcept { return s.getAsInt32BE(); }
template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType& s, int32 newValue) noexcept { s.setAsInt32BE (newValue); }
template <class SourceType, class DestType> static inline void copyFrom (DestType& dest, SourceType& source) noexcept { dest.copyFromBE (source); }
template <class SampleFormatType> static inline float getAsFloat (SampleFormatType s) noexcept { return s.getAsFloatBE(); }
template <class SampleFormatType> static inline void setAsFloat (SampleFormatType s, float newValue) noexcept { s.setAsFloatBE (newValue); }
template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType s) noexcept { return s.getAsInt32BE(); }
template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType s, int32 newValue) noexcept { s.setAsInt32BE (newValue); }
template <class SourceType, class DestType> static inline void copyFrom (DestType dest, SourceType source) noexcept { dest.copyFromBE (source); }
enum { isBigEndian = 1 };
};
class LittleEndian
{
public:
template <class SampleFormatType> static inline float getAsFloat (SampleFormatType& s) noexcept { return s.getAsFloatLE(); }
template <class SampleFormatType> static inline void setAsFloat (SampleFormatType& s, float newValue) noexcept { s.setAsFloatLE (newValue); }
template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType& s) noexcept { return s.getAsInt32LE(); }
template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType& s, int32 newValue) noexcept { s.setAsInt32LE (newValue); }
template <class SourceType, class DestType> static inline void copyFrom (DestType& dest, SourceType& source) noexcept { dest.copyFromLE (source); }
template <class SampleFormatType> static inline float getAsFloat (SampleFormatType s) noexcept { return s.getAsFloatLE(); }
template <class SampleFormatType> static inline void setAsFloat (SampleFormatType s, float newValue) noexcept { s.setAsFloatLE (newValue); }
template <class SampleFormatType> static inline int32 getAsInt32 (SampleFormatType s) noexcept { return s.getAsInt32LE(); }
template <class SampleFormatType> static inline void setAsInt32 (SampleFormatType s, int32 newValue) noexcept { s.setAsInt32LE (newValue); }
template <class SourceType, class DestType> static inline void copyFrom (DestType dest, SourceType source) noexcept { dest.copyFromLE (source); }
enum { isBigEndian = 0 };
};
@ -114,9 +114,9 @@ public:
inline void setAsInt32BE (int newValue) noexcept { setAsInt32LE (newValue); }
inline void clear() noexcept { *data = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, (size_t) (num * bytesPerSample)) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int8& source) noexcept { *data = *source.data; }
template <class SourceType> inline void copyFromLE (SourceType source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int8 source) noexcept { *data = *source.data; }
int8* data;
enum { bytesPerSample = 1, maxValue = 0x7f, resolution = (1 << 24), isFloat = 0 };
@ -139,9 +139,9 @@ public:
inline void setAsInt32BE (int newValue) noexcept { setAsInt32LE (newValue); }
inline void clear() noexcept { *data = 128; }
inline void clearMultiple (int num) noexcept { memset (data, 128, (size_t) num) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (UInt8& source) noexcept { *data = *source.data; }
template <class SourceType> inline void copyFromLE (SourceType source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (UInt8 source) noexcept { *data = *source.data; }
uint8* data;
enum { bytesPerSample = 1, maxValue = 0x7f, resolution = (1 << 24), isFloat = 0 };
@ -164,9 +164,9 @@ public:
inline void setAsInt32BE (int32 newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint16) (newValue >> 16)); }
inline void clear() noexcept { *data = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, (size_t) (num * bytesPerSample)) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int16& source) noexcept { *data = *source.data; }
template <class SourceType> inline void copyFromLE (SourceType source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int16 source) noexcept { *data = *source.data; }
uint16* data;
enum { bytesPerSample = 2, maxValue = 0x7fff, resolution = (1 << 16), isFloat = 0 };
@ -189,9 +189,9 @@ public:
inline void setAsInt32BE (int32 newValue) noexcept { ByteOrder::bigEndian24BitToChars (newValue >> 8, data); }
inline void clear() noexcept { data[0] = 0; data[1] = 0; data[2] = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, (size_t) (num * bytesPerSample)) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int24& source) noexcept { data[0] = source.data[0]; data[1] = source.data[1]; data[2] = source.data[2]; }
template <class SourceType> inline void copyFromLE (SourceType source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int24 source) noexcept { data[0] = source.data[0]; data[1] = source.data[1]; data[2] = source.data[2]; }
char* data;
enum { bytesPerSample = 3, maxValue = 0x7fffff, resolution = (1 << 8), isFloat = 0 };
@ -214,9 +214,9 @@ public:
inline void setAsInt32BE (int32 newValue) noexcept { *data = ByteOrder::swapIfLittleEndian ((uint32) newValue); }
inline void clear() noexcept { *data = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, (size_t) (num * bytesPerSample)) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int32& source) noexcept { *data = *source.data; }
template <class SourceType> inline void copyFromLE (SourceType source) noexcept { setAsInt32LE (source.getAsInt32()); }
template <class SourceType> inline void copyFromBE (SourceType source) noexcept { setAsInt32BE (source.getAsInt32()); }
inline void copyFromSameType (Int32 source) noexcept { *data = *source.data; }
uint32* data;
enum { bytesPerSample = 4, maxValue = 0x7fffffff, resolution = 1, isFloat = 0 };
@ -246,9 +246,9 @@ public:
inline void setAsInt32BE (int32 newValue) noexcept { setAsFloatBE ((float) (newValue * (1.0 / (1.0 + maxValue)))); }
inline void clear() noexcept { *data = 0; }
inline void clearMultiple (int num) noexcept { zeromem (data, (size_t) (num * bytesPerSample)) ;}
template <class SourceType> inline void copyFromLE (SourceType& source) noexcept { setAsFloatLE (source.getAsFloat()); }
template <class SourceType> inline void copyFromBE (SourceType& source) noexcept { setAsFloatBE (source.getAsFloat()); }
inline void copyFromSameType (Float32& source) noexcept { *data = *source.data; }
template <class SourceType> inline void copyFromLE (SourceType source) noexcept { setAsFloatLE (source.getAsFloat()); }
template <class SourceType> inline void copyFromBE (SourceType source) noexcept { setAsFloatBE (source.getAsFloat()); }
inline void copyFromSameType (Float32 source) noexcept { *data = *source.data; }
float* data;
enum { bytesPerSample = 4, maxValue = 0x7fffffff, resolution = (1 << 8), isFloat = 1 };
@ -262,10 +262,10 @@ public:
inline NonInterleaved (const NonInterleaved&) noexcept {}
inline NonInterleaved (const int) noexcept {}
inline void copyFrom (const NonInterleaved&) noexcept {}
template <class SampleFormatType> inline void advanceData (SampleFormatType& s) noexcept { s.advance(); }
template <class SampleFormatType> inline void advanceDataBy (SampleFormatType& s, int numSamples) noexcept { s.skip (numSamples); }
template <class SampleFormatType> inline void clear (SampleFormatType& s, int numSamples) noexcept { s.clearMultiple (numSamples); }
template <class SampleFormatType> inline static int getNumBytesBetweenSamples (const SampleFormatType&) noexcept { return SampleFormatType::bytesPerSample; }
template <class SampleFormatType> inline void advanceData (SampleFormatType s) noexcept { s.advance(); }
template <class SampleFormatType> inline void advanceDataBy (SampleFormatType s, int numSamples) noexcept { s.skip (numSamples); }
template <class SampleFormatType> inline void clear (SampleFormatType s, int numSamples) noexcept { s.clearMultiple (numSamples); }
template <class SampleFormatType> inline static int getNumBytesBetweenSamples (const SampleFormatType) noexcept { return SampleFormatType::bytesPerSample; }
enum { isInterleavedType = 0, numInterleavedChannels = 1 };
};
@ -276,11 +276,11 @@ public:
inline Interleaved() noexcept : numInterleavedChannels (1) {}
inline Interleaved (const Interleaved& other) noexcept : numInterleavedChannels (other.numInterleavedChannels) {}
inline Interleaved (const int numInterleavedChans) noexcept : numInterleavedChannels (numInterleavedChans) {}
inline void copyFrom (const Interleaved& other) noexcept { numInterleavedChannels = other.numInterleavedChannels; }
template <class SampleFormatType> inline void advanceData (SampleFormatType& s) noexcept { s.skip (numInterleavedChannels); }
template <class SampleFormatType> inline void advanceDataBy (SampleFormatType& s, int numSamples) noexcept { s.skip (numInterleavedChannels * numSamples); }
template <class SampleFormatType> inline void clear (SampleFormatType& s, int numSamples) noexcept { while (--numSamples >= 0) { s.clear(); s.skip (numInterleavedChannels); } }
template <class SampleFormatType> inline int getNumBytesBetweenSamples (const SampleFormatType&) const noexcept { return numInterleavedChannels * SampleFormatType::bytesPerSample; }
inline void copyFrom (const Interleaved other) noexcept { numInterleavedChannels = other.numInterleavedChannels; }
template <class SampleFormatType> inline void advanceData (SampleFormatType s) noexcept { s.skip (numInterleavedChannels); }
template <class SampleFormatType> inline void advanceDataBy (SampleFormatType s, int numSamples) noexcept { s.skip (numInterleavedChannels * numSamples); }
template <class SampleFormatType> inline void clear (SampleFormatType s, int numSamples) noexcept { while (--numSamples >= 0) { s.clear(); s.skip (numInterleavedChannels); } }
template <class SampleFormatType> inline int getNumBytesBetweenSamples (const SampleFormatType) const noexcept { return numInterleavedChannels * SampleFormatType::bytesPerSample; }
int numInterleavedChannels;
enum { isInterleavedType = 1 };
};
@ -362,7 +362,7 @@ public:
{
}
Pointer& operator= (const Pointer& other) noexcept
Pointer operator= (const Pointer other) noexcept
{
InterleavingType::operator= (other);
data = other.data;
@ -407,13 +407,13 @@ public:
}
/** Moves the pointer along to the next sample. */
inline Pointer& operator++() noexcept { advance(); return *this; }
inline Pointer operator++() noexcept { advance(); return *this; }
/** Moves the pointer back to the previous sample. */
inline Pointer& operator--() noexcept { this->advanceDataBy (data, -1); return *this; }
inline Pointer operator--() noexcept { this->advanceDataBy (data, -1); return *this; }
/** Adds a number of samples to the pointer's position. */
Pointer& operator+= (int samplesToJump) noexcept { this->advanceDataBy (data, samplesToJump); return *this; }
Pointer operator+= (int samplesToJump) noexcept { this->advanceDataBy (data, samplesToJump); return *this; }
/** Writes a stream of samples into this pointer from another pointer.
This will copy the specified number of samples, converting between formats appropriately.

View file

@ -38,7 +38,7 @@ const char* const WavAudioFormat::bwavCodingHistory = "bwav coding history";
StringPairArray WavAudioFormat::createBWAVMetadata (const String& description,
const String& originator,
const String& originatorRef,
const Time& date,
const Time date,
const int64 timeReferenceSamples,
const String& codingHistory)
{

View file

@ -106,7 +106,7 @@ public:
static StringPairArray createBWAVMetadata (const String& description,
const String& originator,
const String& originatorRef,
const Time& dateAndTime,
const Time dateAndTime,
const int64 timeReferenceSamples,
const String& codingHistory);

View file

@ -395,7 +395,7 @@ bool MemoryMappedAudioFormatReader::mapEntireFile()
return mapSectionOfFile (Range<int64> (0, lengthInSamples));
}
bool MemoryMappedAudioFormatReader::mapSectionOfFile (const Range<int64>& samplesToMap)
bool MemoryMappedAudioFormatReader::mapSectionOfFile (Range<int64> samplesToMap)
{
if (map == nullptr || samplesToMap != mappedSection)
{

View file

@ -62,16 +62,16 @@ public:
bool mapEntireFile();
/** Attempts to map a section of the file into memory. */
bool mapSectionOfFile (const Range<int64>& samplesToMap);
bool mapSectionOfFile (Range<int64> samplesToMap);
/** Returns the sample range that's currently memory-mapped and available for reading. */
const Range<int64>& getMappedSection() const noexcept { return mappedSection; }
Range<int64> getMappedSection() const noexcept { return mappedSection; }
/** Touches the memory for the given sample, to force it to be loaded into active memory. */
void touchSample (int64 sample) const noexcept;
/** Returns the number of bytes currently being mapped */
size_t getNumBytesUsed() const { return map != nullptr ? map->getSize() : 0; }
size_t getNumBytesUsed() const { return map != nullptr ? map->getSize() : 0; }
protected:
File file;

View file

@ -89,7 +89,7 @@ namespace
return Time();
}
bool timesAreDifferent (const Time& t1, const Time& t2) noexcept
bool timesAreDifferent (const Time t1, const Time t2) noexcept
{
return t1 != t2 || t1 == Time();
}

View file

@ -266,7 +266,7 @@ int MidiKeyboardComponent::getKeyStartPosition (const int midiNoteNumber) const
const uint8 MidiKeyboardComponent::whiteNotes[] = { 0, 2, 4, 5, 7, 9, 11 };
const uint8 MidiKeyboardComponent::blackNotes[] = { 1, 3, 6, 8, 10 };
int MidiKeyboardComponent::xyToNote (const Point<int>& pos, float& mousePositionVelocity)
int MidiKeyboardComponent::xyToNote (Point<int> pos, float& mousePositionVelocity)
{
if (! reallyContains (pos, false))
return -1;
@ -286,7 +286,7 @@ int MidiKeyboardComponent::xyToNote (const Point<int>& pos, float& mousePosition
return remappedXYToNote (p + Point<int> (xOffset, 0), mousePositionVelocity);
}
int MidiKeyboardComponent::remappedXYToNote (const Point<int>& pos, float& mousePositionVelocity) const
int MidiKeyboardComponent::remappedXYToNote (Point<int> pos, float& mousePositionVelocity) const
{
if (pos.getY() < blackNoteLength)
{
@ -692,7 +692,7 @@ void MidiKeyboardComponent::updateNoteUnderMouse (const MouseEvent& e, bool isDo
updateNoteUnderMouse (e.getPosition(), isDown, e.source.getIndex());
}
void MidiKeyboardComponent::updateNoteUnderMouse (const Point<int>& pos, bool isDown, int fingerNum)
void MidiKeyboardComponent::updateNoteUnderMouse (Point<int> pos, bool isDown, int fingerNum)
{
float mousePositionVelocity = 0.0f;
const int newNote = xyToNote (pos, mousePositionVelocity);

View file

@ -398,10 +398,10 @@ private:
static const uint8 blackNotes[];
void getKeyPos (int midiNoteNumber, int& x, int& w) const;
int xyToNote (const Point<int>&, float& mousePositionVelocity);
int remappedXYToNote (const Point<int>&, float& mousePositionVelocity) const;
int xyToNote (Point<int>, float& mousePositionVelocity);
int remappedXYToNote (Point<int>, float& mousePositionVelocity) const;
void resetAnyKeysInUse();
void updateNoteUnderMouse (const Point<int>&, bool isDown, int fingerNum);
void updateNoteUnderMouse (Point<int>, bool isDown, int fingerNum);
void updateNoteUnderMouse (const MouseEvent&, bool isDown);
void repaintNote (const int midiNoteNumber);
void setLowestVisibleKeyFloat (float noteNumber);

View file

@ -27,7 +27,7 @@ NamedValueSet::NamedValue::NamedValue() noexcept
{
}
inline NamedValueSet::NamedValue::NamedValue (const Identifier& n, const var& v)
inline NamedValueSet::NamedValue::NamedValue (const Identifier n, const var& v)
: name (n), value (v)
{
}
@ -52,7 +52,7 @@ NamedValueSet::NamedValue::NamedValue (NamedValue&& other) noexcept
{
}
inline NamedValueSet::NamedValue::NamedValue (const Identifier& n, var&& v)
inline NamedValueSet::NamedValue::NamedValue (const Identifier n, var&& v)
: name (n), value (static_cast <var&&> (v))
{
}
@ -138,7 +138,7 @@ int NamedValueSet::size() const noexcept
return values.size();
}
const var& NamedValueSet::operator[] (const Identifier& name) const
const var& NamedValueSet::operator[] (const Identifier name) const
{
for (NamedValue* i = values; i != nullptr; i = i->nextListItem)
if (i->name == name)
@ -147,7 +147,7 @@ const var& NamedValueSet::operator[] (const Identifier& name) const
return var::null;
}
var NamedValueSet::getWithDefault (const Identifier& name, const var& defaultReturnValue) const
var NamedValueSet::getWithDefault (const Identifier name, const var& defaultReturnValue) const
{
if (const var* const v = getVarPointer (name))
return *v;
@ -155,7 +155,7 @@ var NamedValueSet::getWithDefault (const Identifier& name, const var& defaultRet
return defaultReturnValue;
}
var* NamedValueSet::getVarPointer (const Identifier& name) const noexcept
var* NamedValueSet::getVarPointer (const Identifier name) const noexcept
{
for (NamedValue* i = values; i != nullptr; i = i->nextListItem)
if (i->name == name)
@ -165,7 +165,7 @@ var* NamedValueSet::getVarPointer (const Identifier& name) const noexcept
}
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
bool NamedValueSet::set (const Identifier& name, var&& newValue)
bool NamedValueSet::set (const Identifier name, var&& newValue)
{
LinkedListPointer<NamedValue>* i = &values;
@ -190,7 +190,7 @@ bool NamedValueSet::set (const Identifier& name, var&& newValue)
}
#endif
bool NamedValueSet::set (const Identifier& name, const var& newValue)
bool NamedValueSet::set (const Identifier name, const var& newValue)
{
LinkedListPointer<NamedValue>* i = &values;
@ -214,12 +214,12 @@ bool NamedValueSet::set (const Identifier& name, const var& newValue)
return true;
}
bool NamedValueSet::contains (const Identifier& name) const
bool NamedValueSet::contains (const Identifier name) const
{
return getVarPointer (name) != nullptr;
}
bool NamedValueSet::remove (const Identifier& name)
bool NamedValueSet::remove (const Identifier name)
{
LinkedListPointer<NamedValue>* i = &values;

View file

@ -71,35 +71,35 @@ public:
If the name isn't found, this will return a void variant.
@see getProperty
*/
const var& operator[] (const Identifier& name) const;
const var& operator[] (const Identifier name) const;
/** Tries to return the named value, but if no such value is found, this will
instead return the supplied default value.
*/
var getWithDefault (const Identifier& name, const var& defaultReturnValue) const;
var getWithDefault (const Identifier name, const var& defaultReturnValue) const;
/** Changes or adds a named value.
@returns true if a value was changed or added; false if the
value was already set the the value passed-in.
*/
bool set (const Identifier& name, const var& newValue);
bool set (const Identifier name, const var& newValue);
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
/** Changes or adds a named value.
@returns true if a value was changed or added; false if the
value was already set the the value passed-in.
*/
bool set (const Identifier& name, var&& newValue);
bool set (const Identifier name, var&& newValue);
#endif
/** Returns true if the set contains an item with the specified name. */
bool contains (const Identifier& name) const;
bool contains (const Identifier name) const;
/** Removes a value from the set.
@returns true if a value was removed; false if there was no value
with the name that was given.
*/
bool remove (const Identifier& name);
bool remove (const Identifier name);
/** Returns the name of the value at a given index.
The index must be between 0 and size() - 1.
@ -121,7 +121,7 @@ public:
Do not use this method unless you really need access to the internal var object
for some reason - for normal reading and writing always prefer operator[]() and set().
*/
var* getVarPointer (const Identifier& name) const noexcept;
var* getVarPointer (const Identifier name) const noexcept;
//==============================================================================
/** Sets properties to the values of all of an XML element's attributes. */
@ -139,11 +139,11 @@ private:
public:
NamedValue() noexcept;
NamedValue (const NamedValue&);
NamedValue (const Identifier& name, const var& value);
NamedValue (const Identifier name, const var& value);
NamedValue& operator= (const NamedValue&);
#if JUCE_COMPILER_SUPPORTS_MOVE_SEMANTICS
NamedValue (NamedValue&&) noexcept;
NamedValue (const Identifier& name, var&& value);
NamedValue (const Identifier name, var&& value);
NamedValue& operator= (NamedValue&&) noexcept;
#endif
bool operator== (const NamedValue& other) const noexcept;

View file

@ -162,7 +162,7 @@ public:
/** Adds a range of contiguous values to the set.
e.g. addRange (Range \<int\> (10, 14)) will add (10, 11, 12, 13) to the set.
*/
void addRange (const Range<Type>& range)
void addRange (const Range<Type> range)
{
jassert (range.getLength() >= 0);
if (range.getLength() > 0)
@ -179,7 +179,7 @@ public:
/** Removes a range of values from the set.
e.g. removeRange (Range\<int\> (10, 14)) will remove (10, 11, 12, 13) from the set.
*/
void removeRange (const Range<Type>& rangeToRemove)
void removeRange (const Range<Type> rangeToRemove)
{
jassert (rangeToRemove.getLength() >= 0);
@ -216,7 +216,7 @@ public:
}
/** Does an XOR of the values in a given range. */
void invertRange (const Range<Type>& range)
void invertRange (const Range<Type> range)
{
SparseSet newItems;
newItems.addRange (range);
@ -231,7 +231,7 @@ public:
}
/** Checks whether any part of a given range overlaps any part of this set. */
bool overlapsRange (const Range<Type>& range)
bool overlapsRange (const Range<Type> range)
{
if (range.getLength() > 0)
{
@ -249,7 +249,7 @@ public:
}
/** Checks whether the whole of a given range is contained within this one. */
bool containsRange (const Range<Type>& range)
bool containsRange (const Range<Type> range)
{
if (range.getLength() > 0)
{

View file

@ -495,7 +495,7 @@ bool operator!= (const var& v1, const char* const v2) { return v1.toString
//==============================================================================
var var::operator[] (const Identifier& propertyName) const
var var::operator[] (const Identifier propertyName) const
{
if (DynamicObject* const o = getDynamicObject())
return o->getProperty (propertyName);
@ -508,7 +508,7 @@ var var::operator[] (const char* const propertyName) const
return operator[] (Identifier (propertyName));
}
var var::getProperty (const Identifier& propertyName, const var& defaultReturnValue) const
var var::getProperty (const Identifier propertyName, const var& defaultReturnValue) const
{
if (DynamicObject* const o = getDynamicObject())
return o->getProperties().getWithDefault (propertyName, defaultReturnValue);
@ -516,7 +516,7 @@ var var::getProperty (const Identifier& propertyName, const var& defaultReturnVa
return defaultReturnValue;
}
var var::invoke (const Identifier& method, const var* arguments, int numArguments) const
var var::invoke (const Identifier method, const var* arguments, int numArguments) const
{
if (DynamicObject* const o = getDynamicObject())
return o->invokeMethod (method, arguments, numArguments);
@ -534,35 +534,35 @@ var var::invokeMethod (DynamicObject* const target, const var* const arguments,
return var::null;
}
var var::call (const Identifier& method) const
var var::call (const Identifier method) const
{
return invoke (method, nullptr, 0);
}
var var::call (const Identifier& method, const var& arg1) const
var var::call (const Identifier method, const var& arg1) const
{
return invoke (method, &arg1, 1);
}
var var::call (const Identifier& method, const var& arg1, const var& arg2) const
var var::call (const Identifier method, const var& arg1, const var& arg2) const
{
var args[] = { arg1, arg2 };
return invoke (method, args, 2);
}
var var::call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3)
var var::call (const Identifier method, const var& arg1, const var& arg2, const var& arg3)
{
var args[] = { arg1, arg2, arg3 };
return invoke (method, args, 3);
}
var var::call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const
var var::call (const Identifier method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const
{
var args[] = { arg1, arg2, arg3, arg4 };
return invoke (method, args, 4);
}
var var::call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const
var var::call (const Identifier method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const
{
var args[] = { arg1, arg2, arg3, arg4, arg5 };
return invoke (method, args, 5);

View file

@ -220,27 +220,27 @@ public:
//==============================================================================
/** If this variant is an object, this returns one of its properties. */
var operator[] (const Identifier& propertyName) const;
var operator[] (const Identifier propertyName) const;
/** If this variant is an object, this returns one of its properties. */
var operator[] (const char* propertyName) const;
/** If this variant is an object, this returns one of its properties, or a default
fallback value if the property is not set. */
var getProperty (const Identifier& propertyName, const var& defaultReturnValue) const;
var getProperty (const Identifier propertyName, const var& defaultReturnValue) const;
/** If this variant is an object, this invokes one of its methods with no arguments. */
var call (const Identifier& method) const;
var call (const Identifier method) const;
/** If this variant is an object, this invokes one of its methods with one argument. */
var call (const Identifier& method, const var& arg1) const;
var call (const Identifier method, const var& arg1) const;
/** If this variant is an object, this invokes one of its methods with 2 arguments. */
var call (const Identifier& method, const var& arg1, const var& arg2) const;
var call (const Identifier method, const var& arg1, const var& arg2) const;
/** If this variant is an object, this invokes one of its methods with 3 arguments. */
var call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3);
var call (const Identifier method, const var& arg1, const var& arg2, const var& arg3);
/** If this variant is an object, this invokes one of its methods with 4 arguments. */
var call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const;
var call (const Identifier method, const var& arg1, const var& arg2, const var& arg3, const var& arg4) const;
/** If this variant is an object, this invokes one of its methods with 5 arguments. */
var call (const Identifier& method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const;
var call (const Identifier method, const var& arg1, const var& arg2, const var& arg3, const var& arg4, const var& arg5) const;
/** If this variant is an object, this invokes one of its methods with a list of arguments. */
var invoke (const Identifier& method, const var* arguments, int numArguments) const;
var invoke (const Identifier method, const var* arguments, int numArguments) const;
//==============================================================================
/** Writes a binary representation of this value to a stream.

View file

@ -457,13 +457,13 @@ Result File::createDirectory() const
}
//==============================================================================
Time File::getLastModificationTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (m); }
Time File::getLastAccessTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (a); }
Time File::getCreationTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (c); }
Time File::getLastModificationTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (m); }
Time File::getLastAccessTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (a); }
Time File::getCreationTime() const { int64 m, a, c; getFileTimesInternal (m, a, c); return Time (c); }
bool File::setLastModificationTime (const Time& t) const { return setFileTimesInternal (t.toMilliseconds(), 0, 0); }
bool File::setLastAccessTime (const Time& t) const { return setFileTimesInternal (0, t.toMilliseconds(), 0); }
bool File::setCreationTime (const Time& t) const { return setFileTimesInternal (0, 0, t.toMilliseconds()); }
bool File::setLastModificationTime (Time t) const { return setFileTimesInternal (t.toMilliseconds(), 0, 0); }
bool File::setLastAccessTime (Time t) const { return setFileTimesInternal (0, t.toMilliseconds(), 0); }
bool File::setCreationTime (Time t) const { return setFileTimesInternal (0, 0, t.toMilliseconds()); }
//==============================================================================
bool File::loadFileAsData (MemoryBlock& destBlock) const

View file

@ -392,7 +392,7 @@ public:
@returns true if it manages to change the file's time.
@see getLastModificationTime, setLastAccessTime, setCreationTime
*/
bool setLastModificationTime (const Time& newTime) const;
bool setLastModificationTime (Time newTime) const;
/** Changes the last-access time for this file.
@ -400,7 +400,7 @@ public:
@returns true if it manages to change the file's time.
@see getLastAccessTime, setLastModificationTime, setCreationTime
*/
bool setLastAccessTime (const Time& newTime) const;
bool setLastAccessTime (Time newTime) const;
/** Changes the creation date for this file.
@ -408,7 +408,7 @@ public:
@returns true if it manages to change the file's time.
@see getCreationTime, setLastModificationTime, setLastAccessTime
*/
bool setCreationTime (const Time& newTime) const;
bool setCreationTime (Time newTime) const;
/** If possible, this will try to create a version string for the given file.

View file

@ -58,7 +58,7 @@ public:
}
/** Copies another range object. */
Range& operator= (const Range& other) noexcept
Range& operator= (Range other) noexcept
{
start = other.start;
end = other.end;
@ -167,7 +167,7 @@ public:
//==============================================================================
/** Adds an amount to the start and end of the range. */
inline const Range& operator+= (const ValueType amountToAdd) noexcept
inline Range operator+= (const ValueType amountToAdd) noexcept
{
start += amountToAdd;
end += amountToAdd;
@ -175,7 +175,7 @@ public:
}
/** Subtracts an amount from the start and end of the range. */
inline const Range& operator-= (const ValueType amountToSubtract) noexcept
inline Range operator-= (const ValueType amountToSubtract) noexcept
{
start -= amountToSubtract;
end -= amountToSubtract;
@ -197,8 +197,8 @@ public:
return Range (start - amountToSubtract, end - amountToSubtract);
}
bool operator== (const Range& other) const noexcept { return start == other.start && end == other.end; }
bool operator!= (const Range& other) const noexcept { return start != other.start || end != other.end; }
bool operator== (Range other) const noexcept { return start == other.start && end == other.end; }
bool operator!= (Range other) const noexcept { return start != other.start || end != other.end; }
//==============================================================================
/** Returns true if the given position lies inside this range. */
@ -214,27 +214,27 @@ public:
}
/** Returns true if the given range lies entirely inside this range. */
bool contains (const Range& other) const noexcept
bool contains (Range other) const noexcept
{
return start <= other.start && end >= other.end;
}
/** Returns true if the given range intersects this one. */
bool intersects (const Range& other) const noexcept
bool intersects (Range other) const noexcept
{
return other.start < end && start < other.end;
}
/** Returns the range that is the intersection of the two ranges, or an empty range
with an undefined start position if they don't overlap. */
Range getIntersectionWith (const Range& other) const noexcept
Range getIntersectionWith (Range other) const noexcept
{
return Range (jmax (start, other.start),
jmin (end, other.end));
}
/** Returns the smallest range that contains both this one and the other one. */
Range getUnionWith (const Range& other) const noexcept
Range getUnionWith (Range other) const noexcept
{
return Range (jmin (start, other.start),
jmax (end, other.end));
@ -250,7 +250,7 @@ public:
will be the new range, shifted forwards or backwards so that it doesn't extend
beyond this one, but keeping its original length.
*/
Range constrainRange (const Range& rangeToConstrain) const noexcept
Range constrainRange (Range rangeToConstrain) const noexcept
{
const ValueType otherLen = rangeToConstrain.getLength();
return getLength() <= otherLen

View file

@ -51,25 +51,25 @@ public:
{
}
inline CharPointer_ASCII& operator= (const CharPointer_ASCII& other) noexcept
inline CharPointer_ASCII operator= (const CharPointer_ASCII other) noexcept
{
data = other.data;
return *this;
}
inline CharPointer_ASCII& operator= (const CharType* text) noexcept
inline CharPointer_ASCII operator= (const CharType* text) noexcept
{
data = const_cast <CharType*> (text);
return *this;
}
/** This is a pointer comparison, it doesn't compare the actual text. */
inline bool operator== (const CharPointer_ASCII& other) const noexcept { return data == other.data; }
inline bool operator!= (const CharPointer_ASCII& other) const noexcept { return data != other.data; }
inline bool operator<= (const CharPointer_ASCII& other) const noexcept { return data <= other.data; }
inline bool operator< (const CharPointer_ASCII& other) const noexcept { return data < other.data; }
inline bool operator>= (const CharPointer_ASCII& other) const noexcept { return data >= other.data; }
inline bool operator> (const CharPointer_ASCII& other) const noexcept { return data > other.data; }
inline bool operator== (CharPointer_ASCII other) const noexcept { return data == other.data; }
inline bool operator!= (CharPointer_ASCII other) const noexcept { return data != other.data; }
inline bool operator<= (CharPointer_ASCII other) const noexcept { return data <= other.data; }
inline bool operator< (CharPointer_ASCII other) const noexcept { return data < other.data; }
inline bool operator>= (CharPointer_ASCII other) const noexcept { return data >= other.data; }
inline bool operator> (CharPointer_ASCII other) const noexcept { return data > other.data; }
/** Returns the address that this pointer is pointing to. */
inline CharType* getAddress() const noexcept { return data; }
@ -84,14 +84,14 @@ public:
inline juce_wchar operator*() const noexcept { return (juce_wchar) (uint8) *data; }
/** Moves this pointer along to the next character in the string. */
inline CharPointer_ASCII& operator++() noexcept
inline CharPointer_ASCII operator++() noexcept
{
++data;
return *this;
}
/** Moves this pointer to the previous character in the string. */
inline CharPointer_ASCII& operator--() noexcept
inline CharPointer_ASCII operator--() noexcept
{
--data;
return *this;
@ -168,7 +168,7 @@ public:
}
/** Returns the number of characters in this string, or up to the given end pointer, whichever is lower. */
size_t lengthUpTo (const CharPointer_ASCII& end) const noexcept
size_t lengthUpTo (const CharPointer_ASCII end) const noexcept
{
return CharacterFunctions::lengthUpTo (*this, end);
}
@ -194,7 +194,7 @@ public:
The value returned does NOT include the terminating null character.
*/
template <class CharPointer>
static size_t getBytesRequiredFor (const CharPointer& text) noexcept
static size_t getBytesRequiredFor (const CharPointer text) noexcept
{
return text.length();
}
@ -207,13 +207,13 @@ public:
/** Copies a source string to this pointer, advancing this pointer as it goes. */
template <typename CharPointer>
void writeAll (const CharPointer& src) noexcept
void writeAll (const CharPointer src) noexcept
{
CharacterFunctions::copyAll (*this, src);
}
/** Copies a source string to this pointer, advancing this pointer as it goes. */
void writeAll (const CharPointer_ASCII& src) noexcept
void writeAll (const CharPointer_ASCII src) noexcept
{
strcpy (data, src.data);
}
@ -223,7 +223,7 @@ public:
to the destination buffer before stopping.
*/
template <typename CharPointer>
size_t writeWithDestByteLimit (const CharPointer& src, const size_t maxDestBytes) noexcept
size_t writeWithDestByteLimit (const CharPointer src, const size_t maxDestBytes) noexcept
{
return CharacterFunctions::copyWithDestByteLimit (*this, src, maxDestBytes);
}
@ -233,45 +233,45 @@ public:
written to the destination buffer before stopping (including the terminating null).
*/
template <typename CharPointer>
void writeWithCharLimit (const CharPointer& src, const int maxChars) noexcept
void writeWithCharLimit (const CharPointer src, const int maxChars) noexcept
{
CharacterFunctions::copyWithCharLimit (*this, src, maxChars);
}
/** Compares this string with another one. */
template <typename CharPointer>
int compare (const CharPointer& other) const noexcept
int compare (const CharPointer other) const noexcept
{
return CharacterFunctions::compare (*this, other);
}
/** Compares this string with another one. */
int compare (const CharPointer_ASCII& other) const noexcept
int compare (const CharPointer_ASCII other) const noexcept
{
return strcmp (data, other.data);
}
/** Compares this string with another one, up to a specified number of characters. */
template <typename CharPointer>
int compareUpTo (const CharPointer& other, const int maxChars) const noexcept
int compareUpTo (const CharPointer other, const int maxChars) const noexcept
{
return CharacterFunctions::compareUpTo (*this, other, maxChars);
}
/** Compares this string with another one, up to a specified number of characters. */
int compareUpTo (const CharPointer_ASCII& other, const int maxChars) const noexcept
int compareUpTo (const CharPointer_ASCII other, const int maxChars) const noexcept
{
return strncmp (data, other.data, (size_t) maxChars);
}
/** Compares this string with another one. */
template <typename CharPointer>
int compareIgnoreCase (const CharPointer& other) const
int compareIgnoreCase (const CharPointer other) const
{
return CharacterFunctions::compareIgnoreCase (*this, other);
}
int compareIgnoreCase (const CharPointer_ASCII& other) const
int compareIgnoreCase (const CharPointer_ASCII other) const
{
#if JUCE_WINDOWS
return stricmp (data, other.data);
@ -282,14 +282,14 @@ public:
/** Compares this string with another one, up to a specified number of characters. */
template <typename CharPointer>
int compareIgnoreCaseUpTo (const CharPointer& other, const int maxChars) const noexcept
int compareIgnoreCaseUpTo (const CharPointer other, const int maxChars) const noexcept
{
return CharacterFunctions::compareIgnoreCaseUpTo (*this, other, maxChars);
}
/** Returns the character index of a substring, or -1 if it isn't found. */
template <typename CharPointer>
int indexOf (const CharPointer& stringToFind) const noexcept
int indexOf (const CharPointer stringToFind) const noexcept
{
return CharacterFunctions::indexOf (*this, stringToFind);
}

View file

@ -52,25 +52,25 @@ public:
{
}
inline CharPointer_UTF16& operator= (const CharPointer_UTF16& other) noexcept
inline CharPointer_UTF16 operator= (CharPointer_UTF16 other) noexcept
{
data = other.data;
return *this;
}
inline CharPointer_UTF16& operator= (const CharType* text) noexcept
inline CharPointer_UTF16 operator= (const CharType* text) noexcept
{
data = const_cast <CharType*> (text);
return *this;
}
/** This is a pointer comparison, it doesn't compare the actual text. */
inline bool operator== (const CharPointer_UTF16& other) const noexcept { return data == other.data; }
inline bool operator!= (const CharPointer_UTF16& other) const noexcept { return data != other.data; }
inline bool operator<= (const CharPointer_UTF16& other) const noexcept { return data <= other.data; }
inline bool operator< (const CharPointer_UTF16& other) const noexcept { return data < other.data; }
inline bool operator>= (const CharPointer_UTF16& other) const noexcept { return data >= other.data; }
inline bool operator> (const CharPointer_UTF16& other) const noexcept { return data > other.data; }
inline bool operator== (CharPointer_UTF16 other) const noexcept { return data == other.data; }
inline bool operator!= (CharPointer_UTF16 other) const noexcept { return data != other.data; }
inline bool operator<= (CharPointer_UTF16 other) const noexcept { return data <= other.data; }
inline bool operator< (CharPointer_UTF16 other) const noexcept { return data < other.data; }
inline bool operator>= (CharPointer_UTF16 other) const noexcept { return data >= other.data; }
inline bool operator> (CharPointer_UTF16 other) const noexcept { return data > other.data; }
/** Returns the address that this pointer is pointing to. */
inline CharType* getAddress() const noexcept { return data; }
@ -93,7 +93,7 @@ public:
}
/** Moves this pointer along to the next character in the string. */
CharPointer_UTF16& operator++() noexcept
CharPointer_UTF16 operator++() noexcept
{
const juce_wchar n = *data++;
@ -104,7 +104,7 @@ public:
}
/** Moves this pointer back to the previous character in the string. */
CharPointer_UTF16& operator--() noexcept
CharPointer_UTF16 operator--() noexcept
{
const juce_wchar n = *--data;
@ -231,7 +231,7 @@ public:
}
/** Returns the number of characters in this string, or up to the given end pointer, whichever is lower. */
size_t lengthUpTo (const CharPointer_UTF16& end) const noexcept
size_t lengthUpTo (const CharPointer_UTF16 end) const noexcept
{
return CharacterFunctions::lengthUpTo (*this, end);
}
@ -281,13 +281,13 @@ public:
/** Copies a source string to this pointer, advancing this pointer as it goes. */
template <typename CharPointer>
void writeAll (const CharPointer& src) noexcept
void writeAll (const CharPointer src) noexcept
{
CharacterFunctions::copyAll (*this, src);
}
/** Copies a source string to this pointer, advancing this pointer as it goes. */
void writeAll (const CharPointer_UTF16& src) noexcept
void writeAll (const CharPointer_UTF16 src) noexcept
{
const CharType* s = src.data;
@ -303,7 +303,7 @@ public:
to the destination buffer before stopping.
*/
template <typename CharPointer>
size_t writeWithDestByteLimit (const CharPointer& src, const size_t maxDestBytes) noexcept
size_t writeWithDestByteLimit (const CharPointer src, const size_t maxDestBytes) noexcept
{
return CharacterFunctions::copyWithDestByteLimit (*this, src, maxDestBytes);
}
@ -313,51 +313,51 @@ public:
written to the destination buffer before stopping (including the terminating null).
*/
template <typename CharPointer>
void writeWithCharLimit (const CharPointer& src, const int maxChars) noexcept
void writeWithCharLimit (const CharPointer src, const int maxChars) noexcept
{
CharacterFunctions::copyWithCharLimit (*this, src, maxChars);
}
/** Compares this string with another one. */
template <typename CharPointer>
int compare (const CharPointer& other) const noexcept
int compare (const CharPointer other) const noexcept
{
return CharacterFunctions::compare (*this, other);
}
/** Compares this string with another one, up to a specified number of characters. */
template <typename CharPointer>
int compareUpTo (const CharPointer& other, const int maxChars) const noexcept
int compareUpTo (const CharPointer other, const int maxChars) const noexcept
{
return CharacterFunctions::compareUpTo (*this, other, maxChars);
}
/** Compares this string with another one. */
template <typename CharPointer>
int compareIgnoreCase (const CharPointer& other) const noexcept
int compareIgnoreCase (const CharPointer other) const noexcept
{
return CharacterFunctions::compareIgnoreCase (*this, other);
}
/** Compares this string with another one, up to a specified number of characters. */
template <typename CharPointer>
int compareIgnoreCaseUpTo (const CharPointer& other, const int maxChars) const noexcept
int compareIgnoreCaseUpTo (const CharPointer other, const int maxChars) const noexcept
{
return CharacterFunctions::compareIgnoreCaseUpTo (*this, other, maxChars);
}
#if JUCE_WINDOWS && ! DOXYGEN
int compareIgnoreCase (const CharPointer_UTF16& other) const noexcept
int compareIgnoreCase (const CharPointer_UTF16 other) const noexcept
{
return _wcsicmp (data, other.data);
}
int compareIgnoreCaseUpTo (const CharPointer_UTF16& other, int maxChars) const noexcept
int compareIgnoreCaseUpTo (const CharPointer_UTF16 other, int maxChars) const noexcept
{
return _wcsnicmp (data, other.data, (size_t) maxChars);
}
int indexOf (const CharPointer_UTF16& stringToFind) const noexcept
int indexOf (const CharPointer_UTF16 stringToFind) const noexcept
{
const CharType* const t = wcsstr (data, stringToFind.getAddress());
return t == nullptr ? -1 : (int) (t - data);
@ -366,7 +366,7 @@ public:
/** Returns the character index of a substring, or -1 if it isn't found. */
template <typename CharPointer>
int indexOf (const CharPointer& stringToFind) const noexcept
int indexOf (const CharPointer stringToFind) const noexcept
{
return CharacterFunctions::indexOf (*this, stringToFind);
}
@ -466,7 +466,7 @@ public:
}
/** Atomically swaps this pointer for a new value, returning the previous value. */
CharPointer_UTF16 atomicSwap (const CharPointer_UTF16& newValue)
CharPointer_UTF16 atomicSwap (const CharPointer_UTF16 newValue)
{
return CharPointer_UTF16 (reinterpret_cast <Atomic<CharType*>&> (data).exchange (newValue.data));
}

View file

@ -48,25 +48,25 @@ public:
{
}
inline CharPointer_UTF32& operator= (const CharPointer_UTF32& other) noexcept
inline CharPointer_UTF32 operator= (CharPointer_UTF32 other) noexcept
{
data = other.data;
return *this;
}
inline CharPointer_UTF32& operator= (const CharType* text) noexcept
inline CharPointer_UTF32 operator= (const CharType* text) noexcept
{
data = const_cast <CharType*> (text);
return *this;
}
/** This is a pointer comparison, it doesn't compare the actual text. */
inline bool operator== (const CharPointer_UTF32& other) const noexcept { return data == other.data; }
inline bool operator!= (const CharPointer_UTF32& other) const noexcept { return data != other.data; }
inline bool operator<= (const CharPointer_UTF32& other) const noexcept { return data <= other.data; }
inline bool operator< (const CharPointer_UTF32& other) const noexcept { return data < other.data; }
inline bool operator>= (const CharPointer_UTF32& other) const noexcept { return data >= other.data; }
inline bool operator> (const CharPointer_UTF32& other) const noexcept { return data > other.data; }
inline bool operator== (CharPointer_UTF32 other) const noexcept { return data == other.data; }
inline bool operator!= (CharPointer_UTF32 other) const noexcept { return data != other.data; }
inline bool operator<= (CharPointer_UTF32 other) const noexcept { return data <= other.data; }
inline bool operator< (CharPointer_UTF32 other) const noexcept { return data < other.data; }
inline bool operator>= (CharPointer_UTF32 other) const noexcept { return data >= other.data; }
inline bool operator> (CharPointer_UTF32 other) const noexcept { return data > other.data; }
/** Returns the address that this pointer is pointing to. */
inline CharType* getAddress() const noexcept { return data; }
@ -81,14 +81,14 @@ public:
inline juce_wchar operator*() const noexcept { return *data; }
/** Moves this pointer along to the next character in the string. */
inline CharPointer_UTF32& operator++() noexcept
inline CharPointer_UTF32 operator++() noexcept
{
++data;
return *this;
}
/** Moves this pointer to the previous character in the string. */
inline CharPointer_UTF32& operator--() noexcept
inline CharPointer_UTF32 operator--() noexcept
{
--data;
return *this;
@ -172,7 +172,7 @@ public:
}
/** Returns the number of characters in this string, or up to the given end pointer, whichever is lower. */
size_t lengthUpTo (const CharPointer_UTF32& end) const noexcept
size_t lengthUpTo (const CharPointer_UTF32 end) const noexcept
{
return CharacterFunctions::lengthUpTo (*this, end);
}
@ -198,7 +198,7 @@ public:
The value returned does NOT include the terminating null character.
*/
template <class CharPointer>
static size_t getBytesRequiredFor (const CharPointer& text) noexcept
static size_t getBytesRequiredFor (const CharPointer text) noexcept
{
return sizeof (CharType) * text.length();
}
@ -211,13 +211,13 @@ public:
/** Copies a source string to this pointer, advancing this pointer as it goes. */
template <typename CharPointer>
void writeAll (const CharPointer& src) noexcept
void writeAll (const CharPointer src) noexcept
{
CharacterFunctions::copyAll (*this, src);
}
/** Copies a source string to this pointer, advancing this pointer as it goes. */
void writeAll (const CharPointer_UTF32& src) noexcept
void writeAll (const CharPointer_UTF32 src) noexcept
{
const CharType* s = src.data;
@ -233,7 +233,7 @@ public:
to the destination buffer before stopping.
*/
template <typename CharPointer>
size_t writeWithDestByteLimit (const CharPointer& src, const size_t maxDestBytes) noexcept
size_t writeWithDestByteLimit (const CharPointer src, const size_t maxDestBytes) noexcept
{
return CharacterFunctions::copyWithDestByteLimit (*this, src, maxDestBytes);
}
@ -243,21 +243,21 @@ public:
written to the destination buffer before stopping (including the terminating null).
*/
template <typename CharPointer>
void writeWithCharLimit (const CharPointer& src, const int maxChars) noexcept
void writeWithCharLimit (const CharPointer src, const int maxChars) noexcept
{
CharacterFunctions::copyWithCharLimit (*this, src, maxChars);
}
/** Compares this string with another one. */
template <typename CharPointer>
int compare (const CharPointer& other) const noexcept
int compare (const CharPointer other) const noexcept
{
return CharacterFunctions::compare (*this, other);
}
#if JUCE_NATIVE_WCHAR_IS_UTF32 && ! JUCE_ANDROID
/** Compares this string with another one. */
int compare (const CharPointer_UTF32& other) const noexcept
int compare (const CharPointer_UTF32 other) const noexcept
{
return wcscmp (data, other.data);
}
@ -265,28 +265,28 @@ public:
/** Compares this string with another one, up to a specified number of characters. */
template <typename CharPointer>
int compareUpTo (const CharPointer& other, const int maxChars) const noexcept
int compareUpTo (const CharPointer other, const int maxChars) const noexcept
{
return CharacterFunctions::compareUpTo (*this, other, maxChars);
}
/** Compares this string with another one. */
template <typename CharPointer>
int compareIgnoreCase (const CharPointer& other) const
int compareIgnoreCase (const CharPointer other) const
{
return CharacterFunctions::compareIgnoreCase (*this, other);
}
/** Compares this string with another one, up to a specified number of characters. */
template <typename CharPointer>
int compareIgnoreCaseUpTo (const CharPointer& other, const int maxChars) const noexcept
int compareIgnoreCaseUpTo (const CharPointer other, const int maxChars) const noexcept
{
return CharacterFunctions::compareIgnoreCaseUpTo (*this, other, maxChars);
}
/** Returns the character index of a substring, or -1 if it isn't found. */
template <typename CharPointer>
int indexOf (const CharPointer& stringToFind) const noexcept
int indexOf (const CharPointer stringToFind) const noexcept
{
return CharacterFunctions::indexOf (*this, stringToFind);
}
@ -362,7 +362,7 @@ public:
}
/** Atomically swaps this pointer for a new value, returning the previous value. */
CharPointer_UTF32 atomicSwap (const CharPointer_UTF32& newValue)
CharPointer_UTF32 atomicSwap (const CharPointer_UTF32 newValue)
{
return CharPointer_UTF32 (reinterpret_cast <Atomic<CharType*>&> (data).exchange (newValue.data));
}

View file

@ -47,25 +47,25 @@ public:
{
}
inline CharPointer_UTF8& operator= (const CharPointer_UTF8& other) noexcept
inline CharPointer_UTF8 operator= (CharPointer_UTF8 other) noexcept
{
data = other.data;
return *this;
}
inline CharPointer_UTF8& operator= (const CharType* text) noexcept
inline CharPointer_UTF8 operator= (const CharType* text) noexcept
{
data = const_cast <CharType*> (text);
return *this;
}
/** This is a pointer comparison, it doesn't compare the actual text. */
inline bool operator== (const CharPointer_UTF8& other) const noexcept { return data == other.data; }
inline bool operator!= (const CharPointer_UTF8& other) const noexcept { return data != other.data; }
inline bool operator<= (const CharPointer_UTF8& other) const noexcept { return data <= other.data; }
inline bool operator< (const CharPointer_UTF8& other) const noexcept { return data < other.data; }
inline bool operator>= (const CharPointer_UTF8& other) const noexcept { return data >= other.data; }
inline bool operator> (const CharPointer_UTF8& other) const noexcept { return data > other.data; }
inline bool operator== (CharPointer_UTF8 other) const noexcept { return data == other.data; }
inline bool operator!= (CharPointer_UTF8 other) const noexcept { return data != other.data; }
inline bool operator<= (CharPointer_UTF8 other) const noexcept { return data <= other.data; }
inline bool operator< (CharPointer_UTF8 other) const noexcept { return data < other.data; }
inline bool operator>= (CharPointer_UTF8 other) const noexcept { return data >= other.data; }
inline bool operator> (CharPointer_UTF8 other) const noexcept { return data > other.data; }
/** Returns the address that this pointer is pointing to. */
inline CharType* getAddress() const noexcept { return data; }
@ -132,7 +132,7 @@ public:
}
/** Moves this pointer back to the previous character in the string. */
CharPointer_UTF8& operator--() noexcept
CharPointer_UTF8 operator--() noexcept
{
int count = 0;
@ -271,7 +271,7 @@ public:
}
/** Returns the number of characters in this string, or up to the given end pointer, whichever is lower. */
size_t lengthUpTo (const CharPointer_UTF8& end) const noexcept
size_t lengthUpTo (const CharPointer_UTF8 end) const noexcept
{
return CharacterFunctions::lengthUpTo (*this, end);
}
@ -363,13 +363,13 @@ public:
/** Copies a source string to this pointer, advancing this pointer as it goes. */
template <typename CharPointer>
void writeAll (const CharPointer& src) noexcept
void writeAll (const CharPointer src) noexcept
{
CharacterFunctions::copyAll (*this, src);
}
/** Copies a source string to this pointer, advancing this pointer as it goes. */
void writeAll (const CharPointer_UTF8& src) noexcept
void writeAll (const CharPointer_UTF8 src) noexcept
{
const CharType* s = src.data;
@ -385,7 +385,7 @@ public:
to the destination buffer before stopping.
*/
template <typename CharPointer>
size_t writeWithDestByteLimit (const CharPointer& src, const size_t maxDestBytes) noexcept
size_t writeWithDestByteLimit (const CharPointer src, const size_t maxDestBytes) noexcept
{
return CharacterFunctions::copyWithDestByteLimit (*this, src, maxDestBytes);
}
@ -395,34 +395,34 @@ public:
written to the destination buffer before stopping (including the terminating null).
*/
template <typename CharPointer>
void writeWithCharLimit (const CharPointer& src, const int maxChars) noexcept
void writeWithCharLimit (const CharPointer src, const int maxChars) noexcept
{
CharacterFunctions::copyWithCharLimit (*this, src, maxChars);
}
/** Compares this string with another one. */
template <typename CharPointer>
int compare (const CharPointer& other) const noexcept
int compare (const CharPointer other) const noexcept
{
return CharacterFunctions::compare (*this, other);
}
/** Compares this string with another one, up to a specified number of characters. */
template <typename CharPointer>
int compareUpTo (const CharPointer& other, const int maxChars) const noexcept
int compareUpTo (const CharPointer other, const int maxChars) const noexcept
{
return CharacterFunctions::compareUpTo (*this, other, maxChars);
}
/** Compares this string with another one. */
template <typename CharPointer>
int compareIgnoreCase (const CharPointer& other) const noexcept
int compareIgnoreCase (const CharPointer other) const noexcept
{
return CharacterFunctions::compareIgnoreCase (*this, other);
}
/** Compares this string with another one. */
int compareIgnoreCase (const CharPointer_UTF8& other) const noexcept
int compareIgnoreCase (const CharPointer_UTF8 other) const noexcept
{
#if JUCE_WINDOWS
return stricmp (data, other.data);
@ -433,14 +433,14 @@ public:
/** Compares this string with another one, up to a specified number of characters. */
template <typename CharPointer>
int compareIgnoreCaseUpTo (const CharPointer& other, const int maxChars) const noexcept
int compareIgnoreCaseUpTo (const CharPointer other, const int maxChars) const noexcept
{
return CharacterFunctions::compareIgnoreCaseUpTo (*this, other, maxChars);
}
/** Returns the character index of a substring, or -1 if it isn't found. */
template <typename CharPointer>
int indexOf (const CharPointer& stringToFind) const noexcept
int indexOf (const CharPointer stringToFind) const noexcept
{
return CharacterFunctions::indexOf (*this, stringToFind);
}
@ -542,7 +542,7 @@ public:
}
/** Atomically swaps this pointer for a new value, returning the previous value. */
CharPointer_UTF8 atomicSwap (const CharPointer_UTF8& newValue)
CharPointer_UTF8 atomicSwap (const CharPointer_UTF8 newValue)
{
return CharPointer_UTF8 (reinterpret_cast <Atomic<CharType*>&> (data).exchange (newValue.data));
}

View file

@ -255,7 +255,7 @@ public:
//==============================================================================
/** Parses a character string, to read an integer value. */
template <typename IntType, typename CharPointerType>
static IntType getIntValue (const CharPointerType& text) noexcept
static IntType getIntValue (const CharPointerType text) noexcept
{
IntType v = 0;
CharPointerType s (text.findEndOfWhitespace());
@ -294,7 +294,7 @@ public:
/** Counts the number of characters in a given string, stopping if the count exceeds
a specified end-pointer. */
template <typename CharPointerType>
static size_t lengthUpTo (CharPointerType start, const CharPointerType& end) noexcept
static size_t lengthUpTo (CharPointerType start, const CharPointerType end) noexcept
{
size_t len = 0;
@ -437,7 +437,7 @@ public:
Returns -1 if the substring is not found.
*/
template <typename CharPointerType1, typename CharPointerType2>
static int indexOf (CharPointerType1 textToSearch, const CharPointerType2& substringToLookFor) noexcept
static int indexOf (CharPointerType1 textToSearch, const CharPointerType2 substringToLookFor) noexcept
{
int index = 0;
const int substringLength = (int) substringToLookFor.length();
@ -459,7 +459,7 @@ public:
null terminator.
*/
template <typename CharPointerType1, typename CharPointerType2>
static CharPointerType1 find (CharPointerType1 textToSearch, const CharPointerType2& substringToLookFor) noexcept
static CharPointerType1 find (CharPointerType1 textToSearch, const CharPointerType2 substringToLookFor) noexcept
{
const int substringLength = (int) substringToLookFor.length();
@ -475,7 +475,7 @@ public:
Returns -1 if the substring is not found.
*/
template <typename CharPointerType1, typename CharPointerType2>
static int indexOfIgnoreCase (CharPointerType1 haystack, const CharPointerType2& needle) noexcept
static int indexOfIgnoreCase (CharPointerType1 haystack, const CharPointerType2 needle) noexcept
{
int index = 0;
const int needleLength = (int) needle.length();

View file

@ -39,7 +39,7 @@ Identifier::Identifier (const Identifier& other) noexcept
{
}
Identifier& Identifier::operator= (const Identifier& other) noexcept
Identifier& Identifier::operator= (const Identifier other) noexcept
{
name = other.name;
return *this;

View file

@ -61,16 +61,16 @@ public:
Identifier (const Identifier& other) noexcept;
/** Creates a copy of another identifier. */
Identifier& operator= (const Identifier& other) noexcept;
Identifier& operator= (const Identifier other) noexcept;
/** Destructor */
~Identifier();
/** Compares two identifiers. This is a very fast operation. */
inline bool operator== (const Identifier& other) const noexcept { return name == other.name; }
inline bool operator== (const Identifier other) const noexcept { return name == other.name; }
/** Compares two identifiers. This is a very fast operation. */
inline bool operator!= (const Identifier& other) const noexcept { return name != other.name; }
inline bool operator!= (const Identifier other) const noexcept { return name != other.name; }
/** Returns this identifier as a string. */
String toString() const { return name; }

View file

@ -70,7 +70,7 @@ public:
}
template <class CharPointer>
static CharPointerType createFromCharPointer (const CharPointer& text)
static CharPointerType createFromCharPointer (const CharPointer text)
{
if (text.getAddress() == nullptr || text.isEmpty())
return getEmpty();
@ -87,7 +87,7 @@ public:
}
template <class CharPointer>
static CharPointerType createFromCharPointer (const CharPointer& text, size_t maxChars)
static CharPointerType createFromCharPointer (const CharPointer text, size_t maxChars)
{
if (text.getAddress() == nullptr || text.isEmpty() || maxChars == 0)
return getEmpty();
@ -108,7 +108,7 @@ public:
}
template <class CharPointer>
static CharPointerType createFromCharPointer (const CharPointer& start, const CharPointer& end)
static CharPointerType createFromCharPointer (const CharPointer start, const CharPointer end)
{
if (start.getAddress() == nullptr || start.isEmpty())
return getEmpty();
@ -128,7 +128,7 @@ public:
return dest;
}
static CharPointerType createFromCharPointer (const CharPointerType& start, const CharPointerType& end)
static CharPointerType createFromCharPointer (const CharPointerType start, const CharPointerType end)
{
if (start.getAddress() == nullptr || start.isEmpty())
return getEmpty();
@ -153,7 +153,7 @@ public:
}
//==============================================================================
static void retain (const CharPointerType& text) noexcept
static void retain (const CharPointerType text) noexcept
{
++(bufferFromText (text)->refCount);
}
@ -164,13 +164,13 @@ public:
delete[] reinterpret_cast <char*> (b);
}
static void release (const CharPointerType& text) noexcept
static void release (const CharPointerType text) noexcept
{
release (bufferFromText (text));
}
//==============================================================================
static CharPointerType makeUnique (const CharPointerType& text)
static CharPointerType makeUnique (const CharPointerType text)
{
StringHolder* const b = bufferFromText (text);
@ -184,7 +184,7 @@ public:
return newText;
}
static CharPointerType makeUniqueWithByteSize (const CharPointerType& text, size_t numBytes)
static CharPointerType makeUniqueWithByteSize (const CharPointerType text, size_t numBytes)
{
StringHolder* const b = bufferFromText (text);
@ -198,7 +198,7 @@ public:
return newText;
}
static size_t getAllocatedNumBytes (const CharPointerType& text) noexcept
static size_t getAllocatedNumBytes (const CharPointerType text) noexcept
{
return bufferFromText (text)->allocatedNumBytes;
}
@ -211,7 +211,7 @@ public:
static StringHolder empty;
private:
static inline StringHolder* bufferFromText (const CharPointerType& text) noexcept
static inline StringHolder* bufferFromText (const CharPointerType text) noexcept
{
// (Can't use offsetof() here because of warnings about this not being a POD)
return reinterpret_cast <StringHolder*> (reinterpret_cast <char*> (text.getAddress())
@ -331,19 +331,19 @@ String::String (const char* const t, const size_t maxChars)
}
String::String (const wchar_t* const t) : text (StringHolder::createFromCharPointer (castToCharPointer_wchar_t (t))) {}
String::String (const CharPointer_UTF8& t) : text (StringHolder::createFromCharPointer (t)) {}
String::String (const CharPointer_UTF16& t) : text (StringHolder::createFromCharPointer (t)) {}
String::String (const CharPointer_UTF32& t) : text (StringHolder::createFromCharPointer (t)) {}
String::String (const CharPointer_ASCII& t) : text (StringHolder::createFromCharPointer (t)) {}
String::String (const CharPointer_UTF8 t) : text (StringHolder::createFromCharPointer (t)) {}
String::String (const CharPointer_UTF16 t) : text (StringHolder::createFromCharPointer (t)) {}
String::String (const CharPointer_UTF32 t) : text (StringHolder::createFromCharPointer (t)) {}
String::String (const CharPointer_ASCII t) : text (StringHolder::createFromCharPointer (t)) {}
String::String (const CharPointer_UTF8& t, const size_t maxChars) : text (StringHolder::createFromCharPointer (t, maxChars)) {}
String::String (const CharPointer_UTF16& t, const size_t maxChars) : text (StringHolder::createFromCharPointer (t, maxChars)) {}
String::String (const CharPointer_UTF32& t, const size_t maxChars) : text (StringHolder::createFromCharPointer (t, maxChars)) {}
String::String (const CharPointer_UTF8 t, const size_t maxChars) : text (StringHolder::createFromCharPointer (t, maxChars)) {}
String::String (const CharPointer_UTF16 t, const size_t maxChars) : text (StringHolder::createFromCharPointer (t, maxChars)) {}
String::String (const CharPointer_UTF32 t, const size_t maxChars) : text (StringHolder::createFromCharPointer (t, maxChars)) {}
String::String (const wchar_t* const t, size_t maxChars) : text (StringHolder::createFromCharPointer (castToCharPointer_wchar_t (t), maxChars)) {}
String::String (const CharPointer_UTF8& start, const CharPointer_UTF8& end) : text (StringHolder::createFromCharPointer (start, end)) {}
String::String (const CharPointer_UTF16& start, const CharPointer_UTF16& end) : text (StringHolder::createFromCharPointer (start, end)) {}
String::String (const CharPointer_UTF32& start, const CharPointer_UTF32& end) : text (StringHolder::createFromCharPointer (start, end)) {}
String::String (const CharPointer_UTF8 start, const CharPointer_UTF8 end) : text (StringHolder::createFromCharPointer (start, end)) {}
String::String (const CharPointer_UTF16 start, const CharPointer_UTF16 end) : text (StringHolder::createFromCharPointer (start, end)) {}
String::String (const CharPointer_UTF32 start, const CharPointer_UTF32 end) : text (StringHolder::createFromCharPointer (start, end)) {}
String::String (const std::string& s) : text (StringHolder::createFromFixedLength (s.data(), s.size())) {}
@ -546,15 +546,15 @@ int64 String::hashCode64() const noexcept
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const String& s2) noexcept { return s1.compare (s2) == 0; }
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const char* const s2) noexcept { return s1.compare (s2) == 0; }
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const wchar_t* const s2) noexcept { return s1.compare (s2) == 0; }
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const CharPointer_UTF8& s2) noexcept { return s1.getCharPointer().compare (s2) == 0; }
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const CharPointer_UTF16& s2) noexcept { return s1.getCharPointer().compare (s2) == 0; }
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const CharPointer_UTF32& s2) noexcept { return s1.getCharPointer().compare (s2) == 0; }
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const CharPointer_UTF8 s2) noexcept { return s1.getCharPointer().compare (s2) == 0; }
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const CharPointer_UTF16 s2) noexcept { return s1.getCharPointer().compare (s2) == 0; }
JUCE_API bool JUCE_CALLTYPE operator== (const String& s1, const CharPointer_UTF32 s2) noexcept { return s1.getCharPointer().compare (s2) == 0; }
JUCE_API bool JUCE_CALLTYPE operator!= (const String& s1, const String& s2) noexcept { return s1.compare (s2) != 0; }
JUCE_API bool JUCE_CALLTYPE operator!= (const String& s1, const char* const s2) noexcept { return s1.compare (s2) != 0; }
JUCE_API bool JUCE_CALLTYPE operator!= (const String& s1, const wchar_t* const s2) noexcept { return s1.compare (s2) != 0; }
JUCE_API bool JUCE_CALLTYPE operator!= (const String& s1, const CharPointer_UTF8& s2) noexcept { return s1.getCharPointer().compare (s2) != 0; }
JUCE_API bool JUCE_CALLTYPE operator!= (const String& s1, const CharPointer_UTF16& s2) noexcept { return s1.getCharPointer().compare (s2) != 0; }
JUCE_API bool JUCE_CALLTYPE operator!= (const String& s1, const CharPointer_UTF32& s2) noexcept { return s1.getCharPointer().compare (s2) != 0; }
JUCE_API bool JUCE_CALLTYPE operator!= (const String& s1, const CharPointer_UTF8 s2) noexcept { return s1.getCharPointer().compare (s2) != 0; }
JUCE_API bool JUCE_CALLTYPE operator!= (const String& s1, const CharPointer_UTF16 s2) noexcept { return s1.getCharPointer().compare (s2) != 0; }
JUCE_API bool JUCE_CALLTYPE operator!= (const String& s1, const CharPointer_UTF32 s2) noexcept { return s1.getCharPointer().compare (s2) != 0; }
JUCE_API bool JUCE_CALLTYPE operator> (const String& s1, const String& s2) noexcept { return s1.compare (s2) > 0; }
JUCE_API bool JUCE_CALLTYPE operator< (const String& s1, const String& s2) noexcept { return s1.compare (s2) < 0; }
JUCE_API bool JUCE_CALLTYPE operator>= (const String& s1, const String& s2) noexcept { return s1.compare (s2) >= 0; }
@ -1020,7 +1020,7 @@ struct WildCardMatcher
|| (ignoreCase && CharacterFunctions::toLowerCase (wc) == CharacterFunctions::toLowerCase (tc));
}
static bool matchesAnywhere (const CharPointer& wildcard, CharPointer test, const bool ignoreCase) noexcept
static bool matchesAnywhere (const CharPointer wildcard, CharPointer test, const bool ignoreCase) noexcept
{
for (; ! test.isEmpty(); ++test)
if (matches (wildcard, test, ignoreCase))
@ -2024,7 +2024,7 @@ std::string String::toStdString() const
template <class CharPointerType_Src, class CharPointerType_Dest>
struct StringCopier
{
static size_t copyToBuffer (const CharPointerType_Src& source, typename CharPointerType_Dest::CharType* const buffer, const size_t maxBufferSizeBytes)
static size_t copyToBuffer (const CharPointerType_Src source, typename CharPointerType_Dest::CharType* const buffer, const size_t maxBufferSizeBytes)
{
jassert (((ssize_t) maxBufferSizeBytes) >= 0); // keep this value positive!

View file

@ -120,37 +120,37 @@ public:
//==============================================================================
/** Creates a string from a UTF-8 character string */
String (const CharPointer_UTF8& text);
String (const CharPointer_UTF8 text);
/** Creates a string from a UTF-8 character string */
String (const CharPointer_UTF8& text, size_t maxChars);
String (const CharPointer_UTF8 text, size_t maxChars);
/** Creates a string from a UTF-8 character string */
String (const CharPointer_UTF8& start, const CharPointer_UTF8& end);
String (const CharPointer_UTF8 start, const CharPointer_UTF8 end);
//==============================================================================
/** Creates a string from a UTF-16 character string */
String (const CharPointer_UTF16& text);
String (const CharPointer_UTF16 text);
/** Creates a string from a UTF-16 character string */
String (const CharPointer_UTF16& text, size_t maxChars);
String (const CharPointer_UTF16 text, size_t maxChars);
/** Creates a string from a UTF-16 character string */
String (const CharPointer_UTF16& start, const CharPointer_UTF16& end);
String (const CharPointer_UTF16 start, const CharPointer_UTF16 end);
//==============================================================================
/** Creates a string from a UTF-32 character string */
String (const CharPointer_UTF32& text);
String (const CharPointer_UTF32 text);
/** Creates a string from a UTF-32 character string */
String (const CharPointer_UTF32& text, size_t maxChars);
String (const CharPointer_UTF32 text, size_t maxChars);
/** Creates a string from a UTF-32 character string */
String (const CharPointer_UTF32& start, const CharPointer_UTF32& end);
String (const CharPointer_UTF32 start, const CharPointer_UTF32 end);
//==============================================================================
/** Creates a string from an ASCII character string */
String (const CharPointer_ASCII& text);
String (const CharPointer_ASCII text);
/** Creates a string from a UTF-8 encoded std::string. */
String (const std::string&);
@ -242,7 +242,7 @@ public:
@param maxCharsToTake the maximum number of characters to take from the string passed in
*/
template <class CharPointer>
void appendCharPointer (const CharPointer& textToAppend, size_t maxCharsToTake)
void appendCharPointer (const CharPointer textToAppend, size_t maxCharsToTake)
{
if (textToAppend.getAddress() != nullptr)
{
@ -267,7 +267,7 @@ public:
/** Appends a string to the end of this one. */
template <class CharPointer>
void appendCharPointer (const CharPointer& textToAppend)
void appendCharPointer (const CharPointer textToAppend)
{
if (textToAppend.getAddress() != nullptr)
{
@ -1037,7 +1037,7 @@ public:
that is returned must not be stored anywhere, as it can be deleted whenever the
string changes.
*/
inline const CharPointerType& getCharPointer() const noexcept { return text; }
inline CharPointerType getCharPointer() const noexcept { return text; }
/** Returns a pointer to a UTF-8 version of this string.
@ -1296,11 +1296,11 @@ JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const char* strin
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const wchar_t* string2) noexcept;
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const CharPointer_UTF8& string2) noexcept;
JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const CharPointer_UTF8 string2) noexcept;
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const CharPointer_UTF16& string2) noexcept;
JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const CharPointer_UTF16 string2) noexcept;
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const CharPointer_UTF32& string2) noexcept;
JUCE_API bool JUCE_CALLTYPE operator== (const String& string1, const CharPointer_UTF32 string2) noexcept;
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const String& string2) noexcept;
/** Case-sensitive comparison of two strings. */
@ -1308,11 +1308,11 @@ JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const char* strin
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const wchar_t* string2) noexcept;
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const CharPointer_UTF8& string2) noexcept;
JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const CharPointer_UTF8 string2) noexcept;
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const CharPointer_UTF16& string2) noexcept;
JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const CharPointer_UTF16 string2) noexcept;
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const CharPointer_UTF32& string2) noexcept;
JUCE_API bool JUCE_CALLTYPE operator!= (const String& string1, const CharPointer_UTF32 string2) noexcept;
/** Case-sensitive comparison of two strings. */
JUCE_API bool JUCE_CALLTYPE operator> (const String& string1, const String& string2) noexcept;
/** Case-sensitive comparison of two strings. */

View file

@ -45,20 +45,20 @@ double RelativeTime::inWeeks() const noexcept { return seconds / (60.0 * 6
//==============================================================================
RelativeTime& RelativeTime::operator= (const RelativeTime& other) noexcept { seconds = other.seconds; return *this; }
const RelativeTime& RelativeTime::operator+= (const RelativeTime& t) noexcept { seconds += t.seconds; return *this; }
const RelativeTime& RelativeTime::operator-= (const RelativeTime& t) noexcept { seconds -= t.seconds; return *this; }
const RelativeTime& RelativeTime::operator+= (const double secs) noexcept { seconds += secs; return *this; }
const RelativeTime& RelativeTime::operator-= (const double secs) noexcept { seconds -= secs; return *this; }
RelativeTime RelativeTime::operator+= (RelativeTime t) noexcept { seconds += t.seconds; return *this; }
RelativeTime RelativeTime::operator-= (RelativeTime t) noexcept { seconds -= t.seconds; return *this; }
RelativeTime RelativeTime::operator+= (const double secs) noexcept { seconds += secs; return *this; }
RelativeTime RelativeTime::operator-= (const double secs) noexcept { seconds -= secs; return *this; }
RelativeTime operator+ (const RelativeTime& t1, const RelativeTime& t2) noexcept { RelativeTime t (t1); return t += t2; }
RelativeTime operator- (const RelativeTime& t1, const RelativeTime& t2) noexcept { RelativeTime t (t1); return t -= t2; }
RelativeTime operator+ (RelativeTime t1, RelativeTime t2) noexcept { return t1 += t2; }
RelativeTime operator- (RelativeTime t1, RelativeTime t2) noexcept { return t1 -= t2; }
bool operator== (const RelativeTime& t1, const RelativeTime& t2) noexcept { return t1.inSeconds() == t2.inSeconds(); }
bool operator!= (const RelativeTime& t1, const RelativeTime& t2) noexcept { return t1.inSeconds() != t2.inSeconds(); }
bool operator> (const RelativeTime& t1, const RelativeTime& t2) noexcept { return t1.inSeconds() > t2.inSeconds(); }
bool operator< (const RelativeTime& t1, const RelativeTime& t2) noexcept { return t1.inSeconds() < t2.inSeconds(); }
bool operator>= (const RelativeTime& t1, const RelativeTime& t2) noexcept { return t1.inSeconds() >= t2.inSeconds(); }
bool operator<= (const RelativeTime& t1, const RelativeTime& t2) noexcept { return t1.inSeconds() <= t2.inSeconds(); }
bool operator== (RelativeTime t1, RelativeTime t2) noexcept { return t1.inSeconds() == t2.inSeconds(); }
bool operator!= (RelativeTime t1, RelativeTime t2) noexcept { return t1.inSeconds() != t2.inSeconds(); }
bool operator> (RelativeTime t1, RelativeTime t2) noexcept { return t1.inSeconds() > t2.inSeconds(); }
bool operator< (RelativeTime t1, RelativeTime t2) noexcept { return t1.inSeconds() < t2.inSeconds(); }
bool operator>= (RelativeTime t1, RelativeTime t2) noexcept { return t1.inSeconds() >= t2.inSeconds(); }
bool operator<= (RelativeTime t1, RelativeTime t2) noexcept { return t1.inSeconds() <= t2.inSeconds(); }
//==============================================================================
static void translateTimeField (String& result, int n, const char* singular, const char* plural)

View file

@ -139,14 +139,14 @@ public:
//==============================================================================
/** Adds another RelativeTime to this one. */
const RelativeTime& operator+= (const RelativeTime& timeToAdd) noexcept;
RelativeTime operator+= (RelativeTime timeToAdd) noexcept;
/** Subtracts another RelativeTime from this one. */
const RelativeTime& operator-= (const RelativeTime& timeToSubtract) noexcept;
RelativeTime operator-= (RelativeTime timeToSubtract) noexcept;
/** Adds a number of seconds to this time. */
const RelativeTime& operator+= (double secondsToAdd) noexcept;
RelativeTime operator+= (double secondsToAdd) noexcept;
/** Subtracts a number of seconds from this time. */
const RelativeTime& operator-= (double secondsToSubtract) noexcept;
RelativeTime operator-= (double secondsToSubtract) noexcept;
private:
//==============================================================================
@ -155,23 +155,23 @@ private:
//==============================================================================
/** Compares two RelativeTimes. */
bool operator== (const RelativeTime& t1, const RelativeTime& t2) noexcept;
bool operator== (RelativeTime t1, RelativeTime t2) noexcept;
/** Compares two RelativeTimes. */
bool operator!= (const RelativeTime& t1, const RelativeTime& t2) noexcept;
bool operator!= (RelativeTime t1, RelativeTime t2) noexcept;
/** Compares two RelativeTimes. */
bool operator> (const RelativeTime& t1, const RelativeTime& t2) noexcept;
bool operator> (RelativeTime t1, RelativeTime t2) noexcept;
/** Compares two RelativeTimes. */
bool operator< (const RelativeTime& t1, const RelativeTime& t2) noexcept;
bool operator< (RelativeTime t1, RelativeTime t2) noexcept;
/** Compares two RelativeTimes. */
bool operator>= (const RelativeTime& t1, const RelativeTime& t2) noexcept;
bool operator>= (RelativeTime t1, RelativeTime t2) noexcept;
/** Compares two RelativeTimes. */
bool operator<= (const RelativeTime& t1, const RelativeTime& t2) noexcept;
bool operator<= (RelativeTime t1, RelativeTime t2) noexcept;
//==============================================================================
/** Adds two RelativeTimes together. */
RelativeTime operator+ (const RelativeTime& t1, const RelativeTime& t2) noexcept;
RelativeTime operator+ (RelativeTime t1, RelativeTime t2) noexcept;
/** Subtracts two RelativeTimes. */
RelativeTime operator- (const RelativeTime& t1, const RelativeTime& t2) noexcept;
RelativeTime operator- (RelativeTime t1, RelativeTime t2) noexcept;

View file

@ -427,17 +427,17 @@ String Time::getWeekdayName (int day, const bool threeLetterVersion)
}
//==============================================================================
Time& Time::operator+= (const RelativeTime& delta) { millisSinceEpoch += delta.inMilliseconds(); return *this; }
Time& Time::operator-= (const RelativeTime& delta) { millisSinceEpoch -= delta.inMilliseconds(); return *this; }
Time& Time::operator+= (RelativeTime delta) { millisSinceEpoch += delta.inMilliseconds(); return *this; }
Time& Time::operator-= (RelativeTime delta) { millisSinceEpoch -= delta.inMilliseconds(); return *this; }
Time operator+ (const Time& time, const RelativeTime& delta) { Time t (time); return t += delta; }
Time operator- (const Time& time, const RelativeTime& delta) { Time t (time); return t -= delta; }
Time operator+ (const RelativeTime& delta, const Time& time) { Time t (time); return t += delta; }
const RelativeTime operator- (const Time& time1, const Time& time2) { return RelativeTime::milliseconds (time1.toMilliseconds() - time2.toMilliseconds()); }
Time operator+ (Time time, RelativeTime delta) { Time t (time); return t += delta; }
Time operator- (Time time, RelativeTime delta) { Time t (time); return t -= delta; }
Time operator+ (RelativeTime delta, Time time) { Time t (time); return t += delta; }
const RelativeTime operator- (Time time1, Time time2) { return RelativeTime::milliseconds (time1.toMilliseconds() - time2.toMilliseconds()); }
bool operator== (const Time& time1, const Time& time2) { return time1.toMilliseconds() == time2.toMilliseconds(); }
bool operator!= (const Time& time1, const Time& time2) { return time1.toMilliseconds() != time2.toMilliseconds(); }
bool operator< (const Time& time1, const Time& time2) { return time1.toMilliseconds() < time2.toMilliseconds(); }
bool operator> (const Time& time1, const Time& time2) { return time1.toMilliseconds() > time2.toMilliseconds(); }
bool operator<= (const Time& time1, const Time& time2) { return time1.toMilliseconds() <= time2.toMilliseconds(); }
bool operator>= (const Time& time1, const Time& time2) { return time1.toMilliseconds() >= time2.toMilliseconds(); }
bool operator== (Time time1, Time time2) { return time1.toMilliseconds() == time2.toMilliseconds(); }
bool operator!= (Time time1, Time time2) { return time1.toMilliseconds() != time2.toMilliseconds(); }
bool operator< (Time time1, Time time2) { return time1.toMilliseconds() < time2.toMilliseconds(); }
bool operator> (Time time1, Time time2) { return time1.toMilliseconds() > time2.toMilliseconds(); }
bool operator<= (Time time1, Time time2) { return time1.toMilliseconds() <= time2.toMilliseconds(); }
bool operator>= (Time time1, Time time2) { return time1.toMilliseconds() >= time2.toMilliseconds(); }

View file

@ -252,9 +252,9 @@ public:
//==============================================================================
/** Adds a RelativeTime to this time. */
Time& operator+= (const RelativeTime& delta);
Time& operator+= (RelativeTime delta);
/** Subtracts a RelativeTime from this time. */
Time& operator-= (const RelativeTime& delta);
Time& operator-= (RelativeTime delta);
//==============================================================================
/** Tries to set the computer's clock.
@ -377,27 +377,27 @@ private:
//==============================================================================
/** Adds a RelativeTime to a Time. */
JUCE_API Time operator+ (const Time& time, const RelativeTime& delta);
JUCE_API Time operator+ (Time time, RelativeTime delta);
/** Adds a RelativeTime to a Time. */
JUCE_API Time operator+ (const RelativeTime& delta, const Time& time);
JUCE_API Time operator+ (RelativeTime delta, Time time);
/** Subtracts a RelativeTime from a Time. */
JUCE_API Time operator- (const Time& time, const RelativeTime& delta);
JUCE_API Time operator- (Time time, RelativeTime delta);
/** Returns the relative time difference between two times. */
JUCE_API const RelativeTime operator- (const Time& time1, const Time& time2);
JUCE_API const RelativeTime operator- (Time time1, Time time2);
/** Compares two Time objects. */
JUCE_API bool operator== (const Time& time1, const Time& time2);
JUCE_API bool operator== (Time time1, Time time2);
/** Compares two Time objects. */
JUCE_API bool operator!= (const Time& time1, const Time& time2);
JUCE_API bool operator!= (Time time1, Time time2);
/** Compares two Time objects. */
JUCE_API bool operator< (const Time& time1, const Time& time2);
JUCE_API bool operator< (Time time1, Time time2);
/** Compares two Time objects. */
JUCE_API bool operator<= (const Time& time1, const Time& time2);
JUCE_API bool operator<= (Time time1, Time time2);
/** Compares two Time objects. */
JUCE_API bool operator> (const Time& time1, const Time& time2);
JUCE_API bool operator> (Time time1, Time time2);
/** Compares two Time objects. */
JUCE_API bool operator>= (const Time& time1, const Time& time2);
JUCE_API bool operator>= (Time time1, Time time2);
#endif // __JUCE_TIME_JUCEHEADER__

View file

@ -216,7 +216,7 @@ MD5::MD5 (const void* data, const size_t numBytes) noexcept
processData (data, numBytes);
}
MD5::MD5 (const CharPointer_UTF8& utf8) noexcept
MD5::MD5 (CharPointer_UTF8 utf8) noexcept
{
jassert (utf8.getAddress() != nullptr);
processData (utf8.getAddress(), utf8.sizeInBytes() - 1);

View file

@ -72,7 +72,7 @@ public:
@code MD5 checksum (myString.toUTF8());
@endcode
*/
explicit MD5 (const CharPointer_UTF8& utf8Text) noexcept;
explicit MD5 (CharPointer_UTF8 utf8Text) noexcept;
/** Destructor. */
~MD5() noexcept;

View file

@ -206,7 +206,7 @@ SHA256::SHA256 (const File& file)
}
}
SHA256::SHA256 (const CharPointer_UTF8& utf8) noexcept
SHA256::SHA256 (CharPointer_UTF8 utf8) noexcept
{
jassert (utf8.getAddress() != nullptr);
process (utf8.getAddress(), utf8.sizeInBytes() - 1);

View file

@ -82,7 +82,7 @@ public:
@code SHA256 checksum (myString.toUTF8());
@endcode
*/
explicit SHA256 (const CharPointer_UTF8& utf8Text) noexcept;
explicit SHA256 (CharPointer_UTF8 utf8Text) noexcept;
//==============================================================================
/** Returns the hash as a 32-byte block of data. */

View file

@ -28,7 +28,7 @@ class ValueTree::SharedObject : public ReferenceCountedObject
public:
typedef ReferenceCountedObjectPtr<SharedObject> Ptr;
explicit SharedObject (const Identifier& t) noexcept
explicit SharedObject (const Identifier t) noexcept
: type (t), parent (nullptr)
{
}
@ -58,14 +58,14 @@ public:
}
}
void sendPropertyChangeMessage (ValueTree& tree, const Identifier& property)
void sendPropertyChangeMessage (ValueTree& tree, const Identifier property)
{
for (int i = valueTreesWithListeners.size(); --i >= 0;)
if (ValueTree* const v = valueTreesWithListeners[i])
v->listeners.call (&ValueTree::Listener::valueTreePropertyChanged, tree, property);
}
void sendPropertyChangeMessage (const Identifier& property)
void sendPropertyChangeMessage (const Identifier property)
{
ValueTree tree (this);
@ -131,17 +131,17 @@ public:
v->listeners.call (&ValueTree::Listener::valueTreeParentChanged, tree);
}
const var& getProperty (const Identifier& name) const noexcept
const var& getProperty (const Identifier name) const noexcept
{
return properties [name];
}
var getProperty (const Identifier& name, const var& defaultReturnValue) const
var getProperty (const Identifier name, const var& defaultReturnValue) const
{
return properties.getWithDefault (name, defaultReturnValue);
}
void setProperty (const Identifier& name, const var& newValue, UndoManager* const undoManager)
void setProperty (const Identifier name, const var& newValue, UndoManager* const undoManager)
{
if (undoManager == nullptr)
{
@ -162,12 +162,12 @@ public:
}
}
bool hasProperty (const Identifier& name) const noexcept
bool hasProperty (const Identifier name) const noexcept
{
return properties.contains (name);
}
void removeProperty (const Identifier& name, UndoManager* const undoManager)
void removeProperty (const Identifier name, UndoManager* const undoManager)
{
if (undoManager == nullptr)
{
@ -210,7 +210,7 @@ public:
setProperty (source.properties.getName(i), source.properties.getValueAt(i), undoManager);
}
ValueTree getChildWithName (const Identifier& typeToMatch) const
ValueTree getChildWithName (const Identifier typeToMatch) const
{
for (int i = 0; i < children.size(); ++i)
{
@ -222,7 +222,7 @@ public:
return ValueTree::invalid;
}
ValueTree getOrCreateChildWithName (const Identifier& typeToMatch, UndoManager* undoManager)
ValueTree getOrCreateChildWithName (const Identifier typeToMatch, UndoManager* undoManager)
{
for (int i = 0; i < children.size(); ++i)
{
@ -237,7 +237,7 @@ public:
}
ValueTree getChildWithProperty (const Identifier& propertyName, const var& propertyValue) const
ValueTree getChildWithProperty (const Identifier propertyName, const var& propertyValue) const
{
for (int i = 0; i < children.size(); ++i)
{
@ -444,7 +444,7 @@ public:
class SetPropertyAction : public UndoableAction
{
public:
SetPropertyAction (SharedObject* const target_, const Identifier& name_,
SetPropertyAction (SharedObject* const target_, const Identifier name_,
const var& newValue_, const var& oldValue_,
const bool isAddingNewProperty_, const bool isDeletingProperty_)
: target (target_), name (name_), newValue (newValue_), oldValue (oldValue_),
@ -616,7 +616,7 @@ ValueTree::ValueTree() noexcept
const ValueTree ValueTree::invalid;
ValueTree::ValueTree (const Identifier& type_)
ValueTree::ValueTree (const Identifier type_)
: object (new ValueTree::SharedObject (type_))
{
jassert (type_.toString().isNotEmpty()); // All objects should be given a sensible type name!
@ -684,7 +684,7 @@ ValueTree ValueTree::createCopy() const
return ValueTree (createCopyIfNotNull (object.get()));
}
bool ValueTree::hasType (const Identifier& typeName) const
bool ValueTree::hasType (const Identifier typeName) const
{
return object != nullptr && object->type == typeName;
}
@ -709,23 +709,23 @@ ValueTree ValueTree::getSibling (const int delta) const
return ValueTree (object->parent->children.getObjectPointer (index));
}
const var& ValueTree::operator[] (const Identifier& name) const
const var& ValueTree::operator[] (const Identifier name) const
{
return object == nullptr ? var::null : object->getProperty (name);
}
const var& ValueTree::getProperty (const Identifier& name) const
const var& ValueTree::getProperty (const Identifier name) const
{
return object == nullptr ? var::null : object->getProperty (name);
}
var ValueTree::getProperty (const Identifier& name, const var& defaultReturnValue) const
var ValueTree::getProperty (const Identifier name, const var& defaultReturnValue) const
{
return object == nullptr ? defaultReturnValue
: object->getProperty (name, defaultReturnValue);
}
ValueTree& ValueTree::setProperty (const Identifier& name, const var& newValue,
ValueTree& ValueTree::setProperty (const Identifier name, const var& newValue,
UndoManager* const undoManager)
{
jassert (name.toString().isNotEmpty()); // Must have a valid property name!
@ -737,12 +737,12 @@ ValueTree& ValueTree::setProperty (const Identifier& name, const var& newValue,
return *this;
}
bool ValueTree::hasProperty (const Identifier& name) const
bool ValueTree::hasProperty (const Identifier name) const
{
return object != nullptr && object->hasProperty (name);
}
void ValueTree::removeProperty (const Identifier& name, UndoManager* const undoManager)
void ValueTree::removeProperty (const Identifier name, UndoManager* const undoManager)
{
if (object != nullptr)
object->removeProperty (name, undoManager);
@ -780,7 +780,7 @@ class ValueTreePropertyValueSource : public Value::ValueSource,
private ValueTree::Listener
{
public:
ValueTreePropertyValueSource (const ValueTree& vt, const Identifier& prop, UndoManager* um)
ValueTreePropertyValueSource (const ValueTree& vt, const Identifier prop, UndoManager* um)
: tree (vt), property (prop), undoManager (um)
{
tree.addListener (this);
@ -800,21 +800,21 @@ private:
UndoManager* const undoManager;
void valueTreePropertyChanged (ValueTree& treeWhosePropertyHasChanged,
const Identifier& changedProperty)
const Identifier& changedProperty) override
{
if (tree == treeWhosePropertyHasChanged && property == changedProperty)
sendChangeMessage (false);
}
void valueTreeChildAdded (ValueTree&, ValueTree&) {}
void valueTreeChildRemoved (ValueTree&, ValueTree&) {}
void valueTreeChildOrderChanged (ValueTree&) {}
void valueTreeParentChanged (ValueTree&) {}
void valueTreeChildAdded (ValueTree&, ValueTree&) override {}
void valueTreeChildRemoved (ValueTree&, ValueTree&) override {}
void valueTreeChildOrderChanged (ValueTree&) override {}
void valueTreeParentChanged (ValueTree&) override {}
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (ValueTreePropertyValueSource)
};
Value ValueTree::getPropertyAsValue (const Identifier& name, UndoManager* const undoManager)
Value ValueTree::getPropertyAsValue (const Identifier name, UndoManager* const undoManager)
{
return Value (new ValueTreePropertyValueSource (*this, name, undoManager));
}
@ -831,17 +831,17 @@ ValueTree ValueTree::getChild (int index) const
: static_cast <SharedObject*> (nullptr));
}
ValueTree ValueTree::getChildWithName (const Identifier& type) const
ValueTree ValueTree::getChildWithName (const Identifier type) const
{
return object != nullptr ? object->getChildWithName (type) : ValueTree::invalid;
}
ValueTree ValueTree::getOrCreateChildWithName (const Identifier& type, UndoManager* undoManager)
ValueTree ValueTree::getOrCreateChildWithName (const Identifier type, UndoManager* undoManager)
{
return object != nullptr ? object->getOrCreateChildWithName (type, undoManager) : ValueTree::invalid;
}
ValueTree ValueTree::getChildWithProperty (const Identifier& propertyName, const var& propertyValue) const
ValueTree ValueTree::getChildWithProperty (const Identifier propertyName, const var& propertyValue) const
{
return object != nullptr ? object->getChildWithProperty (propertyName, propertyValue) : ValueTree::invalid;
}
@ -923,7 +923,7 @@ void ValueTree::removeListener (Listener* listener)
object->valueTreesWithListeners.removeValue (this);
}
void ValueTree::sendPropertyChangeMessage (const Identifier& property)
void ValueTree::sendPropertyChangeMessage (const Identifier property)
{
if (object != nullptr)
object->sendPropertyChangeMessage (property);

View file

@ -83,7 +83,7 @@ public:
Like an XmlElement, each ValueTree node has a type, which you can access with
getType() and hasType().
*/
explicit ValueTree (const Identifier& type);
explicit ValueTree (const Identifier type);
/** Creates a reference to another ValueTree. */
ValueTree (const ValueTree& other);
@ -138,7 +138,7 @@ public:
/** Returns true if the node has this type.
The comparison is case-sensitive.
*/
bool hasType (const Identifier& typeName) const;
bool hasType (const Identifier typeName) const;
//==============================================================================
/** Returns the value of a named property.
@ -146,21 +146,21 @@ public:
You can also use operator[] to get a property.
@see var, setProperty, hasProperty
*/
const var& getProperty (const Identifier& name) const;
const var& getProperty (const Identifier name) const;
/** Returns the value of a named property, or a user-specified default if the property doesn't exist.
If no such property has been set, this will return the value of defaultReturnValue.
You can also use operator[] and getProperty to get a property.
@see var, getProperty, setProperty, hasProperty
*/
var getProperty (const Identifier& name, const var& defaultReturnValue) const;
var getProperty (const Identifier name, const var& defaultReturnValue) const;
/** Returns the value of a named property.
If no such property has been set, this will return a void variant. This is the same as
calling getProperty().
@see getProperty
*/
const var& operator[] (const Identifier& name) const;
const var& operator[] (const Identifier name) const;
/** Changes a named property of the node.
The name identifier must not be an empty string.
@ -169,16 +169,16 @@ public:
@see var, getProperty, removeProperty
@returns a reference to the value tree, so that you can daisy-chain calls to this method.
*/
ValueTree& setProperty (const Identifier& name, const var& newValue, UndoManager* undoManager);
ValueTree& setProperty (const Identifier name, const var& newValue, UndoManager* undoManager);
/** Returns true if the node contains a named property. */
bool hasProperty (const Identifier& name) const;
bool hasProperty (const Identifier name) const;
/** Removes a property from the node.
If the undoManager parameter is non-null, its UndoManager::perform() method will be used,
so that this change can be undone.
*/
void removeProperty (const Identifier& name, UndoManager* undoManager);
void removeProperty (const Identifier name, UndoManager* undoManager);
/** Removes all properties from the node.
If the undoManager parameter is non-null, its UndoManager::perform() method will be used,
@ -202,7 +202,7 @@ public:
it needs to change the value. Attaching a Value::Listener to the value object will provide
callbacks whenever the property changes.
*/
Value getPropertyAsValue (const Identifier& name, UndoManager* undoManager);
Value getPropertyAsValue (const Identifier name, UndoManager* undoManager);
/** Overwrites all the properties in this tree with the properties of the source tree.
Any properties that already exist will be updated; and new ones will be added, and
@ -227,7 +227,7 @@ public:
whether a node is valid).
@see getOrCreateChildWithName
*/
ValueTree getChildWithName (const Identifier& type) const;
ValueTree getChildWithName (const Identifier type) const;
/** Returns the first child node with the speficied type name, creating and adding
a child with this name if there wasn't already one there.
@ -236,7 +236,7 @@ public:
the method on is itself invalid.
@see getChildWithName
*/
ValueTree getOrCreateChildWithName (const Identifier& type, UndoManager* undoManager);
ValueTree getOrCreateChildWithName (const Identifier type, UndoManager* undoManager);
/** Looks for the first child node that has the speficied property value.
@ -246,7 +246,7 @@ public:
If no such node is found, it'll return an invalid node. (See isValid() to find out
whether a node is valid).
*/
ValueTree getChildWithProperty (const Identifier& propertyName, const var& propertyValue) const;
ValueTree getChildWithProperty (const Identifier propertyName, const var& propertyValue) const;
/** Adds a child to this node.
@ -452,7 +452,7 @@ public:
/** Causes a property-change callback to be triggered for the specified property,
calling any listeners that are registered.
*/
void sendPropertyChangeMessage (const Identifier& property);
void sendPropertyChangeMessage (const Identifier property);
//==============================================================================
/** This method uses a comparator object to sort the tree's children into order.

View file

@ -32,7 +32,7 @@ namespace ColourHelpers
// This is an adjusted brightness value, based on the way the human
// eye responds to different colour channels..
static float getPerceivedBrightness (const Colour& c) noexcept
static float getPerceivedBrightness (Colour c) noexcept
{
const float r = c.getFloatRed();
const float g = c.getFloatGreen();
@ -46,7 +46,7 @@ namespace ColourHelpers
//==============================================================================
struct HSB
{
HSB (const Colour& col) noexcept
HSB (Colour col) noexcept
{
const int r = col.getRed();
const int g = col.getGreen();
@ -92,7 +92,7 @@ namespace ColourHelpers
brightness = hi / 255.0f;
}
Colour toColour (const Colour& original) const noexcept
Colour toColour (Colour original) const noexcept
{
return Colour (hue, saturation, brightness, original.getAlpha());
}
@ -124,7 +124,7 @@ namespace ColourHelpers
//==============================================================================
struct YIQ
{
YIQ (const Colour& c) noexcept
YIQ (Colour c) noexcept
{
const float r = c.getFloatRed();
const float g = c.getFloatGreen();
@ -275,7 +275,7 @@ Colour Colour::withMultipliedAlpha (const float alphaMultiplier) const noexcept
}
//==============================================================================
Colour Colour::overlaidWith (const Colour& src) const noexcept
Colour Colour::overlaidWith (Colour src) const noexcept
{
const int destAlpha = getAlpha();
@ -296,7 +296,7 @@ Colour Colour::overlaidWith (const Colour& src) const noexcept
(uint8) resA);
}
Colour Colour::interpolatedWith (const Colour& other, float proportionOfOther) const noexcept
Colour Colour::interpolatedWith (Colour other, float proportionOfOther) const noexcept
{
if (proportionOfOther <= 0)
return *this;
@ -393,7 +393,7 @@ Colour Colour::contrasting (const float amount) const noexcept
: Colours::white).withAlpha (amount));
}
Colour Colour::contrasting (const Colour& target, float minContrast) const noexcept
Colour Colour::contrasting (Colour target, float minContrast) const noexcept
{
const ColourHelpers::YIQ bg (*this);
ColourHelpers::YIQ fg (target);
@ -408,8 +408,8 @@ Colour Colour::contrasting (const Colour& target, float minContrast) const noexc
return fg.toColour();
}
Colour Colour::contrasting (const Colour& colour1,
const Colour& colour2) noexcept
Colour Colour::contrasting (Colour colour1,
Colour colour2) noexcept
{
const float b1 = ColourHelpers::getPerceivedBrightness (colour1);
const float b2 = ColourHelpers::getPerceivedBrightness (colour2);

View file

@ -231,14 +231,14 @@ public:
If the foreground colour is semi-transparent, it is blended onto this colour
accordingly.
*/
Colour overlaidWith (const Colour& foregroundColour) const noexcept;
Colour overlaidWith (Colour foregroundColour) const noexcept;
/** Returns a colour that lies somewhere between this one and another.
If amountOfOther is zero, the result is 100% this colour, if amountOfOther
is 1.0, the result is 100% of the other colour.
*/
Colour interpolatedWith (const Colour& other, float proportionOfOther) const noexcept;
Colour interpolatedWith (Colour other, float proportionOfOther) const noexcept;
//==============================================================================
/** Returns the colour's hue component.
@ -331,14 +331,14 @@ public:
nudged up or down so that it differs from the luminosity of this colour
by at least the amount specified by minLuminosityDiff.
*/
Colour contrasting (const Colour& targetColour, float minLuminosityDiff) const noexcept;
Colour contrasting (Colour targetColour, float minLuminosityDiff) const noexcept;
/** Returns a colour that contrasts against two colours.
Looks for a colour that contrasts with both of the colours passed-in.
Handy for things like choosing a highlight colour in text editors, etc.
*/
static Colour contrasting (const Colour& colour1,
const Colour& colour2) noexcept;
static Colour contrasting (Colour colour1,
Colour colour2) noexcept;
//==============================================================================
/** Returns an opaque shade of grey.

View file

@ -33,8 +33,8 @@ ColourGradient::ColourGradient() noexcept
#endif
}
ColourGradient::ColourGradient (const Colour& colour1, const float x1_, const float y1_,
const Colour& colour2, const float x2_, const float y2_,
ColourGradient::ColourGradient (Colour colour1, const float x1_, const float y1_,
Colour colour2, const float x2_, const float y2_,
const bool isRadial_)
: point1 (x1_, y1_),
point2 (x2_, y2_),
@ -66,7 +66,7 @@ void ColourGradient::clearColours()
colours.clear();
}
int ColourGradient::addColour (const double proportionAlongGradient, const Colour& colour)
int ColourGradient::addColour (const double proportionAlongGradient, Colour colour)
{
// must be within the two end-points
jassert (proportionAlongGradient >= 0 && proportionAlongGradient <= 1.0);
@ -119,7 +119,7 @@ Colour ColourGradient::getColour (const int index) const noexcept
return Colour();
}
void ColourGradient::setColour (int index, const Colour& newColour) noexcept
void ColourGradient::setColour (int index, Colour newColour) noexcept
{
if (isPositiveAndBelow (index, colours.size()))
colours.getReference (index).colour = newColour;

View file

@ -57,8 +57,8 @@ public:
@see ColourGradient
*/
ColourGradient (const Colour& colour1, float x1, float y1,
const Colour& colour2, float x2, float y2,
ColourGradient (Colour colour1, float x1, float y1,
Colour colour2, float x2, float y2,
bool isRadial);
/** Creates an uninitialised gradient.
@ -91,7 +91,7 @@ public:
@returns the index at which the new point was added
*/
int addColour (double proportionAlongGradient,
const Colour& colour);
Colour colour);
/** Removes one of the colours from the gradient. */
void removeColour (int index);
@ -117,7 +117,7 @@ public:
/** Changes the colour at a given index.
The index is from 0 to getNumColours() - 1.
*/
void setColour (int index, const Colour& newColour) noexcept;
void setColour (int index, Colour newColour) noexcept;
/** Returns the an interpolated colour at any position along the gradient.
@param position the position along the gradient, between 0 and 1
@ -165,7 +165,7 @@ private:
{
ColourPoint() noexcept {}
ColourPoint (const double pos, const Colour& col) noexcept
ColourPoint (const double pos, Colour col) noexcept
: position (pos), colour (col)
{}

View file

@ -166,7 +166,7 @@ const Colour Colours::yellowgreen (0xff9acd32);
//==============================================================================
Colour Colours::findColourForName (const String& colourName,
const Colour& defaultColour)
Colour defaultColour)
{
static const uint32 presets[] =
{

View file

@ -96,7 +96,7 @@ public:
colour passed in as the defaultColour parameter is returned.
*/
static JUCE_API Colour findColourForName (const String& colourName,
const Colour& defaultColour);
Colour defaultColour);
private:
//==============================================================================

View file

@ -28,8 +28,8 @@ FillType::FillType() noexcept
{
}
FillType::FillType (const Colour& colour_) noexcept
: colour (colour_)
FillType::FillType (Colour c) noexcept
: colour (c)
{
}
@ -102,7 +102,7 @@ bool FillType::operator!= (const FillType& other) const
return ! operator== (other);
}
void FillType::setColour (const Colour& newColour) noexcept
void FillType::setColour (Colour newColour) noexcept
{
gradient = nullptr;
image = Image::null;

View file

@ -49,7 +49,7 @@ public:
/** Creates a fill type of a solid colour.
@see setColour
*/
FillType (const Colour& colour) noexcept;
FillType (Colour colour) noexcept;
/** Creates a gradient fill type.
@see setGradient
@ -88,7 +88,7 @@ public:
/** Turns this object into a solid colour fill.
If the object was an image or gradient, those fields will no longer be valid. */
void setColour (const Colour& newColour) noexcept;
void setColour (Colour newColour) noexcept;
/** Turns this object into a gradient fill. */
void setGradient (const ColourGradient& newGradient);

View file

@ -112,7 +112,7 @@ public:
This takes into account the opacity of the pixel being overlaid, and blends
it accordingly.
*/
forcedinline void blend (const PixelRGB& src) noexcept;
forcedinline void blend (const PixelRGB src) noexcept;
/** Blends another pixel onto this one, applying an extra multiplier to its opacity.
@ -358,7 +358,7 @@ public:
b = (uint8) sargb;
}
forcedinline void blend (const PixelRGB& src) noexcept
forcedinline void blend (const PixelRGB src) noexcept
{
set (src);
}
@ -467,7 +467,7 @@ private:
#endif
;
forcedinline void PixelARGB::blend (const PixelRGB& src) noexcept
forcedinline void PixelARGB::blend (const PixelRGB src) noexcept
{
set (src);
}

View file

@ -174,7 +174,7 @@ void Graphics::endTransparencyLayer()
}
//==============================================================================
void Graphics::setColour (const Colour& newColour)
void Graphics::setColour (Colour newColour)
{
saveStateIfPending();
context.setFill (newColour);
@ -369,7 +369,7 @@ void Graphics::fillAll() const
fillRect (context.getClipBounds());
}
void Graphics::fillAll (const Colour& colourToUse) const
void Graphics::fillAll (Colour colourToUse) const
{
if (! colourToUse.isTransparent())
{
@ -503,7 +503,7 @@ void Graphics::drawArrow (const Line<float>& line, const float lineThickness, co
void Graphics::fillCheckerBoard (const Rectangle<int>& area,
const int checkWidth, const int checkHeight,
const Colour& colour1, const Colour& colour2) const
Colour colour1, Colour colour2) const
{
jassert (checkWidth > 0 && checkHeight > 0); // can't be zero or less!

View file

@ -81,7 +81,7 @@ public:
@see setOpacity
*/
void setColour (const Colour& newColour);
void setColour (Colour newColour);
/** Changes the opacity to use with the current colour.
@ -251,7 +251,7 @@ public:
//==============================================================================
/** Fills the context's entire clip region with the current colour or brush.
(See also the fillAll (const Colour&) method which is a quick way of filling
(See also the fillAll (Colour) method which is a quick way of filling
it with a given colour).
*/
void fillAll() const;
@ -261,7 +261,7 @@ public:
This leaves the context's current colour and brush unchanged, it just
uses the specified colour temporarily.
*/
void fillAll (const Colour& colourToUse) const;
void fillAll (Colour colourToUse) const;
//==============================================================================
/** Fills a rectangle with the current colour or brush.
@ -301,7 +301,7 @@ public:
*/
void fillCheckerBoard (const Rectangle<int>& area,
int checkWidth, int checkHeight,
const Colour& colour1, const Colour& colour2) const;
Colour colour1, Colour colour2) const;
/** Draws four lines to form a rectangular outline, using the current colour or brush.

View file

@ -28,7 +28,7 @@ LowLevelGraphicsSoftwareRenderer::LowLevelGraphicsSoftwareRenderer (const Image&
{
}
LowLevelGraphicsSoftwareRenderer::LowLevelGraphicsSoftwareRenderer (const Image& image, const Point<int>& origin,
LowLevelGraphicsSoftwareRenderer::LowLevelGraphicsSoftwareRenderer (const Image& image, Point<int> origin,
const RectangleList& initialClip)
: savedState (new RenderingHelpers::SoftwareRendererSavedState (image, initialClip, origin.x, origin.y))
{

View file

@ -42,7 +42,7 @@ class JUCE_API LowLevelGraphicsSoftwareRenderer : public LowLevelGraphicsCon
public:
//==============================================================================
LowLevelGraphicsSoftwareRenderer (const Image& imageToRenderOnto);
LowLevelGraphicsSoftwareRenderer (const Image& imageToRenderOnto, const Point<int>& origin,
LowLevelGraphicsSoftwareRenderer (const Image& imageToRenderOnto, Point<int> origin,
const RectangleList& initialClip);
~LowLevelGraphicsSoftwareRenderer();

View file

@ -69,7 +69,7 @@ DropShadow::DropShadow() noexcept
{
}
DropShadow::DropShadow (const Colour& shadowColour, const int r, const Point<int>& o) noexcept
DropShadow::DropShadow (Colour shadowColour, const int r, Point<int> o) noexcept
: colour (shadowColour), radius (r), offset (o)
{
jassert (radius > 0);

View file

@ -39,7 +39,7 @@ struct JUCE_API DropShadow
DropShadow() noexcept;
/** Creates a drop-shadow object with the given parameters. */
DropShadow (const Colour& shadowColour, int radius, const Point<int>& offset) noexcept;
DropShadow (Colour shadowColour, int radius, Point<int> offset) noexcept;
/** Renders a drop-shadow based on the alpha-channel of the given image. */
void drawForImage (Graphics& g, const Image& srcImage) const;

View file

@ -34,7 +34,7 @@ GlowEffect::~GlowEffect()
}
void GlowEffect::setGlowProperties (const float newRadius,
const Colour& newColour)
Colour newColour)
{
radius = newRadius;
colour = newColour;

View file

@ -58,7 +58,7 @@ public:
opacity).
*/
void setGlowProperties (float newRadius,
const Colour& newColour);
Colour newColour);
//==============================================================================

View file

@ -23,12 +23,12 @@
==============================================================================
*/
AttributedString::Attribute::Attribute (const Range<int>& range_, const Colour& colour_)
AttributedString::Attribute::Attribute (Range<int> range_, Colour colour_)
: range (range_), colour (new Colour (colour_))
{
}
AttributedString::Attribute::Attribute (const Range<int>& range_, const Font& font_)
AttributedString::Attribute::Attribute (Range<int> range_, const Font& font_)
: range (range_), font (new Font (font_))
{
}
@ -137,7 +137,7 @@ void AttributedString::append (const String& textToAppend, const Font& font)
setFont (Range<int> (oldLength, oldLength + newLength), font);
}
void AttributedString::append (const String& textToAppend, const Colour& colour)
void AttributedString::append (const String& textToAppend, Colour colour)
{
const int oldLength = text.length();
const int newLength = textToAppend.length();
@ -146,7 +146,7 @@ void AttributedString::append (const String& textToAppend, const Colour& colour)
setColour (Range<int> (oldLength, oldLength + newLength), colour);
}
void AttributedString::append (const String& textToAppend, const Font& font, const Colour& colour)
void AttributedString::append (const String& textToAppend, const Font& font, Colour colour)
{
const int oldLength = text.length();
const int newLength = textToAppend.length();
@ -191,12 +191,12 @@ void AttributedString::setLineSpacing (const float newLineSpacing) noexcept
lineSpacing = newLineSpacing;
}
void AttributedString::setColour (const Range<int>& range, const Colour& colour)
void AttributedString::setColour (Range<int> range, Colour colour)
{
attributes.add (new Attribute (range, colour));
}
void AttributedString::setColour (const Colour& colour)
void AttributedString::setColour (Colour colour)
{
for (int i = attributes.size(); --i >= 0;)
if (attributes.getUnchecked(i)->getColour() != nullptr)
@ -205,7 +205,7 @@ void AttributedString::setColour (const Colour& colour)
setColour (Range<int> (0, text.length()), colour);
}
void AttributedString::setFont (const Range<int>& range, const Font& font)
void AttributedString::setFont (Range<int> range, const Font& font)
{
attributes.add (new Attribute (range, font));
}

View file

@ -71,9 +71,9 @@ public:
/** Appends some text, with a specified font, and the default colour (black). */
void append (const String& textToAppend, const Font& font);
/** Appends some text, with a specified colour, and the default font. */
void append (const String& textToAppend, const Colour& colour);
void append (const String& textToAppend, Colour colour);
/** Appends some text, with a specified font and colour. */
void append (const String& textToAppend, const Font& font, const Colour& colour);
void append (const String& textToAppend, const Font& font, Colour colour);
/** Appends another AttributedString to this one.
Note that this will only append the text, fonts, and colours - it won't copy any
@ -154,12 +154,12 @@ public:
/** Creates an attribute that changes the colour for a range of characters.
@see AttributedString::setColour()
*/
Attribute (const Range<int>& range, const Colour& colour);
Attribute (Range<int> range, Colour colour);
/** Creates an attribute that changes the font for a range of characters.
@see AttributedString::setFont()
*/
Attribute (const Range<int>& range, const Font& font);
Attribute (Range<int> range, const Font& font);
Attribute (const Attribute&);
~Attribute();
@ -194,13 +194,13 @@ public:
//==============================================================================
/** Adds a colour attribute for the specified range. */
void setColour (const Range<int>& range, const Colour& colour);
void setColour (Range<int> range, Colour colour);
/** Removes all existing colour attributes, and applies this colour to the whole string. */
void setColour (const Colour& colour);
void setColour (Colour colour);
/** Adds a font attribute for the specified range. */
void setFont (const Range<int>& range, const Font& font);
void setFont (Range<int> range, const Font& font);
/** Removes all existing font attributes, and applies this font to the whole string. */
void setFont (const Font& font);

View file

@ -23,7 +23,7 @@
==============================================================================
*/
TextLayout::Glyph::Glyph (const int glyphCode_, const Point<float>& anchor_, float width_) noexcept
TextLayout::Glyph::Glyph (const int glyphCode_, Point<float> anchor_, float width_) noexcept
: glyphCode (glyphCode_), anchor (anchor_), width (width_)
{
}
@ -49,7 +49,7 @@ TextLayout::Run::Run() noexcept
{
}
TextLayout::Run::Run (const Range<int>& range, const int numGlyphsToPreallocate)
TextLayout::Run::Run (Range<int> range, const int numGlyphsToPreallocate)
: colour (0xff000000), stringRange (range)
{
glyphs.ensureStorageAllocated (numGlyphsToPreallocate);
@ -71,7 +71,7 @@ TextLayout::Line::Line() noexcept
{
}
TextLayout::Line::Line (const Range<int>& stringRange_, const Point<float>& lineOrigin_,
TextLayout::Line::Line (Range<int> stringRange_, Point<float> lineOrigin_,
const float ascent_, const float descent_, const float leading_,
const int numRunsToPreallocate)
: stringRange (stringRange_), lineOrigin (lineOrigin_),
@ -251,7 +251,7 @@ namespace TextLayoutHelpers
struct RunAttribute
{
RunAttribute (const FontAndColour& fc, const Range<int>& r) noexcept
RunAttribute (const FontAndColour& fc, const Range<int> r) noexcept
: fontAndColour (fc), range (r)
{}
@ -415,7 +415,7 @@ namespace TextLayoutHelpers
return CharacterFunctions::isWhitespace (c) ? 2 : 1;
}
void appendText (const AttributedString& text, const Range<int>& stringRange,
void appendText (const AttributedString& text, const Range<int> stringRange,
const Font& font, const Colour& colour)
{
const String stringText (text.getText().substring (stringRange.getStart(), stringRange.getEnd()));

View file

@ -82,7 +82,7 @@ public:
class JUCE_API Glyph
{
public:
Glyph (int glyphCode, const Point<float>& anchor, float width) noexcept;
Glyph (int glyphCode, Point<float> anchor, float width) noexcept;
Glyph (const Glyph&) noexcept;
Glyph& operator= (const Glyph&) noexcept;
~Glyph() noexcept;
@ -108,7 +108,7 @@ public:
public:
Run() noexcept;
Run (const Run&);
Run (const Range<int>& stringRange, int numGlyphsToPreallocate);
Run (Range<int> stringRange, int numGlyphsToPreallocate);
~Run() noexcept;
Font font; /**< The run's font. */
@ -128,7 +128,7 @@ public:
public:
Line() noexcept;
Line (const Line&);
Line (const Range<int>& stringRange, const Point<float>& lineOrigin,
Line (Range<int> stringRange, Point<float> lineOrigin,
float ascent, float descent, float leading, int numRunsToPreallocate);
~Line() noexcept;

View file

@ -271,7 +271,7 @@ void Path::startNewSubPath (const float x, const float y)
data.elements [numElements++] = y;
}
void Path::startNewSubPath (const Point<float>& start)
void Path::startNewSubPath (const Point<float> start)
{
startNewSubPath (start.x, start.y);
}
@ -292,7 +292,7 @@ void Path::lineTo (const float x, const float y)
bounds.extend (x, y);
}
void Path::lineTo (const Point<float>& end)
void Path::lineTo (const Point<float> end)
{
lineTo (end.x, end.y);
}
@ -317,8 +317,8 @@ void Path::quadraticTo (const float x1, const float y1,
bounds.extend (x1, y1, x2, y2);
}
void Path::quadraticTo (const Point<float>& controlPoint,
const Point<float>& endPoint)
void Path::quadraticTo (const Point<float> controlPoint,
const Point<float> endPoint)
{
quadraticTo (controlPoint.x, controlPoint.y,
endPoint.x, endPoint.y);
@ -349,9 +349,9 @@ void Path::cubicTo (const float x1, const float y1,
bounds.extend (x3, y3);
}
void Path::cubicTo (const Point<float>& controlPoint1,
const Point<float>& controlPoint2,
const Point<float>& endPoint)
void Path::cubicTo (const Point<float> controlPoint1,
const Point<float> controlPoint2,
const Point<float> endPoint)
{
cubicTo (controlPoint1.x, controlPoint1.y,
controlPoint2.x, controlPoint2.y,
@ -676,7 +676,7 @@ void Path::addArrow (const Line<float>& line, float lineThickness,
closeSubPath();
}
void Path::addPolygon (const Point<float>& centre, const int numberOfSides,
void Path::addPolygon (const Point<float> centre, const int numberOfSides,
const float radius, const float startAngle)
{
jassert (numberOfSides > 1); // this would be silly.
@ -700,7 +700,7 @@ void Path::addPolygon (const Point<float>& centre, const int numberOfSides,
}
}
void Path::addStar (const Point<float>& centre, const int numberOfPoints,
void Path::addStar (const Point<float> centre, const int numberOfPoints,
const float innerRadius, const float outerRadius, const float startAngle)
{
jassert (numberOfPoints > 1); // this would be silly.
@ -728,7 +728,7 @@ void Path::addStar (const Point<float>& centre, const int numberOfPoints,
void Path::addBubble (const Rectangle<float>& bodyArea,
const Rectangle<float>& maximumArea,
const Point<float>& arrowTip,
const Point<float> arrowTip,
const float cornerSize,
const float arrowBaseWidth)
{
@ -1023,7 +1023,7 @@ bool Path::contains (const float x, const float y, const float tolerance) const
: ((negativeCrossings + positiveCrossings) & 1) != 0;
}
bool Path::contains (const Point<float>& point, const float tolerance) const
bool Path::contains (const Point<float> point, const float tolerance) const
{
return contains (point.x, point.y, tolerance);
}
@ -1100,7 +1100,7 @@ Point<float> Path::getPointAlongPath (float distanceFromStart, const AffineTrans
return Point<float> (i.x2, i.y2);
}
float Path::getNearestPoint (const Point<float>& targetPoint, Point<float>& pointOnPath,
float Path::getNearestPoint (const Point<float> targetPoint, Point<float>& pointOnPath,
const AffineTransform& transform) const
{
PathFlatteningIterator i (*this, transform);

View file

@ -134,7 +134,7 @@ public:
@see closeSubPath, setUsingNonZeroWinding
*/
bool contains (const Point<float>& point,
bool contains (const Point<float> point,
float tolerance = 1.0f) const;
/** Checks whether a line crosses the path.
@ -181,7 +181,7 @@ public:
This sets pointOnPath to the nearest point, and returns the distance of this point from the start
of the path.
*/
float getNearestPoint (const Point<float>& targetPoint,
float getNearestPoint (const Point<float> targetPoint,
Point<float>& pointOnPath,
const AffineTransform& transform = AffineTransform::identity) const;
@ -213,7 +213,7 @@ public:
@see lineTo, quadraticTo, cubicTo, closeSubPath
*/
void startNewSubPath (const Point<float>& start);
void startNewSubPath (const Point<float> start);
/** Closes a the current sub-path with a line back to its start-point.
@ -249,7 +249,7 @@ public:
@see startNewSubPath, quadraticTo, cubicTo, closeSubPath
*/
void lineTo (const Point<float>& end);
void lineTo (const Point<float> end);
/** Adds a quadratic bezier curve from the shape's last position to a new position.
@ -274,8 +274,8 @@ public:
@see startNewSubPath, lineTo, cubicTo, closeSubPath
*/
void quadraticTo (const Point<float>& controlPoint,
const Point<float>& endPoint);
void quadraticTo (const Point<float> controlPoint,
const Point<float> endPoint);
/** Adds a cubic bezier curve from the shape's last position to a new position.
@ -302,9 +302,9 @@ public:
@see startNewSubPath, lineTo, quadraticTo, closeSubPath
*/
void cubicTo (const Point<float>& controlPoint1,
const Point<float>& controlPoint2,
const Point<float>& endPoint);
void cubicTo (const Point<float> controlPoint1,
const Point<float> controlPoint2,
const Point<float> endPoint);
/** Returns the last point that was added to the path by one of the drawing methods.
*/
@ -512,7 +512,7 @@ public:
/** Adds a polygon shape to the path.
@see addStar
*/
void addPolygon (const Point<float>& centre,
void addPolygon (const Point<float> centre,
int numberOfSides,
float radius,
float startAngle = 0.0f);
@ -520,7 +520,7 @@ public:
/** Adds a star shape to the path.
@see addPolygon
*/
void addStar (const Point<float>& centre,
void addStar (const Point<float> centre,
int numberOfPoints,
float innerRadius,
float outerRadius,
@ -538,7 +538,7 @@ public:
*/
void addBubble (const Rectangle<float>& bodyArea,
const Rectangle<float>& maximumArea,
const Point<float>& arrowTipPosition,
const Point<float> arrowTipPosition,
const float cornerSize,
const float arrowBaseWidth);

View file

@ -59,8 +59,8 @@ public:
/** Copies this point from another one. */
Point& operator= (const Point& other) noexcept { x = other.x; y = other.y; return *this; }
inline bool operator== (const Point& other) const noexcept { return x == other.x && y == other.y; }
inline bool operator!= (const Point& other) const noexcept { return x != other.x || y != other.y; }
inline bool operator== (Point other) const noexcept { return x == other.x && y == other.y; }
inline bool operator!= (Point other) const noexcept { return x != other.x || y != other.y; }
/** Returns true if the point is (0, 0). */
bool isOrigin() const noexcept { return x == ValueType() && y == ValueType(); }
@ -93,16 +93,16 @@ public:
Point translated (const ValueType xDelta, const ValueType yDelta) const noexcept { return Point (x + xDelta, y + yDelta); }
/** Adds two points together. */
Point operator+ (const Point& other) const noexcept { return Point (x + other.x, y + other.y); }
Point operator+ (Point other) const noexcept { return Point (x + other.x, y + other.y); }
/** Adds another point's co-ordinates to this one. */
Point& operator+= (const Point& other) noexcept { x += other.x; y += other.y; return *this; }
Point& operator+= (Point other) noexcept { x += other.x; y += other.y; return *this; }
/** Subtracts one points from another. */
Point operator- (const Point& other) const noexcept { return Point (x - other.x, y - other.y); }
Point operator- (Point other) const noexcept { return Point (x - other.x, y - other.y); }
/** Subtracts another point's co-ordinates to this one. */
Point& operator-= (const Point& other) noexcept { x -= other.x; y -= other.y; return *this; }
Point& operator-= (Point other) noexcept { x -= other.x; y -= other.y; return *this; }
/** Returns a point whose coordinates are multiplied by a given value. */
Point operator* (const ValueType multiplier) const noexcept { return Point (x * multiplier, y * multiplier); }
@ -123,7 +123,7 @@ public:
ValueType getDistanceFromOrigin() const noexcept { return juce_hypot (x, y); }
/** Returns the straight-line distance between this point and another one. */
ValueType getDistanceFrom (const Point& other) const noexcept { return juce_hypot (x - other.x, y - other.y); }
ValueType getDistanceFrom (Point other) const noexcept { return juce_hypot (x - other.x, y - other.y); }
/** This type will be double if the Point's type is double, otherwise it will be float. */
typedef typename TypeHelpers::SmallestFloatType<ValueType>::type FloatType;
@ -133,7 +133,7 @@ public:
The return value is the number of radians clockwise from the 12 o'clock direction,
where this point is the centre and the other point is on the circumference.
*/
FloatType getAngleToPoint (const Point& other) const noexcept
FloatType getAngleToPoint (Point other) const noexcept
{ return static_cast<FloatType> (std::atan2 (other.x - x, y - other.y)); }
/** Taking this point to be the centre of a circle, this returns a point on its circumference.
@ -165,7 +165,7 @@ public:
transform.mat10 * x + transform.mat11 * y + transform.mat12); }
/** Returns the dot-product of two points (x1 * x2 + y1 * y2). */
FloatType getDotProduct (const Point& other) const noexcept { return x * other.x + y * other.y; }
FloatType getDotProduct (Point other) const noexcept { return x * other.x + y * other.y; }
/** Casts this point to a Point<int> object. */
Point<int> toInt() const noexcept { return Point<int> (static_cast <int> (x), static_cast<int> (y)); }

View file

@ -392,7 +392,7 @@ Colour Image::BitmapData::getPixelColour (const int x, const int y) const noexce
return Colour();
}
void Image::BitmapData::setPixelColour (const int x, const int y, const Colour& colour) const noexcept
void Image::BitmapData::setPixelColour (const int x, const int y, Colour colour) const noexcept
{
jassert (isPositiveAndBelow (x, width) && isPositiveAndBelow (y, height));
@ -409,7 +409,7 @@ void Image::BitmapData::setPixelColour (const int x, const int y, const Colour&
}
//==============================================================================
void Image::clear (const Rectangle<int>& area, const Colour& colourToClearTo)
void Image::clear (const Rectangle<int>& area, Colour colourToClearTo)
{
const ScopedPointer<LowLevelGraphicsContext> g (image->createLowLevelContext());
g->setFill (colourToClearTo);
@ -428,7 +428,7 @@ Colour Image::getPixelAt (const int x, const int y) const
return Colour();
}
void Image::setPixelAt (const int x, const int y, const Colour& colour)
void Image::setPixelAt (const int x, const int y, Colour colour)
{
if (isPositiveAndBelow (x, getWidth()) && isPositiveAndBelow (y, getHeight()))
{

View file

@ -188,7 +188,7 @@ public:
This won't do any alpha-blending - it just sets all pixels in the image to
the given colour (which may be non-opaque if the image has an alpha channel).
*/
void clear (const Rectangle<int>& area, const Colour& colourToClearTo = Colour (0x00000000));
void clear (const Rectangle<int>& area, Colour colourToClearTo = Colour (0x00000000));
/** Returns a rescaled version of this image.
@ -262,7 +262,7 @@ public:
@see getPixelAt, Image::BitmapData::setPixelColour
*/
void setPixelAt (int x, int y, const Colour& colour);
void setPixelAt (int x, int y, Colour colour);
/** Changes the opacity of a pixel.
@ -344,7 +344,7 @@ public:
For performance reasons, this won't do any bounds-checking on the coordinates, so it's the caller's
repsonsibility to make sure they're within the image's size.
*/
void setPixelColour (int x, int y, const Colour& colour) const noexcept;
void setPixelColour (int x, int y, Colour colour) const noexcept;
/** Returns the size of the bitmap. */
Rectangle<int> getBounds() const noexcept { return Rectangle<int> (width, height); }

View file

@ -581,7 +581,7 @@ namespace EdgeTableFillers
class SolidColour
{
public:
SolidColour (const Image::BitmapData& image, const PixelARGB& colour)
SolidColour (const Image::BitmapData& image, const PixelARGB colour)
: destData (image), sourceColour (colour)
{
if (sizeof (PixelType) == 3 && destData.pixelStride == sizeof (PixelType))
@ -651,12 +651,12 @@ namespace EdgeTableFillers
return addBytesToPointer (linePixels, x * destData.pixelStride);
}
inline void blendLine (PixelType* dest, const PixelARGB& colour, int width) const noexcept
inline void blendLine (PixelType* dest, const PixelARGB colour, int width) const noexcept
{
JUCE_PERFORM_PIXEL_OP_LOOP (blend (colour))
}
forcedinline void replaceLine (PixelRGB* dest, const PixelARGB& colour, int width) const noexcept
forcedinline void replaceLine (PixelRGB* dest, const PixelARGB colour, int width) const noexcept
{
if (destData.pixelStride == sizeof (*dest))
{
@ -701,7 +701,7 @@ namespace EdgeTableFillers
}
}
forcedinline void replaceLine (PixelAlpha* dest, const PixelARGB& colour, int width) const noexcept
forcedinline void replaceLine (PixelAlpha* dest, const PixelARGB colour, int width) const noexcept
{
if (destData.pixelStride == sizeof (*dest))
memset (dest, colour.getAlpha(), (size_t) width);
@ -709,7 +709,7 @@ namespace EdgeTableFillers
JUCE_PERFORM_PIXEL_OP_LOOP (setAlpha (colour.getAlpha()))
}
forcedinline void replaceLine (PixelARGB* dest, const PixelARGB& colour, int width) const noexcept
forcedinline void replaceLine (PixelARGB* dest, const PixelARGB colour, int width) const noexcept
{
JUCE_PERFORM_PIXEL_OP_LOOP (set (colour))
}
@ -1497,7 +1497,7 @@ namespace EdgeTableFillers
}
template <class Iterator, class DestPixelType>
void renderSolidFill (Iterator& iter, const Image::BitmapData& destData, const PixelARGB& fillColour, const bool replaceContents, DestPixelType*)
void renderSolidFill (Iterator& iter, const Image::BitmapData& destData, const PixelARGB fillColour, const bool replaceContents, DestPixelType*)
{
if (replaceContents)
{
@ -1556,14 +1556,14 @@ namespace ClipRegions
virtual Ptr clipToPath (const Path&, const AffineTransform&) = 0;
virtual Ptr clipToEdgeTable (const EdgeTable& et) = 0;
virtual Ptr clipToImageAlpha (const Image&, const AffineTransform&, const bool betterQuality) = 0;
virtual void translate (const Point<int>& delta) = 0;
virtual void translate (Point<int> delta) = 0;
virtual bool clipRegionIntersects (const Rectangle<int>&) const = 0;
virtual Rectangle<int> getClipBounds() const = 0;
virtual void fillRectWithColour (Image::BitmapData& destData, const Rectangle<int>&, const PixelARGB& colour, bool replaceContents) const = 0;
virtual void fillRectWithColour (Image::BitmapData& destData, const Rectangle<float>&, const PixelARGB& colour) const = 0;
virtual void fillAllWithColour (Image::BitmapData& destData, const PixelARGB& colour, bool replaceContents) const = 0;
virtual void fillRectWithColour (Image::BitmapData& destData, const Rectangle<int>&, const PixelARGB colour, bool replaceContents) const = 0;
virtual void fillRectWithColour (Image::BitmapData& destData, const Rectangle<float>&, const PixelARGB colour) const = 0;
virtual void fillAllWithColour (Image::BitmapData& destData, const PixelARGB colour, bool replaceContents) const = 0;
virtual void fillAllWithGradient (Image::BitmapData& destData, ColourGradient&, const AffineTransform&, bool isIdentity) const = 0;
virtual void renderImageTransformed (const Image::BitmapData& destData, const Image::BitmapData& srcData, const int alpha, const AffineTransform&, bool betterQuality, bool tiledFill) const = 0;
virtual void renderImageUntransformed (const Image::BitmapData& destData, const Image::BitmapData& srcData, const int alpha, int x, int y, bool tiledFill) const = 0;
@ -1664,7 +1664,7 @@ namespace ClipRegions
return edgeTable.isEmpty() ? nullptr : this;
}
void translate (const Point<int>& delta)
void translate (Point<int> delta)
{
edgeTable.translate ((float) delta.x, delta.y);
}
@ -1679,7 +1679,7 @@ namespace ClipRegions
return edgeTable.getMaximumBounds();
}
void fillRectWithColour (Image::BitmapData& destData, const Rectangle<int>& area, const PixelARGB& colour, bool replaceContents) const
void fillRectWithColour (Image::BitmapData& destData, const Rectangle<int>& area, const PixelARGB colour, bool replaceContents) const
{
const Rectangle<int> totalClip (edgeTable.getMaximumBounds());
const Rectangle<int> clipped (totalClip.getIntersection (area));
@ -1692,7 +1692,7 @@ namespace ClipRegions
}
}
void fillRectWithColour (Image::BitmapData& destData, const Rectangle<float>& area, const PixelARGB& colour) const
void fillRectWithColour (Image::BitmapData& destData, const Rectangle<float>& area, const PixelARGB colour) const
{
const Rectangle<float> totalClip (edgeTable.getMaximumBounds().toFloat());
const Rectangle<float> clipped (totalClip.getIntersection (area));
@ -1705,7 +1705,7 @@ namespace ClipRegions
}
}
void fillAllWithColour (Image::BitmapData& destData, const PixelARGB& colour, bool replaceContents) const
void fillAllWithColour (Image::BitmapData& destData, const PixelARGB colour, bool replaceContents) const
{
switch (destData.pixelFormat)
{
@ -1805,7 +1805,7 @@ namespace ClipRegions
return toEdgeTable()->clipToImageAlpha (image, transform, betterQuality);
}
void translate (const Point<int>& delta)
void translate (Point<int> delta)
{
clip.offsetAll (delta.x, delta.y);
}
@ -1813,7 +1813,7 @@ namespace ClipRegions
bool clipRegionIntersects (const Rectangle<int>& r) const { return clip.intersects (r); }
Rectangle<int> getClipBounds() const { return clip.getBounds(); }
void fillRectWithColour (Image::BitmapData& destData, const Rectangle<int>& area, const PixelARGB& colour, bool replaceContents) const
void fillRectWithColour (Image::BitmapData& destData, const Rectangle<int>& area, const PixelARGB colour, bool replaceContents) const
{
SubRectangleIterator iter (clip, area);
@ -1825,7 +1825,7 @@ namespace ClipRegions
}
}
void fillRectWithColour (Image::BitmapData& destData, const Rectangle<float>& area, const PixelARGB& colour) const
void fillRectWithColour (Image::BitmapData& destData, const Rectangle<float>& area, const PixelARGB colour) const
{
SubRectangleIteratorFloat iter (clip, area);
@ -1837,7 +1837,7 @@ namespace ClipRegions
}
}
void fillAllWithColour (Image::BitmapData& destData, const PixelARGB& colour, bool replaceContents) const
void fillAllWithColour (Image::BitmapData& destData, const PixelARGB colour, bool replaceContents) const
{
switch (destData.pixelFormat)
{

View file

@ -629,8 +629,8 @@ public:
{
radialGradient = 0;
const Point<float>& p1 = fillType.gradient->point1;
const Point<float>& p2 = fillType.gradient->point2;
const Point<float> p1 = fillType.gradient->point1;
const Point<float> p2 = fillType.gradient->point2;
float r = p1.getDistanceFrom (p2);
D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES props =
@ -645,8 +645,8 @@ public:
{
linearGradient = 0;
const Point<float>& p1 = fillType.gradient->point1;
const Point<float>& p2 = fillType.gradient->point2;
const Point<float> p1 = fillType.gradient->point1;
const Point<float> p2 = fillType.gradient->point2;
D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES props =
D2D1::LinearGradientBrushProperties (D2D1::Point2F (p1.x, p1.y),

View file

@ -23,7 +23,7 @@
==============================================================================
*/
ArrowButton::ArrowButton (const String& name, float arrowDirectionInRadians, const Colour& arrowColour)
ArrowButton::ArrowButton (const String& name, float arrowDirectionInRadians, Colour arrowColour)
: Button (name), colour (arrowColour)
{
path.addTriangle (0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.5f);

View file

@ -48,7 +48,7 @@ public:
*/
ArrowButton (const String& buttonName,
float arrowDirection,
const Colour& arrowColour);
Colour arrowColour);
/** Destructor. */
~ArrowButton();

View file

@ -40,13 +40,13 @@ void ImageButton::setImages (const bool resizeButtonNowToFitThisImage,
const bool preserveImageProportions,
const Image& normalImage_,
const float imageOpacityWhenNormal,
const Colour& overlayColourWhenNormal,
Colour overlayColourWhenNormal,
const Image& overImage_,
const float imageOpacityWhenOver,
const Colour& overlayColourWhenOver,
Colour overlayColourWhenOver,
const Image& downImage_,
const float imageOpacityWhenDown,
const Colour& overlayColourWhenDown,
Colour overlayColourWhenDown,
const float hitTestAlphaThreshold)
{
normalImage = normalImage_;

View file

@ -101,13 +101,13 @@ public:
bool preserveImageProportions,
const Image& normalImage,
float imageOpacityWhenNormal,
const Colour& overlayColourWhenNormal,
Colour overlayColourWhenNormal,
const Image& overImage,
float imageOpacityWhenOver,
const Colour& overlayColourWhenOver,
Colour overlayColourWhenOver,
const Image& downImage,
float imageOpacityWhenDown,
const Colour& overlayColourWhenDown,
Colour overlayColourWhenDown,
float hitTestAlphaThreshold = 0.0f);
/** Returns the currently set 'normal' image. */

View file

@ -56,7 +56,7 @@ void ApplicationCommandInfo::setTicked (const bool b) noexcept
flags &= ~isTicked;
}
void ApplicationCommandInfo::addDefaultKeypress (const int keyCode, const ModifierKeys& modifiers) noexcept
void ApplicationCommandInfo::addDefaultKeypress (const int keyCode, ModifierKeys modifiers) noexcept
{
defaultKeypresses.add (KeyPress (keyCode, modifiers, 0));
}

View file

@ -82,7 +82,7 @@ struct JUCE_API ApplicationCommandInfo
@endcode
*/
void addDefaultKeypress (int keyCode,
const ModifierKeys& modifiers) noexcept;
ModifierKeys modifiers) noexcept;
//==============================================================================
/** The command's unique ID number.

View file

@ -194,14 +194,14 @@ struct Component::ComponentHelpers
}
//==============================================================================
static inline bool hitTest (Component& comp, const Point<int>& localPoint)
static inline bool hitTest (Component& comp, Point<int> localPoint)
{
return isPositiveAndBelow (localPoint.x, comp.getWidth())
&& isPositiveAndBelow (localPoint.y, comp.getHeight())
&& comp.hitTest (localPoint.x, localPoint.y);
}
static Point<int> convertFromParentSpace (const Component& comp, const Point<int>& pointInParentSpace)
static Point<int> convertFromParentSpace (const Component& comp, Point<int> pointInParentSpace)
{
if (comp.affineTransform == nullptr)
return pointInParentSpace - comp.getPosition();
@ -217,7 +217,7 @@ struct Component::ComponentHelpers
return areaInParentSpace.toFloat().transformed (comp.affineTransform->inverted()).getSmallestIntegerContainer() - comp.getPosition();
}
static Point<int> convertToParentSpace (const Component& comp, const Point<int>& pointInLocalSpace)
static Point<int> convertToParentSpace (const Component& comp, Point<int> pointInLocalSpace)
{
if (comp.affineTransform == nullptr)
return pointInLocalSpace + comp.getPosition();
@ -295,7 +295,7 @@ struct Component::ComponentHelpers
return r;
}
static bool clipObscuredRegions (const Component& comp, Graphics& g, const Rectangle<int>& clipRect, const Point<int>& delta)
static bool clipObscuredRegions (const Component& comp, Graphics& g, const Rectangle<int>& clipRect, Point<int> delta)
{
bool nothingChanged = true;
@ -328,7 +328,7 @@ struct Component::ComponentHelpers
}
static void subtractObscuredRegions (const Component& comp, RectangleList& result,
const Point<int>& delta, const Rectangle<int>& clipRect,
Point<int> delta, const Rectangle<int>& clipRect,
const Component* const compToAvoid)
{
for (int i = comp.childComponentList.size(); --i >= 0;)
@ -966,7 +966,7 @@ Rectangle<int> Component::getParentMonitorArea() const
return Desktop::getInstance().getDisplays().getDisplayContaining (getScreenBounds().getCentre()).userArea;
}
Point<int> Component::getLocalPoint (const Component* source, const Point<int>& point) const
Point<int> Component::getLocalPoint (const Component* source, Point<int> point) const
{
return ComponentHelpers::convertCoordinate (this, source, point);
}
@ -976,7 +976,7 @@ Rectangle<int> Component::getLocalArea (const Component* source, const Rectangle
return ComponentHelpers::convertCoordinate (this, source, area);
}
Point<int> Component::localPointToGlobal (const Point<int>& point) const
Point<int> Component::localPointToGlobal (Point<int> point) const
{
return ComponentHelpers::convertCoordinate (nullptr, this, point);
}
@ -987,17 +987,17 @@ Rectangle<int> Component::localAreaToGlobal (const Rectangle<int>& area) const
}
// Deprecated methods...
Point<int> Component::relativePositionToGlobal (const Point<int>& relativePosition) const
Point<int> Component::relativePositionToGlobal (Point<int> relativePosition) const
{
return localPointToGlobal (relativePosition);
}
Point<int> Component::globalPositionToRelative (const Point<int>& screenPosition) const
Point<int> Component::globalPositionToRelative (Point<int> screenPosition) const
{
return getLocalPoint (nullptr, screenPosition);
}
Point<int> Component::relativePositionToOtherComponent (const Component* const targetComponent, const Point<int>& positionRelativeToThis) const
Point<int> Component::relativePositionToOtherComponent (const Component* const targetComponent, Point<int> positionRelativeToThis) const
{
return targetComponent == nullptr ? localPointToGlobal (positionRelativeToThis)
: targetComponent->getLocalPoint (this, positionRelativeToThis);
@ -1104,7 +1104,7 @@ void Component::setTopLeftPosition (const int x, const int y)
setBounds (x, y, getWidth(), getHeight());
}
void Component::setTopLeftPosition (const Point<int>& pos)
void Component::setTopLeftPosition (Point<int> pos)
{
setBounds (pos.x, pos.y, getWidth(), getHeight());
}
@ -1287,7 +1287,7 @@ void Component::getInterceptsMouseClicks (bool& allowsClicksOnThisComponent,
allowsClicksOnChildComponents = flags.allowChildMouseClicksFlag;
}
bool Component::contains (const Point<int>& point)
bool Component::contains (Point<int> point)
{
if (ComponentHelpers::hitTest (*this, point))
{
@ -1302,7 +1302,7 @@ bool Component::contains (const Point<int>& point)
return false;
}
bool Component::reallyContains (const Point<int>& point, const bool returnTrueIfWithinAChild)
bool Component::reallyContains (Point<int> point, const bool returnTrueIfWithinAChild)
{
if (! contains (point))
return false;
@ -1313,7 +1313,7 @@ bool Component::reallyContains (const Point<int>& point, const bool returnTrueIf
return (compAtPosition == this) || (returnTrueIfWithinAChild && isParentOf (compAtPosition));
}
Component* Component::getComponentAt (const Point<int>& position)
Component* Component::getComponentAt (Point<int> position)
{
if (flags.visibleFlag && ComponentHelpers::hitTest (*this, position))
{
@ -2046,7 +2046,7 @@ void Component::removeColour (const int colourId)
colourChanged();
}
void Component::setColour (const int colourId, const Colour& colour)
void Component::setColour (const int colourId, Colour colour)
{
if (properties.set (ComponentHelpers::getColourPropertyId (colourId), (int) colour.getARGB()))
colourChanged();
@ -2245,7 +2245,7 @@ void Component::removeMouseListener (MouseListener* const listenerToRemove)
}
//==============================================================================
void Component::internalMouseEnter (MouseInputSource& source, const Point<int>& relativePos, const Time& time)
void Component::internalMouseEnter (MouseInputSource& source, Point<int> relativePos, Time time)
{
if (isCurrentlyBlockedByAnotherModalComponent())
{
@ -2271,7 +2271,7 @@ void Component::internalMouseEnter (MouseInputSource& source, const Point<int>&
MouseListenerList::sendMouseEvent (*this, checker, &MouseListener::mouseEnter, me);
}
void Component::internalMouseExit (MouseInputSource& source, const Point<int>& relativePos, const Time& time)
void Component::internalMouseExit (MouseInputSource& source, Point<int> relativePos, Time time)
{
if (flags.repaintOnMouseActivityFlag)
repaint();
@ -2291,7 +2291,7 @@ void Component::internalMouseExit (MouseInputSource& source, const Point<int>& r
MouseListenerList::sendMouseEvent (*this, checker, &MouseListener::mouseExit, me);
}
void Component::internalMouseDown (MouseInputSource& source, const Point<int>& relativePos, const Time& time)
void Component::internalMouseDown (MouseInputSource& source, Point<int> relativePos, Time time)
{
Desktop& desktop = Desktop::getInstance();
BailOutChecker checker (this);
@ -2355,8 +2355,8 @@ void Component::internalMouseDown (MouseInputSource& source, const Point<int>& r
MouseListenerList::sendMouseEvent (*this, checker, &MouseListener::mouseDown, me);
}
void Component::internalMouseUp (MouseInputSource& source, const Point<int>& relativePos,
const Time& time, const ModifierKeys& oldModifiers)
void Component::internalMouseUp (MouseInputSource& source, Point<int> relativePos,
Time time, const ModifierKeys oldModifiers)
{
if (flags.mouseDownWasBlocked && isCurrentlyBlockedByAnotherModalComponent())
return;
@ -2398,7 +2398,7 @@ void Component::internalMouseUp (MouseInputSource& source, const Point<int>& rel
}
}
void Component::internalMouseDrag (MouseInputSource& source, const Point<int>& relativePos, const Time& time)
void Component::internalMouseDrag (MouseInputSource& source, Point<int> relativePos, Time time)
{
if (! isCurrentlyBlockedByAnotherModalComponent())
{
@ -2421,7 +2421,7 @@ void Component::internalMouseDrag (MouseInputSource& source, const Point<int>& r
}
}
void Component::internalMouseMove (MouseInputSource& source, const Point<int>& relativePos, const Time& time)
void Component::internalMouseMove (MouseInputSource& source, Point<int> relativePos, Time time)
{
Desktop& desktop = Desktop::getInstance();
@ -2447,8 +2447,8 @@ void Component::internalMouseMove (MouseInputSource& source, const Point<int>& r
}
}
void Component::internalMouseWheel (MouseInputSource& source, const Point<int>& relativePos,
const Time& time, const MouseWheelDetails& wheel)
void Component::internalMouseWheel (MouseInputSource& source, Point<int> relativePos,
Time time, const MouseWheelDetails& wheel)
{
Desktop& desktop = Desktop::getInstance();
BailOutChecker checker (this);
@ -2475,8 +2475,8 @@ void Component::internalMouseWheel (MouseInputSource& source, const Point<int>&
}
}
void Component::internalMagnifyGesture (MouseInputSource& source, const Point<int>& relativePos,
const Time& time, float amount)
void Component::internalMagnifyGesture (MouseInputSource& source, Point<int> relativePos,
Time time, float amount)
{
if (! isCurrentlyBlockedByAnotherModalComponent())
{

View file

@ -288,7 +288,7 @@ public:
int getRight() const noexcept { return bounds.getRight(); }
/** Returns the component's top-left position as a Point. */
const Point<int>& getPosition() const noexcept { return bounds.getPosition(); }
Point<int> getPosition() const noexcept { return bounds.getPosition(); }
/** Returns the y coordinate of the bottom edge of this component.
This is a distance in pixels from the top edge of the component's parent.
@ -361,7 +361,7 @@ public:
screen coordinate.
*/
Point<int> getLocalPoint (const Component* sourceComponent,
const Point<int>& pointRelativeToSourceComponent) const;
Point<int> pointRelativeToSourceComponent) const;
/** Converts a rectangle to be relative to this component's coordinate space.
@ -379,7 +379,7 @@ public:
/** Converts a point relative to this component's top-left into a screen coordinate.
@see getLocalPoint, localAreaToGlobal
*/
Point<int> localPointToGlobal (const Point<int>& localPoint) const;
Point<int> localPointToGlobal (Point<int> localPoint) const;
/** Converts a rectangle from this component's coordinate space to a screen coordinate.
@ -419,7 +419,7 @@ public:
@see setBounds, ComponentListener::componentMovedOrResized
*/
void setTopLeftPosition (const Point<int>& newTopLeftPosition);
void setTopLeftPosition (Point<int> newTopLeftPosition);
/** Moves the component to a new position.
@ -897,7 +897,7 @@ public:
which might be in the way - for that, see reallyContains()
@see hitTest, reallyContains, getComponentAt
*/
bool contains (const Point<int>& localPoint);
bool contains (Point<int> localPoint);
/** Returns true if a given point lies in this component, taking any overlapping
siblings into account.
@ -907,7 +907,7 @@ public:
this determines whether that is counted as a hit.
@see contains, getComponentAt
*/
bool reallyContains (const Point<int>& localPoint, bool returnTrueIfWithinAChild);
bool reallyContains (Point<int> localPoint, bool returnTrueIfWithinAChild);
/** Returns the component at a certain point within this one.
@ -930,7 +930,7 @@ public:
instead call getComponentAt on the top-level parent of this component.
@see hitTest, contains, reallyContains
*/
Component* getComponentAt (const Point<int>& position);
Component* getComponentAt (Point<int> position);
//==============================================================================
/** Marks the whole component as needing to be redrawn.
@ -2043,7 +2043,7 @@ public:
@see findColour, isColourSpecified, colourChanged, LookAndFeel::findColour, LookAndFeel::setColour
*/
void setColour (int colourId, const Colour& colour);
void setColour (int colourId, Colour newColour);
/** If a colour has been set with setColour(), this will remove it.
This allows you to make a colour revert to its default state.
@ -2217,9 +2217,9 @@ public:
//==============================================================================
#ifndef DOXYGEN
// These methods are deprecated - use localPointToGlobal, getLocalPoint, getLocalPoint, etc instead.
JUCE_DEPRECATED (Point<int> relativePositionToGlobal (const Point<int>&) const);
JUCE_DEPRECATED (Point<int> globalPositionToRelative (const Point<int>&) const);
JUCE_DEPRECATED (Point<int> relativePositionToOtherComponent (const Component*, const Point<int>&) const);
JUCE_DEPRECATED (Point<int> relativePositionToGlobal (Point<int>) const);
JUCE_DEPRECATED (Point<int> globalPositionToRelative (Point<int>) const);
JUCE_DEPRECATED (Point<int> relativePositionToOtherComponent (const Component*, Point<int>) const);
#endif
private:
@ -2287,14 +2287,14 @@ private:
uint8 componentTransparency;
//==============================================================================
void internalMouseEnter (MouseInputSource&, const Point<int>&, const Time&);
void internalMouseExit (MouseInputSource&, const Point<int>&, const Time&);
void internalMouseDown (MouseInputSource&, const Point<int>&, const Time&);
void internalMouseUp (MouseInputSource&, const Point<int>&, const Time&, const ModifierKeys& oldModifiers);
void internalMouseDrag (MouseInputSource&, const Point<int>&, const Time&);
void internalMouseMove (MouseInputSource&, const Point<int>&, const Time&);
void internalMouseWheel (MouseInputSource&, const Point<int>&, const Time&, const MouseWheelDetails&);
void internalMagnifyGesture (MouseInputSource&, const Point<int>&, const Time&, float);
void internalMouseEnter (MouseInputSource&, Point<int>, Time);
void internalMouseExit (MouseInputSource&, Point<int>, Time);
void internalMouseDown (MouseInputSource&, Point<int>, Time);
void internalMouseUp (MouseInputSource&, Point<int>, Time, const ModifierKeys oldModifiers);
void internalMouseDrag (MouseInputSource&, Point<int>, Time);
void internalMouseMove (MouseInputSource&, Point<int>, Time);
void internalMouseWheel (MouseInputSource&, Point<int>, Time, const MouseWheelDetails&);
void internalMagnifyGesture (MouseInputSource&, Point<int>, Time, float);
void internalBroughtToFront();
void internalFocusGain (const FocusChangeType, const WeakReference<Component>&);
void internalFocusGain (const FocusChangeType);
@ -2336,7 +2336,7 @@ private:
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 (const Point<int>&)
// favour of contains (Point<int>)
void contains (int, int);
#endif

View file

@ -64,7 +64,7 @@ Component* Desktop::getComponent (const int index) const noexcept
return desktopComponents [index];
}
Component* Desktop::findComponentAt (const Point<int>& screenPosition) const
Component* Desktop::findComponentAt (Point<int> screenPosition) const
{
for (int i = desktopComponents.size(); --i >= 0;)
{
@ -328,7 +328,7 @@ const Desktop::Displays::Display& Desktop::Displays::getMainDisplay() const noex
return displays.getReference(0);
}
const Desktop::Displays::Display& Desktop::Displays::getDisplayContaining (const Point<int>& position) const noexcept
const Desktop::Displays::Display& Desktop::Displays::getDisplayContaining (Point<int> position) const noexcept
{
const Display* best = &displays.getReference(0);
double bestDistance = 1.0e10;

View file

@ -80,7 +80,7 @@ public:
/** Makes the mouse pointer jump to a given location.
The co-ordinates are relative to the top-left of the main monitor.
*/
static void setMousePosition (const Point<int>& newPosition);
static void setMousePosition (Point<int> newPosition);
/** Returns the last position at which a mouse button was pressed.
@ -203,7 +203,7 @@ public:
Returns nullptr if the co-ordinates are inside a non-Juce window.
*/
Component* findComponentAt (const Point<int>& screenPosition) const;
Component* findComponentAt (Point<int> screenPosition) const;
/** The Desktop object has a ComponentAnimator instance which can be used for performing
your animations.
@ -343,7 +343,7 @@ public:
/** Returns the display which contains a particular point.
If the point lies outside all the displays, the nearest one will be returned.
*/
const Display& getDisplayContaining (const Point<int>& position) const noexcept;
const Display& getDisplayContaining (Point<int> position) const noexcept;
/** Returns a RectangleList made up of all the displays. */
RectangleList getRectangleList (bool userAreasOnly) const;

View file

@ -109,7 +109,7 @@ void Drawable::setBoundsToEnclose (const Rectangle<float>& area)
}
//==============================================================================
void Drawable::setOriginWithOriginalSize (const Point<float>& originWithinParent)
void Drawable::setOriginWithOriginalSize (Point<float> originWithinParent)
{
setTransform (AffineTransform::translation (originWithinParent.x, originWithinParent.y));
}

View file

@ -113,7 +113,7 @@ public:
/** Resets any transformations on this drawable, and positions its origin within
its parent component.
*/
void setOriginWithOriginalSize (const Point<float>& originWithinParent);
void setOriginWithOriginalSize (Point<float> originWithinParent);
/** Sets a transform for this drawable that will position it within the specified
area of its parent component.

View file

@ -403,7 +403,7 @@ namespace DrawablePathHelpers
}
}
float DrawablePath::ValueTreeWrapper::Element::findProportionAlongLine (const Point<float>& targetPoint, Expression::Scope* scope) const
float DrawablePath::ValueTreeWrapper::Element::findProportionAlongLine (Point<float> targetPoint, Expression::Scope* scope) const
{
using namespace DrawablePathHelpers;
const Identifier pointType (state.getType());
@ -460,7 +460,7 @@ float DrawablePath::ValueTreeWrapper::Element::findProportionAlongLine (const Po
return bestProp;
}
ValueTree DrawablePath::ValueTreeWrapper::Element::insertPoint (const Point<float>& targetPoint, Expression::Scope* scope, UndoManager* undoManager)
ValueTree DrawablePath::ValueTreeWrapper::Element::insertPoint (Point<float> targetPoint, Expression::Scope* scope, UndoManager* undoManager)
{
ValueTree newTree;
const Identifier pointType (state.getType());

View file

@ -112,9 +112,9 @@ public:
void convertToLine (UndoManager*);
void convertToCubic (Expression::Scope*, UndoManager*);
void convertToPathBreak (UndoManager* undoManager);
ValueTree insertPoint (const Point<float>& targetPoint, Expression::Scope*, UndoManager*);
ValueTree insertPoint (Point<float> targetPoint, Expression::Scope*, UndoManager*);
void removePoint (UndoManager* undoManager);
float findProportionAlongLine (const Point<float>& targetPoint, Expression::Scope*) const;
float findProportionAlongLine (Point<float> targetPoint, Expression::Scope*) const;
static const Identifier mode, startSubPathElement, closeSubPathElement,
lineToElement, quadraticToElement, cubicToElement;

View file

@ -59,7 +59,7 @@ void DrawableText::setText (const String& newText)
}
}
void DrawableText::setColour (const Colour& newColour)
void DrawableText::setColour (Colour newColour)
{
if (colour != newColour)
{
@ -233,7 +233,7 @@ Colour DrawableText::ValueTreeWrapper::getColour() const
return Colour::fromString (state [colour].toString());
}
void DrawableText::ValueTreeWrapper::setColour (const Colour& newColour, UndoManager* undoManager)
void DrawableText::ValueTreeWrapper::setColour (Colour newColour, UndoManager* undoManager)
{
state.setProperty (colour, newColour.toString(), undoManager);
}

View file

@ -55,10 +55,10 @@ public:
const String& getText() const noexcept { return text;}
/** Sets the colour of the text. */
void setColour (const Colour& newColour);
void setColour (Colour newColour);
/** Returns the current text colour. */
const Colour& getColour() const noexcept { return colour; }
Colour getColour() const noexcept { return colour; }
/** Sets the font to use.
Note that the font height and horizontal scale are set as RelativeCoordinates using
@ -115,7 +115,7 @@ public:
Value getTextValue (UndoManager* undoManager);
Colour getColour() const;
void setColour (const Colour& newColour, UndoManager* undoManager);
void setColour (Colour newColour, UndoManager* undoManager);
Justification getJustification() const;
void setJustification (const Justification& newJustification, UndoManager* undoManager);

View file

@ -714,7 +714,7 @@ private:
const String& fill,
const String& fillOpacity,
const String& overallOpacity,
const Colour& defaultColour) const
const Colour defaultColour) const
{
float opacity = 1.0f;
@ -1045,7 +1045,7 @@ private:
}
//==============================================================================
static Colour parseColour (const String& s, int& index, const Colour& defaultColour)
static Colour parseColour (const String& s, int& index, const Colour defaultColour)
{
if (s [index] == '#')
{
@ -1071,9 +1071,10 @@ private:
(uint8) ((hex [2] << 4) + hex [3]),
(uint8) ((hex [4] << 4) + hex [5]));
}
else if (s [index] == 'r'
&& s [index + 1] == 'g'
&& s [index + 2] == 'b')
if (s [index] == 'r'
&& s [index + 1] == 'g'
&& s [index + 2] == 'b')
{
const int openBracket = s.indexOfChar (index, '(');
const int closeBracket = s.indexOfChar (openBracket, ')');

View file

@ -232,8 +232,8 @@ int DirectoryContentsList::compareElements (const DirectoryContentsList::FileInf
bool DirectoryContentsList::addFile (const File& file,
const bool isDir,
const int64 fileSize,
const Time& modTime,
const Time& creationTime,
const Time modTime,
const Time creationTime,
const bool isReadOnly)
{
if (fileFilter == nullptr

View file

@ -206,8 +206,8 @@ private:
void changed();
bool checkNextFile (bool& hasChanged);
bool addFile (const File& file, bool isDir,
const int64 fileSize, const Time& modTime,
const Time& creationTime, bool isReadOnly);
const int64 fileSize, const Time modTime,
const Time creationTime, bool isReadOnly);
void setTypeFlags (int newFlags);
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectoryContentsList)

View file

@ -30,7 +30,7 @@ KeyPress::KeyPress() noexcept
}
KeyPress::KeyPress (const int keyCode_,
const ModifierKeys& mods_,
ModifierKeys mods_,
const juce_wchar textCharacter_) noexcept
: keyCode (keyCode_),
mods (mods_),

View file

@ -67,7 +67,7 @@ public:
@see getKeyCode, isKeyCode, getModifiers
*/
KeyPress (int keyCode,
const ModifierKeys& modifiers,
ModifierKeys modifiers,
juce_wchar textCharacter) noexcept;
/** Creates a keypress with a keyCode but no modifiers or text character. */

View file

@ -38,7 +38,7 @@ ModifierKeys::ModifierKeys (const ModifierKeys& other) noexcept
{
}
ModifierKeys& ModifierKeys::operator= (const ModifierKeys& other) noexcept
ModifierKeys& ModifierKeys::operator= (const ModifierKeys other) noexcept
{
flags = other.flags;
return *this;

View file

@ -55,7 +55,7 @@ public:
ModifierKeys (const ModifierKeys& other) noexcept;
/** Copies this object from another one. */
ModifierKeys& operator= (const ModifierKeys& other) noexcept;
ModifierKeys& operator= (const ModifierKeys other) noexcept;
//==============================================================================
/** Checks whether the 'command' key flag is set (or 'ctrl' on Windows/Linux).
@ -167,8 +167,8 @@ public:
/** Returns a copy of only the non-mouse flags */
ModifierKeys withoutMouseButtons() const noexcept { return ModifierKeys (flags & ~allMouseButtonModifiers); }
bool operator== (const ModifierKeys& other) const noexcept { return flags == other.flags; }
bool operator!= (const ModifierKeys& other) const noexcept { return flags != other.flags; }
bool operator== (const ModifierKeys other) const noexcept { return flags == other.flags; }
bool operator!= (const ModifierKeys other) const noexcept { return flags != other.flags; }
//==============================================================================
/** Returns the raw flags for direct testing. */

View file

@ -46,7 +46,7 @@ bool ResizableBorderComponent::Zone::operator!= (const ResizableBorderComponent:
ResizableBorderComponent::Zone ResizableBorderComponent::Zone::fromPositionOnBorder (const Rectangle<int>& totalSize,
const BorderSize<int>& border,
const Point<int>& position)
Point<int> position)
{
int z = 0;

View file

@ -121,7 +121,7 @@ public:
*/
static Zone fromPositionOnBorder (const Rectangle<int>& totalSize,
const BorderSize<int>& border,
const Point<int>& position);
Point<int> position);
/** Returns an appropriate mouse-cursor for this resize zone. */
MouseCursor getMouseCursor() const noexcept;

View file

@ -79,7 +79,7 @@ ScrollBar::~ScrollBar()
}
//==============================================================================
void ScrollBar::setRangeLimits (const Range<double>& newRangeLimit, NotificationType notification)
void ScrollBar::setRangeLimits (Range<double> newRangeLimit, NotificationType notification)
{
if (totalRange != newRangeLimit)
{
@ -95,7 +95,7 @@ void ScrollBar::setRangeLimits (const double newMinimum, const double newMaximum
setRangeLimits (Range<double> (newMinimum, newMaximum), notification);
}
bool ScrollBar::setCurrentRange (const Range<double>& newRange,
bool ScrollBar::setCurrentRange (Range<double> newRange,
const NotificationType notification)
{
const Range<double> constrainedRange (totalRange.constrainRange (newRange));

View file

@ -99,7 +99,7 @@ public:
@see setCurrentRange
*/
void setRangeLimits (const Range<double>& newRangeLimit,
void setRangeLimits (Range<double> newRangeLimit,
NotificationType notification = sendNotificationAsync);
/** Sets the minimum and maximum values that the bar will move between.
@ -145,7 +145,7 @@ public:
@returns true if the range was changed, or false if nothing was changed.
@see getCurrentRange. setCurrentRangeStart
*/
bool setCurrentRange (const Range<double>& newRange,
bool setCurrentRange (Range<double> newRange,
NotificationType notification = sendNotificationAsync);
/** Changes the position of the scrollbar's 'thumb'.

View file

@ -98,7 +98,7 @@ void Viewport::setViewedComponent (Component* const newViewedComponent, const bo
int Viewport::getMaximumVisibleWidth() const { return contentHolder.getWidth(); }
int Viewport::getMaximumVisibleHeight() const { return contentHolder.getHeight(); }
Point<int> Viewport::viewportPosToCompPos (const Point<int>& pos) const
Point<int> Viewport::viewportPosToCompPos (Point<int> pos) const
{
jassert (contentComp != nullptr);
return Point<int> (jmax (jmin (0, contentHolder.getWidth() - contentComp->getWidth()), jmin (0, -(pos.x))),
@ -110,7 +110,7 @@ void Viewport::setViewPosition (const int xPixelsOffset, const int yPixelsOffset
setViewPosition (Point<int> (xPixelsOffset, yPixelsOffset));
}
void Viewport::setViewPosition (const Point<int>& newPosition)
void Viewport::setViewPosition (Point<int> newPosition)
{
if (contentComp != nullptr)
contentComp->setTopLeftPosition (viewportPosToCompPos (newPosition));

View file

@ -106,7 +106,7 @@ public:
@see getViewPositionX, getViewPositionY, setViewPositionProportionately
*/
void setViewPosition (const Point<int>& newPosition);
void setViewPosition (Point<int> newPosition);
/** Changes the view position as a proportion of the distance it can move.
@ -136,7 +136,7 @@ public:
/** Returns the position within the child component of the top-left of its visible area.
*/
const Point<int>& getViewPosition() const noexcept { return lastVisibleArea.getPosition(); }
Point<int> getViewPosition() const noexcept { return lastVisibleArea.getPosition(); }
/** Returns the position within the child component of the top-left of its visible area.
@see getViewWidth, setViewPosition
@ -260,7 +260,7 @@ private:
Component contentHolder;
ScrollBar verticalScrollBar;
ScrollBar horizontalScrollBar;
Point<int> viewportPosToCompPos (const Point<int>&) const;
Point<int> viewportPosToCompPos (Point<int>) const;
void updateVisibleArea();
void deleteContentComp();

View file

@ -110,7 +110,7 @@ void MenuBarComponent::resized()
}
}
int MenuBarComponent::getItemAt (const Point<int>& p)
int MenuBarComponent::getItemAt (Point<int> p)
{
for (int i = 0; i < xPositions.size(); ++i)
if (p.x >= xPositions[i] && p.x < xPositions[i + 1])
@ -157,7 +157,7 @@ void MenuBarComponent::setOpenItem (int index)
}
}
void MenuBarComponent::updateItemUnderMouse (const Point<int>& p)
void MenuBarComponent::updateItemUnderMouse (Point<int> p)
{
setItemUnderMouse (getItemAt (p));
}

View file

@ -108,10 +108,10 @@ private:
Point<int> lastMousePos;
int itemUnderMouse, currentPopupIndex, topLevelIndexClicked;
int getItemAt (const Point<int>&);
int getItemAt (Point<int>);
void setItemUnderMouse (int index);
void setOpenItem (int index);
void updateItemUnderMouse (const Point<int>&);
void updateItemUnderMouse (Point<int>);
void timerCallback();
void repaintMenuItem (int index);
void menuDismissed (int topLevelIndex, int itemId);

View file

@ -47,7 +47,7 @@ public:
const bool active,
const bool ticked,
const Image& im,
const Colour& colour,
const Colour colour,
const bool useColour,
CustomComponent* const custom,
const PopupMenu* const sub,
@ -564,7 +564,7 @@ private:
&& (isOver || (activeSubMenu != nullptr && activeSubMenu->isOverChildren()));
}
void updateMouseOverStatus (const Point<int>& globalMousePos)
void updateMouseOverStatus (Point<int> globalMousePos)
{
isOver = reallyContains (getLocalPoint (nullptr, globalMousePos), true);
@ -930,7 +930,7 @@ private:
return false;
}
void highlightItemUnderMouse (const Point<int>& globalMousePos, const Point<int>& localMousePos, const uint32 timeNow)
void highlightItemUnderMouse (Point<int> globalMousePos, Point<int> localMousePos, const uint32 timeNow)
{
if (globalMousePos != lastMousePos || timeNow > lastMouseMoveTime + 350)
{
@ -1006,7 +1006,7 @@ private:
}
}
void checkButtonState (const Point<int>& localMousePos, const uint32 timeNow,
void checkButtonState (Point<int> localMousePos, const uint32 timeNow,
const bool wasDown, const bool overScrollArea, const bool isOverAny)
{
isDown = hasBeenOver
@ -1088,7 +1088,7 @@ private:
bool isTopScrollZoneActive() const noexcept { return canScroll() && childYOffset > 0; }
bool isBottomScrollZoneActive() const noexcept { return canScroll() && childYOffset < contentHeight - windowPos.getHeight(); }
bool scrollIfNecessary (const Point<int>& localMousePos, const uint32 timeNow)
bool scrollIfNecessary (Point<int> localMousePos, const uint32 timeNow)
{
if (canScroll()
&& (isOver || (isDown && isPositiveAndBelow (localMousePos.x, getWidth()))))
@ -1214,7 +1214,7 @@ void PopupMenu::addCommandItem (ApplicationCommandManager* commandManager,
void PopupMenu::addColouredItem (const int itemResultID,
const String& itemText,
const Colour& itemTextColour,
Colour itemTextColour,
const bool isActive,
const bool isTicked,
const Image& iconToUse)

View file

@ -146,7 +146,7 @@ public:
*/
void addColouredItem (int itemResultID,
const String& itemText,
const Colour& itemTextColour,
Colour itemTextColour,
bool isEnabled = true,
bool isTicked = false,
const Image& iconToUse = Image::null);

View file

@ -60,7 +60,7 @@ void BubbleComponent::setPosition (Component* componentToPointTo)
setPosition (componentToPointTo->getScreenBounds());
}
void BubbleComponent::setPosition (const Point<int>& pos)
void BubbleComponent::setPosition (Point<int> pos)
{
setPosition (Rectangle<int> (pos.x, pos.y, 1, 1));
}

Some files were not shown because too many files have changed in this diff Show more