VSF Documented
Macros | Functions
vsf_tgui_control.c File Reference
#include "../vsf_tgui_cfg.h"
#include "./vsf_tgui_control.h"
#include "../view/vsf_tgui_v.h"
#include "../vsf_tgui.h"

Macros

#define __VSF_TGUI_CONTROLS_CONTROL_CLASS_IMPLEMENT
 
#define THIS_FSM_STATE   control_ptr->tMSGMap.chState
 
#define RESET_TGUI_USER_MSG_HANDLING_FSM()    do { THIS_FSM_STATE = 0; } while(0)
 

Functions

 declare_class (vsf_tgui_t)
 
void vsf_tgui_timer_init (vsf_tgui_timer_t *ptTimer, const vsf_tgui_control_t *control_ptr)
 
void vsf_tgui_timer_enable (vsf_tgui_timer_t *ptTimer)
 
void vsf_tgui_timer_disable (vsf_tgui_timer_t *ptTimer)
 
bool vsf_tgui_timer_is_working (vsf_tgui_timer_t *ptTimer)
 
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 control. !
 
vsf_tgui_location_tvsf_tgui_control_get_location (const vsf_tgui_control_t *control_ptr)
 
vsf_tgui_size_tvsf_tgui_control_get_size (const vsf_tgui_control_t *control_ptr)
 
vsf_tgui_location_tvsf_tgui_control_calculate_absolute_location (const vsf_tgui_control_t *control_ptr, vsf_tgui_location_t *ptOffset)
 
vsf_tgui_region_tvsf_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 and store the result in the region you specified. ! ! \NOTE As the location info of the region you passed to this ! function will be changed, please do NOT pass the control's own region ! to this function. ! Due to this reason aforementioned, you should creat a copy of the target ! region and use it with this function. ! !
 
vsf_tgui_region_tvsf_tgui_get_absolute_control_region (const vsf_tgui_control_t *control_ptr, vsf_tgui_region_t *ptRegionBuffer)
 
bool vsf_tgui_control_is_in_range (const vsf_tgui_region_t *region_ptr, const vsf_tgui_location_t *ptLocation)
 
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) !
 
vsf_tgui_region_tvsf_tgui_control_get_relative_region (const vsf_tgui_control_t *control_ptr, vsf_tgui_region_t *ptAbsoluteRegion)
 
vsf_tgui_region_tvsf_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)
 
bool vsf_tgui_control_shoot (const vsf_tgui_control_t *control_ptr, const vsf_tgui_location_t *ptLocation)
 
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 !
 
vsf_tgui_status_t vsf_tgui_control_status_get (const vsf_tgui_control_t *control_ptr)
 
void vsf_tgui_control_status_set (vsf_tgui_control_t *control_ptr, vsf_tgui_status_t Status)
 
bool vsf_tgui_control_is_container (const vsf_tgui_control_t *control_ptr)
 
vsf_tgui_control_tvsf_tgui_control_get_parent (const vsf_tgui_control_t *control_ptr)
 
uint_fast8_t vk_tgui_container_visible_item_get (const vsf_tgui_container_t *container_ptr)
 
const vsf_tgui_root_container_tvk_tgui_control_get_top (const vsf_tgui_control_t *control_ptr)
 
bool vsf_tgui_control_send_message (const vsf_tgui_control_t *control_ptr, vsf_tgui_evt_t event)
 
bool vsf_tgui_control_update (const vsf_tgui_control_t *control_ptr)
 
bool vsf_tgui_control_update_tree (const vsf_tgui_control_t *control_ptr)
 
bool vsf_tgui_control_set_active (const vsf_tgui_control_t *control_ptr)
 
fsm_rt_t __vk_tgui_control_user_message_handling (vsf_tgui_control_t *control_ptr, const vsf_tgui_evt_t *event_ptr)
 
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)
 
fsm_rt_t vsf_tgui_control_msg_handler (vsf_tgui_control_t *control_ptr, vsf_tgui_msg_t *ptMSG)
 
fsm_rt_t vsf_tgui_container_msg_handler (vsf_tgui_container_t *control_ptr, vsf_tgui_msg_t *ptMSG)
 
const vsf_tgui_control_t__vk_tgui_control_get_next_visible_one_within_container (const vsf_tgui_control_t *item_ptr)
 
fsm_rt_t vk_tgui_control_update (vsf_tgui_control_t *control_ptr)
 
fsm_rt_t vk_tgui_container_update (vsf_tgui_container_t *container_ptr)
 
fsm_rt_t vk_tgui_control_init (vsf_tgui_control_t *control_ptr)
 
fsm_rt_t vk_tgui_container_init (vsf_tgui_container_t *container_ptr)
 

Macro Definition Documentation

◆ __VSF_TGUI_CONTROLS_CONTROL_CLASS_IMPLEMENT

#define __VSF_TGUI_CONTROLS_CONTROL_CLASS_IMPLEMENT

◆ THIS_FSM_STATE

#define THIS_FSM_STATE   control_ptr->tMSGMap.chState

◆ RESET_TGUI_USER_MSG_HANDLING_FSM

#define RESET_TGUI_USER_MSG_HANDLING_FSM ( )     do { THIS_FSM_STATE = 0; } while(0)

Function Documentation

◆ declare_class()

declare_class ( vsf_tgui_t  )

◆ vsf_tgui_timer_init()

void vsf_tgui_timer_init ( vsf_tgui_timer_t *  ptTimer,
const vsf_tgui_control_t control_ptr 
)

◆ vsf_tgui_timer_enable()

void vsf_tgui_timer_enable ( vsf_tgui_timer_t *  ptTimer)

◆ vsf_tgui_timer_disable()

void vsf_tgui_timer_disable ( vsf_tgui_timer_t *  ptTimer)

◆ vsf_tgui_timer_is_working()

bool vsf_tgui_timer_is_working ( vsf_tgui_timer_t *  ptTimer)

◆ __vk_tgui_calculate_absolute_location_from_control_location()

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 control. !

Parameters
control_ptrthe Target Control Address !
ptLocationthe Location buffer which has already stored the location ! information of or derived from the target control !
Returns
the location buffer address passed with ptLocation

◆ vsf_tgui_control_get_location()

vsf_tgui_location_t * vsf_tgui_control_get_location ( const vsf_tgui_control_t control_ptr)

◆ vsf_tgui_control_get_size()

vsf_tgui_size_t * vsf_tgui_control_get_size ( const vsf_tgui_control_t control_ptr)

◆ vsf_tgui_control_calculate_absolute_location()

vsf_tgui_location_t * vsf_tgui_control_calculate_absolute_location ( const vsf_tgui_control_t control_ptr,
vsf_tgui_location_t ptOffset 
)

◆ vsf_tgui_control_calculate_absolute_region()

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 and store the result in the region you specified. ! ! \NOTE As the location info of the region you passed to this ! function will be changed, please do NOT pass the control's own region ! to this function. ! Due to this reason aforementioned, you should creat a copy of the target ! region and use it with this function. ! !

Parameters
control_ptrthe address of the target control !
region_ptrthe address of the region which you want to calculate !
Returns
the same region address you passed to the function !

◆ vsf_tgui_get_absolute_control_region()

vsf_tgui_region_t * vsf_tgui_get_absolute_control_region ( const vsf_tgui_control_t control_ptr,
vsf_tgui_region_t ptRegionBuffer 
)

◆ vsf_tgui_control_is_in_range()

bool vsf_tgui_control_is_in_range ( const vsf_tgui_region_t region_ptr,
const vsf_tgui_location_t ptLocation 
)

to mitigate C89/90 warning

◆ vsf_tgui_control_get_visible_region()

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) !

Parameters
control_ptrthe target control !
region_ptrthe region buffer !
Return values
truevisible !
falseinvisible

◆ vsf_tgui_control_get_relative_region()

vsf_tgui_region_t * vsf_tgui_control_get_relative_region ( const vsf_tgui_control_t control_ptr,
vsf_tgui_region_t ptAbsoluteRegion 
)

◆ vsf_tgui_control_generate_dirty_region_from_parent_dirty_region()

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 
)

◆ vsf_tgui_control_shoot()

bool vsf_tgui_control_shoot ( const vsf_tgui_control_t control_ptr,
const vsf_tgui_location_t ptLocation 
)

◆ vsf_tgui_control_set_is_transparent_bit()

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 !

Return values
truethe original value of is_control_transparent is changed !
falsethe set value is the same as the original value, no change is ! made.

◆ vsf_tgui_control_status_get()

vsf_tgui_status_t vsf_tgui_control_status_get ( const vsf_tgui_control_t control_ptr)

◆ vsf_tgui_control_status_set()

void vsf_tgui_control_status_set ( vsf_tgui_control_t control_ptr,
vsf_tgui_status_t  Status 
)

◆ vsf_tgui_control_is_container()

bool vsf_tgui_control_is_container ( const vsf_tgui_control_t control_ptr)

◆ vsf_tgui_control_get_parent()

vsf_tgui_control_t * vsf_tgui_control_get_parent ( const vsf_tgui_control_t control_ptr)

◆ vk_tgui_container_visible_item_get()

uint_fast8_t vk_tgui_container_visible_item_get ( const vsf_tgui_container_t *  container_ptr)

◆ vk_tgui_control_get_top()

const vsf_tgui_root_container_t * vk_tgui_control_get_top ( const vsf_tgui_control_t control_ptr)

◆ vsf_tgui_control_send_message()

bool vsf_tgui_control_send_message ( const vsf_tgui_control_t control_ptr,
vsf_tgui_evt_t  event 
)

◆ vsf_tgui_control_update()

bool vsf_tgui_control_update ( const vsf_tgui_control_t control_ptr)

◆ vsf_tgui_control_update_tree()

bool vsf_tgui_control_update_tree ( const vsf_tgui_control_t control_ptr)

◆ vsf_tgui_control_set_active()

bool vsf_tgui_control_set_active ( const vsf_tgui_control_t control_ptr)

◆ __vk_tgui_control_user_message_handling()

fsm_rt_t __vk_tgui_control_user_message_handling ( vsf_tgui_control_t control_ptr,
const vsf_tgui_evt_t event_ptr 
)

get mask

check message

haven't support yet

message has been handled

message is not handled

◆ __vsf_tgui_control_msg_handler()

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 
)

message contains data

◆ vsf_tgui_control_msg_handler()

fsm_rt_t vsf_tgui_control_msg_handler ( vsf_tgui_control_t control_ptr,
vsf_tgui_msg_t ptMSG 
)

◆ vsf_tgui_container_msg_handler()

fsm_rt_t vsf_tgui_container_msg_handler ( vsf_tgui_container_t *  control_ptr,
vsf_tgui_msg_t ptMSG 
)

◆ __vk_tgui_control_get_next_visible_one_within_container()

const vsf_tgui_control_t * __vk_tgui_control_get_next_visible_one_within_container ( const vsf_tgui_control_t item_ptr)

◆ vk_tgui_control_update()

fsm_rt_t vk_tgui_control_update ( vsf_tgui_control_t control_ptr)

◆ vk_tgui_container_update()

fsm_rt_t vk_tgui_container_update ( vsf_tgui_container_t *  container_ptr)

◆ vk_tgui_control_init()

fsm_rt_t vk_tgui_control_init ( vsf_tgui_control_t control_ptr)

◆ vk_tgui_container_init()

fsm_rt_t vk_tgui_container_init ( vsf_tgui_container_t *  container_ptr)