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.

53 lines
1.9KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2020 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. #pragma once
  14. #include "../jucer_JucerDocument.h"
  15. //==============================================================================
  16. class ComponentDocument : public JucerDocument
  17. {
  18. public:
  19. ComponentDocument (SourceCodeDocument* cpp);
  20. ~ComponentDocument();
  21. //==============================================================================
  22. String getTypeName() const;
  23. JucerDocument* createCopy();
  24. Component* createTestComponent (const bool alwaysFillBackground);
  25. int getNumPaintRoutines() const { return 1; }
  26. StringArray getPaintRoutineNames() const { return StringArray ("Graphics"); }
  27. PaintRoutine* getPaintRoutine (const int index) const { return index == 0 ? backgroundGraphics.get() : nullptr; }
  28. ComponentLayout* getComponentLayout() const { return components.get(); }
  29. //==============================================================================
  30. std::unique_ptr<XmlElement> createXml() const;
  31. bool loadFromXml (const XmlElement& xml);
  32. void fillInGeneratedCode (GeneratedCode& code) const;
  33. void applyCustomPaintSnippets (StringArray&);
  34. private:
  35. std::unique_ptr<ComponentLayout> components;
  36. std::unique_ptr<PaintRoutine> backgroundGraphics;
  37. };