JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::detail::TopLevelWindowManager Class Reference

#include <juce_TopLevelWindowManager.h>

Inheritance diagram for juce::detail::TopLevelWindowManager:
Collaboration diagram for juce::detail::TopLevelWindowManager:

Public Member Functions

 TopLevelWindowManager ()=default
 
 ~TopLevelWindowManager () override
 
bool addWindow (TopLevelWindow *const w)
 
void checkFocus ()
 
void checkFocusAsync ()
 
void removeWindow (TopLevelWindow *const w)
 

Static Public Member Functions

static void checkCurrentlyFocusedTopLevelWindow ()
 

Public Attributes

Array< TopLevelWindow * > windows
 

Private Member Functions

TopLevelWindowfindCurrentlyActiveWindow () const
 
int getTimerInterval () const noexcept
 Returns the timer's interval.
 
bool isTimerRunning () const noexcept
 Returns true if the timer is currently running.
 
bool isWindowActive (TopLevelWindow *const tlw) const
 
void startTimer (int intervalInMilliseconds) noexcept
 Starts the timer and sets the length of interval required.
 
void startTimerHz (int timerFrequencyHz) noexcept
 Starts the timer with an interval specified in Hertz.
 
void stopTimer () noexcept
 Stops the timer.
 
void timerCallback () override
 The user-defined callback routine that actually gets called periodically.
 

Static Private Member Functions

static void callAfterDelay (int milliseconds, std::function< void()> functionToCall)
 Invokes a lambda after a given number of milliseconds.
 
static void callPendingTimersSynchronously ()
 For internal use only: invokes any timers that need callbacks.
 
static void deleteAll ()
 Deletes all extant objects.
 

Private Attributes

TopLevelWindowcurrentActive = nullptr
 
size_t positionInQueue = (size_t) -1
 
int timerPeriodMs = 0
 
SharedResourcePointer< TimerThread > timerThread
 

Constructor & Destructor Documentation

◆ TopLevelWindowManager()

juce::detail::TopLevelWindowManager::TopLevelWindowManager ( )
default

◆ ~TopLevelWindowManager()

juce::detail::TopLevelWindowManager::~TopLevelWindowManager ( )
inlineoverride

Member Function Documentation

◆ addWindow()

bool juce::detail::TopLevelWindowManager::addWindow ( TopLevelWindow *const  w)
inline

◆ callAfterDelay()

static void juce::Timer::callAfterDelay ( int  milliseconds,
std::function< void()>  functionToCall 
)
staticinherited

Invokes a lambda after a given number of milliseconds.

◆ callPendingTimersSynchronously()

static void juce::Timer::callPendingTimersSynchronously ( )
staticinherited

For internal use only: invokes any timers that need callbacks.

Don't call this unless you really know what you're doing!

◆ checkCurrentlyFocusedTopLevelWindow()

static void juce::detail::TopLevelWindowManager::checkCurrentlyFocusedTopLevelWindow ( )
inlinestatic

◆ checkFocus()

◆ checkFocusAsync()

void juce::detail::TopLevelWindowManager::checkFocusAsync ( )
inline

References juce::Timer::startTimer().

Referenced by addWindow(), and removeWindow().

◆ deleteAll()

static void juce::DeletedAtShutdown::deleteAll ( )
staticinherited

Deletes all extant objects.

This shouldn't be used by applications, as it's called automatically in the shutdown code of the JUCEApplicationBase class.

◆ findCurrentlyActiveWindow()

TopLevelWindow * juce::detail::TopLevelWindowManager::findCurrentlyActiveWindow ( ) const
inlineprivate

◆ getTimerInterval()

int juce::Timer::getTimerInterval ( ) const
inlinenoexceptinherited

Returns the timer's interval.

Returns
the timer's interval in milliseconds if it's running, or 0 if it's not.

Referenced by juce::detail::MouseInputSourceList::beginDragAutoRepeat(), and checkFocus().

◆ isTimerRunning()

bool juce::Timer::isTimerRunning ( ) const
inlinenoexceptinherited

Returns true if the timer is currently running.

◆ isWindowActive()

bool juce::detail::TopLevelWindowManager::isWindowActive ( TopLevelWindow *const  tlw) const
inlineprivate

◆ removeWindow()

void juce::detail::TopLevelWindowManager::removeWindow ( TopLevelWindow *const  w)
inline

◆ startTimer()

void juce::Timer::startTimer ( int  intervalInMilliseconds)
noexceptinherited

Starts the timer and sets the length of interval required.

If the timer is already started, this will reset it, so the time between calling this method and the next timer callback will not be less than the interval length passed in.

Parameters
intervalInMillisecondsthe interval to use (any value less than 1 will be rounded up to 1)

Referenced by juce::detail::MouseInputSourceList::beginDragAutoRepeat(), checkFocus(), checkFocusAsync(), juce::StandalonePluginHolder::init(), and juce::DeviceChangeDetector::triggerAsyncDeviceChangeCallback().

◆ startTimerHz()

void juce::Timer::startTimerHz ( int  timerFrequencyHz)
noexceptinherited

Starts the timer with an interval specified in Hertz.

This is effectively the same as calling startTimer (1000 / timerFrequencyHz).

Referenced by juce::AnimatedPosition< Behaviour >::endDrag(), juce::AnimatedPosition< Behaviour >::nudge(), and juce::AnimatedPosition< Behaviour >::timerCallback().

◆ stopTimer()

void juce::Timer::stopTimer ( )
noexceptinherited

Stops the timer.

No more timer callbacks will be triggered after this method returns.

Note that if you call this from a background thread while the message-thread is already in the middle of your callback, then this method will cancel any future timer callbacks, but it will return without waiting for the current one to finish. The current callback will continue, possibly still running some of your timer code after this method has returned.

Referenced by juce::StandalonePluginHolder::~StandalonePluginHolder(), juce::AnimatedPosition< Behaviour >::beginDrag(), juce::detail::MouseInputSourceList::beginDragAutoRepeat(), juce::AnimatedPosition< Behaviour >::setPosition(), juce::DeviceChangeDetector::timerCallback(), juce::detail::MouseInputSourceList::timerCallback(), and juce::AnimatedPosition< Behaviour >::timerCallback().

◆ timerCallback()

void juce::detail::TopLevelWindowManager::timerCallback ( )
inlineoverrideprivatevirtual

The user-defined callback routine that actually gets called periodically.

It's perfectly ok to call startTimer() or stopTimer() from within this callback to change the subsequent intervals.

Implements juce::Timer.

References checkFocus().

Member Data Documentation

◆ currentActive

TopLevelWindow* juce::detail::TopLevelWindowManager::currentActive = nullptr
private

◆ positionInQueue

size_t juce::Timer::positionInQueue = (size_t) -1
privateinherited

◆ timerPeriodMs

int juce::Timer::timerPeriodMs = 0
privateinherited

◆ timerThread

SharedResourcePointer<TimerThread> juce::Timer::timerThread
privateinherited

◆ windows

Array<TopLevelWindow*> juce::detail::TopLevelWindowManager::windows

Referenced by addWindow(), checkFocus(), and removeWindow().


The documentation for this class was generated from the following file: