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.

119 lines
2.8KB

  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. /*
  18. Sorry.. This class isn't implemented on Linux!
  19. */
  20. //==============================================================================
  21. WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
  22. : browser (0),
  23. blankPageShown (false),
  24. unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
  25. {
  26. setOpaque (true);
  27. }
  28. WebBrowserComponent::~WebBrowserComponent()
  29. {
  30. }
  31. //==============================================================================
  32. void WebBrowserComponent::goToURL (const String& url,
  33. const StringArray* headers,
  34. const MemoryBlock* postData)
  35. {
  36. lastURL = url;
  37. if (headers != nullptr)
  38. lastHeaders = *headers;
  39. else
  40. lastHeaders.clear();
  41. if (postData != nullptr)
  42. lastPostData = *postData;
  43. else
  44. lastPostData.reset();
  45. blankPageShown = false;
  46. }
  47. void WebBrowserComponent::stop()
  48. {
  49. }
  50. void WebBrowserComponent::goBack()
  51. {
  52. lastURL.clear();
  53. blankPageShown = false;
  54. }
  55. void WebBrowserComponent::goForward()
  56. {
  57. lastURL.clear();
  58. }
  59. void WebBrowserComponent::refresh()
  60. {
  61. }
  62. //==============================================================================
  63. void WebBrowserComponent::paint (Graphics& g)
  64. {
  65. g.fillAll (Colours::white);
  66. }
  67. void WebBrowserComponent::checkWindowAssociation()
  68. {
  69. }
  70. void WebBrowserComponent::reloadLastURL()
  71. {
  72. if (lastURL.isNotEmpty())
  73. {
  74. goToURL (lastURL, &lastHeaders, &lastPostData);
  75. lastURL.clear();
  76. }
  77. }
  78. void WebBrowserComponent::parentHierarchyChanged()
  79. {
  80. checkWindowAssociation();
  81. }
  82. void WebBrowserComponent::resized()
  83. {
  84. }
  85. void WebBrowserComponent::visibilityChanged()
  86. {
  87. checkWindowAssociation();
  88. }
  89. void WebBrowserComponent::focusGained (FocusChangeType)
  90. {
  91. }