VSF Documented
vsf_tgui_port.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 requir 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_PORT_H__
19#define __VSF_TINY_GUI_PORT_H__
20
21/*============================ INCLUDES ======================================*/
22
23#include "../vsf_tgui_cfg.h"
24
25#if VSF_USE_TINY_GUI == ENABLED
26
27#if VSF_USE_INPUT == ENABLED
29#endif
30
32
33/*============================ MACROS ========================================*/
34/*============================ MACROFIED FUNCTIONS ===========================*/
35
36#define __TGUI_FONT_DEF(__NAME, __HEIGHT) __NAME
37#define TGUI_FONT_DEF(__NAME, __HEIGHT) \
38 __TGUI_FONT_DEF(__NAME, __HEIGHT)
39
40#if VSF_TGUI_CFG_FONT_USE_FREETYPE == ENABLED
41# define TGUI_FT2_FONT_DEF(__NAME, __PATH, __SIZE) \
42 __TGUI_FONT_DEF(__NAME, 0)
43#elif VSF_TGUI_CFG_FONT_USE_LVGL == ENABLED
44# define TGUI_LVGL_FONT_DEF(__NAME, __PATH, __SIZE) \
45 __TGUI_FONT_DEF(__NAME, __SIZE)
46#endif
47
48/*============================ TYPES =========================================*/
49
51#if VSF_TGUI_CFG_FONT_USE_FREETYPE == ENABLED
54#endif
55#if VSF_TGUI_CFG_FONT_USE_LVGL == ENABLED
58#endif
60
61typedef struct vsf_tgui_font_t {
62#if VSF_TGUI_CFG_SUPPORT_NAME_STRING == ENABLED
63 const char *name_ptr;
64#endif
67
68 union {
69#if VSF_TGUI_CFG_FONT_USE_FREETYPE == ENABLED
70 struct {
72 const char *font_path_ptr;
73 void *data_ptr;
74 } ft2;
75#endif
76#if VSF_TGUI_CFG_FONT_USE_LVGL == ENABLED
77 void *font; // pointer to lv_font_t
78#endif
79 };
81
82#ifdef VSF_TGUI_FONTS
83enum {
84 VSF_TGUI_FONTS
85};
86#endif
87
88/*============================ GLOBAL VARIABLES ==============================*/
89/*============================ LOCAL VARIABLES ===============================*/
90/*============================ GLOBAL VARIABLES ==============================*/
91/*============================ PROTOTYPES ====================================*/
92
93#if VSF_USE_INPUT == ENABLED
94extern void vsf_tgui_input_init(vsf_tgui_t *gui_ptr, vk_input_notifier_t *notifier);
95#endif
96
98extern uint8_t vsf_tgui_font_number(void);
99extern bool vsf_tgui_fonts_init(vsf_tgui_font_t *font_ptr, size_t font_num, const char *font_dir);
100
101// common APIs for view
102
103extern void vsf_tgui_v_bind_disp(vsf_tgui_t *gui_ptr, vk_disp_t *disp, void *pfb, size_t pfb_size);
104
105#endif
106#endif
107/* EOF */
Definition vsf_disp.h:173
Definition vsf_input.h:114
unsigned char uint8_t
Definition lvgl.h:40
void * pfb
Definition vsf_tgui_sv_port.h:59
size_t pfb_size
Definition vsf_tgui_sv_port.h:67
uint8_t font_index
Definition vsf_tgui_v_type.h:226
Definition vsf_tgui_port.h:61
uint8_t font_size
Definition vsf_tgui_port.h:71
uint8_t height
Definition vsf_tgui_port.h:66
const char * name_ptr
Definition vsf_tgui_port.h:63
void * data_ptr
Definition vsf_tgui_port.h:73
void * font
Definition vsf_tgui_port.h:77
struct vsf_tgui_font_t::@142::@144 ft2
vsf_tgui_font_type_t type
Definition vsf_tgui_port.h:65
const char * font_path_ptr
Definition vsf_tgui_port.h:72
void vsf_tgui_input_init(vsf_tgui_t *gui_ptr, vk_input_notifier_t *notifier)
Definition vsf_tgui_port.c:247
uint8_t vsf_tgui_font_number(void)
Definition vsf_tgui_port.c:267
const vsf_tgui_font_t * vsf_tgui_font_get(uint8_t font_index)
Definition vsf_tgui_port.c:256
vsf_tgui_font_type_t
Definition vsf_tgui_port.h:50
@ VSF_TGUI_FONT_LVGL
Definition vsf_tgui_port.h:56
@ VSF_TGUI_DEFAULT_FONT
Definition vsf_tgui_port.h:53
@ VSF_TGUI_FONT_FT2
Definition vsf_tgui_port.h:52
bool vsf_tgui_fonts_init(vsf_tgui_font_t *font_ptr, size_t font_num, const char *font_dir)
Definition vsf_tgui_font_port_freetype.c:139
void vsf_tgui_v_bind_disp(vsf_tgui_t *gui_ptr, vk_disp_t *disp, void *pfb, size_t pfb_size)
Definition vsf_tgui_sv_port.c:550
vk_input_notifier_t notifier
Definition vsf_xboot.c:31