Euphoria
gui.cc
Go to the documentation of this file.
1 #include "files/gui.h"
2 
3 #include "io/json.h"
4 
5 
6 namespace eu::files::gui
7 {
20 
21 
23  {
25 
26  JSON_ENUM_VAL(linear);
27  JSON_ENUM_VAL(smooth_start2); JSON_ENUM_VAL(smooth_start3); JSON_ENUM_VAL(smooth_start4);
28  JSON_ENUM_VAL(smooth_stop2); JSON_ENUM_VAL(smooth_stop3); JSON_ENUM_VAL(smooth_stop4);
29  JSON_ENUM_VAL(smooth_step2); JSON_ENUM_VAL(smooth_step3); JSON_ENUM_VAL(smooth_step4);
30 
31  JSON_END_ENUM();
32  }
33 
34 
36  {
38 
39  JSON_OPT_VAL(String, skin);
40  JSON_VAL(String, text);
41  JSON_VAL(String, command);
42 
44  }
45 
46 
48  {
50 
51  JSON_VAL(Number, left);
52  JSON_VAL(Number, right);
53  JSON_VAL(Number, top);
54  JSON_VAL(Number, bottom);
55 
57  }
58 
59 
61  {
63 
64  JSON_ARRAY_PROP(Bool, expanded_cols);
65  JSON_ARRAY_PROP(Bool, expanded_rows);
66  JSON_VAL(Number, padding);
67 
69  }
70 
71 
73  {
75 
76  JSON_VAL(Number, padding);
77 
79  }
80 
81 
83  {
85 
87  JSON_VAL_OPT_OBJ(SingleRowLayout, single_row);
88 
90  }
91 
92 
94  {
96 
97  JSON_VAL_OBJ(Layout, layout);
98  JSON_ARRAY(Widget, widgets);
99 
100  JSON_END_OBJECT();
101  }
102 
103 
105  {
107 
108  JSON_VAL(String, name);
109  JSON_VAL(Int, column);
110  JSON_VAL(Int, row);
111  JSON_VAL(Number, preferred_width);
112  JSON_VAL(Number, preferred_height);
113  JSON_VAL_OBJ(Lrtb, margin);
114  JSON_VAL_OBJ(Lrtb, padding);
115 
116  JSON_VAL_OPT_OBJ(Button, button);
117  JSON_VAL_OPT_OBJ_CON(Panel, panel, std::make_unique<Panel>);
118 
119  JSON_END_OBJECT();
120  }
121 
122 
124  {
126 
127  JSON_VAL_OBJ(LayoutContainer, container);
128 
129  JSON_END_OBJECT();
130  }
131 
132 
134  {
136 
137  JSON_OPT_VAL(Number, r);
138  JSON_OPT_VAL(Number, g);
139  JSON_OPT_VAL(Number, b);
140 
141  JSON_END_OBJECT();
142  }
143 
144 
146  {
148 
149  JSON_OPT_VAL(Number, scale);
150  JSON_VAL_OBJ(Rgb, image_color);
151  JSON_VAL_OBJ(Rgb, text_color);
152  JSON_VAL(Number, dx);
153  JSON_VAL(Number, dy);
154 
155  JSON_VAL_OPT_OBJ(InterpolationType, interpolate_position);
156  JSON_OPT_VAL(Number, interpolate_position_time);
157 
158  JSON_VAL_OPT_OBJ(InterpolationType, interpolate_color);
159  JSON_OPT_VAL(Number, interpolate_color_time);
160 
161  JSON_VAL_OPT_OBJ(InterpolationType, interpolate_size);
162  JSON_OPT_VAL(Number, interpolate_size_time);
163 
164  JSON_END_OBJECT();
165  }
166 
167 
169  {
171 
172  JSON_OPT_VAL(String, name);
173  JSON_VAL(String, font);
174  JSON_OPT_VAL(Number, text_size);
175  JSON_VAL(String, button_image);
176 
177  JSON_VAL_OBJ(ButtonState, button_idle);
178  JSON_VAL_OBJ(ButtonState, button_hot);
179  JSON_VAL_OBJ(ButtonState, button_active_hot);
180 
181  JSON_END_OBJECT();
182  }
183 
184 
186  {
188 
189  JSON_VAL(String, cursor_image);
190  JSON_VAL(String, hover_image);
191  JSON_ARRAY(Skin, skins);
193 
194  JSON_END_OBJECT();
195  }
196 }
197 
#define JSON_VAL_OPT_OBJ(TYPE, PROP)
Definition: json.h:125
#define JSON_END_ENUM()
Definition: json.h:80
#define JSON_BEGIN_ENUM(TYPE)
Definition: json.h:65
#define JSON_BEGIN_OBJECT()
Definition: json.h:86
#define JSON_VAL_OBJ(TYPE, PROP)
Definition: json.h:124
#define JSON_VAL(TYPE, PROP)
Definition: json.h:128
#define JSON_END_OBJECT()
Definition: json.h:166
#define JSON_ENUM_VAL(VAL)
Definition: json.h:72
#define JSON_ARRAY(TYPE, PROP)
Definition: json.h:132
#define JSON_VAL_OPT_OBJ_CON(TYPE, PROP, CON)
Definition: json.h:126
#define JSON_OPT_VAL(TYPE, PROP)
Definition: json.h:129
#define JSON_ARRAY_PROP(TYPE, PROP)
Definition: json.h:163
InterpolationType
Definition: gui.h:8
JSON_PARSE_FUNC(Button)
Definition: gui.cc:35