The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
3.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-11 by Raw Material Software Ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the GNU General
  7. Public License (Version 2), as published by the Free Software Foundation.
  8. A copy of the license is included in the JUCE distribution, or can be found
  9. online at www.gnu.org/licenses.
  10. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13. ------------------------------------------------------------------------------
  14. To release a closed-source product which uses JUCE, commercial licenses are
  15. available: visit www.rawmaterialsoftware.com/juce for more information.
  16. ==============================================================================
  17. */
  18. #ifndef __JUCER_COLOUREDELEMENT_JUCEHEADER__
  19. #define __JUCER_COLOUREDELEMENT_JUCEHEADER__
  20. #include "../jucer_PaintRoutine.h"
  21. #include "../jucer_JucerDocument.h"
  22. #include "jucer_StrokeType.h"
  23. //==============================================================================
  24. /**
  25. Base class for paint elements that have a fill colour and stroke.
  26. */
  27. class ColouredElement : public PaintElement
  28. {
  29. public:
  30. ColouredElement (PaintRoutine* owner,
  31. const String& name,
  32. const bool showOutline_,
  33. const bool showJointAndEnd_);
  34. ~ColouredElement();
  35. //==============================================================================
  36. void getEditableProperties (Array <PropertyComponent*>& properties);
  37. void getColourSpecificProperties (Array <PropertyComponent*>& properties);
  38. //==============================================================================
  39. const JucerFillType& getFillType() noexcept;
  40. void setFillType (const JucerFillType& newType, const bool undoable);
  41. bool isStrokeEnabled() const noexcept;
  42. void enableStroke (bool enable, const bool undoable);
  43. const StrokeType& getStrokeType() noexcept;
  44. void setStrokeType (const PathStrokeType& newType, const bool undoable);
  45. void setStrokeFill (const JucerFillType& newType, const bool undoable);
  46. //==============================================================================
  47. Rectangle<int> getCurrentBounds (const Rectangle<int>& parentArea) const;
  48. void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& parentArea, const bool undoable);
  49. void createSiblingComponents();
  50. //==============================================================================
  51. void addColourAttributes (XmlElement* const e) const;
  52. bool loadColourAttributes (const XmlElement& xml);
  53. protected:
  54. JucerFillType fillType;
  55. bool isStrokePresent;
  56. const bool showOutline, showJointAndEnd;
  57. StrokeType strokeType;
  58. void convertToNewPathElement (const Path& path);
  59. };
  60. #endif // __JUCER_COLOUREDELEMENT_JUCEHEADER__