Browse Source

Rebuilt the docs including a couple of missing classes; tweaked WebBrowserComponent to make page unloading optional; small efficiency improvement to ThreadPool

tags/2021-05-28
Julian Storer 16 years ago
parent
commit
54831605c3
10 changed files with 58 additions and 41 deletions
  1. BIN
      docs/JuceAPIDocs.zip
  2. +16
    -14
      juce_amalgamated.cpp
  3. +13
    -6
      juce_amalgamated.h
  4. +0
    -2
      src/gui/components/controls/juce_TableHeaderComponent.cpp
  5. +1
    -1
      src/gui/components/special/juce_SystemTrayIconComponent.h
  6. +12
    -6
      src/gui/components/special/juce_WebBrowserComponent.h
  7. +3
    -2
      src/native/linux/juce_linux_WebBrowserComponent.cpp
  8. +8
    -7
      src/native/mac/juce_mac_WebBrowserComponent.mm
  9. +4
    -3
      src/native/windows/juce_win32_WebBrowserComponent.cpp
  10. +1
    -0
      src/threads/juce_ThreadPool.cpp

BIN
docs/JuceAPIDocs.zip View File


+ 16
- 14
juce_amalgamated.cpp View File

@@ -15676,6 +15676,7 @@ void ThreadPool::addJob (ThreadPoolJob* const job)
{
threads[i]->startThread (priority);
startedOne = true;
break;
}
}

@@ -47081,8 +47082,6 @@ void TableHeaderComponent::mouseDrag (const MouseEvent& e)
{
if (e.y >= -50 && e.y < getHeight() + 50)
{
beginDrag (e);

if (dragOverlayComp != 0)
{
dragOverlayComp->setVisible (true);
@@ -239207,9 +239206,10 @@ private:
};
};

WebBrowserComponent::WebBrowserComponent()
WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
: browser (0),
blankPageShown (false)
blankPageShown (false),
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{
setOpaque (true);
addAndMakeVisible (browser = new WebBrowserComponentInternal());
@@ -239291,7 +239291,7 @@ void WebBrowserComponent::checkWindowAssociation()
}
else
{
if (browser != 0 && ! blankPageShown)
if (browser != 0 && unloadPageWhenBrowserIsHidden && ! blankPageShown)
{
// when the component becomes invisible, some stuff like flash
// carries on playing audio, so we need to force it onto a blank
@@ -255885,9 +255885,10 @@ void FileChooser::showPlatformDialog (OwnedArray<File>& results,
Sorry.. This class isn't implemented on Linux!
*/

WebBrowserComponent::WebBrowserComponent()
WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
: browser (0),
blankPageShown (false)
blankPageShown (false),
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{
setOpaque (true);
}
@@ -262999,9 +263000,10 @@ private:
DownloadClickDetector* clickListener;
};

WebBrowserComponent::WebBrowserComponent()
WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
: browser (0),
blankPageShown (false)
blankPageShown (false),
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{
setOpaque (true);

@@ -263061,10 +263063,6 @@ void WebBrowserComponent::paint (Graphics& g)

void WebBrowserComponent::checkWindowAssociation()
{
// when the component becomes invisible, some stuff like flash
// carries on playing audio, so we need to force it onto a blank
// page to avoid this, (and send it back when it's made visible again).

if (isShowing())
{
if (blankPageShown)
@@ -263072,8 +263070,12 @@ void WebBrowserComponent::checkWindowAssociation()
}
else
{
if (! blankPageShown)
if (unloadPageWhenBrowserIsHidden && ! blankPageShown)
{
// when the component becomes invisible, some stuff like flash
// carries on playing audio, so we need to force it onto a blank
// page to avoid this, (and send it back when it's made visible again).

blankPageShown = true;
browser->goToURL ("about:blank", 0, 0);
}


+ 13
- 6
juce_amalgamated.h View File

@@ -53665,9 +53665,11 @@ private:
#ifndef __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__
#define __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__

#if JUCE_WEB_BROWSER
#if JUCE_WEB_BROWSER || DOXYGEN

class WebBrowserComponentInternal;
#if ! DOXYGEN
class WebBrowserComponentInternal;
#endif

/**
A component that displays an embedded web browser.
@@ -53683,8 +53685,14 @@ public:
/** Creates a WebBrowserComponent.

Once it's created and visible, send the browser to a URL using goToURL().

@param unloadPageWhenBrowserIsHidden if this is true, then when the browser
component is taken offscreen, it'll clear the current page
and replace it with a blank page - this can be handy to stop
the browser using resources in the background when it's not
actually being used.
*/
WebBrowserComponent();
WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden = true);

/** Destructor. */
~WebBrowserComponent();
@@ -53740,8 +53748,7 @@ public:

private:
WebBrowserComponentInternal* browser;
bool blankPageShown;

bool blankPageShown, unloadPageWhenBrowserIsHidden;
String lastURL;
StringArray lastHeaders;
MemoryBlock lastPostData;
@@ -53764,7 +53771,7 @@ private:
#ifndef __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__
#define __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__

#if JUCE_WIN32 || JUCE_LINUX
#if JUCE_WIN32 || JUCE_LINUX || DOXYGEN

/**
On Windows only, this component sits in the taskbar tray as a small icon.


+ 0
- 2
src/gui/components/controls/juce_TableHeaderComponent.cpp View File

@@ -657,8 +657,6 @@ void TableHeaderComponent::mouseDrag (const MouseEvent& e)
{
if (e.y >= -50 && e.y < getHeight() + 50)
{
beginDrag (e);
if (dragOverlayComp != 0)
{
dragOverlayComp->setVisible (true);


+ 1
- 1
src/gui/components/special/juce_SystemTrayIconComponent.h View File

@@ -26,7 +26,7 @@
#ifndef __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__
#define __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__
#if JUCE_WIN32 || JUCE_LINUX
#if JUCE_WIN32 || JUCE_LINUX || DOXYGEN
#include "../juce_Component.h"


+ 12
- 6
src/gui/components/special/juce_WebBrowserComponent.h View File

@@ -28,10 +28,11 @@
#include "../juce_Component.h"
#if JUCE_WEB_BROWSER
class WebBrowserComponentInternal;
#if JUCE_WEB_BROWSER || DOXYGEN
#if ! DOXYGEN
class WebBrowserComponentInternal;
#endif
//==============================================================================
/**
@@ -48,8 +49,14 @@ public:
/** Creates a WebBrowserComponent.
Once it's created and visible, send the browser to a URL using goToURL().
@param unloadPageWhenBrowserIsHidden if this is true, then when the browser
component is taken offscreen, it'll clear the current page
and replace it with a blank page - this can be handy to stop
the browser using resources in the background when it's not
actually being used.
*/
WebBrowserComponent();
WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden = true);
/** Destructor. */
~WebBrowserComponent();
@@ -109,8 +116,7 @@ public:
private:
WebBrowserComponentInternal* browser;
bool blankPageShown;
bool blankPageShown, unloadPageWhenBrowserIsHidden;
String lastURL;
StringArray lastHeaders;
MemoryBlock lastPostData;


+ 3
- 2
src/native/linux/juce_linux_WebBrowserComponent.cpp View File

@@ -34,9 +34,10 @@
*/
//==============================================================================
WebBrowserComponent::WebBrowserComponent()
WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
: browser (0),
blankPageShown (false)
blankPageShown (false),
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{
setOpaque (true);
}


+ 8
- 7
src/native/mac/juce_mac_WebBrowserComponent.mm View File

@@ -153,9 +153,10 @@ private:
};
//==============================================================================
WebBrowserComponent::WebBrowserComponent()
WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
: browser (0),
blankPageShown (false)
blankPageShown (false),
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{
setOpaque (true);
@@ -217,10 +218,6 @@ void WebBrowserComponent::paint (Graphics& g)
void WebBrowserComponent::checkWindowAssociation()
{
// when the component becomes invisible, some stuff like flash
// carries on playing audio, so we need to force it onto a blank
// page to avoid this, (and send it back when it's made visible again).
if (isShowing())
{
if (blankPageShown)
@@ -228,8 +225,12 @@ void WebBrowserComponent::checkWindowAssociation()
}
else
{
if (! blankPageShown)
if (unloadPageWhenBrowserIsHidden && ! blankPageShown)
{
// when the component becomes invisible, some stuff like flash
// carries on playing audio, so we need to force it onto a blank
// page to avoid this, (and send it back when it's made visible again).
blankPageShown = true;
browser->goToURL ("about:blank", 0, 0);
}


+ 4
- 3
src/native/windows/juce_win32_WebBrowserComponent.cpp View File

@@ -220,9 +220,10 @@ private:
//==============================================================================
WebBrowserComponent::WebBrowserComponent()
WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
: browser (0),
blankPageShown (false)
blankPageShown (false),
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{
setOpaque (true);
addAndMakeVisible (browser = new WebBrowserComponentInternal());
@@ -306,7 +307,7 @@ void WebBrowserComponent::checkWindowAssociation()
}
else
{
if (browser != 0 && ! blankPageShown)
if (browser != 0 && unloadPageWhenBrowserIsHidden && ! blankPageShown)
{
// when the component becomes invisible, some stuff like flash
// carries on playing audio, so we need to force it onto a blank


+ 1
- 0
src/threads/juce_ThreadPool.cpp View File

@@ -167,6 +167,7 @@ void ThreadPool::addJob (ThreadPoolJob* const job)
{
threads[i]->startThread (priority);
startedOne = true;
break;
}
}


Loading…
Cancel
Save