VSF Documented
vsf_tgui_cfg.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/****************************************************************************
19* Copyright 2020 by Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) *
20* *
21* Licensed under the Apache License, Version 2.0 (the "License"); *
22* you may not use this file except in compliance with the License. *
23* You may obtain a copy of the License at *
24* *
25* http://www.apache.org/licenses/LICENSE-2.0 *
26* *
27* Unless required by applicable law or agreed to in writing, software *
28* distributed under the License is distributed on an "AS IS" BASIS, *
29* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
30* See the License for the specific language governing permissions and *
31* limitations under the License. *
32* *
33****************************************************************************/
34
35 /*============================ INCLUDES ======================================*/
37#include "../vsf_ui_cfg.h"
38
39#ifndef __VSF_TINY_GUI_CFG_H__
40#define __VSF_TINY_GUI_CFG_H__
41
42#if VSF_USE_TINY_GUI == ENABLED
43/*============================ MACROS ========================================*/
44
45#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
46# error tGUI requires ANSI-C99 and above
47#endif
48
49
50/*----------------------------------------------------------------------------*
51 * Rendering *
52 *----------------------------------------------------------------------------*/
53
54#define VSF_TGUI_V_TEMPLATE_EXAMPLE 1
55#define VSF_TGUI_V_TEMPLATE_SIMPLE_VIEW 2
56#define VSF_TGUI_V_TEMPLATE_SCGUI_VIEW 3
57
58#ifndef VSF_TGUI_CFG_RENDERING_TEMPLATE_SEL
59# define VSF_TGUI_CFG_RENDERING_TEMPLATE_SEL VSF_TGUI_V_TEMPLATE_EXAMPLE
60#endif
61
62/*----------------------------------------------------------------------------*
63 * Colour Space *
64 *----------------------------------------------------------------------------*/
65
66#define VSF_TGUI_COLOR_RGB_565 0
67#define VSF_TGUI_COLOR_BGR_565 1
68#define VSF_TGUI_COLOR_ARGB_8888 2
69#define VSF_TGUI_COLOR_RGB8_USER_TEMPLATE 3
70
71#ifndef VSF_TGUI_CFG_COLOR_MODE
72# define VSF_TGUI_CFG_COLOR_MODE VSF_TGUI_COLOR_ARGB_8888
73#endif
74
75#undef __VSF_TGUI_IS_COLOR_SUPPORT_ALPHA__
76#if VSF_TGUI_CFG_COLOR_MODE == VSF_TGUI_COLOR_ARGB_8888
77# define __VSF_TGUI_IS_COLOR_SUPPORT_ALPHA__ 1
78#else
79# define __VSF_TGUI_IS_COLOR_SUPPORT_ALPHA__ 0
80#endif
81
82/*----------------------------------------------------------------------------*
83 * Designer & Layout *
84 *----------------------------------------------------------------------------*/
85
86#ifndef VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_PADDING
87# define VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_PADDING ENABLED
88#endif
89
90#ifndef VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_MARGIN
91# define VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_MARGIN ENABLED
92#endif
93
94
95#ifndef VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_ANCHOR
96# define VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_ANCHOR DISABLED /* haven't support */
97#endif
98
99#ifndef VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_DOCK
100# define VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_DOCK DISABLED /* haven't support */
101#endif
102
103#ifndef VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_ALIGN
104# define VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_ALIGN DISABLED /* haven't support */
105#endif
106
107/*----------------------------------------------------------------------------*
108 * Font and Text *
109 *----------------------------------------------------------------------------*/
110#define VSF_TGUI_TEXT_ASCII 0
111#define VSF_TGUI_TEXT_UTF8 1
112
113#ifndef VSF_TGUI_CFG_TEXT_MODE
114# define VSF_TGUI_CFG_TEXT_MODE VSF_TGUI_TEXT_UTF8
115#endif
116
117#ifndef VSF_TGUI_CFG_SUPPORT_NAME_STRING
118# define VSF_TGUI_CFG_SUPPORT_NAME_STRING ENABLED
119#endif
120#if VSF_TGUI_CFG_SUPPORT_NAME_STRING == ENABLED
121# if VSF_MSG_TREE_CFG_SUPPORT_NAME_STRING != ENABLED
122# warning "VSF_TGUI_CFG_SUPPORT_NAME_STRING is ENABLED and depends \
123on VSF_MSG_TREE_CFG_SUPPORT_NAME_STRING, but it is set to DISABLED. \
124In order to continue the compilation process, this macro \
125VSF_MSG_TREE_CFG_SUPPORT_NAME_STRING is forced to be ENABLED. Please \
126enable it in vsf_usr_cfg.h or top vsf_tgui_cfg.h to suppress this \
127warning."
128# undef VSF_MSG_TREE_CFG_SUPPORT_NAME_STRING
129# define VSF_MSG_TREE_CFG_SUPPORT_NAME_STRING ENABLED
130# endif
131#endif
132
133#ifndef VSF_TGUI_CFG_TEXT_SIZE_INFO_CACHING
134# define VSF_TGUI_CFG_TEXT_SIZE_INFO_CACHING ENABLED
135#endif
136
137#ifndef VSF_TGUI_CFG_SAFE_STRING_MODE
138# define VSF_TGUI_CFG_SAFE_STRING_MODE ENABLED
139#endif
140
141/*----------------------------------------------------------------------------*
142 * Refresh Control *
143 *----------------------------------------------------------------------------*/
144#define VSF_TGUI_REFRESH_SCHEME_NONE 0
145#define VSF_TGUI_REFRESH_SCHEME_Z_ORDER 1
146#define VSF_TGUI_REFRESH_SCHEME_PRE_ORDER_TRAVERSAL 1
147#define VSF_TGUI_REFRESH_SCHEME_LAYER_BY_LAYER 2
148#define VSF_TGUI_REFRESH_SCHEME_BREADTH_FIRST_TRAVERSAL 2
149
150#ifndef VSF_TGUI_CFG_REFRESH_SCHEME
151# define VSF_TGUI_CFG_REFRESH_SCHEME VSF_TGUI_REFRESH_SCHEME_Z_ORDER
152#endif
153
154#ifndef VSF_TGUI_CFG_SUPPORT_TRANSPARENT_CONTROL
155# define VSF_TGUI_CFG_SUPPORT_TRANSPARENT_CONTROL ENABLED
156#endif
157
158#ifndef VSF_TGUI_CFG_SUPPORT_DIRTY_REGION
159# define VSF_TGUI_CFG_SUPPORT_DIRTY_REGION ENABLED
160#endif
161
162/*----------------------------------------------------------------------------*
163 * Message Handling Control *
164 *----------------------------------------------------------------------------*/
165#ifndef VSF_TGUI_CFG_SUPPORT_DESTRUCTOR_SCHEME
166# define VSF_TGUI_CFG_SUPPORT_DESTRUCTOR_SCHEME ENABLED
167#endif
168
169#ifndef VSF_TGUI_CFG_SUPPORT_CONSTRUCTOR_SCHEME
170# define VSF_TGUI_CFG_SUPPORT_CONSTRUCTOR_SCHEME ENABLED
171#endif
172
173#ifndef VSF_TGUI_CFG_SUPPORT_MOUSE_LIKE_EVENTS
174# define VSF_TGUI_CFG_SUPPORT_MOUSE_LIKE_EVENTS ENABLED
175#endif
176#ifndef VSF_TGUI_CFG_SUPPORT_MOUSE_MOVE_HANDLING
177# define VSF_TGUI_CFG_SUPPORT_MOUSE_MOVE_HANDLING DISABLED
178#endif
179
180#ifndef VSF_TGUI_CFG_SUPPORT_KEY_EVENTS
181# define VSF_TGUI_CFG_SUPPORT_KEY_EVENTS ENABLED
182#endif
183
184/*----------------------------------------------------------------------------*
185 * Control Features *
186 *----------------------------------------------------------------------------*/
187
188#ifndef VSF_TGUI_CFG_DYNAMIC
189# define VSF_TGUI_CFG_DYNAMIC VSF_USE_HEAP
190#endif
191
192#ifndef VSF_TGUI_CFG_SUPPORT_TIMER
193# define VSF_TGUI_CFG_SUPPORT_TIMER ENABLED
194#endif
195
196#ifndef VSF_TGUI_CFG_SUPPORT_STREAM_CONTAINER
197# define VSF_TGUI_CFG_SUPPORT_STREAM_CONTAINER ENABLED
198#endif
199
200#ifndef VSF_TGUI_CFG_SUPPORT_LINE_STREAM_CONTAINER
201# define VSF_TGUI_CFG_SUPPORT_LINE_STREAM_CONTAINER ENABLED
202#endif
203
204#ifndef VSF_TGUI_CFG_SUPPORT_SLIDER
205# define VSF_TGUI_CFG_SUPPORT_SLIDER ENABLED
206#endif
207
208#ifndef VSF_TGUI_CFG_SUPPORT_TEXT_LIST
209# define VSF_TGUI_CFG_SUPPORT_TEXT_LIST ENABLED
210#endif
211
212#if VSF_TGUI_CFG_SUPPORT_TEXT_LIST == ENABLED
213# ifndef VSF_TGUI_CFG_TEXT_LIST_SUPPORT_SLIDE
214# define VSF_TGUI_CFG_TEXT_LIST_SUPPORT_SLIDE ENABLED
215# endif
216#endif
217
218#ifndef VSF_TGUI_CFG_SUPPORT_LIST
219# define VSF_TGUI_CFG_SUPPORT_LIST ENABLED
220#endif
221
222#if VSF_TGUI_CFG_SUPPORT_LIST == ENABLED
223# ifndef VSF_TGUI_CFG_LIST_SUPPORT_SLIDE
224# define VSF_TGUI_CFG_LIST_SUPPORT_SLIDE ENABLED
225# endif
226#endif
227
228#ifndef VSF_TGUI_CFG_REFRESH_CONTROL_ON_ACTIVE_STATE_CHANGE
229# define VSF_TGUI_CFG_REFRESH_CONTROL_ON_ACTIVE_STATE_CHANGE DISABLED
230#endif
231
232#ifndef VSF_TGUI_CFG_LIST_SUPPORT_SCROOLBAR
233# define VSF_TGUI_CFG_LIST_SUPPORT_SCROOLBAR ENABLED
234#endif
235
236#ifndef VSF_TGUI_CFG_PANEL_HAS_LABEL
237# define VSF_TGUI_CFG_PANEL_HAS_LABEL ENABLED
238#endif
239
240/*----------------------------------------------------------------------------*
241 * miscellaneous *
242 *----------------------------------------------------------------------------*/
243#ifndef VSF_TGUI_ASSERT
244# define VSF_TGUI_ASSERT VSF_ASSERT
245#endif
246
247#ifndef VSF_TGUI_CFG_SHOW_REFRESH_EVT_LOG
248# define VSF_TGUI_CFG_SHOW_REFRESH_EVT_LOG DISABLED
249#endif
250
251#ifndef VSF_TGUI_CFG_SHOW_ON_LOAD_EVT_LOG
252# define VSF_TGUI_CFG_SHOW_ON_LOAD_EVT_LOG ENABLED
253#endif
254
255#ifndef VSF_TGUI_CFG_SHOW_UPDATE_EVT_LOG
256# define VSF_TGUI_CFG_SHOW_UPDATE_EVT_LOG ENABLED
257#endif
258
259#ifndef VSF_TGUI_CFG_SHOW_ON_DEPOSE_EVT_LOG
260# define VSF_TGUI_CFG_SHOW_ON_DEPOSE_EVT_LOG ENABLED
261#endif
262
263#ifndef VSF_TGUI_CFG_SHOW_ON_TIME_EVT_LOG
264# define VSF_TGUI_CFG_SHOW_ON_TIME_EVT_LOG DISABLED
265#endif
266
267#ifndef VSF_TGUI_CFG_SHOW_GET_ACTIVE_EVT_LOG
268# define VSF_TGUI_CFG_SHOW_GET_ACTIVE_EVT_LOG ENABLED
269#endif
270
271#ifndef VSF_TGUI_CFG_SHOW_LOST_ACTIVE_EVT_LOG
272# define VSF_TGUI_CFG_SHOW_LOST_ACTIVE_EVT_LOG ENABLED
273#endif
274
275#ifndef VSF_TGUI_CFG_SHOW_POINTER_EVT_LOG
276# define VSF_TGUI_CFG_SHOW_POINTER_EVT_LOG ENABLED
277#endif
278
279#ifndef VSF_TGUI_CFG_SHOW_KEY_EVT_LOG
280# define VSF_TGUI_CFG_SHOW_KEY_EVT_LOG ENABLED
281#endif
282
283#ifndef VSF_TGUI_CFG_SHOW_GESTURE_EVT_LOG
284# define VSF_TGUI_CFG_SHOW_GESTURE_EVT_LOG ENABLED
285#endif
286
287#ifndef VSF_TGUI_CFG_SHOW_CONTROL_SPECIFIC_EVT_LOG
288# define VSF_TGUI_CFG_SHOW_CONTROL_SPECIFIC_EVT_LOG ENABLED
289#endif
290
291#ifndef VSF_TGUI_CFG_SHOW_SYSTEM_LOG
292# define VSF_TGUI_CFG_SHOW_SYSTEM_LOG ENABLED
293#endif
294#if VSF_TGUI_CFG_SHOW_SYSTEM_LOG != ENABLED
295# undef VSF_TGUI_CFG_SHOW_REFRESH_EVT_LOG
296# undef VSF_TGUI_CFG_SHOW_ON_LOAD_EVT_LOG
297# undef VSF_TGUI_CFG_SHOW_UPDATE_EVT_LOG
298# undef VSF_TGUI_CFG_SHOW_ON_DEPOSE_EVT_LOG
299# undef VSF_TGUI_CFG_SHOW_ON_TIME_EVT_LOG
300# undef VSF_TGUI_CFG_SHOW_CONTROL_SPECIFIC_EVT_LOG
301# undef VSF_TGUI_CFG_SHOW_GET_ACTIVE_EVT_LOG
302# undef VSF_TGUI_CFG_SHOW_LOST_ACTIVE_EVT_LOG
303
304# define VSF_TGUI_CFG_SHOW_REFRESH_EVT_LOG DISABLED
305# define VSF_TGUI_CFG_SHOW_ON_LOAD_EVT_LOG DISABLED
306# define VSF_TGUI_CFG_SHOW_UPDATE_EVT_LOG DISABLED
307# define VSF_TGUI_CFG_SHOW_ON_DEPOSE_EVT_LOG DISABLED
308# define VSF_TGUI_CFG_SHOW_ON_TIME_EVT_LOG DISABLED
309# define VSF_TGUI_CFG_SHOW_CONTROL_SPECIFIC_EVT_LOG DISABLED
310# define VSF_TGUI_CFG_SHOW_GET_ACTIVE_EVT_LOG DISABLED
311# define VSF_TGUI_CFG_SHOW_LOST_ACTIVE_EVT_LOG DISABLED
312#endif
313
314#ifndef VSF_TGUI_CFG_SHOW_USER_INPUT_LOG
315# define VSF_TGUI_CFG_SHOW_USER_INPUT_LOG ENABLED
316#endif
317#if VSF_TGUI_CFG_SHOW_USER_INPUT_LOG != ENABLED
318# undef VSF_TGUI_CFG_SHOW_POINTER_EVT_LOG
319# undef VSF_TGUI_CFG_SHOW_KEY_EVT_LOG
320# undef VSF_TGUI_CFG_SHOW_GESTURE_EVT_LOG
321# define VSF_TGUI_CFG_SHOW_POINTER_EVT_LOG DISABLED
322# define VSF_TGUI_CFG_SHOW_KEY_EVT_LOG DISABLED
323# define VSF_TGUI_CFG_SHOW_GESTURE_EVT_LOG DISABLED
324#endif
325
326/*============================ MACROFIED FUNCTIONS ===========================*/
327
328#ifndef VSF_TGUI_LOG
329# if VSF_USE_TRACE == ENABLED
330
331# warning 'macro VSF_TGUI_LOG() is not defined. Use vsf_trace() by default \
332as VSF_USE_TRACE is ENABLED. You can remove the log output by putting following\
333 code in vsf_usr_cfg.h: #define VSF_TGUI_LOG'
334
335# define VSF_TGUI_LOG vsf_trace
336# elif defined(__STDC_VERSION__) && __STDC_VERSION__ > 199901L
337
338# warning 'macro VSF_TGUI_LOG() is not defined. Use printf() by default \
339as VSF_USE_TRACE is DISABLED.You can remove the log output by putting following\
340code in vsf_usr_cfg.h: #define VSF_TGUI_LOG'
341
342# define VSF_TGUI_LOG(__LEVEL, __STRING, ...) printf(__STRING, ##__VA_ARGS__)
343# else
344# define VSF_TGUI_LOG
345# endif
346#endif
347
348/*============================ TYPES =========================================*/
349/*============================ GLOBAL VARIABLES ==============================*/
350/*============================ LOCAL VARIABLES ===============================*/
351/*============================ PROTOTYPES ====================================*/
352
353
354/*============================ INCLUDES ======================================*/
355#include "vsf_tgui_common.h"
356#endif
357#endif
358/* EOF */