VuoEventLoop interface.
Definition in file VuoEventLoop.h.
Go to the source code of this file.
Enumerations | |
enum | VuoEventLoopMode { VuoEventLoop_WaitIndefinitely , VuoEventLoop_RunOnce } |
How to execute the event loop. More... | |
Functions | |
void | VuoEventLoop_processEvent (VuoEventLoopMode mode) |
Handles one or more blocks or application events (e.g., keypresses, mouse moves, window state changes). More... | |
void | VuoEventLoop_break (void) |
Interrupts VuoEventLoop_processEvent while it is waiting. More... | |
void | VuoEventLoop_switchToAppMode (void) |
Interrupts VuoEventLoop_processEvent if it's currently blocking, so that it can process NSEvents next time it's invoked. More... | |
bool | VuoEventLoop_mayBeTerminated (void) |
Returns false if the app is currently waiting on user input in a modal dialog or a window sheet. More... | |
dispatch_queue_attr_t | VuoEventLoop_getDispatchInteractiveAttribute (void) |
Returns the Dispatch attribute for QOS_CLASS_USER_INTERACTIVE . More... | |
void | VuoEventLoop_setLimits (void) |
Installs SIGINT and SIGTERM handlers, to cleanly shut down the composition. More... | |
void | VuoEventLoop_installSignalHandlers (void) |
Installs SIGINT and SIGTERM handlers, to cleanly shut down the composition. More... | |
void | VuoEventLoop_disableAppNap (void) |
Disable "App Nap" since even if our timers are set to DISPATCH_TIMER_STRICT , the OS still prevents the process from running smoothly while taking a nap. More... | |
void | VuoEventLoop_installSleepHandlers (void) |
Starts monitoring for system sleep events, to better support maintaining a connection between VuoRunner and VuoRuntime while the system is sleeping. More... | |
bool | VuoEventLoop_isSystemAsleep (void) |
Returns true if the system is asleep (i.e., the screens are off but the CPU is still active). More... | |
enum VuoEventLoopMode |
How to execute the event loop.
Definition at line 24 of file VuoEventLoop.h.
void VuoEventLoop_break | ( | void | ) |
Interrupts VuoEventLoop_processEvent while it is waiting.
This function may be called from any thread.
Definition at line 118 of file VuoEventLoop.m.
void VuoEventLoop_disableAppNap | ( | void | ) |
Disable "App Nap" since even if our timers are set to DISPATCH_TIMER_STRICT
, the OS still prevents the process from running smoothly while taking a nap.
https://b33p.net/kosada/node/12685
This function may only be called on the main thread.
Definition at line 401 of file VuoEventLoop.m.
dispatch_queue_attr_t VuoEventLoop_getDispatchInteractiveAttribute | ( | void | ) |
Returns the Dispatch attribute for QOS_CLASS_USER_INTERACTIVE
.
Apple's documentation says: "The use of this QOS class should be limited to […] view drawing, animation, etc."
This function may be called from any thread.
Definition at line 195 of file VuoEventLoop.m.
void VuoEventLoop_installSignalHandlers | ( | void | ) |
Installs SIGINT and SIGTERM handlers, to cleanly shut down the composition.
This function may only be called on the main thread.
Definition at line 225 of file VuoEventLoop.m.
void VuoEventLoop_installSleepHandlers | ( | void | ) |
Starts monitoring for system sleep events, to better support maintaining a connection between VuoRunner and VuoRuntime while the system is sleeping.
Also starts monitoring other system/workspace events, for debugging.
This function may only be called on the main thread.
Definition at line 387 of file VuoEventLoop.m.
bool VuoEventLoop_isSystemAsleep | ( | void | ) |
Returns true if the system is asleep (i.e., the screens are off but the CPU is still active).
Definition at line 374 of file VuoEventLoop.m.
bool VuoEventLoop_mayBeTerminated | ( | void | ) |
Returns false if the app is currently waiting on user input in a modal dialog or a window sheet.
This function may only be called on the main thread.
Definition at line 163 of file VuoEventLoop.m.
void VuoEventLoop_processEvent | ( | VuoEventLoopMode | mode | ) |
Handles one or more blocks or application events (e.g., keypresses, mouse moves, window state changes).
If an NSApp is available:
mode
is VuoEventLoop_WaitIndefinitely, waits until an NSEvent arrives, processes the event, and returns.mode
is VuoEventLoop_RunOnce, processes an NSEvent (if one is ready), and returns.If there's no NSApp, executes the CFRunLoop:
mode
is VuoEventLoop_WaitIndefinitely, returns when the CFRunLoop exits.mode
is VuoEventLoop_RunOnce, returns immediately after a single CFRunLoop iteration.In either case, when mode
is VuoEventLoop_WaitIndefinitely, VuoEventLoop_break will cause this function to return immediately.
This function may only be called on the main thread.
Definition at line 71 of file VuoEventLoop.m.
void VuoEventLoop_setLimits | ( | void | ) |
Installs SIGINT and SIGTERM handlers, to cleanly shut down the composition.
This function may only be called on the main thread.
Definition at line 210 of file VuoEventLoop.m.
void VuoEventLoop_switchToAppMode | ( | void | ) |
Interrupts VuoEventLoop_processEvent if it's currently blocking, so that it can process NSEvents next time it's invoked.
This function may be called from any thread.
Definition at line 151 of file VuoEventLoop.m.