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.

110 lines
2.6KB

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