VSF Documented
vsf_tgui_panel.h
Go to the documentation of this file.
1/****************************************************************************
2* Copyright 2020 by Gorgon Meducer (Email:embedded_zhuoran@hotmail.com) *
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(C)2009-2022 by VSF Team *
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_PANEL_H__
36#define __VSF_TGUI_CONTROLS_PANEL_H__
37
38/*============================ INCLUDES ======================================*/
39
40#include "./vsf_tgui_label.h"
41#include "./vsf_tgui_control.h"
42
48#if defined(__VSF_TGUI_CONTROLS_PANEL_CLASS_IMPLEMENT)
49# define __PLOOC_CLASS_IMPLEMENT__
50# undef __VSF_TGUI_CONTROLS_PANEL_CLASS_IMPLEMENT
51#elif defined(__VSF_TGUI_CONTROLS_PANEL_CLASS_INHERIT)
52# define __PLOOC_CLASS_INHERIT__
53# undef __VSF_TGUI_CONTROLS_PANEL_CLASS_INHERIT
54#endif
55
56#include "utilities/ooc_class.h"
57
58#ifdef __cplusplus
59extern "C" {
60#endif
61
62/*============================ MACROS ========================================*/
63
64# define __VSF_TGUI_INTERFACE_CONTROLS_PANEL { \
65 .msg_handler = { \
66 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
67 (vsf_msgt_method_fsm_t *)&vsf_tgui_panel_msg_handler, \
68 }, \
69 .Status = (vsf_msgt_method_status_t *) \
70 &vsf_tgui_control_status_get, \
71 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
72 }
73
74/*============================ MACROFIED FUNCTIONS ===========================*/
75
76#define __tgui_set_internal_panel( __OWNER_ADDR, \
77 __MEMBER, \
78 __PREVIOUS, \
79 __NEXT, ...) \
80 (*__OWNER_ADDR) tgui_panel( \
81 __MEMBER, \
82 (__OWNER_ADDR), \
83 __PREVIOUS, \
84 __NEXT, \
85 __VA_ARGS__)
86
87#define tgui_set_internal_panel( __OWNER_ADDR, \
88 __MEMBER, \
89 __PREVIOUS, \
90 __NEXT, ...) \
91 __tgui_set_internal_panel( (__OWNER_ADDR), \
92 __MEMBER, \
93 __PREVIOUS, \
94 __NEXT, \
95 __VA_ARGS__)
96
97
98#define tgui_set_priv_panel( __OWNER_ADDR , \
99 __MEMBER, \
100 ...) \
101 __tgui_set_internal_panel( (__OWNER_ADDR), \
102 __MEMBER, \
103 __MEMBER, \
104 __MEMBER, \
105 __VA_ARGS__)
106
107
108#define __declare_tgui_panel(__NAME) \
109 typedef struct __NAME __NAME;
110#define declare_tgui_panel(__NAME) __declare_tgui_panel(__NAME)
111
112#define __def_tgui_panel_ex(__NAME, __VAR_NAME, ...) \
113 typedef struct __NAME { \
114 implement(vsf_tgui_panel_t) \
115 \
116 union { \
117 vsf_msgt_node_t __VAR_NAME##_FirstNode ; \
118 struct { \
119 __VA_ARGS__; \
120 }; \
121 };
122
123#define def_tgui_panel(__NAME, ...) \
124 __def_tgui_panel_ex(__NAME, __NAME, __VA_ARGS__)
125#define def_tgui_panel_ex(__NAME, __VAR_NAME, ...) \
126 __def_tgui_panel_ex(__NAME, __VAR_NAME, __VA_ARGS__)
127
128#define end_def_tgui_panel(__NAME) \
129 } __NAME;
130
131#define __describ_tgui_panel(__TYPE, __NAME, ...) \
132 describe_tgui_container_base( \
133 __NAME, \
134 VSF_TGUI_COMPONENT_ID_PANEL, \
135 __TYPE, \
136 VSF_TGUI_V_PANEL_STATIC_INIT_DEFAULT \
137 __VA_ARGS__ \
138 VSF_TGUI_V_PANEL_STATIC_INIT_OVERRIDE \
139 .is_top = true, \
140 )
141
142
143#define describ_tgui_panel(__NAME, __VAR, ...) \
144 __describ_tgui_panel(__NAME, __VAR, __VA_ARGS__)
145
146#define __use_tgui_panel(__NAME, ...) \
147 struct { \
148 implement(vsf_tgui_panel_t) \
149 \
150 union { \
151 vsf_msgt_node_t __NAME##_FirstNode ; \
152 struct { \
153 __VA_ARGS__; \
154 }; \
155 }; \
156 } __NAME;
157
158#define use_tgui_panel(__NAME, ...) __use_tgui_panel(__NAME, ##__VA_ARGS__)
159
160
161#define __tgui_panel(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
162 tgui_container_base( \
163 __NAME, \
164 VSF_TGUI_COMPONENT_ID_PANEL, \
165 vsf_tgui_panel_t, \
166 (__PARENT_ADDR), \
167 __PREVIOUS, \
168 __NEXT, \
169 VSF_TGUI_V_PANEL_STATIC_INIT_DEFAULT \
170 __VA_ARGS__ \
171 VSF_TGUI_V_PANEL_STATIC_INIT_OVERRIDE \
172 .is_top = false, \
173 )
174
175#define tgui_panel(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
176 __tgui_panel( __NAME, \
177 (__PARENT_ADDR), \
178 __PREVIOUS, \
179 __NEXT, \
180 __VA_ARGS__)
181
182/*============================ TYPES =========================================*/
183
184declare_class(vsf_tgui_panel_t)
185
186def_class(vsf_tgui_panel_t,
187 which(
189 implement(vsf_tgui_v_panel_t)
190 )
191
193 public_member(
195 )
196
198 protected_member(
199 vsf_tgui_label_t tTitleLabel;
201#endif
202)
203
204end_def_class(vsf_tgui_panel_t)
205
206/*============================ GLOBAL VARIABLES ==============================*/
207/*============================ PROTOTYPES ====================================*/
208
209extern
210fsm_rt_t vk_tgui_panel_init(vsf_tgui_panel_t* ptPanel);
211
212extern
213fsm_rt_t vk_tgui_panel_update(vsf_tgui_panel_t* ptPanel);
214
215extern
218
219#ifdef __cplusplus
220}
221#endif
222
223#endif
224/* EOF */
#define ENABLED
Definition __type.h:28
Definition vsf_tgui_common.h:558
Definition vsf_tgui_common.h:371
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_PANEL_HAS_LABEL
Definition vsf_tgui_cfg.h:239
struct vsf_tgui_root_container_t vsf_tgui_root_container_t
Definition vsf_tgui_common.h:556
which(union { inherit(vsf_msgt_container_t) vsf_tgui_control_t };vsf_tgui_v_container_t) implement_ex(struct
Definition vsf_tgui_control.h:566
which(vsf_tgui_control_t vsf_tgui_v_label_t) public vsf_tgui_msg_t * ptMSG
Definition vsf_tgui_label.h:161
fsm_rt_t vk_tgui_panel_init(vsf_tgui_panel_t *ptPanel)
Definition vsf_tgui_panel.c:102
fsm_rt_t vsf_tgui_panel_msg_handler(vsf_tgui_panel_t *control_ptr, vsf_tgui_msg_t *ptMSG)
Definition vsf_tgui_panel.c:75
end_def_class(vsf_tgui_panel_t) extern fsm_rt_t vk_tgui_panel_init(vsf_tgui_panel_t *ptPanel)
vsf_tgui_label_t tTitleLabel
Definition vsf_tgui_panel.h:187
declare_class(vsf_tgui_panel_t) def_class(vsf_tgui_panel_t
fsm_rt_t vk_tgui_panel_update(vsf_tgui_panel_t *ptPanel)
Definition vsf_tgui_panel.c:83
const vsf_tgui_control_t * control_ptr
Definition vsf_tgui_scguiv_port.h:91