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.

82 lines
2.5KB

  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. #if JUCE_IOS || DOXYGEN
  16. //==============================================================================
  17. /**
  18. An iOS-specific class that can create and embed an UIView inside itself.
  19. To use it, create one of these, put it in place and make sure it's visible in a
  20. window, then use setView() to assign a UIView to it. The view will then be
  21. moved and resized to follow the movements of this component.
  22. Of course, since the view is a native object, it'll obliterate any
  23. JUCE components that may overlap this component, but that's life.
  24. @tags{GUI}
  25. */
  26. class JUCE_API UIViewComponent : public Component
  27. {
  28. public:
  29. //==============================================================================
  30. /** Create an initially-empty container. */
  31. UIViewComponent();
  32. /** Destructor. */
  33. ~UIViewComponent() override;
  34. /** Assigns an UIView to this peer.
  35. The view will be retained and released by this component for as long as
  36. it is needed. To remove the current view, just call setView (nullptr).
  37. Note: A void* is used here to avoid including the cocoa headers as
  38. part of JuceHeader.h, but the method expects an UIView*.
  39. */
  40. void setView (void* uiView);
  41. /** Returns the current UIView.
  42. Note: A void* is returned here to avoid the needing to include the cocoa
  43. headers, so you should just cast the return value to an UIView*.
  44. */
  45. void* getView() const;
  46. /** Resizes this component to fit the view that it contains. */
  47. void resizeToFitView();
  48. //==============================================================================
  49. /** @internal */
  50. void paint (Graphics&) override;
  51. private:
  52. class Pimpl;
  53. std::unique_ptr<Pimpl> pimpl;
  54. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (UIViewComponent)
  55. };
  56. #endif
  57. } // namespace juce