Vuo 2.4.4
Loading...
Searching...
No Matches
VuoInteraction.h
Go to the documentation of this file.
1
10#ifndef VuoInteraction_h
11#define VuoInteraction_h
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#include "VuoReal.h"
18#include "VuoText.h"
19#include "VuoPoint2d.h"
20#include "VuoUuid.h"
21#include "VuoInteractionType.h"
22#include "VuoBoolean.h"
23
37typedef struct
38{
39 VuoUuid uuid; // Globally unique identifier.
40 VuoPoint2d position; // The x,y coordinates of this input relative to a window.
41 bool isPressed; // Set true when this input device is in a "down" state - ex, mouse is depressed, or leap motion finger is past the z input wall.
42 VuoInteractionType type; // What kind of interaction is this.
43 VuoPoint2d origin; // The position at the time of the last onPressed event.
44 double timestamp; // The timestamp that the last onPressed event was fired.
45 VuoInteger clickCount; // The number of successive clicks with double-click timing.
47
48#define VuoInteraction_SUPPORTS_COMPARISON
50
51VuoInteraction VuoInteraction_makeFromJson(struct json_object * js);
52struct json_object * VuoInteraction_getJson(const VuoInteraction value);
54
55bool VuoInteraction_update(const VuoPoint2d position, const VuoBoolean isPressed, VuoInteraction *interaction) VuoWarnUnusedResult;
56
60static inline VuoInteraction VuoInteraction_make(void) __attribute__((const));
62{
64
65 i.uuid = VuoUuid_make();
66 i.position = VuoPoint2d_make(0,0);
67 i.isPressed = false;
68 i.type = VuoInteractionType_None;
69 i.origin = VuoPoint2d_make(0,0);
70 i.timestamp = -1;
71 i.clickCount = 0;
72
73 return i;
74}
75
78
80
87
92#ifdef __cplusplus
93}
94#endif
95
96#endif