Vuo  2.4.0
VuoVerticalAlignment.c
Go to the documentation of this file.
1
10#include <string.h>
11#include "type.h"
12
14#ifdef VUO_COMPILER
16 "title" : "Vertical Alignment",
17 "description" : "Vertical alignment.",
18 "keywords" : [ ],
19 "version" : "1.0.0",
20 "dependencies" : [
21 "VuoList_VuoVerticalAlignment"
22 ]
23 });
24#endif
26
38{
39 const char *valueAsString = "";
40 if (json_object_get_type(js) == json_type_string)
41 valueAsString = json_object_get_string(js);
42
43 if (strcmp(valueAsString, "center") == 0)
44 return VuoVerticalAlignment_Center;
45 else if (strcmp(valueAsString, "bottom") == 0)
46 return VuoVerticalAlignment_Bottom;
47
48 return VuoVerticalAlignment_Top;
49}
50
56{
57 char *valueAsString = "top";
58
59 if (value == VuoVerticalAlignment_Center)
60 valueAsString = "center";
61 else if (value == VuoVerticalAlignment_Bottom)
62 valueAsString = "bottom";
63
64 return json_object_new_string(valueAsString);
65}
66
71{
73 VuoListAppendValue_VuoVerticalAlignment(l, VuoVerticalAlignment_Top);
74 VuoListAppendValue_VuoVerticalAlignment(l, VuoVerticalAlignment_Center);
75 VuoListAppendValue_VuoVerticalAlignment(l, VuoVerticalAlignment_Bottom);
76 return l;
77}
78
84{
85 char *valueAsString = "Top";
86
87 if (value == VuoVerticalAlignment_Center)
88 valueAsString = "Center";
89 else if (value == VuoVerticalAlignment_Bottom)
90 valueAsString = "Bottom";
91
92 return strdup(valueAsString);
93}
94
99{
100 return valueA == valueB;
101}
102
107{
108 return valueA < valueB;
109}