Audio plugin host https://kx.studio/carla
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.

66 lines
2.2KB

  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. namespace juce
  14. {
  15. //==============================================================================
  16. /**
  17. Base class used internally for structures that can store cached images of
  18. component state.
  19. Most people are unlikely to ever need to know about this class - it's really
  20. only for power-users!
  21. @see Component::setCachedComponentImage
  22. @tags{GUI}
  23. */
  24. class JUCE_API CachedComponentImage
  25. {
  26. public:
  27. CachedComponentImage() = default;
  28. virtual ~CachedComponentImage() = default;
  29. //==============================================================================
  30. /** Called as part of the parent component's paint method, this must draw
  31. the given component into the target graphics context, using the cached
  32. version where possible.
  33. */
  34. virtual void paint (Graphics&) = 0;
  35. /** Invalidates all cached image data.
  36. @returns true if the peer should also be repainted, or false if this object
  37. handles all repaint work internally.
  38. */
  39. virtual bool invalidateAll() = 0;
  40. /** Invalidates a section of the cached image data.
  41. @returns true if the peer should also be repainted, or false if this object
  42. handles all repaint work internally.
  43. */
  44. virtual bool invalidate (const Rectangle<int>& area) = 0;
  45. /** Called to indicate that the component is no longer active, so
  46. any cached data should be released if possible.
  47. */
  48. virtual void releaseResources() = 0;
  49. };
  50. } // namespace juce