Vuo  2.4.0
VuoUiTheme.cc
Go to the documentation of this file.
1
10#include "type.h"
11extern "C" {
12#include "VuoUiTheme.h"
13}
14
15#include "VuoUiThemeBase.hh"
16
18#ifdef VUO_COMPILER
19extern "C" {
21 "title" : "UI Theme",
22 "description" : "A visual style for UI widgets.",
23 "keywords" : [ ],
24 "version" : "1.0.0",
25 "dependencies" : [
26 "VuoRenderedLayers",
27 "VuoSerializable",
28 "VuoUiThemeGroup",
29 "VuoUiThemeButtonRounded",
30 "VuoUiThemeTextFieldRounded",
31 "VuoUiThemeToggleRounded",
32 "VuoUiThemeSliderRounded",
33 "VuoList_VuoUiTheme"
34 ]
35 });
36}
37#endif
39
44{
45 return reinterpret_cast<VuoUiTheme>(VuoSerializable::makeFromJson(js));
46}
47
52{
53 VuoSerializable *value = (VuoSerializable *)v;
54 return value != NULL ? value->getJson() : NULL;
55}
56
61{
62 VuoSerializable *value = (VuoSerializable *)v;
63 return value != NULL ? value->getSummary() : strdup("No theme");
64}
65
70{
71 if (!a || !b)
72 return !a && !b;
73
74 VuoSerializable *valueA = (VuoSerializable *)a;
75 VuoSerializable *valueB = (VuoSerializable *)b;
76 return *valueA == *valueB;
77}
78
83{
84 // Treat a null theme as greater than a non-null theme,
85 // so the more useful non-null theme sorts to the beginning of the list.
86 if (!a || !b)
87 return a && !b;
88
89 VuoSerializable *valueA = (VuoSerializable *)a;
90 VuoSerializable *valueB = (VuoSerializable *)b;
91 return *valueA < *valueB;
92}