diff --git a/extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.cpp b/extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.cpp index e12f5fada2..7a7e71600e 100644 --- a/extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.cpp +++ b/extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.cpp @@ -1433,9 +1433,9 @@ PathPoint PathPoint::withChangedPointType (const Path::Iterator::PathElementType p.pos [numPoints - 1] = p.pos [oldNumPoints - 1]; p.pos [numPoints - 1].getRectangleDouble (x, y, w, h, parentArea, owner->getDocument()->getComponentLayout()); - const int index = owner->points.indexOf (this); + const int index = owner->indexOfPoint (this); - if (PathPoint* lastPoint = owner->points [index - 1]) + if (PathPoint* lastPoint = owner->getPoint (index - 1)) { lastPoint->pos [lastPoint->getNumPoints() - 1] .getRectangleDouble (lastX, lastY, w, h, parentArea, owner->getDocument()->getComponentLayout()); @@ -1486,7 +1486,7 @@ void PathPoint::getEditableProperties (Array& props, bool mu if (multipleSelected) return; - auto index = owner->points.indexOf (this); + auto index = owner->indexOfPoint (this); jassert (index >= 0); switch (type) @@ -1537,7 +1537,7 @@ void PathPoint::getEditableProperties (Array& props, bool mu void PathPoint::deleteFromPath() { - owner->deletePoint (owner->points.indexOf (this), true); + owner->deletePoint (owner->indexOfPoint (this), true); } //============================================================================== @@ -1554,7 +1554,7 @@ PathPointComponent::PathPointComponent (PaintElementPath* const path_, setSize (11, 11); setRepaintsOnMouseActivity (true); - selected = routine->getSelectedPoints().isSelected (path_->points [index]); + selected = routine->getSelectedPoints().isSelected (path_->getPoint (index)); routine->getSelectedPoints().addChangeListener (this); } @@ -1614,7 +1614,7 @@ void PathPointComponent::mouseDown (const MouseEvent& e) dragX = getX() + getWidth() / 2; dragY = getY() + getHeight() / 2; - mouseDownSelectStatus = routine->getSelectedPoints().addToSelectionOnMouseDown (path->points [index], e.mods); + mouseDownSelectStatus = routine->getSelectedPoints().addToSelectionOnMouseDown (path->getPoint (index), e.mods); owner->getDocument()->beginTransaction(); } @@ -1646,7 +1646,7 @@ void PathPointComponent::mouseDrag (const MouseEvent& e) void PathPointComponent::mouseUp (const MouseEvent& e) { - routine->getSelectedPoints().addToSelectionOnMouseUp (path->points [index], + routine->getSelectedPoints().addToSelectionOnMouseUp (path->getPoint (index), e.mods, dragging, mouseDownSelectStatus); } @@ -1655,7 +1655,7 @@ void PathPointComponent::changeListenerCallback (ChangeBroadcaster* source) { ElementSiblingComponent::changeListenerCallback (source); - const bool nowSelected = routine->getSelectedPoints().isSelected (path->points [index]); + const bool nowSelected = routine->getSelectedPoints().isSelected (path->getPoint (index)); if (nowSelected != selected) { diff --git a/extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.h b/extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.h index fc1eb504ca..d6a949f835 100644 --- a/extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.h +++ b/extras/Projucer/Source/ComponentEditor/PaintElements/jucer_PaintElementPath.h @@ -70,21 +70,21 @@ public: //============================================================================== void setInitialBounds (int parentWidth, int parentHeight) override; Rectangle getCurrentBounds (const Rectangle& parentArea) const override; - void setCurrentBounds (const Rectangle& b, const Rectangle& parentArea, const bool undoable) override; + void setCurrentBounds (const Rectangle& b, const Rectangle& parentArea, bool undoable) override; //============================================================================== bool getPoint (int index, int pointNumber, double& x, double& y, const Rectangle& parentArea) const; - void movePoint (int index, int pointNumber, double newX, double newY, const Rectangle& parentArea, const bool undoable); + void movePoint (int index, int pointNumber, double newX, double newY, const Rectangle& parentArea, bool undoable); RelativePositionedRectangle getPoint (int index, int pointNumber) const; - void setPoint (int index, int pointNumber, const RelativePositionedRectangle& newPoint, const bool undoable); + void setPoint (int index, int pointNumber, const RelativePositionedRectangle& newPoint, bool undoable); int getNumPoints() const noexcept { return points.size(); } PathPoint* getPoint (int index) const noexcept { return points [index]; } - int indexOfPoint (PathPoint* const p) const noexcept { return points.indexOf (p); } + int indexOfPoint (const PathPoint* p) const noexcept { return points.indexOf (p); } - PathPoint* addPoint (int pointIndexToAddItAfter, const bool undoable); - void deletePoint (int pointIndex, const bool undoable); + PathPoint* addPoint (int pointIndexToAddItAfter, bool undoable); + void deletePoint (int pointIndex, bool undoable); void pointListChanged(); @@ -92,10 +92,10 @@ public: //============================================================================== bool isSubpathClosed (int pointIndex) const; - void setSubpathClosed (int pointIndex, const bool closed, const bool undoable); + void setSubpathClosed (int pointIndex, bool closed, bool undoable); bool isNonZeroWinding() const noexcept { return nonZeroWinding; } - void setNonZeroWinding (const bool nonZero, const bool undoable); + void setNonZeroWinding (bool nonZero, bool undoable); //============================================================================== void getEditableProperties (Array& props, bool multipleSelected) override; @@ -125,8 +125,6 @@ public: void changed() override; private: - friend class PathPoint; - friend class PathPointComponent; OwnedArray points; bool nonZeroWinding; mutable Path path; diff --git a/extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.h b/extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.h index cb2eb306d2..68eb64cc34 100644 --- a/extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.h +++ b/extras/Projucer/Source/ComponentEditor/jucer_ComponentLayout.h @@ -120,6 +120,8 @@ public: void perform (UndoableAction* action, const String& actionName); + void moveComponentZOrder (int oldIndex, int newIndex); + private: JucerDocument* document; OwnedArray components; @@ -127,10 +129,6 @@ private: int nextCompUID; String getUnusedMemberName (String nameRoot, Component* comp) const; - - friend class FrontBackCompAction; - friend class DeleteCompAction; - void moveComponentZOrder (int oldIndex, int newIndex); }; void positionToCode (const RelativePositionedRectangle& position, diff --git a/extras/Projucer/Source/ComponentEditor/jucer_PaintRoutine.h b/extras/Projucer/Source/ComponentEditor/jucer_PaintRoutine.h index b8c6cc4ce6..67e0d7caa5 100644 --- a/extras/Projucer/Source/ComponentEditor/jucer_PaintRoutine.h +++ b/extras/Projucer/Source/ComponentEditor/jucer_PaintRoutine.h @@ -46,23 +46,23 @@ public: //============================================================================== int getNumElements() const noexcept { return elements.size(); } - PaintElement* getElement (const int index) const noexcept { return elements [index]; } + PaintElement* getElement (int index) const noexcept { return elements [index]; } int indexOfElement (PaintElement* e) const noexcept { return elements.indexOf (e); } bool containsElement (PaintElement* e) const noexcept { return elements.contains (e); } //============================================================================== void clear(); - PaintElement* addElementFromXml (const XmlElement& xml, const int index, const bool undoable); - PaintElement* addNewElement (PaintElement* elementToCopy, const int index, const bool undoable); - void removeElement (PaintElement* element, const bool undoable); + PaintElement* addElementFromXml (const XmlElement& xml, int index, bool undoable); + PaintElement* addNewElement (PaintElement* elementToCopy, int index, bool undoable); + void removeElement (PaintElement* element, bool undoable); - void elementToFront (PaintElement* element, const bool undoable); - void elementToBack (PaintElement* element, const bool undoable); + void elementToFront (PaintElement* element, bool undoable); + void elementToBack (PaintElement* element, bool undoable); - const Colour getBackgroundColour() const noexcept { return backgroundColour; } + Colour getBackgroundColour() const noexcept { return backgroundColour; } void setBackgroundColour (Colour newColour) noexcept; - void fillWithBackground (Graphics& g, const bool drawOpaqueBackground); + void fillWithBackground (Graphics& g, bool drawOpaqueBackground); void drawElements (Graphics& g, const Rectangle& relativeTo); void dropImageAt (const File& f, int x, int y); @@ -108,6 +108,8 @@ public: void applyCustomPaintSnippets (StringArray&); //============================================================================== + void moveElementZOrder (int oldIndex, int newIndex); + private: OwnedArray elements; SelectedItemSet selectedElements; @@ -115,8 +117,4 @@ private: JucerDocument* document; Colour backgroundColour; - - friend class DeleteElementAction; - friend class FrontOrBackElementAction; - void moveElementZOrder (int oldIndex, int newIndex); }; diff --git a/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h b/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h index eb8d904cf7..4a3e744fb2 100644 --- a/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h +++ b/extras/Projucer/Source/Utility/UI/jucer_JucerTreeViewBase.h @@ -108,7 +108,6 @@ protected: private: class ItemSelectionTimer; - friend class ItemSelectionTimer; std::unique_ptr delayedSelectionTimer; void invokeShowDocument(); diff --git a/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h b/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h index 15cbc65e76..f3f064e06a 100644 --- a/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h +++ b/extras/Projucer/Source/Utility/UI/jucer_SlidingPanelComponent.h @@ -58,7 +58,6 @@ public: private: struct DotButton; - friend struct DotButton; struct PageInfo {