comment updates
This commit is contained in:
@@ -46,7 +46,7 @@ void lv_indev_drv_init(lv_indev_drv_t *driver)
|
||||
{
|
||||
driver->read = NULL;
|
||||
driver->type = LV_INDEV_TYPE_NONE;
|
||||
driver->priv = NULL;
|
||||
driver->user_data = NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -108,7 +108,7 @@ bool lv_indev_read(lv_indev_t * indev, lv_indev_data_t *data)
|
||||
bool cont = false;
|
||||
|
||||
if(indev->driver.read) {
|
||||
data->priv = indev->driver.priv;
|
||||
data->user_data = indev->driver.user_data;
|
||||
cont = indev->driver.read(data);
|
||||
} else {
|
||||
memset(data, 0, sizeof(lv_indev_data_t));
|
||||
|
||||
@@ -48,14 +48,14 @@ typedef struct {
|
||||
uint32_t key; /*For INDEV_TYPE_KEYPAD*/
|
||||
};
|
||||
lv_indev_state_t state; /*LV_INDEV_EVENT_REL or LV_INDEV_EVENT_PR*/
|
||||
void *priv; /*'lv_indev_drv_t.priv' for this driver*/
|
||||
void *user_data; /*'lv_indev_drv_t.priv' for this driver*/
|
||||
}lv_indev_data_t;
|
||||
|
||||
/*Initialized by the user and registered by 'lv_indev_add()'*/
|
||||
typedef struct {
|
||||
lv_hal_indev_type_t type; /*Input device type*/
|
||||
bool (*read)(lv_indev_data_t *data); /*Function pointer to read data. Return 'true' if there is still data to be read (buffered)*/
|
||||
void *priv; /*Opaque pointer for driver's use, passed in 'lv_indev_data_t' on read*/
|
||||
void *user_data; /*Pointer to user defined data, passed in 'lv_indev_data_t' on read*/
|
||||
}lv_indev_drv_t;
|
||||
|
||||
struct _lv_obj_t;
|
||||
|
||||
@@ -198,16 +198,6 @@ void lv_img_set_src(lv_obj_t * img, const void * src_img)
|
||||
lv_obj_invalidate(img);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a file to the image
|
||||
* @param img pointer to an image object
|
||||
* @param fn file name in the RAMFS to set as picture (e.g. "U:/pic1").
|
||||
*/
|
||||
void lv_img_set_file(lv_obj_t * img, const char * fn)
|
||||
{
|
||||
lv_img_set_src(img, fn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable the auto size feature.
|
||||
* If enabled the object size will be same as the picture size.
|
||||
@@ -226,6 +216,14 @@ void lv_img_set_auto_size(lv_obj_t * img, bool autosize_en)
|
||||
* Getter functions
|
||||
*====================*/
|
||||
|
||||
/**
|
||||
* Get the type of an image source
|
||||
* @param src pointer to an image source:
|
||||
* - pointer to an 'lv_img_t' variable (image stored internally and compiled into the code)
|
||||
* - a path to an file (e.g. "S:/folder/image.bin")
|
||||
* - or a symbol (e.g. SYMBOL_CLOSE)
|
||||
* @return type of the image source LV_IMG_SRC_VARIABLE/FILE/SYMBOL/UNKOWN
|
||||
*/
|
||||
lv_img_src_t lv_img_get_src_type(const void * src)
|
||||
{
|
||||
if(src == NULL) return LV_IMG_SRC_UNKNOWN;
|
||||
@@ -247,7 +245,8 @@ const char * lv_img_get_file_name(lv_obj_t * img)
|
||||
{
|
||||
lv_img_ext_t * ext = lv_obj_get_ext_attr(img);
|
||||
|
||||
return ext->src;
|
||||
if(ext->src_type == LV_IMG_SRC_FILE) return ext->src;
|
||||
else return "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -68,11 +68,15 @@ lv_obj_t * lv_img_create(lv_obj_t * par, lv_obj_t * copy);
|
||||
void lv_img_set_src(lv_obj_t * img, const void * src_img);
|
||||
|
||||
/**
|
||||
* Set a file to the image
|
||||
* @param img pointer to an image object
|
||||
* @param fn file name in the RAMFS to set as picture (e.g. "U:/pic1").
|
||||
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0.
|
||||
* Use 'lv_img_set_src()' instead.
|
||||
* @param img
|
||||
* @param fn
|
||||
*/
|
||||
void lv_img_set_file(lv_obj_t * img, const char * fn);
|
||||
static inline void lv_img_set_file(lv_obj_t * img, const char * fn)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable the auto size feature.
|
||||
@@ -92,12 +96,31 @@ static inline void lv_img_set_style(lv_obj_t *img, lv_style_t *style)
|
||||
lv_obj_set_style(img, style);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0
|
||||
* @param img
|
||||
* @param upscale
|
||||
*/
|
||||
static inline void lv_img_set_upscale(lv_obj_t * img, bool upcale)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/*=====================
|
||||
* Getter functions
|
||||
*====================*/
|
||||
|
||||
/**
|
||||
* Get the type of an image source
|
||||
* @param src pointer to an image source:
|
||||
* - pointer to an 'lv_img_t' variable (image stored internally and compiled into the code)
|
||||
* - a path to an file (e.g. "S:/folder/image.bin")
|
||||
* - or a symbol (e.g. SYMBOL_CLOSE)
|
||||
* @return type of the image source LV_IMG_SRC_VARIABLE/FILE/SYMBOL/UNKOWN
|
||||
*/
|
||||
lv_img_src_t lv_img_get_src_type(const void * src);
|
||||
|
||||
|
||||
/**
|
||||
* Get the name of the file set for an image
|
||||
* @param img pointer to an image
|
||||
@@ -105,7 +128,6 @@ lv_img_src_t lv_img_get_src_type(const void * src);
|
||||
*/
|
||||
const char * lv_img_get_file_name(lv_obj_t * img);
|
||||
|
||||
|
||||
/**
|
||||
* Get the auto size enable attribute
|
||||
* @param img pointer to an image
|
||||
@@ -123,6 +145,16 @@ static inline lv_style_t* lv_img_get_style(lv_obj_t *img)
|
||||
return lv_obj_get_style(img);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0
|
||||
* @param img
|
||||
* @return false
|
||||
*/
|
||||
static inline bool lv_img_get_upscale(lv_obj_t * img)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
@@ -71,6 +71,7 @@ lv_obj_t * lv_line_create(lv_obj_t * par, lv_obj_t * copy)
|
||||
if(copy == NULL) {
|
||||
lv_obj_set_size(new_line, LV_DPI, LV_DPI); /*Auto size is enables, but set default size until no points are added*/
|
||||
lv_obj_set_style(new_line, NULL); /*Inherit parent's style*/
|
||||
lv_obj_set_click(new_line, false);
|
||||
}
|
||||
/*Copy an existing object*/
|
||||
else {
|
||||
|
||||
@@ -88,6 +88,15 @@ static inline void lv_line_set_style(lv_obj_t *line, lv_style_t *style)
|
||||
lv_obj_set_style(line, style);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0
|
||||
* @param line
|
||||
* @param upscale
|
||||
*/
|
||||
static inline void lv_line_set_upscale(lv_obj_t * line, bool upcale)
|
||||
{
|
||||
|
||||
}
|
||||
/*=====================
|
||||
* Getter functions
|
||||
*====================*/
|
||||
@@ -116,6 +125,17 @@ static inline lv_style_t* lv_line_get_style(lv_obj_t *line)
|
||||
return lv_obj_get_style(line);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obsolete since v5.1. Just for compatibility with v5.0. Will be removed in v6.0
|
||||
* @param line
|
||||
* @return false
|
||||
*/
|
||||
static inline bool lv_line_get_upscale(lv_obj_t * line)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
Reference in New Issue
Block a user