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.

87 lines
2.9KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2013 - Raw Material Software Ltd.
  5. Permission is granted to use this software under the terms of either:
  6. a) the GPL v2 (or any later version)
  7. b) the Affero GPL v3
  8. Details of these licenses can be found at: www.gnu.org/licenses
  9. JUCE is distributed in the hope that it will be useful, but WITHOUT ANY
  10. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  12. ------------------------------------------------------------------------------
  13. To release a closed-source product which uses JUCE, commercial licenses are
  14. available: visit www.juce.com for more information.
  15. ==============================================================================
  16. */
  17. #ifndef JUCE_UIVIEWCOMPONENT_H_INCLUDED
  18. #define JUCE_UIVIEWCOMPONENT_H_INCLUDED
  19. #if JUCE_IOS || DOXYGEN
  20. //==============================================================================
  21. /**
  22. An iOS-specific class that can create and embed an UIView inside itself.
  23. To use it, create one of these, put it in place and make sure it's visible in a
  24. window, then use setView() to assign a UIView to it. The view will then be
  25. moved and resized to follow the movements of this component.
  26. Of course, since the view is a native object, it'll obliterate any
  27. juce components that may overlap this component, but that's life.
  28. */
  29. class JUCE_API UIViewComponent : public Component
  30. {
  31. public:
  32. //==============================================================================
  33. /** Create an initially-empty container. */
  34. UIViewComponent();
  35. /** Destructor. */
  36. ~UIViewComponent();
  37. /** Assigns an UIView to this peer.
  38. The view will be retained and released by this component for as long as
  39. it is needed. To remove the current view, just call setView (nullptr).
  40. Note: a void* is used here to avoid including the cocoa headers as
  41. part of the juce.h, but the method expects an UIView*.
  42. */
  43. void setView (void* uiView);
  44. /** Returns the current UIView.
  45. Note: a void* is returned here to avoid the needing to include the cocoa
  46. headers, so you should just cast the return value to an UIView*.
  47. */
  48. void* getView() const;
  49. /** Resizes this component to fit the view that it contains. */
  50. void resizeToFitView();
  51. //==============================================================================
  52. /** @internal */
  53. void paint (Graphics&) override;
  54. private:
  55. class Pimpl;
  56. friend class Pimpl;
  57. ScopedPointer<Pimpl> pimpl;
  58. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (UIViewComponent)
  59. };
  60. #endif
  61. #endif // JUCE_UIVIEWCOMPONENT_H_INCLUDED