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.

87 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. //==============================================================================
  31. ColouredElement (PaintRoutine* owner,
  32. const String& name,
  33. const bool showOutline_,
  34. const bool showJointAndEnd_);
  35. ~ColouredElement();
  36. //==============================================================================
  37. void getEditableProperties (Array <PropertyComponent*>& properties);
  38. void getColourSpecificProperties (Array <PropertyComponent*>& properties);
  39. //==============================================================================
  40. const JucerFillType& getFillType() noexcept;
  41. void setFillType (const JucerFillType& newType, const bool undoable);
  42. bool isStrokeEnabled() const noexcept;
  43. void enableStroke (bool enable, const bool undoable);
  44. const StrokeType& getStrokeType() noexcept;
  45. void setStrokeType (const PathStrokeType& newType, const bool undoable);
  46. void setStrokeFill (const JucerFillType& newType, const bool undoable);
  47. //==============================================================================
  48. Rectangle<int> getCurrentBounds (const Rectangle<int>& parentArea) const;
  49. void setCurrentBounds (const Rectangle<int>& newBounds, const Rectangle<int>& parentArea, const bool undoable);
  50. void createSiblingComponents();
  51. //==============================================================================
  52. void addColourAttributes (XmlElement* const e) const;
  53. bool loadColourAttributes (const XmlElement& xml);
  54. protected:
  55. JucerFillType fillType;
  56. bool isStrokePresent;
  57. const bool showOutline, showJointAndEnd;
  58. StrokeType strokeType;
  59. void convertToNewPathElement (const Path& path);
  60. };
  61. #endif // __JUCER_COLOUREDELEMENT_JUCEHEADER__