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