Vuo  2.4.0
VuoIconPosition.c
Go to the documentation of this file.
1
10#include "type.h"
11#include "VuoIconPosition.h"
13
15#ifdef VUO_COMPILER
17 "title" : "Icon Position",
18 "description" : "The position of an icon image relative to its label",
19 "keywords" : [ ],
20 "version" : "1.0.0",
21 "dependencies" : [
22 "VuoList_VuoIconPosition"
23 ]
24 });
25#endif
27
36{
37 const char *valueAsString = "";
38 if (json_object_get_type(js) == json_type_string)
39 valueAsString = json_object_get_string(js);
40
41 VuoIconPosition value = VuoIconPosition_Left;
42
43 if (strcmp(valueAsString, "right") == 0)
44 value = VuoIconPosition_Right;
45 else if (strcmp(valueAsString, "above") == 0)
46 value = VuoIconPosition_Above;
47 else if (strcmp(valueAsString, "below") == 0)
48 value = VuoIconPosition_Below;
49 else if (strcmp(valueAsString, "behind") == 0)
50 value = VuoIconPosition_Behind;
51
52 return value;
53}
54
59{
60 char *valueAsString = "left";
61
62 if (value == VuoIconPosition_Right)
63 valueAsString = "right";
64 else if (value == VuoIconPosition_Above)
65 valueAsString = "above";
66 else if (value == VuoIconPosition_Below)
67 valueAsString = "below";
68 else if (value == VuoIconPosition_Behind)
69 valueAsString = "behind";
70
71 return json_object_new_string(valueAsString);
72}
73
78{
80 VuoListAppendValue_VuoIconPosition(l, VuoIconPosition_Left);
81 VuoListAppendValue_VuoIconPosition(l, VuoIconPosition_Right);
82 VuoListAppendValue_VuoIconPosition(l, VuoIconPosition_Above);
83 VuoListAppendValue_VuoIconPosition(l, VuoIconPosition_Below);
84 VuoListAppendValue_VuoIconPosition(l, VuoIconPosition_Behind);
85 return l;
86}
87
92{
93 char *valueAsString = "Left of label";
94
95 if (value == VuoIconPosition_Right)
96 valueAsString = "Right of label";
97 else if (value == VuoIconPosition_Above)
98 valueAsString = "Above label";
99 else if (value == VuoIconPosition_Below)
100 valueAsString = "Below label";
101 else if (value == VuoIconPosition_Behind)
102 valueAsString = "Behind label";
103
104 return strdup(valueAsString);
105}
106
111{
112 return value1 == value2;
113}
114
120{
121 return a < b;
122}