Vuo 2.4.4
Loading...
Searching...
No Matches
VuoDragEvent.c
Go to the documentation of this file.
1
10#include "VuoDragEvent.h"
11
13#ifdef VUO_COMPILER
15 "title" : "Drag Event",
16 "description" : "Information about an in-progress or completed file drag.",
17 "keywords" : [ ],
18 "version" : "1.0.0",
19 "dependencies" : [
20 "VuoPoint2d",
21 "VuoUrl",
22 "VuoList_VuoUrl"
23 ]
24 });
25#endif
27
39{
40 return (VuoDragEvent){
41 VuoJson_getObjectValue(VuoPoint2d, js, "position", (VuoPoint2d){0,0}),
42 VuoJson_getObjectValue(VuoList_VuoUrl, js, "urls", NULL),
43 };
44}
45
49json_object * VuoDragEvent_getJson(const VuoDragEvent value)
50{
51 json_object *js = json_object_new_object();
52
53 json_object_object_add(js, "position", VuoPoint2d_getJson(value.position));
54
55 if (value.urls)
56 json_object_object_add(js, "urls", VuoList_VuoUrl_getJson(value.urls));
57
58 return js;
59}
60
65{
66 char *listSummary = VuoList_VuoUrl_getSummary(value.urls);
67 char *summary = VuoText_format("%g,%g<br>%s", value.position.x, value.position.y, listSummary);
68 free(listSummary);
69 return summary;
70}
71
75VuoDragEvent VuoDragEvent_make(const VuoPoint2d position, const VuoList_VuoUrl urls)
76{
77 return (VuoDragEvent){position, urls};
78}
79
86bool VuoDragEvent_areEqual(const VuoDragEvent value1, const VuoDragEvent value2)
87{
88 if (!VuoPoint2d_areEqual(value1.position, value2.position))
89 return false;
90
91 if (!VuoList_VuoUrl_areEqual(value1.urls, value2.urls))
92 return false;
93
94 return true;
95}
96
101{
102 VuoType_returnInequality(VuoPoint2d, a.position, b.position);
104 return false;
105}
106
112{
113 VuoRetain(value.urls);
114}
115
121{
122 VuoRelease(value.urls);
123}