35#ifndef __VSF_TGUI_CONTROLS_CONTROL_H__
36#define __VSF_TGUI_CONTROLS_CONTROL_H__
45#ifndef VSF_TGUI_V_TEMPLATE_TYPE_HEADER_FILE
46#if VSF_TGUI_CFG_RENDERING_TEMPLATE_SEL == VSF_TGUI_V_TEMPLATE_SIMPLE_VIEW
47# define VSF_TGUI_V_TEMPLATE_TYPE_HEADER_FILE "../view/simple_view/vsf_tgui_v_type.h"
48#elif VSF_TGUI_CFG_RENDERING_TEMPLATE_SEL == VSF_TGUI_V_TEMPLATE_SCGUI_VIEW
49# define VSF_TGUI_V_TEMPLATE_TYPE_HEADER_FILE "../view/scgui_view/vsf_tgui_v_type.h"
51# undef VSF_TGUI_CFG_RENDERING_TEMPLATE_SEL
52# define VSF_TGUI_CFG_RENDERING_TEMPLATE_SEL VSF_TGUI_V_TEMPLATE_EXAMPLE
53# define VSF_TGUI_V_TEMPLATE_TYPE_HEADER_FILE "../view/template/vsf_tgui_v_type.h"
56#include VSF_TGUI_V_TEMPLATE_TYPE_HEADER_FILE
59#if defined(__VSF_TGUI_CONTROLS_CONTROL_CLASS_IMPLEMENT)
60# define __PLOOC_CLASS_IMPLEMENT__
61# undef __VSF_TGUI_CONTROLS_CONTROL_CLASS_IMPLEMENT
62#elif defined(__VSF_TGUI_CONTROLS_CONTROL_CLASS_INHERIT)
63# define __PLOOC_CLASS_INHERIT__
64# undef __VSF_TGUI_CONTROLS_CONTROL_CLASS_INHERIT
71#define __VSF_TGUI_INTERFACE_CONTROLS_CONTROL { \
73 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
74 (vsf_msgt_method_fsm_t *)&vsf_tgui_control_msg_handler, \
76 .Status = (vsf_msgt_method_status_t *) \
77 &vsf_tgui_control_status_get, \
78 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
81#define __VSF_TGUI_INTERFACE_CONTROLS_CONTAINER { \
83 VSF_MSGT_NODE_HANDLER_TYPE_FSM, \
84 (vsf_msgt_method_fsm_t *)&vsf_tgui_container_msg_handler, \
86 .Status = (vsf_msgt_method_status_t *) \
87 &vsf_tgui_control_status_get, \
88 .Shoot = (vsf_msgt_method_shoot_t *)&vsf_tgui_control_shoot, \
92#define VSF_TGUI_CTRL_STATUS_INITIALISED VSF_BIT(0)
93#define VSF_TGUI_CTRL_STATUS_ENABLED VSF_BIT(1)
94#define VSF_TGUI_CTRL_STATUS_VISIBLE VSF_BIT(2)
95#define VSF_TGUI_CTRL_STATUS_ACTIVE VSF_BIT(3)
96#define VSF_TGUI_CTRL_STATUS_HIDE_CONTAINER_CONTENT VSF_BIT(4)
100#if VSF_TGUI_CFG_SUPPORT_NAME_STRING == ENABLED
101# define ____tgui_name_string_tag(__name, __type) \
102 .node_name_ptr = "["#__type"]["#__name"]",
104# define ____tgui_name_string_tag(__name, __type)
107#define __tgui_name_string_tag(__name, __type) \
108 ____tgui_name_string_tag(__name, __type)
110#if VSF_MSG_TREE_CFG_SUPPORT_DUAL_LIST == ENABLED
111# define ____tgui_node_list_init(__name, __parent_addr, __previous, __next) \
113 .previous = (intptr_t)&((__parent_addr)->__name) \
114 - (intptr_t)&((__parent_addr)->__previous), \
115 .next = (intptr_t)&((__parent_addr)->__next) \
116 - (intptr_t)&((__parent_addr)->__name), \
119# define ____tgui_node_list_init(__name, __parent_addr, __previous, __next) \
121 .next = (intptr_t)&((__parent_addr)->__next) \
122 - (intptr_t)&((__parent_addr)->__name), \
127#define __tgui_node_list_init(__name, __parent_addr, __previous, __next) \
128 ____tgui_node_list_init(__name, __parent_addr, __previous, __next)
130#define __tgui_control_base( __NAME, \
138 .parent_ptr = (vsf_msgt_container_t *) \
139 &(((__TYPE *)(__PARENT_ADDR))->use_as__vsf_msgt_node_t), \
141 __tgui_node_list_init(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT)\
142 __tgui_name_string_tag(__NAME, __TYPE) \
143 .bIsEnabled = true, \
144 .bIsVisible = true, \
145 VSF_TGUI_V_CONTROL_STATIC_INIT_DEFAULT \
147 VSF_TGUI_V_CONTROL_STATIC_INIT_OVERRIDE \
150#define __tgui_control_base_const( __NAME, \
157 .__NAME = (const __TYPE) { \
158 .parent_ptr = (vsf_msgt_container_t *) \
159 &((__PARENT_ADDR)->use_as__vsf_msgt_node_t), \
161 __tgui_node_list_init(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT)\
162 __tgui_name_string_tag(__NAME, __TYPE) \
163 .bIsEnabled = true, \
164 .bIsVisible = true, \
165 VSF_TGUI_V_CONTROL_STATIC_INIT_DEFAULT \
167 VSF_TGUI_V_CONTROL_STATIC_INIT_OVERRIDE \
170#define __describe_tgui_control_base( __NAME, \
174 static const __TYPE __NAME = { \
176 __tgui_name_string_tag(__VAR, __TYPE) \
177 .bIsEnabled = true, \
178 .bIsVisible = true, \
179 VSF_TGUI_V_CONTROL_STATIC_INIT_DEFAULT \
181 VSF_TGUI_V_CONTROL_STATIC_INIT_OVERRIDE \
185#define __describe_tgui_container_base( __NAME, \
189 __describe_tgui_control_base( \
193 .is_container = true, \
194 .ContainerAttribute.bIsAutoSize = true, \
197 &((*(__TYPE *)0).__TYPE##_FirstNode), \
198 VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
200 VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE \
203#define describe_tgui_container_base( __NAME, \
207 __describe_tgui_container_base( __NAME, \
212#define tgui_control_base( __NAME, \
219 __tgui_control_base( \
228#define tgui_control_base_const( __NAME, \
235 __tgui_control_base_const( \
245#define describe_tgui_control_base( __NAME, \
249 __describe_tgui_control_base( __NAME, \
255#define __tgui_control(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
256 tgui_control_base( __NAME, \
257 VSF_TGUI_COMPONENT_ID_CONTROL, \
258 vsf_tgui_control_t, \
264#define tgui_control(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
265 __tgui_control( __NAME, \
271#define __tgui_control_const(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
272 tgui_control_base_const(__NAME, \
273 VSF_TGUI_COMPONENT_ID_CONTROL, \
274 vsf_tgui_control_t, \
280#define tgui_control_const(__NAME, __PARENT_ADDR, __PREVIOUS, __NEXT, ...) \
281 __tgui_control_const( __NAME, \
287#define __use_tgui_container(__NAME, ...) \
289 implement(vsf_tgui_container_t) \
291 vsf_msgt_node_t __NAME##_FirstNode ; \
298#define use_tgui_container(__NAME, ...) __use_tgui_container(__NAME, __VA_ARGS__)
302#define __tgui_container_base( __NAME, \
316 .is_container = true, \
317 .ContainerAttribute.bIsAutoSize = true, \
320 &((__PARENT_ADDR)->__NAME.__NAME##_FirstNode), \
321 VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
323 VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE \
326#define tgui_container_base(__NAME, \
333 __tgui_container_base( __NAME, \
341#define __tgui_container_base_const(__NAME, \
348 tgui_control_base_const( __NAME, \
354 .is_container = true, \
355 .ContainerAttribute.bIsAutoSize = true, \
358 &((__PARENT_ADDR)->__NAME.__NAME##_FirstNode), \
359 VSF_TGUI_V_CONTAINER_STATIC_INIT_DEFAULT \
361 VSF_TGUI_V_CONTAINER_STATIC_INIT_OVERRIDE \
364#define tgui_container_base_const(__NAME, \
371 __tgui_container_base_const(__NAME, \
379# define __tgui_container( __NAME, \
383 tgui_container_base(__NAME, \
384 VSF_TGUI_COMPONENT_ID_CONTAINER, \
385 vsf_tgui_container_t, \
392#define tgui_container( __NAME, \
397 __tgui_container(__NAME, \
459 const char *handler_name_ptr;
470#if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_PADDING == ENABLED ||\
471 VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_MARGIN == ENABLED
483 implement(vsf_msgt_node_t)
484 vsf_msgt_node_t* node_ptr;
488 #if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_ANCHOR == ENABLED
492 #if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_DOCK == ENABLED
496 #if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_MARGIN == ENABLED
500 #if VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_ALIGN == ENABLED
521 #if VSF_TGUI_CFG_SUPPORT_NAME_STRING == ENABLED
522 const char *name_ptr;
541 uint8_t bIsHideContentInsideContainer : 1;
549#if VSF_TGUI_CFG_SUPPORT_DIRTY_REGION == ENABLED
554 implement(vsf_tgui_v_control_t)
564 inherit(vsf_msgt_container_t)
567 implement(vsf_tgui_v_container_t)
575 uint8_t is_forced_to_refresh_whole_background : 1;
596 which(implement(vsf_tgui_container_t))
606 VSF_TGUI_CONTROL_REFRESHED_BY_PARENT = 0,
607 VSF_TGUI_CONTROL_REFRESHED_DIRECTLY_BY_USER
632#if VSF_TGUI_CFG_SUPPORT_TIMER == ENABLED
664#if VSF_TGUI_CFG_SUPPORT_TIMER == ENABLED
779 bool is_control_transparent);
798 const vsf_tgui_container_t *container_ptr);
813#if VSF_TGUI_CFG_REFRESH_SCHEME != VSF_TGUI_REFRESH_SCHEME_NONE
#define ENABLED
Definition __type.h:28
unsigned short uint16_t
Definition lvgl.h:41
unsigned int uint32_t
Definition lvgl.h:43
unsigned char uint8_t
Definition lvgl.h:40
signed char int8_t
Definition lvgl.h:38
unsigned char uint_fast8_t
Definition stdint.h:23
Definition vsf_tgui_control.h:626
vsf_tgui_control_method_t * Init
Definition vsf_tgui_control.h:628
vsf_tgui_control_method_t * Update
Definition vsf_tgui_control.h:629
i_tgui_v_vtable_t tView
Definition vsf_tgui_control.h:627
Definition vsf_tgui_control.h:618
vsf_tgui_v_method_render_t * Render
Definition vsf_tgui_control.h:621
vsf_tgui_v_method_t * Init
Definition vsf_tgui_control.h:619
vsf_tgui_v_method_t * Update
Definition vsf_tgui_control.h:623
vsf_tgui_v_method_t * Depose
Definition vsf_tgui_control.h:620
vsf_tgui_v_method_render_t * ContainerPostRender
Definition vsf_tgui_control.h:622
Definition vsf_tgui_control.h:445
uint16_t u10EvtMask
0 means no mask
Definition vsf_tgui_control.h:448
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:446
Definition vsf_tgui_common.h:265
Definition vsf_tgui_control.h:472
int8_t chLeft
Definition vsf_tgui_control.h:473
int8_t chTop
Definition vsf_tgui_control.h:474
int8_t chBottom
Definition vsf_tgui_control.h:476
int8_t chRight
Definition vsf_tgui_control.h:475
Definition vsf_tgui_common.h:552
Definition vsf_tgui_common.h:275
Definition vsf_tgui_common.h:270
Definition vsf_tgui_control.h:464
Definition vsf_tgui_common.h:585
Definition vsf_tgui_control.h:408
uint8_t bIsEnabled
Definition vsf_tgui_control.h:414
uint8_t chStatus
Definition vsf_tgui_control.h:409
uint8_t __skip_render_frame
Definition vsf_tgui_control.h:427
uint8_t bIsHideContentInsideContainer
Definition vsf_tgui_control.h:417
uint8_t __is_the_first_node_for_refresh
Definition vsf_tgui_control.h:424
uint8_t bIsVisible
Definition vsf_tgui_control.h:415
uint8_t bIsInitialised
Definition vsf_tgui_control.h:413
struct vsf_tgui_status_t::@138 Values
uint8_t bIsTransparent
Definition vsf_tgui_control.h:418
uint8_t __does_contain_builtin_structure
Definition vsf_tgui_control.h:425
uint8_t bIsActive
Definition vsf_tgui_control.h:416
uint8_t __skip_render
Definition vsf_tgui_control.h:426
Definition vsf_tgui_common.h:438
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:118
#define VSF_TGUI_CFG_SUPPORT_CONTROL_LAYOUT_PADDING
Definition vsf_tgui_cfg.h:87
vsf_tgui_align_mode_t
Definition vsf_tgui_common.h:281
vsf_tgui_anchor_mode_t
Definition vsf_tgui_common.h:326
vsf_tgui_dock_mode_t
Definition vsf_tgui_common.h:314
struct vsf_tgui_control_t vsf_tgui_control_t
Definition vsf_tgui_common.h:549
struct vsf_tgui_root_container_t vsf_tgui_root_container_t
Definition vsf_tgui_common.h:550
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:281
vsf_tgui_size_t * vsf_tgui_control_get_size(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:225
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:269
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:343
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:1109
bool vsf_tgui_control_is_container(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:446
fsm_rt_t vk_tgui_container_update(vsf_tgui_container_t *container_ptr)
Definition vsf_tgui_control.c:1518
bool vsf_tgui_control_set_active(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:555
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:432
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:315
vsf_tgui_location_t * vsf_tgui_control_get_location(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:220
bool vsf_tgui_control_update(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:509
bool vsf_tgui_control_send_message(const vsf_tgui_control_t *control_ptr, vsf_tgui_evt_t event)
Definition vsf_tgui_control.c:490
vsf_tgui_location_t * __vk_tgui_calculate_control_location_from_parent(const vsf_tgui_control_t *control_ptr, const vsf_tgui_control_t *parent_ptr, vsf_tgui_location_t *ptLocation)
get the relative location information base on the location information ! of or derived from target co...
Definition vsf_tgui_control.c:194
bool vsf_tgui_control_set_is_transparent_bit(vsf_tgui_control_t *control_ptr, bool is_control_transparent)
update bIsTransparent bit in control status ! \parame control_ptr target control address !
Definition vsf_tgui_control.c:416
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:580
uint_fast8_t vk_tgui_container_visible_item_get(const vsf_tgui_container_t *container_ptr)
Definition vsf_tgui_control.c:459
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:259
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:1163
vsf_tgui_t * vsf_tgui_control_get_gui_instance(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:483
bool vsf_tgui_control_shoot(const vsf_tgui_control_t *control_ptr, const vsf_tgui_location_t *ptLocation)
Definition vsf_tgui_control.c:386
fsm_rt_t vk_tgui_control_update(vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:1508
fsm_rt_t vk_tgui_control_init(vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:1523
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:727
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:439
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:359
fsm_rt_t vk_tgui_container_init(vsf_tgui_container_t *container_ptr)
Definition vsf_tgui_control.c:1534
vsf_tgui_control_t * vsf_tgui_control_get_parent(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:452
const vsf_tgui_root_container_t * vk_tgui_control_get_top(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:470
fsm_rt_t vsf_tgui_control_msg_handler(vsf_tgui_control_t *control_ptr, vsf_tgui_msg_t *ptMSG)
Definition vsf_tgui_control.c:1101
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:230
bool vsf_tgui_control_update_tree(const vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.c:523
uint32_t bIsWorking
Definition vsf_tgui_control.h:656
fsm_rt_t vsf_tgui_v_method_render_t(vsf_tgui_t *gui_ptr, vsf_tgui_control_t *control_ptr, vsf_tgui_region_t *ptDirtyRegion, vsf_tgui_control_refresh_mode_t tMode)
Definition vsf_tgui_control.h:611
struct i_tgui_control_vtable_t i_tgui_control_methods_t
fsm_rt_t vsf_tgui_control_method_t(vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.h:616
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:586
which(union { inherit(vsf_msgt_container_t) vsf_tgui_control_t };vsf_tgui_v_container_t) implement_ex(struct
Definition vsf_tgui_control.h:562
uint32_t u29Interval
Definition vsf_tgui_control.h:648
fsm_rt_t vsf_tgui_v_method_t(vsf_tgui_t *gui_ptr, vsf_tgui_control_t *control_ptr)
Definition vsf_tgui_control.h:610
uint32_t bEnabled
Definition vsf_tgui_control.h:648
uint32_t bIsRepeat
Definition vsf_tgui_control.h:648
fsm_rt_t vsf_tgui_controal_fsm_t(vsf_tgui_control_t *node_ptr, vsf_tgui_msg_t *ptMSG)
Definition vsf_tgui_control.h:441
declare_class(vsf_tgui_control_t) typedef struct vsf_tgui_control_subcall_t
Definition vsf_tgui_control.h:433
vsf_tgui_control_refresh_mode_t
Definition vsf_tgui_control.h:608
uint8_t chVisibleItemCount
Definition vsf_tgui_control.h:577
vsf_tgui_control_subcall_t
Definition vsf_tgui_control.h:439
which(vsf_tgui_control_t vsf_tgui_v_label_t) public vsf_tgui_msg_t * ptMSG
Definition vsf_tgui_label.h:157
const vsf_tgui_control_t * control_ptr
Definition vsf_tgui_scguiv_port.h:87