Vuo  2.3.2
VuoOrientation.c
Go to the documentation of this file.
1 
10 #include <string.h>
11 #include "type.h"
12 
14 #ifdef VUO_COMPILER
16  "title" : "Orientation",
17  "description" : "Horizontal or vertical alignment.",
18  "keywords" : [ ],
19  "version" : "1.0.0",
20  "dependencies" : [
21  "VuoList_VuoOrientation"
22  ]
23  });
24 #endif
26 
34 {
35  const char *valueAsString = "";
36 
37  if (json_object_get_type(js) == json_type_string)
38  valueAsString = json_object_get_string(js);
39 
40  if (strcmp(valueAsString, "vertical") == 0)
41  return VuoOrientation_Vertical;
42 
43  return VuoOrientation_Horizontal;
44 }
45 
53 {
54  char *valueAsString = "horizontal";
55 
56  if (value == VuoOrientation_Vertical)
57  valueAsString = "vertical";
58 
59  return json_object_new_string(valueAsString);
60 }
61 
68 {
70  VuoListAppendValue_VuoOrientation(l, VuoOrientation_Horizontal);
71  VuoListAppendValue_VuoOrientation(l, VuoOrientation_Vertical);
72  return l;
73 }
74 
82 {
83  char *valueAsString = "Horizontal";
84 
85  if (value == VuoOrientation_Vertical)
86  valueAsString = "Vertical";
87 
88  return strdup(valueAsString);
89 }
90 
96 bool VuoOrientation_areEqual(const VuoOrientation valueA, const VuoOrientation valueB)
97 {
98  return valueA == valueB;
99 }
100 
107 {
108  return valueA < valueB;
109 }