1 /*
2  * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3  *           (C) 2020 Vladimir Sadovnikov <sadko4u@gmail.com>
4  *
5  * This file is part of lsp-plugins
6  * Created on: 15 июн. 2017 г.
7  *
8  * lsp-plugins is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * any later version.
12  *
13  * lsp-plugins is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public License
19  * along with lsp-plugins. If not, see <https://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef UI_CTL_CTL_H_
23 #define UI_CTL_CTL_H_
24 
25 #include <core/types.h>
26 
27 #include <locale.h>
28 #include <ctype.h>
29 #include <errno.h>
30 #include <stdlib.h>
31 
32 #include <metadata/metadata.h>
33 #include <data/cvector.h>
34 
35 #include <ui/tk/tk.h>
36 
37 namespace lsp
38 {
39     namespace ctl
40     {
41         using namespace lsp::tk;
42 
43         enum widget_ctl_t
44         {
45             WC_UNKNOWN = -1,
46 
47             WC_ALIGN,
48             WC_AXIS,
49             WC_BODY,
50             WC_BOX,
51             WC_BUTTON,
52             WC_CAPTURE3D,
53             WC_CELL,
54             WC_CENTER,
55             WC_CGROUP,
56             WC_COMBO,
57             WC_DOT,
58             WC_EDIT,
59             WC_FADER,
60             WC_FBUFFER,
61             WC_FILE,
62             WC_FRAC,
63             WC_GRAPH,
64             WC_GRID,
65             WC_GROUP,
66             WC_HBOX,
67             WC_HGRID,
68             WC_HLINK,
69             WC_HSBAR,
70             WC_HSBOX,
71             WC_HSEP,
72             WC_INDICATOR,
73             WC_KNOB,
74             WC_LABEL,
75             WC_LED,
76             WC_LISTBOX,
77             WC_LOAD,
78             WC_MARKER,
79             WC_MESH,
80             WC_METER,
81             WC_MIDINOTE,
82             WC_MSTUD,
83             WC_PARAM,
84             WC_PLUGIN,
85             WC_PORT,
86             WC_PROGRESS,
87             WC_SAMPLE,
88             WC_SAVE,
89             WC_SBAR,
90             WC_SBOX,
91             WC_SEP,
92             WC_SOURCE3D,
93             WC_STATUS,
94             WC_STREAM,
95             WC_SWITCH,
96             WC_TEXT,
97             WC_THREADCOMBO,
98             WC_TTAP,
99             WC_VALUE,
100             WC_VBOX,
101             WC_VGRID,
102             WC_VIEWER3D,
103             WC_VOID,
104             WC_VSBAR,
105             WC_VSBOX,
106             WC_VSEP,
107             WC_WINDOW
108         };
109 
110         // List of all available widget attributes
111         enum widget_attribute_t
112         {
113             A_UNKNOWN = -1,
114 
115             A_ACTIVITY,
116             A_ACTIVITY2,
117             A_ACTIVITY2_ID,
118             A_ACTIVITY_ID,
119             A_ANGLE,
120             A_ANGLE_ID,
121             A_ASPECT,
122             A_BALANCE,
123             A_BASIS,
124             A_BG_COLOR,
125             A_BIND,
126             A_BORDER,
127             A_BORDER_COLOR,
128             A_BRIGHT,
129             A_CENTER,
130             A_COLOR,
131             A_COLOR2,
132             A_COLS,
133             A_COMMAND_ID,
134             A_COORD,
135             A_CURVATURE_ID,
136             A_CYCLE,
137             A_DEFAULT,
138             A_DETAILED,
139             A_DISTANCE_ID,
140             A_DURATION_ID,
141             A_DX,
142             A_DY,
143             A_EDITABLE,
144             A_EMBED,
145             A_EXPAND,
146             A_FADEIN_ID,
147             A_FADEOUT_ID,
148             A_FILL,
149             A_FONT_SIZE,
150             A_FORMAT,
151             A_FORMAT_ID,
152             A_FOV,
153             A_HALIGN,
154             A_HEAD_ID,
155             A_HEIGHT,
156             A_HEIGHT_ID,
157             A_HFILL,
158             A_HORIZONTAL,
159             A_HPOS,
160             A_HPOS_ID,
161             A_HSCALE,
162             A_HSCROLL,
163             A_HSPACING,
164             A_HUE2_ID,
165             A_HUE_ID,
166             A_HUE_SHIFT,
167             A_ID,
168             A_ID2,
169             A_INVERT,
170             A_KEY,
171             A_KVT_ROOT,
172             A_LED,
173             A_LENGTH,
174             A_LENGTH_ID,
175             A_LIGHT2_ID,
176             A_LIGHT_ID,
177             A_LOGARITHMIC,
178             A_MAX,
179             A_MAX_DOTS,
180             A_MAX_DURATION_ID,
181             A_MAX_HEIGHT,
182             A_MAX_WIDTH,
183             A_MESH_ID,
184             A_MIN,
185             A_MIN_HEIGHT,
186             A_MIN_WIDTH,
187             A_MODE,
188             A_MODE_ID,
189             A_NOTE_ID,
190             A_OCTAVE_ID,
191             A_OFFSET,
192             A_OPACITY,
193             A_ORIENTATION_ID,
194             A_PAD_BOTTOM,
195             A_PAD_LEFT,
196             A_PAD_RIGHT,
197             A_PAD_TOP,
198             A_PADDING,
199             A_PARALLEL,
200             A_PATH_ID,
201             A_PITCH_ID,
202             A_PRECISION,
203             A_PROGRESS_ID,
204             A_PROPORTIONAL,
205             A_RADIUS,
206             A_RADIUS_ID,
207             A_READ_ONLY,
208             A_RESIZABLE,
209             A_REVERSIVE,
210             A_ROLL_ID,
211             A_ROWS,
212             A_S_INDEX,
213             A_SAME_LINE,
214             A_SAT2_ID,
215             A_SAT_ID,
216             A_SCALE_COLOR,
217             A_SCALE_HUE,
218             A_SCALE_HUE_ID,
219             A_SCALE_LIGHT_ID,
220             A_SCALE_SAT_ID,
221             A_SCROLL_ID,
222             A_SIZE,
223             A_SIZE_ID,
224             A_SMOOTH,
225             A_SPACING,
226             A_STATUS_ID,
227             A_STEP,
228             A_STEREO,
229             A_STROBE,
230             A_STROBES,
231             A_TAIL_ID,
232             A_TEXT,
233             A_TEXT_COLOR,
234             A_TINY_STEP,
235             A_TOGGLE,
236             A_TRANSPARENCY,
237             A_TRANSPOSE,
238             A_TYPE,
239             A_WUID,
240             A_UNITS,
241             A_URL,
242             A_VALIGN,
243             A_VALUE,
244             A_VERTICAL,
245             A_VFILL,
246             A_VISIBILITY,
247             A_VISIBILITY_ID,
248             A_VISIBILITY_KEY,
249             A_VISIBLE,
250             A_VPOS,
251             A_VPOS_ID,
252             A_VSCALE,
253             A_VSCROLL,
254             A_VSPACING,
255             A_WIDTH,
256             A_X_INDEX,
257             A_XPOS_ID,
258             A_XSCALE_ID,
259             A_Y_INDEX,
260             A_YAW_ID,
261             A_YPOS_ID,
262             A_YSCALE_ID,
263             A_ZPOS_ID,
264             A_ZSCALE_ID
265         };
266 
267         typedef struct ctl_class_t
268         {
269             const char         *name;
270             const ctl_class_t  *parent;
271         } ctl_class_t;
272 
273         // Helper functions
274         /** Decode widget type to enum
275          *
276          * @param name widget name
277          * @return widget type
278          */
279         widget_ctl_t widget_ctl(const char *name);
280 
281         /** Get widget tag name
282          *
283          * @param type widget type
284          * @return widget tag or NULL if not found
285          */
286         const char *widget_ctl(widget_ctl_t type);
287 
288         /** Decode widget attribute
289          *
290          * @param name widget name
291          * @return widget attribute
292          */
293         widget_attribute_t widget_attribute(const char *name);
294 
295         /**
296          * Get widget attribute name
297          * @param type attribute type
298          * @return attribute name or NULL if not found
299          */
300         const char *widget_attribute(widget_attribute_t type);
301 
302         /**
303          * Get widget scrolling
304          * @param value value representing scrolling
305          * @return scrolling type
306          */
307         scrolling_t widget_scroll(const char *value);
308     }
309 }
310 
311 // Core headers
312 #include <ui/ctl/CtlRegistry.h>
313 #include <ui/ctl/CtlPortListener.h>
314 #include <ui/ctl/CtlPortResolver.h>
315 #include <ui/ctl/CtlPort.h>
316 #include <ui/ctl/CtlExpression.h>
317 #include <ui/ctl/CtlColor.h>
318 #include <ui/ctl/CtlPadding.h>
319 #include <ui/ctl/CtlKvtListener.h>
320 
321 // Parsing header
322 #include <ui/ctl/parse.h>
323 
324 // Widget controllers
325 #include <ui/ctl/CtlWidget.h>
326 #include <ui/ctl/CtlVoid.h>
327 #include <ui/ctl/CtlPluginWindow.h>
328 #include <ui/ctl/CtlBox.h>
329 #include <ui/ctl/CtlScrollBox.h>
330 #include <ui/ctl/CtlGrid.h>
331 #include <ui/ctl/CtlButton.h>
332 #include <ui/ctl/CtlSwitch.h>
333 #include <ui/ctl/CtlLabel.h>
334 #include <ui/ctl/CtlHyperlink.h>
335 #include <ui/ctl/CtlIndicator.h>
336 #include <ui/ctl/CtlMidiNote.h>
337 #include <ui/ctl/CtlSeparator.h>
338 #include <ui/ctl/CtlLed.h>
339 #include <ui/ctl/CtlKnob.h>
340 #include <ui/ctl/CtlMeter.h>
341 #include <ui/ctl/CtlAlign.h>
342 #include <ui/ctl/CtlGroup.h>
343 #include <ui/ctl/CtlCell.h>
344 #include <ui/ctl/CtlScrollBar.h>
345 #include <ui/ctl/CtlFader.h>
346 #include <ui/ctl/CtlListBox.h>
347 #include <ui/ctl/CtlComboBox.h>
348 #include <ui/ctl/CtlEdit.h>
349 #include <ui/ctl/CtlAudioFile.h>
350 #include <ui/ctl/CtlSaveFile.h>
351 #include <ui/ctl/CtlLoadFile.h>
352 #include <ui/ctl/CtlComboGroup.h>
353 #include <ui/ctl/CtlProgressBar.h>
354 #include <ui/ctl/CtlAudioSample.h>
355 
356 #include <ui/ctl/CtlGraph.h>
357 #include <ui/ctl/CtlAxis.h>
358 #include <ui/ctl/CtlCenter.h>
359 #include <ui/ctl/CtlMarker.h>
360 #include <ui/ctl/CtlMesh.h>
361 #include <ui/ctl/CtlStream.h>
362 #include <ui/ctl/CtlDot.h>
363 #include <ui/ctl/CtlText.h>
364 #include <ui/ctl/CtlFrameBuffer.h>
365 
366 #include <ui/ctl/CtlFraction.h>
367 #include <ui/ctl/CtlTempoTap.h>
368 
369 #include <ui/ctl/CtlViewer3D.h>
370 #include <ui/ctl/CtlCapture3D.h>
371 #include <ui/ctl/CtlSource3D.h>
372 
373 // Specials
374 #include <ui/ctl/CtlPortAlias.h>
375 #include <ui/ctl/CtlSwitchedPort.h>
376 #include <ui/ctl/CtlControlPort.h>
377 #include <ui/ctl/CtlPathPort.h>
378 #include <ui/ctl/CtlValuePort.h>
379 #include <ui/ctl/CtlPortHandler.h>
380 #include <ui/ctl/CtlConfigSource.h>
381 #include <ui/ctl/CtlConfigHandler.h>
382 #include <ui/ctl/CtlThreadComboBox.h>
383 
384 #endif /* UI_CTL_CTL_H_ */
385