BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lvgl
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
lvgl
Commits
ff2e425b
Commit
ff2e425b
authored
Feb 23, 2018
by
Gabor Kiss-Vamosi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comment updates
parent
93330eaf
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
21 deletions
+73
-21
lv_hal_indev.c
lv_hal/lv_hal_indev.c
+2
-2
lv_hal_indev.h
lv_hal/lv_hal_indev.h
+3
-3
lv_img.c
lv_objx/lv_img.c
+10
-11
lv_img.h
lv_objx/lv_img.h
+37
-5
lv_line.c
lv_objx/lv_line.c
+1
-0
lv_line.h
lv_objx/lv_line.h
+20
-0
No files found.
lv_hal/lv_hal_indev.c
View file @
ff2e425b
...
...
@@ -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
));
...
...
lv_hal/lv_hal_indev.h
View file @
ff2e425b
...
...
@@ -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*/
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
;
...
...
lv_objx/lv_img.c
View file @
ff2e425b
...
...
@@ -199,16 +199,6 @@ 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").
*/
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.
* @param img pointer to an image
...
...
@@ -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
""
;
}
...
...
lv_objx/lv_img.h
View file @
ff2e425b
...
...
@@ -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
**********************/
...
...
lv_objx/lv_line.c
View file @
ff2e425b
...
...
@@ -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
{
...
...
lv_objx/lv_line.h
View file @
ff2e425b
...
...
@@ -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
**********************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment