Vuo  1.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
VuoWindow.m File Reference

Description

VuoWindow implementation.

Classes

class  VuoApplicationDelegate
 NSApplication delegate, to shut down cleanly when the user requests to quit. More...
 
class  VuoApplicationAboutDialog
 The About dialog for a Vuo app. More...
 

Functions

bool VuoApp_isMainThread (void)
 Is the current thread the main thread?
 
void VuoApp_executeOnMainThread (void(^block)(void))
 Executes the specified block on the main thread, then returns.
 
static void VuoApp_initNSApplication (void)
 Helper for VuoApp_init.
 
void VuoApp_init (void)
 Creates an NSApplication instance (if one doesn't already exist).
 
static void VuoApp_finiWindows (void)
 Helper for VuoApp_fini.
 
void VuoApp_fini (void)
 Cleanly shuts the application down.
 
void VuoWindowText_destroy (VuoWindowText vw)
 Deallocates the window.
 
VuoWindowText VuoWindowText_make (void)
 Creates and displays a window containing a text edit widget.
 
void VuoWindowText_enableTriggers (VuoWindowText w, VuoOutputTrigger(typedLine, VuoText), VuoOutputTrigger(typedWord, VuoText), VuoOutputTrigger(typedCharacter, VuoText))
 Sets up the window to call the trigger functions when its text is edited.
 
void VuoWindowText_disableTriggers (VuoWindowText w)
 Stops the window from calling trigger functions when its text is edited.
 
void VuoWindowText_appendLine (VuoWindowText vw, const char *text)
 Appends text and a linebreak to the text edit widget in the window.
 
void VuoWindowText_close (VuoWindowText vw)
 Closes the window.
 
void VuoWindowOpenGl_destroy (VuoWindowOpenGl vw)
 Deallocates a VuoWindowOpenGl window.
 
VuoWindowOpenGl VuoWindowOpenGl_make (bool useDepthBuffer, void(*initCallback)(VuoGlContext glContext, float backingScaleFactor, void *), void(*updateBackingCallback)(VuoGlContext glContext, void *, float backingScaleFactor), void(*resizeCallback)(VuoGlContext glContext, void *, unsigned int, unsigned int), void(*drawCallback)(VuoGlContext glContext, void *), void *context)
 Creates and displays a window containing an OpenGL view.
 
void VuoWindowOpenGl_enableTriggers (VuoWindowOpenGl w, VuoOutputTrigger(showedWindow, VuoWindowReference), VuoOutputTrigger(requestedFrame, VuoReal))
 Sets up the window to call the trigger functions when events occur.
 
void VuoWindowOpenGl_disableTriggers (VuoWindowOpenGl w)
 Stops the window from calling trigger functions when events occur.
 
void VuoWindowOpenGl_redraw (VuoWindowOpenGl w)
 Schedules the specified window to be redrawn.
 
void VuoWindowOpenGl_setProperties (VuoWindowOpenGl w, VuoList_VuoWindowProperty properties)
 Applies a list of properties to a window.
 
void VuoWindowOpenGl_executeWithWindowContext (VuoWindowOpenGl w, void(^blockToExecute)(VuoGlContext glContext))
 Executes the specifed block on the window's OpenGL context, then returns.
 
void VuoWindowOpenGl_setAspectRatio (VuoWindowOpenGl w, unsigned int pixelsWide, unsigned int pixelsHigh)
 Sets the window's current and preferred aspect ratio.
 
void VuoWindowOpenGl_unlockAspectRatio (VuoWindowOpenGl w)
 Removes the aspect ratio constraint set by VuoWindowOpenGl_setAspectRatio.
 
void VuoWindowOpenGl_close (VuoWindowOpenGl vw)
 Closes the window.
 
void * VuoApp_setMenuItems (void *items)
 Replaces the top-level menus in the menu bar, except for application-wide menus, with the given menus.
 
void VuoApp_setMenu (void *menu)
 Replaces the top-level menus in the menu bar with the given menu.
 

Function Documentation

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).

void VuoApp_fini ( void  )

Cleanly shuts the application down.

Should only be called from within vuoStopComposition().

This function may be called from any thread.

static void VuoApp_finiWindows ( void  )
static

Helper for VuoApp_fini.

This function may only be called on the main thread.

void VuoApp_init ( void  )

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).

This function may be called from any thread.

static void VuoApp_initNSApplication ( void  )
static

Helper for VuoApp_init.

This function may only be called on the main thread.

Todo:
Have Vuo Editor activate the composition's process instead, using -[NSRunningApplication activateWithOptions:NSApplicationActivateAllWindows], so Vuo apps behave more like typical Mac apps when launched from, say, Finder or Terminal.
bool VuoApp_isMainThread ( void  )

Is the current thread the main thread?

void VuoApp_setMenu ( void *  menu)

Replaces the top-level menus in the menu bar with the given menu.

menu should be an NSMenu.

void* VuoApp_setMenuItems ( void *  items)

Replaces the top-level menus in the menu bar, except for application-wide menus, with the given menus.

items should be an NSArray of NSMenuItems.

Returns the old menu.

void VuoWindowOpenGl_close ( VuoWindowOpenGl  vw)

Closes the window.

This function may be called on any thread except the main thread.

void VuoWindowOpenGl_destroy ( VuoWindowOpenGl  vw)

Deallocates a VuoWindowOpenGl window.

This function may be called on any thread except the main thread.

void VuoWindowOpenGl_disableTriggers ( VuoWindowOpenGl  w)

Stops the window from calling trigger functions when events occur.

This function may be called on any thread except the main thread.

void VuoWindowOpenGl_enableTriggers ( VuoWindowOpenGl  w,
VuoOutputTrigger(showedWindow, VuoWindowReference ,
VuoOutputTrigger(requestedFrame, VuoReal  
)

Sets up the window to call the trigger functions when events occur.

This function may be called on any thread except the main thread.

void VuoWindowOpenGl_executeWithWindowContext ( VuoWindowOpenGl  w,
void(^)(VuoGlContext glContext)  blockToExecute 
)

Executes the specifed block on the window's OpenGL context, then returns.

Ensures that nobody else is using the OpenGL context at that time (by synchronizing with the window's drawQueue).

This function may be called from any thread.

VuoWindowOpenGl VuoWindowOpenGl_make ( bool  useDepthBuffer,
void(*)(VuoGlContext glContext, float backingScaleFactor, void *)  initCallback,
void(*)(VuoGlContext glContext, void *, float backingScaleFactor)  updateBackingCallback,
void(*)(VuoGlContext glContext, void *, unsigned int, unsigned int)  resizeCallback,
void(*)(VuoGlContext glContext, void *)  drawCallback,
void *  context 
)

Creates and displays a window containing an OpenGL view.

Creates a new NSApplication instance if one did not already exist.

This function may be called on any thread except the main thread.

void VuoWindowOpenGl_redraw ( VuoWindowOpenGl  w)

Schedules the specified window to be redrawn.

This function may be called from any thread.

void VuoWindowOpenGl_setAspectRatio ( VuoWindowOpenGl  w,
unsigned int  pixelsWide,
unsigned int  pixelsHigh 
)

Sets the window's current and preferred aspect ratio.

If necessary, the window is resized to match the specified aspect ratio. After calling this method, when the user resizes the window, its height is adjusted to match the specified aspect ratio.

void VuoWindowOpenGl_setProperties ( VuoWindowOpenGl  w,
VuoList_VuoWindowProperty  properties 
)

Applies a list of properties to a window.

This function may be called from any thread.

void VuoWindowOpenGl_unlockAspectRatio ( VuoWindowOpenGl  w)

Removes the aspect ratio constraint set by VuoWindowOpenGl_setAspectRatio.

After calling this method, the user will be able to resizes the window freely.

void VuoWindowText_appendLine ( VuoWindowText  vw,
const char *  text 
)

Appends text and a linebreak to the text edit widget in the window.

This function may be called from any thread.

void VuoWindowText_close ( VuoWindowText  vw)

Closes the window.

This function may be called on any thread except the main thread.

void VuoWindowText_destroy ( VuoWindowText  vw)

Deallocates the window.

This function may be called on any thread except the main thread.

void VuoWindowText_disableTriggers ( VuoWindowText  w)

Stops the window from calling trigger functions when its text is edited.

This function may be called on any thread except the main thread.

void VuoWindowText_enableTriggers ( VuoWindowText  w,
VuoOutputTrigger(typedLine, VuoText ,
VuoOutputTrigger(typedWord, VuoText ,
VuoOutputTrigger(typedCharacter, VuoText  
)

Sets up the window to call the trigger functions when its text is edited.

This function may be called on any thread except the main thread.

VuoWindowText VuoWindowText_make ( void  )

Creates and displays a window containing a text edit widget.

Creates a new NSApplication instance if one did not already exist.

This function may be called on any thread except the main thread.