Vuo  2.3.2
VuoHorizontalAlignment.c
Go to the documentation of this file.
1 
10 #include <stdio.h>
11 #include <string.h>
12 #include "type.h"
13 
15 #ifdef VUO_COMPILER
17  "title" : "Horizontal Alignment",
18  "description" : "Horizontal alignment.",
19  "keywords" : [ ],
20  "version" : "1.0.0",
21  "dependencies" : [
22  "VuoList_VuoHorizontalAlignment"
23  ]
24  });
25 #endif
27 
33 {
34  const char *valueAsString = "";
35  if (json_object_get_type(js) == json_type_string)
36  valueAsString = json_object_get_string(js);
37 
38  if (strcmp(valueAsString, "center") == 0)
39  return VuoHorizontalAlignment_Center;
40  else if (strcmp(valueAsString, "right") == 0)
41  return VuoHorizontalAlignment_Right;
42 
43  return VuoHorizontalAlignment_Left;
44 }
45 
51 {
52  char *valueAsString = "left";
53 
54  if (value == VuoHorizontalAlignment_Center)
55  valueAsString = "center";
56  else if (value == VuoHorizontalAlignment_Right)
57  valueAsString = "right";
58 
59  return json_object_new_string(valueAsString);
60 }
61 
66 {
68  VuoListAppendValue_VuoHorizontalAlignment(l, VuoHorizontalAlignment_Left);
69  VuoListAppendValue_VuoHorizontalAlignment(l, VuoHorizontalAlignment_Center);
70  VuoListAppendValue_VuoHorizontalAlignment(l, VuoHorizontalAlignment_Right);
71  return l;
72 }
73 
79 {
80  char *valueAsString = "Left";
81 
82  if (value == VuoHorizontalAlignment_Center)
83  valueAsString = "Center";
84  else if (value == VuoHorizontalAlignment_Right)
85  valueAsString = "Right";
86 
87  return strdup(valueAsString);
88 }
89 
94 {
95  return valueA == valueB;
96 }
97 
102 {
103  return valueA < valueB;
104 }