lv_obj_event.h
API reference for lv_obj_event.h
Functions
lv_event_set_ext_draw_size
Set the new extra draw size. Can be used in LV_EVENT_REFR_EXT_DRAW_SIZE
void lv_event_set_ext_draw_size(lv_event_t *e, int32_t size)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
size | int32_t | The new extra draw size |
lv_event_set_cover_res
Set the result of cover checking. Can be used in LV_EVENT_COVER_CHECK
void lv_event_set_cover_res(lv_event_t *e, lv_cover_res_t res)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
res | lv_cover_res_t | an element of lv_cover_check_info_t |
lv_event_get_current_target_obj
Get the current target of the event. It's the object which event handler being called. If the event is not bubbled it's the same as "original" target.
lv_obj_t * lv_event_get_current_target_obj(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to the event descriptor |
Returns: lv_obj_t * — the target of the event_code
lv_event_get_target_obj
Get the object originally targeted by the event. It's the same even if the event is bubbled.
lv_obj_t * lv_event_get_target_obj(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to the event descriptor |
Returns: lv_obj_t * — pointer to the original target of the event_code
lv_obj_get_event_count
uint32_t lv_obj_get_event_count(lv_obj_t *obj)| Name | Type |
|---|---|
obj | lv_obj_t * |
lv_obj_get_event_dsc
lv_event_dsc_t * lv_obj_get_event_dsc(lv_obj_t *obj, uint32_t index)| Name | Type |
|---|---|
obj | lv_obj_t * |
index | uint32_t |
lv_event_get_indev
Get the input device passed as parameter to indev related events.
lv_indev_t * lv_event_get_indev(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: lv_indev_t * — the indev that triggered the event or NULL if called on a not indev related event
lv_event_get_layer
Get the draw context which should be the first parameter of the draw functions. Namely: LV_EVENT_DRAW_MAIN/POST, LV_EVENT_DRAW_MAIN/POST_BEGIN, LV_EVENT_DRAW_MAIN/POST_END
lv_layer_t * lv_event_get_layer(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: lv_layer_t * — pointer to a draw context or NULL if called on an unrelated event
lv_event_get_old_size
Get the old area of the object before its size was changed. Can be used in LV_EVENT_SIZE_CHANGED
const lv_area_t * lv_event_get_old_size(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: const lv_area_t * — the old absolute area of the object or NULL if called on an unrelated event
lv_event_get_key
Get the key passed as parameter to an event. Can be used in LV_EVENT_KEY
uint32_t lv_event_get_key(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: uint32_t — the triggering key or NULL if called on an unrelated event
lv_event_get_rotary_diff
Get the signed rotary encoder diff. passed as parameter to an event. Can be used in LV_EVENT_ROTARY
int32_t lv_event_get_rotary_diff(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: int32_t — the triggering key or NULL if called on an unrelated event
lv_event_get_scroll_anim
Get the animation descriptor of a scrolling. Can be used in LV_EVENT_SCROLL_BEGIN
lv_anim_t * lv_event_get_scroll_anim(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: lv_anim_t * — the animation that will scroll the object. (can be modified as required)
lv_event_get_self_size_info
Get a pointer to an lv_point_t variable in which the self size should be saved (width in point->x and height point->y). Can be used in LV_EVENT_GET_SELF_SIZE
lv_point_t * lv_event_get_self_size_info(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: lv_point_t * — pointer to lv_point_t or NULL if called on an unrelated event
lv_event_get_hit_test_info
Get a pointer to an lv_hit_test_info_t variable in which the hit test result should be saved. Can be used in LV_EVENT_HIT_TEST
lv_hit_test_info_t * lv_event_get_hit_test_info(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: lv_hit_test_info_t * — pointer to lv_hit_test_info_t or NULL if called on an unrelated event
lv_event_get_cover_area
Get a pointer to an area which should be examined whether the object fully covers it or not. Can be used in LV_EVENT_HIT_TEST
const lv_area_t * lv_event_get_cover_area(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: const lv_area_t * — an area with absolute coordinates to check
lv_event_get_draw_task
Get the draw task which was just added. Can be used in LV_EVENT_DRAW_TASK_ADDED event
lv_draw_task_t * lv_event_get_draw_task(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: lv_draw_task_t * — the added draw task
lv_event_get_prev_state
Get the previous state before the state change. Can be used in LV_EVENT_STATE_CHANGED event
lv_state_t lv_event_get_prev_state(lv_event_t *e)| Name | Type | Description |
|---|---|---|
e | lv_event_t * | pointer to an event |
Returns: lv_state_t — the previous state
lv_obj_send_event
Send an event to the object
lv_result_t lv_obj_send_event(lv_obj_t *obj, lv_event_code_t event_code, void *param)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
event_code | lv_event_code_t | the type of the event from lv_event_t |
param | void * | arbitrary data depending on the widget type and the event. May be NULL. (Usually NULL) |
Returns: lv_result_t — LV_RESULT_OK: obj was not deleted in the event; LV_RESULT_INVALID: obj was deleted in the event_code
lv_obj_event_base
Used by the widgets internally to call the ancestor widget types's event handler
lv_result_t lv_obj_event_base(const lv_obj_class_t *class_p, lv_event_t *e)| Name | Type | Description |
|---|---|---|
class_p | const lv_obj_class_t * | pointer to the class of the widget (NOT the ancestor class). May be NULL. When NULL the current target's own class is used. |
e | lv_event_t * | pointer to the event descriptor |
Returns: lv_result_t — LV_RESULT_OK: the target object was not deleted in the event; LV_RESULT_INVALID: it was deleted in the event_code
lv_obj_add_event_cb
Add an event handler function for an object. Used by the user to react on event which happens with the object. An object can have multiple event handler. They will be called in the same order as they were added.
lv_event_dsc_t * lv_obj_add_event_cb(lv_obj_t *obj, lv_event_cb_t event_cb, lv_event_code_t filter, void *user_data)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
event_cb | lv_event_cb_t | the new event function |
filter | lv_event_code_t | an event code (e.g. LV_EVENT_CLICKED) on which the event should be called. LV_EVENT_ALL can be used to receive all the events. |
user_data | void * | custom data will be available in event_cb May be NULL. |
Returns: lv_event_dsc_t * — handler to the event. It can be used in lv_obj_remove_event_dsc.
lv_obj_remove_event
bool lv_obj_remove_event(lv_obj_t *obj, uint32_t index)| Name | Type |
|---|---|
obj | lv_obj_t * |
index | uint32_t |
lv_obj_remove_event_dsc
bool lv_obj_remove_event_dsc(lv_obj_t *obj, lv_event_dsc_t *dsc)| Name | Type |
|---|---|
obj | lv_obj_t * |
dsc | lv_event_dsc_t * |
lv_obj_remove_event_cb
Remove an event_cb from an object
uint32_t lv_obj_remove_event_cb(lv_obj_t *obj, lv_event_cb_t event_cb)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a obj |
event_cb | lv_event_cb_t | the event_cb of the event to remove |
Returns: uint32_t — the count of the event removed
lv_obj_remove_event_cb_with_user_data
Remove an event_cb with user_data
uint32_t lv_obj_remove_event_cb_with_user_data(lv_obj_t *obj, lv_event_cb_t event_cb, void *user_data)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to a obj |
event_cb | lv_event_cb_t | the event_cb of the event to remove |
user_data | void * | user_data May be NULL. |
Returns: uint32_t — the count of the event removed
Enums
lv_cover_res_t
Cover check results.
| Name | Value |
|---|---|
LV_COVER_RES_COVER | 0 |
LV_COVER_RES_NOT_COVER | 1 |
LV_COVER_RES_MASKED | 2 |
Used by 1 function
lv_event_set_cover_res— paramres
Dependencies
Indirect dependencies
lv_anim.hlv_area.hlv_assert.hlv_bidi.hlv_color.hlv_color_op.hlv_conf_internal.hlv_draw_buf.hlv_ext_data.hlv_flex.hlv_font.hlv_grad.hlv_grid.hlv_group.hlv_image_dsc.hlv_layout.hlv_log.hlv_math.hlv_mem.hlv_obj_style_gen.hlv_palette.hlv_sprintf.hlv_string.hlv_style.hlv_style_gen.hlv_symbol_def.hlv_text.hlv_timer.h
Last updated on