JUCE
Classes | Macros | Typedefs | Enumerations | Functions
messages

Classes

class  JUCEApplicationBase
 Abstract base class for application classes. More...
 
class  CallbackMessage
 A message that invokes a callback method when it gets delivered. More...
 
class  DeletedAtShutdown
 Classes derived from this will be automatically deleted when the application exits. More...
 
class  ScopedJuceInitialiser_GUI
 A utility object that helps you initialise and shutdown JUCE correctly using an RAII pattern. More...
 
class  Message
 The base class for objects that can be sent to a MessageListener. More...
 
class  MessageListener
 MessageListener subclasses can post and receive Message objects. More...
 
class  MessageManager
 This class is in charge of the application's event-dispatch loop. More...
 
class  MessageManager::Lock
 A lock you can use to lock the message manager. More...
 
class  MessageManager::MessageBase
 Internal class used as the base class for all message objects. More...
 
class  MessageManagerLock
 Used to make sure that the calling thread has exclusive access to the message loop. More...
 
class  MountedVolumeListChangeDetector
 An instance of this class will provide callbacks when drives are mounted or unmounted on the system. More...
 

Macros

#define JUCE_TRY   try
 The JUCE_TRY/JUCE_CATCH_EXCEPTION wrappers can be used to pass any uncaught exceptions to the JUCEApplicationBase::sendUnhandledException() method. More...
 
#define JUCE_CATCH_EXCEPTION
 The JUCE_TRY/JUCE_CATCH_EXCEPTION wrappers can be used to pass any uncaught exceptions to the JUCEApplicationBase::sendUnhandledException() method. More...
 
#define START_JUCE_APPLICATION(AppClass)
 To start a JUCE app, use this macro: START_JUCE_APPLICATION (AppSubClass) where AppSubClass is the name of a class derived from JUCEApplication or JUCEApplicationBase. More...
 
#define JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED   jassert (juce::MessageManager::existsAndIsLockedByCurrentThread());
 This macro is used to catch unsafe use of functions which expect to only be called on the message thread, or when a MessageManagerLock is in place. More...
 
#define JUCE_ASSERT_MESSAGE_THREAD   jassert (juce::MessageManager::existsAndIsCurrentThread());
 This macro is used to catch unsafe use of functions which expect to only be called on the message thread. More...
 
#define JUCE_ASSERT_MESSAGE_MANAGER_EXISTS   jassert (juce::MessageManager::getInstanceWithoutCreating() != nullptr);
 This macro is used to catch unsafe use of functions which expect to not be called outside the lifetime of the MessageManager. More...
 

Typedefs

using MessageCallbackFunction = void *(void *userData)
 See MessageManager::callFunctionOnMessageThread() for use of this function type. More...
 

Enumerations

enum  NotificationType { dontSendNotification = 0, sendNotification = 1, sendNotificationSync, sendNotificationAsync }
 These enums are used in various classes to indicate whether a notification event should be sent out. More...
 

Functions

JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI ()
 Initialises JUCE's GUI classes. More...
 
JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI ()
 Clears up any static data being used by JUCE's GUI classes. More...
 

Detailed Description

Macro Definition Documentation

◆ JUCE_TRY

#define JUCE_TRY   try

The JUCE_TRY/JUCE_CATCH_EXCEPTION wrappers can be used to pass any uncaught exceptions to the JUCEApplicationBase::sendUnhandledException() method.

This functionality can be enabled with the JUCE_CATCH_UNHANDLED_EXCEPTIONS macro.

◆ JUCE_CATCH_EXCEPTION

#define JUCE_CATCH_EXCEPTION
Value:
catch (const std::exception& e) { juce::JUCEApplicationBase::sendUnhandledException (&e, __FILE__, __LINE__); } \
catch (...) { juce::JUCEApplicationBase::sendUnhandledException (nullptr, __FILE__, __LINE__); }

The JUCE_TRY/JUCE_CATCH_EXCEPTION wrappers can be used to pass any uncaught exceptions to the JUCEApplicationBase::sendUnhandledException() method.

This functionality can be enabled with the JUCE_CATCH_UNHANDLED_EXCEPTIONS macro.

◆ START_JUCE_APPLICATION

#define START_JUCE_APPLICATION (   AppClass)

To start a JUCE app, use this macro: START_JUCE_APPLICATION (AppSubClass) where AppSubClass is the name of a class derived from JUCEApplication or JUCEApplicationBase.

See the JUCEApplication and JUCEApplicationBase class documentation for more details.

◆ JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED

#define JUCE_ASSERT_MESSAGE_MANAGER_IS_LOCKED   jassert (juce::MessageManager::existsAndIsLockedByCurrentThread());

This macro is used to catch unsafe use of functions which expect to only be called on the message thread, or when a MessageManagerLock is in place.

It will also fail if you try to use the function before the message manager has been created, which could happen if you accidentally invoke it during a static constructor.

◆ JUCE_ASSERT_MESSAGE_THREAD

#define JUCE_ASSERT_MESSAGE_THREAD   jassert (juce::MessageManager::existsAndIsCurrentThread());

This macro is used to catch unsafe use of functions which expect to only be called on the message thread.

It will also fail if you try to use the function before the message manager has been created, which could happen if you accidentally invoke it during a static constructor.

◆ JUCE_ASSERT_MESSAGE_MANAGER_EXISTS

#define JUCE_ASSERT_MESSAGE_MANAGER_EXISTS   jassert (juce::MessageManager::getInstanceWithoutCreating() != nullptr);

This macro is used to catch unsafe use of functions which expect to not be called outside the lifetime of the MessageManager.

Typedef Documentation

◆ MessageCallbackFunction

using MessageCallbackFunction = void* (void* userData)

See MessageManager::callFunctionOnMessageThread() for use of this function type.

Enumeration Type Documentation

◆ NotificationType

These enums are used in various classes to indicate whether a notification event should be sent out.

Enumerator
dontSendNotification 

No notification message should be sent.

sendNotification 

Requests a notification message, either synchronous or not.

sendNotificationSync 

Requests a synchronous notification.

sendNotificationAsync 

Requests an asynchronous notification.

Function Documentation

◆ initialiseJuce_GUI()

JUCE_API void JUCE_CALLTYPE initialiseJuce_GUI ( )

Initialises JUCE's GUI classes.

If you're embedding JUCE into an application that uses its own event-loop rather than using the START_JUCE_APPLICATION macro, call this function before making any JUCE calls, to make sure things are initialised correctly.

Note that if you're creating a JUCE DLL for Windows, you may also need to call the Process::setCurrentModuleInstanceHandle() method.

See also
shutdownJuce_GUI()

◆ shutdownJuce_GUI()

JUCE_API void JUCE_CALLTYPE shutdownJuce_GUI ( )

Clears up any static data being used by JUCE's GUI classes.

If you're embedding JUCE into an application that uses its own event-loop rather than using the START_JUCE_APPLICATION macro, call this function in your shutdown code to clean up any JUCE objects that might be lying around.

See also
initialiseJuce_GUI()