Vuo  2.0.2
Macros | Functions | Variables
VuoApp.m File Reference

Description

VuoApp implementation.

Definition in file VuoApp.m.

Go to the source code of this file.

Macros

#define NS_RETURNS_INNER_POINTER
 Disable NS_RETURNS_INNER_POINTER (new in Mac OS 10.10's system headers), since Clang 3.2 doesn't support it. More...
 

Functions

bool VuoApp_isMainThread (void)
 Is the current thread the main thread? More...
 
void VuoApp_executeOnMainThread (void(^block)(void))
 Executes the specified block on the main thread, then returns. More...
 
char * VuoApp_getName (void)
 Returns the composition's name. More...
 
static void VuoApp_initNSApplication (bool requiresDockIcon)
 Helper for VuoApp_init. More...
 
void VuoApp_init (bool requiresDockIcon)
 Creates an NSApplication instance (if one doesn't already exist). More...
 
static void VuoApp_finiWindows (uint64_t compositionUid)
 Helper for VuoApp_fini. More...
 
void VuoApp_fini (void)
 Cleanly shuts the application down. More...
 

Variables

const double VuoApp_windowFadeSeconds = 0.45
 The duration of the window fade in/out animation. More...
 

Macro Definition Documentation

◆ NS_RETURNS_INNER_POINTER

#define NS_RETURNS_INNER_POINTER

Disable NS_RETURNS_INNER_POINTER (new in Mac OS 10.10's system headers), since Clang 3.2 doesn't support it.

https://b33p.net/kosada/node/9140

Definition at line 17 of file VuoApp.m.

Function Documentation

◆ VuoApp_executeOnMainThread()

void VuoApp_executeOnMainThread ( void(^)(void)  block)

Executes the specified block on the main thread, then returns.

Can be called from any thread, including the main thread (avoids deadlock).

Don't call this from __attribute__((constructor)) functions, since this function depends on initialization which might not happen before your constructor is called.

Definition at line 79 of file VuoApp.m.

◆ VuoApp_fini()

void VuoApp_fini ( void  )

Cleanly shuts the application down.

Should only be called from within vuoStopComposition().

This function may be called from any thread.

Definition at line 277 of file VuoApp.m.

◆ VuoApp_finiWindows()

static void VuoApp_finiWindows ( uint64_t  compositionUid)
static

Helper for VuoApp_fini.

This function may only be called on the main thread.

Definition at line 243 of file VuoApp.m.

◆ VuoApp_getName()

char* VuoApp_getName ( void  )

Returns the composition's name.

If the composition is running in Vuo Editor (via VuoCompositionLoader), it extracts the name from the most-recently-loaded dylib's path. If the composition has been saved, this matches the composition's source filename. If not, it returns the text "Vuo Composition".

If the composition is running via VuoRunner (but not via VuoCompositionLoader), it returns the name of the VuoRunner process.

If the composition is running standalone, it tries the following Info.plist keys:

  • CFBundleDisplayName
  • CFBundleName
  • CFBundleExecutable

If none of those keys exist, it uses the composition executable's filename.

The caller is responsible for freeing the returned string.

Definition at line 117 of file VuoApp.m.

◆ VuoApp_init()

void VuoApp_init ( bool  requiresDockIcon)

Creates an NSApplication instance (if one doesn't already exist).

This causes the process's icon to appear in the dock.

VuoWindow methods call this automatically as needed, so you only need to call this if you need an NSApplication without using VuoWindow (like, for example, VuoAudioFile does).

If requiresDockIcon is true, the app will show up in the dock. If requiresDockIcon is false, the app won't necessarily show up in the dock (if VuoApp_init was previously called with requiresDockIcon=true, the icon will remain).

This function may be called from any thread.

Changed in Vuo 2.0.0:
Added requiresDockIcon parameter.

Definition at line 217 of file VuoApp.m.

◆ VuoApp_initNSApplication()

static void VuoApp_initNSApplication ( bool  requiresDockIcon)
static

Helper for VuoApp_init.

This function may only be called on the main thread.

Definition at line 168 of file VuoApp.m.

◆ VuoApp_isMainThread()

bool VuoApp_isMainThread ( void  )

Is the current thread the main thread?

Definition at line 43 of file VuoApp.m.

Variable Documentation

◆ VuoApp_windowFadeSeconds

const double VuoApp_windowFadeSeconds = 0.45

The duration of the window fade in/out animation.

Changed in Vuo 2.0.0:
New.

Definition at line 38 of file VuoApp.m.