VSF Documented
vsf_tgui_v_type.h
Go to the documentation of this file.
1/*****************************************************************************
2 * Copyright(C)2009-2022 by VSF Team *
3 * *
4 * Licensed under the Apache License, Version 2.0 (the "License"); *
5 * you may not use this file except in compliance with the License. *
6 * You may obtain a copy of the License at *
7 * *
8 * http://www.apache.org/licenses/LICENSE-2.0 *
9 * *
10 * Unless required by applicable law or agreed to in writing, software *
11 * distributed under the License is distributed on an "AS IS" BASIS, *
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13 * See the License for the specific language governing permissions and *
14 * limitations under the License. *
15 * *
16 ****************************************************************************/
17
18#ifndef __VSF_TINY_GUI_V_TMPLATE_TYPE_H__
19#define __VSF_TINY_GUI_V_TMPLATE_TYPE_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "../../vsf_tgui_cfg.h"
24
25#if VSF_USE_TINY_GUI == ENABLED \
26 && VSF_TGUI_CFG_RENDERING_TEMPLATE_SEL == VSF_TGUI_V_TEMPLATE_SCGUI_VIEW
27
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/*============================ MACROS ========================================*/
35
36// colors
37
38#define VSF_TGUI_COLOR_WHITE C_WHITE
39#define VSF_TGUI_COLOR_SILVER C_SILVER
40#define VSF_TGUI_COLOR_GRAY C_GRAY
41#define VSF_TGUI_COLOR_BLACK C_BLACK
42#define VSF_TGUI_COLOR_RED C_RED
43#define VSF_TGUI_COLOR_MAROON C_MAROON
44#define VSF_TGUI_COLOR_YELLOW C_YELLOW
45#define VSF_TGUI_COLOR_LIME C_LIME
46#define VSF_TGUI_COLOR_GREEN C_GREEN
47#define VSF_TGUI_COLOR_AQUA C_AQUA
48#define VSF_TGUI_COLOR_TEAL C_TEAL
49#define VSF_TGUI_COLOR_BLUE C_BLUE
50#define VSF_TGUI_COLOR_NAVY C_NAVY
51#define VSF_TGUI_COLOR_PURPLE C_PURPLE
52
53#define VSF_TGUI_COLOR_OLIVE C_OLIVER
54#define VSF_TGUI_COLOR_FUCHSIA C_FUCHSIA
55
56#define VSF_TGUI_COLOR_RGBA(__R, __G, __B, __A) ((vsf_tgui_v_color_t) ((((__R) & 0xF1) << 8) | (((__G) & 0xF3) << 3) | (((__B) & 0xF1) >> 3)) )
57#define VSF_TGUI_COLOR_RGB(__R, __G, __B) VSF_TGUI_COLOR_RGBA((__R), (__G), (__B), 0xFF)
58
59// configurations
60
61// control configurations
62
63#ifndef VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR
64# define VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR ENABLED
65#endif
66
67#ifndef VSF_TGUI_CFG_V_SUPPORT_BORDER
68# define VSF_TGUI_CFG_V_SUPPORT_BORDER ENABLED
69#endif
70#if VSF_TGUI_CFG_V_SUPPORT_BORDER == ENABLED
71# ifndef VSF_TGUI_CFG_V_SUPPORT_ROUND_BORDER
72# define VSF_TGUI_CFG_V_SUPPORT_ROUND_BORDER ENABLED
73# endif
74#endif
75#ifndef VSF_TGUI_CFG_V_BORDER_COLOR
76# define VSF_TGUI_CFG_V_BORDER_COLOR VSF_TGUI_COLOR_WHITE
77#endif
78
79#ifndef VSF_TGUI_CFG_V_CONTROL_BACKGROUND_COLOR
80# define VSF_TGUI_CFG_V_CONTROL_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
81#endif
82
83// container configurations
84
85#ifndef VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR
86# define VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0x44, 0x72, 0xC4)
87#endif
88
89// text list configurations
90
91#ifndef VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR
92# define VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
93#endif
94
95#ifndef VSF_TGUI_CFG_V_TEXT_LIST_INDICATOR_COLOR
96# define VSF_TGUI_CFG_V_TEXT_LIST_INDICATOR_COLOR VSF_TGUI_COLOR_RGB(0x44, 0x72, 0xC4)
97#endif
98
99// label configurations
100
101#ifndef VSF_TGUI_CFG_V_LABEL_BACKGROUND_COLOR
102# define VSF_TGUI_CFG_V_LABEL_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
103#endif
104
105#ifndef VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR
106# define VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR ENABLED
107#endif
108
109#ifndef VSF_TGUI_CFG_V_LABEL_TEXT_COLOR
110# define VSF_TGUI_CFG_V_LABEL_TEXT_COLOR VSF_TGUI_COLOR_BLACK
111#endif
112
113#ifndef VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_COLOR
114# define VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_COLOR VSF_TGUI_COLOR_WHITE
115#endif
116
117#ifndef VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_VALUE
118# define VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_VALUE 128
119#endif
120
121// button configurations
122
123#ifndef VSF_TGUI_CFG_V_BUTTON_BACKGROUND_COLOR
124# define VSF_TGUI_CFG_V_BUTTON_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
125#endif
126
127#ifndef VSF_TGUI_CFG_V_BUTTON_CLICKED_BACKGROUND_COLOR
128# define VSF_TGUI_CFG_V_BUTTON_CLICKED_BACKGROUND_COLOR VSF_TGUI_COLOR_BLUE
129#endif
130
131#ifndef VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_COLOR
132# define VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_COLOR VSF_TGUI_COLOR_BLUE
133#endif
134
135#ifndef VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_VALUE
136# define VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_VALUE 128
137#endif
138
139#ifndef VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR
140# define VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR VSF_TGUI_COLOR_BLACK
141#endif
142
143// default init and override init
144
145#define VSF_TGUI_V_CONTROL_STATIC_INIT_DEFAULT \
146 tgui_v_border_color(VSF_TGUI_CFG_V_BORDER_COLOR), \
147 tgui_v_background_color(VSF_TGUI_CFG_V_CONTROL_BACKGROUND_COLOR),
148#define VSF_TGUI_V_LABEL_STATIC_INIT_DEFAULT \
149 tgui_v_border_radius(16), \
150 tgui_v_background_color(VSF_TGUI_CFG_V_LABEL_BACKGROUND_COLOR), \
151 tgui_v_text_color(VSF_TGUI_CFG_V_LABEL_TEXT_COLOR),
152#define VSF_TGUI_V_BUTTON_STATIC_INIT_DEFAULT \
153 tgui_v_border_radius(16), \
154 tgui_v_background_color(VSF_TGUI_CFG_V_BUTTON_BACKGROUND_COLOR), \
155 tgui_v_text_color(VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR),
156#define VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
157 tgui_v_background_color(VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR),
158#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_DEFAULT \
159 tgui_v_border_radius(16), \
160 tgui_v_background_color(VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR),
161#define VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_DEFAULT
162#define VSF_TGUI_V_LIST_STATIC_INIT_DEFAULT
163#define VSF_TGUI_V_PANEL_STATIC_INIT_DEFAULT \
164 tgui_v_border_radius(16),
165
166#define VSF_TGUI_V_PANEL_STATIC_INIT_OVERRIDE
167#define VSF_TGUI_V_CONTROL_STATIC_INIT_OVERRIDE
168#define VSF_TGUI_V_LABEL_STATIC_INIT_OVERRIDE
169#define VSF_TGUI_V_BUTTON_STATIC_INIT_OVERRIDE
170#define VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE
171#define VSF_TGUI_V_LIST_STATIC_INIT_OVERRIDE
172#define VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_OVERRIDE
173#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_OVERRIDE
174
175/*============================ MACROFIED FUNCTIONS ===========================*/
176
177#define tgui_v_font(...) \
178 __tgui_attribute(font_index, __VA_ARGS__)
179
180#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == ENABLED
181# define tgui_v_background_color(...) \
182 __tgui_attribute(background_color, __VA_ARGS__)
183#endif
184
185#if VSF_TGUI_CFG_V_SUPPORT_BORDER == ENABLED
186# define tgui_v_border_width(...) \
187 __tgui_attribute(border_width, __VA_ARGS__)
188#endif
189
190#if VSF_TGUI_CFG_V_SUPPORT_BORDER == ENABLED
191# define tgui_v_border_color(...) \
192 __tgui_attribute(border_color, __VA_ARGS__)
193#endif
194
195#if VSF_TGUI_CFG_V_SUPPORT_ROUND_BORDER == ENABLED
196# define tgui_v_border_radius(...) \
197 __tgui_attribute(border_radius, __VA_ARGS__)
198#endif
199
200#if VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR == ENABLED
201# define tgui_v_text_color(...) \
202 __tgui_attribute(text_color, __VA_ARGS__)
203#endif
204
205/*============================ TYPES =========================================*/
206
207def_structure(vsf_tgui_v_control_t)
208#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == ENABLED
210#endif
211#if VSF_TGUI_CFG_V_SUPPORT_BORDER == ENABLED
214# if VSF_TGUI_CFG_V_SUPPORT_ROUND_BORDER == ENABLED
216# endif
217#endif
218end_def_structure(vsf_tgui_v_control_t)
219
220def_structure(vsf_tgui_v_container_t)
221#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
222 //please remove this if your structure is not emplty
223 uint8_t : 8;
224#endif
225end_def_structure(vsf_tgui_v_container_t)
226
227def_structure(vsf_tgui_v_label_t)
228#if VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR == ENABLED
229 vsf_tgui_v_color_t text_color;
230#endif
232end_def_structure(vsf_tgui_v_label_t)
233
234def_structure(vsf_tgui_v_button_t)
235#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
236 //please remove this if your structure is not emplty
237 uint8_t : 8;
238#endif
239end_def_structure(vsf_tgui_v_button_t)
240
241def_structure(vsf_tgui_v_panel_t)
242#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
243 //please remove this if your structure is not emplty
244 uint8_t : 8;
245#endif
246end_def_structure(vsf_tgui_v_panel_t)
247
248def_structure(vsf_tgui_v_list_t)
249#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
250 //please remove this if your structure is not emplty
251 uint8_t : 8;
252#endif
253end_def_structure(vsf_tgui_v_list_t)
254
255def_structure(vsf_tgui_v_text_list_t)
256#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
257 //please remove this if your structure is not emplty
258 uint8_t : 8;
259#endif
260end_def_structure(vsf_tgui_v_text_list_t)
261
262/*============================ GLOBAL VARIABLES ==============================*/
263/*============================ PROTOTYPES ====================================*/
264
265#ifdef __cplusplus
266}
267#endif
268
269#endif
270#endif
271/* EOF */
unsigned char uint8_t
Definition lvgl.h:40
vsf_tgui_v_color_t border_color
Definition vsf_tgui_v_type.h:212
uint8_t border_width
Definition vsf_tgui_v_type.h:213
uint8_t border_radius
Definition vsf_tgui_v_type.h:215
uint8_t font_index
Definition vsf_tgui_v_type.h:231
vsf_tgui_v_color_t background_color
Definition vsf_tgui_v_type.h:251
Definition vsf_tgui_sv_color.h:93
end_def_structure(vsf_tgui_v_port_t) extern void __vsf_tgui_v_update_dirty_region(vsf_tgui_t *gui_ptr
def_structure(vsf_tgui_v_port_t) vk_disp_t *disp