2018-06-09 08:47:09 +02:00
|
|
|
/**
|
|
|
|
* @file lv_preload.c
|
2018-06-19 09:49:58 +02:00
|
|
|
*
|
2018-06-09 08:47:09 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
2018-07-08 01:12:20 +02:00
|
|
|
#include "lv_preload.h"
|
2020-02-14 12:36:44 +01:00
|
|
|
#if LV_USE_SPINNER != 0
|
2018-06-09 08:47:09 +02:00
|
|
|
|
2019-09-24 16:30:38 +02:00
|
|
|
#include "../lv_core/lv_debug.h"
|
2018-06-09 08:47:09 +02:00
|
|
|
#include "../lv_misc/lv_math.h"
|
|
|
|
#include "../lv_draw/lv_draw_rect.h"
|
|
|
|
#include "../lv_draw/lv_draw_arc.h"
|
2018-09-20 22:14:48 +02:00
|
|
|
#include "../lv_themes/lv_theme.h"
|
2018-06-09 08:47:09 +02:00
|
|
|
|
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
2020-02-14 12:36:44 +01:00
|
|
|
#define LV_OBJX_NAME "lv_spinner"
|
2019-09-26 10:51:54 +02:00
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
#ifndef LV_SPINNER_DEF_ARC_LENGTH
|
|
|
|
#define LV_SPINNER_DEF_ARC_LENGTH 60 /*[deg]*/
|
2018-06-11 10:36:36 +02:00
|
|
|
#endif
|
2018-06-09 08:47:09 +02:00
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
#ifndef LV_SPINNER_DEF_SPIN_TIME
|
|
|
|
#define LV_SPINNER_DEF_SPIN_TIME 1000 /*[ms]*/
|
2018-06-11 10:36:36 +02:00
|
|
|
#endif
|
2018-11-15 11:37:00 +01:00
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
#ifndef LV_SPINNER_DEF_ANIM
|
|
|
|
#define LV_SPINNER_DEF_ANIM LV_SPINNER_TYPE_SPINNING_ARC /*animation type*/
|
2018-11-15 11:37:00 +01:00
|
|
|
#endif
|
|
|
|
|
2018-06-09 08:47:09 +02:00
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* STATIC PROTOTYPES
|
|
|
|
**********************/
|
2020-02-14 12:36:44 +01:00
|
|
|
static lv_res_t lv_spinner_signal(lv_obj_t * preload, lv_signal_t sign, void * param);
|
2018-06-09 08:47:09 +02:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* STATIC VARIABLES
|
|
|
|
**********************/
|
2019-02-26 09:25:46 +01:00
|
|
|
static lv_signal_cb_t ancestor_signal;
|
|
|
|
static lv_design_cb_t ancestor_design;
|
2018-06-09 08:47:09 +02:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* GLOBAL FUNCTIONS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a pre loader object
|
|
|
|
* @param par pointer to an object, it will be the parent of the new pre loader
|
2019-04-04 07:15:40 +02:00
|
|
|
* @param copy pointer to a pre loader object, if not NULL then the new object will be copied from
|
|
|
|
* it
|
2018-06-09 08:47:09 +02:00
|
|
|
* @return pointer to the created pre loader
|
|
|
|
*/
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_obj_t * lv_spinner_create(lv_obj_t * par, const lv_obj_t * copy)
|
2018-06-09 08:47:09 +02:00
|
|
|
{
|
2018-10-05 17:22:49 +02:00
|
|
|
LV_LOG_TRACE("preload create started");
|
2018-07-25 17:57:08 +02:00
|
|
|
|
2018-06-09 08:47:09 +02:00
|
|
|
/*Create the ancestor of pre loader*/
|
2020-02-03 16:18:53 +01:00
|
|
|
lv_obj_t * preload = lv_arc_create(par, copy);
|
|
|
|
LV_ASSERT_MEM(preload);
|
|
|
|
if(preload == NULL) return NULL;
|
2018-06-19 09:49:58 +02:00
|
|
|
|
2018-06-09 08:47:09 +02:00
|
|
|
/*Allocate the pre loader type specific extended data*/
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_allocate_ext_attr(preload, sizeof(lv_spinner_ext_t));
|
2019-09-24 23:14:17 +02:00
|
|
|
LV_ASSERT_MEM(ext);
|
2019-12-03 18:16:14 +01:00
|
|
|
if(ext == NULL) {
|
2020-02-03 16:18:53 +01:00
|
|
|
lv_obj_del(preload);
|
2019-12-03 18:16:14 +01:00
|
|
|
return NULL;
|
|
|
|
}
|
2018-07-25 13:33:53 +02:00
|
|
|
|
2020-02-03 16:18:53 +01:00
|
|
|
if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(preload);
|
|
|
|
if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(preload);
|
2018-06-09 08:47:09 +02:00
|
|
|
|
|
|
|
/*Initialize the allocated 'ext' */
|
2020-02-14 12:36:44 +01:00
|
|
|
ext->arc_length = LV_SPINNER_DEF_ARC_LENGTH;
|
|
|
|
ext->anim_type = LV_SPINNER_DEF_ANIM;
|
|
|
|
ext->anim_dir = LV_SPINNER_DIR_FORWARD;
|
|
|
|
ext->time = LV_SPINNER_DEF_SPIN_TIME;
|
2018-06-09 08:47:09 +02:00
|
|
|
|
|
|
|
/*The signal and design functions are not copied so set them here*/
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_obj_set_signal_cb(preload, lv_spinner_signal);
|
2018-11-15 11:37:00 +01:00
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
/*Init the new spinner spinner*/
|
2018-06-09 08:47:09 +02:00
|
|
|
if(copy == NULL) {
|
2020-02-03 16:18:53 +01:00
|
|
|
ext->arc.bg_angle_start = 0;
|
|
|
|
ext->arc.bg_angle_end = 360;
|
|
|
|
lv_obj_set_size(preload, LV_DPI, LV_DPI);
|
2020-02-14 17:03:25 +01:00
|
|
|
lv_theme_apply(preload, LV_THEME_SPINNER);
|
2018-11-15 11:37:00 +01:00
|
|
|
|
2018-06-09 08:47:09 +02:00
|
|
|
}
|
2020-02-14 12:36:44 +01:00
|
|
|
/*Copy an existing spinner*/
|
2018-06-09 08:47:09 +02:00
|
|
|
else {
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
|
2019-04-04 07:15:40 +02:00
|
|
|
ext->arc_length = copy_ext->arc_length;
|
|
|
|
ext->time = copy_ext->time;
|
2019-04-12 07:57:16 -07:00
|
|
|
ext->anim_dir = copy_ext->anim_dir;
|
2018-06-09 08:47:09 +02:00
|
|
|
/*Refresh the style with new signal function*/
|
2020-02-03 16:18:53 +01:00
|
|
|
lv_obj_refresh_style(preload);
|
2018-06-09 08:47:09 +02:00
|
|
|
}
|
2018-06-19 09:49:58 +02:00
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_set_type(preload, ext->anim_type);
|
2018-11-15 11:37:00 +01:00
|
|
|
|
2018-10-05 17:22:49 +02:00
|
|
|
LV_LOG_INFO("preload created");
|
2018-07-25 17:57:08 +02:00
|
|
|
|
2020-02-03 16:18:53 +01:00
|
|
|
return preload;
|
2018-06-09 08:47:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*======================
|
|
|
|
* Add/remove functions
|
|
|
|
*=====================*/
|
|
|
|
|
2018-06-11 10:36:36 +02:00
|
|
|
/**
|
|
|
|
* Set the length of the spinning arc in degrees
|
|
|
|
* @param preload pointer to a preload object
|
|
|
|
* @param deg length of the arc
|
|
|
|
*/
|
2020-02-14 12:36:44 +01:00
|
|
|
void lv_spinner_set_arc_length(lv_obj_t * preload, lv_anim_value_t deg)
|
2018-06-11 10:36:36 +02:00
|
|
|
{
|
2019-09-26 12:54:40 +02:00
|
|
|
LV_ASSERT_OBJ(preload, LV_OBJX_NAME);
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_get_ext_attr(preload);
|
2018-06-11 10:36:36 +02:00
|
|
|
|
2018-06-19 09:49:58 +02:00
|
|
|
ext->arc_length = deg;
|
2018-06-11 10:36:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the spin time of the arc
|
|
|
|
* @param preload pointer to a preload object
|
|
|
|
* @param time time of one round in milliseconds
|
2018-06-09 08:47:09 +02:00
|
|
|
*/
|
2020-02-14 12:36:44 +01:00
|
|
|
void lv_spinner_set_spin_time(lv_obj_t * preload, uint16_t time)
|
2018-06-11 10:36:36 +02:00
|
|
|
{
|
2019-09-26 12:54:40 +02:00
|
|
|
LV_ASSERT_OBJ(preload, LV_OBJX_NAME);
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_get_ext_attr(preload);
|
2018-06-09 08:47:09 +02:00
|
|
|
|
2018-06-19 09:49:58 +02:00
|
|
|
ext->time = time;
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_set_type(preload, ext->anim_type);
|
2018-06-11 10:36:36 +02:00
|
|
|
}
|
2018-06-09 08:47:09 +02:00
|
|
|
/*=====================
|
|
|
|
* Setter functions
|
|
|
|
*====================*/
|
|
|
|
|
2018-11-15 11:37:00 +01:00
|
|
|
/**
|
|
|
|
* Set the animation type of a preloadeer.
|
|
|
|
* @param preload pointer to pre loader object
|
|
|
|
* @param type animation type of the preload
|
|
|
|
* */
|
2020-02-14 12:36:44 +01:00
|
|
|
void lv_spinner_set_type(lv_obj_t * preload, lv_spinner_type_t type)
|
2018-11-15 11:37:00 +01:00
|
|
|
{
|
2019-09-26 12:54:40 +02:00
|
|
|
LV_ASSERT_OBJ(preload, LV_OBJX_NAME);
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_get_ext_attr(preload);
|
2018-11-15 11:37:00 +01:00
|
|
|
|
|
|
|
/*delete previous animation*/
|
2019-04-12 07:48:00 -07:00
|
|
|
lv_anim_del(preload, NULL);
|
2019-04-04 07:15:40 +02:00
|
|
|
switch(type) {
|
2020-02-14 12:36:44 +01:00
|
|
|
case LV_SPINNER_TYPE_FILLSPIN_ARC: {
|
|
|
|
ext->anim_type = LV_SPINNER_TYPE_FILLSPIN_ARC;
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_anim_t a;
|
2019-06-06 06:05:40 +02:00
|
|
|
a.var = preload;
|
2020-02-14 12:36:44 +01:00
|
|
|
if(ext->anim_dir == LV_SPINNER_DIR_FORWARD) {
|
2019-04-11 09:26:11 -07:00
|
|
|
/* Clockwise */
|
2019-06-06 06:05:40 +02:00
|
|
|
a.start = 0;
|
|
|
|
a.end = 360;
|
2019-08-28 09:46:56 +02:00
|
|
|
} else {
|
|
|
|
a.start = 360;
|
|
|
|
a.end = 0;
|
2019-04-11 09:26:11 -07:00
|
|
|
}
|
2020-02-14 12:36:44 +01:00
|
|
|
a.exec_cb = (lv_anim_exec_xcb_t)lv_spinner_spinner_anim;
|
2019-05-18 18:14:21 -07:00
|
|
|
a.path_cb = lv_anim_path_ease_in_out;
|
|
|
|
a.ready_cb = NULL;
|
2019-04-04 07:15:40 +02:00
|
|
|
a.act_time = 0;
|
|
|
|
a.time = ext->time;
|
|
|
|
a.playback = 0;
|
|
|
|
a.playback_pause = 0;
|
|
|
|
a.repeat = 1;
|
|
|
|
a.repeat_pause = 0;
|
|
|
|
lv_anim_create(&a);
|
|
|
|
|
|
|
|
lv_anim_t b;
|
2019-06-06 06:05:40 +02:00
|
|
|
b.var = preload;
|
2020-02-14 12:36:44 +01:00
|
|
|
if(ext->anim_dir == LV_SPINNER_DIR_FORWARD) {
|
2019-04-11 09:26:11 -07:00
|
|
|
/* Clockwise */
|
2019-06-06 06:05:40 +02:00
|
|
|
b.start = ext->arc_length;
|
|
|
|
b.end = 360 - ext->arc_length;
|
2019-08-28 09:46:56 +02:00
|
|
|
} else {
|
|
|
|
b.start = 360 - ext->arc_length;
|
|
|
|
b.end = ext->arc_length;
|
2019-04-11 09:26:11 -07:00
|
|
|
}
|
2020-02-14 12:36:44 +01:00
|
|
|
b.exec_cb = (lv_anim_exec_xcb_t)lv_spinner_set_arc_length;
|
2019-05-18 18:14:21 -07:00
|
|
|
b.path_cb = lv_anim_path_ease_in_out;
|
|
|
|
b.ready_cb = NULL;
|
2019-04-04 07:15:40 +02:00
|
|
|
b.act_time = 0;
|
|
|
|
b.time = ext->time;
|
|
|
|
b.playback = 1;
|
|
|
|
b.playback_pause = 0;
|
|
|
|
b.repeat = 1;
|
|
|
|
b.repeat_pause = 0;
|
|
|
|
lv_anim_create(&b);
|
|
|
|
break;
|
|
|
|
}
|
2020-02-14 12:36:44 +01:00
|
|
|
case LV_SPINNER_TYPE_CONSTANT_ARC:
|
|
|
|
case LV_SPINNER_TYPE_SPINNING_ARC:
|
2019-04-04 07:15:40 +02:00
|
|
|
default: {
|
2019-08-29 00:01:50 +12:00
|
|
|
ext->anim_type = type;
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_anim_t a;
|
2019-06-06 06:05:40 +02:00
|
|
|
a.var = preload;
|
2020-02-14 12:36:44 +01:00
|
|
|
if(ext->anim_dir == LV_SPINNER_DIR_FORWARD) {
|
2019-04-11 09:26:11 -07:00
|
|
|
/* Clockwise */
|
2019-06-06 06:05:40 +02:00
|
|
|
a.start = 0;
|
|
|
|
a.end = 360;
|
2019-08-28 09:46:56 +02:00
|
|
|
} else {
|
|
|
|
a.start = 360;
|
|
|
|
a.end = 0;
|
2019-04-11 09:26:11 -07:00
|
|
|
}
|
2020-02-14 12:36:44 +01:00
|
|
|
a.exec_cb = (lv_anim_exec_xcb_t)lv_spinner_spinner_anim;
|
|
|
|
a.path_cb = (LV_SPINNER_TYPE_CONSTANT_ARC == type ?
|
2019-08-29 00:01:50 +12:00
|
|
|
lv_anim_path_linear : lv_anim_path_ease_in_out);
|
2019-05-18 18:14:21 -07:00
|
|
|
a.ready_cb = NULL;
|
2019-04-04 07:15:40 +02:00
|
|
|
a.act_time = 0;
|
|
|
|
a.time = ext->time;
|
|
|
|
a.playback = 0;
|
|
|
|
a.playback_pause = 0;
|
|
|
|
a.repeat = 1;
|
|
|
|
a.repeat_pause = 0;
|
|
|
|
lv_anim_create(&a);
|
|
|
|
break;
|
|
|
|
}
|
2018-11-15 11:37:00 +01:00
|
|
|
}
|
2018-06-09 08:47:09 +02:00
|
|
|
}
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
void lv_spinner_set_dir(lv_obj_t * preload, lv_spinner_dir_t dir)
|
2019-06-06 06:05:40 +02:00
|
|
|
{
|
2019-09-26 12:54:40 +02:00
|
|
|
LV_ASSERT_OBJ(preload, LV_OBJX_NAME);
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_get_ext_attr(preload);
|
2019-04-11 09:26:11 -07:00
|
|
|
|
2019-04-12 07:57:16 -07:00
|
|
|
ext->anim_dir = dir;
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_set_type(preload, ext->anim_type);
|
2019-04-11 09:26:11 -07:00
|
|
|
}
|
|
|
|
|
2018-06-09 08:47:09 +02:00
|
|
|
/*=====================
|
|
|
|
* Getter functions
|
|
|
|
*====================*/
|
|
|
|
|
2018-06-11 10:36:36 +02:00
|
|
|
/**
|
|
|
|
* Get the arc length [degree] of the a pre loader
|
|
|
|
* @param preload pointer to a pre loader object
|
|
|
|
*/
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_anim_value_t lv_spinner_get_arc_length(const lv_obj_t * preload)
|
2018-06-11 10:36:36 +02:00
|
|
|
{
|
2019-09-26 12:54:40 +02:00
|
|
|
LV_ASSERT_OBJ(preload, LV_OBJX_NAME);
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_get_ext_attr(preload);
|
2018-06-19 09:49:58 +02:00
|
|
|
return ext->arc_length;
|
2018-06-11 10:36:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the spin time of the arc
|
|
|
|
* @param preload pointer to a pre loader object [milliseconds]
|
2018-06-09 08:47:09 +02:00
|
|
|
*/
|
2020-02-14 12:36:44 +01:00
|
|
|
uint16_t lv_spinner_get_spin_time(const lv_obj_t * preload)
|
2018-06-11 10:36:36 +02:00
|
|
|
{
|
2019-09-26 12:54:40 +02:00
|
|
|
LV_ASSERT_OBJ(preload, LV_OBJX_NAME);
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_get_ext_attr(preload);
|
2018-06-19 09:49:58 +02:00
|
|
|
return ext->time;
|
2018-06-11 10:36:36 +02:00
|
|
|
}
|
2018-06-09 08:47:09 +02:00
|
|
|
|
2018-11-15 11:37:00 +01:00
|
|
|
/**
|
|
|
|
* Get the animation type of a preloadeer.
|
|
|
|
* @param preload pointer to pre loader object
|
|
|
|
* @return animation type
|
|
|
|
* */
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_type_t lv_spinner_get_type(lv_obj_t * preload)
|
2018-11-15 11:37:00 +01:00
|
|
|
{
|
2019-09-26 12:54:40 +02:00
|
|
|
LV_ASSERT_OBJ(preload, LV_OBJX_NAME);
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_get_ext_attr(preload);
|
2018-11-15 11:37:00 +01:00
|
|
|
return ext->anim_type;
|
|
|
|
}
|
|
|
|
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_dir_t lv_spinner_get_dir(lv_obj_t * preload)
|
2019-06-06 06:05:40 +02:00
|
|
|
{
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_get_ext_attr(preload);
|
2019-04-12 07:57:16 -07:00
|
|
|
return ext->anim_dir;
|
2019-04-11 09:26:11 -07:00
|
|
|
}
|
|
|
|
|
2018-06-09 08:47:09 +02:00
|
|
|
/*=====================
|
|
|
|
* Other functions
|
|
|
|
*====================*/
|
|
|
|
|
2018-07-30 06:52:29 +02:00
|
|
|
/**
|
2019-06-20 06:20:23 +02:00
|
|
|
* Animator function (exec_cb) to rotate the arc of spinner.
|
2020-02-14 12:36:44 +01:00
|
|
|
* @param ptr pointer to spinner
|
2018-07-30 06:52:29 +02:00
|
|
|
* @param val the current desired value [0..360]
|
|
|
|
*/
|
2020-02-14 12:36:44 +01:00
|
|
|
void lv_spinner_spinner_anim(void * ptr, lv_anim_value_t val)
|
2018-06-11 17:06:24 +02:00
|
|
|
{
|
2019-04-04 07:15:40 +02:00
|
|
|
lv_obj_t * preload = ptr;
|
2020-02-14 12:36:44 +01:00
|
|
|
lv_spinner_ext_t * ext = lv_obj_get_ext_attr(preload);
|
2019-04-11 09:26:11 -07:00
|
|
|
|
2019-11-08 10:23:49 +01:00
|
|
|
int16_t angle_start = val - ext->arc_length / 2 - 90;
|
|
|
|
if(angle_start < 0) angle_start += 360;
|
2019-06-06 06:05:40 +02:00
|
|
|
int16_t angle_end = angle_start + ext->arc_length;
|
2018-06-11 17:06:24 +02:00
|
|
|
|
2018-06-19 09:49:58 +02:00
|
|
|
angle_start = angle_start % 360;
|
2019-04-04 07:15:40 +02:00
|
|
|
angle_end = angle_end % 360;
|
2018-06-11 17:06:24 +02:00
|
|
|
|
2020-02-05 10:40:50 +01:00
|
|
|
lv_arc_set_angles(preload, angle_start, angle_end);
|
2018-06-11 17:06:24 +02:00
|
|
|
}
|
|
|
|
|
2018-06-09 08:47:09 +02:00
|
|
|
/**********************
|
|
|
|
* STATIC FUNCTIONS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signal function of the pre loader
|
|
|
|
* @param preload pointer to a pre loader object
|
|
|
|
* @param sign a signal type from lv_signal_t enum
|
|
|
|
* @param param pointer to a signal specific variable
|
|
|
|
* @return LV_RES_OK: the object is not deleted in the function; LV_RES_INV: the object is deleted
|
|
|
|
*/
|
2020-02-14 12:36:44 +01:00
|
|
|
static lv_res_t lv_spinner_signal(lv_obj_t * preload, lv_signal_t sign, void * param)
|
2018-06-09 08:47:09 +02:00
|
|
|
{
|
|
|
|
lv_res_t res;
|
|
|
|
|
|
|
|
/* Include the ancient signal function */
|
|
|
|
res = ancestor_signal(preload, sign, param);
|
|
|
|
if(res != LV_RES_OK) return res;
|
2019-09-26 12:54:40 +02:00
|
|
|
if(sign == LV_SIGNAL_GET_TYPE) return lv_obj_handle_get_type_signal(param, LV_OBJX_NAME);
|
2018-06-09 08:47:09 +02:00
|
|
|
|
|
|
|
if(sign == LV_SIGNAL_CLEANUP) {
|
|
|
|
/*Nothing to cleanup. (No dynamically allocated memory in 'ext')*/
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|