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
64f5482d6d
9 changed files with 52 additions and 37 deletions
  1. BIN
      docs/JuceAPIDocs.zip
  2. +13
    -12
      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. +8
    -7
      src/native/mac/juce_mac_WebBrowserComponent.mm
  8. +4
    -3
      src/native/windows/juce_win32_WebBrowserComponent.cpp
  9. +1
    -0
      src/threads/juce_ThreadPool.cpp

BIN
docs/JuceAPIDocs.zip View File


+ 13
- 12
juce_amalgamated.cpp View File

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


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

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


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


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


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


void WebBrowserComponent::checkWindowAssociation() 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 (isShowing())
{ {
if (blankPageShown) if (blankPageShown)
@@ -263072,8 +263069,12 @@ void WebBrowserComponent::checkWindowAssociation()
} }
else 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; blankPageShown = true;
browser->goToURL ("about:blank", 0, 0); browser->goToURL ("about:blank", 0, 0);
} }


+ 13
- 6
juce_amalgamated.h View File

@@ -53665,9 +53665,11 @@ private:
#ifndef __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__ #ifndef __JUCE_WEBBROWSERCOMPONENT_JUCEHEADER__
#define __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. A component that displays an embedded web browser.
@@ -53683,8 +53685,14 @@ public:
/** Creates a WebBrowserComponent. /** Creates a WebBrowserComponent.


Once it's created and visible, send the browser to a URL using goToURL(). 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. */ /** Destructor. */
~WebBrowserComponent(); ~WebBrowserComponent();
@@ -53740,8 +53748,7 @@ public:


private: private:
WebBrowserComponentInternal* browser; WebBrowserComponentInternal* browser;
bool blankPageShown;

bool blankPageShown, unloadPageWhenBrowserIsHidden;
String lastURL; String lastURL;
StringArray lastHeaders; StringArray lastHeaders;
MemoryBlock lastPostData; MemoryBlock lastPostData;
@@ -53764,7 +53771,7 @@ private:
#ifndef __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__ #ifndef __JUCE_SYSTEMTRAYICONCOMPONENT_JUCEHEADER__
#define __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. 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) if (e.y >= -50 && e.y < getHeight() + 50)
{ {
beginDrag (e);
if (dragOverlayComp != 0) if (dragOverlayComp != 0)
{ {
dragOverlayComp->setVisible (true); dragOverlayComp->setVisible (true);


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

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


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

@@ -28,10 +28,11 @@
#include "../juce_Component.h" #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. /** Creates a WebBrowserComponent.
Once it's created and visible, send the browser to a URL using goToURL(). 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. */ /** Destructor. */
~WebBrowserComponent(); ~WebBrowserComponent();
@@ -109,8 +116,7 @@ public:
private: private:
WebBrowserComponentInternal* browser; WebBrowserComponentInternal* browser;
bool blankPageShown;
bool blankPageShown, unloadPageWhenBrowserIsHidden;
String lastURL; String lastURL;
StringArray lastHeaders; StringArray lastHeaders;
MemoryBlock lastPostData; MemoryBlock lastPostData;


+ 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), : browser (0),
blankPageShown (false)
blankPageShown (false),
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{ {
setOpaque (true); setOpaque (true);
@@ -217,10 +218,6 @@ void WebBrowserComponent::paint (Graphics& g)
void WebBrowserComponent::checkWindowAssociation() 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 (isShowing())
{ {
if (blankPageShown) if (blankPageShown)
@@ -228,8 +225,12 @@ void WebBrowserComponent::checkWindowAssociation()
} }
else 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; blankPageShown = true;
browser->goToURL ("about:blank", 0, 0); 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), : browser (0),
blankPageShown (false)
blankPageShown (false),
unloadPageWhenBrowserIsHidden (unloadPageWhenBrowserIsHidden_)
{ {
setOpaque (true); setOpaque (true);
addAndMakeVisible (browser = new WebBrowserComponentInternal()); addAndMakeVisible (browser = new WebBrowserComponentInternal());
@@ -306,7 +307,7 @@ void WebBrowserComponent::checkWindowAssociation()
} }
else else
{ {
if (browser != 0 && ! blankPageShown)
if (browser != 0 && unloadPageWhenBrowserIsHidden && ! blankPageShown)
{ {
// when the component becomes invisible, some stuff like flash // when the component becomes invisible, some stuff like flash
// carries on playing audio, so we need to force it onto a blank // 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); threads[i]->startThread (priority);
startedOne = true; startedOne = true;
break;
} }
} }


Loading…
Cancel
Save