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

Removed some superfluous consts from definitions

This commit is contained in:
Tom Poole 2023-09-20 12:28:25 +01:00
parent 1eea4766ce
commit 7d45d498b9
47 changed files with 120 additions and 119 deletions

View file

@ -70,7 +70,7 @@ namespace build_tools
const String& utf8PointerVariable,
const StringArray& strings,
const StringArray& codeToExecute,
const int indentLevel);
int indentLevel);
String unixStylePath (const String& path);
String windowsStylePath (const String& path);

View file

@ -40,7 +40,7 @@ namespace build_tools
Image getBestIconForSize (const Icons& icons,
int size,
bool returnNullIfNothingBigEnough);
Image rescaleImageForIcon (Drawable& d, const int size);
Image rescaleImageForIcon (Drawable& d, int size);
RelativePath createXcassetsFolderFromIcons (const Icons& icons,
const File& targetFolder,

View file

@ -120,7 +120,7 @@ public:
int getDefaultHeight() const noexcept { return defaultHeight; }
static int64 getComponentId (Component* comp);
static void setComponentId (Component* comp, const int64 newID);
static void setComponentId (Component* comp, int64 newID);
static RelativePositionedRectangle getComponentPosition (Component* comp);
static void setComponentPosition (Component* comp,

View file

@ -38,14 +38,14 @@ public:
String getTypeName() const;
JucerDocument* createCopy();
Component* createTestComponent (const bool alwaysFillBackground);
Component* createTestComponent (bool alwaysFillBackground);
int getNumPaintRoutines() const;
StringArray getPaintRoutineNames() const;
PaintRoutine* getPaintRoutine (const int index) const;
PaintRoutine* getPaintRoutine (int index) const;
void setStatePaintRoutineEnabled (const int index, bool b);
bool isStatePaintRoutineEnabled (const int index) const;
void setStatePaintRoutineEnabled (int index, bool b);
bool isStatePaintRoutineEnabled (int index) const;
int chooseBestEnabledPaintRoutine (int paintRoutineWanted) const;

View file

@ -38,11 +38,11 @@ public:
String getTypeName() const;
JucerDocument* createCopy();
Component* createTestComponent (const bool alwaysFillBackground);
Component* createTestComponent (bool alwaysFillBackground);
int getNumPaintRoutines() const { return 1; }
StringArray getPaintRoutineNames() const { return StringArray ("Graphics"); }
PaintRoutine* getPaintRoutine (const int index) const { return index == 0 ? backgroundGraphics.get() : nullptr; }
PaintRoutine* getPaintRoutine (int index) const { return index == 0 ? backgroundGraphics.get() : nullptr; }
ComponentLayout* getComponentLayout() const { return components.get(); }

View file

@ -167,8 +167,8 @@ public:
ElementFillPositionProperty (ColouredElement* const owner_,
const String& name,
ComponentPositionDimension dimension_,
const bool isStart_,
const bool isForStroke_)
bool isStart_,
bool isForStroke_)
: PositionPropertyBase (owner_, name, dimension_, false, false,
owner_->getDocument()->getComponentLayout()),
listener (owner_),

View file

@ -39,8 +39,8 @@ class ColouredElement : public PaintElement
public:
ColouredElement (PaintRoutine* owner,
const String& name,
const bool showOutline_,
const bool showJointAndEnd_);
bool showOutline_,
bool showJointAndEnd_);
~ColouredElement() override;
@ -50,18 +50,18 @@ public:
//==============================================================================
const JucerFillType& getFillType() noexcept;
void setFillType (const JucerFillType& newType, const bool undoable);
void setFillType (const JucerFillType& newType, bool undoable);
bool isStrokeEnabled() const noexcept;
void enableStroke (bool enable, const bool undoable);
void enableStroke (bool enable, bool undoable);
const StrokeType& getStrokeType() noexcept;
void setStrokeType (const PathStrokeType& newType, const bool undoable);
void setStrokeFill (const JucerFillType& newType, const bool undoable);
void setStrokeType (const PathStrokeType& newType, bool undoable);
void setStrokeFill (const JucerFillType& newType, bool undoable);
//==============================================================================
Rectangle<int> getCurrentBounds (const Rectangle<int>& parentArea) const override;
void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& parentArea, const bool undoable) override;
void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& parentArea, bool undoable) override;
void createSiblingComponents() override;

View file

@ -50,13 +50,13 @@ public:
virtual void setInitialBounds (int parentWidth, int parentHeight);
virtual Rectangle<int> getCurrentBounds (const Rectangle<int>& activeArea) const;
virtual void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& activeArea, const bool undoable);
virtual void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& activeArea, bool undoable);
const RelativePositionedRectangle& getPosition() const;
void setPosition (const RelativePositionedRectangle& newPosition, const bool undoable);
void setPaintElementBounds (const Rectangle<int>& newBounds, const bool undoable);
void setPosition (const RelativePositionedRectangle& newPosition, bool undoable);
void setPaintElementBounds (const Rectangle<int>& newBounds, bool undoable);
void setPaintElementBoundsAndProperties (PaintElement* elementToPosition, const Rectangle<int>& newBounds,
PaintElement* referenceElement, const bool undoable);
PaintElement* referenceElement, bool undoable);
void updateBounds (const Rectangle<int>& activeArea);
@ -118,7 +118,7 @@ protected:
Rectangle<int> getCurrentAbsoluteBounds() const;
void getCurrentAbsoluteBoundsDouble (double& x, double& y, double& w, double& h) const;
virtual void selectionChanged (const bool isSelected);
virtual void selectionChanged (bool isSelected);
virtual void createSiblingComponents();

View file

@ -35,13 +35,13 @@ public:
PaintElementGroup (PaintRoutine*);
~PaintElementGroup() override;
void ungroup (const bool);
void ungroup (bool);
static void groupSelected (PaintRoutine* const);
int getNumElements() const noexcept;
PaintElement* getElement (const int index) const noexcept;
PaintElement* getElement (int index) const noexcept;
int indexOfElement (const PaintElement* element) const noexcept;
bool containsElement (const PaintElement* element) const;
@ -49,7 +49,7 @@ public:
//==============================================================================
void setInitialBounds (int, int) override;
Rectangle<int> getCurrentBounds (const Rectangle<int>&) const override;
void setCurrentBounds (const Rectangle<int>&, const Rectangle<int>&, const bool) override;
void setCurrentBounds (const Rectangle<int>&, const Rectangle<int>&, bool) override;
//==============================================================================
void draw (Graphics&, const ComponentLayout*, const Rectangle<int>&) override;

View file

@ -65,7 +65,7 @@ public:
String newResource, oldResource;
};
void setResource (const String&, const bool);
void setResource (const String&, bool);
String getResource() const;
@ -73,7 +73,7 @@ public:
class SetOpacityAction : public PaintElementUndoableAction <PaintElementImage>
{
public:
SetOpacityAction (PaintElementImage* const, const double);
SetOpacityAction (PaintElementImage* const, double);
bool perform();
bool undo();
@ -82,7 +82,7 @@ public:
double newOpacity, oldOpacity;
};
void setOpacity (double, const bool);
void setOpacity (double, bool);
double getOpacity() const noexcept;
//==============================================================================
@ -94,7 +94,7 @@ public:
class SetStretchModeAction : public PaintElementUndoableAction <PaintElementImage>
{
public:
SetStretchModeAction (PaintElementImage* const, const StretchMode);
SetStretchModeAction (PaintElementImage* const, StretchMode);
bool perform();
bool undo();
@ -105,7 +105,7 @@ public:
StretchMode getStretchMode() const noexcept;
void setStretchMode (const StretchMode, const bool);
void setStretchMode (StretchMode, bool);
//==============================================================================
XmlElement* createXml() const override;

View file

@ -47,15 +47,15 @@ public:
int getNumPoints() const;
void changePointType (const Path::Iterator::PathElementType newType,
void changePointType (Path::Iterator::PathElementType newType,
const Rectangle<int>& parentArea,
const bool undoable);
bool undoable);
void deleteFromPath();
void getEditableProperties (Array<PropertyComponent*>& props, bool multipleSelected);
private:
PathPoint withChangedPointType (const Path::Iterator::PathElementType newType,
PathPoint withChangedPointType (Path::Iterator::PathElementType newType,
const Rectangle<int>& parentArea) const;
};
@ -150,7 +150,7 @@ class PathPointComponent : public ElementSiblingComponent
{
public:
PathPointComponent (PaintElementPath* const path_,
const int index, const int pointNumber);
int index, int pointNumber);
~PathPointComponent();

View file

@ -41,7 +41,7 @@ public:
return PaintElement::getCurrentBounds (parentArea); // bypass the ColouredElement implementation
}
void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& parentArea, const bool undoable) override
void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& parentArea, bool undoable) override
{
PaintElement::setCurrentBounds (newBounds, parentArea, undoable); // bypass the ColouredElement implementation
}

View file

@ -220,8 +220,8 @@ public:
/** Same functionality as updateFrom(), but taking doubles instead of ints.
*/
void updateFromDouble (const double newX, const double newY,
const double newW, const double newH,
void updateFromDouble (double newX, double newY,
double newW, double newH,
const Rectangle<int>& target) noexcept
{
updatePosAndSize (x, w, newX, newW, xMode, wMode, target.getX(), target.getWidth());
@ -334,7 +334,7 @@ public:
/** Sets the raw value of the x coordinate.
See getX() for the meaning of this value.
*/
void setX (const double newX) noexcept { x = newX; }
void setX (double newX) noexcept { x = newX; }
/** Returns the anchoring mode for the y coordinate.
To change any of the modes, use setModes().
@ -364,7 +364,7 @@ public:
/** Sets the raw value of the y coordinate.
See getY() for the meaning of this value.
*/
void setY (const double newY) noexcept { y = newY; }
void setY (double newY) noexcept { y = newY; }
/** Returns the mode used to calculate the width.
To change any of the modes, use setModes().
@ -383,7 +383,7 @@ public:
See getWidth() for the details about what this value means.
*/
void setWidth (const double newWidth) noexcept { w = newWidth; }
void setWidth (double newWidth) noexcept { w = newWidth; }
/** Returns the mode used to calculate the height.
To change any of the modes, use setModes().
@ -402,7 +402,7 @@ public:
See getHeight() for the details about what this value means.
*/
void setHeight (const double newHeight) noexcept { h = newHeight; }
void setHeight (double newHeight) noexcept { h = newHeight; }
//==============================================================================
/** If the size and position are constance, and wouldn't be affected by changes

View file

@ -34,7 +34,7 @@ public:
//==============================================================================
TestComponent (JucerDocument* const ownerDocument,
JucerDocument* const loadedDocument,
const bool alwaysFillBackground);
bool alwaysFillBackground);
~TestComponent() override;

View file

@ -52,8 +52,8 @@ public:
void clear();
bool add (const String& name, const File& file);
void add (const String& name, const String& originalFileName, const MemoryBlock& data);
void remove (const int index);
bool reload (const int index);
void remove (int index);
bool reload (int index);
void browseForResource (const String& title, const String& wildcard,
const File& fileToStartFrom, const String& resourceToReplace,
std::function<void (String)> callback);

View file

@ -50,20 +50,20 @@ public:
//==============================================================================
void clearComponents();
void removeComponent (Component* comp, const bool undoable);
void removeComponent (Component* comp, bool undoable);
Component* addNewComponent (ComponentTypeHandler* const type, int x, int y);
Component* addComponentFromXml (const XmlElement& xml, const bool undoable);
Component* addComponentFromXml (const XmlElement& xml, bool undoable);
Component* findComponentWithId (const int64 componentId) const;
Component* findComponentWithId (int64 componentId) const;
//==============================================================================
void componentToFront (Component* comp, const bool undoable);
void componentToBack (Component* comp, const bool undoable);
void componentToFront (Component* comp, bool undoable);
void componentToBack (Component* comp, bool undoable);
void setComponentPosition (Component* comp, const RelativePositionedRectangle& newPos, const bool undoable);
void setComponentBoundsAndProperties (Component* comp, const Rectangle<int>& newBounds, Component* referenceComponent, const bool undoable);
void updateStoredComponentPosition (Component* comp, const bool undoable);
void setComponentPosition (Component* comp, const RelativePositionedRectangle& newPos, bool undoable);
void setComponentBoundsAndProperties (Component* comp, const Rectangle<int>& newBounds, Component* referenceComponent, bool undoable);
void updateStoredComponentPosition (Component* comp, bool undoable);
//==============================================================================
Component* getComponentRelativePosTarget (Component* comp, int whichDimension) const;

View file

@ -74,7 +74,7 @@ public:
String& getCallbackCode (const String& requiredParentClass,
const String& returnType,
const String& prototype,
const bool hasPrePostUserSections);
bool hasPrePostUserSections);
void removeCallback (const String& returnType, const String& prototype);

View file

@ -83,7 +83,7 @@ public:
String getVariableInitialisers() const { return variableInitialisers; }
void setVariableInitialisers (const String& newInitlialisers);
void setFixedSize (const bool isFixed);
void setFixedSize (bool isFixed);
bool isFixedSize() const noexcept { return fixedSize; }
void setInitialSize (int w, int h);
@ -94,9 +94,9 @@ public:
//==============================================================================
virtual int getNumPaintRoutines() const = 0;
virtual StringArray getPaintRoutineNames() const = 0;
virtual PaintRoutine* getPaintRoutine (const int index) const = 0;
virtual PaintRoutine* getPaintRoutine (int index) const = 0;
virtual ComponentLayout* getComponentLayout() const = 0;
virtual Component* createTestComponent (const bool alwaysFillBackground) = 0;
virtual Component* createTestComponent (bool alwaysFillBackground) = 0;
virtual void addExtraClassProperties (PropertyPanel&);
//==============================================================================
@ -105,23 +105,23 @@ public:
StringArray& methods,
StringArray& initialContents) const;
void setOptionalMethodEnabled (const String& methodSignature, const bool enable);
void setOptionalMethodEnabled (const String& methodSignature, bool enable);
bool isOptionalMethodEnabled (const String& methodSignature) const noexcept;
//==============================================================================
BinaryResources& getResources() noexcept { return resources; }
//==============================================================================
void setSnappingGrid (const int numPixels, const bool active, const bool shown);
void setSnappingGrid (int numPixels, bool active, const bool shown);
int getSnappingGridSize() const noexcept { return snapGridPixels; }
bool isSnapActive (const bool disableIfCtrlKeyDown) const noexcept;
bool isSnapActive (bool disableIfCtrlKeyDown) const noexcept;
bool isSnapShown() const noexcept { return snapShown; }
int snapPosition (int pos) const noexcept;
//==============================================================================
void setComponentOverlayOpacity (const float alpha);
void setComponentOverlayOpacity (float alpha);
float getComponentOverlayOpacity() const noexcept { return componentOverlayOpacity; }
//==============================================================================

View file

@ -41,7 +41,7 @@ namespace ObjectTypes
extern const char* const* const elementTypeNames;
extern const int numElementTypes;
PaintElement* createNewElement (const int index, PaintRoutine* owner);
PaintElement* createNewElement (int index, PaintRoutine* owner);
PaintElement* createNewImageElement (PaintRoutine* owner);
PaintElement* createElementForXml (const XmlElement* const e, PaintRoutine* const owner);
}

View file

@ -107,7 +107,7 @@ public:
void getCommandInfo (CommandID, ApplicationCommandInfo&) override;
bool perform (const InvocationInfo&) override;
bool isSaveCommand (const CommandID id);
bool isSaveCommand (CommandID);
void paint (Graphics&) override;
void resized() override;
@ -125,7 +125,7 @@ private:
void showTranslationTool();
//==============================================================================
void showProjectPanel (const int index);
void showProjectPanel (int index);
bool canSelectedProjectBeLaunch();
//==============================================================================

View file

@ -77,8 +77,8 @@ public:
ProgressBar::Style getDefaultProgressBarStyle (const ProgressBar&) override;
//==============================================================================
static Path getArrowPath (Rectangle<float> arrowZone, const int direction,
const bool filled, const Justification justification);
static Path getArrowPath (Rectangle<float> arrowZone, int direction,
bool filled, Justification justification);
static Path getChoiceComponentArrowPath (Rectangle<float> arrowZone);
static Font getPropertyComponentFont() { return { 14.0f, Font::FontStyleFlags::bold }; }