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.

114 lines
2.7KB

  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. if (headers != nullptr)
  34. lastHeaders = *headers;
  35. else
  36. lastHeaders.clear();
  37. if (postData != nullptr)
  38. lastPostData = *postData;
  39. else
  40. lastPostData.reset();
  41. blankPageShown = false;
  42. }
  43. void WebBrowserComponent::stop()
  44. {
  45. }
  46. void WebBrowserComponent::goBack()
  47. {
  48. lastURL.clear();
  49. blankPageShown = false;
  50. }
  51. void WebBrowserComponent::goForward()
  52. {
  53. lastURL.clear();
  54. }
  55. void WebBrowserComponent::refresh()
  56. {
  57. }
  58. //==============================================================================
  59. void WebBrowserComponent::paint (Graphics& g)
  60. {
  61. g.fillAll (Colours::white);
  62. }
  63. void WebBrowserComponent::checkWindowAssociation()
  64. {
  65. }
  66. void WebBrowserComponent::reloadLastURL()
  67. {
  68. if (lastURL.isNotEmpty())
  69. {
  70. goToURL (lastURL, &lastHeaders, &lastPostData);
  71. lastURL.clear();
  72. }
  73. }
  74. void WebBrowserComponent::parentHierarchyChanged()
  75. {
  76. checkWindowAssociation();
  77. }
  78. void WebBrowserComponent::resized()
  79. {
  80. }
  81. void WebBrowserComponent::visibilityChanged()
  82. {
  83. checkWindowAssociation();
  84. }
  85. void WebBrowserComponent::focusGained (FocusChangeType)
  86. {
  87. }