mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Projucer: Remove unnecessary friends
This commit is contained in:
parent
d621d46ca8
commit
1543ab1164
6 changed files with 28 additions and 36 deletions
|
|
@ -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<PropertyComponent*>& 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<PropertyComponent*>& 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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -70,21 +70,21 @@ public:
|
|||
//==============================================================================
|
||||
void setInitialBounds (int parentWidth, int parentHeight) override;
|
||||
Rectangle<int> getCurrentBounds (const Rectangle<int>& parentArea) const override;
|
||||
void setCurrentBounds (const Rectangle<int>& b, const Rectangle<int>& parentArea, const bool undoable) override;
|
||||
void setCurrentBounds (const Rectangle<int>& b, const Rectangle<int>& parentArea, bool undoable) override;
|
||||
|
||||
//==============================================================================
|
||||
bool getPoint (int index, int pointNumber, double& x, double& y, const Rectangle<int>& parentArea) const;
|
||||
void movePoint (int index, int pointNumber, double newX, double newY, const Rectangle<int>& parentArea, const bool undoable);
|
||||
void movePoint (int index, int pointNumber, double newX, double newY, const Rectangle<int>& 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<PropertyComponent*>& props, bool multipleSelected) override;
|
||||
|
|
@ -125,8 +125,6 @@ public:
|
|||
void changed() override;
|
||||
|
||||
private:
|
||||
friend class PathPoint;
|
||||
friend class PathPointComponent;
|
||||
OwnedArray<PathPoint> points;
|
||||
bool nonZeroWinding;
|
||||
mutable Path path;
|
||||
|
|
|
|||
|
|
@ -120,6 +120,8 @@ public:
|
|||
|
||||
void perform (UndoableAction* action, const String& actionName);
|
||||
|
||||
void moveComponentZOrder (int oldIndex, int newIndex);
|
||||
|
||||
private:
|
||||
JucerDocument* document;
|
||||
OwnedArray<Component> 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,
|
||||
|
|
|
|||
|
|
@ -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<int>& 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<PaintElement> elements;
|
||||
SelectedItemSet <PaintElement*> selectedElements;
|
||||
|
|
@ -115,8 +117,4 @@ private:
|
|||
JucerDocument* document;
|
||||
|
||||
Colour backgroundColour;
|
||||
|
||||
friend class DeleteElementAction;
|
||||
friend class FrontOrBackElementAction;
|
||||
void moveElementZOrder (int oldIndex, int newIndex);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -108,7 +108,6 @@ protected:
|
|||
|
||||
private:
|
||||
class ItemSelectionTimer;
|
||||
friend class ItemSelectionTimer;
|
||||
std::unique_ptr<Timer> delayedSelectionTimer;
|
||||
|
||||
void invokeShowDocument();
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ public:
|
|||
|
||||
private:
|
||||
struct DotButton;
|
||||
friend struct DotButton;
|
||||
|
||||
struct PageInfo
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue