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#include "../../vsf_tgui_cfg.h"
23
24#if VSF_USE_TINY_GUI == ENABLED \
25 && VSF_TGUI_CFG_RENDERING_TEMPLATE_SEL == VSF_TGUI_V_TEMPLATE_SCGUI_VIEW
26
28
29/*============================ MACROS ========================================*/
30
31// colors
32
33#define VSF_TGUI_COLOR_WHITE C_WHITE
34#define VSF_TGUI_COLOR_SILVER C_SILVER
35#define VSF_TGUI_COLOR_GRAY C_GRAY
36#define VSF_TGUI_COLOR_BLACK C_BLACK
37#define VSF_TGUI_COLOR_RED C_RED
38#define VSF_TGUI_COLOR_MAROON C_MAROON
39#define VSF_TGUI_COLOR_YELLOW C_YELLOW
40#define VSF_TGUI_COLOR_LIME C_LIME
41#define VSF_TGUI_COLOR_GREEN C_GREEN
42#define VSF_TGUI_COLOR_AQUA C_AQUA
43#define VSF_TGUI_COLOR_TEAL C_TEAL
44#define VSF_TGUI_COLOR_BLUE C_BLUE
45#define VSF_TGUI_COLOR_NAVY C_NAVY
46#define VSF_TGUI_COLOR_PURPLE C_PURPLE
47
48#define VSF_TGUI_COLOR_OLIVE C_OLIVER
49#define VSF_TGUI_COLOR_FUCHSIA C_FUCHSIA
50
51#define VSF_TGUI_COLOR_RGBA(__R, __G, __B, __A) ((vsf_tgui_v_color_t) ((((__R) & 0xF1) << 8) | (((__G) & 0xF3) << 3) | (((__B) & 0xF1) >> 3)) )
52#define VSF_TGUI_COLOR_RGB(__R, __G, __B) VSF_TGUI_COLOR_RGBA((__R), (__G), (__B), 0xFF)
53
54// configurations
55
56// control configurations
57
58#ifndef VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR
59# define VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR ENABLED
60#endif
61
62#ifndef VSF_TGUI_CFG_V_SUPPORT_BORDER
63# define VSF_TGUI_CFG_V_SUPPORT_BORDER ENABLED
64#endif
65#if VSF_TGUI_CFG_V_SUPPORT_BORDER == ENABLED
66# ifndef VSF_TGUI_CFG_V_SUPPORT_ROUND_BORDER
67# define VSF_TGUI_CFG_V_SUPPORT_ROUND_BORDER ENABLED
68# endif
69#endif
70#ifndef VSF_TGUI_CFG_V_BORDER_COLOR
71# define VSF_TGUI_CFG_V_BORDER_COLOR VSF_TGUI_COLOR_WHITE
72#endif
73
74#ifndef VSF_TGUI_CFG_V_CONTROL_BACKGROUND_COLOR
75# define VSF_TGUI_CFG_V_CONTROL_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
76#endif
77
78// container configurations
79
80#ifndef VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR
81# define VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0x44, 0x72, 0xC4)
82#endif
83
84// text list configurations
85
86#ifndef VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR
87# define VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
88#endif
89
90#ifndef VSF_TGUI_CFG_V_TEXT_LIST_INDICATOR_COLOR
91# define VSF_TGUI_CFG_V_TEXT_LIST_INDICATOR_COLOR VSF_TGUI_COLOR_RGB(0x44, 0x72, 0xC4)
92#endif
93
94// label configurations
95
96#ifndef VSF_TGUI_CFG_V_LABEL_BACKGROUND_COLOR
97# define VSF_TGUI_CFG_V_LABEL_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
98#endif
99
100#ifndef VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR
101# define VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR ENABLED
102#endif
103
104#ifndef VSF_TGUI_CFG_V_LABEL_TEXT_COLOR
105# define VSF_TGUI_CFG_V_LABEL_TEXT_COLOR VSF_TGUI_COLOR_BLACK
106#endif
107
108#ifndef VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_COLOR
109# define VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_COLOR VSF_TGUI_COLOR_WHITE
110#endif
111
112#ifndef VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_VALUE
113# define VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_VALUE 128
114#endif
115
116// button configurations
117
118#ifndef VSF_TGUI_CFG_V_BUTTON_BACKGROUND_COLOR
119# define VSF_TGUI_CFG_V_BUTTON_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
120#endif
121
122#ifndef VSF_TGUI_CFG_V_BUTTON_CLICKED_BACKGROUND_COLOR
123# define VSF_TGUI_CFG_V_BUTTON_CLICKED_BACKGROUND_COLOR VSF_TGUI_COLOR_BLUE
124#endif
125
126#ifndef VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_COLOR
127# define VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_COLOR VSF_TGUI_COLOR_BLUE
128#endif
129
130#ifndef VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_VALUE
131# define VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_VALUE 128
132#endif
133
134#ifndef VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR
135# define VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR VSF_TGUI_COLOR_BLACK
136#endif
137
138// default init and override init
139
140#define VSF_TGUI_V_CONTROL_STATIC_INIT_DEFAULT \
141 tgui_v_border_color(VSF_TGUI_CFG_V_BORDER_COLOR), \
142 tgui_v_background_color(VSF_TGUI_CFG_V_CONTROL_BACKGROUND_COLOR),
143#define VSF_TGUI_V_LABEL_STATIC_INIT_DEFAULT \
144 tgui_v_border_radius(16), \
145 tgui_v_background_color(VSF_TGUI_CFG_V_LABEL_BACKGROUND_COLOR), \
146 tgui_v_text_color(VSF_TGUI_CFG_V_LABEL_TEXT_COLOR),
147#define VSF_TGUI_V_BUTTON_STATIC_INIT_DEFAULT \
148 tgui_v_border_radius(16), \
149 tgui_v_background_color(VSF_TGUI_CFG_V_BUTTON_BACKGROUND_COLOR), \
150 tgui_v_text_color(VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR),
151#define VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
152 tgui_v_background_color(VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR),
153#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_DEFAULT \
154 tgui_v_border_radius(16), \
155 tgui_v_background_color(VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR),
156#define VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_DEFAULT
157#define VSF_TGUI_V_LIST_STATIC_INIT_DEFAULT
158#define VSF_TGUI_V_PANEL_STATIC_INIT_DEFAULT \
159 tgui_v_border_radius(16),
160
161#define VSF_TGUI_V_PANEL_STATIC_INIT_OVERRIDE
162#define VSF_TGUI_V_CONTROL_STATIC_INIT_OVERRIDE
163#define VSF_TGUI_V_LABEL_STATIC_INIT_OVERRIDE
164#define VSF_TGUI_V_BUTTON_STATIC_INIT_OVERRIDE
165#define VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE
166#define VSF_TGUI_V_LIST_STATIC_INIT_OVERRIDE
167#define VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_OVERRIDE
168#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_OVERRIDE
169
170/*============================ MACROFIED FUNCTIONS ===========================*/
171
172#define tgui_v_font(...) \
173 __tgui_attribute(font_index, __VA_ARGS__)
174
175#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == ENABLED
176# define tgui_v_background_color(...) \
177 __tgui_attribute(background_color, __VA_ARGS__)
178#endif
179
180#if VSF_TGUI_CFG_V_SUPPORT_BORDER == ENABLED
181# define tgui_v_border_width(...) \
182 __tgui_attribute(border_width, __VA_ARGS__)
183#endif
184
185#if VSF_TGUI_CFG_V_SUPPORT_BORDER == ENABLED
186# define tgui_v_border_color(...) \
187 __tgui_attribute(border_color, __VA_ARGS__)
188#endif
189
190#if VSF_TGUI_CFG_V_SUPPORT_ROUND_BORDER == ENABLED
191# define tgui_v_border_radius(...) \
192 __tgui_attribute(border_radius, __VA_ARGS__)
193#endif
194
195#if VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR == ENABLED
196# define tgui_v_text_color(...) \
197 __tgui_attribute(text_color, __VA_ARGS__)
198#endif
199
200/*============================ TYPES =========================================*/
201
202def_structure(vsf_tgui_v_control_t)
203#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == ENABLED
205#endif
206#if VSF_TGUI_CFG_V_SUPPORT_BORDER == ENABLED
209# if VSF_TGUI_CFG_V_SUPPORT_ROUND_BORDER == ENABLED
211# endif
212#endif
213end_def_structure(vsf_tgui_v_control_t)
214
215def_structure(vsf_tgui_v_container_t)
216#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
217 //please remove this if your structure is not emplty
218 uint8_t : 8;
219#endif
220end_def_structure(vsf_tgui_v_container_t)
221
222def_structure(vsf_tgui_v_label_t)
223#if VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR == ENABLED
224 vsf_tgui_v_color_t text_color;
225#endif
227end_def_structure(vsf_tgui_v_label_t)
228
229def_structure(vsf_tgui_v_button_t)
230#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
231 //please remove this if your structure is not emplty
232 uint8_t : 8;
233#endif
234end_def_structure(vsf_tgui_v_button_t)
235
236def_structure(vsf_tgui_v_panel_t)
237#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
238 //please remove this if your structure is not emplty
239 uint8_t : 8;
240#endif
241end_def_structure(vsf_tgui_v_panel_t)
242
243def_structure(vsf_tgui_v_list_t)
244#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
245 //please remove this if your structure is not emplty
246 uint8_t : 8;
247#endif
248end_def_structure(vsf_tgui_v_list_t)
249
250def_structure(vsf_tgui_v_text_list_t)
251#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
252 //please remove this if your structure is not emplty
253 uint8_t : 8;
254#endif
255end_def_structure(vsf_tgui_v_text_list_t)
256
257/*============================ GLOBAL VARIABLES ==============================*/
258/*============================ PROTOTYPES ====================================*/
259
260#endif
261
262#endif
263/* EOF */
unsigned char uint8_t
Definition lvgl.h:40
vsf_tgui_v_color_t border_color
Definition vsf_tgui_v_type.h:207
uint8_t border_width
Definition vsf_tgui_v_type.h:208
uint8_t border_radius
Definition vsf_tgui_v_type.h:210
def_structure(vsf_tgui_v_control_t) vsf_tgui_v_color_t background_color
uint8_t font_index
Definition vsf_tgui_v_type.h:226
vsf_tgui_v_color_t background_color
Definition vsf_tgui_v_type.h:246
Definition vsf_tgui_sv_color.h:87
end_def_structure(vsf_tgui_v_port_t) extern void __vsf_tgui_v_update_dirty_region(vsf_tgui_t *gui_ptr