arch(driver): new driver architecture with new color format support
This commit is contained in:
@@ -10,6 +10,9 @@
|
||||
|
||||
#include "lv_obj.h"
|
||||
#include "lv_indev.h"
|
||||
#include "lv_indev_private.h"
|
||||
#include "lv_disp.h"
|
||||
#include "lv_disp_private.h"
|
||||
#include "../misc/lv_anim.h"
|
||||
#include "../misc/lv_gc.h"
|
||||
#include "../misc/lv_async.h"
|
||||
@@ -68,8 +71,8 @@ void lv_obj_del(lv_obj_t * obj)
|
||||
lv_obj_update_layout(par);
|
||||
lv_obj_readjust_scroll(par, LV_ANIM_OFF);
|
||||
lv_obj_scrollbar_invalidate(par);
|
||||
lv_event_send(par, LV_EVENT_CHILD_CHANGED, NULL);
|
||||
lv_event_send(par, LV_EVENT_CHILD_DELETED, NULL);
|
||||
lv_obj_send_event(par, LV_EVENT_CHILD_CHANGED, NULL);
|
||||
lv_obj_send_event(par, LV_EVENT_CHILD_DELETED, NULL);
|
||||
}
|
||||
|
||||
/*Handle if the active screen was deleted*/
|
||||
@@ -175,12 +178,12 @@ void lv_obj_set_parent(lv_obj_t * obj, lv_obj_t * parent)
|
||||
/*Notify the original parent because one of its children is lost*/
|
||||
lv_obj_readjust_scroll(old_parent, LV_ANIM_OFF);
|
||||
lv_obj_scrollbar_invalidate(old_parent);
|
||||
lv_event_send(old_parent, LV_EVENT_CHILD_CHANGED, obj);
|
||||
lv_event_send(old_parent, LV_EVENT_CHILD_DELETED, NULL);
|
||||
lv_obj_send_event(old_parent, LV_EVENT_CHILD_CHANGED, obj);
|
||||
lv_obj_send_event(old_parent, LV_EVENT_CHILD_DELETED, NULL);
|
||||
|
||||
/*Notify the new parent about the child*/
|
||||
lv_event_send(parent, LV_EVENT_CHILD_CHANGED, obj);
|
||||
lv_event_send(parent, LV_EVENT_CHILD_CREATED, NULL);
|
||||
lv_obj_send_event(parent, LV_EVENT_CHILD_CHANGED, obj);
|
||||
lv_obj_send_event(parent, LV_EVENT_CHILD_CREATED, NULL);
|
||||
|
||||
lv_obj_mark_layout_as_dirty(obj);
|
||||
|
||||
@@ -223,7 +226,7 @@ void lv_obj_move_to_index(lv_obj_t * obj, int32_t index)
|
||||
}
|
||||
|
||||
parent->spec_attr->children[index] = obj;
|
||||
lv_event_send(parent, LV_EVENT_CHILD_CHANGED, NULL);
|
||||
lv_obj_send_event(parent, LV_EVENT_CHILD_CHANGED, NULL);
|
||||
lv_obj_invalidate(parent);
|
||||
}
|
||||
|
||||
@@ -238,16 +241,16 @@ void lv_obj_swap(lv_obj_t * obj1, lv_obj_t * obj2)
|
||||
uint_fast32_t index1 = lv_obj_get_index(obj1);
|
||||
uint_fast32_t index2 = lv_obj_get_index(obj2);
|
||||
|
||||
lv_event_send(parent2, LV_EVENT_CHILD_DELETED, obj2);
|
||||
lv_event_send(parent, LV_EVENT_CHILD_DELETED, obj1);
|
||||
lv_obj_send_event(parent2, LV_EVENT_CHILD_DELETED, obj2);
|
||||
lv_obj_send_event(parent, LV_EVENT_CHILD_DELETED, obj1);
|
||||
|
||||
parent->spec_attr->children[index1] = obj2;
|
||||
parent2->spec_attr->children[index2] = obj1;
|
||||
|
||||
lv_event_send(parent, LV_EVENT_CHILD_CHANGED, obj2);
|
||||
lv_event_send(parent, LV_EVENT_CHILD_CREATED, obj2);
|
||||
lv_event_send(parent2, LV_EVENT_CHILD_CHANGED, obj1);
|
||||
lv_event_send(parent2, LV_EVENT_CHILD_CREATED, obj1);
|
||||
lv_obj_send_event(parent, LV_EVENT_CHILD_CHANGED, obj2);
|
||||
lv_obj_send_event(parent, LV_EVENT_CHILD_CREATED, obj2);
|
||||
lv_obj_send_event(parent2, LV_EVENT_CHILD_CHANGED, obj1);
|
||||
lv_obj_send_event(parent2, LV_EVENT_CHILD_CREATED, obj1);
|
||||
|
||||
lv_obj_invalidate(parent);
|
||||
|
||||
@@ -362,7 +365,7 @@ static void lv_obj_del_async_cb(void * obj)
|
||||
static void obj_del_core(lv_obj_t * obj)
|
||||
{
|
||||
/*Let the user free the resources used in `LV_EVENT_DELETE`*/
|
||||
lv_res_t res = lv_event_send(obj, LV_EVENT_DELETE, NULL);
|
||||
lv_res_t res = lv_obj_send_event(obj, LV_EVENT_DELETE, NULL);
|
||||
if(res == LV_RES_INV) return;
|
||||
|
||||
/*Recursively delete the children*/
|
||||
@@ -377,11 +380,14 @@ static void obj_del_core(lv_obj_t * obj)
|
||||
/*Reset all input devices if the object to delete is used*/
|
||||
lv_indev_t * indev = lv_indev_get_next(NULL);
|
||||
while(indev) {
|
||||
if(indev->proc.types.pointer.act_obj == obj || indev->proc.types.pointer.last_obj == obj) {
|
||||
lv_indev_reset(indev, obj);
|
||||
}
|
||||
if(indev->proc.types.pointer.last_pressed == obj) {
|
||||
indev->proc.types.pointer.last_pressed = NULL;
|
||||
lv_indev_type_t indev_type = lv_indev_get_type(indev);
|
||||
if(indev_type == LV_INDEV_TYPE_POINTER || indev_type == LV_INDEV_TYPE_BUTTON) {
|
||||
if(indev->pointer.act_obj == obj || indev->pointer.last_obj == obj) {
|
||||
lv_indev_reset(indev, obj);
|
||||
}
|
||||
if(indev->pointer.last_pressed == obj) {
|
||||
indev->pointer.last_pressed = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if(indev->group == group && obj == lv_indev_get_obj_act()) {
|
||||
|
||||
Reference in New Issue
Block a user