35#ifndef __VSF_TGUI_CONTROLS_CONTROL_H__
36#define __VSF_TGUI_CONTROLS_CONTROL_H__
46#if defined(__VSF_TGUI_CONTROLS_CONTROL_CLASS_IMPLEMENT)
47# define __PLOOC_CLASS_IMPLEMENT__
48# undef __VSF_TGUI_CONTROLS_CONTROL_CLASS_IMPLEMENT
49#elif defined(__VSF_TGUI_CONTROLS_CONTROL_CLASS_INHERIT)
50# define __PLOOC_CLASS_INHERIT__
51# undef __VSF_TGUI_CONTROLS_CONTROL_CLASS_INHERIT
57#define __VSF_TGUI_INTERFACE_CONTROLS_CONTROL { \
59 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
60 (vsf_msgt_method_fsm_t *)&vsf_tgui_control_msg_handler, \
62 .Status = (vsf_msgt_method_status_t *) \
63 &vsf_tgui_control_status_get, \
64 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
67#define __VSF_TGUI_INTERFACE_CONTROLS_CONTAINER { \
69 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
70 (vsf_msgt_method_fsm_t *)&vsf_tgui_container_msg_handler, \
72 .Status = (vsf_msgt_method_status_t *) \
73 &vsf_tgui_control_status_get, \
74 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
78#define VSF_TGUI_CTRL_STATUS_INITIALISED VSF_BIT(0)
79#define VSF_TGUI_CTRL_STATUS_ENABLED VSF_BIT(1)
80#define VSF_TGUI_CTRL_STATUS_VISIBLE VSF_BIT(2)
81#define VSF_TGUI_CTRL_STATUS_ACTIVE VSF_BIT(3)
82#define VSF_TGUI_CTRL_STATUS_HIDE_CONTAINER_CONTENT VSF_BIT(4)
86#if VSF_TGUI_CFG_SUPPORT_NAME_STRING == ENABLED
87# define ____tgui_name_string_tag(__name, __type) \
88 .node_name_ptr = "["#__type"]["#__name"]",
90# define ____tgui_name_string_tag(__name, __type)
93#define __tgui_name_string_tag(__name, __type) \
94 ____tgui_name_string_tag(__name, __type)
96#if VSF_MSG_TREE_CFG_SUPPORT_DUAL_LIST == ENABLED
97# define ____tgui_node_list_init(__name, __parent_addr, __previous, __next) \
99 .previous = (intptr_t)&((__parent_addr)->__name) \
100 - (intptr_t)&((__parent_addr)->__previous), \
101 .next = (intptr_t)&((__parent_addr)->__next) \
102 - (intptr_t)&((__parent_addr)->__name), \
105# define ____tgui_node_list_init(__name, __parent_addr, __previous, __next) \
107 .next = (intptr_t)&((__parent_addr)->__next) \
108 - (intptr_t)&((__parent_addr)->__name), \
113#define __tgui_node_list_init(__name, __parent_addr, __previous, __next) \
114 ____tgui_node_list_init(__name, __parent_addr, __previous, __next)
116#define __tgui_control_base( __NAME, \
124 .parent_ptr = (vsf_msgt_container_t *) \
125 &(((__TYPE *)(__PARENT_ADDR))->use_as__vsf_msgt_node_t), \
127 __tgui_node_list_init(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT)\
128 __tgui_name_string_tag(__NAME, __TYPE) \
129 .bIsEnabled = true, \
130 .bIsVisible = true, \
131 VSF_TGUI_V_CONTROL_STATIC_INIT_DEFAULT \
133 VSF_TGUI_V_CONTROL_STATIC_INIT_OVERRIDE \
136#define __tgui_control_base_const( __NAME, \
143 .__NAME = (const __TYPE) { \
144 .parent_ptr = (vsf_msgt_container_t *) \
145 &((__PARENT_ADDR)->use_as__vsf_msgt_node_t), \
147 __tgui_node_list_init(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT)\
148 __tgui_name_string_tag(__NAME, __TYPE) \
149 .bIsEnabled = true, \
150 .bIsVisible = true, \
151 VSF_TGUI_V_CONTROL_STATIC_INIT_DEFAULT \
153 VSF_TGUI_V_CONTROL_STATIC_INIT_OVERRIDE \
156#define __describe_tgui_control_base( __NAME, \
160 static const __TYPE __NAME = { \
162 __tgui_name_string_tag(__VAR, __TYPE) \
163 .bIsEnabled = true, \
164 .bIsVisible = true, \
165 VSF_TGUI_V_CONTROL_STATIC_INIT_DEFAULT \
167 VSF_TGUI_V_CONTROL_STATIC_INIT_OVERRIDE \
171#define __describe_tgui_container_base( __NAME, \
175 __describe_tgui_control_base( \
179 .is_container = true, \
180 .ContainerAttribute.bIsAutoSize = true, \
183 &((*(__TYPE *)0).__TYPE##_FirstNode), \
184 VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
186 VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE \
189#define describe_tgui_container_base( __NAME, \
193 __describe_tgui_container_base( __NAME, \
198#define tgui_control_base( __NAME, \
205 __tgui_control_base( \
214#define tgui_control_base_const( __NAME, \
221 __tgui_control_base_const( \
231#define describe_tgui_control_base( __NAME, \
235 __describe_tgui_control_base( __NAME, \
241#define __tgui_control(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
242 tgui_control_base( __NAME, \
243 VSF_TGUI_COMPONENT_ID_CONTROL, \
244 vsf_tgui_control_t, \
250#define tgui_control(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
251 __tgui_control( __NAME, \
257#define __tgui_control_const(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
258 tgui_control_base_const(__NAME, \
259 VSF_TGUI_COMPONENT_ID_CONTROL, \
260 vsf_tgui_control_t, \
266#define tgui_control_const(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
267 __tgui_control_const( __NAME, \
273#define __use_tgui_container(__NAME, ...) \
275 implement(vsf_tgui_container_t) \
277 vsf_msgt_node_t __NAME##_FirstNode ; \
284#define use_tgui_container(__NAME, ...) __use_tgui_container(__NAME, __VA_ARGS__)
288#define __tgui_container_base( __NAME, \
302 .is_container = true, \
303 .ContainerAttribute.bIsAutoSize = true, \
306 &((__PARENT_ADDR)->__NAME.__NAME##_FirstNode), \
307 VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
309 VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE \
312#define tgui_container_base(__NAME, \
319 __tgui_container_base( __NAME, \
327#define __tgui_container_base_const(__NAME, \
334 tgui_control_base_const( __NAME, \
340 .is_container = true, \
341 .ContainerAttribute.bIsAutoSize = true, \
344 &((__PARENT_ADDR)->__NAME.__NAME##_FirstNode), \
345 VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
347 VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE \
350#define tgui_container_base_const(__NAME, \
357 __tgui_container_base_const(__NAME, \
365# define __tgui_container( __NAME, \
369 tgui_container_base(__NAME, \
370 VSF_TGUI_COMPONENT_ID_CONTAINER, \
371 vsf_tgui_container_t, \
378#define tgui_container( __NAME, \
383 __tgui_container(__NAME, \
443 const char *handler_name_ptr;
454#if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_PADDING == ENABLED ||\
455 VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_MARGIN == ENABLED
467 implement(vsf_msgt_node_t)
468 vsf_msgt_node_t* node_ptr;
472 #if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_ANCHOR == ENABLED
476 #if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_DOCK == ENABLED
480 #if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_MARGIN == ENABLED
484 #if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_ALIGN == ENABLED
505 #if VSF_TGUI_CFG_SUPPORT_NAME_STRING == ENABLED
506 const char *name_ptr;
525 uint8_t bIsHideContentInsideContainer : 1;
526 uint8_t is_control_transparent : 1;
532 implement(vsf_tgui_v_control_t)
542 inherit(vsf_msgt_container_t)
545 implement(vsf_tgui_v_container_t)
553 uint8_t is_forced_to_refresh_whole_background : 1;
574 which(implement(vsf_tgui_container_t))
584 VSF_TGUI_CONTROL_REFRESHED_BY_PARENT = 0,
585 VSF_TGUI_CONTROL_REFRESHED_DIRECTLY_BY_USER
607#if VSF_TGUI_CFG_SUPPORT_TIMER == ENABLED
639#if VSF_TGUI_CFG_SUPPORT_TIMER == ENABLED
752 bool is_control_transparent);
771 const vsf_tgui_container_t *container_ptr);
784#if VSF_TGUI_CFG_REFRESH_SCHEME != VSF_TGUI_REFRESH_SCHEME_NONE
#define ENABLED
Definition __type.h:28
unsigned short uint16_t
Definition stdint.h:7
unsigned char uint_fast8_t
Definition stdint.h:23
unsigned uint32_t
Definition stdint.h:9
unsigned char uint8_t
Definition stdint.h:5
signed char int8_t
Definition stdint.h:4
Definition vsf_tgui_control.h:601
vsf_tgui_method_t * Update
Definition vsf_tgui_control.h:604
vsf_tgui_method_t * Init
Definition vsf_tgui_control.h:603
i_tgui_v_vtable_t tView
Definition vsf_tgui_control.h:602
Definition vsf_tgui_control.h:593
vsf_tgui_v_method_render_t * Render
Definition vsf_tgui_control.h:596
vsf_tgui_method_t * Init
Definition vsf_tgui_control.h:594
vsf_tgui_method_t * Depose
Definition vsf_tgui_control.h:595
vsf_tgui_method_t * Update
Definition vsf_tgui_control.h:598
vsf_tgui_v_method_render_t * ContainerPostRender
Definition vsf_tgui_control.h:597
Definition vsf_tgui_control.h:429
uint16_t u10EvtMask
0 means no mask
Definition vsf_tgui_control.h:432
implement_ex(union { vsf_tgui_controal_fsm_t *FSM;vsf_eda_t *ptEDA;vsf_tgui_control_subcall_t *ptSubCall;}, fn) const char *handler_name_ptr
uint16_t u2Type
vsf_msgt_handler_type_t
Definition vsf_tgui_control.h:430
Definition vsf_tgui_common.h:226
Definition vsf_tgui_control.h:456
int8_t chLeft
Definition vsf_tgui_control.h:457
int8_t chTop
Definition vsf_tgui_control.h:458
int8_t chBottom
Definition vsf_tgui_control.h:460
int8_t chRight
Definition vsf_tgui_control.h:459
Definition vsf_tgui_common.h:509
Definition vsf_tgui_common.h:236
Definition vsf_tgui_common.h:231
Definition vsf_tgui_control.h:448
Definition vsf_tgui_common.h:539
Definition vsf_tgui_control.h:394
uint8_t bIsEnabled
Definition vsf_tgui_control.h:400
uint8_t chStatus
Definition vsf_tgui_control.h:395
uint8_t bIsHideContentInsideContainer
Definition vsf_tgui_control.h:403
uint8_t __is_the_first_node_for_refresh
Definition vsf_tgui_control.h:410
uint8_t is_control_transparent
Definition vsf_tgui_control.h:404
uint8_t bIsVisible
Definition vsf_tgui_control.h:401
uint8_t bIsInitialised
Definition vsf_tgui_control.h:399
struct vsf_tgui_status_t::@138 Values
uint8_t __does_contain_builtin_structure
Definition vsf_tgui_control.h:411
uint8_t bIsActive
Definition vsf_tgui_control.h:402
Definition vsf_tgui_common.h:395
void(* vsf_param_eda_evthandler_t)(uintptr_t target, vsf_evt_t evt)
Definition vsf_eda.h:658
fsm_rt_t
Definition vsf_fsm.h:315
vsf_msgt_msg_t
Definition vsf_msg_tree.h:79
vsf_msgt_container_t * parent_ptr
parent node
Definition vsf_msg_tree.h:187
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
uintptr_t item_ptr
Definition vsf_pool.h:476
#define VSF_TGUI_CFG_SUPPORT_NAME_STRING
Definition vsf_tgui_cfg.h:117
#define VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_PADDING
Definition vsf_tgui_cfg.h:86
vsf_tgui_align_mode_t
Definition vsf_tgui_common.h:242
vsf_tgui_anchor_mode_t
Definition vsf_tgui_common.h:287
vsf_tgui_dock_mode_t
Definition vsf_tgui_common.h:275
struct vsf_tgui_control_t vsf_tgui_control_t
Definition vsf_tgui_common.h:506
struct vsf_tgui_root_container_t vsf_tgui_root_container_t
Definition vsf_tgui_common.h:507
bool vsf_tgui_control_is_in_range(const vsf_tgui_region_t *region_ptr, const vsf_tgui_location_t *ptLocation)
Definition vsf_tgui_control.c:282
vsf_tgui_size_t * vsf_tgui_control_get_size(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:226
vsf_tgui_region_t * vsf_tgui_get_absolute_control_region(const vsf_tgui_control_t *control_ptr, vsf_tgui_region_t *ptRegionBuffer)
Definition vsf_tgui_control.c:270
vsf_tgui_region_t * vsf_tgui_control_get_relative_region(const vsf_tgui_control_t *control_ptr, vsf_tgui_region_t *ptAbsoluteRegion)
Definition vsf_tgui_control.c:344
bool vsf_tgui_timer_is_working(vsf_tgui_timer_t *ptTimer)
Definition vsf_tgui_control.c:174
fsm_rt_t vsf_tgui_container_msg_handler(vsf_tgui_container_t *control_ptr, vsf_tgui_msg_t *ptMSG)
Definition vsf_tgui_control.c:1101
bool vsf_tgui_control_is_container(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:447
fsm_rt_t vk_tgui_container_update(vsf_tgui_container_t *container_ptr)
Definition vsf_tgui_control.c:1510
bool vsf_tgui_control_set_active(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:549
void vsf_tgui_timer_init(vsf_tgui_timer_t *ptTimer, const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:120
vsf_tgui_status_t vsf_tgui_control_status_get(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:433
bool vsf_tgui_control_get_visible_region(const vsf_tgui_control_t *control_ptr, vsf_tgui_region_t *ptRegionBuffer)
get the visible region (with absolute location) !
Definition vsf_tgui_control.c:316
vsf_tgui_location_t * vsf_tgui_control_get_location(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:221
bool vsf_tgui_control_update(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:503
bool vsf_tgui_control_send_message(const vsf_tgui_control_t *control_ptr, vsf_tgui_evt_t event)
Definition vsf_tgui_control.c:484
bool vsf_tgui_control_set_is_transparent_bit(vsf_tgui_control_t *control_ptr, bool is_control_transparent)
update is_control_transparent bit in control status ! \parame control_ptr target control address !
Definition vsf_tgui_control.c:417
void vsf_tgui_timer_disable(vsf_tgui_timer_t *ptTimer)
Definition vsf_tgui_control.c:156
fsm_rt_t __vk_tgui_control_user_message_handling(vsf_tgui_control_t *control_ptr, const vsf_tgui_evt_t *event_ptr)
Definition vsf_tgui_control.c:574
uint_fast8_t vk_tgui_container_visible_item_get(const vsf_tgui_container_t *container_ptr)
Definition vsf_tgui_control.c:460
vsf_tgui_region_t * vsf_tgui_control_calculate_absolute_region(const vsf_tgui_control_t *control_ptr, vsf_tgui_region_t *region_ptr)
If you get a relative region inside a control, this function can calculate ! the absolute location an...
Definition vsf_tgui_control.c:260
const vsf_tgui_control_t * __vk_tgui_control_get_next_visible_one_within_container(const vsf_tgui_control_t *item_ptr)
Definition vsf_tgui_control.c:1155
bool vsf_tgui_control_shoot(const vsf_tgui_control_t *control_ptr, const vsf_tgui_location_t *ptLocation)
Definition vsf_tgui_control.c:387
fsm_rt_t vk_tgui_control_update(vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:1500
fsm_rt_t vk_tgui_control_init(vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:1515
fsm_rt_t __vsf_tgui_control_msg_handler(vsf_tgui_control_t *control_ptr, vsf_tgui_msg_t *ptMSG, const i_tgui_control_methods_t *ptMethods)
Definition vsf_tgui_control.c:721
void vsf_tgui_timer_enable(vsf_tgui_timer_t *ptTimer)
Definition vsf_tgui_control.c:135
void vsf_tgui_control_status_set(vsf_tgui_control_t *control_ptr, vsf_tgui_status_t Status)
Definition vsf_tgui_control.c:440
vsf_tgui_region_t * vsf_tgui_control_generate_dirty_region_from_parent_dirty_region(const vsf_tgui_control_t *parent_ptr, const vsf_tgui_region_t *ptParentDirtyRegion, const vsf_tgui_control_t *ptPrivate, vsf_tgui_region_t *ptNewDirtyRegionBuffer)
Definition vsf_tgui_control.c:360
fsm_rt_t vk_tgui_container_init(vsf_tgui_container_t *container_ptr)
Definition vsf_tgui_control.c:1526
vsf_tgui_control_t * vsf_tgui_control_get_parent(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:453
vsf_tgui_location_t * __vk_tgui_calculate_absolute_location_from_control_location(const vsf_tgui_control_t *control_ptr, vsf_tgui_location_t *ptLocation)
get the absolute location information base on the location information ! of or derived from target co...
Definition vsf_tgui_control.c:193
const vsf_tgui_root_container_t * vk_tgui_control_get_top(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:471
fsm_rt_t vsf_tgui_control_msg_handler(vsf_tgui_control_t *control_ptr, vsf_tgui_msg_t *ptMSG)
Definition vsf_tgui_control.c:1093
vsf_tgui_location_t * vsf_tgui_control_calculate_absolute_location(const vsf_tgui_control_t *control_ptr, vsf_tgui_location_t *ptOffset)
Definition vsf_tgui_control.c:231
bool vsf_tgui_control_update_tree(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:517
uint32_t bIsWorking
Definition vsf_tgui_control.h:631
fsm_rt_t vsf_tgui_method_t(vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.h:588
struct i_tgui_control_vtable_t i_tgui_control_methods_t
end_def_class(vsf_tgui_container_t) declare_class(vsf_tgui_root_container_t) def_class(vsf_tgui_root_container_t
vsf_tgui_margin_t tContainerPadding
Definition vsf_tgui_control.h:564
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
uint32_t u29Interval
Definition vsf_tgui_control.h:623
fsm_rt_t vsf_tgui_v_method_render_t(vsf_tgui_control_t *control_ptr, vsf_tgui_region_t *ptDirtyRegion, vsf_tgui_control_refresh_mode_t tMode)
Definition vsf_tgui_control.h:589
uint32_t bEnabled
Definition vsf_tgui_control.h:623
uint32_t bIsRepeat
Definition vsf_tgui_control.h:623
fsm_rt_t vsf_tgui_controal_fsm_t(vsf_tgui_control_t *node_ptr, vsf_tgui_msg_t *ptMSG)
Definition vsf_tgui_control.h:425
declare_class(vsf_tgui_control_t) typedef struct vsf_tgui_control_subcall_t
Definition vsf_tgui_control.h:417
vsf_tgui_control_refresh_mode_t
Definition vsf_tgui_control.h:586
uint8_t chVisibleItemCount
Definition vsf_tgui_control.h:555
vsf_tgui_control_subcall_t
Definition vsf_tgui_control.h:423
which(vsf_tgui_control_t vsf_tgui_v_label_t) public vsf_tgui_msg_t * ptMSG
Definition vsf_tgui_label.h:157