lv_obj_user_data_ptr initial commit. Also deleted an unused variable in lv_indev to prevent compiler warnings

This commit is contained in:
Brian Pugh
2019-05-09 09:02:11 -07:00
parent 523170297e
commit 7631d41c88
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.