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 ======================================*/
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/*============================ MACROS ========================================*/
59
60# define __VSF_TGUI_INTERFACE_CONTROLS_PANEL { \
61 .msg_handler = { \
62 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
63 (vsf_msgt_method_fsm_t *)&vsf_tgui_panel_msg_handler, \
64 }, \
65 .Status = (vsf_msgt_method_status_t *) \
66 &vsf_tgui_control_status_get, \
67 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
68 }
69
70/*============================ MACROFIED FUNCTIONS ===========================*/
71
72#define __tgui_set_internal_panel( __OWNER_ADDR, \
73 __MEMBER, \
74 __PREVIOUS, \
75 __NEXT, ...) \
76 (*__OWNER_ADDR) tgui_panel( \
77 __MEMBER, \
78 (__OWNER_ADDR), \
79 __PREVIOUS, \
80 __NEXT, \
81 __VA_ARGS__)
82
83#define tgui_set_internal_panel( __OWNER_ADDR, \
84 __MEMBER, \
85 __PREVIOUS, \
86 __NEXT, ...) \
87 __tgui_set_internal_panel( (__OWNER_ADDR), \
88 __MEMBER, \
89 __PREVIOUS, \
90 __NEXT, \
91 __VA_ARGS__)
92
93
94#define tgui_set_priv_panel( __OWNER_ADDR , \
95 __MEMBER, \
96 ...) \
97 __tgui_set_internal_panel( (__OWNER_ADDR), \
98 __MEMBER, \
99 __MEMBER, \
100 __MEMBER, \
101 __VA_ARGS__)
102
103
104#define __declare_tgui_panel(__NAME) \
105 typedef struct __NAME __NAME;
106#define declare_tgui_panel(__NAME) __declare_tgui_panel(__NAME)
107
108#define __def_tgui_panel(__NAME, ...) \
109 struct __NAME { \
110 implement(vsf_tgui_panel_t) \
111 \
112 union { \
113 vsf_msgt_node_t __NAME##_FirstNode ; \
114 struct { \
115 __VA_ARGS__; \
116 }; \
117 };
118
119#define def_tgui_panel(__NAME, ...) __def_tgui_panel(__NAME, __VA_ARGS__)
120
121#define end_def_tgui_panel(...) \
122 };
123
124#define __describ_tgui_panel(__TYPE, __NAME, ...) \
125 describe_tgui_container_base( \
126 __NAME, \
127 VSF_TGUI_COMPONENT_ID_PANEL, \
128 __TYPE, \
129 VSF_TGUI_V_PANEL_STATIC_INIT_DEFAULT \
130 __VA_ARGS__ \
131 VSF_TGUI_V_PANEL_STATIC_INIT_OVERRIDE \
132 .is_top = true, \
133 )
134
135
136#define describ_tgui_panel(__NAME, __VAR, ...) \
137 __describ_tgui_panel(__NAME, __VAR, __VA_ARGS__)
138
139#define __use_tgui_panel(__NAME, ...) \
140 struct { \
141 implement(vsf_tgui_panel_t) \
142 \
143 union { \
144 vsf_msgt_node_t __NAME##_FirstNode ; \
145 struct { \
146 __VA_ARGS__; \
147 }; \
148 }; \
149 } __NAME;
150
151#define use_tgui_panel(__NAME, ...) __use_tgui_panel(__NAME, ##__VA_ARGS__)
152
153
154#define __tgui_panel(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
155 tgui_container_base( \
156 __NAME, \
157 VSF_TGUI_COMPONENT_ID_PANEL, \
158 vsf_tgui_panel_t, \
159 (__PARENT_ADDR), \
160 __PREVIOUS, \
161 __NEXT, \
162 VSF_TGUI_V_PANEL_STATIC_INIT_DEFAULT \
163 __VA_ARGS__ \
164 VSF_TGUI_V_PANEL_STATIC_INIT_OVERRIDE \
165 .is_top = false, \
166 )
167
168#define tgui_panel(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
169 __tgui_panel( __NAME, \
170 (__PARENT_ADDR), \
171 __PREVIOUS, \
172 __NEXT, \
173 __VA_ARGS__)
174
175/*============================ TYPES =========================================*/
176
177declare_class(vsf_tgui_panel_t)
178
179def_class(vsf_tgui_panel_t,
180 which(
182 implement(vsf_tgui_v_panel_t)
183 )
184
186 public_member(
188 )
189
191 protected_member(
192 vsf_tgui_label_t tTitleLabel;
194#endif
195)
196
197end_def_class(vsf_tgui_panel_t)
198
199/*============================ GLOBAL VARIABLES ==============================*/
200/*============================ PROTOTYPES ====================================*/
201
202extern
203fsm_rt_t vk_tgui_panel_init(vsf_tgui_panel_t* ptPanel);
204
205extern
206fsm_rt_t vk_tgui_panel_update(vsf_tgui_panel_t* ptPanel);
207
208extern
209fsm_rt_t vsf_tgui_panel_msg_handler( vsf_tgui_panel_t* control_ptr,
211#endif
212/* EOF */
#define ENABLED
Definition __type.h:28
Definition vsf_tgui_common.h:509
Definition vsf_tgui_common.h:326
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:232
struct vsf_tgui_root_container_t vsf_tgui_root_container_t
Definition vsf_tgui_common.h:507
which(union { inherit(vsf_msgt_container_t) vsf_tgui_control_t };vsf_tgui_v_container_t) implement_ex(struct
Definition vsf_tgui_control.h:540
which(vsf_tgui_control_t vsf_tgui_v_label_t) public vsf_tgui_msg_t * ptMSG
Definition vsf_tgui_label.h:157
fsm_rt_t vk_tgui_panel_init(vsf_tgui_panel_t *ptPanel)
Definition vsf_tgui_panel.c:101
fsm_rt_t vsf_tgui_panel_msg_handler(vsf_tgui_panel_t *control_ptr, vsf_tgui_msg_t *ptMSG)
Definition vsf_tgui_panel.c:74
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:180
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:82