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