Vuo  0.8.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
VuoMouse.m File Reference

Description

VuoMouse implementation.

Classes

struct  VuoMouseContext
 Handle for starting and stopping event listeners. More...
 

Functions

VuoMouseVuoMouse_make (void)
 Creates a handle for starting and stopping event listeners.
 
static VuoPoint2d VuoMouse_convertWindowToScreenCoordinates (NSPoint pointInWindow, NSWindow *window)
 Converts a position relative to the window into a position relative to the current screen.
 
static VuoPoint2d VuoMouse_convertViewToVuoCoordinates (NSPoint pointInView, NSView *view)
 Converts a position relative to a view and in view coordinates into a position in Vuo coordinates.
 
static VuoPoint2d VuoMouse_convertFullScreenToVuoCoordinates (NSPoint pointInScreen, NSWindow *window, bool *isInScreen)
 Converts a position in screen coordinates into a position relative to the the window's fullscreen view and in Vuo coordinates.
 
static VuoPoint2d VuoMouse_convertWindowToVuoCoordinates (NSPoint pointInWindow, NSWindow *window)
 Converts a position relative to the window and in window coordinates into a position relative to the window's content view and in Vuo coordinates.
 
static VuoPoint2d VuoMouse_convertDeltaToVuoCoordinates (NSPoint delta, NSWindow *window)
 Converts a change in position in window coordinates into a change in position in Vuo coordinates.
 
static void VuoMouse_fireScrollDeltaIfNeeded (NSEvent *event, VuoModifierKey modifierKey, void(*scrolled)(VuoPoint2d))
 If the mouse was scrolled a non-zero amount, calls the trigger function and passes it the scroll delta.
 
static void VuoMouse_fireMousePositionIfNeeded (NSEvent *event, VuoWindowReference windowRef, VuoModifierKey modifierKey, void(^fire)(VuoPoint2d))
 If the mouse event is not ignored, calls the block and passes it the mouse position.
 
static void VuoMouse_fireMouseDeltaIfNeeded (NSEvent *event, VuoWindowReference windowRef, VuoModifierKey modifierKey, void(*fire)(VuoPoint2d))
 If the mouse event is not ignored, calls the trigger function and passes it the mouse delta (change in position).
 
static void VuoMouse_fireMouseClickIfNeeded (struct VuoMouseContext *context, NSEvent *event, VuoWindowReference windowRef, VuoModifierKey modifierKey, void(*singleClicked)(VuoPoint2d), void(*doubleClicked)(VuoPoint2d), void(*tripleClicked)(VuoPoint2d))
 If the mouse click event is not ignored, calls the trigger function and passes it the mouse position.
 
void VuoMouse_startListeningForScrolls (VuoMouse *mouseListener, void(*scrolled)(VuoPoint2d), VuoModifierKey modifierKey)
 Starts listening for scroll events, and calling the trigger function for each one.
 
void VuoMouse_startListeningForMoves (VuoMouse *mouseListener, void(*movedTo)(VuoPoint2d), VuoWindowReference window, VuoModifierKey modifierKey)
 Starts listening for mouse move events, and calling the trigger function (with mouse position) for each one,.
 
void VuoMouse_startListeningForDeltas (VuoMouse *mouseListener, void(*movedBy)(VuoPoint2d), VuoWindowReference window, VuoModifierKey modifierKey)
 Starts listening for mouse move events, and calling the trigger function (with change in mouse position) for each one.
 
void VuoMouse_startListeningForDragsWithCallback (VuoMouse *mouseListener, void(^dragMovedTo)(VuoPoint2d), VuoMouseButton button, VuoWindowReference window, VuoModifierKey modifierKey)
 Starts listening for mouse drag events, and calling the given block for each one.
 
void VuoMouse_startListeningForDrags (VuoMouse *mouseListener, void(*dragMovedTo)(VuoPoint2d), VuoMouseButton button, VuoWindowReference window, VuoModifierKey modifierKey)
 Starts listening for mouse drag events, and calling the trigger function for each one.
 
void VuoMouse_startListeningForPressesWithCallback (VuoMouse *mouseListener, void(^pressed)(VuoPoint2d), VuoMouseButton button, VuoWindowReference window, VuoModifierKey modifierKey)
 Starts listening for mouse press events, and calling the given block for each one.
 
void VuoMouse_startListeningForPresses (VuoMouse *mouseListener, void(*pressed)(VuoPoint2d), VuoMouseButton button, VuoWindowReference window, VuoModifierKey modifierKey)
 Starts listening for mouse press events, and calling the trigger function for each one.
 
void VuoMouse_startListeningForReleasesWithCallback (VuoMouse *mouseListener, void(^released)(VuoPoint2d), VuoMouseButton button, VuoWindowReference window, VuoModifierKey modifierKey)
 Starts listening for mouse release events, and calling the given block for each one.
 
void VuoMouse_startListeningForReleases (VuoMouse *mouseListener, void(*released)(VuoPoint2d), VuoMouseButton button, VuoWindowReference window, VuoModifierKey modifierKey)
 Starts listening for mouse release events, and calling the trigger function for each one.
 
void VuoMouse_startListeningForClicks (VuoMouse *mouseListener, void(*singleClicked)(VuoPoint2d), void(*doubleClicked)(VuoPoint2d), void(*tripleClicked)(VuoPoint2d), VuoMouseButton button, VuoWindowReference window, VuoModifierKey modifierKey)
 Starts listening for mouse click events, and calling the trigger function for each one.
 
void VuoMouse_stopListening (VuoMouse *mouseListener)
 Stops listening for mouse events for the given handle.
 
VuoPoint2d VuoMouse_getPosition (VuoWindowReference windowRef)
 Returns the current mouse position.
 
VuoBoolean VuoMouse_isPressed (VuoMouseButton button, VuoModifierKey modifierKey)
 Returns true if the given mouse button is currently pressed.
 

Function Documentation

static VuoPoint2d VuoMouse_convertDeltaToVuoCoordinates ( NSPoint  delta,
NSWindow *  window 
)
static

Converts a change in position in window coordinates into a change in position in Vuo coordinates.

static VuoPoint2d VuoMouse_convertFullScreenToVuoCoordinates ( NSPoint  pointInScreen,
NSWindow *  window,
bool *  isInScreen 
)
static

Converts a position in screen coordinates into a position relative to the the window's fullscreen view and in Vuo coordinates.

static VuoPoint2d VuoMouse_convertViewToVuoCoordinates ( NSPoint  pointInView,
NSView *  view 
)
static

Converts a position relative to a view and in view coordinates into a position in Vuo coordinates.

static VuoPoint2d VuoMouse_convertWindowToScreenCoordinates ( NSPoint  pointInWindow,
NSWindow *  window 
)
static

Converts a position relative to the window into a position relative to the current screen.

static VuoPoint2d VuoMouse_convertWindowToVuoCoordinates ( NSPoint  pointInWindow,
NSWindow *  window 
)
static

Converts a position relative to the window and in window coordinates into a position relative to the window's content view and in Vuo coordinates.

static void VuoMouse_fireMouseClickIfNeeded ( struct VuoMouseContext context,
NSEvent *  event,
VuoWindowReference  windowRef,
VuoModifierKey  modifierKey,
void(*)(VuoPoint2d singleClicked,
void(*)(VuoPoint2d doubleClicked,
void(*)(VuoPoint2d tripleClicked 
)
static

If the mouse click event is not ignored, calls the trigger function and passes it the mouse position.

If a window is given, the mouse position is in Vuo coordinates relative to the window's content view. The mouse event is ignored if it doesn't correspond to this window.

If no window is given, the mouse position is in screen coordinates.

static void VuoMouse_fireMouseDeltaIfNeeded ( NSEvent *  event,
VuoWindowReference  windowRef,
VuoModifierKey  modifierKey,
void(*)(VuoPoint2d fire 
)
static

If the mouse event is not ignored, calls the trigger function and passes it the mouse delta (change in position).

If a window is given, the mouse delta is in Vuo coordinates relative to the window's content view. The mouse event is ignored if it doesn't correspond to this window.

If no window is given, the mouse delta is in screen coordinates.

static void VuoMouse_fireMousePositionIfNeeded ( NSEvent *  event,
VuoWindowReference  windowRef,
VuoModifierKey  modifierKey,
void(^)(VuoPoint2d fire 
)
static

If the mouse event is not ignored, calls the block and passes it the mouse position.

If a window is given, the mouse position is in Vuo coordinates relative to the window's content view. The mouse event is ignored if it doesn't correspond to this window.

If no window is given, the mouse position is in screen coordinates.

static void VuoMouse_fireScrollDeltaIfNeeded ( NSEvent *  event,
VuoModifierKey  modifierKey,
void(*)(VuoPoint2d scrolled 
)
static

If the mouse was scrolled a non-zero amount, calls the trigger function and passes it the scroll delta.

VuoPoint2d VuoMouse_getPosition ( VuoWindowReference  windowRef)

Returns the current mouse position.

VuoBoolean VuoMouse_isPressed ( VuoMouseButton  button,
VuoModifierKey  modifierKey 
)

Returns true if the given mouse button is currently pressed.

VuoMouse* VuoMouse_make ( void  )

Creates a handle for starting and stopping event listeners.

void VuoMouse_startListeningForClicks ( VuoMouse mouseListener,
void(*)(VuoPoint2d singleClicked,
void(*)(VuoPoint2d doubleClicked,
void(*)(VuoPoint2d tripleClicked,
VuoMouseButton  button,
VuoWindowReference  window,
VuoModifierKey  modifierKey 
)

Starts listening for mouse click events, and calling the trigger function for each one.

void VuoMouse_startListeningForDeltas ( VuoMouse mouseListener,
void(*)(VuoPoint2d movedBy,
VuoWindowReference  window,
VuoModifierKey  modifierKey 
)

Starts listening for mouse move events, and calling the trigger function (with change in mouse position) for each one.

void VuoMouse_startListeningForDrags ( VuoMouse mouseListener,
void(*)(VuoPoint2d dragMovedTo,
VuoMouseButton  button,
VuoWindowReference  window,
VuoModifierKey  modifierKey 
)

Starts listening for mouse drag events, and calling the trigger function for each one.

void VuoMouse_startListeningForDragsWithCallback ( VuoMouse mouseListener,
void(^)(VuoPoint2d dragMovedTo,
VuoMouseButton  button,
VuoWindowReference  window,
VuoModifierKey  modifierKey 
)

Starts listening for mouse drag events, and calling the given block for each one.

void VuoMouse_startListeningForMoves ( VuoMouse mouseListener,
void(*)(VuoPoint2d movedTo,
VuoWindowReference  window,
VuoModifierKey  modifierKey 
)

Starts listening for mouse move events, and calling the trigger function (with mouse position) for each one,.

void VuoMouse_startListeningForPresses ( VuoMouse mouseListener,
void(*)(VuoPoint2d pressed,
VuoMouseButton  button,
VuoWindowReference  window,
VuoModifierKey  modifierKey 
)

Starts listening for mouse press events, and calling the trigger function for each one.

void VuoMouse_startListeningForPressesWithCallback ( VuoMouse mouseListener,
void(^)(VuoPoint2d pressed,
VuoMouseButton  button,
VuoWindowReference  window,
VuoModifierKey  modifierKey 
)

Starts listening for mouse press events, and calling the given block for each one.

void VuoMouse_startListeningForReleases ( VuoMouse mouseListener,
void(*)(VuoPoint2d released,
VuoMouseButton  button,
VuoWindowReference  window,
VuoModifierKey  modifierKey 
)

Starts listening for mouse release events, and calling the trigger function for each one.

void VuoMouse_startListeningForReleasesWithCallback ( VuoMouse mouseListener,
void(^)(VuoPoint2d released,
VuoMouseButton  button,
VuoWindowReference  window,
VuoModifierKey  modifierKey 
)

Starts listening for mouse release events, and calling the given block for each one.

void VuoMouse_startListeningForScrolls ( VuoMouse mouseListener,
void(*)(VuoPoint2d scrolled,
VuoModifierKey  modifierKey 
)

Starts listening for scroll events, and calling the trigger function for each one.

void VuoMouse_stopListening ( VuoMouse mouseListener)

Stops listening for mouse events for the given handle.