Vuo  2.4.0
VuoHorizontalSide.c
Go to the documentation of this file.
1
10#include "type.h"
11#include "VuoHorizontalSide.h"
13
15#ifdef VUO_COMPILER
17 "title" : "Horizontal Side",
18 "description" : "Direction on the horizontal axis (Right or Left).",
19 "keywords" : [ ],
20 "version" : "1.0.0",
21 "dependencies" : [
22 "VuoList_VuoHorizontalSide",
23 "VuoText"
24 ]
25 });
26#endif
28
35{
36 const char *valueAsString = "";
37 if (json_object_get_type(js) == json_type_string)
38 valueAsString = json_object_get_string(js);
39
40 VuoHorizontalSide value = VuoHorizontalSide_Left;
41
42 if (! strcmp(valueAsString, "right"))
43 value = VuoHorizontalSide_Right;
44
45 return value;
46}
47
52{
53 char *valueAsString = "";
54
55 switch (value)
56 {
57 case VuoHorizontalSide_Right:
58 valueAsString = "right";
59 break;
60 case VuoHorizontalSide_Left:
61 valueAsString = "left";
62 break;
63 }
64
65 return json_object_new_string(valueAsString);
66}
67
72{
74 VuoListAppendValue_VuoHorizontalSide(l, VuoHorizontalSide_Left);
75 VuoListAppendValue_VuoHorizontalSide(l, VuoHorizontalSide_Right);
76 return l;
77}
78
83{
84 if (value == VuoHorizontalSide_Left)
85 return VuoText_format("Left");
86 else
87 return VuoText_format("Right");
88
89}