VSF Documented
vsf_tgui_text_list.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#ifndef __VSF_TGUI_CONTROLS_TEXT_LIST_H__
36#define __VSF_TGUI_CONTROLS_TEXT_LIST_H__
37
38/*============================ INCLUDES ======================================*/
39
40#include "./vsf_tgui_list.h"
41#include "./vsf_tgui_label.h"
42#include "./__vk_tgui_slider.h"
43
44#if VSF_TGUI_CFG_SUPPORT_TEXT_LIST == ENABLED
45
51#if defined(__VSF_TGUI_CONTROLS_TEXT_LIST_CLASS_IMPLEMENT)
52# define __PLOOC_CLASS_IMPLEMENT__
53# undef __VSF_TGUI_CONTROLS_TEXT_LIST_CLASS_IMPLEMENT
54#elif defined(__VSF_TGUI_CONTROLS_TEXT_LIST_CLASS_INHERIT)
55# define __PLOOC_CLASS_INHERIT__
56# undef __VSF_TGUI_CONTROLS_TEXT_LIST_CLASS_INHERIT
57#endif
58
59#include "utilities/ooc_class.h"
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64
65/*============================ MACROS ========================================*/
66
67#define __VSF_TGUI_INTERFACE_CONTROLS_TEXT_LIST { \
68 .msg_handler = { \
69 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
70 (vsf_msgt_method_fsm_t *)&vsf_tgui_text_list_msg_handler, \
71 }, \
72 .Status = (vsf_msgt_method_status_t *) \
73 &vsf_tgui_control_status_get, \
74 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
75 }
76
77/*============================ MACROFIED FUNCTIONS ===========================*/
78
79
80#define __tgui_text_list(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
81 tgui_control_base( __NAME, \
82 VSF_TGUI_COMPONENT_ID_TEXT_LIST, \
83 vsf_tgui_text_list_t, \
84 (__PARENT_ADDR), \
85 __PREVIOUS, \
86 __NEXT, \
87 VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
88 VSF_TGUI_V_TEXT_LIST_STATIC_INIT_DEFAULT \
89 __VA_ARGS__ \
90 VSF_TGUI_V_TEXT_LIST_STATIC_INIT_OVERRIDE \
91 .tList.is_container = true, \
92 .tList.node_ptr = (vsf_msgt_node_t*) \
93 &((&((__PARENT_ADDR)->__NAME))->tList.tList##_FirstNode), \
94 .tList.parent_ptr = (vsf_msgt_container_t *) \
95 &(((vsf_tgui_container_t *)(&((__PARENT_ADDR)->__NAME)))->use_as__vsf_msgt_node_t), \
96 .tList.id = (VSF_TGUI_COMPONENT_ID_CONTAINER), \
97 .tList \
98 __tgui_name_string_tag(__NAME.tList, vsf_tgui_text_list_t) \
99 .tList.bIsTransparent = true, \
100 .tList.bIsEnabled = true, \
101 .tList.bIsVisible = true, \
102 .tList.ContainerAttribute \
103 .u5Type = VSF_TGUI_CONTAINER_TYPE_LINE_STREAM_VERTICAL, \
104 .tList.ContainerAttribute.bIsAutoSize = true, \
105 .is_container = true, \
106 .node_ptr = \
107 (vsf_msgt_node_t*) \
108 &((__PARENT_ADDR)->__NAME.tList), \
109 .ContainerAttribute \
110 .u5Type = VSF_TGUI_CONTAINER_TYPE_PLANE, \
111 .bIsHideContentInsideContainer = true, \
112 VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE \
113 )
114
115
116#define tgui_text_list(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
117 __tgui_text_list( __NAME, \
118 (__PARENT_ADDR), \
119 __PREVIOUS, \
120 __NEXT, \
121 __VA_ARGS__)
122
123# define tgui_text_list_content(...) \
124 .tList.tContent = (vsf_tgui_label_t){ \
125 VSF_TGUI_V_LABEL_STATIC_INIT_DEFAULT \
126 VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_DEFAULT \
127 __VA_ARGS__ \
128 VSF_TGUI_V_LABEL_STATIC_INIT_OVERRIDE \
129 VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_OVERRIDE \
130 .id = VSF_TGUI_COMPONENT_ID_LABEL, \
131 .Offset = { \
132 .next = sizeof(vsf_tgui_label_t), \
133 }, \
134 __tgui_name_string_tag(tContent, vsf_tgui_label_t) \
135 .bIsEnabled = true, \
136 .bIsVisible = true, \
137 .tLabel.bIsAutoSize = true, \
138 },
139
140/*============================ TYPES =========================================*/
141
142declare_class(vsf_tgui_text_list_t)
143
144def_class(vsf_tgui_text_list_t,
146 implement(vsf_tgui_container_t)
147 implement(vsf_tgui_v_text_list_t)
148 )
149
150
151 use_tgui_container(tList,
152 public_member(
153 vsf_tgui_label_t tContent;
155 private_member(
156 vsf_tgui_label_t tBuffer;
157 )
158 )
159
161 union {
162 private_member(
163 implement(__vk_tgui_slider_t);
164 int16_t iOldLineSelect;
165 uint16_t hwLineCount;
166 int16_t iLineSelect;
167 )
168 inherit_ex(__vk_tgui_slider_t, tSlider);
169 };
170#else
171 private_member(
172 uint16_t hwLineCount;
173 int16_t iLineSelect;
174 )
175#endif
176
177)
178end_def_class(vsf_tgui_text_list_t)
179
180/*============================ GLOBAL VARIABLES ==============================*/
181/*============================ PROTOTYPES ====================================*/
182extern
184 vsf_tgui_msg_t* ptMSG);
185extern
186fsm_rt_t vk_tgui_text_list_init(vsf_tgui_text_list_t* ptLabel);
187
188extern
189fsm_rt_t vk_tgui_text_list_update(vsf_tgui_text_list_t* ptLabel);
190
191extern
192int_fast16_t vsf_tgui_text_list_select_get(vsf_tgui_text_list_t* ptTextList);
193
194extern
195void vsf_tgui_text_list_select_set( vsf_tgui_text_list_t* ptTextList,
196 int_fast16_t iSelect);
197
198#ifdef __cplusplus
199}
200#endif
201
202#endif
203#endif
204/* EOF */
205
#define ENABLED
Definition __type.h:28
signed short int16_t
Definition lvgl.h:42
unsigned short uint16_t
Definition lvgl.h:41
short int_fast16_t
Definition stdint.h:24
Definition vsf_tgui_common.h:558
fsm_rt_t
Definition vsf_fsm.h:315
def_class(vsf_stream_fifo_t, which(vsf_stream_tx_t TX;vsf_stream_rx_t RX;), private:vsf_slist_queue_t union { vsf_stream_fifo_cfg_t cfg;struct { vsf_stream_dat_rdy_evt_t tDataReadyEventHandling;vsf_stream_dat_drn_evt_t tDataDrainEventHandling;vsf_stream_status_t Status;#if !defined(VSF_PBUF_QUEUE_CFG_ATOM_ACCESS) vsf_protect_region_t *pregion;#endif };};) end_def_class(vsf_stream_fifo_t) extern vsf_err_t vsf_stream_fifo_init(vsf_stream_fifo_t *obj_ptr
#define VSF_TGUI_CFG_TEXT_LIST_SUPPORT_SLIDE
Definition vsf_tgui_cfg.h:216
#define use_tgui_container(__NAME,...)
Definition vsf_tgui_control.h:302
const vsf_tgui_control_t * control_ptr
Definition vsf_tgui_scguiv_port.h:91
void vsf_tgui_text_list_select_set(vsf_tgui_text_list_t *ptTextList, int_fast16_t iSelect)
set the index of selection ! !
Definition vsf_tgui_text_list.c:453
fsm_rt_t vk_tgui_text_list_update(vsf_tgui_text_list_t *ptTextList)
Definition vsf_tgui_text_list.c:363
fsm_rt_t vsf_tgui_text_list_msg_handler(vsf_tgui_text_list_t *ptTextList, vsf_tgui_msg_t *ptMSG)
Definition vsf_tgui_text_list.c:282
int_fast16_t vsf_tgui_text_list_select_get(vsf_tgui_text_list_t *ptTextList)
Definition vsf_tgui_text_list.c:437
fsm_rt_t vk_tgui_text_list_init(vsf_tgui_text_list_t *ptTextList)
Definition vsf_tgui_text_list.c:413
declare_class(vsf_tgui_text_list_t) def_class(vsf_tgui_text_list_t
vsf_tgui_label_t tContent
Definition vsf_tgui_text_list.h:154
which(vsf_tgui_container_t vsf_tgui_v_text_list_t) use_tgui_container(tList