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_SIMPLE_VIEW
26
27#include "./vsf_tgui_sv_color.h"
28
29#include "../../port/view/vsf_tgui_sv_port.h"
30
31/*============================ MACROS ========================================*/
32
33#ifndef VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR
34# define VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR ENABLED
35#endif
36
37#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == DISLABED
38#ifndef VSF_TGUI_CFG_V_SUPPORT_FIXED_BACKGROUND_COLOR
39# define VSF_TGUI_CFG_V_SUPPORT_FIXED_BACKGROUND_COLOR ENABLED
40#endif
41#endif
42
43#ifndef VSF_TGUI_CFG_V_SUPPORT_TILE_TRANSPARENCY
44# define VSF_TGUI_CFG_V_SUPPORT_TILE_TRANSPARENCY ENABLED
45#endif
46
47#ifndef VSF_TGUI_CFG_V_SUPPORT_CORNER_TILE
48# define VSF_TGUI_CFG_V_SUPPORT_CORNER_TILE ENABLED
49#endif
50
51#ifndef VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR
52# define VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR ENABLED
53#endif
54
55#ifndef VSF_TGUI_CFG_V_CONTROL_BACKGROUND_COLOR
56# define VSF_TGUI_CFG_V_CONTROL_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
57#endif
58
59#ifndef VSF_TGUI_CFG_V_LABEL_BACKGROUND_COLOR
60# define VSF_TGUI_CFG_V_LABEL_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
61#endif
62
63#ifndef VSF_TGUI_CFG_V_LABEL_TEXT_COLOR
64# define VSF_TGUI_CFG_V_LABEL_TEXT_COLOR VSF_TGUI_COLOR_BLACK
65#endif
66
67#ifndef VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_COLOR
68# define VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_COLOR VSF_TGUI_COLOR_WHITE
69#endif
70
71#ifndef VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_VALUE
72# define VSF_TGUI_CFG_V_LABEL_DISABLED_TEXT_MIX_VALUE 128
73#endif
74
75#ifndef VSF_TGUI_CFG_V_BUTTON_BACKGROUND_COLOR
76# define VSF_TGUI_CFG_V_BUTTON_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
77#endif
78
79#ifndef VSF_TGUI_CFG_V_BUTTON_CLICKED_BACKGROUND_COLOR
80# define VSF_TGUI_CFG_V_BUTTON_CLICKED_BACKGROUND_COLOR VSF_TGUI_COLOR_BLUE
81#endif
82
83#ifndef VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_COLOR
84# define VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_COLOR VSF_TGUI_COLOR_BLUE
85#endif
86
87#ifndef VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_VALUE
88# define VSF_TGUI_CFG_V_BUTTON_CLICKED_MIX_VALUE 128
89#endif
90
91#ifndef VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR
92# define VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR VSF_TGUI_COLOR_BLACK
93#endif
94
95#ifndef VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR
96# define VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0x44, 0x72, 0xC4)
97#endif
98
99#ifndef VSF_TGUI_CFG_V_PANEL_BACKGROUND_COLOR
100# define VSF_TGUI_CFG_V_PANEL_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0x44, 0x72, 0xC4)
101#endif
102
103#ifndef VSF_TGUI_CFG_V_LIST_BACKGROUND_COLOR
104# define VSF_TGUI_CFG_V_LIST_BACKGROUND_COLOR VSF_TGUI_COLOR_RGBA(0xB4, 0xC7, 0xE7, 0x00)
105#endif
106
107#ifndef VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR
108# define VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR VSF_TGUI_COLOR_RGB(0xB4, 0xC7, 0xE7)
109#endif
110
111#ifndef VSF_TGUI_CFG_V_TEXT_LIST_INDICATOR_COLOR
112# define VSF_TGUI_CFG_V_TEXT_LIST_INDICATOR_COLOR VSF_TGUI_COLOR_RGB(0x44, 0x72, 0xC4)
113#endif
114
115#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == ENABLED
116# define __SV_BACKGROUND_COLOR(__COLOR) .background_color = __COLOR,
117#else
118# define __SV_BACKGROUND_COLOR(__COLOR)
119#endif
120
121#if VSF_TGUI_CFG_V_SUPPORT_TILE_TRANSPARENCY == ENABLED
122# define __SV_TILE_TRANS_RATE(__COLOR) .tile_trans_rate = __COLOR,
123#else
124# define __SV_TILE_TRANS_RATE(__COLOR)
125#endif
126
127#if VSF_TGUI_CFG_V_SUPPORT_CORNER_TILE == ENABLED
128# define __SV_SHOW_CORNER_TILE(__VALUE) .show_corner_tile = __VALUE,
129#else
130# define __SV_SHOW_CORNER_TILE(__VALUE)
131#endif
132
133#if VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR == ENABLED
134# define __SV_TEXT_COLOR(__COLOR) .text_color = __COLOR,
135#else
136# define __SV_TEXT_COLOR(__COLOR)
137#endif
138
139#define VSF_TGUI_V_CONTROL_STATIC_INIT_DEFAULT \
140 __SV_SHOW_CORNER_TILE(false) \
141 __SV_TILE_TRANS_RATE(0xFF) \
142 __SV_BACKGROUND_COLOR(VSF_TGUI_CFG_V_CONTROL_BACKGROUND_COLOR)
143
144#define VSF_TGUI_V_LABEL_STATIC_INIT_DEFAULT \
145 __SV_SHOW_CORNER_TILE(true) \
146 __SV_TILE_TRANS_RATE(0xFF) \
147 __SV_BACKGROUND_COLOR(VSF_TGUI_CFG_V_LABEL_BACKGROUND_COLOR) \
148 __SV_TEXT_COLOR(VSF_TGUI_CFG_V_LABEL_TEXT_COLOR)
149
150#define VSF_TGUI_V_BUTTON_STATIC_INIT_DEFAULT \
151 __SV_SHOW_CORNER_TILE(true) \
152 __SV_TILE_TRANS_RATE(0xFF) \
153 __SV_BACKGROUND_COLOR(VSF_TGUI_CFG_V_BUTTON_BACKGROUND_COLOR) \
154 __SV_TEXT_COLOR(VSF_TGUI_CFG_V_BUTTON_TEXT_COLOR)
155
156#define VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
157 __SV_SHOW_CORNER_TILE(true) \
158 __SV_TILE_TRANS_RATE(0xFF) \
159 __SV_BACKGROUND_COLOR(VSF_TGUI_CFG_V_CONTAINER_BACKGROUND_COLOR)
160
161#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_DEFAULT \
162 __SV_SHOW_CORNER_TILE(true) \
163 __SV_TILE_TRANS_RATE(0xFF) \
164 __SV_BACKGROUND_COLOR(VSF_TGUI_CFG_V_TEXT_LIST_BACKGROUND_COLOR)
165
166#define VSF_TGUI_V_LIST_STATIC_INIT_DEFAULT \
167 __SV_SHOW_CORNER_TILE(true) \
168 __SV_TILE_TRANS_RATE(0xFF)
169
170#define VSF_TGUI_V_PANEL_STATIC_INIT_DEFAULT \
171 __SV_SHOW_CORNER_TILE(true) \
172 __SV_TILE_TRANS_RATE(0xFF)
173
174#define VSF_TGUI_V_CONTROL_STATIC_INIT_OVERRIDE
175#define VSF_TGUI_V_LABEL_STATIC_INIT_OVERRIDE
176#define VSF_TGUI_V_BUTTON_STATIC_INIT_OVERRIDE
177#define VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE
178#define VSF_TGUI_V_LIST_STATIC_INIT_OVERRIDE
179
180#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == ENABLED
181#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_BACKGROUND_CLOLOR_OVERRIDE \
182 .tList.background_color = VSF_TGUI_COLOR_RGBA(0x00, 0x00, 0x00, 0x00),
183#else
184#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_BACKGROUND_CLOLOR_OVERRIDE
185#endif
186
187#if VSF_TGUI_CFG_V_SUPPORT_CORNER_TILE == ENABLED
188#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_TILE_OVERRIDE \
189 .show_corner_tile = true,
190#else
191#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_TILE_OVERRIDE
192#endif
193
194#define VSF_TGUI_V_TEXT_LIST_STATIC_INIT_OVERRIDE \
195 VSF_TGUI_V_TEXT_LIST_STATIC_INIT_BACKGROUND_CLOLOR_OVERRIDE
196
197#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == ENABLED
198# define VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_OVERRIDE \
199 .background_color = VSF_TGUI_COLOR_RGBA(0x00, 0x00, 0x00, 0x00), \
200 VSF_TGUI_V_TEXT_LIST_STATIC_INIT_TILE_OVERRIDE
201#else
202# define VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_OVERRIDE
203#endif
204
205#define VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_DEFAULT
206
207#define VSF_TGUI_V_PANEL_STATIC_INIT_OVERRIDE
208
209#define tgui_v_font(...) \
210 __tgui_attribute(font_index, __VA_ARGS__)
211
212#if VSF_TGUI_CFG_V_SUPPORT_CORNER_TILE == ENABLED
213#define tgui_v_show_corner_tile(...) \
214 __tgui_attribute(show_corner_tile, __VA_ARGS__)
215#endif
216
217#if VSF_TGUI_CFG_V_SUPPORT_TILE_TRANSPARENCY == ENABLED
218#define tgui_v_tile_trans_rate(...) \
219 __tgui_attribute(tile_trans_rate, __VA_ARGS__)
220#endif
221
222#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == ENABLED
223#define tgui_v_background_color(...) \
224 __tgui_attribute(background_color, __VA_ARGS__)
225#endif
226
227#if VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR == ENABLED
228#define tgui_v_text_color(...) \
229 __tgui_attribute(text_color, __VA_ARGS__)
230#endif
231
232/*============================ MACROFIED FUNCTIONS ===========================*/
233/*============================ TYPES =========================================*/
234
235declare_structure(vsf_tgui_v_control_t)
236def_structure(vsf_tgui_v_control_t)
239#if VSF_TGUI_CFG_V_SUPPORT_CORNER_TILE == ENABLED
241#endif
242#if VSF_TGUI_CFG_V_SUPPORT_TILE_TRANSPARENCY == ENABLED
244#endif
245#if VSF_TGUI_CFG_V_SUPPORT_FLUXIBLE_BACKGROUND_COLOR == ENABLED
247#endif
248end_def_structure(vsf_tgui_v_control_t)
249
250declare_structure(vsf_tgui_v_container_t)
251def_structure(vsf_tgui_v_container_t)
252#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
253 //please remove this if your structure is not emplty
255#endif
256end_def_structure(vsf_tgui_v_container_t)
257
258declare_structure(vsf_tgui_v_label_t)
259def_structure(vsf_tgui_v_label_t)
260#if VSF_TGUI_CFG_V_LABLE_SUPPORT_TEXT_COLOR == ENABLED
261 vsf_tgui_v_color_t text_color;
262#endif
263end_def_structure(vsf_tgui_v_label_t)
264
265declare_structure(vsf_tgui_v_button_t)
266def_structure(vsf_tgui_v_button_t)
267#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
268 //please remove this if your structure is not emplty
270#endif
271end_def_structure(vsf_tgui_v_button_t)
272
273declare_structure(vsf_tgui_v_panel_t)
274def_structure(vsf_tgui_v_panel_t)
275#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
276 //please remove this if your structure is not emplty
278#endif
279end_def_structure(vsf_tgui_v_panel_t)
280
281declare_structure(vsf_tgui_v_list_t)
282def_structure(vsf_tgui_v_list_t)
283#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
284 //please remove this if your structure is not emplty
286#endif
287end_def_structure(vsf_tgui_v_list_t)
288
289declare_structure(vsf_tgui_v_text_list_t)
290def_structure(vsf_tgui_v_text_list_t)
291#if __IS_COMPILER_IAR__ || (!defined( __STDC_VERSION__ ) || __STDC_VERSION__ < 199901L)
292 //please remove this if your structure is not emplty
294#endif
295end_def_structure(vsf_tgui_v_text_list_t)
296
297/*============================ GLOBAL VARIABLES ==============================*/
298/*============================ PROTOTYPES ====================================*/
299
300#endif
301
302#endif
303/* EOF */
#define REG_RSVD_U8
Definition i_io_systick.h:136
unsigned char uint8_t
Definition lvgl.h:40
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
declare_structure(vsf_tgui_v_control_t) def_structure(vsf_tgui_v_control_t) uint8_t font_index uint8_t __skip_frame
Definition vsf_tgui_v_type.h:235
uint8_t tile_trans_rate
Definition vsf_tgui_v_type.h:243
uint8_t show_corner_tile
Definition vsf_tgui_v_type.h:240
Definition vsf_tgui_sv_color.h:87
vsf_tgui_evt_t declare_structure(__vk_tgui_focus_t) def_structure(__vk_tgui_focus_t) const vsf_tgui_control_t *current_ptr
end_def_structure(vsf_tgui_v_port_t) extern void __vsf_tgui_v_update_dirty_region(vsf_tgui_t *gui_ptr