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.

118 lines
2.8KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library.
  4. Copyright (c) 2015 - 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. WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
  18. : browser (nullptr),
  19. blankPageShown (false),
  20. unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
  21. {
  22. // Unfortunately, WebBrowserComponent is not implemented for Android yet!
  23. // This is just a stub implementation without any useful functionality.
  24. jassertfalse;
  25. setOpaque (true);
  26. }
  27. WebBrowserComponent::~WebBrowserComponent()
  28. {
  29. }
  30. //==============================================================================
  31. void WebBrowserComponent::goToURL (const String& url,
  32. const StringArray* headers,
  33. const MemoryBlock* postData)
  34. {
  35. lastURL = url;
  36. if (headers != nullptr)
  37. lastHeaders = *headers;
  38. else
  39. lastHeaders.clear();
  40. if (postData != nullptr)
  41. lastPostData = *postData;
  42. else
  43. lastPostData.reset();
  44. blankPageShown = false;
  45. }
  46. void WebBrowserComponent::stop()
  47. {
  48. }
  49. void WebBrowserComponent::goBack()
  50. {
  51. lastURL.clear();
  52. blankPageShown = false;
  53. }
  54. void WebBrowserComponent::goForward()
  55. {
  56. lastURL.clear();
  57. }
  58. void WebBrowserComponent::refresh()
  59. {
  60. }
  61. //==============================================================================
  62. void WebBrowserComponent::paint (Graphics& g)
  63. {
  64. g.fillAll (Colours::white);
  65. }
  66. void WebBrowserComponent::checkWindowAssociation()
  67. {
  68. }
  69. void WebBrowserComponent::reloadLastURL()
  70. {
  71. if (lastURL.isNotEmpty())
  72. {
  73. goToURL (lastURL, &lastHeaders, &lastPostData);
  74. lastURL.clear();
  75. }
  76. }
  77. void WebBrowserComponent::parentHierarchyChanged()
  78. {
  79. checkWindowAssociation();
  80. }
  81. void WebBrowserComponent::resized()
  82. {
  83. }
  84. void WebBrowserComponent::visibilityChanged()
  85. {
  86. checkWindowAssociation();
  87. }
  88. void WebBrowserComponent::focusGained (FocusChangeType)
  89. {
  90. }