Initial addition of asynchronous callbacks

This commit is contained in:
Themba Dube
2019-07-05 14:46:53 -04:00
parent 8e9764532d
commit 5ae4b62f4d
5 changed files with 178 additions and 1 deletions

View File

@@ -15,6 +15,7 @@
#include "../lv_draw/lv_draw.h"
#include "../lv_misc/lv_anim.h"
#include "../lv_misc/lv_task.h"
#include "../lv_misc/lv_async.h"
#include "../lv_misc/lv_fs.h"
#include "../lv_hal/lv_hal.h"
#include <stdint.h>
@@ -49,6 +50,7 @@ static void report_style_mod_core(void * style_p, lv_obj_t * obj);
static void refresh_children_style(lv_obj_t * obj);
static void delete_children(lv_obj_t * obj);
static void lv_event_mark_deleted(lv_obj_t * obj);
static void lv_obj_del_async_cb(void * obj);
static bool lv_obj_design(lv_obj_t * obj, const lv_area_t * mask_p, lv_design_mode_t mode);
static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param);
@@ -448,6 +450,12 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
return LV_RES_INV;
}
void lv_obj_del_async(lv_obj_t * obj)
{
lv_async_call(lv_obj_del_async_cb, obj);
}
/**
* Delete all children of an object
* @param obj pointer to an object
@@ -2101,6 +2109,11 @@ bool lv_obj_is_focused(const lv_obj_t * obj)
* STATIC FUNCTIONS
**********************/
static void lv_obj_del_async_cb(void * obj)
{
lv_obj_del(obj);
}
/**
* Handle the drawing related tasks of the base objects.
* @param obj pointer to an object