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.

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