The JUCE cross-platform C++ framework, with DISTRHO/KXStudio specific changes
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.

123 lines
3.0KB

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