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_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... | |
enum VuoEventLoopMode |
How to execute the event loop.
Definition at line 23 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 115 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 247 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 192 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 207 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 160 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 68 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 148 of file VuoEventLoop.m.