mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-14 00:14:18 +00:00
73 lines
2.7 KiB
C++
73 lines
2.7 KiB
C++
/*
|
|
==============================================================================
|
|
|
|
This file is part of the JUCE 6 technical preview.
|
|
Copyright (c) 2017 - ROLI Ltd.
|
|
|
|
You may use this code under the terms of the GPL v3
|
|
(see www.gnu.org/licenses).
|
|
|
|
For this technical preview, this file is not subject to commercial licensing.
|
|
|
|
JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
|
|
EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
|
|
DISCLAIMED.
|
|
|
|
==============================================================================
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "../jucer_PaintRoutine.h"
|
|
#include "../jucer_JucerDocument.h"
|
|
#include "jucer_StrokeType.h"
|
|
|
|
//==============================================================================
|
|
/**
|
|
Base class for paint elements that have a fill colour and stroke.
|
|
|
|
*/
|
|
class ColouredElement : public PaintElement
|
|
{
|
|
public:
|
|
ColouredElement (PaintRoutine* owner,
|
|
const String& name,
|
|
const bool showOutline_,
|
|
const bool showJointAndEnd_);
|
|
|
|
~ColouredElement() override;
|
|
|
|
//==============================================================================
|
|
void getEditableProperties (Array<PropertyComponent*>& props, bool multipleSelected) override;
|
|
void getColourSpecificProperties (Array<PropertyComponent*>& props);
|
|
|
|
//==============================================================================
|
|
const JucerFillType& getFillType() noexcept;
|
|
void setFillType (const JucerFillType& newType, const bool undoable);
|
|
|
|
bool isStrokeEnabled() const noexcept;
|
|
void enableStroke (bool enable, const bool undoable);
|
|
|
|
const StrokeType& getStrokeType() noexcept;
|
|
void setStrokeType (const PathStrokeType& newType, const bool undoable);
|
|
void setStrokeFill (const JucerFillType& newType, const 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 createSiblingComponents() override;
|
|
|
|
//==============================================================================
|
|
void addColourAttributes (XmlElement* const e) const;
|
|
bool loadColourAttributes (const XmlElement& xml);
|
|
|
|
protected:
|
|
JucerFillType fillType;
|
|
|
|
bool isStrokePresent;
|
|
const bool showOutline, showJointAndEnd;
|
|
StrokeType strokeType;
|
|
|
|
void convertToNewPathElement (const Path& path);
|
|
};
|