mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Rebuilt the docs including a couple of missing classes; tweaked WebBrowserComponent to make page unloading optional; small efficiency improvement to ThreadPool
This commit is contained in:
parent
f72563d6c7
commit
54831605c3
10 changed files with 58 additions and 41 deletions
Binary file not shown.
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53665,9 +53665,11 @@ private:
|
|||
#ifndef __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__
|
||||
#define __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__
|
||||
|
||||
#if JUCE_WEB_BROWSER
|
||||
#if JUCE_WEB_BROWSER || DOXYGEN
|
||||
|
||||
#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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -28,10 +28,11 @@
|
|||
|
||||
#include "../juce_Component.h"
|
||||
|
||||
#if JUCE_WEB_BROWSER
|
||||
#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;
|
||||
|
|
|
|||
|
|
@ -34,9 +34,10 @@
|
|||
*/
|
||||
|
||||
//==============================================================================
|
||||
WebBrowserComponent::WebBrowserComponent()
|
||||
WebBrowserComponent::WebBrowserComponent (const bool unloadPageWhenBrowserIsHidden_)
|
||||
: browser (0),
|
||||
blankPageShown (false)
|
||||
blankPageShown (false),
|
||||
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
|
||||
{
|
||||
setOpaque (true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -167,6 +167,7 @@ void ThreadPool::addJob (ThreadPoolJob* const job)
|
|||
{
|
||||
threads[i]->startThread (priority);
|
||||
startedOne = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue