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.

74 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. #if JUCE_ANDROID || DOXYGEN
  16. //==============================================================================
  17. /**
  18. An Android-specific class that can create and embed a View 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 View 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 AndroidViewComponent : public Component
  27. {
  28. public:
  29. //==============================================================================
  30. /** Create an initially-empty container */
  31. AndroidViewComponent();
  32. /** Destructor. */
  33. ~AndroidViewComponent() override;
  34. /** Assigns a View 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. */
  38. void setView (void* uiView);
  39. /** Returns the current View. */
  40. void* getView() const;
  41. /** Resizes this component to fit the view that it contains. */
  42. void resizeToFitView();
  43. //==============================================================================
  44. /** @internal */
  45. void paint (Graphics&) override;
  46. private:
  47. class Pimpl;
  48. std::unique_ptr<Pimpl> pimpl;
  49. JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AndroidViewComponent)
  50. };
  51. #endif
  52. } // namespace juce