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.

79 lines
2.6KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2017 - ROLI 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. #pragma once
  18. /** @internal */
  19. bool juce_handleXEmbedEvent (ComponentPeer*, void*);
  20. /** @internal */
  21. unsigned long juce_getCurrentFocusWindow (ComponentPeer*);
  22. #if JUCE_LINUX || DOXYGEN
  23. //==============================================================================
  24. /**
  25. A Linux-specific class that can embed a foreign X11 widget.
  26. Use this class to embed a foreign X11 widget from other toolkits such as
  27. GTK+ or QT.
  28. For GTK+, create a gtk_plug container and pass the plug's id
  29. (gtk_plug_get_id) to the constructor of this class.
  30. For QT, use the QX11EmbedWidget class and pass the widget's
  31. id (containerWinId()) to the constructor of this class.
  32. Other toolkits or raw X11 widgets should follow the X11 embed protocol:
  33. https://specifications.freedesktop.org/xembed-spec/xembed-spec-latest.html
  34. */
  35. class XEmbedComponent : public Component
  36. {
  37. public:
  38. //==============================================================================
  39. /** Create a JUCE component wrapping the foreign widget with id wID */
  40. XEmbedComponent (unsigned long wID, bool wantsKeyboardFocus = true);
  41. /** Destructor. */
  42. ~XEmbedComponent();
  43. protected:
  44. //==============================================================================
  45. /** @internal */
  46. void paint (Graphics&) override;
  47. void focusGained (FocusChangeType) override;
  48. void focusLost (FocusChangeType) override;
  49. void broughtToFront() override;
  50. private:
  51. friend bool juce::juce_handleXEmbedEvent (ComponentPeer*, void*);
  52. friend unsigned long juce_getCurrentFocusWindow (ComponentPeer*);
  53. class Pimpl;
  54. friend struct ContainerDeletePolicy<Pimpl>;
  55. ScopedPointer<Pimpl> pimpl;
  56. };
  57. #endif