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_TK_TK_H_
23 #define UI_TK_TK_H_
24 
25 #include <core/types.h>
26 #include <core/status.h>
27 #include <data/cvector.h>
28 #include <data/cstorage.h>
29 #include <core/LSPString.h>
30 #include <core/i18n/IDictionary.h>
31 
32 #include <ui/ws/ws.h>
33 
34 namespace lsp
35 {
36     namespace tk
37     {
38         /** Widget orientation
39          *
40          */
41         enum orientation_t
42         {
43             O_HORIZONTAL,       //!< O_HORIZONTAL horizontal orientation
44             O_VERTICAL          //!< O_VERTICAL vertical orientation
45         };
46 
47         enum scrolling_t
48         {
49             SCROLL_NONE,        //!< SCROLL_NONE no scrolling permitted
50             SCROLL_OPTIONAL,    //!< SCROLL_OPTIONAL scrolling is permitted but in optional state
51             SCROLL_ALWAYS       //!< SCROLL_ALWAYS scrolling is permitted but in optional state
52         };
53 
54         // List of colors
55         enum color_t
56         {
57             C_UNKNOWN = -1,
58 
59             C_BACKGROUND,
60             C_BACKGROUND2,
61             C_HOLE,
62             C_GLASS,
63 
64             C_RED,
65             C_GREEN,
66             C_BLUE,
67             C_YELLOW,
68             C_CYAN,
69             C_MAGENTA,
70             C_BLACK,
71             C_WHITE,
72 
73             C_LABEL_TEXT,
74             C_BUTTON_FACE,
75             C_BUTTON_TEXT,
76 
77             C_KNOB_CAP,
78             C_KNOB_SCALE,
79 
80             C_LOGO_FACE,
81             C_LOGO_TEXT,
82 
83             C_GRAPH_AXIS,
84             C_GRAPH_MESH,
85             C_GRAPH_MARKER,
86             C_GRAPH_TEXT,
87             C_GRAPH_LINE,
88             C_LEFT_CHANNEL,
89             C_RIGHT_CHANNEL,
90             C_MIDDLE_CHANNEL,
91             C_SIDE_CHANNEL,
92 
93             C_HLINK_TEXT,
94             C_HLINK_HOVER,
95 
96             C_STATUS_OK,
97             C_STATUS_WARN,
98             C_STATUS_ERROR,
99 
100             C_INVALID_INPUT
101         };
102 
103         /** List of available slots for event processing
104          *
105          */
106         enum ui_slot_t
107         {
108             LSPSLOT_FOCUS_IN,           //!< LSPSLOT_FOCUS_IN Triggered when element takes focus
109             LSPSLOT_FOCUS_OUT,          //!< LSPSLOT_FOCUS_IN Triggered when element loses focus
110             LSPSLOT_KEY_DOWN,           //!< LSPSLOT_KEY_DOWN Triggered on keyboard key press
111             LSPSLOT_KEY_UP,             //!< LSPSLOT_KEY_UP Triggered on keyboard key release
112             LSPSLOT_MOUSE_DOWN,         //!< LSPSLOT_MOUSE_DOWN Triggered on mouse button press
113             LSPSLOT_MOUSE_UP,           //!< LSPSLOT_MOUSE_UP Triggered on mouse button release
114             LSPSLOT_MOUSE_MOVE,         //!< LSPSLOT_MOUSE_MOVE Triggered on mouse pointer motion
115             LSPSLOT_MOUSE_SCROLL,       //!< LSPSLOT_MOUSE_SCROLL Triggered on mouse scroll event
116             LSPSLOT_MOUSE_CLICK,        //!< LSPSLOT_MOUSE_DBL_CLICK Triggered on mouse click
117             LSPSLOT_MOUSE_DBL_CLICK,    //!< LSPSLOT_MOUSE_DBL_CLICK Triggered on mouse double click
118             LSPSLOT_MOUSE_TRI_CLICK,    //!< LSPSLOT_MOUSE_TRI_CLICK Triggered on mouse triple click
119             LSPSLOT_MOUSE_IN,           //!< LSPSLOT_MOUSE_IN Triggered when mouse first entered widget's area
120             LSPSLOT_MOUSE_OUT,          //!< LSPSLOT_MOUSE_OUT Triggered when mouse left widget's area
121             LSPSLOT_SHOW,               //!< LSPSLOT_SHOW Triggered when widget becomes visible
122             LSPSLOT_HIDE,               //!< LSPSLOT_HIDE Triggered when widget becomes invisible
123             LSPSLOT_SUBMIT,             //!< LSPSLOT_SUBMIT Triggered when value(s) stored by the widget is submitted (but can be not changed)
124             LSPSLOT_CHANGE,             //!< LSPSLOT_CHANGE Triggered only when value(s) stored by the widget is(are) changed
125             LSPSLOT_DESTROY,            //!< LSPSLOT_DESTROY Triggered when widget associated with slot is destroyed
126             LSPSLOT_RESIZE,             //!< LSPSLOT_RESIZE Triggered when the geometry of widget has been changed
127             LSPSLOT_RESIZE_PARENT,      //!< LSPSLOT_RESIZE_PARENT Triggered when the parent widget has been resized
128             LSPSLOT_CLOSE,              //!< LSPSLOT_CLOSE Triggered when the window is requested to close
129             LSPSLOT_HSCROLL,            //!< LSPSLOT_HSCROLL Triggered when the horizontal scrolling is applied
130             LSPSLOT_VSCROLL,            //!< LSPSLOT_VSCROLL Triggered when the vertical scrolling is applied
131             LSPSLOT_ACTIVATE,           //!< LSPSLOT_ACTIVATE Triggered some user-interaction
132             LSPSLOT_DRAW3D,             //!< LSPSLOT_DRAW3D Triggered when a 3D-rendering is required
133             LSPSLOT_DRAG_REQUEST,       //!< LSPSLOT_DRAG_REQUEST Triggered when a drag request is pending on the widget
134             LSPSLOT_BEFORE_POPUP,       //!< LSPSLOT_BEFORE_POPUP Triggered before pop-up element is going to be shown
135             LSPSLOT_POPUP,              //!< LSPSLOT_POPUP Triggered after pop-up element has been shown
136         };
137 
138         typedef struct w_class_t
139         {
140             const char         *name;
141             const w_class_t    *parent;
142         } w_class_t;
143 
144         enum ui_property_type_t
145         {
146             PT_INT,         // Integer property
147             PT_FLOAT,       // Floating-point property
148             PT_BOOL,        // Boolean property
149             PT_STRING,      // String (text) property
150 
151             PT_UNKNOWN  = -1
152         };
153 
154         /**
155          * Atom identifier
156          */
157         typedef ssize_t             ui_atom_t;
158 
159         /** Get color name by it's identifier
160          *
161          * @param color color identifier
162          * @return color name
163          */
164         const char *color_name(color_t color);
165 
166         /** Get color identifier by it's name
167          *
168          * @param name color name
169          * @return color identifier
170          */
171         color_t color_id(const char *name);
172 
173         // Collaborate with ::lsp::ws namespace
174         using namespace ::lsp::ws;
175     }
176 }
177 
178 // System objects
179 #include <ui/tk/sys/LSPSlot.h>
180 #include <ui/tk/sys/LSPTimer.h>
181 #include <ui/tk/sys/LSPSlotSet.h>
182 #include <ui/tk/sys/LSPStyle.h>
183 #include <ui/tk/sys/LSPColor.h>
184 #include <ui/tk/sys/LSPLocalString.h>
185 #include <ui/tk/sys/LSPFloat.h>
186 #include <ui/tk/sys/LSPTheme.h>
187 #include <ui/tk/sys/LSPDisplay.h>
188 
189 // Utilitary objects
190 #include <ui/tk/util/LSPSurface.h>
191 #include <ui/tk/util/LSPFont.h>
192 #include <ui/tk/util/LSPPadding.h>
193 #include <ui/tk/util/LSPTextLines.h>
194 #include <ui/tk/util/LSPItem.h>
195 #include <ui/tk/util/LSPItemList.h>
196 #include <ui/tk/util/LSPItemSelection.h>
197 #include <ui/tk/util/LSPTextSelection.h>
198 #include <ui/tk/util/LSPTextCursor.h>
199 #include <ui/tk/util/LSPFileMask.h>
200 #include <ui/tk/util/LSPKeyboardHandler.h>
201 #include <ui/tk/util/LSPSizeConstraints.h>
202 #include <ui/tk/util/LSPWindowActions.h>
203 #include <ui/tk/util/LSPTextDataSource.h>
204 #include <ui/tk/util/LSPTextDataSink.h>
205 #include <ui/tk/util/LSPUrlSink.h>
206 #include <ui/tk/util/LSPFileFilterItem.h>
207 #include <ui/tk/util/LSPFileFilter.h>
208 #include <ui/tk/util/LSPStyleTrigger.h>
209 
210 // Widget basics
211 #include <ui/tk/basic/LSPWidget.h>
212 #include <ui/tk/basic/LSPComplexWidget.h>
213 #include <ui/tk/basic/LSPWidgetContainer.h>
214 
215 // Basic widgets
216 #include <ui/tk/widgets/LSPVoid.h>
217 #include <ui/tk/widgets/LSPWindow.h>
218 #include <ui/tk/widgets/LSPBox.h>
219 #include <ui/tk/widgets/LSPGrid.h>
220 #include <ui/tk/widgets/LSPMenuItem.h>
221 #include <ui/tk/widgets/LSPMenu.h>
222 #include <ui/tk/widgets/LSPButton.h>
223 #include <ui/tk/widgets/LSPSwitch.h>
224 #include <ui/tk/widgets/LSPLabel.h>
225 #include <ui/tk/widgets/LSPHyperlink.h>
226 #include <ui/tk/widgets/LSPIndicator.h>
227 #include <ui/tk/widgets/LSPSeparator.h>
228 #include <ui/tk/widgets/LSPLed.h>
229 #include <ui/tk/widgets/LSPKnob.h>
230 #include <ui/tk/widgets/LSPMeter.h>
231 #include <ui/tk/widgets/LSPAlign.h>
232 #include <ui/tk/widgets/LSPGroup.h>
233 #include <ui/tk/widgets/LSPScrollBar.h>
234 #include <ui/tk/widgets/LSPFader.h>
235 #include <ui/tk/widgets/LSPListBox.h>
236 #include <ui/tk/widgets/LSPComboBox.h>
237 #include <ui/tk/widgets/LSPEdit.h>
238 #include <ui/tk/widgets/LSPGraph.h>
239 #include <ui/tk/widgets/LSPComboGroup.h>
240 #include <ui/tk/widgets/LSPProgressBar.h>
241 #include <ui/tk/widgets/LSPAudioSample.h>
242 #include <ui/tk/widgets/LSPScrollBox.h>
243 
244 // Dialogs
245 #include <ui/tk/widgets/dialogs/LSPMessageBox.h>
246 #include <ui/tk/widgets/dialogs/LSPFileDialog.h>
247 
248 // Advanced widgets
249 #include <ui/tk/widgets/LSPAudioFile.h>
250 #include <ui/tk/widgets/LSPMountStud.h>
251 #include <ui/tk/widgets/LSPSaveFile.h>
252 #include <ui/tk/widgets/LSPLoadFile.h>
253 #include <ui/tk/widgets/LSPFraction.h>
254 
255 // Grapic widgets
256 #include <ui/tk/widgets/graph/LSPGraphItem.h>
257 #include <ui/tk/widgets/graph/LSPAxis.h>
258 #include <ui/tk/widgets/graph/LSPCenter.h>
259 #include <ui/tk/widgets/graph/LSPMarker.h>
260 #include <ui/tk/widgets/graph/LSPMesh.h>
261 #include <ui/tk/widgets/graph/LSPDot.h>
262 #include <ui/tk/widgets/graph/LSPText.h>
263 #include <ui/tk/widgets/graph/LSPFrameBuffer.h>
264 
265 // 3D rendering
266 #include <ui/tk/widgets/LSPArea3D.h>
267 #include <ui/tk/widgets/3d/LSPObject3D.h>
268 #include <ui/tk/widgets/3d/LSPCapture3D.h>
269 #include <ui/tk/widgets/3d/LSPMesh3D.h>
270 
271 
272 #endif /* UI_TK_TK_H_ */
273