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.

137 lines
3.3KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE library - "Jules' Utility Class Extensions"
  4. Copyright 2004-7 by Raw Material Software ltd.
  5. ------------------------------------------------------------------------------
  6. JUCE can be redistributed and/or modified under the terms of the
  7. GNU General Public License, as published by the Free Software Foundation;
  8. either version 2 of the License, or (at your option) any later version.
  9. JUCE is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with JUCE; if not, visit www.gnu.org/licenses or write to the
  15. Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  16. Boston, MA 02111-1307 USA
  17. ------------------------------------------------------------------------------
  18. If you'd like to release a closed-source product which uses JUCE, commercial
  19. licenses are also available: visit www.rawmaterialsoftware.com/juce for
  20. more information.
  21. ==============================================================================
  22. */
  23. #include "../../../src/juce_core/basics/juce_StandardHeader.h"
  24. BEGIN_JUCE_NAMESPACE
  25. #include "../../../src/juce_appframework/gui/components/special/juce_WebBrowserComponent.h"
  26. #if JUCE_WEB_BROWSER
  27. /*
  28. Sorry.. This class isn't implemented on Linux!
  29. */
  30. //==============================================================================
  31. WebBrowserComponent::WebBrowserComponent()
  32. : browser (0),
  33. blankPageShown (false)
  34. {
  35. setOpaque (true);
  36. }
  37. WebBrowserComponent::~WebBrowserComponent()
  38. {
  39. }
  40. //==============================================================================
  41. void WebBrowserComponent::goToURL (const String& url,
  42. const StringArray* headers,
  43. const MemoryBlock* postData)
  44. {
  45. lastURL = url;
  46. lastHeaders.clear();
  47. if (headers != 0)
  48. lastHeaders = *headers;
  49. lastPostData.setSize (0);
  50. if (postData != 0)
  51. lastPostData = *postData;
  52. blankPageShown = false;
  53. }
  54. void WebBrowserComponent::stop()
  55. {
  56. }
  57. void WebBrowserComponent::goBack()
  58. {
  59. lastURL = String::empty;
  60. blankPageShown = false;
  61. }
  62. void WebBrowserComponent::goForward()
  63. {
  64. lastURL = String::empty;
  65. }
  66. void WebBrowserComponent::refresh()
  67. {
  68. }
  69. //==============================================================================
  70. void WebBrowserComponent::paint (Graphics& g)
  71. {
  72. g.fillAll (Colours::white);
  73. }
  74. void WebBrowserComponent::checkWindowAssociation()
  75. {
  76. }
  77. void WebBrowserComponent::reloadLastURL()
  78. {
  79. if (lastURL.isNotEmpty())
  80. {
  81. goToURL (lastURL, &lastHeaders, &lastPostData);
  82. lastURL = String::empty;
  83. }
  84. }
  85. void WebBrowserComponent::parentHierarchyChanged()
  86. {
  87. checkWindowAssociation();
  88. }
  89. void WebBrowserComponent::resized()
  90. {
  91. }
  92. void WebBrowserComponent::visibilityChanged()
  93. {
  94. checkWindowAssociation();
  95. }
  96. bool WebBrowserComponent::pageAboutToLoad (const String& url)
  97. {
  98. return true;
  99. }
  100. #endif
  101. END_JUCE_NAMESPACE