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 ======================================*/
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/*============================ MACROS ========================================*/
62
63#define __VSF_TGUI_INTERFACE_CONTROLS_TEXT_LIST { \
64 .msg_handler = { \
65 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
66 (vsf_msgt_method_fsm_t *)&vsf_tgui_text_list_msg_handler, \
67 }, \
68 .Status = (vsf_msgt_method_status_t *) \
69 &vsf_tgui_control_status_get, \
70 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
71 }
72
73/*============================ MACROFIED FUNCTIONS ===========================*/
74
75
76#define __tgui_text_list(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
77 tgui_control_base( __NAME, \
78 VSF_TGUI_COMPONENT_ID_TEXT_LIST, \
79 vsf_tgui_text_list_t, \
80 (__PARENT_ADDR), \
81 __PREVIOUS, \
82 __NEXT, \
83 VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
84 VSF_TGUI_V_TEXT_LIST_STATIC_INIT_DEFAULT \
85 __VA_ARGS__ \
86 VSF_TGUI_V_TEXT_LIST_STATIC_INIT_OVERRIDE \
87 .tList.is_container = true, \
88 .tList.node_ptr = (vsf_msgt_node_t*) \
89 &((&((__PARENT_ADDR)->__NAME))->tList.tList##_FirstNode), \
90 .tList.parent_ptr = (vsf_msgt_container_t *) \
91 &(((vsf_tgui_container_t *)(&((__PARENT_ADDR)->__NAME)))->use_as__vsf_msgt_node_t), \
92 .tList.id = (VSF_TGUI_COMPONENT_ID_CONTAINER), \
93 .tList \
94 __tgui_name_string_tag(__NAME.tList, vsf_tgui_text_list_t) \
95 .tList.is_control_transparent = true, \
96 .tList.bIsEnabled = true, \
97 .tList.bIsVisible = true, \
98 .tList.ContainerAttribute \
99 .u5Type = VSF_TGUI_CONTAINER_TYPE_LINE_STREAM_VERTICAL, \
100 .tList.ContainerAttribute.bIsAutoSize = true, \
101 .is_container = true, \
102 .node_ptr = \
103 (vsf_msgt_node_t*) \
104 &((__PARENT_ADDR)->__NAME.tList), \
105 .ContainerAttribute \
106 .u5Type = VSF_TGUI_CONTAINER_TYPE_PLANE, \
107 .bIsHideContentInsideContainer = true, \
108 VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE \
109 )
110
111
112#define tgui_text_list(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
113 __tgui_text_list( __NAME, \
114 (__PARENT_ADDR), \
115 __PREVIOUS, \
116 __NEXT, \
117 __VA_ARGS__)
118
119# define tgui_text_list_content(...) \
120 .tList.tContent = (vsf_tgui_label_t){ \
121 VSF_TGUI_V_LABEL_STATIC_INIT_DEFAULT \
122 VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_DEFAULT \
123 __VA_ARGS__ \
124 VSF_TGUI_V_LABEL_STATIC_INIT_OVERRIDE \
125 VSF_TGUI_V_TEXT_LIST_CONTENT_INIT_OVERRIDE \
126 .id = VSF_TGUI_COMPONENT_ID_LABEL, \
127 .Offset = { \
128 .next = sizeof(vsf_tgui_label_t), \
129 }, \
130 __tgui_name_string_tag(tContent, vsf_tgui_label_t) \
131 .bIsEnabled = true, \
132 .bIsVisible = true, \
133 .tLabel.bIsAutoSize = true, \
134 },
135
136/*============================ TYPES =========================================*/
137
138declare_class(vsf_tgui_text_list_t)
139
140def_class(vsf_tgui_text_list_t,
142 implement(vsf_tgui_container_t)
143 implement(vsf_tgui_v_text_list_t)
144 )
145
146
147 use_tgui_container(tList,
148 public_member(
149 vsf_tgui_label_t tContent;
151 private_member(
152 vsf_tgui_label_t tBuffer;
153 )
154 )
155
157 union {
158 private_member(
159 implement(__vk_tgui_slider_t);
160 int16_t iOldLineSelect;
161 uint16_t hwLineCount;
162 int16_t iLineSelect;
163 )
164 inherit_ex(__vk_tgui_slider_t, tSlider);
165 };
166#else
167 private_member(
168 uint16_t hwLineCount;
169 int16_t iLineSelect;
170 )
171#endif
172
173)
174end_def_class(vsf_tgui_text_list_t)
175
176/*============================ GLOBAL VARIABLES ==============================*/
177/*============================ PROTOTYPES ====================================*/
178extern
179fsm_rt_t vsf_tgui_text_list_msg_handler(vsf_tgui_text_list_t* control_ptr,
180 vsf_tgui_msg_t* ptMSG);
181extern
182fsm_rt_t vk_tgui_text_list_init(vsf_tgui_text_list_t* ptLabel);
183
184extern
185fsm_rt_t vk_tgui_text_list_update(vsf_tgui_text_list_t* ptLabel);
186
187extern
188int_fast16_t vsf_tgui_text_list_select_get(vsf_tgui_text_list_t* ptTextList);
189
190extern
191void vsf_tgui_text_list_select_set( vsf_tgui_text_list_t* ptTextList,
192 int_fast16_t iSelect);
193
194#endif
195#endif
196/* EOF */
197
#define ENABLED
Definition __type.h:28
unsigned short uint16_t
Definition stdint.h:7
short int16_t
Definition stdint.h:6
short int_fast16_t
Definition stdint.h:24
Definition vsf_tgui_common.h:509
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:209
#define use_tgui_container(__NAME,...)
Definition vsf_tgui_control.h:284
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:451
fsm_rt_t vk_tgui_text_list_update(vsf_tgui_text_list_t *ptTextList)
Definition vsf_tgui_text_list.c:362
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:281
int_fast16_t vsf_tgui_text_list_select_get(vsf_tgui_text_list_t *ptTextList)
Definition vsf_tgui_text_list.c:435
fsm_rt_t vk_tgui_text_list_init(vsf_tgui_text_list_t *ptTextList)
Definition vsf_tgui_text_list.c:412
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:150
which(vsf_tgui_container_t vsf_tgui_v_text_list_t) use_tgui_container(tList