1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

Merge pull request #1058 from joltwallet/user_data_ptr

lv_obj_get_user_data_ptr
This commit is contained in:
Gabor Kiss-Vamosi 2019-05-09 20:02:23 +02:00 committed by GitHub
commit 3079d2c6e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 4 deletions

View File

@ -513,7 +513,6 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data)
/* Save the last keys before anything else.
* They need to be already saved if the the function returns for any reason*/
lv_indev_state_t last_state = i->proc.types.keypad.last_state;
uint32_t last_key = i->proc.types.keypad.last_key;
i->proc.types.keypad.last_state = data->state;
i->proc.types.keypad.last_key = data->key;

View File

@ -1970,15 +1970,25 @@ void lv_obj_get_type(lv_obj_t * obj, lv_obj_type_t * buf)
#if LV_USE_USER_DATA_SINGLE
/**
* Get a pointer to the object's user data
* Get the object's user data
* @param obj pointer to an object
* @return pointer to the user data
* @return user data
*/
lv_obj_user_data_t lv_obj_get_user_data(lv_obj_t * obj)
{
return obj->user_data;
}
/**
* Get a pointer to the object's user data
* @param obj pointer to an object
* @return pointer to the user data
*/
lv_obj_user_data_t *lv_obj_get_user_data_ptr(lv_obj_t * obj)
{
return &obj->user_data;
}
/**
* Set the object's user data. The data will be copied.
* @param obj pointer to an object

View File

@ -908,12 +908,19 @@ void * lv_obj_get_ext_attr(const lv_obj_t * obj);
void lv_obj_get_type(lv_obj_t * obj, lv_obj_type_t * buf);
#if LV_USE_USER_DATA_SINGLE
/**
* Get the object's user data
* @param obj pointer to an object
* @return user data
*/
lv_obj_user_data_t lv_obj_get_user_data(lv_obj_t * obj);
/**
* Get a pointer to the object's user data
* @param obj pointer to an object
* @return pointer to the user data
*/
lv_obj_user_data_t lv_obj_get_user_data(lv_obj_t * obj);
lv_obj_user_data_t *lv_obj_get_user_data_ptr(lv_obj_t * obj);
/**
* Set the object's user data. The data will be copied.