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
ebf7fd20
Commit
ebf7fd20
authored
Aug 22, 2017
by
Gabor
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'beta' into new_objs
parents
6d68aabc
8ad9b481
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
38 additions
and
31 deletions
+38
-31
TODO_PATCH.md
docs/TODO_PATCH.md
+1
-0
lv_draw.c
lv_draw/lv_draw.c
+14
-2
lv_draw.h
lv_draw/lv_draw.h
+11
-0
lv_img.c
lv_objx/lv_img.c
+5
-2
lv_img.h
lv_objx/lv_img.h
+1
-20
lv_list.c
lv_objx/lv_list.c
+6
-3
lv_list.h
lv_objx/lv_list.h
+0
-4
No files found.
docs/TODO_PATCH.md
View file @
ebf7fd20
...
...
@@ -11,3 +11,4 @@ Please create an issue to introduce a bug instead of adding pull request to this
## Next release
-
[
x
]
lv_slider: don't let indicator or bar to disappear because of hpad/vpad
-
[
x
]
lv_ta: memory leak if deleted in password mode
-
[
x
]
lv_list: work without
*lv_img*
by ignore the image file name parameter of
*lv_list_add()*
lv_draw/lv_draw.c
View file @
ebf7fd20
...
...
@@ -65,13 +65,17 @@ static void point_swap(point_t * p1, point_t * p2);
static
void
(
*
px_fp
)(
cord_t
x
,
cord_t
y
,
const
area_t
*
mask_p
,
color_t
color
,
opa_t
opa
)
=
lv_vpx
;
static
void
(
*
fill_fp
)(
const
area_t
*
cords_p
,
const
area_t
*
mask_p
,
color_t
color
,
opa_t
opa
)
=
lv_vfill
;
static
void
(
*
letter_fp
)(
const
point_t
*
pos_p
,
const
area_t
*
mask_p
,
const
font_t
*
font_p
,
uint8_t
letter
,
color_t
color
,
opa_t
opa
)
=
lv_vletter
;
#if USE_FSINT != 0
static
void
(
*
map_fp
)(
const
area_t
*
cords_p
,
const
area_t
*
mask_p
,
const
color_t
*
map_p
,
opa_t
opa
,
bool
transp
,
bool
upscale
,
color_t
recolor
,
opa_t
recolor_opa
)
=
lv_vmap
;
#endif
#else
static
void
(
*
px_fp
)(
cord_t
x
,
cord_t
y
,
const
area_t
*
mask_p
,
color_t
color
,
opa_t
opa
)
=
lv_rpx
;
static
void
(
*
fill_fp
)(
const
area_t
*
cords_p
,
const
area_t
*
mask_p
,
color_t
color
,
opa_t
opa
)
=
lv_rfill
;
static
void
(
*
letter_fp
)(
const
point_t
*
pos_p
,
const
area_t
*
mask_p
,
const
font_t
*
font_p
,
uint8_t
letter
,
color_t
color
,
opa_t
opa
)
=
lv_rletter
;
#if USE_LV_IMG != 0 && USE_FSINT != 0
static
void
(
*
map_fp
)(
const
area_t
*
cords_p
,
const
area_t
*
mask_p
,
const
color_t
*
map_p
,
opa_t
opa
,
bool
transp
,
bool
upscale
,
color_t
recolor
,
opa_t
recolor_opa
)
=
lv_rmap
;
#endif
#endif
/**********************
...
...
@@ -338,6 +342,7 @@ void lv_draw_label(const area_t * cords_p,const area_t * mask_p, const lv_style_
}
}
#if USE_FSINT != 0
/**
* Draw an image
* @param cords_p the coordinates of the image
...
...
@@ -379,14 +384,21 @@ void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
if
((
mask_com
.
x2
&
0x1
)
==
0
)
mask_com
.
x2
-=
1
;
/*Can be only odd*/
}
bool
const_data
=
false
;
#if USE_UFS != 0
/*If the img. data is inside the MCU then do not use FS reading just a pointer*/
if
(
fn
[
0
]
==
UFS_LETTER
)
{
const_data
=
true
;
uint8_t
*
f_data
=
((
ufs_file_t
*
)
file
.
file_d
)
->
ent
->
data_d
;
f_data
+=
sizeof
(
lv_img_raw_header_t
);
map_fp
(
cords_p
,
&
mask_com
,
(
void
*
)
f_data
,
style
->
opa
,
header
.
transp
,
upscale
,
style
->
ccolor
,
style
->
img_recolor
);
}
#endif
/*Read the img. with the FS interface*/
else
{
if
(
const_data
!=
false
)
{
uint8_t
us_shift
=
0
;
uint8_t
us_val
=
1
;
if
(
upscale
!=
false
)
{
...
...
@@ -434,7 +446,7 @@ void lv_draw_img(const area_t * cords_p, const area_t * mask_p,
}
}
}
#endif
/**
* Draw a line
...
...
lv_draw/lv_draw.h
View file @
ebf7fd20
...
...
@@ -25,6 +25,17 @@ extern "C" {
* TYPEDEFS
**********************/
/* Image header it is compatible with
* the result image converter utility*/
typedef
struct
{
uint32_t
w
:
12
;
/*Width of the image map*/
uint32_t
h
:
12
;
/*Height of the image map*/
uint32_t
transp
:
1
;
/*1: The image contains transparent pixels with LV_COLOR_TRANSP color*/
uint32_t
cd
:
3
;
/*Color depth (0: reserved, 1: 8 bit, 2: 16 bit or 3: 24 bit, 4-7: reserved)*/
uint32_t
res
:
4
;
/*Reserved*/
}
lv_img_raw_header_t
;
/**********************
* GLOBAL PROTOTYPES
**********************/
...
...
lv_objx/lv_img.c
View file @
ebf7fd20
...
...
@@ -8,7 +8,7 @@
*********************/
#include "lv_conf.h"
#include "misc_conf.h"
#if USE_LV_IMG != 0 && USE_FSINT != 0
&& USE_UFS != 0
#if USE_LV_IMG != 0 && USE_FSINT != 0
#include "lv_img.h"
#include "../lv_draw/lv_draw.h"
...
...
@@ -134,11 +134,15 @@ bool lv_img_signal(lv_obj_t * img, lv_signal_t sign, void * param)
*/
fs_res_t
lv_img_create_file
(
const
char
*
fn
,
const
color_int_t
*
data
)
{
#if USE_UFS != 0
const
lv_img_raw_header_t
*
raw_p
=
(
lv_img_raw_header_t
*
)
data
;
fs_res_t
res
;
res
=
ufs_create_const
(
fn
,
data
,
raw_p
->
w
*
raw_p
->
h
*
sizeof
(
color_t
)
+
sizeof
(
lv_img_raw_header_t
));
return
res
;
#else
return
FS_RES_NOT_EX
;
#endif
}
/*=====================
...
...
@@ -156,7 +160,6 @@ void lv_img_set_file(lv_obj_t * img, const char * fn)
/*Handle normal images*/
if
(
lv_img_is_symbol
(
fn
)
==
false
)
{
fs_file_t
file
;
fs_res_t
res
;
lv_img_raw_header_t
header
;
...
...
lv_objx/lv_img.h
View file @
ebf7fd20
...
...
@@ -15,15 +15,7 @@ extern "C" {
*********************/
#include "lv_conf.h"
#include "misc_conf.h"
#if USE_LV_IMG != 0 && USE_FSINT != 0 && USE_UFS != 0
#if USE_FSINT == 0
#error "lv_img: fsint is required. Enable it in misc_conf.h (USE_FSINT 1) "
#endif
#if USE_UFS == 0
#error "lv_img: ufs is required. Enable it in misc_conf.h (USE_UFS 1) "
#endif
#if USE_LV_IMG != 0 && USE_FSINT != 0
#include "../lv_obj/lv_obj.h"
#include "misc/fs/fsint.h"
...
...
@@ -57,17 +49,6 @@ typedef struct
uint8_t
transp
:
1
;
/*Transp. bit in the image header (Handled by the library)*/
}
lv_img_ext_t
;
/* Image header it is compatible with
* the result image converter utility*/
typedef
struct
{
uint32_t
w
:
12
;
/*Width of the image map*/
uint32_t
h
:
12
;
/*Height of the image map*/
uint32_t
transp
:
1
;
/*1: The image contains transparent pixels with LV_COLOR_TRANSP color*/
uint32_t
cd
:
3
;
/*Color depth (0: reserved, 1: 8 bit, 2: 16 bit or 3: 24 bit, 4-7: reserved)*/
uint32_t
res
:
4
;
/*Reserved*/
}
lv_img_raw_header_t
;
/**********************
* GLOBAL PROTOTYPES
**********************/
...
...
lv_objx/lv_list.c
View file @
ebf7fd20
...
...
@@ -233,18 +233,17 @@ lv_obj_t * lv_list_add(lv_obj_t * list, const char * img_fn, const char * txt, l
if
(
hpad_tot
<
ext
->
page
.
sb_width
)
w
-=
ext
->
page
.
sb_width
-
hpad_tot
;
}
lv_obj_set_width
(
liste
,
w
);
#if USE_LV_IMG != 0 && USE_FSINT != 0
if
(
img_fn
!=
NULL
&&
img_fn
[
0
]
!=
'\0'
)
{
lv_obj_t
*
img
=
lv_img_create
(
liste
,
NULL
);
lv_img_set_file
(
img
,
img_fn
);
lv_obj_set_style
(
img
,
ext
->
style_img
);
lv_obj_set_click
(
img
,
false
);
}
#endif
if
(
txt
!=
NULL
)
{
lv_obj_t
*
label
=
lv_label_create
(
liste
,
NULL
);
lv_label_set_text
(
label
,
txt
);
lv_obj_set_style
(
label
,
ext
->
styles_btn
[
LV_BTN_STATE_REL
]);
lv_obj_set_click
(
label
,
false
);
lv_obj_set_width
(
label
,
liste
->
cords
.
x2
-
label
->
cords
.
x1
);
lv_label_set_long_mode
(
label
,
LV_LABEL_LONG_ROLL
);
...
...
@@ -463,6 +462,7 @@ lv_obj_t * lv_list_get_element_label(lv_obj_t * liste)
*/
lv_obj_t
*
lv_list_get_element_img
(
lv_obj_t
*
liste
)
{
#if USE_LV_IMG != 0 && USE_FSINT != 0
lv_obj_t
*
img
=
lv_obj_get_child
(
liste
,
NULL
);
if
(
img
==
NULL
)
return
NULL
;
...
...
@@ -472,6 +472,9 @@ lv_obj_t * lv_list_get_element_img(lv_obj_t * liste)
}
return
img
;
#else
return
NULL
;
#endif
}
/**
...
...
lv_objx/lv_list.h
View file @
ebf7fd20
...
...
@@ -29,10 +29,6 @@ extern "C" {
#error "lv_list: lv_label is required. Enable it in lv_conf.h (USE_LV_LABEL 1) "
#endif
#if USE_LV_IMG == 0
#error "lv_list: lv_img is required. Enable it in lv_conf.h (USE_LV_IMG 1) "
#endif
#include "../lv_obj/lv_obj.h"
#include "lv_page.h"
...
...
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