diff --git a/Kconfig b/Kconfig
index 5ceb017c69..6eb4c23025 100644
--- a/Kconfig
+++ b/Kconfig
@@ -1026,8 +1026,8 @@ menu "LVGL configuration"
config LV_USE_BMP
bool "BMP decoder library"
- config LV_USE_SJPG
- bool "JPG + split JPG decoder library"
+ config LV_USE_JPG
+ bool "JPG decoder library"
config LV_USE_GIF
bool "GIF decoder library"
diff --git a/demos/benchmark/lv_demo_benchmark.c b/demos/benchmark/lv_demo_benchmark.c
index 3a0766f1b6..6d6987497d 100644
--- a/demos/benchmark/lv_demo_benchmark.c
+++ b/demos/benchmark/lv_demo_benchmark.c
@@ -9,7 +9,7 @@
#include "lv_demo_benchmark.h"
#if LV_USE_DEMO_BENCHMARK
-#include "../../src/disp/lv_disp_private.h"
+#include "../../src/display/lv_display_private.h"
/*********************
* DEFINES
@@ -74,7 +74,7 @@ static lv_style_t style_common;
static bool scene_with_opa = true;
static uint32_t last_flush_cb_call;
static uint32_t render_start_time;
-static void (*flush_cb_ori)(lv_disp_t *, const lv_area_t *, uint8_t *);
+static void (*flush_cb_ori)(lv_display_t *, const lv_area_t *, uint8_t *);
static uint32_t disp_ori_timer_period;
static uint32_t anim_ori_timer_period;
@@ -100,10 +100,10 @@ static void benchmark_event_remove(void);
static void show_scene_report(void);
static void calc_scene_statistics(void);
-static lv_res_t load_next_scene(void);
+static lv_result_t load_next_scene(void);
static void next_scene_timer_cb(lv_timer_t * timer);
static void single_scene_finsih_timer_cb(lv_timer_t * timer);
-static void dummy_flush_cb(lv_disp_t * drv, const lv_area_t * area, uint8_t * pxmap);
+static void dummy_flush_cb(lv_display_t * drv, const lv_area_t * area, uint8_t * pxmap);
static void generate_report(void);
static void rect_create(lv_style_t * style);
@@ -666,7 +666,7 @@ void lv_demo_benchmark(lv_demo_benchmark_mode_t _mode)
benchmark_init();
if(mode == LV_DEMO_BENCHMARK_MODE_RENDER_ONLY) {
- while(load_next_scene() == LV_RES_OK) {
+ while(load_next_scene() == LV_RESULT_OK) {
uint32_t i;
for(i = 0; i < RENDER_REPEAT_CNT; i++) {
/*Wait a little to be sure something happens with the animations*/
@@ -733,9 +733,9 @@ void lv_demo_benchmark_run_scene(lv_demo_benchmark_mode_t _mode, uint16_t scene_
static void benchmark_init(void)
{
- lv_disp_t * disp = lv_disp_get_default();
+ lv_display_t * disp = lv_display_get_default();
- lv_disp_add_event(disp, benchmark_event_cb, LV_EVENT_ALL, NULL);
+ lv_display_add_event(disp, benchmark_event_cb, LV_EVENT_ALL, NULL);
flush_cb_ori = disp->flush_cb;
disp->flush_cb = dummy_flush_cb;
@@ -785,12 +785,12 @@ static void benchmark_event_cb(lv_event_t * e)
static void benchmark_event_remove(void)
{
- lv_disp_t * disp = lv_disp_get_default();
+ lv_display_t * disp = lv_display_get_default();
uint32_t i;
- for(i = 0; i < lv_disp_get_event_count(disp); i++) {
- lv_event_dsc_t * dsc = lv_disp_get_event_dsc(disp, i);
+ for(i = 0; i < lv_display_get_event_count(disp); i++) {
+ lv_event_dsc_t * dsc = lv_display_get_event_dsc(disp, i);
if(lv_event_dsc_get_cb(dsc) == benchmark_event_cb) {
- lv_disp_remove_event(disp, i);
+ lv_display_remove_event(disp, i);
return;
}
}
@@ -827,9 +827,9 @@ static void calc_scene_statistics(void)
}
}
-static lv_res_t load_next_scene(void)
+static lv_result_t load_next_scene(void)
{
- if(scene_act >= 0 && scenes[scene_act].create_cb == NULL) return LV_RES_INV;
+ if(scene_act >= 0 && scenes[scene_act].create_cb == NULL) return LV_RESULT_INVALID;
lv_obj_clean(scene_bg);
@@ -841,14 +841,14 @@ static lv_res_t load_next_scene(void)
scene_with_opa = true;
}
- if(scene_act >= 0 && scenes[scene_act].create_cb == NULL) return LV_RES_INV;
+ if(scene_act >= 0 && scenes[scene_act].create_cb == NULL) return LV_RESULT_INVALID;
last_flush_cb_call = 0;
rnd_reset();
scenes[scene_act].create_cb();
lv_label_set_text_fmt(title, "%s%s", scenes[scene_act].name, scene_with_opa ? " + opa" : "");
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
static void next_scene_timer_cb(lv_timer_t * timer)
@@ -857,9 +857,9 @@ static void next_scene_timer_cb(lv_timer_t * timer)
calc_scene_statistics();
show_scene_report();
- lv_res_t res = load_next_scene();
+ lv_result_t res = load_next_scene();
- if(res == LV_RES_INV) {
+ if(res == LV_RESULT_INVALID) {
lv_timer_del(timer);
generate_report();
}
@@ -870,7 +870,7 @@ static void single_scene_finsih_timer_cb(lv_timer_t * timer)
LV_UNUSED(timer);
calc_scene_statistics();
- lv_disp_t * disp = lv_disp_get_default();
+ lv_display_t * disp = lv_display_get_default();
disp->flush_cb = flush_cb_ori;
if(mode == LV_DEMO_BENCHMARK_MODE_RENDER_ONLY) {
@@ -886,13 +886,13 @@ static void single_scene_finsih_timer_cb(lv_timer_t * timer)
lv_obj_invalidate(lv_scr_act());
}
-static void dummy_flush_cb(lv_disp_t * drv, const lv_area_t * area, uint8_t * pxmap)
+static void dummy_flush_cb(lv_display_t * drv, const lv_area_t * area, uint8_t * pxmap)
{
LV_UNUSED(area);
if(mode == LV_DEMO_BENCHMARK_MODE_RENDER_AND_DRIVER) {
/*Measure the time since render start after flushing*/
- bool last = lv_disp_flush_is_last(drv);
+ bool last = lv_display_flush_is_last(drv);
flush_cb_ori(drv, area, pxmap);
if(last) {
@@ -908,7 +908,7 @@ static void dummy_flush_cb(lv_disp_t * drv, const lv_area_t * area, uint8_t * px
}
}
else if(mode == LV_DEMO_BENCHMARK_MODE_REAL) {
- bool last = lv_disp_flush_is_last(drv);
+ bool last = lv_display_flush_is_last(drv);
flush_cb_ori(drv, area, pxmap);
/*Measure the time since the previous last flush (full render)*/
@@ -929,10 +929,10 @@ static void dummy_flush_cb(lv_disp_t * drv, const lv_area_t * area, uint8_t * px
}
}
else if(mode == LV_DEMO_BENCHMARK_MODE_RENDER_ONLY) {
- bool last = lv_disp_flush_is_last(drv);
+ bool last = lv_display_flush_is_last(drv);
/*Just bypass the driver and measure the pure rendering time*/
- lv_disp_flush_ready(drv);
+ lv_display_flush_ready(drv);
if(last) {
uint32_t t = lv_tick_elaps(render_start_time);
@@ -950,7 +950,7 @@ static void dummy_flush_cb(lv_disp_t * drv, const lv_area_t * area, uint8_t * px
static void generate_report(void)
{
- lv_disp_t * disp = lv_disp_get_default();
+ lv_display_t * disp = lv_display_get_default();
disp->flush_cb = flush_cb_ori;
if(mode == LV_DEMO_BENCHMARK_MODE_RENDER_ONLY) {
@@ -1114,7 +1114,7 @@ static void img_create(lv_style_t * style, const void * src, bool rotate, bool z
lv_image_set_src(obj, src);
lv_obj_set_style_image_recolor(obj, lv_color_hex(rnd_next(0, 0xFFFFF0)), 0);
- if(rotate) lv_image_set_angle(obj, rnd_next(0, 3599));
+ if(rotate) lv_image_set_rotation(obj, rnd_next(0, 3599));
if(zoom) lv_image_set_zoom(obj, rnd_next(IMG_ZOOM_MIN, IMG_ZOOM_MAX));
lv_image_set_antialias(obj, aa);
diff --git a/demos/multilang/lv_demo_multilang.c b/demos/multilang/lv_demo_multilang.c
index ebc444be6f..4271df69ec 100644
--- a/demos/multilang/lv_demo_multilang.c
+++ b/demos/multilang/lv_demo_multilang.c
@@ -249,8 +249,8 @@ static void inactive_timer_cb(lv_timer_t * t)
return;
}
- if(lv_disp_get_inactive_time(NULL) > 8000) {
- lv_disp_trig_activity(NULL);
+ if(lv_display_get_inactive_time(NULL) > 8000) {
+ lv_display_trig_activity(NULL);
lv_obj_scroll_by(cont, 100, 0, LV_ANIM_ON);
lv_obj_add_flag(lv_layer_top(), LV_OBJ_FLAG_CLICKABLE);
scrolled = true;
diff --git a/demos/music/lv_demo_music_main.c b/demos/music/lv_demo_music_main.c
index 42a7449c1b..b52c78188b 100644
--- a/demos/music/lv_demo_music_main.c
+++ b/demos/music/lv_demo_music_main.c
@@ -281,7 +281,7 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)
lv_anim_set_var(&a, album_image_obj);
lv_anim_set_time(&a, 1000);
lv_anim_set_delay(&a, INTRO_TIME + 1000);
- lv_anim_set_values(&a, 1, LV_ZOOM_NONE);
+ lv_anim_set_values(&a, 1, LV_SCALE_NONE);
lv_anim_set_exec_cb(&a, _image_set_zoom_anim_cb);
lv_anim_set_ready_cb(&a, NULL);
lv_anim_start(&a);
@@ -305,7 +305,7 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)
lv_anim_set_var(&a, logo);
lv_anim_set_time(&a, 400);
lv_anim_set_delay(&a, INTRO_TIME + 800);
- lv_anim_set_values(&a, LV_ZOOM_NONE, 10);
+ lv_anim_set_values(&a, LV_SCALE_NONE, 10);
lv_anim_set_ready_cb(&a, lv_obj_del_anim_ready_cb);
lv_anim_start(&a);
@@ -373,7 +373,7 @@ void _lv_demo_music_pause(void)
spectrum_i = 0;
lv_anim_del(spectrum_obj, spectrum_anim_cb);
lv_obj_invalidate(spectrum_obj);
- lv_image_set_zoom(album_image_obj, LV_ZOOM_NONE);
+ lv_image_set_zoom(album_image_obj, LV_SCALE_NONE);
if(sec_counter_timer) lv_timer_pause(sec_counter_timer);
lv_obj_clear_state(play_obj, LV_STATE_CHECKED);
}
@@ -720,7 +720,7 @@ static void track_load(uint32_t id)
lv_anim_set_path_cb(&a, lv_anim_path_linear);
lv_anim_set_var(&a, album_image_obj);
lv_anim_set_time(&a, 500);
- lv_anim_set_values(&a, LV_ZOOM_NONE, LV_ZOOM_NONE / 2);
+ lv_anim_set_values(&a, LV_SCALE_NONE, LV_SCALE_NONE / 2);
lv_anim_set_exec_cb(&a, _image_set_zoom_anim_cb);
lv_anim_set_ready_cb(&a, NULL);
lv_anim_start(&a);
@@ -731,7 +731,7 @@ static void track_load(uint32_t id)
lv_anim_set_var(&a, album_image_obj);
lv_anim_set_time(&a, 500);
lv_anim_set_delay(&a, 100);
- lv_anim_set_values(&a, LV_ZOOM_NONE / 4, LV_ZOOM_NONE);
+ lv_anim_set_values(&a, LV_SCALE_NONE / 4, LV_SCALE_NONE);
lv_anim_set_exec_cb(&a, _image_set_zoom_anim_cb);
lv_anim_set_ready_cb(&a, NULL);
lv_anim_start(&a);
@@ -924,7 +924,7 @@ static void spectrum_anim_cb(void * a, int32_t v)
}
if(spectrum[spectrum_i][0] < 4) bar_rot += dir;
- lv_image_set_zoom(album_image_obj, LV_ZOOM_NONE + spectrum[spectrum_i][0]);
+ lv_image_set_zoom(album_image_obj, LV_SCALE_NONE + spectrum[spectrum_i][0]);
}
static void start_anim_cb(void * a, int32_t v)
diff --git a/demos/stress/lv_demo_stress.c b/demos/stress/lv_demo_stress.c
index ab2e176210..8a73e393ca 100644
--- a/demos/stress/lv_demo_stress.c
+++ b/demos/stress/lv_demo_stress.c
@@ -62,8 +62,8 @@ static void obj_test_task_cb(lv_timer_t * tmr)
switch(state) {
case -1: {
- lv_res_t res = lv_mem_test();
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_mem_test();
+ if(res != LV_RESULT_OK) {
LV_LOG_ERROR("Memory integrity error");
}
diff --git a/demos/transform/lv_demo_transform.c b/demos/transform/lv_demo_transform.c
index 11f787bdab..9ea6baa7b4 100644
--- a/demos/transform/lv_demo_transform.c
+++ b/demos/transform/lv_demo_transform.c
@@ -87,7 +87,7 @@ void lv_demo_transform(void)
card_to_transform = card_create();
lv_obj_center(card_to_transform);
- lv_coord_t disp_w = lv_disp_get_hor_res(NULL);
+ lv_coord_t disp_w = lv_display_get_horizontal_resolution(NULL);
lv_obj_t * arc = lv_arc_create(lv_scr_act());
lv_obj_set_size(arc, disp_w - 20, disp_w - 20);
lv_arc_set_range(arc, 0, 270);
@@ -148,14 +148,14 @@ static void arc_event_cb(lv_event_t * e)
lv_obj_t * arc = lv_event_get_target(e);
int32_t v = lv_arc_get_angle_end(arc);
- lv_obj_set_style_transform_angle(card_to_transform, v * 10, 0);
+ lv_obj_set_style_transform_rotation(card_to_transform, v * 10, 0);
}
static void slider_event_cb(lv_event_t * e)
{
lv_obj_t * slider = lv_event_get_target(e);
int32_t v = lv_slider_get_value(slider);
- lv_obj_set_style_transform_zoom(card_to_transform, v, 0);
+ lv_obj_set_style_transform_scale(card_to_transform, v, 0);
}
#endif
diff --git a/demos/widgets/lv_demo_widgets.c b/demos/widgets/lv_demo_widgets.c
index b759a2ddc4..7e53d54eb8 100644
--- a/demos/widgets/lv_demo_widgets.c
+++ b/demos/widgets/lv_demo_widgets.c
@@ -1284,7 +1284,7 @@ static void slider_event_cb(lv_event_t * e)
lv_snprintf(buf, sizeof(buf), "%"LV_PRId32, lv_slider_get_value(obj));
lv_point_t text_size;
- lv_txt_get_size(&text_size, buf, font_normal, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&text_size, buf, font_normal, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
lv_area_t txt_area;
txt_area.x1 = draw_task->area.x1 + lv_area_get_width(&draw_task->area) / 2 - text_size.x / 2;
@@ -1437,7 +1437,7 @@ static void chart_event_cb(lv_event_t * e)
lv_snprintf(buf, sizeof(buf), "%"LV_PRIu32, ser->y_points[base_dsc->id2]);
lv_point_t text_size;
- lv_txt_get_size(&text_size, buf, font_normal, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&text_size, buf, font_normal, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
lv_area_t txt_area;
if(lv_chart_get_type(obj) == LV_CHART_TYPE_BAR) {
diff --git a/docs/overview/style-props.md b/docs/overview/style-props.md
index 3e9a383563..d1a674bbc8 100644
--- a/docs/overview/style-props.md
+++ b/docs/overview/style-props.md
@@ -120,8 +120,8 @@ Move the object with this value in Y direction. Applied after layouts, aligns an
Ext. draw No
-### transform_zoom
-Zoom an objects. The value 256 (or `LV_ZOOM_NONE`) means normal size, 128 half size, 512 double size, and so on
+### transform_scale
+Zoom an objects. The value 256 (or `LV_SCALE_NONE`) means normal size, 128 half size, 512 double size, and so on
- Default 0
- Inherited No
@@ -129,7 +129,7 @@ Zoom an objects. The value 256 (or `LV_ZOOM_NONE`) means normal size, 128 half s
- Ext. draw Yes
-### transform_angle
+### transform_rotation
Rotate an objects. The value is interpreted in 0.1 degree units. E.g. 450 means 45 deg.
- Default 0
@@ -217,7 +217,7 @@ Sets the padding between the columns. Used by the layouts.
Properties to describe spacing around an object. Very similar to the margin properties in HTML.
### margin_top
-Sets the margin on the top. The object will keep this space from its siblings in layouts.
+Sets the margin on the top. The object will keep this space from its siblings in layouts.
- Default 0
- Inherited No
@@ -327,8 +327,8 @@ Set the dithering mode of the gradient of the background. The possible values ar
- Ext. draw No
-### bg_img_src
-Set a background image. Can be a pointer to `lv_img_dsc_t`, a path to a file or an `LV_SYMBOL_...`
+### bg_image_src
+Set a background image. Can be a pointer to `lv_image_dsc_t`, a path to a file or an `LV_SYMBOL_...`
- Default `NULL`
- Inherited No
@@ -336,7 +336,7 @@ Set a background image. Can be a pointer to `lv_img_dsc_t`, a path to a file or
- Ext. draw Yes
-### bg_img_opa
+### bg_image_opa
Set the opacity of the background image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency.
- Default `LV_OPA_COVER`
@@ -345,7 +345,7 @@ Set the opacity of the background image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP`
- Ext. draw No
-### bg_img_recolor
+### bg_image_recolor
Set a color to mix to the background image.
- Default `0x000000`
@@ -354,7 +354,7 @@ Set a color to mix to the background image.
- Ext. draw No
-### bg_img_recolor_opa
+### bg_image_recolor_opa
Set the intensity of background image recoloring. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means no mixing, 255, `LV_OPA_100` or `LV_OPA_COVER` means full recoloring, other values or LV_OPA_10, LV_OPA_20, etc are interpreted proportionally.
- Default `LV_OPA_TRANSP`
@@ -363,7 +363,7 @@ Set the intensity of background image recoloring. Value 0, `LV_OPA_0` or `LV_OPA
- Ext. draw No
-### bg_img_tiled
+### bg_image_tiled
If enabled the background image will be tiled. The possible values are `true` or `false`.
- Default 0
@@ -424,7 +424,7 @@ Sets whether the border should be drawn before or after the children are drawn.
Properties to describe the outline. It's like a border but drawn outside of the rectangles.
### outline_width
-Set the width of the outline in pixels.
+Set the width of the outline in pixels.
- Default 0
- Inherited No
@@ -472,7 +472,7 @@ Set the width of the shadow in pixels. The value should be >= 0.
### shadow_ofs_x
-Set an offset on the shadow in pixels in X direction.
+Set an offset on the shadow in pixels in X direction.
- Default 0
- Inherited No
@@ -481,7 +481,7 @@ Set an offset on the shadow in pixels in X direction.
### shadow_ofs_y
-Set an offset on the shadow in pixels in Y direction.
+Set an offset on the shadow in pixels in Y direction.
- Default 0
- Inherited No
@@ -519,7 +519,7 @@ Set the opacity of the shadow. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means full
## Image
Properties to describe the images
-### img_opa
+### image_opa
Set the opacity of an image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency.
- Default `LV_OPA_COVER`
@@ -528,7 +528,7 @@ Set the opacity of an image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully
- Ext. draw No
-### img_recolor
+### image_recolor
Set color to mixt to the image.
- Default `0x000000`
@@ -537,7 +537,7 @@ Set color to mixt to the image.
- Ext. draw No
-### img_recolor_opa
+### image_recolor_opa
Set the intensity of the color mixing. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency.
- Default 0
@@ -577,7 +577,7 @@ Set the gap between dashes in pixel. Note that dash works only on horizontal and
### line_rounded
-Make the end points of the lines rounded. `true`: rounded, `false`: perpendicular line ending
+Make the end points of the lines rounded. `true`: rounded, `false`: perpendicular line ending
- Default 0
- Inherited No
@@ -616,7 +616,7 @@ Set the width (thickness) of the arcs in pixel.
### arc_rounded
-Make the end points of the arcs rounded. `true`: rounded, `false`: perpendicular line ending
+Make the end points of the arcs rounded. `true`: rounded, `false`: perpendicular line ending
- Default 0
- Inherited No
@@ -642,8 +642,8 @@ Set the opacity of the arcs.
- Ext. draw No
-### arc_img_src
-Set an image from which the arc will be masked out. It's useful to display complex effects on the arcs. Can be a pointer to `lv_img_dsc_t` or a path to a file
+### arc_image_src
+Set an image from which the arc will be masked out. It's useful to display complex effects on the arcs. Can be a pointer to `lv_image_dsc_t` or a path to a file
- Default `NULL`
- Inherited No
@@ -673,7 +673,7 @@ Set the opacity of the text. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully
### text_font
-Set the font of the text (a pointer `lv_font_t *`).
+Set the font of the text (a pointer `lv_font_t *`).
- Default `LV_FONT_DEFAULT`
- Inherited Yes
diff --git a/env_support/cmsis-pack/lv_conf_cmsis.h b/env_support/cmsis-pack/lv_conf_cmsis.h
index ce8c5d7bad..be0da63afa 100644
--- a/env_support/cmsis-pack/lv_conf_cmsis.h
+++ b/env_support/cmsis-pack/lv_conf_cmsis.h
@@ -277,7 +277,7 @@
/*Maximum buffer size to allocate for rotation.
*Only used if software rotation is enabled in the display driver.*/
-#define LV_DISP_ROT_MAX_BUF (10*1024)
+#define LV_DISPLAY_ROT_MAX_BUF (10*1024)
/*Garbage Collector settings
*Used if lvgl is bound to higher level language and the memory is managed by that language*/
@@ -315,7 +315,7 @@
/*Define a custom attribute to `lv_timer_handler` function*/
#define LV_ATTRIBUTE_TIMER_HANDLER
-/*Define a custom attribute to `lv_disp_flush_ready` function*/
+/*Define a custom attribute to `lv_display_flush_ready` function*/
#define LV_ATTRIBUTE_FLUSH_READY
/*Required alignment size for buffers*/
diff --git a/examples/others/snapshot/lv_example_snapshot_1.c b/examples/others/snapshot/lv_example_snapshot_1.c
index 26767d26b9..d5843f9d4c 100644
--- a/examples/others/snapshot/lv_example_snapshot_1.c
+++ b/examples/others/snapshot/lv_example_snapshot_1.c
@@ -31,7 +31,7 @@ void lv_example_snapshot_1(void)
lv_obj_set_style_bg_color(snapshot_obj, lv_palette_main(LV_PALETTE_PURPLE), 0);
lv_obj_set_style_bg_opa(snapshot_obj, LV_OPA_100, 0);
lv_image_set_zoom(snapshot_obj, 128);
- lv_image_set_angle(snapshot_obj, 300);
+ lv_image_set_rotation(snapshot_obj, 300);
/*Create the container and its children*/
lv_obj_t * container = lv_obj_create(root);
@@ -48,7 +48,7 @@ void lv_example_snapshot_1(void)
lv_image_set_src(img, &img_star);
lv_obj_set_style_bg_color(img, lv_color_black(), 0);
lv_obj_set_style_bg_opa(img, LV_OPA_COVER, 0);
- // lv_obj_set_style_transform_zoom(img, 400, LV_STATE_PRESSED);
+ // lv_obj_set_style_transform_scale(img, 400, LV_STATE_PRESSED);
lv_obj_add_flag(img, LV_OBJ_FLAG_CLICKABLE);
lv_obj_add_event(img, event_cb, LV_EVENT_PRESSED, snapshot_obj);
lv_obj_add_event(img, event_cb, LV_EVENT_RELEASED, snapshot_obj);
diff --git a/examples/others/snapshot/lv_example_snapshot_1.py b/examples/others/snapshot/lv_example_snapshot_1.py
index 6098a67fed..23d55f2f97 100644
--- a/examples/others/snapshot/lv_example_snapshot_1.py
+++ b/examples/others/snapshot/lv_example_snapshot_1.py
@@ -44,7 +44,7 @@ root.set_style_bg_color(lv.palette_main(lv.PALETTE.LIGHT_BLUE), 0)
snapshot_obj = lv.image(root)
snapshot_obj.set_style_bg_color(lv.palette_main(lv.PALETTE.PURPLE), 0)
snapshot_obj.set_style_bg_opa(lv.OPA.COVER, 0)
-snapshot_obj.set_zoom(128)
+snapshot_obj.set_scale(128)
# Create the container and its children
container = lv.obj(root)
@@ -59,7 +59,7 @@ for i in range(4):
image.set_src(image_star)
image.set_style_bg_color(lv.palette_main(lv.PALETTE.GREY), 0)
image.set_style_bg_opa(lv.OPA.COVER, 0)
- image.set_style_transform_zoom(400, lv.STATE.PRESSED)
+ image.set_style_transform_scale(400, lv.STATE.PRESSED)
image.add_flag(image.FLAG.CLICKABLE)
image.add_event(lambda e: event_cb(e, snapshot_obj), lv.EVENT.PRESSED, None)
image.add_event(lambda e: event_cb(e, snapshot_obj), lv.EVENT.RELEASED, None)
diff --git a/examples/porting/lv_port_disp_template.c b/examples/porting/lv_port_disp_template.c
index b17313a700..dea7bf12f9 100644
--- a/examples/porting/lv_port_disp_template.c
+++ b/examples/porting/lv_port_disp_template.c
@@ -34,7 +34,7 @@
**********************/
static void disp_init(void);
-static void disp_flush(lv_disp_t * disp, const lv_area_t * area, lv_color_t * px_map);
+static void disp_flush(lv_display_t * disp, const lv_area_t * area, lv_color_t * px_map);
/**********************
* STATIC VARIABLES
@@ -58,27 +58,27 @@ void lv_port_disp_init(void)
/*------------------------------------
* Create a display and set a flush_cb
* -----------------------------------*/
- lv_disp_t * disp = lv_disp_create(MY_DISP_HOR_RES, MY_DISP_VER_RES);
- lv_disp_set_flush_cb(disp, disp_flush);
+ lv_display_t * disp = lv_display_create(MY_DISP_HOR_RES, MY_DISP_VER_RES);
+ lv_display_set_flush_cb(disp, disp_flush);
/* Example 1
* One buffer for partial rendering*/
static lv_color_t buf_1_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
- lv_disp_set_draw_buffers(disp, buf_1_1, NULL, sizeof(buf_1_1), LV_DISP_RENDER_MODE_PARTIAL);
+ lv_display_set_draw_buffers(disp, buf_1_1, NULL, sizeof(buf_1_1), LV_DISPLAY_RENDER_MODE_PARTIAL);
/* Example 2
* Two buffers for partial rendering
* In flush_cb DMA or similar hardware should be used to update the display in the background.*/
static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10];
static lv_color_t buf_2_2[MY_DISP_HOR_RES * 10];
- lv_disp_set_draw_buffers(disp, buf_2_1, buf_2_2, sizeof(buf_2_1), LV_DISP_RENDER_MODE_PARTIAL);
+ lv_display_set_draw_buffers(disp, buf_2_1, buf_2_2, sizeof(buf_2_1), LV_DISPLAY_RENDER_MODE_PARTIAL);
/* Example 3
* Two buffers screen sized buffer for double buffering.
- * Both LV_DISP_RENDER_MODE_DIRECT and LV_DISP_RENDER_MODE_FULL works, see their comments*/
+ * Both LV_DISPLAY_RENDER_MODE_DIRECT and LV_DISPLAY_RENDER_MODE_FULL works, see their comments*/
static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES];
static lv_color_t buf_3_2[MY_DISP_HOR_RES * MY_DISP_VER_RES];
- lv_disp_set_draw_buffers(disp, buf_3_1, buf_3_2, sizeof(buf_3_1), LV_DISP_RENDER_MODE_DIRECT);
+ lv_display_set_draw_buffers(disp, buf_3_1, buf_3_2, sizeof(buf_3_1), LV_DISPLAY_RENDER_MODE_DIRECT);
}
@@ -111,8 +111,8 @@ void disp_disable_update(void)
/*Flush the content of the internal buffer the specific area on the display.
*`px_map` contains the rendered image as raw pixel map and it should be copied to `area` on the display.
*You can use DMA or any hardware acceleration to do this operation in the background but
- *'lv_disp_flush_ready()' has to be called when it's finished.*/
-static void disp_flush(lv_disp_t * disp_drv, const lv_area_t * area, lv_color_t * px_map)
+ *'lv_display_flush_ready()' has to be called when it's finished.*/
+static void disp_flush(lv_display_t * disp_drv, const lv_area_t * area, lv_color_t * px_map)
{
if(disp_flush_enabled) {
/*The most simple case (but also the slowest) to put all pixels to the screen one-by-one*/
@@ -130,7 +130,7 @@ static void disp_flush(lv_disp_t * disp_drv, const lv_area_t * area, lv_color_t
/*IMPORTANT!!!
*Inform the graphics library that you are ready with the flushing*/
- lv_disp_flush_ready(disp_drv);
+ lv_display_flush_ready(disp_drv);
}
#else /*Enable this file at the top*/
diff --git a/examples/styles/lv_example_style_14.c b/examples/styles/lv_example_style_14.c
index 4e032a5dbd..d26627c16d 100644
--- a/examples/styles/lv_example_style_14.c
+++ b/examples/styles/lv_example_style_14.c
@@ -24,7 +24,7 @@ static void new_theme_init_and_set(void)
lv_style_set_border_width(&style_btn, 3);
/*Initialize the new theme from the current theme*/
- lv_theme_t * th_act = lv_disp_get_theme(NULL);
+ lv_theme_t * th_act = lv_display_get_theme(NULL);
static lv_theme_t th_new;
th_new = *th_act;
@@ -33,7 +33,7 @@ static void new_theme_init_and_set(void)
lv_theme_set_apply_cb(&th_new, new_theme_apply_cb);
/*Assign the new theme to the current display*/
- lv_disp_set_theme(NULL, &th_new);
+ lv_display_set_theme(NULL, &th_new);
}
diff --git a/examples/styles/lv_example_style_14.py b/examples/styles/lv_example_style_14.py
index fa6407ab39..93a2222b11 100644
--- a/examples/styles/lv_example_style_14.py
+++ b/examples/styles/lv_example_style_14.py
@@ -49,7 +49,7 @@ class ExampleStyle_14:
# Initialize the new theme from the current theme
self.th_new = NewTheme()
self.th_new.set_apply_cb(self.new_theme_apply_cb)
- lv.disp_get_default().set_theme(self.th_new)
+ lv.display_get_default().set_theme(self.th_new)
exampleStyle_14 = ExampleStyle_14()
diff --git a/examples/styles/lv_example_style_15.c b/examples/styles/lv_example_style_15.c
index 9e31fecf87..f2ba8638d4 100644
--- a/examples/styles/lv_example_style_15.c
+++ b/examples/styles/lv_example_style_15.c
@@ -35,8 +35,8 @@ void lv_example_style_15(void)
*The button and the label is rendered to a layer first and that layer is transformed*/
btn = lv_button_create(lv_scr_act());
lv_obj_set_size(btn, 100, 40);
- lv_obj_set_style_transform_angle(btn, 150, 0); /*15 deg*/
- lv_obj_set_style_transform_zoom(btn, 256 + 64, 0); /*1.25x*/
+ lv_obj_set_style_transform_rotation(btn, 150, 0); /*15 deg*/
+ lv_obj_set_style_transform_scale(btn, 256 + 64, 0); /*1.25x*/
lv_obj_set_style_transform_pivot_x(btn, 50, 0);
lv_obj_set_style_transform_pivot_y(btn, 20, 0);
lv_obj_set_style_opa(btn, LV_OPA_50, 0);
diff --git a/examples/styles/lv_example_style_15.py b/examples/styles/lv_example_style_15.py
index c7887e6557..59787e5082 100644
--- a/examples/styles/lv_example_style_15.py
+++ b/examples/styles/lv_example_style_15.py
@@ -26,8 +26,8 @@ label.center()
# The button and the label is rendered to a layer first and that layer is transformed
button = lv.button(lv.scr_act())
button.set_size(100, 40)
-button.set_style_transform_angle(150, 0) # 15 deg
-button.set_style_transform_zoom(256 + 64, 0) # 1.25x
+button.set_style_transform_rotation(150, 0) # 15 deg
+button.set_style_transform_scale(256 + 64, 0) # 1.25x
button.set_style_transform_pivot_x(50, 0)
button.set_style_transform_pivot_y(20, 0)
button.set_style_opa(lv.OPA._50, 0)
diff --git a/examples/styles/lv_example_style_6.c b/examples/styles/lv_example_style_6.c
index 49b355a039..26f6fa65f4 100644
--- a/examples/styles/lv_example_style_6.c
+++ b/examples/styles/lv_example_style_6.c
@@ -18,7 +18,7 @@ void lv_example_style_6(void)
lv_style_set_image_recolor(&style, lv_palette_main(LV_PALETTE_BLUE));
lv_style_set_image_recolor_opa(&style, LV_OPA_50);
- lv_style_set_transform_angle(&style, 300);
+ lv_style_set_transform_rotation(&style, 300);
/*Create an object with the new style*/
lv_obj_t * obj = lv_image_create(lv_scr_act());
diff --git a/examples/styles/lv_example_style_6.py b/examples/styles/lv_example_style_6.py
index 87aaf40ae0..8b30e6f01f 100644
--- a/examples/styles/lv_example_style_6.py
+++ b/examples/styles/lv_example_style_6.py
@@ -26,7 +26,7 @@ style.set_border_color(lv.palette_main(lv.PALETTE.BLUE))
style.set_image_recolor(lv.palette_main(lv.PALETTE.BLUE))
style.set_image_recolor_opa(lv.OPA._50)
-style.set_transform_angle(300)
+style.set_transform_rotation(300)
# Create an object with the new style
obj = lv.image(lv.scr_act())
diff --git a/examples/widgets/bar/lv_example_bar_6.c b/examples/widgets/bar/lv_example_bar_6.c
index 2a8fe4e6e1..d2374f6605 100644
--- a/examples/widgets/bar/lv_example_bar_6.c
+++ b/examples/widgets/bar/lv_example_bar_6.c
@@ -18,8 +18,8 @@ static void event_cb(lv_event_t * e)
lv_snprintf(buf, sizeof(buf), "%d", (int)lv_bar_get_value(obj));
lv_point_t txt_size;
- lv_txt_get_size(&txt_size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
- label_dsc.flag);
+ lv_text_get_size(&txt_size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
+ label_dsc.flag);
lv_area_t txt_area;
txt_area.x1 = 0;
diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c
index 52686ceaf0..dbd344e9fc 100644
--- a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c
+++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.c
@@ -48,8 +48,8 @@ static void event_cb(lv_event_t * e)
if(draw_task->type == LV_DRAW_TASK_TYPE_FILL) {
LV_IMAGE_DECLARE(img_star);
lv_image_header_t header;
- lv_res_t res = lv_image_decoder_get_info(&img_star, &header);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_image_decoder_get_info(&img_star, &header);
+ if(res != LV_RESULT_OK) return;
lv_area_t a;
a.x1 = 0;
diff --git a/examples/widgets/calendar/lv_example_calendar_1.py b/examples/widgets/calendar/lv_example_calendar_1.py
index 9720f80e41..2206a6bf93 100644
--- a/examples/widgets/calendar/lv_example_calendar_1.py
+++ b/examples/widgets/calendar/lv_example_calendar_1.py
@@ -5,7 +5,7 @@ def event_handler(e):
if code == lv.EVENT.VALUE_CHANGED:
source = e.get_current_target_obj()
date = lv.calendar_date_t()
- if source.get_pressed_date(date) == lv.RES.OK:
+ if source.get_pressed_date(date) == lv.RESULT.OK:
calendar.set_today_date(date.year, date.month, date.day)
print("Clicked date: %02d.%02d.%02d"%(date.day, date.month, date.year))
diff --git a/examples/widgets/canvas/lv_example_canvas_1.c b/examples/widgets/canvas/lv_example_canvas_1.c
index 50bf167dd9..f1bdd5476a 100644
--- a/examples/widgets/canvas/lv_example_canvas_1.c
+++ b/examples/widgets/canvas/lv_example_canvas_1.c
@@ -64,7 +64,7 @@ void lv_example_canvas_1(void)
lv_draw_image_dsc_t img_dsc;
lv_draw_image_dsc_init(&img_dsc);
- img_dsc.angle = 120;
+ img_dsc.rotation = 120;
img_dsc.src = &img;
img_dsc.pivot.x = CANVAS_WIDTH / 2;
img_dsc.pivot.y = CANVAS_HEIGHT / 2;
diff --git a/examples/widgets/canvas/lv_example_canvas_1.py b/examples/widgets/canvas/lv_example_canvas_1.py
index e68830bf79..ad145c8e24 100644
--- a/examples/widgets/canvas/lv_example_canvas_1.py
+++ b/examples/widgets/canvas/lv_example_canvas_1.py
@@ -72,7 +72,7 @@ canvas.fill_bg(lv.palette_lighten(lv.PALETTE.GREY, 3), lv.OPA.COVER)
image_dsc = lv.draw_image_dsc_t()
image_dsc.init();
-image_dsc.angle = 120;
+image_dsc.rotation = 120;
image_dsc.src = image;
image_dsc.pivot.x = _CANVAS_WIDTH // 2;
image_dsc.pivot.y = _CANVAS_HEIGHT // 2;
diff --git a/examples/widgets/chart/lv_example_chart_5.c b/examples/widgets/chart/lv_example_chart_5.c
index c6484fdd21..cf03287d03 100644
--- a/examples/widgets/chart/lv_example_chart_5.c
+++ b/examples/widgets/chart/lv_example_chart_5.c
@@ -84,13 +84,13 @@ void lv_example_chart_5(void)
lv_obj_t * slider;
slider = lv_slider_create(lv_scr_act());
- lv_slider_set_range(slider, LV_ZOOM_NONE, LV_ZOOM_NONE * 10);
+ lv_slider_set_range(slider, LV_SCALE_NONE, LV_SCALE_NONE * 10);
lv_obj_add_event(slider, slider_x_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
lv_obj_set_size(slider, 200, 10);
lv_obj_align_to(slider, chart, LV_ALIGN_OUT_BOTTOM_MID, 0, 20);
slider = lv_slider_create(lv_scr_act());
- lv_slider_set_range(slider, LV_ZOOM_NONE, LV_ZOOM_NONE * 10);
+ lv_slider_set_range(slider, LV_SCALE_NONE, LV_SCALE_NONE * 10);
lv_obj_add_event(slider, slider_y_event_cb, LV_EVENT_VALUE_CHANGED, NULL);
lv_obj_set_size(slider, 10, 150);
lv_obj_align_to(slider, chart, LV_ALIGN_OUT_RIGHT_MID, 20, 0);
diff --git a/examples/widgets/chart/lv_example_chart_5.py b/examples/widgets/chart/lv_example_chart_5.py
index 54aede821c..09fdfe5912 100644
--- a/examples/widgets/chart/lv_example_chart_5.py
+++ b/examples/widgets/chart/lv_example_chart_5.py
@@ -76,13 +76,13 @@ chart.set_point_count(pcnt)
chart.set_ext_y_array(ser, ecg_sample)
slider = lv.slider(lv.scr_act())
-slider.set_range(lv.ZOOM_NONE, lv.ZOOM_NONE * 10)
+slider.set_range(lv.SCALE_NONE, lv.SCALE_NONE * 10)
slider.add_event(slider_x_event_cb, lv.EVENT.VALUE_CHANGED, None)
slider.set_size(200,10)
slider.align_to(chart, lv.ALIGN.OUT_BOTTOM_MID, 0, 20)
slider = lv.slider(lv.scr_act())
-slider.set_range(lv.ZOOM_NONE, lv.ZOOM_NONE * 10)
+slider.set_range(lv.SCALE_NONE, lv.SCALE_NONE * 10)
slider.add_event(slider_y_event_cb, lv.EVENT.VALUE_CHANGED, None)
slider.set_size(10, 150)
slider.align_to(chart, lv.ALIGN.OUT_RIGHT_MID, 20, 0)
diff --git a/examples/widgets/dropdown/lv_example_dropdown_3.c b/examples/widgets/dropdown/lv_example_dropdown_3.c
index 3dd948708a..3d19d612b3 100644
--- a/examples/widgets/dropdown/lv_example_dropdown_3.c
+++ b/examples/widgets/dropdown/lv_example_dropdown_3.c
@@ -32,7 +32,7 @@ void lv_example_dropdown_3(void)
/*Use a custom image as down icon and flip it when the list is opened*/
LV_IMAGE_DECLARE(img_caret_down)
lv_dropdown_set_symbol(dropdown, &img_caret_down);
- lv_obj_set_style_transform_angle(dropdown, 1800, LV_PART_INDICATOR | LV_STATE_CHECKED);
+ lv_obj_set_style_transform_rotation(dropdown, 1800, LV_PART_INDICATOR | LV_STATE_CHECKED);
/*In a menu we don't need to show the last clicked item*/
lv_dropdown_set_selected_highlight(dropdown, false);
diff --git a/examples/widgets/dropdown/lv_example_dropdown_3.py b/examples/widgets/dropdown/lv_example_dropdown_3.py
index 279dd364eb..90ef156307 100644
--- a/examples/widgets/dropdown/lv_example_dropdown_3.py
+++ b/examples/widgets/dropdown/lv_example_dropdown_3.py
@@ -37,7 +37,7 @@ dropdown.set_text("Menu")
# Use a custom image as down icon and flip it when the list is opened
# LV_IMAGE_DECLARE(image_caret_down)
dropdown.set_symbol(image_caret_down_argb)
-dropdown.set_style_transform_angle(1800, lv.PART.INDICATOR | lv.STATE.CHECKED)
+dropdown.set_style_transform_rotation(1800, lv.PART.INDICATOR | lv.STATE.CHECKED)
# In a menu we don't need to show the last clicked item
dropdown.set_selected_highlight(False)
diff --git a/examples/widgets/img/lv_example_img_3.c b/examples/widgets/img/lv_example_img_3.c
index c24d19e2a0..ba2a0181e1 100644
--- a/examples/widgets/img/lv_example_img_3.c
+++ b/examples/widgets/img/lv_example_img_3.c
@@ -3,7 +3,7 @@
static void set_angle(void * img, int32_t v)
{
- lv_image_set_angle(img, v);
+ lv_image_set_rotation(img, v);
}
static void set_zoom(void * img, int32_t v)
diff --git a/examples/widgets/menu/lv_example_menu_1.c b/examples/widgets/menu/lv_example_menu_1.c
index db8d340557..f963d6d5bd 100644
--- a/examples/widgets/menu/lv_example_menu_1.c
+++ b/examples/widgets/menu/lv_example_menu_1.c
@@ -5,7 +5,7 @@ void lv_example_menu_1(void)
{
/*Create a menu object*/
lv_obj_t * menu = lv_menu_create(lv_scr_act());
- lv_obj_set_size(menu, lv_disp_get_hor_res(NULL), lv_disp_get_ver_res(NULL));
+ lv_obj_set_size(menu, lv_display_get_horizontal_resolution(NULL), lv_display_get_vertical_resolution(NULL));
lv_obj_center(menu);
lv_obj_t * cont;
diff --git a/examples/widgets/menu/lv_example_menu_2.c b/examples/widgets/menu/lv_example_menu_2.c
index 0acefc2a35..373646b41c 100644
--- a/examples/widgets/menu/lv_example_menu_2.c
+++ b/examples/widgets/menu/lv_example_menu_2.c
@@ -17,7 +17,7 @@ void lv_example_menu_2(void)
lv_obj_t * menu = lv_menu_create(lv_scr_act());
lv_menu_set_mode_root_back_button(menu, LV_MENU_ROOT_BACK_BUTTON_ENABLED);
lv_obj_add_event(menu, back_event_handler, LV_EVENT_CLICKED, menu);
- lv_obj_set_size(menu, lv_disp_get_hor_res(NULL), lv_disp_get_ver_res(NULL));
+ lv_obj_set_size(menu, lv_display_get_horizontal_resolution(NULL), lv_display_get_vertical_resolution(NULL));
lv_obj_center(menu);
lv_obj_t * cont;
diff --git a/examples/widgets/menu/lv_example_menu_3.c b/examples/widgets/menu/lv_example_menu_3.c
index deba698b69..fd33057a18 100644
--- a/examples/widgets/menu/lv_example_menu_3.c
+++ b/examples/widgets/menu/lv_example_menu_3.c
@@ -5,7 +5,7 @@ void lv_example_menu_3(void)
{
/*Create a menu object*/
lv_obj_t * menu = lv_menu_create(lv_scr_act());
- lv_obj_set_size(menu, lv_disp_get_hor_res(NULL), lv_disp_get_ver_res(NULL));
+ lv_obj_set_size(menu, lv_display_get_horizontal_resolution(NULL), lv_display_get_vertical_resolution(NULL));
lv_obj_center(menu);
/*Modify the header*/
diff --git a/examples/widgets/menu/lv_example_menu_4.c b/examples/widgets/menu/lv_example_menu_4.c
index e5db82e341..3e546dec2c 100644
--- a/examples/widgets/menu/lv_example_menu_4.c
+++ b/examples/widgets/menu/lv_example_menu_4.c
@@ -32,7 +32,7 @@ void lv_example_menu_4(void)
{
/*Create a menu object*/
menu = lv_menu_create(lv_scr_act());
- lv_obj_set_size(menu, lv_disp_get_hor_res(NULL), lv_disp_get_ver_res(NULL));
+ lv_obj_set_size(menu, lv_display_get_horizontal_resolution(NULL), lv_display_get_vertical_resolution(NULL));
lv_obj_center(menu);
lv_obj_t * cont;
diff --git a/examples/widgets/menu/lv_example_menu_5.c b/examples/widgets/menu/lv_example_menu_5.c
index 7f54bfd1ef..722dbf8d5f 100644
--- a/examples/widgets/menu/lv_example_menu_5.c
+++ b/examples/widgets/menu/lv_example_menu_5.c
@@ -30,7 +30,7 @@ void lv_example_menu_5(void)
}
lv_menu_set_mode_root_back_button(menu, LV_MENU_ROOT_BACK_BUTTON_ENABLED);
lv_obj_add_event(menu, back_event_handler, LV_EVENT_CLICKED, menu);
- lv_obj_set_size(menu, lv_disp_get_hor_res(NULL), lv_disp_get_ver_res(NULL));
+ lv_obj_set_size(menu, lv_display_get_horizontal_resolution(NULL), lv_display_get_vertical_resolution(NULL));
lv_obj_center(menu);
lv_obj_t * cont;
diff --git a/examples/widgets/scale/lv_example_scale_5.c b/examples/widgets/scale/lv_example_scale_5.c
index 85015ff91b..41516ae1b5 100644
--- a/examples/widgets/scale/lv_example_scale_5.c
+++ b/examples/widgets/scale/lv_example_scale_5.c
@@ -7,7 +7,7 @@
void lv_example_scale_5(void)
{
lv_obj_t * scale = lv_scale_create(lv_scr_act());
- lv_obj_set_size(scale, lv_disp_get_hor_res(NULL) / 2, lv_disp_get_ver_res(NULL) / 2);
+ lv_obj_set_size(scale, lv_display_get_horizontal_resolution(NULL) / 2, lv_display_get_vertical_resolution(NULL) / 2);
lv_scale_set_label_show(scale, true);
lv_scale_set_total_tick_count(scale, 10);
diff --git a/examples/widgets/slider/lv_example_slider_3.c b/examples/widgets/slider/lv_example_slider_3.c
index 7e10099fc9..adfa0fb129 100644
--- a/examples/widgets/slider/lv_example_slider_3.c
+++ b/examples/widgets/slider/lv_example_slider_3.c
@@ -40,7 +40,7 @@ static void slider_event_cb(lv_event_t * e)
lv_snprintf(buf, sizeof(buf), "%d - %d", (int)lv_slider_get_left_value(obj), (int)lv_slider_get_value(obj));
lv_point_t label_size;
- lv_txt_get_size(&label_size, buf, LV_FONT_DEFAULT, 0, 0, LV_COORD_MAX, 0);
+ lv_text_get_size(&label_size, buf, LV_FONT_DEFAULT, 0, 0, LV_COORD_MAX, 0);
lv_area_t label_area;
label_area.x1 = 0;
label_area.x2 = label_size.x - 1;
diff --git a/examples/widgets/slider/lv_example_slider_3.py b/examples/widgets/slider/lv_example_slider_3.py
index d8cbd21604..3b59f91960 100644
--- a/examples/widgets/slider/lv_example_slider_3.py
+++ b/examples/widgets/slider/lv_example_slider_3.py
@@ -12,7 +12,7 @@ def slider_event_cb(e):
if base_dsc.part == lv.PART.INDICATOR:
label_text = "{:d} - {:d}".format(obj.get_left_value(),slider.get_value())
label_size = lv.point_t()
- lv.txt_get_size(label_size, label_text, lv.font_default(), 0, 0, lv.COORD.MAX, 0)
+ lv.text_get_size(label_size, label_text, lv.font_default(), 0, 0, lv.COORD.MAX, 0)
# print(label_size.x,label_size.y)
label_area = lv.area_t()
label_area.x1 = dsc.area.x1 + dsc.area.get_width() // 2 - label_size.x // 2
diff --git a/lv_conf_template.h b/lv_conf_template.h
index 6207c396dc..2b4f97f484 100644
--- a/lv_conf_template.h
+++ b/lv_conf_template.h
@@ -239,7 +239,7 @@
/*Maximum buffer size to allocate for rotation.
*Only used if software rotation is enabled in the display driver.*/
-#define LV_DISP_ROT_MAX_BUF (10*1024)
+#define LV_DISPLAY_ROT_MAX_BUF (10*1024)
#define LV_ENABLE_GLOBAL_CUSTOM 0
#if LV_ENABLE_GLOBAL_CUSTOM
@@ -278,7 +278,7 @@
/*Define a custom attribute to `lv_timer_handler` function*/
#define LV_ATTRIBUTE_TIMER_HANDLER
-/*Define a custom attribute to `lv_disp_flush_ready` function*/
+/*Define a custom attribute to `lv_display_flush_ready` function*/
#define LV_ATTRIBUTE_FLUSH_READY
/*Required alignment size for buffers*/
@@ -721,7 +721,7 @@
#define LV_USE_SDL 0
#if LV_USE_SDL
#define LV_SDL_INCLUDE_PATH
- #define LV_SDL_RENDER_MODE LV_DISP_RENDER_MODE_DIRECT /*LV_DISP_RENDER_MODE_DIRECT is recommended for best performance*/
+ #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/
#define LV_SDL_BUF_COUNT 1 /*1 or 2*/
#define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/
#define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL widows are closed*/
@@ -732,7 +732,7 @@
#if LV_USE_LINUX_FBDEV
#define LV_LINUX_FBDEV_BSD 0
#define LV_LINUX_FBDEV_NUTTX 0
- #define LV_LINUX_FBDEV_RENDER_MODE LV_DISP_RENDER_MODE_PARTIAL
+ #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
#define LV_LINUX_FBDEV_BUFFER_COUNT 0
#define LV_LINUX_FBDEV_BUFFER_SIZE 60
#endif
diff --git a/lvgl.h b/lvgl.h
index 93dff49426..00128d19b9 100644
--- a/lvgl.h
+++ b/lvgl.h
@@ -40,7 +40,7 @@ extern "C" {
#include "src/core/lv_group.h"
#include "src/indev/lv_indev.h"
#include "src/core/lv_refr.h"
-#include "src/disp/lv_disp.h"
+#include "src/display/lv_display.h"
#include "src/font/lv_font.h"
#include "src/font/lv_font_loader.h"
@@ -114,9 +114,9 @@ extern "C" {
#include "src/dev/sdl/lv_sdl_mousewheel.h"
#include "src/dev/sdl/lv_sdl_keyboard.h"
-#include "src/dev/disp/drm/lv_linux_drm.h"
-#include "src/dev/disp/fb/lv_linux_fbdev.h"
-#include "src/dev/disp/lcd/lv_nuttx_lcd.h"
+#include "src/dev/display/drm/lv_linux_drm.h"
+#include "src/dev/display/fb/lv_linux_fbdev.h"
+#include "src/dev/display/lcd/lv_nuttx_lcd.h"
#include "src/dev/input/touchscreen/lv_nuttx_touchscreen.h"
diff --git a/scripts/style_api_gen.py b/scripts/style_api_gen.py
index ff309d374c..ea689a55d7 100755
--- a/scripts/style_api_gen.py
+++ b/scripts/style_api_gen.py
@@ -58,11 +58,11 @@ props = [
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Move the object with this value in Y direction. Applied after layouts, aligns and other positioning. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's height." },
-{'name': 'TRANSFORM_ZOOM',
+{'name': 'TRANSFORM_SCALE',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
- 'dsc': "Zoom an objects. The value 256 (or `LV_ZOOM_NONE`) means normal size, 128 half size, 512 double size, and so on" },
+ 'dsc': "Zoom an objects. The value 256 (or `LV_SCALE_NONE`) means normal size, 128 half size, 512 double size, and so on" },
-{'name': 'TRANSFORM_ANGLE',
+{'name': 'TRANSFORM_ROTATION',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'dsc': "Rotate an objects. The value is interpreted in 0.1 degree units. E.g. 450 means 45 deg."},
@@ -149,23 +149,23 @@ props = [
'style_type': 'num', 'var_type': 'lv_dither_mode_t', 'default':'`LV_DITHER_NONE`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the dithering mode of the gradient of the background. The possible values are `LV_DITHER_NONE/ORDERED/ERR_DIFF`."},
-{'name': 'BG_IMG_SRC',
+{'name': 'BG_IMAGE_SRC',
'style_type': 'ptr', 'var_type': 'const void *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set a background image. Can be a pointer to `lv_image_dsc_t`, a path to a file or an `LV_SYMBOL_...`"},
-{'name': 'BG_IMG_OPA',
+{'name': 'BG_IMAGE_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the background image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
-{'name': 'BG_IMG_RECOLOR',
+{'name': 'BG_IMAGE_RECOLOR',
'style_type': 'color', 'var_type': 'lv_color_t', 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set a color to mix to the background image."},
-{'name': 'BG_IMG_RECOLOR_OPA',
+{'name': 'BG_IMAGE_RECOLOR_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t', 'default':'`LV_OPA_TRANSP`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the intensity of background image recoloring. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means no mixing, 255, `LV_OPA_100` or `LV_OPA_COVER` means full recoloring, other values or LV_OPA_10, LV_OPA_20, etc are interpreted proportionally."},
-{'name': 'BG_IMG_TILED',
+{'name': 'BG_IMAGE_TILED',
'style_type': 'num', 'var_type': 'bool', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "If enabled the background image will be tiled. The possible values are `true` or `false`."},
@@ -233,15 +233,15 @@ props = [
'dsc': "Set the opacity of the shadow. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
{'section': 'Image', 'dsc':'Properties to describe the images' },
-{'name': 'IMG_OPA',
+{'name': 'IMAGE_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of an image. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
-{'name': 'IMG_RECOLOR',
+{'name': 'IMAGE_RECOLOR',
'style_type': 'color', 'var_type': 'lv_color_t', 'default':'`0x000000`', 'inherited': 0, 'layout': 0, 'ext_draw': 0, 'filtered': 1,
'dsc': "Set color to mixt to the image."},
-{'name': 'IMG_RECOLOR_OPA',
+{'name': 'IMAGE_RECOLOR_OPA',
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the intensity of the color mixing. Value 0, `LV_OPA_0` or `LV_OPA_TRANSP` means fully transparent, 255, `LV_OPA_100` or `LV_OPA_COVER` means fully covering, other values or LV_OPA_10, LV_OPA_20, etc means semi transparency."},
@@ -287,7 +287,7 @@ props = [
'style_type': 'num', 'var_type': 'lv_opa_t' , 'default':'`LV_OPA_COVER`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the opacity of the arcs."},
-{'name': 'ARC_IMG_SRC',
+{'name': 'ARC_IMAGE_SRC',
'style_type': 'ptr', 'var_type': 'const void *', 'default':'`NULL`', 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set an image from which the arc will be masked out. It's useful to display complex effects on the arcs. Can be a pointer to `lv_image_dsc_t` or a path to a file"},
diff --git a/src/core/lv_global.h b/src/core/lv_global.h
index c853b4b151..c32c96af14 100644
--- a/src/core/lv_global.h
+++ b/src/core/lv_global.h
@@ -49,7 +49,7 @@ extern "C" {
* TYPEDEFS
**********************/
-struct _lv_disp_t;
+struct _lv_display_t;
struct _lv_group_t;
struct _my_theme_t;
struct _lv_indev_t;
@@ -68,8 +68,8 @@ typedef struct _lv_global_t {
bool inited;
lv_ll_t disp_ll;
- struct _lv_disp_t * disp_refresh;
- struct _lv_disp_t * disp_default;
+ struct _lv_display_t * disp_refresh;
+ struct _lv_display_t * disp_default;
lv_ll_t style_trans_ll;
bool style_refresh;
diff --git a/src/core/lv_group.c b/src/core/lv_group.c
index 944ee5f7f3..fd6914030a 100644
--- a/src/core/lv_group.c
+++ b/src/core/lv_group.c
@@ -246,8 +246,8 @@ void lv_group_focus_obj(lv_obj_t * obj)
_LV_LL_READ(&g->obj_ll, i) {
if(*i == obj) {
if(g->obj_focus != NULL && obj != *g->obj_focus) { /*Do not defocus if the same object needs to be focused again*/
- lv_res_t res = lv_obj_send_event(*g->obj_focus, LV_EVENT_DEFOCUSED, get_indev(g));
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_send_event(*g->obj_focus, LV_EVENT_DEFOCUSED, get_indev(g));
+ if(res != LV_RESULT_OK) return;
lv_obj_invalidate(*g->obj_focus);
}
@@ -255,8 +255,8 @@ void lv_group_focus_obj(lv_obj_t * obj)
if(g->obj_focus != NULL) {
if(g->focus_cb) g->focus_cb(g);
- lv_res_t res = lv_obj_send_event(*g->obj_focus, LV_EVENT_FOCUSED, get_indev(g));
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_send_event(*g->obj_focus, LV_EVENT_FOCUSED, get_indev(g));
+ if(res != LV_RESULT_OK) return;
lv_obj_invalidate(*g->obj_focus);
}
break;
@@ -288,12 +288,12 @@ void lv_group_focus_freeze(lv_group_t * group, bool en)
else group->frozen = 1;
}
-lv_res_t lv_group_send_data(lv_group_t * group, uint32_t c)
+lv_result_t lv_group_send_data(lv_group_t * group, uint32_t c)
{
lv_obj_t * act = lv_group_get_focused(group);
- if(act == NULL) return LV_RES_OK;
+ if(act == NULL) return LV_RESULT_OK;
- if(lv_obj_has_state(act, LV_STATE_DISABLED)) return LV_RES_OK;
+ if(lv_obj_has_state(act, LV_STATE_DISABLED)) return LV_RESULT_OK;
return lv_obj_send_event(act, LV_EVENT_KEY, &c);
}
@@ -319,8 +319,8 @@ void lv_group_set_editing(lv_group_t * group, bool edit)
lv_obj_t * focused = lv_group_get_focused(group);
if(focused) {
- lv_res_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group));
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group));
+ if(res != LV_RESULT_OK) return;
lv_obj_invalidate(focused);
}
@@ -449,15 +449,15 @@ static bool focus_next_core(lv_group_t * group, void * (*begin)(const lv_ll_t *)
if(obj_next == group->obj_focus) return focus_changed; /*There's only one visible object and it's already focused*/
if(group->obj_focus) {
- lv_res_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group));
- if(res != LV_RES_OK) return focus_changed;
+ lv_result_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_DEFOCUSED, get_indev(group));
+ if(res != LV_RESULT_OK) return focus_changed;
lv_obj_invalidate(*group->obj_focus);
}
group->obj_focus = obj_next;
- lv_res_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group));
- if(res != LV_RES_OK) return focus_changed;
+ lv_result_t res = lv_obj_send_event(*group->obj_focus, LV_EVENT_FOCUSED, get_indev(group));
+ if(res != LV_RESULT_OK) return focus_changed;
lv_obj_invalidate(*group->obj_focus);
diff --git a/src/core/lv_group.h b/src/core/lv_group.h
index 65bcead312..bf4007c893 100644
--- a/src/core/lv_group.h
+++ b/src/core/lv_group.h
@@ -178,7 +178,7 @@ void lv_group_focus_freeze(lv_group_t * group, bool en);
* @param c a character (use LV_KEY_.. to navigate)
* @return result of focused object in group.
*/
-lv_res_t lv_group_send_data(lv_group_t * group, uint32_t c);
+lv_result_t lv_group_send_data(lv_group_t * group, uint32_t c);
/**
* Set a function for a group which will be called when a new object is focused
diff --git a/src/core/lv_obj.c b/src/core/lv_obj.c
index b5076ccaf8..b6d1a2f10e 100644
--- a/src/core/lv_obj.c
+++ b/src/core/lv_obj.c
@@ -11,8 +11,8 @@
#include "../indev/lv_indev_private.h"
#include "lv_refr.h"
#include "lv_group.h"
-#include "../disp/lv_disp.h"
-#include "../disp/lv_disp_private.h"
+#include "../display/lv_display.h"
+#include "../display/lv_display_private.h"
#include "../themes/lv_theme.h"
#include "../misc/lv_assert.h"
#include "../misc/lv_math.h"
@@ -42,7 +42,7 @@ static void lv_obj_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj);
static void lv_obj_draw(lv_event_t * e);
static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e);
static void draw_scrollbar(lv_obj_t * obj, lv_layer_t * layer);
-static lv_res_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc);
+static lv_result_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc);
static bool obj_valid_child(const lv_obj_t * parent, const lv_obj_t * obj_to_find);
static void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state);
@@ -259,7 +259,7 @@ const lv_obj_class_t * lv_obj_get_class(const lv_obj_t * obj)
bool lv_obj_is_valid(const lv_obj_t * obj)
{
- lv_disp_t * disp = lv_disp_get_next(NULL);
+ lv_display_t * disp = lv_display_get_next(NULL);
while(disp) {
uint32_t i;
for(i = 0; i < disp->screen_cnt; i++) {
@@ -268,7 +268,7 @@ bool lv_obj_is_valid(const lv_obj_t * obj)
if(found) return true;
}
- disp = lv_disp_get_next(disp);
+ disp = lv_display_get_next(disp);
}
return false;
@@ -435,8 +435,8 @@ static void draw_scrollbar(lv_obj_t * obj, lv_layer_t * layer)
if(lv_area_get_size(&hor_area) <= 0 && lv_area_get_size(&ver_area) <= 0) return;
lv_draw_rect_dsc_t draw_dsc;
- lv_res_t sb_res = scrollbar_init_draw_dsc(obj, &draw_dsc);
- if(sb_res != LV_RES_OK) return;
+ lv_result_t sb_res = scrollbar_init_draw_dsc(obj, &draw_dsc);
+ if(sb_res != LV_RESULT_OK) return;
if(lv_area_get_size(&hor_area) > 0) {
draw_dsc.base.id1 = 0;
@@ -452,9 +452,9 @@ static void draw_scrollbar(lv_obj_t * obj, lv_layer_t * layer)
* Initialize the draw descriptor for the scrollbar
* @param obj pointer to an object
* @param dsc the draw descriptor to initialize
- * @return LV_RES_OK: the scrollbar is visible; LV_RES_INV: the scrollbar is not visible
+ * @return LV_RESULT_OK: the scrollbar is visible; LV_RESULT_INVALID: the scrollbar is not visible
*/
-static lv_res_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc)
+static lv_result_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc)
{
lv_draw_rect_dsc_init(dsc);
dsc->bg_opa = lv_obj_get_style_bg_opa(obj, LV_PART_SCROLLBAR);
@@ -495,10 +495,10 @@ static lv_res_t scrollbar_init_draw_dsc(lv_obj_t * obj, lv_draw_rect_dsc_t * dsc
if(dsc->bg_opa != LV_OPA_TRANSP || dsc->border_opa != LV_OPA_TRANSP || dsc->shadow_opa != LV_OPA_TRANSP) {
dsc->radius = lv_obj_get_style_radius(obj, LV_PART_SCROLLBAR);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
else {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
}
@@ -519,8 +519,8 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e)
if(!(lv_obj_get_state(obj) & LV_STATE_CHECKED)) lv_obj_add_state(obj, LV_STATE_CHECKED);
else lv_obj_clear_state(obj, LV_STATE_CHECKED);
- lv_res_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
+ if(res != LV_RESULT_OK) return;
}
}
else if(code == LV_EVENT_PRESS_LOST) {
@@ -545,8 +545,8 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e)
/*With Enter LV_EVENT_RELEASED will send VALUE_CHANGE event*/
if(c != LV_KEY_ENTER) {
- lv_res_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
+ if(res != LV_RESULT_OK) return;
}
}
else if(lv_obj_has_flag(obj, LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_WITH_ARROW) && !lv_obj_is_editable(obj)) {
diff --git a/src/core/lv_obj_class.c b/src/core/lv_obj_class.c
index ac67735985..1c852b8e55 100644
--- a/src/core/lv_obj_class.c
+++ b/src/core/lv_obj_class.c
@@ -8,8 +8,8 @@
*********************/
#include "lv_obj.h"
#include "../themes/lv_theme.h"
-#include "../disp/lv_disp.h"
-#include "../disp/lv_disp_private.h"
+#include "../display/lv_display.h"
+#include "../display/lv_display_private.h"
#include "../stdlib/lv_string.h"
/*********************
@@ -56,7 +56,7 @@ lv_obj_t * lv_obj_class_create_obj(const lv_obj_class_t * class_p, lv_obj_t * pa
/*Create a screen*/
if(parent == NULL) {
LV_TRACE_OBJ_CREATE("creating a screen");
- lv_disp_t * disp = lv_disp_get_default();
+ lv_display_t * disp = lv_display_get_default();
if(!disp) {
LV_LOG_WARN("No display created yet. No place to assign the new screen");
lv_free(obj);
@@ -74,8 +74,8 @@ lv_obj_t * lv_obj_class_create_obj(const lv_obj_class_t * class_p, lv_obj_t * pa
/*Set coordinates to full screen size*/
obj->coords.x1 = 0;
obj->coords.y1 = 0;
- obj->coords.x2 = lv_disp_get_hor_res(NULL) - 1;
- obj->coords.y2 = lv_disp_get_ver_res(NULL) - 1;
+ obj->coords.x2 = lv_display_get_horizontal_resolution(NULL) - 1;
+ obj->coords.y2 = lv_display_get_vertical_resolution(NULL) - 1;
}
/*Create a normal object*/
else {
diff --git a/src/core/lv_obj_draw.c b/src/core/lv_obj_draw.c
index c391f62043..2acb735c6d 100644
--- a/src/core/lv_obj_draw.c
+++ b/src/core/lv_obj_draw.c
@@ -8,7 +8,7 @@
*********************/
#include "lv_obj_draw.h"
#include "lv_obj.h"
-#include "../disp/lv_disp.h"
+#include "../display/lv_display.h"
#include "../indev/lv_indev.h"
#include "../stdlib/lv_string.h"
@@ -186,8 +186,8 @@ void lv_obj_init_draw_image_dsc(lv_obj_t * obj, uint32_t part, lv_draw_image_dsc
}
if(draw_dsc->opa <= LV_OPA_MIN) return;
- draw_dsc->angle = 0;
- draw_dsc->zoom = LV_ZOOM_NONE;
+ draw_dsc->rotation = 0;
+ draw_dsc->zoom = LV_SCALE_NONE;
draw_dsc->pivot.x = lv_area_get_width(&obj->coords) / 2;
draw_dsc->pivot.y = lv_area_get_height(&obj->coords) / 2;
diff --git a/src/core/lv_obj_event.c b/src/core/lv_obj_event.c
index dfb3edd6b8..8746b1d613 100644
--- a/src/core/lv_obj_event.c
+++ b/src/core/lv_obj_event.c
@@ -22,7 +22,7 @@
/**********************
* STATIC PROTOTYPES
**********************/
-static lv_res_t event_send_core(lv_event_t * e);
+static lv_result_t event_send_core(lv_event_t * e);
static bool event_is_bubbled(lv_event_t * e);
/**********************
@@ -42,9 +42,9 @@ static bool event_is_bubbled(lv_event_t * e);
* GLOBAL FUNCTIONS
**********************/
-lv_res_t lv_obj_send_event(lv_obj_t * obj, lv_event_code_t event_code, void * param)
+lv_result_t lv_obj_send_event(lv_obj_t * obj, lv_event_code_t event_code, void * param)
{
- if(obj == NULL) return LV_RES_OK;
+ if(obj == NULL) return LV_RESULT_OK;
LV_ASSERT_OBJ(obj, MY_CLASS);
@@ -61,7 +61,7 @@ lv_res_t lv_obj_send_event(lv_obj_t * obj, lv_event_code_t event_code, void * pa
_lv_event_push(&e);
/*Send the event*/
- lv_res_t res = event_send_core(&e);
+ lv_result_t res = event_send_core(&e);
/*Remove this element from the list*/
_lv_event_pop(&e);
@@ -70,7 +70,7 @@ lv_res_t lv_obj_send_event(lv_obj_t * obj, lv_event_code_t event_code, void * pa
}
-lv_res_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e)
+lv_result_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e)
{
const lv_obj_class_t * base;
if(class_p == NULL) base = ((lv_obj_t *)e->current_target)->class_p;
@@ -79,16 +79,16 @@ lv_res_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e)
/*Find a base in which call the ancestor's event handler_cb if set*/
while(base && base->event_cb == NULL) base = base->base_class;
- if(base == NULL) return LV_RES_OK;
- if(base->event_cb == NULL) return LV_RES_OK;
+ if(base == NULL) return LV_RESULT_OK;
+ if(base->event_cb == NULL) return LV_RESULT_OK;
/*Call the actual event callback*/
e->user_data = NULL;
base->event_cb(base, e);
- lv_res_t res = LV_RES_OK;
+ lv_result_t res = LV_RESULT_OK;
/*Stop if the object is deleted*/
- if(e->deleted) res = LV_RES_INV;
+ if(e->deleted) res = LV_RESULT_INVALID;
return res;
}
@@ -285,7 +285,7 @@ lv_draw_task_t * lv_event_get_draw_task(lv_event_t * e)
* STATIC FUNCTIONS
**********************/
-static lv_res_t event_send_core(lv_event_t * e)
+static lv_result_t event_send_core(lv_event_t * e)
{
EVENT_TRACE("Sending event %d to %p with %p param", e->code, (void *)e->original_target, e->param);
@@ -293,28 +293,28 @@ static lv_res_t event_send_core(lv_event_t * e)
lv_indev_t * indev_act = lv_indev_get_act();
if(indev_act) {
if(indev_act->feedback_cb) indev_act->feedback_cb(indev_act, e);
- if(e->stop_processing) return LV_RES_OK;
- if(e->deleted) return LV_RES_INV;
+ if(e->stop_processing) return LV_RESULT_OK;
+ if(e->deleted) return LV_RESULT_INVALID;
}
lv_obj_t * target = e->current_target;
- lv_res_t res = LV_RES_OK;
+ lv_result_t res = LV_RESULT_OK;
lv_event_list_t * list = target->spec_attr ? &target->spec_attr->event_list : NULL;
res = lv_event_send(list, e, true);
- if(res != LV_RES_OK) return res;
+ if(res != LV_RESULT_OK) return res;
res = lv_obj_event_base(NULL, e);
- if(res != LV_RES_OK) return res;
+ if(res != LV_RESULT_OK) return res;
res = lv_event_send(list, e, false);
- if(res != LV_RES_OK) return res;
+ if(res != LV_RESULT_OK) return res;
lv_obj_t * parent = lv_obj_get_parent(e->current_target);
if(parent && event_is_bubbled(e)) {
e->current_target = parent;
res = event_send_core(e);
- if(res != LV_RES_OK) return res;
+ if(res != LV_RESULT_OK) return res;
}
return res;
diff --git a/src/core/lv_obj_event.h b/src/core/lv_obj_event.h
index e4b40cfe5a..dc2cc5a846 100644
--- a/src/core/lv_obj_event.h
+++ b/src/core/lv_obj_event.h
@@ -67,17 +67,17 @@ typedef struct {
* @param obj pointer to an object
* @param event_code the type of the event from `lv_event_t`
* @param param arbitrary data depending on the widget type and the event. (Usually `NULL`)
- * @return LV_RES_OK: `obj` was not deleted in the event; LV_RES_INV: `obj` was deleted in the event_code
+ * @return LV_RESULT_OK: `obj` was not deleted in the event; LV_RESULT_INVALID: `obj` was deleted in the event_code
*/
-lv_res_t lv_obj_send_event(struct _lv_obj_t * obj, lv_event_code_t event_code, void * param);
+lv_result_t lv_obj_send_event(struct _lv_obj_t * obj, lv_event_code_t event_code, void * param);
/**
* Used by the widgets internally to call the ancestor widget types's event handler
* @param class_p pointer to the class of the widget (NOT the ancestor class)
* @param e pointer to the event descriptor
- * @return LV_RES_OK: the target object was not deleted in the event; LV_RES_INV: it was deleted in the event_code
+ * @return LV_RESULT_OK: the target object was not deleted in the event; LV_RESULT_INVALID: it was deleted in the event_code
*/
-lv_res_t lv_obj_event_base(const struct _lv_obj_class_t * class_p, lv_event_t * e);
+lv_result_t lv_obj_event_base(const struct _lv_obj_class_t * class_p, lv_event_t * e);
/**
* Get the current target of the event. It's the object which event handler being called.
diff --git a/src/core/lv_obj_pos.c b/src/core/lv_obj_pos.c
index 0ac4212b44..9115a374b8 100644
--- a/src/core/lv_obj_pos.c
+++ b/src/core/lv_obj_pos.c
@@ -7,8 +7,8 @@
* INCLUDES
*********************/
#include "lv_obj.h"
-#include "../disp/lv_disp.h"
-#include "../disp/lv_disp_private.h"
+#include "../display/lv_display.h"
+#include "../display/lv_display_private.h"
#include "lv_refr.h"
#include "../core/lv_global.h"
@@ -54,12 +54,12 @@ void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
- lv_res_t res_x;
+ lv_result_t res_x;
lv_style_value_t v_x;
res_x = lv_obj_get_local_style_prop(obj, LV_STYLE_X, &v_x, 0);
- if((res_x == LV_RES_OK && v_x.num != x) || res_x == LV_RES_INV) {
+ if((res_x == LV_RESULT_OK && v_x.num != x) || res_x == LV_RESULT_INVALID) {
lv_obj_set_style_x(obj, x, 0);
}
}
@@ -68,12 +68,12 @@ void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
- lv_res_t res_y;
+ lv_result_t res_y;
lv_style_value_t v_y;
res_y = lv_obj_get_local_style_prop(obj, LV_STYLE_Y, &v_y, 0);
- if((res_y == LV_RES_OK && v_y.num != y) || res_y == LV_RES_INV) {
+ if((res_y == LV_RESULT_OK && v_y.num != y) || res_y == LV_RESULT_INVALID) {
lv_obj_set_style_y(obj, y, 0);
}
}
@@ -215,12 +215,12 @@ void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h)
void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
- lv_res_t res_w;
+ lv_result_t res_w;
lv_style_value_t v_w;
res_w = lv_obj_get_local_style_prop(obj, LV_STYLE_WIDTH, &v_w, 0);
- if((res_w == LV_RES_OK && v_w.num != w) || res_w == LV_RES_INV) {
+ if((res_w == LV_RESULT_OK && v_w.num != w) || res_w == LV_RESULT_INVALID) {
lv_obj_set_style_width(obj, w, 0);
}
}
@@ -228,12 +228,12 @@ void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w)
void lv_obj_set_height(lv_obj_t * obj, lv_coord_t h)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
- lv_res_t res_h;
+ lv_result_t res_h;
lv_style_value_t v_h;
res_h = lv_obj_get_local_style_prop(obj, LV_STYLE_HEIGHT, &v_h, 0);
- if((res_h == LV_RES_OK && v_h.num != h) || res_h == LV_RES_INV) {
+ if((res_h == LV_RESULT_OK && v_h.num != h) || res_h == LV_RESULT_INVALID) {
lv_obj_set_style_height(obj, h, 0);
}
}
@@ -282,8 +282,8 @@ void lv_obj_mark_layout_as_dirty(lv_obj_t * obj)
scr->scr_layout_inv = 1;
/*Make the display refreshing*/
- lv_disp_t * disp = lv_obj_get_disp(scr);
- lv_disp_send_event(disp, LV_EVENT_REFR_REQUEST, NULL);
+ lv_display_t * disp = lv_obj_get_disp(scr);
+ lv_display_send_event(disp, LV_EVENT_REFR_REQUEST, NULL);
}
void lv_obj_update_layout(const lv_obj_t * obj)
@@ -802,8 +802,8 @@ void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
- lv_disp_t * disp = lv_obj_get_disp(obj);
- if(!lv_disp_is_invalidation_enabled(disp)) return;
+ lv_display_t * disp = lv_obj_get_disp(obj);
+ if(!lv_display_is_invalidation_enabled(disp)) return;
lv_area_t area_tmp;
lv_area_copy(&area_tmp, area);
@@ -834,12 +834,12 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
/*Invalidate the object only if it belongs to the current or previous or one of the layers'*/
lv_obj_t * obj_scr = lv_obj_get_screen(obj);
- lv_disp_t * disp = lv_obj_get_disp(obj_scr);
- if(obj_scr != lv_disp_get_scr_act(disp) &&
- obj_scr != lv_disp_get_scr_prev(disp) &&
- obj_scr != lv_disp_get_layer_bottom(disp) &&
- obj_scr != lv_disp_get_layer_top(disp) &&
- obj_scr != lv_disp_get_layer_sys(disp)) {
+ lv_display_t * disp = lv_obj_get_disp(obj_scr);
+ if(obj_scr != lv_display_get_scr_act(disp) &&
+ obj_scr != lv_display_get_scr_prev(disp) &&
+ obj_scr != lv_display_get_layer_bottom(disp) &&
+ obj_scr != lv_display_get_layer_top(disp) &&
+ obj_scr != lv_display_get_layer_sys(disp)) {
return false;
}
@@ -1118,10 +1118,10 @@ static void layout_update_core(lv_obj_t * obj)
static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv)
{
- lv_coord_t angle = lv_obj_get_style_transform_angle(obj, 0);
- lv_coord_t zoom = lv_obj_get_style_transform_zoom_safe(obj, 0);
+ lv_coord_t angle = lv_obj_get_style_transform_rotation(obj, 0);
+ lv_coord_t zoom = lv_obj_get_style_transform_scale_safe(obj, 0);
- if(angle == 0 && zoom == LV_ZOOM_NONE) return;
+ if(angle == 0 && zoom == LV_SCALE_NONE) return;
lv_point_t pivot = {
.x = lv_obj_get_style_transform_pivot_x(obj, 0),
diff --git a/src/core/lv_obj_scroll.c b/src/core/lv_obj_scroll.c
index bd0ae85420..3a8aee85e6 100644
--- a/src/core/lv_obj_scroll.c
+++ b/src/core/lv_obj_scroll.c
@@ -10,7 +10,7 @@
#include "lv_obj.h"
#include "../indev/lv_indev.h"
#include "../indev/lv_indev_scroll.h"
-#include "../disp/lv_disp.h"
+#include "../display/lv_display.h"
/*********************
* DEFINES
@@ -306,14 +306,14 @@ void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enab
{
if(dx == 0 && dy == 0) return;
if(anim_en == LV_ANIM_ON) {
- lv_disp_t * d = lv_obj_get_disp(obj);
+ lv_display_t * d = lv_obj_get_disp(obj);
lv_anim_t a;
lv_anim_init(&a);
lv_anim_set_var(&a, obj);
lv_anim_set_ready_cb(&a, scroll_anim_ready_cb);
if(dx) {
- uint32_t t = lv_anim_speed_to_time((lv_disp_get_hor_res(d) * 2) >> 2, 0, dx);
+ uint32_t t = lv_anim_speed_to_time((lv_display_get_horizontal_resolution(d) * 2) >> 2, 0, dx);
if(t < SCROLL_ANIM_TIME_MIN) t = SCROLL_ANIM_TIME_MIN;
if(t > SCROLL_ANIM_TIME_MAX) t = SCROLL_ANIM_TIME_MAX;
lv_anim_set_time(&a, t);
@@ -322,14 +322,14 @@ void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enab
lv_anim_set_exec_cb(&a, scroll_x_anim);
lv_anim_set_path_cb(&a, lv_anim_path_ease_out);
- lv_res_t res;
+ lv_result_t res;
res = lv_obj_send_event(obj, LV_EVENT_SCROLL_BEGIN, &a);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_anim_start(&a);
}
if(dy) {
- uint32_t t = lv_anim_speed_to_time((lv_disp_get_ver_res(d) * 2) >> 2, 0, dy);
+ uint32_t t = lv_anim_speed_to_time((lv_display_get_vertical_resolution(d) * 2) >> 2, 0, dy);
if(t < SCROLL_ANIM_TIME_MIN) t = SCROLL_ANIM_TIME_MIN;
if(t > SCROLL_ANIM_TIME_MAX) t = SCROLL_ANIM_TIME_MAX;
lv_anim_set_time(&a, t);
@@ -338,9 +338,9 @@ void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enab
lv_anim_set_exec_cb(&a, scroll_y_anim);
lv_anim_set_path_cb(&a, lv_anim_path_ease_out);
- lv_res_t res;
+ lv_result_t res;
res = lv_obj_send_event(obj, LV_EVENT_SCROLL_BEGIN, &a);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_anim_start(&a);
}
}
@@ -349,15 +349,15 @@ void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enab
lv_anim_del(obj, scroll_y_anim);
lv_anim_del(obj, scroll_x_anim);
- lv_res_t res;
+ lv_result_t res;
res = lv_obj_send_event(obj, LV_EVENT_SCROLL_BEGIN, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
res = _lv_obj_scroll_by_raw(obj, dx, dy);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
res = lv_obj_send_event(obj, LV_EVENT_SCROLL_END, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
}
@@ -411,9 +411,9 @@ void lv_obj_scroll_to_view_recursive(lv_obj_t * obj, lv_anim_enable_t anim_en)
}
}
-lv_res_t _lv_obj_scroll_by_raw(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
+lv_result_t _lv_obj_scroll_by_raw(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
{
- if(x == 0 && y == 0) return LV_RES_OK;
+ if(x == 0 && y == 0) return LV_RESULT_OK;
lv_obj_allocate_spec_attr(obj);
@@ -421,10 +421,10 @@ lv_res_t _lv_obj_scroll_by_raw(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
obj->spec_attr->scroll.y += y;
lv_obj_move_children_by(obj, x, y, true);
- lv_res_t res = lv_obj_send_event(obj, LV_EVENT_SCROLL, NULL);
- if(res != LV_RES_OK) return res;
+ lv_result_t res = lv_obj_send_event(obj, LV_EVENT_SCROLL, NULL);
+ if(res != LV_RESULT_OK) return res;
lv_obj_invalidate(obj);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
@@ -785,9 +785,9 @@ static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_p
bool y_del = lv_anim_del(parent, scroll_y_anim);
bool x_del = lv_anim_del(parent, scroll_x_anim);
if(y_del || x_del) {
- lv_res_t res;
+ lv_result_t res;
res = lv_obj_send_event(parent, LV_EVENT_SCROLL_END, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
if((scroll_dir & LV_DIR_LEFT) == 0 && x_scroll < 0) x_scroll = 0;
diff --git a/src/core/lv_obj_scroll.h b/src/core/lv_obj_scroll.h
index 8d1a01cf40..b07a6cc6f6 100644
--- a/src/core/lv_obj_scroll.h
+++ b/src/core/lv_obj_scroll.h
@@ -265,10 +265,10 @@ void lv_obj_scroll_to_view_recursive(struct _lv_obj_t * obj, lv_anim_enable_t an
* @param obj pointer to an object to scroll
* @param x pixels to scroll horizontally
* @param y pixels to scroll vertically
- * @return `LV_RES_INV`: to object was deleted in `LV_EVENT_SCROLL`;
- * `LV_RES_OK`: if the object is still valid
+ * @return `LV_RESULT_INVALID`: to object was deleted in `LV_EVENT_SCROLL`;
+ * `LV_RESULT_OK`: if the object is still valid
*/
-lv_res_t _lv_obj_scroll_by_raw(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
+lv_result_t _lv_obj_scroll_by_raw(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
/**
* Tell whether an object is being scrolled or not at this moment
diff --git a/src/core/lv_obj_style.c b/src/core/lv_obj_style.c
index ef988c873e..265fd275b5 100644
--- a/src/core/lv_obj_style.c
+++ b/src/core/lv_obj_style.c
@@ -7,8 +7,8 @@
* INCLUDES
*********************/
#include "lv_obj.h"
-#include "../disp/lv_disp.h"
-#include "../disp/lv_disp_private.h"
+#include "../display/lv_display.h"
+#include "../display/lv_display_private.h"
#include "../misc/lv_color.h"
#include "../stdlib/lv_string.h"
#include "../core/lv_global.h"
@@ -246,14 +246,14 @@ void lv_obj_remove_style_all(struct _lv_obj_t * obj)
void lv_obj_report_style_change(lv_style_t * style)
{
if(!style_refr) return;
- lv_disp_t * d = lv_disp_get_next(NULL);
+ lv_display_t * d = lv_display_get_next(NULL);
while(d) {
uint32_t i;
for(i = 0; i < d->screen_cnt; i++) {
report_style_change_core(style, d->screens[i]);
}
- d = lv_disp_get_next(d);
+ d = lv_display_get_next(d);
}
}
@@ -319,9 +319,9 @@ static inline lv_style_value_t lv_style_prop_get_default_inlined(lv_style_prop_t
const lv_color_t black = LV_COLOR_MAKE(0x00, 0x00, 0x00);
const lv_color_t white = LV_COLOR_MAKE(0xff, 0xff, 0xff);
switch(prop) {
- case LV_STYLE_TRANSFORM_ZOOM:
+ case LV_STYLE_TRANSFORM_SCALE:
return (lv_style_value_t) {
- .num = LV_ZOOM_NONE
+ .num = LV_SCALE_NONE
};
case LV_STYLE_BG_COLOR:
return (lv_style_value_t) {
@@ -497,8 +497,8 @@ bool lv_obj_remove_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_sty
/*The style is not found*/
if(i == obj->style_cnt) return false;
- lv_res_t res = lv_style_remove_prop((lv_style_t *)obj->styles[i].style, prop);
- if(res == LV_RES_OK) {
+ lv_result_t res = lv_style_remove_prop((lv_style_t *)obj->styles[i].style, prop);
+ if(res == LV_RESULT_OK) {
full_cache_refresh(obj, lv_obj_style_get_selector_part(selector));
lv_obj_refresh_style(obj, selector, prop);
}
@@ -606,8 +606,8 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
else if(lv_style_get_prop(style, LV_STYLE_MIN_HEIGHT, &v)) layout_diff = true;
else if(lv_style_get_prop(style, LV_STYLE_MAX_HEIGHT, &v)) layout_diff = true;
else if(lv_style_get_prop(style, LV_STYLE_BORDER_WIDTH, &v)) layout_diff = true;
- else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ANGLE, &v)) layout_diff = true;
- else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ZOOM, &v)) layout_diff = true;
+ else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ROTATION, &v)) layout_diff = true;
+ else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_SCALE, &v)) layout_diff = true;
if(layout_diff) {
return _LV_STYLE_STATE_CMP_DIFF_LAYOUT;
@@ -616,8 +616,8 @@ _lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t sta
/*Check for draw pad changes*/
if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_HEIGHT, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
- else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ANGLE, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
- else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ZOOM, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
+ else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_ROTATION, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
+ else if(lv_style_get_prop(style, LV_STYLE_TRANSFORM_SCALE, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_OPA, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_PAD, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
else if(lv_style_get_prop(style, LV_STYLE_OUTLINE_WIDTH, &v)) res = _LV_STYLE_STATE_CMP_DIFF_DRAW_PAD;
@@ -1041,8 +1041,8 @@ static void trans_anim_ready_cb(lv_anim_t * a)
static lv_layer_type_t calculate_layer_type(lv_obj_t * obj)
{
- if(lv_obj_get_style_transform_angle(obj, 0) != 0) return LV_LAYER_TYPE_TRANSFORM;
- if(lv_obj_get_style_transform_zoom(obj, 0) != 256) return LV_LAYER_TYPE_TRANSFORM;
+ if(lv_obj_get_style_transform_rotation(obj, 0) != 0) return LV_LAYER_TYPE_TRANSFORM;
+ if(lv_obj_get_style_transform_scale(obj, 0) != 256) return LV_LAYER_TYPE_TRANSFORM;
if(lv_obj_get_style_opa_layered(obj, 0) != LV_OPA_COVER) return LV_LAYER_TYPE_SIMPLE;
if(lv_obj_get_style_blend_mode(obj, 0) != LV_BLEND_MODE_NORMAL) return LV_LAYER_TYPE_SIMPLE;
return LV_LAYER_TYPE_NONE;
diff --git a/src/core/lv_obj_style.h b/src/core/lv_obj_style.h
index 9bb837f666..d8475ae184 100644
--- a/src/core/lv_obj_style.h
+++ b/src/core/lv_obj_style.h
@@ -313,9 +313,9 @@ static inline lv_coord_t lv_obj_get_style_space_bottom(const struct _lv_obj_t *
lv_text_align_t lv_obj_calculate_style_text_align(const struct _lv_obj_t * obj, lv_part_t part, const char * txt);
-static inline lv_coord_t lv_obj_get_style_transform_zoom_safe(const struct _lv_obj_t * obj, uint32_t part)
+static inline lv_coord_t lv_obj_get_style_transform_scale_safe(const struct _lv_obj_t * obj, uint32_t part)
{
- int16_t zoom = lv_obj_get_style_transform_zoom(obj, part);
+ int16_t zoom = lv_obj_get_style_transform_scale(obj, part);
return zoom != 0 ? zoom : 1;
}
diff --git a/src/core/lv_obj_style_gen.c b/src/core/lv_obj_style_gen.c
index 9275f30b5a..bec9dbc191 100644
--- a/src/core/lv_obj_style_gen.c
+++ b/src/core/lv_obj_style_gen.c
@@ -114,20 +114,20 @@ void lv_obj_set_style_translate_y(struct _lv_obj_t * obj, lv_coord_t value, lv_s
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSLATE_Y, v, selector);
}
-void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
+void lv_obj_set_style_transform_scale(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
- lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ZOOM, v, selector);
+ lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_SCALE, v, selector);
}
-void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
+void lv_obj_set_style_transform_rotation(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
};
- lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ANGLE, v, selector);
+ lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_ROTATION, v, selector);
}
void lv_obj_set_style_transform_pivot_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
diff --git a/src/core/lv_obj_style_gen.h b/src/core/lv_obj_style_gen.h
index f56c1ae72d..513408f926 100644
--- a/src/core/lv_obj_style_gen.h
+++ b/src/core/lv_obj_style_gen.h
@@ -92,15 +92,15 @@ static inline lv_coord_t lv_obj_get_style_translate_y(const struct _lv_obj_t * o
return (lv_coord_t)v.num;
}
-static inline lv_coord_t lv_obj_get_style_transform_zoom(const struct _lv_obj_t * obj, uint32_t part)
+static inline lv_coord_t lv_obj_get_style_transform_scale(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ZOOM);
+ lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_SCALE);
return (lv_coord_t)v.num;
}
-static inline lv_coord_t lv_obj_get_style_transform_angle(const struct _lv_obj_t * obj, uint32_t part)
+static inline lv_coord_t lv_obj_get_style_transform_rotation(const struct _lv_obj_t * obj, uint32_t part)
{
- lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ANGLE);
+ lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_ROTATION);
return (lv_coord_t)v.num;
}
@@ -718,8 +718,8 @@ void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value,
void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
-void lv_obj_set_style_transform_zoom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
-void lv_obj_set_style_transform_angle(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
+void lv_obj_set_style_transform_scale(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
+void lv_obj_set_style_transform_rotation(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_pivot_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_pivot_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
@@ -785,8 +785,6 @@ void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_
void lv_obj_set_style_clip_corner(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_opa_layered(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
-void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
- lv_style_selector_t selector);
void lv_obj_set_style_color_filter_dsc(struct _lv_obj_t * obj, const lv_color_filter_dsc_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_color_filter_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
diff --git a/src/core/lv_obj_tree.c b/src/core/lv_obj_tree.c
index bf37ad95ad..caf4d59269 100644
--- a/src/core/lv_obj_tree.c
+++ b/src/core/lv_obj_tree.c
@@ -11,8 +11,8 @@
#include "lv_obj.h"
#include "../indev/lv_indev.h"
#include "../indev/lv_indev_private.h"
-#include "../disp/lv_disp.h"
-#include "../disp/lv_disp_private.h"
+#include "../display/lv_display.h"
+#include "../display/lv_display_private.h"
#include "../misc/lv_anim.h"
#include "../misc/lv_async.h"
#include "../core/lv_global.h"
@@ -60,7 +60,7 @@ void lv_obj_del(lv_obj_t * obj)
lv_obj_scrollbar_invalidate(par);
}
- lv_disp_t * disp = NULL;
+ lv_display_t * disp = NULL;
bool act_scr_del = false;
if(par == NULL) {
disp = lv_obj_get_disp(obj);
@@ -282,7 +282,7 @@ lv_obj_t * lv_obj_get_screen(const lv_obj_t * obj)
return (lv_obj_t *)act_par;
}
-lv_disp_t * lv_obj_get_disp(const lv_obj_t * obj)
+lv_display_t * lv_obj_get_disp(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@@ -291,7 +291,7 @@ lv_disp_t * lv_obj_get_disp(const lv_obj_t * obj)
if(obj->parent == NULL) scr = obj; /*`obj` is a screen*/
else scr = lv_obj_get_screen(obj); /*get the screen of `obj`*/
- lv_disp_t * d;
+ lv_display_t * d;
lv_ll_t * disp_head = disp_ll_p;
_LV_LL_READ(disp_head, d) {
uint32_t i;
@@ -378,8 +378,8 @@ static void obj_del_core(lv_obj_t * obj)
obj->is_deleting = true;
/*Let the user free the resources used in `LV_EVENT_DELETE`*/
- lv_res_t res = lv_obj_send_event(obj, LV_EVENT_DELETE, NULL);
- if(res == LV_RES_INV) {
+ lv_result_t res = lv_obj_send_event(obj, LV_EVENT_DELETE, NULL);
+ if(res == LV_RESULT_INVALID) {
obj->is_deleting = false;
return;
}
@@ -416,8 +416,8 @@ static void obj_del_core(lv_obj_t * obj)
}
/*Delete all pending async del-s*/
- lv_res_t async_cancel_res = LV_RES_OK;
- while(async_cancel_res == LV_RES_OK) {
+ lv_result_t async_cancel_res = LV_RESULT_OK;
+ while(async_cancel_res == LV_RESULT_OK) {
async_cancel_res = lv_async_call_cancel(lv_obj_del_async_cb, obj);
}
@@ -426,7 +426,7 @@ static void obj_del_core(lv_obj_t * obj)
/*Remove the screen for the screen list*/
if(obj->parent == NULL) {
- lv_disp_t * disp = lv_obj_get_disp(obj);
+ lv_display_t * disp = lv_obj_get_disp(obj);
uint32_t i;
/*Find the screen in the list*/
for(i = 0; i < disp->screen_cnt; i++) {
@@ -462,13 +462,13 @@ static lv_obj_tree_walk_res_t walk_core(lv_obj_t * obj, lv_obj_tree_walk_cb_t cb
lv_obj_tree_walk_res_t res = LV_OBJ_TREE_WALK_NEXT;
if(obj == NULL) {
- lv_disp_t * disp = lv_disp_get_next(NULL);
+ lv_display_t * disp = lv_display_get_next(NULL);
while(disp) {
uint32_t i;
for(i = 0; i < disp->screen_cnt; i++) {
walk_core(disp->screens[i], cb, user_data);
}
- disp = lv_disp_get_next(disp);
+ disp = lv_display_get_next(disp);
}
return LV_OBJ_TREE_WALK_END; /*The value doesn't matter as it wasn't called recursively*/
}
diff --git a/src/core/lv_obj_tree.h b/src/core/lv_obj_tree.h
index 6ae7a6ced4..6769180589 100644
--- a/src/core/lv_obj_tree.h
+++ b/src/core/lv_obj_tree.h
@@ -16,7 +16,7 @@ extern "C" {
#include
#include
#include "../misc/lv_anim.h"
-#include "../disp/lv_disp.h"
+#include "../display/lv_display.h"
/*********************
* DEFINES
@@ -28,7 +28,7 @@ extern "C" {
**********************/
struct _lv_obj_t;
-struct _lv_disp_t;
+struct _lv_display_t;
struct _lv_obj_class_t;
typedef enum {
@@ -118,7 +118,7 @@ struct _lv_obj_t * lv_obj_get_screen(const struct _lv_obj_t * obj);
* @param obj pointer to an object
* @return pointer to the object's display
*/
-struct _lv_disp_t * lv_obj_get_disp(const struct _lv_obj_t * obj);
+struct _lv_display_t * lv_obj_get_disp(const struct _lv_obj_t * obj);
/**
* Get the parent of an object
diff --git a/src/core/lv_refr.c b/src/core/lv_refr.c
index e07ee4f35f..244642d1f5 100644
--- a/src/core/lv_refr.c
+++ b/src/core/lv_refr.c
@@ -8,8 +8,8 @@
*********************/
#include
#include "lv_refr.h"
-#include "../disp/lv_disp.h"
-#include "../disp/lv_disp_private.h"
+#include "../display/lv_display.h"
+#include "../display/lv_display_private.h"
#include "../tick/lv_tick.h"
#include "../misc/lv_timer.h"
#include "../misc/lv_math.h"
@@ -40,9 +40,9 @@ static void refr_area_part(lv_layer_t * layer);
static lv_obj_t * lv_refr_get_top_obj(const lv_area_t * area_p, lv_obj_t * obj);
static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj);
static void refr_obj(lv_layer_t * layer, lv_obj_t * obj);
-static uint32_t get_max_row(lv_disp_t * disp, lv_coord_t area_w, lv_coord_t area_h);
-static void draw_buf_flush(lv_disp_t * disp);
-static void call_flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * px_map);
+static uint32_t get_max_row(lv_display_t * disp, lv_coord_t area_w, lv_coord_t area_h);
+static void draw_buf_flush(lv_display_t * disp);
+static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map);
/**********************
* STATIC VARIABLES
@@ -68,19 +68,19 @@ void _lv_refr_init(void)
{
}
-void lv_refr_now(lv_disp_t * disp)
+void lv_refr_now(lv_display_t * disp)
{
lv_anim_refr_now();
if(disp) {
- if(disp->refr_timer) _lv_disp_refr_timer(disp->refr_timer);
+ if(disp->refr_timer) _lv_display_refr_timer(disp->refr_timer);
}
else {
- lv_disp_t * d;
- d = lv_disp_get_next(NULL);
+ lv_display_t * d;
+ d = lv_display_get_next(NULL);
while(d) {
- if(d->refr_timer) _lv_disp_refr_timer(d->refr_timer);
- d = lv_disp_get_next(d);
+ if(d->refr_timer) _lv_display_refr_timer(d->refr_timer);
+ d = lv_display_get_next(d);
}
}
}
@@ -248,11 +248,11 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
* @param area_p pointer to area which should be invalidated (NULL: delete the invalidated areas)
* only one display)
*/
-void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p)
+void _lv_inv_area(lv_display_t * disp, const lv_area_t * area_p)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) return;
- if(!lv_disp_is_invalidation_enabled(disp)) return;
+ if(!lv_display_is_invalidation_enabled(disp)) return;
LV_ASSERT_MSG(!disp->rendering_in_progress, "Invalidate area is not allowed during rendering.");
@@ -265,8 +265,8 @@ void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p)
lv_area_t scr_area;
scr_area.x1 = 0;
scr_area.y1 = 0;
- scr_area.x2 = lv_disp_get_hor_res(disp) - 1;
- scr_area.y2 = lv_disp_get_ver_res(disp) - 1;
+ scr_area.x2 = lv_display_get_horizontal_resolution(disp) - 1;
+ scr_area.y2 = lv_display_get_vertical_resolution(disp) - 1;
lv_area_t com_area;
bool suc;
@@ -275,15 +275,15 @@ void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p)
if(suc == false) return; /*Out of the screen*/
/*If there were at least 1 invalid area in full refresh mode, redraw the whole screen*/
- if(disp->render_mode == LV_DISP_RENDER_MODE_FULL) {
+ if(disp->render_mode == LV_DISPLAY_RENDER_MODE_FULL) {
disp->inv_areas[0] = scr_area;
disp->inv_p = 1;
- lv_disp_send_event(disp, LV_EVENT_REFR_REQUEST, NULL);
+ lv_display_send_event(disp, LV_EVENT_REFR_REQUEST, NULL);
return;
}
- lv_res_t res = lv_disp_send_event(disp, LV_EVENT_INVALIDATE_AREA, &com_area);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_display_send_event(disp, LV_EVENT_INVALIDATE_AREA, &com_area);
+ if(res != LV_RESULT_OK) return;
/*Save only if this area is not in one of the saved areas*/
uint16_t i;
@@ -300,14 +300,14 @@ void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p)
lv_area_copy(&disp->inv_areas[disp->inv_p], tmp_area_p);
disp->inv_p++;
- lv_disp_send_event(disp, LV_EVENT_REFR_REQUEST, NULL);
+ lv_display_send_event(disp, LV_EVENT_REFR_REQUEST, NULL);
}
/**
* Get the display which is being refreshed
* @return the display being refreshed
*/
-lv_disp_t * _lv_refr_get_disp_refreshing(void)
+lv_display_t * _lv_refr_get_disp_refreshing(void)
{
return disp_refr;
}
@@ -316,7 +316,7 @@ lv_disp_t * _lv_refr_get_disp_refreshing(void)
* Called periodically to handle the refreshing
* @param tmr pointer to the timer itself
*/
-void _lv_disp_refr_timer(lv_timer_t * tmr)
+void _lv_display_refr_timer(lv_timer_t * tmr)
{
LV_PROFILER_BEGIN;
REFR_TRACE("begin");
@@ -332,7 +332,7 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
#endif
}
else {
- disp_refr = lv_disp_get_default();
+ disp_refr = lv_display_get_default();
}
if(disp_refr == NULL) {
@@ -349,7 +349,7 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
return;
}
- lv_disp_send_event(disp_refr, LV_EVENT_REFR_START, NULL);
+ lv_display_send_event(disp_refr, LV_EVENT_REFR_START, NULL);
/*Refresh the screen's layout if required*/
lv_obj_update_layout(disp_refr->act_scr);
@@ -374,9 +374,10 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
/*If refresh happened ...*/
/*Call monitor cb if present*/
- lv_disp_send_event(disp_refr, LV_EVENT_RENDER_READY, NULL);
+ lv_display_send_event(disp_refr, LV_EVENT_RENDER_READY, NULL);
- if(!lv_disp_is_double_buffered(disp_refr) || disp_refr->render_mode != LV_DISP_RENDER_MODE_DIRECT) goto refr_clean_up;
+ if(!lv_display_is_double_buffered(disp_refr) ||
+ disp_refr->render_mode != LV_DISPLAY_RENDER_MODE_DIRECT) goto refr_clean_up;
/*With double buffered direct mode synchronize the rendered areas to the other buffer*/
/*We need to wait for ready here to not mess up the active screen*/
@@ -389,8 +390,8 @@ void _lv_disp_refr_timer(lv_timer_t * tmr)
? disp_refr->buf_2
: disp_refr->buf_1;
- lv_coord_t stride = lv_draw_buf_width_to_stride(lv_disp_get_hor_res(disp_refr),
- lv_disp_get_color_format(disp_refr));
+ lv_coord_t stride = lv_draw_buf_width_to_stride(lv_display_get_horizontal_resolution(disp_refr),
+ lv_display_get_color_format(disp_refr));
uint32_t i;
for(i = 0; i < disp_refr->inv_p; i++) {
if(disp_refr->inv_area_joined[i]) continue;
@@ -413,7 +414,7 @@ refr_finish:
_lv_draw_sw_mask_cleanup();
#endif
- lv_disp_send_event(disp_refr, LV_EVENT_REFR_FINISH, NULL);
+ lv_display_send_event(disp_refr, LV_EVENT_REFR_FINISH, NULL);
REFR_TRACE("finished");
LV_PROFILER_END;
@@ -479,7 +480,7 @@ static void refr_invalid_areas(void)
}
/*Notify the display driven rendering has started*/
- lv_disp_send_event(disp_refr, LV_EVENT_RENDER_START, NULL);
+ lv_display_send_event(disp_refr, LV_EVENT_RENDER_START, NULL);
disp_refr->last_area = 0;
disp_refr->last_part = 0;
@@ -510,21 +511,21 @@ static void refr_area(const lv_area_t * area_p)
/*With full refresh just redraw directly into the buffer*/
/*In direct mode draw directly on the absolute coordinates of the buffer*/
- if(disp_refr->render_mode != LV_DISP_RENDER_MODE_PARTIAL) {
- layer->draw_buf.width = lv_disp_get_hor_res(disp_refr);
- layer->draw_buf.height = lv_disp_get_ver_res(disp_refr);
+ if(disp_refr->render_mode != LV_DISPLAY_RENDER_MODE_PARTIAL) {
+ layer->draw_buf.width = lv_display_get_horizontal_resolution(disp_refr);
+ layer->draw_buf.height = lv_display_get_vertical_resolution(disp_refr);
layer->draw_buf_ofs.x = 0;
layer->draw_buf_ofs.y = 0;
lv_area_t disp_area;
- lv_area_set(&disp_area, 0, 0, lv_disp_get_hor_res(disp_refr) - 1,
- lv_disp_get_ver_res(disp_refr) - 1);
+ lv_area_set(&disp_area, 0, 0, lv_display_get_horizontal_resolution(disp_refr) - 1,
+ lv_display_get_vertical_resolution(disp_refr) - 1);
- if(disp_refr->render_mode == LV_DISP_RENDER_MODE_FULL) {
+ if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_FULL) {
disp_refr->last_part = 1;
layer->clip_area = disp_area;
refr_area_part(layer);
}
- else if(disp_refr->render_mode == LV_DISP_RENDER_MODE_DIRECT) {
+ else if(disp_refr->render_mode == LV_DISPLAY_RENDER_MODE_DIRECT) {
disp_refr->last_part = disp_refr->last_area;
layer->clip_area = *area_p;
refr_area_part(layer);
@@ -536,8 +537,8 @@ static void refr_area(const lv_area_t * area_p)
/*Calculate the max row num*/
lv_coord_t w = lv_area_get_width(area_p);
lv_coord_t h = lv_area_get_height(area_p);
- lv_coord_t y2 = area_p->y2 >= lv_disp_get_ver_res(disp_refr) ?
- lv_disp_get_ver_res(disp_refr) - 1 : area_p->y2;
+ lv_coord_t y2 = area_p->y2 >= lv_display_get_vertical_resolution(disp_refr) ?
+ lv_display_get_vertical_resolution(disp_refr) - 1 : area_p->y2;
int32_t max_row = get_max_row(disp_refr, w, h);
@@ -586,7 +587,7 @@ static void refr_area_part(lv_layer_t * layer)
/* In single buffered mode wait here until the buffer is freed.
* Else we would draw into the buffer while it's still being transferred to the display*/
- if(!lv_disp_is_double_buffered(disp_refr)) {
+ if(!lv_display_is_double_buffered(disp_refr)) {
while(disp_refr->flushing);
}
/*If the screen is transparent initialize it when the flushing is ready*/
@@ -598,14 +599,14 @@ static void refr_area_part(lv_layer_t * layer)
lv_obj_t * top_prev_scr = NULL;
/*Get the most top object which is not covered by others*/
- top_act_scr = lv_refr_get_top_obj(&layer->clip_area, lv_disp_get_scr_act(disp_refr));
+ top_act_scr = lv_refr_get_top_obj(&layer->clip_area, lv_display_get_scr_act(disp_refr));
if(disp_refr->prev_scr) {
top_prev_scr = lv_refr_get_top_obj(&layer->clip_area, disp_refr->prev_scr);
}
/*Draw a bottom layer background if there is no top object*/
if(top_act_scr == NULL && top_prev_scr == NULL) {
- refr_obj_and_children(layer, lv_disp_get_layer_bottom(disp_refr));
+ refr_obj_and_children(layer, lv_display_get_layer_bottom(disp_refr));
}
if(disp_refr->draw_prev_over_act) {
@@ -630,8 +631,8 @@ static void refr_area_part(lv_layer_t * layer)
}
/*Also refresh top and sys layer unconditionally*/
- refr_obj_and_children(layer, lv_disp_get_layer_top(disp_refr));
- refr_obj_and_children(layer, lv_disp_get_layer_sys(disp_refr));
+ refr_obj_and_children(layer, lv_display_get_layer_top(disp_refr));
+ refr_obj_and_children(layer, lv_display_get_layer_sys(disp_refr));
draw_buf_flush(disp_refr);
}
@@ -687,7 +688,7 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj)
/*Normally always will be a top_obj (at least the screen)
*but in special cases (e.g. if the screen has alpha) it won't.
*In this case use the screen directly*/
- if(top_obj == NULL) top_obj = lv_disp_get_scr_act(disp_refr);
+ if(top_obj == NULL) top_obj = lv_display_get_scr_act(disp_refr);
if(top_obj == NULL) return; /*Shouldn't happen*/
/*Refresh the top object and its children*/
@@ -729,8 +730,8 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj)
}
-static lv_res_t layer_get_area(lv_layer_t * layer, lv_obj_t * obj, lv_layer_type_t layer_type,
- lv_area_t * layer_area_out)
+static lv_result_t layer_get_area(lv_layer_t * layer, lv_obj_t * obj, lv_layer_type_t layer_type,
+ lv_area_t * layer_area_out)
{
lv_coord_t ext_draw_size = _lv_obj_get_ext_draw_size(obj);
lv_area_t obj_coords_ext;
@@ -744,7 +745,7 @@ static lv_res_t layer_get_area(lv_layer_t * layer, lv_obj_t * obj, lv_layer_type
lv_area_t tranf_coords = obj_coords_ext;
lv_obj_get_transformed_area(obj, &tranf_coords, false, false);
if(!_lv_area_intersect(&clip_coords_for_obj, &layer->clip_area, &tranf_coords)) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
/*Transform back (inverse) the transformed area.
@@ -753,7 +754,7 @@ static lv_res_t layer_get_area(lv_layer_t * layer, lv_obj_t * obj, lv_layer_type
lv_area_t inverse_clip_coords_for_obj = clip_coords_for_obj;
lv_obj_get_transformed_area(obj, &inverse_clip_coords_for_obj, false, true);
if(!_lv_area_intersect(&inverse_clip_coords_for_obj, &inverse_clip_coords_for_obj, &obj_coords_ext)) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
*layer_area_out = inverse_clip_coords_for_obj;
@@ -762,16 +763,16 @@ static lv_res_t layer_get_area(lv_layer_t * layer, lv_obj_t * obj, lv_layer_type
else if(layer_type == LV_LAYER_TYPE_SIMPLE) {
lv_area_t clip_coords_for_obj;
if(!_lv_area_intersect(&clip_coords_for_obj, &layer->clip_area, &obj_coords_ext)) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
*layer_area_out = clip_coords_for_obj;
}
else {
LV_LOG_WARN("Unhandled layer type");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
static bool alpha_test_area_on_obj(lv_obj_t * obj, const lv_area_t * area)
@@ -802,8 +803,8 @@ void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
if(opa < LV_OPA_MIN) return;
lv_area_t layer_area_full;
- lv_res_t res = layer_get_area(layer, obj, layer_type, &layer_area_full);
- if(res != LV_RES_OK) return;
+ lv_result_t res = layer_get_area(layer, obj, layer_type, &layer_area_full);
+ if(res != LV_RESULT_OK) return;
/*Simple layers can be subdivied into smaller layers*/
uint32_t max_rgb_row_height = lv_area_get_height(&layer_area_full);
@@ -842,10 +843,10 @@ void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
layer_draw_dsc.pivot.y = obj->coords.y1 + lv_obj_get_style_transform_pivot_y(obj, 0) - new_layer->draw_buf_ofs.y;
layer_draw_dsc.opa = opa;
- layer_draw_dsc.angle = lv_obj_get_style_transform_angle(obj, 0);
- while(layer_draw_dsc.angle > 3600) layer_draw_dsc.angle -= 3600;
- while(layer_draw_dsc.angle < 0) layer_draw_dsc.angle += 3600;
- layer_draw_dsc.zoom = lv_obj_get_style_transform_zoom(obj, 0);
+ layer_draw_dsc.rotation = lv_obj_get_style_transform_rotation(obj, 0);
+ while(layer_draw_dsc.rotation > 3600) layer_draw_dsc.rotation -= 3600;
+ while(layer_draw_dsc.rotation < 0) layer_draw_dsc.rotation += 3600;
+ layer_draw_dsc.zoom = lv_obj_get_style_transform_scale(obj, 0);
layer_draw_dsc.blend_mode = lv_obj_get_style_blend_mode(obj, 0);
layer_draw_dsc.antialias = disp_refr->antialiasing;
layer_draw_dsc.src = new_layer;
@@ -858,7 +859,7 @@ void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
}
-static uint32_t get_max_row(lv_disp_t * disp, lv_coord_t area_w, lv_coord_t area_h)
+static uint32_t get_max_row(lv_display_t * disp, lv_coord_t area_w, lv_coord_t area_h)
{
bool has_alpha = lv_color_format_has_alpha(disp->color_format);
uint32_t px_size_disp = lv_color_format_get_size(disp->color_format);
@@ -876,7 +877,7 @@ static uint32_t get_max_row(lv_disp_t * disp, lv_coord_t area_w, lv_coord_t area
lv_coord_t h_tmp = max_row;
do {
tmp.y2 = h_tmp - 1;
- lv_disp_send_event(disp_refr, LV_EVENT_INVALIDATE_AREA, &tmp);
+ lv_display_send_event(disp_refr, LV_EVENT_INVALIDATE_AREA, &tmp);
/*If this height fits into `max_row` then fine*/
if(lv_area_get_height(&tmp) <= max_row) break;
@@ -900,7 +901,7 @@ static uint32_t get_max_row(lv_disp_t * disp, lv_coord_t area_w, lv_coord_t area
/**
* Flush the content of the draw buffer
*/
-static void draw_buf_flush(lv_disp_t * disp)
+static void draw_buf_flush(lv_display_t * disp)
{
/*Flush the rendered content to the display*/
lv_layer_t * layer = disp->layer_head;
@@ -914,7 +915,7 @@ static void draw_buf_flush(lv_disp_t * disp)
* and driver is ready to receive the new buffer.
* If we need to wait here it means that the content of one buffer is being sent to display
* and other buffer already contains the new rendered image. */
- if(lv_disp_is_double_buffered(disp)) {
+ if(lv_display_is_double_buffered(disp)) {
while(disp->flushing);
}
@@ -927,7 +928,7 @@ static void draw_buf_flush(lv_disp_t * disp)
if(disp->flush_cb) {
/*Rotate the buffer to the display's native orientation if necessary*/
- if(disp->rotation != LV_DISP_ROTATION_0 && disp->sw_rotate) {
+ if(disp->rotation != LV_DISPLAY_ROTATION_0 && disp->sw_rotate) {
LV_LOG_WARN("SW rotation is not supported now");
call_flush_cb(disp, &disp->refreshed_area, layer->draw_buf.buf);
}
@@ -936,7 +937,7 @@ static void draw_buf_flush(lv_disp_t * disp)
}
}
/*If there are 2 buffers swap them. With direct mode swap only on the last area*/
- if(lv_disp_is_double_buffered(disp) && (disp->render_mode != LV_DISP_RENDER_MODE_DIRECT || flushing_last)) {
+ if(lv_display_is_double_buffered(disp) && (disp->render_mode != LV_DISPLAY_RENDER_MODE_DIRECT || flushing_last)) {
if(disp->buf_act == disp->buf_1) {
disp->buf_act = disp->buf_2;
}
@@ -946,7 +947,7 @@ static void draw_buf_flush(lv_disp_t * disp)
}
}
-static void call_flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * px_map)
+static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map)
{
LV_PROFILER_BEGIN;
REFR_TRACE("Calling flush_cb on (%d;%d)(%d;%d) area with %p image pointer",
@@ -962,9 +963,9 @@ static void call_flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * px
// if(disp->layer_head->buffer_convert) disp->layer_head->buffer_convert(disp->layer_head);
- lv_disp_send_event(disp, LV_EVENT_FLUSH_START, &offset_area);
+ lv_display_send_event(disp, LV_EVENT_FLUSH_START, &offset_area);
disp->flush_cb(disp, &offset_area, px_map);
- lv_disp_send_event(disp, LV_EVENT_FLUSH_FINISH, &offset_area);
+ lv_display_send_event(disp, LV_EVENT_FLUSH_FINISH, &offset_area);
LV_PROFILER_END;
}
diff --git a/src/core/lv_refr.h b/src/core/lv_refr.h
index e2004e9f45..32921db9f8 100644
--- a/src/core/lv_refr.h
+++ b/src/core/lv_refr.h
@@ -14,7 +14,7 @@ extern "C" {
* INCLUDES
*********************/
#include "lv_obj.h"
-#include "../disp/lv_disp.h"
+#include "../display/lv_display.h"
#include
/*********************
@@ -53,7 +53,7 @@ void _lv_refr_init(void);
* (e.g. progress bar) this function can be called when the screen should be updated.
* @param disp pointer to display to refresh. NULL to refresh all displays.
*/
-void lv_refr_now(lv_disp_t * disp);
+void lv_refr_now(lv_display_t * disp);
/**
* Redrawn on object an all its children using the passed draw context
@@ -68,19 +68,19 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj);
* @param disp pointer to display where the area should be invalidated (NULL can be used if there is
* only one display)
*/
-void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p);
+void _lv_inv_area(lv_display_t * disp, const lv_area_t * area_p);
/**
* Get the display which is being refreshed
* @return the display being refreshed
*/
-lv_disp_t * _lv_refr_get_disp_refreshing(void);
+lv_display_t * _lv_refr_get_disp_refreshing(void);
/**
* Called periodically to handle the refreshing
* @param timer pointer to the timer itself
*/
-void _lv_disp_refr_timer(lv_timer_t * timer);
+void _lv_display_refr_timer(lv_timer_t * timer);
/**********************
* STATIC FUNCTIONS
diff --git a/src/dev/disp/drm/lv_linux_drm.c b/src/dev/display/drm/lv_linux_drm.c
similarity index 96%
rename from src/dev/disp/drm/lv_linux_drm.c
rename to src/dev/display/drm/lv_linux_drm.c
index 7342eb3686..802ba32dd5 100644
--- a/src/dev/disp/drm/lv_linux_drm.c
+++ b/src/dev/display/drm/lv_linux_drm.c
@@ -99,7 +99,7 @@ static int drm_setup(drm_dev_t * drm_dev, const char * device_path, int64_t conn
static int drm_allocate_dumb(drm_dev_t * drm_dev, drm_buffer_t * buf);
static int drm_setup_buffers(drm_dev_t * drm_dev);
static void drm_wait_vsync(drm_dev_t * drm_dev);
-static void drm_flush(lv_disp_t * disp, const lv_area_t * area, lv_color_t * color_p);
+static void drm_flush(lv_display_t * disp, const lv_area_t * area, lv_color_t * color_p);
/**********************
* STATIC VARIABLES
@@ -121,28 +121,28 @@ static void drm_flush(lv_disp_t * disp, const lv_area_t * area, lv_color_t * col
* GLOBAL FUNCTIONS
**********************/
-lv_disp_t * lv_linux_drm_create(void)
+lv_display_t * lv_linux_drm_create(void)
{
drm_dev_t * drm_dev = lv_malloc(sizeof(drm_dev_t));
LV_ASSERT_MALLOC(drm_dev);
if(drm_dev == NULL) return NULL;
lv_memzero(drm_dev, sizeof(drm_dev_t));
- lv_disp_t * disp = lv_disp_create(800, 480);
+ lv_display_t * disp = lv_display_create(800, 480);
if(disp == NULL) {
lv_free(drm_dev);
return NULL;
}
drm_dev->fd = -1;
- lv_disp_set_driver_data(disp, drm_dev);
- lv_disp_set_flush_cb(disp, drm_flush);
+ lv_display_set_driver_data(disp, drm_dev);
+ lv_display_set_flush_cb(disp, drm_flush);
return disp;
}
-void lv_linux_drm_set_file(lv_disp_t * disp, const char * file, int64_t connector_id)
+void lv_linux_drm_set_file(lv_display_t * disp, const char * file, int64_t connector_id)
{
- drm_dev_t * drm_dev = lv_disp_get_driver_data(disp);
+ drm_dev_t * drm_dev = lv_display_get_driver_data(disp);
int ret;
ret = drm_setup(drm_dev, file, connector_id, DRM_FOURCC);
@@ -168,14 +168,14 @@ void lv_linux_drm_set_file(lv_disp_t * disp, const char * file, int64_t connecto
uint32_t draw_buf_size = hor_res * ver_res / 4; /*1/4 screen sized buffer has the same performance */
lv_color_t * draw_buf = malloc(draw_buf_size * sizeof(lv_color_t));
- lv_disp_set_draw_buffers(disp, draw_buf, NULL, draw_buf_size, LV_DISP_RENDER_MODE_PARTIAL);
- lv_disp_set_res(disp, hor_res, ver_res);
+ lv_display_set_draw_buffers(disp, draw_buf, NULL, draw_buf_size, LV_DISPLAY_RENDER_MODE_PARTIAL);
+ lv_display_set_res(disp, hor_res, ver_res);
if(width) {
- lv_disp_set_dpi(disp, DIV_ROUND_UP(hor_res * 25400, width * 1000));
+ lv_display_set_dpi(disp, DIV_ROUND_UP(hor_res * 25400, width * 1000));
}
- LV_LOG_INFO("Resolution is set to %dx%d at %ddpi", hor_res, ver_res, lv_disp_get_dpi(disp));
+ LV_LOG_INFO("Resolution is set to %dx%d at %ddpi", hor_res, ver_res, lv_display_get_dpi(disp));
}
/**********************
@@ -827,9 +827,9 @@ static void drm_wait_vsync(drm_dev_t * drm_dev)
drm_dev->req = NULL;
}
-static void drm_flush(lv_disp_t * disp, const lv_area_t * area, lv_color_t * color_p)
+static void drm_flush(lv_display_t * disp, const lv_area_t * area, lv_color_t * color_p)
{
- drm_dev_t * drm_dev = lv_disp_get_driver_data(disp);
+ drm_dev_t * drm_dev = lv_display_get_driver_data(disp);
drm_buffer_t * fbuf = drm_dev->cur_bufs[1];
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
@@ -865,7 +865,7 @@ static void drm_flush(lv_disp_t * disp, const lv_area_t * area, lv_color_t * col
drm_dev->cur_bufs[0] = fbuf;
- lv_disp_flush_ready(disp);
+ lv_display_flush_ready(disp);
}
#endif /*LV_USE_LINUX_DRM*/
diff --git a/src/dev/disp/drm/lv_linux_drm.h b/src/dev/display/drm/lv_linux_drm.h
similarity index 77%
rename from src/dev/disp/drm/lv_linux_drm.h
rename to src/dev/display/drm/lv_linux_drm.h
index 4364146034..a75d19586f 100644
--- a/src/dev/disp/drm/lv_linux_drm.h
+++ b/src/dev/display/drm/lv_linux_drm.h
@@ -14,7 +14,7 @@ extern "C" {
* INCLUDES
*********************/
-#include "../../../disp/lv_disp.h"
+#include "../../../display/lv_display.h"
#if LV_USE_LINUX_DRM
@@ -29,9 +29,9 @@ extern "C" {
/**********************
* GLOBAL PROTOTYPES
**********************/
-lv_disp_t * lv_linux_drm_create(void);
+lv_display_t * lv_linux_drm_create(void);
-void lv_linux_drm_set_file(lv_disp_t * disp, const char * file, int64_t connector_id);
+void lv_linux_drm_set_file(lv_display_t * disp, const char * file, int64_t connector_id);
/**********************
* MACROS
diff --git a/src/dev/disp/fb/lv_linux_fbdev.c b/src/dev/display/fb/lv_linux_fbdev.c
similarity index 86%
rename from src/dev/disp/fb/lv_linux_fbdev.c
rename to src/dev/display/fb/lv_linux_fbdev.c
index 09ff2ce12a..0ba05f7ba4 100644
--- a/src/dev/disp/fb/lv_linux_fbdev.c
+++ b/src/dev/display/fb/lv_linux_fbdev.c
@@ -69,7 +69,7 @@ typedef struct {
* STATIC PROTOTYPES
**********************/
-static void flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * color_p);
+static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p);
/**********************
* STATIC VARIABLES
@@ -91,33 +91,33 @@ static void flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * color_p
* GLOBAL FUNCTIONS
**********************/
-lv_disp_t * lv_linux_fbdev_create(void)
+lv_display_t * lv_linux_fbdev_create(void)
{
lv_linux_fb_t * dsc = lv_malloc(sizeof(lv_linux_fb_t));
LV_ASSERT_MALLOC(dsc);
if(dsc == NULL) return NULL;
lv_memzero(dsc, sizeof(lv_linux_fb_t));
- lv_disp_t * disp = lv_disp_create(800, 480);
+ lv_display_t * disp = lv_display_create(800, 480);
if(disp == NULL) {
lv_free(dsc);
return NULL;
}
dsc->fbfd = -1;
- lv_disp_set_driver_data(disp, dsc);
- lv_disp_set_flush_cb(disp, flush_cb);
+ lv_display_set_driver_data(disp, dsc);
+ lv_display_set_flush_cb(disp, flush_cb);
return disp;
}
-void lv_linux_fbdev_set_file(lv_disp_t * disp, const char * file)
+void lv_linux_fbdev_set_file(lv_display_t * disp, const char * file)
{
char * devname = lv_malloc(lv_strlen(file) + 1);
LV_ASSERT_MALLOC(devname);
if(devname == NULL) return;
lv_strcpy(devname, file);
- lv_linux_fb_t * dsc = lv_disp_get_driver_data(disp);
+ lv_linux_fb_t * dsc = lv_display_get_driver_data(disp);
dsc->devname = devname;
if(dsc->fbfd > 0) close(dsc->fbfd);
@@ -209,39 +209,39 @@ void lv_linux_fbdev_set_file(lv_disp_t * disp, const char * file)
if(LV_LINUX_FBDEV_BUFFER_COUNT == 2) {
draw_buf_2 = lv_malloc(draw_buf_size);
}
- lv_disp_set_draw_buffers(disp, draw_buf, draw_buf_2, draw_buf_size, LV_LINUX_FBDEV_RENDER_MODE);
- lv_disp_set_res(disp, hor_res, ver_res);
+ lv_display_set_draw_buffers(disp, draw_buf, draw_buf_2, draw_buf_size, LV_LINUX_FBDEV_RENDER_MODE);
+ lv_display_set_resolution(disp, hor_res, ver_res);
if(width) {
- lv_disp_set_dpi(disp, DIV_ROUND_UP(hor_res * 254, width * 10));
+ lv_display_set_dpi(disp, DIV_ROUND_UP(hor_res * 254, width * 10));
}
- LV_LOG_INFO("Resolution is set to %dx%d at %ddpi", hor_res, ver_res, lv_disp_get_dpi(disp));
+ LV_LOG_INFO("Resolution is set to %dx%d at %ddpi", hor_res, ver_res, lv_display_get_dpi(disp));
}
/**********************
* STATIC FUNCTIONS
**********************/
-static void flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * color_p)
+static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p)
{
- lv_linux_fb_t * dsc = lv_disp_get_driver_data(disp);
+ lv_linux_fb_t * dsc = lv_display_get_driver_data(disp);
if(dsc->fbp == NULL ||
area->x2 < 0 || area->y2 < 0 ||
area->x1 > (int32_t)dsc->vinfo.xres - 1 || area->y1 > (int32_t)dsc->vinfo.yres - 1) {
- lv_disp_flush_ready(disp);
+ lv_display_flush_ready(disp);
return;
}
lv_coord_t w = lv_area_get_width(area);
- uint32_t px_size = lv_color_format_get_size(lv_disp_get_color_format(disp));
+ uint32_t px_size = lv_color_format_get_size(lv_display_get_color_format(disp));
uint32_t color_pos = (area->x1 + dsc->vinfo.xoffset) * px_size + area->y1 * dsc->finfo.line_length;
uint32_t fb_pos = color_pos + dsc->vinfo.yoffset * dsc->finfo.line_length;
uint8_t * fbp = (uint8_t *)dsc->fbp;
int32_t y;
- if(LV_LINUX_FBDEV_RENDER_MODE == LV_DISP_RENDER_MODE_DIRECT) {
+ if(LV_LINUX_FBDEV_RENDER_MODE == LV_DISPLAY_RENDER_MODE_DIRECT) {
for(y = area->y1; y <= area->y2; y++) {
lv_memcpy(&fbp[fb_pos], &color_p[color_pos], w * px_size);
fb_pos += dsc->finfo.line_length;
@@ -266,7 +266,7 @@ static void flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * color_p
ioctl(dsc->fbfd, FBIO_UPDATE, (unsigned long)((uintptr_t)&fb_area));
#endif
- lv_disp_flush_ready(disp);
+ lv_display_flush_ready(disp);
}
#endif /*LV_USE_LINUX_FBDEV*/
diff --git a/src/dev/disp/fb/lv_linux_fbdev.h b/src/dev/display/fb/lv_linux_fbdev.h
similarity index 79%
rename from src/dev/disp/fb/lv_linux_fbdev.h
rename to src/dev/display/fb/lv_linux_fbdev.h
index a31c6ef204..b94723c9fc 100644
--- a/src/dev/disp/fb/lv_linux_fbdev.h
+++ b/src/dev/display/fb/lv_linux_fbdev.h
@@ -14,7 +14,7 @@ extern "C" {
* INCLUDES
*********************/
-#include "../../../disp/lv_disp.h"
+#include "../../../display/lv_display.h"
#if LV_USE_LINUX_FBDEV
@@ -29,9 +29,9 @@ extern "C" {
/**********************
* GLOBAL PROTOTYPES
**********************/
-lv_disp_t * lv_linux_fbdev_create(void);
+lv_display_t * lv_linux_fbdev_create(void);
-void lv_linux_fbdev_set_file(lv_disp_t * disp, const char * file);
+void lv_linux_fbdev_set_file(lv_display_t * disp, const char * file);
/**********************
* MACROS
diff --git a/src/dev/disp/lcd/lv_nuttx_lcd.c b/src/dev/display/lcd/lv_nuttx_lcd.c
similarity index 83%
rename from src/dev/disp/lcd/lv_nuttx_lcd.c
rename to src/dev/display/lcd/lv_nuttx_lcd.c
index fe7c5eb263..50beb62226 100644
--- a/src/dev/disp/lcd/lv_nuttx_lcd.c
+++ b/src/dev/display/lcd/lv_nuttx_lcd.c
@@ -32,7 +32,7 @@
typedef struct {
int fd;
- lv_disp_t * disp;
+ lv_display_t * disp;
struct lcddev_area_s area;
struct lcddev_area_align_s align_info;
} lv_nuttx_lcd_t;
@@ -43,9 +43,9 @@ typedef struct {
static lv_coord_t align_round_up(lv_coord_t v, uint16_t align);
static void rounder_cb(lv_event_t * e);
-static void flush_cb(lv_disp_t * disp, const lv_area_t * area_p,
+static void flush_cb(lv_display_t * disp, const lv_area_t * area_p,
uint8_t * color_p);
-static lv_disp_t * lcd_init(int fd, int hor_res, int ver_res);
+static lv_display_t * lcd_init(int fd, int hor_res, int ver_res);
/**********************
* STATIC VARIABLES
@@ -59,11 +59,11 @@ static lv_disp_t * lcd_init(int fd, int hor_res, int ver_res);
* GLOBAL FUNCTIONS
**********************/
-lv_disp_t * lv_nuttx_lcd_create(const char * dev_path)
+lv_display_t * lv_nuttx_lcd_create(const char * dev_path)
{
struct fb_videoinfo_s vinfo;
struct lcd_planeinfo_s pinfo;
- lv_disp_t * disp;
+ lv_display_t * disp;
int fd;
int ret;
@@ -130,7 +130,7 @@ static void rounder_cb(lv_event_t * e)
area->y2 = area->y1 + h - 1;
}
-static void flush_cb(lv_disp_t * disp, const lv_area_t * area_p,
+static void flush_cb(lv_display_t * disp, const lv_area_t * area_p,
uint8_t * color_p)
{
lv_nuttx_lcd_t * lcd = disp->user_data;
@@ -141,10 +141,10 @@ static void flush_cb(lv_disp_t * disp, const lv_area_t * area_p,
lcd->area.col_end = area_p->x2;
lcd->area.data = (uint8_t *)color_p;
ioctl(lcd->fd, LCDDEVIO_PUTAREA, (unsigned long) & (lcd->area));
- lv_disp_flush_ready(disp);
+ lv_display_flush_ready(disp);
}
-static lv_disp_t * lcd_init(int fd, int hor_res, int ver_res)
+static lv_display_t * lcd_init(int fd, int hor_res, int ver_res)
{
lv_color_t * draw_buf = NULL;
lv_color_t * draw_buf_2 = NULL;
@@ -156,19 +156,19 @@ static lv_disp_t * lcd_init(int fd, int hor_res, int ver_res)
}
lv_memzero(lcd, sizeof(lv_nuttx_lcd_t));
- lv_disp_t * disp = lv_disp_create(hor_res, ver_res);
+ lv_display_t * disp = lv_display_create(hor_res, ver_res);
if(disp == NULL) {
lv_free(lcd);
return NULL;
}
- uint32_t px_size = lv_color_format_get_size(lv_disp_get_color_format(disp));
+ uint32_t px_size = lv_color_format_get_size(lv_display_get_color_format(disp));
#if LV_NUTTX_LCD_BUFFER_COUNT > 0
uint32_t buf_size = hor_res * ver_res * px_size;
- lv_disp_render_mode_t render_mode = LV_DISP_RENDER_MODE_FULL;
+ lv_display_render_mode_t render_mode = LV_DISPLAY_RENDER_MODE_FULL;
#else
uint32_t buf_size = hor_res * LV_NUTTX_LCD_BUFFER_SIZE * px_size;
- lv_disp_render_mode_t render_mode = LV_DISP_RENDER_MODE_PARTIAL;
+ lv_display_render_mode_t render_mode = LV_DISPLAY_RENDER_MODE_PARTIAL;
#endif
draw_buf = lv_malloc(buf_size);
@@ -194,8 +194,8 @@ static lv_disp_t * lcd_init(int fd, int hor_res, int ver_res)
}
lcd->disp = disp;
- lv_disp_set_draw_buffers(lcd->disp, draw_buf, draw_buf_2, buf_size, render_mode);
- lv_disp_set_flush_cb(lcd->disp, flush_cb);
+ lv_display_set_draw_buffers(lcd->disp, draw_buf, draw_buf_2, buf_size, render_mode);
+ lv_display_set_flush_cb(lcd->disp, flush_cb);
lv_event_add(&lcd->disp->event_list, rounder_cb, LV_EVENT_INVALIDATE_AREA, lcd);
lcd->disp->user_data = lcd;
diff --git a/src/dev/disp/lcd/lv_nuttx_lcd.h b/src/dev/display/lcd/lv_nuttx_lcd.h
similarity index 85%
rename from src/dev/disp/lcd/lv_nuttx_lcd.h
rename to src/dev/display/lcd/lv_nuttx_lcd.h
index 685e861642..1e4f1b72a8 100644
--- a/src/dev/disp/lcd/lv_nuttx_lcd.h
+++ b/src/dev/display/lcd/lv_nuttx_lcd.h
@@ -14,7 +14,7 @@ extern "C" {
* INCLUDES
*********************/
-#include "../../../disp/lv_disp.h"
+#include "../../../display/lv_display.h"
#if LV_USE_NUTTX_LCD
@@ -30,7 +30,7 @@ extern "C" {
* GLOBAL PROTOTYPES
**********************/
-lv_disp_t * lv_nuttx_lcd_create(const char * dev_path);
+lv_display_t * lv_nuttx_lcd_create(const char * dev_path);
/**********************
* MACROS
diff --git a/src/dev/disp/tft_espi/lv_tft_espi.cpp b/src/dev/display/tft_espi/lv_tft_espi.cpp
similarity index 100%
rename from src/dev/disp/tft_espi/lv_tft_espi.cpp
rename to src/dev/display/tft_espi/lv_tft_espi.cpp
diff --git a/src/dev/disp/tft_espi/lv_tft_espi.h b/src/dev/display/tft_espi/lv_tft_espi.h
similarity index 79%
rename from src/dev/disp/tft_espi/lv_tft_espi.h
rename to src/dev/display/tft_espi/lv_tft_espi.h
index cd3eeb6fec..1010575652 100644
--- a/src/dev/disp/tft_espi/lv_tft_espi.h
+++ b/src/dev/display/tft_espi/lv_tft_espi.h
@@ -13,7 +13,7 @@ extern "C" {
/*********************
* INCLUDES
*********************/
-#include "../../../disp/lv_disp.h"
+#include "../../../display/lv_display.h"
#if LV_USE_TFT_ESPI
@@ -28,7 +28,7 @@ extern "C" {
/**********************
* GLOBAL PROTOTYPES
**********************/
-lv_disp_t * lv_tft_espi_create(uint32_t hor_res, uint32_t ver_res, void * buf, uint32_t buf_size_bytes);
+lv_display_t * lv_tft_espi_create(uint32_t hor_res, uint32_t ver_res, void * buf, uint32_t buf_size_bytes);
/**********************
* MACROS
diff --git a/src/dev/input/touchscreen/lv_nuttx_touchscreen.c b/src/dev/input/touchscreen/lv_nuttx_touchscreen.c
index 61c7f2ee0d..19ac1bf73d 100644
--- a/src/dev/input/touchscreen/lv_nuttx_touchscreen.c
+++ b/src/dev/input/touchscreen/lv_nuttx_touchscreen.c
@@ -96,7 +96,7 @@ static void touchscreen_read(lv_indev_t * drv, lv_indev_data_t * data)
uint8_t touch_flags = sample.point[0].flags;
if(touch_flags & TOUCH_DOWN || touch_flags & TOUCH_MOVE) {
- const lv_disp_t * disp_drv = drv->disp;
+ const lv_display_t * disp_drv = drv->disp;
lv_coord_t ver_max = disp_drv->ver_res - 1;
lv_coord_t hor_max = disp_drv->hor_res - 1;
diff --git a/src/dev/sdl/lv_sdl_keyboard.c b/src/dev/sdl/lv_sdl_keyboard.c
index 6563606ba0..a7574130d6 100644
--- a/src/dev/sdl/lv_sdl_keyboard.c
+++ b/src/dev/sdl/lv_sdl_keyboard.c
@@ -101,7 +101,7 @@ void _lv_sdl_keyboard_handler(SDL_Event * event)
return;
}
- lv_disp_t * disp = _lv_sdl_get_disp_from_win_id(win_id);
+ lv_display_t * disp = _lv_sdl_get_disp_from_win_id(win_id);
/*Find a suitable indev*/
lv_indev_t * indev = lv_indev_get_next(NULL);
diff --git a/src/dev/sdl/lv_sdl_mouse.c b/src/dev/sdl/lv_sdl_mouse.c
index 73b4050491..6e43547f34 100644
--- a/src/dev/sdl/lv_sdl_mouse.c
+++ b/src/dev/sdl/lv_sdl_mouse.c
@@ -99,7 +99,7 @@ void _lv_sdl_mouse_handler(SDL_Event * event)
return;
}
- lv_disp_t * disp = _lv_sdl_get_disp_from_win_id(win_id);
+ lv_display_t * disp = _lv_sdl_get_disp_from_win_id(win_id);
/*Find a suitable indev*/
lv_indev_t * indev = lv_indev_get_next(NULL);
@@ -114,8 +114,8 @@ void _lv_sdl_mouse_handler(SDL_Event * event)
lv_sdl_mouse_t * indev_dev = lv_indev_get_driver_data(indev);
if(indev_dev == NULL) return;
- lv_coord_t hor_res = lv_disp_get_hor_res(disp);
- lv_coord_t ver_res = lv_disp_get_ver_res(disp);
+ lv_coord_t hor_res = lv_display_get_horizontal_resolution(disp);
+ lv_coord_t ver_res = lv_display_get_vertical_resolution(disp);
uint8_t zoom = lv_sdl_window_get_zoom(disp);
switch(event->type) {
diff --git a/src/dev/sdl/lv_sdl_mousewheel.c b/src/dev/sdl/lv_sdl_mousewheel.c
index 86797c601c..822b8d1b3a 100644
--- a/src/dev/sdl/lv_sdl_mousewheel.c
+++ b/src/dev/sdl/lv_sdl_mousewheel.c
@@ -84,7 +84,7 @@ void _lv_sdl_mousewheel_handler(SDL_Event * event)
return;
}
- lv_disp_t * disp = _lv_sdl_get_disp_from_win_id(win_id);
+ lv_display_t * disp = _lv_sdl_get_disp_from_win_id(win_id);
/*Find a suitable indev*/
lv_indev_t * indev = lv_indev_get_next(NULL);
diff --git a/src/dev/sdl/lv_sdl_window.c b/src/dev/sdl/lv_sdl_window.c
index 8c4864403c..d0971f3dd5 100644
--- a/src/dev/sdl/lv_sdl_window.c
+++ b/src/dev/sdl/lv_sdl_window.c
@@ -36,18 +36,18 @@ typedef struct {
/**********************
* STATIC PROTOTYPES
**********************/
-static void flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * color_p);
-static void window_create(lv_disp_t * disp);
-static void window_update(lv_disp_t * disp);
-static void clean_up(lv_disp_t * disp);
-static void texture_resize(lv_disp_t * disp);
+static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p);
+static void window_create(lv_display_t * disp);
+static void window_update(lv_display_t * disp);
+static void clean_up(lv_display_t * disp);
+static void texture_resize(lv_display_t * disp);
static void sdl_event_handler(lv_timer_t * t);
static void release_disp_cb(lv_event_t * e);
/***********************
* GLOBAL PROTOTYPES
***********************/
-lv_disp_t * _lv_sdl_get_disp_from_win_id(uint32_t win_id);
+lv_display_t * _lv_sdl_get_disp_from_win_id(uint32_t win_id);
void _lv_sdl_mouse_handler(SDL_Event * event);
void _lv_sdl_mousewheel_handler(SDL_Event * event);
void _lv_sdl_keyboard_handler(SDL_Event * event);
@@ -68,7 +68,7 @@ static lv_timer_t * event_handler_timer;
* GLOBAL FUNCTIONS
**********************/
-lv_disp_t * lv_sdl_window_create(lv_coord_t hor_res, lv_coord_t ver_res)
+lv_display_t * lv_sdl_window_create(lv_coord_t hor_res, lv_coord_t ver_res)
{
if(!inited) {
SDL_Init(SDL_INIT_VIDEO);
@@ -83,67 +83,69 @@ lv_disp_t * lv_sdl_window_create(lv_coord_t hor_res, lv_coord_t ver_res)
if(dsc == NULL) return NULL;
lv_memzero(dsc, sizeof(lv_sdl_window_t));
- lv_disp_t * disp = lv_disp_create(hor_res, ver_res);
+ lv_display_t * disp = lv_display_create(hor_res, ver_res);
if(disp == NULL) {
lv_free(dsc);
return NULL;
}
- lv_disp_add_event(disp, release_disp_cb, LV_EVENT_DELETE, disp);
- lv_disp_set_driver_data(disp, dsc);
+ lv_display_add_event(disp, release_disp_cb, LV_EVENT_DELETE, disp);
+ lv_display_set_driver_data(disp, dsc);
window_create(disp);
- lv_disp_set_flush_cb(disp, flush_cb);
- if(LV_SDL_RENDER_MODE == LV_DISP_RENDER_MODE_PARTIAL) {
+ lv_display_set_flush_cb(disp, flush_cb);
+ if(LV_SDL_RENDER_MODE == LV_DISPLAY_RENDER_MODE_PARTIAL) {
uint8_t * buf1 = malloc(32 * 1024);
uint8_t * buf2 = NULL;
#if LV_SDL_BUF_COUNT == 2
buf2 = malloc(32 * 1024);
#endif
- lv_disp_set_draw_buffers(disp, buf1, buf2,
- 32 * 1024, LV_DISP_RENDER_MODE_PARTIAL);
+ lv_display_set_draw_buffers(disp, buf1, buf2,
+ 32 * 1024, LV_DISPLAY_RENDER_MODE_PARTIAL);
}
- /*LV_DISP_RENDER_MODE_DIRECT or FULL */
+ /*LV_DISPLAY_RENDER_MODE_DIRECT or FULL */
else {
- uint32_t stride = lv_draw_buf_width_to_stride(lv_disp_get_hor_res(disp), lv_disp_get_color_format(disp));
- lv_disp_set_draw_buffers(disp, dsc->fb1, dsc->fb2, stride * lv_disp_get_ver_res(disp), LV_SDL_RENDER_MODE);
+ uint32_t stride = lv_draw_buf_width_to_stride(lv_display_get_horizontal_resolution(disp),
+ lv_display_get_color_format(disp));
+ lv_display_set_draw_buffers(disp, dsc->fb1, dsc->fb2, stride * lv_display_get_vertical_resolution(disp),
+ LV_SDL_RENDER_MODE);
}
- lv_disp_add_event(disp, res_chg_event_cb, LV_EVENT_RESOLUTION_CHANGED, NULL);
+ lv_display_add_event(disp, res_chg_event_cb, LV_EVENT_RESOLUTION_CHANGED, NULL);
return disp;
}
-void lv_sdl_window_set_zoom(lv_disp_t * disp, uint8_t zoom)
+void lv_sdl_window_set_zoom(lv_display_t * disp, uint8_t zoom)
{
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
dsc->zoom = zoom;
- lv_disp_send_event(disp, LV_EVENT_RESOLUTION_CHANGED, NULL);
+ lv_display_send_event(disp, LV_EVENT_RESOLUTION_CHANGED, NULL);
lv_refr_now(disp);
}
-uint8_t lv_sdl_window_get_zoom(lv_disp_t * disp)
+uint8_t lv_sdl_window_get_zoom(lv_display_t * disp)
{
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
return dsc->zoom;
}
-lv_disp_t * _lv_sdl_get_disp_from_win_id(uint32_t win_id)
+lv_display_t * _lv_sdl_get_disp_from_win_id(uint32_t win_id)
{
- lv_disp_t * disp = lv_disp_get_next(NULL);
+ lv_display_t * disp = lv_display_get_next(NULL);
if(win_id == UINT32_MAX) return disp;
while(disp) {
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
if(SDL_GetWindowID(dsc->window) == win_id) {
return disp;
}
- disp = lv_disp_get_next(disp);
+ disp = lv_display_get_next(disp);
}
return NULL;
}
-void lv_sdl_window_set_title(lv_disp_t * disp, const char * title)
+void lv_sdl_window_set_title(lv_display_t * disp, const char * title)
{
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
SDL_SetWindowTitle(dsc->window, title);
}
@@ -161,15 +163,15 @@ void lv_sdl_quit()
**********************/
-static void flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * px_map)
+static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map)
{
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
- if(LV_SDL_RENDER_MODE == LV_DISP_RENDER_MODE_PARTIAL) {
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
+ if(LV_SDL_RENDER_MODE == LV_DISPLAY_RENDER_MODE_PARTIAL) {
int32_t y;
uint8_t * fb_tmp = dsc->fb_act;
- uint32_t px_size = lv_color_format_get_size(lv_disp_get_color_format(disp));
+ uint32_t px_size = lv_color_format_get_size(lv_display_get_color_format(disp));
uint32_t px_map_stride = lv_area_get_width(area) * px_size;
- lv_coord_t fb_stride = lv_disp_get_hor_res(disp) * px_size;
+ lv_coord_t fb_stride = lv_display_get_horizontal_resolution(disp) * px_size;
fb_tmp += area->y1 * fb_stride;
fb_tmp += area->x1 * px_size;
for(y = area->y1; y <= area->y2; y++) {
@@ -181,15 +183,15 @@ static void flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * px_map)
/* TYPICALLY YOU DO NOT NEED THIS
* If it was the last part to refresh update the texture of the window.*/
- if(lv_disp_flush_is_last(disp)) {
- if(LV_SDL_RENDER_MODE != LV_DISP_RENDER_MODE_PARTIAL) {
+ if(lv_display_flush_is_last(disp)) {
+ if(LV_SDL_RENDER_MODE != LV_DISPLAY_RENDER_MODE_PARTIAL) {
dsc->fb_act = px_map;
}
window_update(disp);
}
/*IMPORTANT! It must be called to tell the system the flush is ready*/
- lv_disp_flush_ready(disp);
+ lv_display_flush_ready(disp);
}
/**
@@ -208,9 +210,9 @@ static void sdl_event_handler(lv_timer_t * t)
_lv_sdl_keyboard_handler(&event);
if(event.type == SDL_WINDOWEVENT) {
- lv_disp_t * disp = _lv_sdl_get_disp_from_win_id(event.window.windowID);
+ lv_display_t * disp = _lv_sdl_get_disp_from_win_id(event.window.windowID);
if(disp == NULL) continue;
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
switch(event.window.event) {
#if SDL_VERSION_ATLEAST(2, 0, 5)
@@ -221,7 +223,7 @@ static void sdl_event_handler(lv_timer_t * t)
break;
case SDL_WINDOWEVENT_RESIZED:
dsc->ignore_size_chg = 1;
- lv_disp_set_res(disp, event.window.data1 / dsc->zoom, event.window.data2 / dsc->zoom);
+ lv_display_set_resolution(disp, event.window.data1 / dsc->zoom, event.window.data2 / dsc->zoom);
dsc->ignore_size_chg = 0;
lv_refr_now(disp);
break;
@@ -243,9 +245,9 @@ static void sdl_event_handler(lv_timer_t * t)
}
}
-static void clean_up(lv_disp_t * disp)
+static void clean_up(lv_display_t * disp)
{
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
SDL_DestroyTexture(dsc->texture);
SDL_DestroyRenderer(dsc->renderer);
SDL_DestroyWindow(dsc->window);
@@ -253,9 +255,9 @@ static void clean_up(lv_disp_t * disp)
lv_free(dsc);
}
-static void window_create(lv_disp_t * disp)
+static void window_create(lv_display_t * disp)
{
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
dsc->zoom = 1;
int flag = SDL_WINDOW_RESIZABLE;
@@ -263,15 +265,15 @@ static void window_create(lv_disp_t * disp)
flag |= SDL_WINDOW_FULLSCREEN;
#endif
- lv_coord_t hor_res = lv_disp_get_hor_res(disp);
- lv_coord_t ver_res = lv_disp_get_ver_res(disp);
+ lv_coord_t hor_res = lv_display_get_horizontal_resolution(disp);
+ lv_coord_t ver_res = lv_display_get_vertical_resolution(disp);
dsc->window = SDL_CreateWindow("LVGL Simulator",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
hor_res * dsc->zoom, ver_res * dsc->zoom, flag); /*last param. SDL_WINDOW_BORDERLESS to hide borders*/
dsc->renderer = SDL_CreateRenderer(dsc->window, -1, SDL_RENDERER_SOFTWARE);
texture_resize(disp);
- uint32_t px_size = lv_color_format_get_size(lv_disp_get_color_format(disp));
+ uint32_t px_size = lv_color_format_get_size(lv_display_get_color_format(disp));
lv_memset(dsc->fb1, 0xff, hor_res * ver_res * px_size);
#if LV_SDL_DIRECT_MODE_2_BUF
lv_memset(dsc->fb2, 0xff, hor_res * ver_res * px_size);
@@ -281,11 +283,11 @@ static void window_create(lv_disp_t * disp)
texture_resize(disp);
}
-static void window_update(lv_disp_t * disp)
+static void window_update(lv_display_t * disp)
{
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
- lv_coord_t hor_res = lv_disp_get_hor_res(disp);
- uint32_t stride = lv_draw_buf_width_to_stride(hor_res, lv_disp_get_color_format(disp));
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
+ lv_coord_t hor_res = lv_display_get_horizontal_resolution(disp);
+ uint32_t stride = lv_draw_buf_width_to_stride(hor_res, lv_display_get_color_format(disp));
SDL_UpdateTexture(dsc->texture, NULL, dsc->fb_act, stride);
SDL_RenderClear(dsc->renderer);
@@ -295,17 +297,17 @@ static void window_update(lv_disp_t * disp)
SDL_RenderPresent(dsc->renderer);
}
-static void texture_resize(lv_disp_t * disp)
+static void texture_resize(lv_display_t * disp)
{
- lv_coord_t hor_res = lv_disp_get_hor_res(disp);
- lv_coord_t ver_res = lv_disp_get_ver_res(disp);
- uint32_t stride = lv_draw_buf_width_to_stride(hor_res, lv_disp_get_color_format(disp));
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
+ lv_coord_t hor_res = lv_display_get_horizontal_resolution(disp);
+ lv_coord_t ver_res = lv_display_get_vertical_resolution(disp);
+ uint32_t stride = lv_draw_buf_width_to_stride(hor_res, lv_display_get_color_format(disp));
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
dsc->fb1 = realloc(dsc->fb1, stride * ver_res);
memset(dsc->fb1, 0x00, stride * ver_res);
- if(LV_SDL_RENDER_MODE == LV_DISP_RENDER_MODE_PARTIAL) {
+ if(LV_SDL_RENDER_MODE == LV_DISPLAY_RENDER_MODE_PARTIAL) {
dsc->fb_act = dsc->fb1;
}
else {
@@ -313,7 +315,7 @@ static void texture_resize(lv_disp_t * disp)
dsc->fb2 = realloc(dsc->fb2, stride * ver_res);
memset(dsc->fb2, 0x00, stride * ver_res);
#endif
- lv_disp_set_draw_buffers(disp, dsc->fb1, dsc->fb2, stride * ver_res, LV_SDL_RENDER_MODE);
+ lv_display_set_draw_buffers(disp, dsc->fb1, dsc->fb2, stride * ver_res, LV_SDL_RENDER_MODE);
}
if(dsc->texture) SDL_DestroyTexture(dsc->texture);
@@ -335,11 +337,11 @@ static void texture_resize(lv_disp_t * disp)
static void res_chg_event_cb(lv_event_t * e)
{
- lv_disp_t * disp = lv_event_get_target(e);
+ lv_display_t * disp = lv_event_get_target(e);
- int32_t hor_res = lv_disp_get_hor_res(disp);
- int32_t ver_res = lv_disp_get_ver_res(disp);
- lv_sdl_window_t * dsc = lv_disp_get_driver_data(disp);
+ int32_t hor_res = lv_display_get_horizontal_resolution(disp);
+ int32_t ver_res = lv_display_get_vertical_resolution(disp);
+ lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
if(dsc->ignore_size_chg == false) {
SDL_SetWindowSize(dsc->window, hor_res * dsc->zoom, ver_res * dsc->zoom);
}
@@ -349,7 +351,7 @@ static void res_chg_event_cb(lv_event_t * e)
static void release_disp_cb(lv_event_t * e)
{
- lv_disp_t * disp = (lv_disp_t *) lv_event_get_user_data(e);
+ lv_display_t * disp = (lv_display_t *) lv_event_get_user_data(e);
clean_up(disp);
}
diff --git a/src/dev/sdl/lv_sdl_window.h b/src/dev/sdl/lv_sdl_window.h
index b3acd0343a..387e2ec3cb 100644
--- a/src/dev/sdl/lv_sdl_window.h
+++ b/src/dev/sdl/lv_sdl_window.h
@@ -14,7 +14,7 @@ extern "C" {
* INCLUDES
*********************/
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../../indev/lv_indev.h"
#if LV_USE_SDL
@@ -31,15 +31,15 @@ extern "C" {
* GLOBAL PROTOTYPES
**********************/
-lv_disp_t * lv_sdl_window_create(lv_coord_t hor_res, lv_coord_t ver_res);
+lv_display_t * lv_sdl_window_create(lv_coord_t hor_res, lv_coord_t ver_res);
-void lv_sdl_window_set_zoom(lv_disp_t * disp, uint8_t zoom);
+void lv_sdl_window_set_zoom(lv_display_t * disp, uint8_t zoom);
-uint8_t lv_sdl_window_get_zoom(lv_disp_t * disp);
+uint8_t lv_sdl_window_get_zoom(lv_display_t * disp);
-lv_disp_t * _lv_sdl_get_disp_from_win_id(uint32_t win_id);
+lv_display_t * _lv_sdl_get_disp_from_win_id(uint32_t win_id);
-void lv_sdl_window_set_title(lv_disp_t * disp, const char * title);
+void lv_sdl_window_set_title(lv_display_t * disp, const char * title);
void lv_sdl_quit();
diff --git a/src/disp/lv_disp.c b/src/display/lv_display.c
similarity index 67%
rename from src/disp/lv_disp.c
rename to src/display/lv_display.c
index ddd02cda50..2fd9de8edc 100644
--- a/src/disp/lv_disp.c
+++ b/src/display/lv_display.c
@@ -6,10 +6,10 @@
/*********************
* INCLUDES
*********************/
-#include "lv_disp.h"
+#include "lv_display.h"
#include "../misc/lv_math.h"
#include "../core/lv_refr.h"
-#include "../disp/lv_disp_private.h"
+#include "../display/lv_display_private.h"
#include "../stdlib/lv_string.h"
#include "../themes/lv_theme.h"
#include "../core/lv_global.h"
@@ -33,7 +33,7 @@
* STATIC PROTOTYPES
**********************/
static lv_obj_tree_walk_res_t invalidate_layout_cb(lv_obj_t * obj, void * user_data);
-static void update_resolution(lv_disp_t * disp);
+static void update_resolution(lv_display_t * disp);
static void scr_load_internal(lv_obj_t * scr);
static void scr_load_anim_start(lv_anim_t * a);
static void opa_scale_anim(void * obj, int32_t v);
@@ -55,13 +55,13 @@ static void disp_event_cb(lv_event_t * e);
* GLOBAL FUNCTIONS
**********************/
-lv_disp_t * lv_disp_create(lv_coord_t hor_res, lv_coord_t ver_res)
+lv_display_t * lv_display_create(lv_coord_t hor_res, lv_coord_t ver_res)
{
- lv_disp_t * disp = _lv_ll_ins_head(disp_ll_p);
+ lv_display_t * disp = _lv_ll_ins_head(disp_ll_p);
LV_ASSERT_MALLOC(disp);
if(!disp) return NULL;
- lv_memzero(disp, sizeof(lv_disp_t));
+ lv_memzero(disp, sizeof(lv_display_t));
disp->hor_res = hor_res;
disp->ver_res = ver_res;
@@ -84,11 +84,11 @@ lv_disp_t * lv_disp_create(lv_coord_t hor_res, lv_coord_t ver_res)
disp->inv_en_cnt = 1;
- lv_disp_t * disp_def_tmp = disp_def;
+ lv_display_t * disp_def_tmp = disp_def;
disp_def = disp; /*Temporarily change the default screen to create the default screens on the
new display*/
/*Create a refresh timer*/
- disp->refr_timer = lv_timer_create(_lv_disp_refr_timer, LV_DEF_REFR_PERIOD, disp);
+ disp->refr_timer = lv_timer_create(_lv_display_refr_timer, LV_DEF_REFR_PERIOD, disp);
LV_ASSERT_MALLOC(disp->refr_timer);
if(disp->refr_timer == NULL) {
lv_free(disp);
@@ -124,7 +124,7 @@ lv_disp_t * lv_disp_create(lv_coord_t hor_res, lv_coord_t ver_res)
disp_def = disp_def_tmp; /*Revert the default display*/
if(disp_def == NULL) disp_def = disp; /*Initialize the default display*/
- lv_disp_add_event(disp, disp_event_cb, LV_EVENT_REFR_REQUEST, NULL);
+ lv_display_add_event(disp, disp_event_cb, LV_EVENT_REFR_REQUEST, NULL);
lv_timer_ready(disp->refr_timer); /*Be sure the screen will be refreshed immediately on start up*/
@@ -132,12 +132,12 @@ lv_disp_t * lv_disp_create(lv_coord_t hor_res, lv_coord_t ver_res)
}
-void lv_disp_remove(lv_disp_t * disp)
+void lv_display_remove(lv_display_t * disp)
{
bool was_default = false;
- if(disp == lv_disp_get_default()) was_default = true;
+ if(disp == lv_display_get_default()) was_default = true;
- lv_disp_send_event(disp, LV_EVENT_DELETE, NULL);
+ lv_display_send_event(disp, LV_EVENT_DELETE, NULL);
lv_event_remove_all(&(disp->event_list));
/*Detach the input devices*/
@@ -173,20 +173,20 @@ void lv_disp_remove(lv_disp_t * disp)
if(disp->refr_timer) lv_timer_del(disp->refr_timer);
lv_free(disp);
- if(was_default) lv_disp_set_default(_lv_ll_get_head(disp_ll_p));
+ if(was_default) lv_display_set_default(_lv_ll_get_head(disp_ll_p));
}
-void lv_disp_set_default(lv_disp_t * disp)
+void lv_display_set_default(lv_display_t * disp)
{
disp_def = disp;
}
-lv_disp_t * lv_disp_get_default(void)
+lv_display_t * lv_display_get_default(void)
{
return disp_def;
}
-lv_disp_t * lv_disp_get_next(lv_disp_t * disp)
+lv_display_t * lv_display_get_next(lv_display_t * disp)
{
if(disp == NULL)
return _lv_ll_get_head(disp_ll_p);
@@ -198,9 +198,9 @@ lv_disp_t * lv_disp_get_next(lv_disp_t * disp)
* RESOLUTION
*--------------------*/
-void lv_disp_set_res(lv_disp_t * disp, lv_coord_t hor_res, lv_coord_t ver_res)
+void lv_display_set_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord_t ver_res)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
if(disp->hor_res == hor_res && disp->ver_res == ver_res) return;
@@ -211,9 +211,9 @@ void lv_disp_set_res(lv_disp_t * disp, lv_coord_t hor_res, lv_coord_t ver_res)
update_resolution(disp);
}
-void lv_disp_set_physical_res(lv_disp_t * disp, lv_coord_t hor_res, lv_coord_t ver_res)
+void lv_display_set_physical_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord_t ver_res)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
disp->physical_hor_res = hor_res;
@@ -223,9 +223,9 @@ void lv_disp_set_physical_res(lv_disp_t * disp, lv_coord_t hor_res, lv_coord_t v
}
-void lv_disp_set_offset(lv_disp_t * disp, lv_coord_t x, lv_coord_t y)
+void lv_display_set_offset(lv_display_t * disp, lv_coord_t x, lv_coord_t y)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
disp->offset_x = x;
@@ -235,25 +235,25 @@ void lv_disp_set_offset(lv_disp_t * disp, lv_coord_t x, lv_coord_t y)
}
-void lv_disp_set_dpi(lv_disp_t * disp, lv_coord_t dpi)
+void lv_display_set_dpi(lv_display_t * disp, lv_coord_t dpi)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
disp->dpi = dpi;
}
-lv_coord_t lv_disp_get_hor_res(const lv_disp_t * disp)
+lv_coord_t lv_display_get_horizontal_resolution(const lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) {
return 0;
}
else {
switch(disp->rotation) {
- case LV_DISP_ROTATION_90:
- case LV_DISP_ROTATION_270:
+ case LV_DISPLAY_ROTATION_90:
+ case LV_DISPLAY_ROTATION_270:
return disp->ver_res;
default:
return disp->hor_res;
@@ -261,17 +261,17 @@ lv_coord_t lv_disp_get_hor_res(const lv_disp_t * disp)
}
}
-lv_coord_t lv_disp_get_ver_res(const lv_disp_t * disp)
+lv_coord_t lv_display_get_vertical_resolution(const lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) {
return 0;
}
else {
switch(disp->rotation) {
- case LV_DISP_ROTATION_90:
- case LV_DISP_ROTATION_270:
+ case LV_DISPLAY_ROTATION_90:
+ case LV_DISPLAY_ROTATION_270:
return disp->hor_res;
default:
return disp->ver_res;
@@ -279,17 +279,17 @@ lv_coord_t lv_disp_get_ver_res(const lv_disp_t * disp)
}
}
-lv_coord_t lv_disp_get_physical_hor_res(const lv_disp_t * disp)
+lv_coord_t lv_display_get_physical_horizontal_resolution(const lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) {
return 0;
}
else {
switch(disp->rotation) {
- case LV_DISP_ROTATION_90:
- case LV_DISP_ROTATION_270:
+ case LV_DISPLAY_ROTATION_90:
+ case LV_DISPLAY_ROTATION_270:
return disp->physical_ver_res > 0 ? disp->physical_ver_res : disp->ver_res;
default:
return disp->physical_hor_res > 0 ? disp->physical_hor_res : disp->hor_res;
@@ -297,17 +297,17 @@ lv_coord_t lv_disp_get_physical_hor_res(const lv_disp_t * disp)
}
}
-lv_coord_t lv_disp_get_physical_ver_res(const lv_disp_t * disp)
+lv_coord_t lv_display_get_physical_vertical_resolution(const lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) {
return 0;
}
else {
switch(disp->rotation) {
- case LV_DISP_ROTATION_90:
- case LV_DISP_ROTATION_270:
+ case LV_DISPLAY_ROTATION_90:
+ case LV_DISPLAY_ROTATION_270:
return disp->physical_hor_res > 0 ? disp->physical_hor_res : disp->hor_res;
default:
return disp->physical_ver_res > 0 ? disp->physical_ver_res : disp->ver_res;
@@ -315,51 +315,51 @@ lv_coord_t lv_disp_get_physical_ver_res(const lv_disp_t * disp)
}
}
-lv_coord_t lv_disp_get_offset_x(const lv_disp_t * disp)
+lv_coord_t lv_display_get_offset_x(const lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) {
return 0;
}
else {
switch(disp->rotation) {
- case LV_DISP_ROTATION_90:
+ case LV_DISPLAY_ROTATION_90:
return disp->offset_y;
- case LV_DISP_ROTATION_180:
- return lv_disp_get_physical_hor_res(disp) - disp->offset_x;
- case LV_DISP_ROTATION_270:
- return lv_disp_get_physical_hor_res(disp) - disp->offset_y;
+ case LV_DISPLAY_ROTATION_180:
+ return lv_display_get_physical_horizontal_resolution(disp) - disp->offset_x;
+ case LV_DISPLAY_ROTATION_270:
+ return lv_display_get_physical_horizontal_resolution(disp) - disp->offset_y;
default:
return disp->offset_x;
}
}
}
-lv_coord_t lv_disp_get_offset_y(const lv_disp_t * disp)
+lv_coord_t lv_display_get_offset_y(const lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) {
return 0;
}
else {
switch(disp->rotation) {
- case LV_DISP_ROTATION_90:
+ case LV_DISPLAY_ROTATION_90:
return disp->offset_x;
- case LV_DISP_ROTATION_180:
- return lv_disp_get_physical_ver_res(disp) - disp->offset_y;
- case LV_DISP_ROTATION_270:
- return lv_disp_get_physical_ver_res(disp) - disp->offset_x;
+ case LV_DISPLAY_ROTATION_180:
+ return lv_display_get_physical_vertical_resolution(disp) - disp->offset_y;
+ case LV_DISPLAY_ROTATION_270:
+ return lv_display_get_physical_vertical_resolution(disp) - disp->offset_x;
default:
return disp->offset_y;
}
}
}
-lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp)
+lv_coord_t lv_display_get_dpi(const lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return LV_DPI_DEF; /*Do not return 0 because it might be a divider*/
return disp->dpi;
}
@@ -368,10 +368,10 @@ lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp)
* BUFFERING
*--------------------*/
-void lv_disp_set_draw_buffers(lv_disp_t * disp, void * buf1, void * buf2, uint32_t buf_size_in_bytes,
- lv_disp_render_mode_t render_mode)
+void lv_display_set_draw_buffers(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size_in_bytes,
+ lv_display_render_mode_t render_mode)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
disp->buf_1 = buf1;
@@ -381,60 +381,60 @@ void lv_disp_set_draw_buffers(lv_disp_t * disp, void * buf1, void * buf2, uint32
disp->render_mode = render_mode;
}
-void lv_disp_set_flush_cb(lv_disp_t * disp, lv_disp_flush_cb_t flush_cb)
+void lv_display_set_flush_cb(lv_display_t * disp, lv_display_flush_cb_t flush_cb)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
disp->flush_cb = flush_cb;
}
-void lv_disp_set_color_format(lv_disp_t * disp, lv_color_format_t color_format)
+void lv_display_set_color_format(lv_display_t * disp, lv_color_format_t color_format)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
disp->color_format = color_format;
disp->layer_head->draw_buf.color_format = color_format;
}
-lv_color_format_t lv_disp_get_color_format(lv_disp_t * disp)
+lv_color_format_t lv_display_get_color_format(lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return LV_COLOR_FORMAT_UNKNOWN;
return disp->color_format;
}
-void lv_disp_set_antialiasing(lv_disp_t * disp, bool en)
+void lv_display_set_antialiasing(lv_display_t * disp, bool en)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
disp->antialiasing = en;
}
-bool lv_disp_get_antialiasing(lv_disp_t * disp)
+bool lv_display_get_antialiasing(lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return false;
return disp->antialiasing;
}
-LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_t * disp)
+LV_ATTRIBUTE_FLUSH_READY void lv_display_flush_ready(lv_display_t * disp)
{
disp->flushing = 0;
disp->flushing_last = 0;
}
-LV_ATTRIBUTE_FLUSH_READY bool lv_disp_flush_is_last(lv_disp_t * disp)
+LV_ATTRIBUTE_FLUSH_READY bool lv_display_flush_is_last(lv_display_t * disp)
{
return disp->flushing_last;
}
-bool lv_disp_is_double_buffered(lv_disp_t * disp)
+bool lv_display_is_double_buffered(lv_display_t * disp)
{
return disp->buf_2 != NULL;
}
@@ -443,9 +443,9 @@ bool lv_disp_is_double_buffered(lv_disp_t * disp)
* SCREENS
*--------------------*/
-lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp)
+lv_obj_t * lv_display_get_scr_act(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) {
LV_LOG_WARN("no display registered to get its active screen");
return NULL;
@@ -454,9 +454,9 @@ lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp)
return disp->act_scr;
}
-lv_obj_t * lv_disp_get_scr_prev(lv_disp_t * disp)
+lv_obj_t * lv_display_get_scr_prev(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) {
LV_LOG_WARN("no display registered to get its previous screen");
return NULL;
@@ -465,14 +465,14 @@ lv_obj_t * lv_disp_get_scr_prev(lv_disp_t * disp)
return disp->prev_scr;
}
-void lv_disp_load_scr(lv_obj_t * scr)
+void lv_display_load_scr(lv_obj_t * scr)
{
lv_scr_load_anim(scr, LV_SCR_LOAD_ANIM_NONE, 0, 0, false);
}
-lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp)
+lv_obj_t * lv_display_get_layer_top(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) {
LV_LOG_WARN("lv_layer_top: no display registered to get its top layer");
return NULL;
@@ -481,9 +481,9 @@ lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp)
return disp->top_layer;
}
-lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp)
+lv_obj_t * lv_display_get_layer_sys(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) {
LV_LOG_WARN("lv_layer_sys: no display registered to get its sys. layer");
return NULL;
@@ -492,9 +492,9 @@ lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp)
return disp->sys_layer;
}
-lv_obj_t * lv_disp_get_layer_bottom(lv_disp_t * disp)
+lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) {
LV_LOG_WARN("lv_layer_bottom: no display registered to get its bottom layer");
return NULL;
@@ -505,7 +505,7 @@ lv_obj_t * lv_disp_get_layer_bottom(lv_disp_t * disp)
void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t time, uint32_t delay, bool auto_del)
{
- lv_disp_t * d = lv_obj_get_disp(new_scr);
+ lv_display_t * d = lv_obj_get_disp(new_scr);
lv_obj_t * act_scr = lv_scr_act();
if(act_scr == new_scr || d->scr_to_load == new_scr) {
@@ -578,47 +578,47 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
break;
case LV_SCR_LOAD_ANIM_OVER_LEFT:
lv_anim_set_exec_cb(&a_new, set_x_anim);
- lv_anim_set_values(&a_new, lv_disp_get_hor_res(d), 0);
+ lv_anim_set_values(&a_new, lv_display_get_horizontal_resolution(d), 0);
break;
case LV_SCR_LOAD_ANIM_OVER_RIGHT:
lv_anim_set_exec_cb(&a_new, set_x_anim);
- lv_anim_set_values(&a_new, -lv_disp_get_hor_res(d), 0);
+ lv_anim_set_values(&a_new, -lv_display_get_horizontal_resolution(d), 0);
break;
case LV_SCR_LOAD_ANIM_OVER_TOP:
lv_anim_set_exec_cb(&a_new, set_y_anim);
- lv_anim_set_values(&a_new, lv_disp_get_ver_res(d), 0);
+ lv_anim_set_values(&a_new, lv_display_get_vertical_resolution(d), 0);
break;
case LV_SCR_LOAD_ANIM_OVER_BOTTOM:
lv_anim_set_exec_cb(&a_new, set_y_anim);
- lv_anim_set_values(&a_new, -lv_disp_get_ver_res(d), 0);
+ lv_anim_set_values(&a_new, -lv_display_get_vertical_resolution(d), 0);
break;
case LV_SCR_LOAD_ANIM_MOVE_LEFT:
lv_anim_set_exec_cb(&a_new, set_x_anim);
- lv_anim_set_values(&a_new, lv_disp_get_hor_res(d), 0);
+ lv_anim_set_values(&a_new, lv_display_get_horizontal_resolution(d), 0);
lv_anim_set_exec_cb(&a_old, set_x_anim);
- lv_anim_set_values(&a_old, 0, -lv_disp_get_hor_res(d));
+ lv_anim_set_values(&a_old, 0, -lv_display_get_horizontal_resolution(d));
break;
case LV_SCR_LOAD_ANIM_MOVE_RIGHT:
lv_anim_set_exec_cb(&a_new, set_x_anim);
- lv_anim_set_values(&a_new, -lv_disp_get_hor_res(d), 0);
+ lv_anim_set_values(&a_new, -lv_display_get_horizontal_resolution(d), 0);
lv_anim_set_exec_cb(&a_old, set_x_anim);
- lv_anim_set_values(&a_old, 0, lv_disp_get_hor_res(d));
+ lv_anim_set_values(&a_old, 0, lv_display_get_horizontal_resolution(d));
break;
case LV_SCR_LOAD_ANIM_MOVE_TOP:
lv_anim_set_exec_cb(&a_new, set_y_anim);
- lv_anim_set_values(&a_new, lv_disp_get_ver_res(d), 0);
+ lv_anim_set_values(&a_new, lv_display_get_vertical_resolution(d), 0);
lv_anim_set_exec_cb(&a_old, set_y_anim);
- lv_anim_set_values(&a_old, 0, -lv_disp_get_ver_res(d));
+ lv_anim_set_values(&a_old, 0, -lv_display_get_vertical_resolution(d));
break;
case LV_SCR_LOAD_ANIM_MOVE_BOTTOM:
lv_anim_set_exec_cb(&a_new, set_y_anim);
- lv_anim_set_values(&a_new, -lv_disp_get_ver_res(d), 0);
+ lv_anim_set_values(&a_new, -lv_display_get_vertical_resolution(d), 0);
lv_anim_set_exec_cb(&a_old, set_y_anim);
- lv_anim_set_values(&a_old, 0, lv_disp_get_ver_res(d));
+ lv_anim_set_values(&a_old, 0, lv_display_get_vertical_resolution(d));
break;
case LV_SCR_LOAD_ANIM_FADE_IN:
lv_anim_set_exec_cb(&a_new, opa_scale_anim);
@@ -630,19 +630,19 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
break;
case LV_SCR_LOAD_ANIM_OUT_LEFT:
lv_anim_set_exec_cb(&a_old, set_x_anim);
- lv_anim_set_values(&a_old, 0, -lv_disp_get_hor_res(d));
+ lv_anim_set_values(&a_old, 0, -lv_display_get_horizontal_resolution(d));
break;
case LV_SCR_LOAD_ANIM_OUT_RIGHT:
lv_anim_set_exec_cb(&a_old, set_x_anim);
- lv_anim_set_values(&a_old, 0, lv_disp_get_hor_res(d));
+ lv_anim_set_values(&a_old, 0, lv_display_get_horizontal_resolution(d));
break;
case LV_SCR_LOAD_ANIM_OUT_TOP:
lv_anim_set_exec_cb(&a_old, set_y_anim);
- lv_anim_set_values(&a_old, 0, -lv_disp_get_ver_res(d));
+ lv_anim_set_values(&a_old, 0, -lv_display_get_vertical_resolution(d));
break;
case LV_SCR_LOAD_ANIM_OUT_BOTTOM:
lv_anim_set_exec_cb(&a_old, set_y_anim);
- lv_anim_set_values(&a_old, 0, lv_disp_get_ver_res(d));
+ lv_anim_set_values(&a_old, 0, lv_display_get_vertical_resolution(d));
break;
}
@@ -656,35 +656,35 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
* OTHERS
*--------------------*/
-void lv_disp_add_event(lv_disp_t * disp, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data)
+void lv_display_add_event(lv_display_t * disp, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data)
{
LV_ASSERT_NULL(disp);
lv_event_add(&disp->event_list, event_cb, filter, user_data);
}
-uint32_t lv_disp_get_event_count(lv_disp_t * disp)
+uint32_t lv_display_get_event_count(lv_display_t * disp)
{
LV_ASSERT_NULL(disp);
return lv_event_get_count(&disp->event_list);
}
-lv_event_dsc_t * lv_disp_get_event_dsc(lv_disp_t * disp, uint32_t index)
+lv_event_dsc_t * lv_display_get_event_dsc(lv_display_t * disp, uint32_t index)
{
LV_ASSERT_NULL(disp);
return lv_event_get_dsc(&disp->event_list, index);
}
-bool lv_disp_remove_event(lv_disp_t * disp, uint32_t index)
+bool lv_display_remove_event(lv_display_t * disp, uint32_t index)
{
LV_ASSERT_NULL(disp);
return lv_event_remove(&disp->event_list, index);
}
-lv_res_t lv_disp_send_event(lv_disp_t * disp, lv_event_code_t code, void * param)
+lv_result_t lv_display_send_event(lv_display_t * disp, lv_event_code_t code, void * param)
{
lv_event_t e;
@@ -693,19 +693,19 @@ lv_res_t lv_disp_send_event(lv_disp_t * disp, lv_event_code_t code, void * param
e.current_target = disp;
e.original_target = disp;
e.param = param;
- lv_res_t res;
+ lv_result_t res;
res = lv_event_send(&disp->event_list, &e, true);
- if(res != LV_RES_OK) return res;
+ if(res != LV_RESULT_OK) return res;
res = lv_event_send(&disp->event_list, &e, false);
- if(res != LV_RES_OK) return res;
+ if(res != LV_RESULT_OK) return res;
return res;
}
-void lv_disp_set_rotation(lv_disp_t * disp, lv_disp_rotation_t rotation, bool sw_rotate)
+void lv_display_set_rotation(lv_display_t * disp, lv_display_rotation_t rotation, bool sw_rotate)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
disp->rotation = rotation;
@@ -713,16 +713,16 @@ void lv_disp_set_rotation(lv_disp_t * disp, lv_disp_rotation_t rotation, bool sw
update_resolution(disp);
}
-lv_disp_rotation_t lv_disp_get_rotation(lv_disp_t * disp)
+lv_display_rotation_t lv_display_get_rotation(lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
- if(disp == NULL) return LV_DISP_ROTATION_0;
+ if(disp == NULL) disp = lv_display_get_default();
+ if(disp == NULL) return LV_DISPLAY_ROTATION_0;
return disp->rotation;
}
-void lv_disp_set_theme(lv_disp_t * disp, lv_theme_t * th)
+void lv_display_set_theme(lv_display_t * disp, lv_theme_t * th)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) {
LV_LOG_WARN("no display registered");
return;
@@ -738,42 +738,42 @@ void lv_disp_set_theme(lv_disp_t * disp, lv_theme_t * th)
}
}
-lv_theme_t * lv_disp_get_theme(lv_disp_t * disp)
+lv_theme_t * lv_display_get_theme(lv_display_t * disp)
{
- if(disp == NULL) disp = lv_disp_get_default();
+ if(disp == NULL) disp = lv_display_get_default();
return disp->theme;
}
-uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp)
+uint32_t lv_display_get_inactive_time(const lv_display_t * disp)
{
if(disp) return lv_tick_elaps(disp->last_activity_time);
- lv_disp_t * d;
+ lv_display_t * d;
uint32_t t = UINT32_MAX;
- d = lv_disp_get_next(NULL);
+ d = lv_display_get_next(NULL);
while(d) {
uint32_t elaps = lv_tick_elaps(d->last_activity_time);
t = LV_MIN(t, elaps);
- d = lv_disp_get_next(d);
+ d = lv_display_get_next(d);
}
return t;
}
-void lv_disp_trig_activity(lv_disp_t * disp)
+void lv_display_trig_activity(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) {
- LV_LOG_WARN("lv_disp_trig_activity: no display registered");
+ LV_LOG_WARN("lv_display_trig_activity: no display registered");
return;
}
disp->last_activity_time = lv_tick_get();
}
-void lv_disp_enable_invalidation(lv_disp_t * disp, bool en)
+void lv_display_enable_invalidation(lv_display_t * disp, bool en)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) {
LV_LOG_WARN("no display registered");
return;
@@ -782,9 +782,9 @@ void lv_disp_enable_invalidation(lv_disp_t * disp, bool en)
disp->inv_en_cnt += en ? 1 : -1;
}
-bool lv_disp_is_invalidation_enabled(lv_disp_t * disp)
+bool lv_display_is_invalidation_enabled(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) {
LV_LOG_WARN("no display registered");
return false;
@@ -793,39 +793,39 @@ bool lv_disp_is_invalidation_enabled(lv_disp_t * disp)
return (disp->inv_en_cnt > 0);
}
-lv_timer_t * _lv_disp_get_refr_timer(lv_disp_t * disp)
+lv_timer_t * _lv_display_get_refr_timer(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) return NULL;
return disp->refr_timer;
}
-void lv_disp_set_user_data(lv_disp_t * disp, void * user_data)
+void lv_display_set_user_data(lv_display_t * disp, void * user_data)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) return;
disp->user_data = user_data;
}
-void lv_disp_set_driver_data(lv_disp_t * disp, void * driver_data)
+void lv_display_set_driver_data(lv_display_t * disp, void * driver_data)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) return;
disp->driver_data = driver_data;
}
-void * lv_disp_get_user_data(lv_disp_t * disp)
+void * lv_display_get_user_data(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) return NULL;
return disp->user_data;
}
-void * lv_disp_get_driver_data(lv_disp_t * disp)
+void * lv_display_get_driver_data(lv_display_t * disp)
{
- if(!disp) disp = lv_disp_get_default();
+ if(!disp) disp = lv_display_get_default();
if(!disp) return NULL;
return disp->driver_data;
@@ -835,10 +835,10 @@ void * lv_disp_get_driver_data(lv_disp_t * disp)
* STATIC FUNCTIONS
**********************/
-static void update_resolution(lv_disp_t * disp)
+static void update_resolution(lv_display_t * disp)
{
- lv_coord_t hor_res = lv_disp_get_hor_res(disp);
- lv_coord_t ver_res = lv_disp_get_ver_res(disp);
+ lv_coord_t hor_res = lv_display_get_horizontal_resolution(disp);
+ lv_coord_t ver_res = lv_display_get_vertical_resolution(disp);
lv_area_t prev_coords;
lv_obj_get_coords(disp->sys_layer, &prev_coords);
@@ -868,7 +868,7 @@ static void update_resolution(lv_disp_t * disp)
lv_obj_tree_walk(NULL, invalidate_layout_cb, NULL);
- lv_disp_send_event(disp, LV_EVENT_RESOLUTION_CHANGED, NULL);
+ lv_display_send_event(disp, LV_EVENT_RESOLUTION_CHANGED, NULL);
}
static lv_obj_tree_walk_res_t invalidate_layout_cb(lv_obj_t * obj, void * user_data)
@@ -880,7 +880,7 @@ static lv_obj_tree_walk_res_t invalidate_layout_cb(lv_obj_t * obj, void * user_d
static void scr_load_internal(lv_obj_t * scr)
{
- lv_disp_t * d = lv_obj_get_disp(scr);
+ lv_display_t * d = lv_obj_get_disp(scr);
if(!d) return; /*Shouldn't happen, just to be sure*/
lv_obj_t * old_scr = d->act_scr;
@@ -898,7 +898,7 @@ static void scr_load_internal(lv_obj_t * scr)
static void scr_load_anim_start(lv_anim_t * a)
{
- lv_disp_t * d = lv_obj_get_disp(a->var);
+ lv_display_t * d = lv_obj_get_disp(a->var);
d->prev_scr = lv_scr_act();
d->act_scr = a->var;
@@ -923,7 +923,7 @@ static void set_y_anim(void * obj, int32_t v)
static void scr_anim_ready(lv_anim_t * a)
{
- lv_disp_t * d = lv_obj_get_disp(a->var);
+ lv_display_t * d = lv_obj_get_disp(a->var);
lv_obj_send_event(d->act_scr, LV_EVENT_SCREEN_LOADED, NULL);
lv_obj_send_event(d->prev_scr, LV_EVENT_SCREEN_UNLOADED, NULL);
@@ -948,7 +948,7 @@ static bool is_out_anim(lv_scr_load_anim_t anim_type)
static void disp_event_cb(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
- lv_disp_t * disp = lv_event_get_target(e);
+ lv_display_t * disp = lv_event_get_target(e);
switch(code) {
case LV_EVENT_REFR_REQUEST:
if(disp->refr_timer) lv_timer_resume(disp->refr_timer);
diff --git a/src/disp/lv_disp.h b/src/display/lv_display.h
similarity index 74%
rename from src/disp/lv_disp.h
rename to src/display/lv_display.h
index 008d61cd7f..9472f7b39d 100644
--- a/src/disp/lv_disp.h
+++ b/src/display/lv_display.h
@@ -3,8 +3,8 @@
*
*/
-#ifndef LV_DISP_H
-#define LV_DISP_H
+#ifndef LV_DISPLAY_H
+#define LV_DISPLAY_H
#ifdef __cplusplus
extern "C" {
@@ -32,36 +32,36 @@ extern "C" {
struct _lv_obj_t;
struct _lv_theme_t;
-struct _lv_disp_t;
-typedef struct _lv_disp_t lv_disp_t;
+struct _lv_display_t;
+typedef struct _lv_display_t lv_display_t;
typedef enum {
- LV_DISP_ROTATION_0 = 0,
- LV_DISP_ROTATION_90,
- LV_DISP_ROTATION_180,
- LV_DISP_ROTATION_270
-} lv_disp_rotation_t;
+ LV_DISPLAY_ROTATION_0 = 0,
+ LV_DISPLAY_ROTATION_90,
+ LV_DISPLAY_ROTATION_180,
+ LV_DISPLAY_ROTATION_270
+} lv_display_rotation_t;
typedef enum {
/**
* Use the buffer(s) to render the screen is smaller parts.
* This way the buffers can be smaller then the display to save RAM. At least 1/10 screen size buffer(s) are recommended.
*/
- LV_DISP_RENDER_MODE_PARTIAL,
+ LV_DISPLAY_RENDER_MODE_PARTIAL,
/**
* The buffer(s) has to be screen sized and LVGL will render into the correct location of the buffer.
* This way the buffer always contain the whole image. Only the changed ares will be updated.
* With 2 buffers the buffers' content are kept in sync automatically and in flush_cb only address change is required.
*/
- LV_DISP_RENDER_MODE_DIRECT,
+ LV_DISPLAY_RENDER_MODE_DIRECT,
/**
* Always redraw the whole screen even if only one pixel has been changed.
* With 2 buffers in flush_cb only and address change is required.
*/
- LV_DISP_RENDER_MODE_FULL,
-} lv_disp_render_mode_t;
+ LV_DISPLAY_RENDER_MODE_FULL,
+} lv_display_render_mode_t;
typedef enum {
@@ -84,7 +84,7 @@ typedef enum {
} lv_scr_load_anim_t;
-typedef void (*lv_disp_flush_cb_t)(struct _lv_disp_t * disp, const lv_area_t * area, uint8_t * px_map);
+typedef void (*lv_display_flush_cb_t)(struct _lv_display_t * disp, const lv_area_t * area, uint8_t * px_map);
/**********************
* GLOBAL PROTOTYPES
@@ -96,32 +96,32 @@ typedef void (*lv_disp_flush_cb_t)(struct _lv_disp_t * disp, const lv_area_t * a
* @param ver_res vertical resolution in pixels
* @return pointer to a display object or `NULL` on error
*/
-lv_disp_t * lv_disp_create(lv_coord_t hor_res, lv_coord_t ver_res);
+lv_display_t * lv_display_create(lv_coord_t hor_res, lv_coord_t ver_res);
/**
* Remove a display
* @param disp pointer to display
*/
-void lv_disp_remove(lv_disp_t * disp);
+void lv_display_remove(lv_display_t * disp);
/**
* Set a default display. The new screens will be created on it by default.
* @param disp pointer to a display
*/
-void lv_disp_set_default(lv_disp_t * disp);
+void lv_display_set_default(lv_display_t * disp);
/**
* Get the default display
* @return pointer to the default display
*/
-lv_disp_t * lv_disp_get_default(void);
+lv_display_t * lv_display_get_default(void);
/**
* Get the next display.
* @param disp pointer to the current display. NULL to initialize.
* @return the next display or NULL if no more. Gives the first display when the parameter is NULL.
*/
-lv_disp_t * lv_disp_get_next(lv_disp_t * disp);
+lv_display_t * lv_display_get_next(lv_display_t * disp);
/*---------------------
* RESOLUTION
@@ -130,12 +130,12 @@ lv_disp_t * lv_disp_get_next(lv_disp_t * disp);
/**
* Sets the resolution of a display. `LV_EVENT_RESOLUTION_CHANGED` event will be sent.
* Here the native resolution of the device should be set. If the display will be rotated later with
- * `lv_disp_set_rotation` LVGL will swap the hor. and ver. resolution automatically.
+ * `lv_display_set_rotation` LVGL will swap the hor. and ver. resolution automatically.
* @param disp pointer to a display
* @param hor_res the new horizontal resolution
* @param ver_res the new vertical resolution
*/
-void lv_disp_set_res(lv_disp_t * disp, lv_coord_t hor_res, lv_coord_t ver_res);
+void lv_display_set_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord_t ver_res);
/**
* It's not mandatory to use the whole display for LVGL, however in some cases physical resolution is important.
@@ -145,7 +145,7 @@ void lv_disp_set_res(lv_disp_t * disp, lv_coord_t hor_res, lv_coord_t ver_res);
* @param hor_res the new physical horizontal resolution, or -1 to assume it's the same as the normal hor. res.
* @param ver_res the new physical vertical resolution, or -1 to assume it's the same as the normal hor. res.
*/
-void lv_disp_set_physical_res(lv_disp_t * disp, lv_coord_t hor_res, lv_coord_t ver_res);
+void lv_display_set_physical_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord_t ver_res);
/**
* If physical resolution is not the same as the normal resolution
@@ -154,16 +154,16 @@ void lv_disp_set_physical_res(lv_disp_t * disp, lv_coord_t hor_res, lv_coord_t v
* @param x X offset
* @param y Y offset
*/
-void lv_disp_set_offset(lv_disp_t * disp, lv_coord_t x, lv_coord_t y);
+void lv_display_set_offset(lv_display_t * disp, lv_coord_t x, lv_coord_t y);
/**
* Set the rotation of this display. LVGL will swap the horizontal and vertical resolutions internally.
* @param disp pointer to a display (NULL to use the default display)
- * @param rotation `LV_DISP_ROTATION_0/90/180/270`
+ * @param rotation `LV_DISPLAY_ROTATION_0/90/180/270`
* @param sw_rotate true: make LVGL rotate the rendered image;
* false: the display driver should rotate the rendered image
*/
-void lv_disp_set_rotation(lv_disp_t * disp, lv_disp_rotation_t rotation, bool sw_rotate);
+void lv_display_set_rotation(lv_display_t * disp, lv_display_rotation_t rotation, bool sw_rotate);
/**
* Set the DPI (dot per inch) of the display.
@@ -171,63 +171,63 @@ void lv_disp_set_rotation(lv_disp_t * disp, lv_disp_rotation_t rotation, bool sw
* @param disp pointer to a display
* @param dpi the new DPI
*/
-void lv_disp_set_dpi(lv_disp_t * disp, lv_coord_t dpi);
+void lv_display_set_dpi(lv_display_t * disp, lv_coord_t dpi);
/**
* Get the horizontal resolution of a display.
* @param disp pointer to a display (NULL to use the default display)
* @return the horizontal resolution of the display.
*/
-lv_coord_t lv_disp_get_hor_res(const lv_disp_t * disp);
+lv_coord_t lv_display_get_horizontal_resolution(const lv_display_t * disp);
/**
* Get the vertical resolution of a display
* @param disp pointer to a display (NULL to use the default display)
* @return the vertical resolution of the display
*/
-lv_coord_t lv_disp_get_ver_res(const lv_disp_t * disp);
+lv_coord_t lv_display_get_vertical_resolution(const lv_display_t * disp);
/**
* Get the physical horizontal resolution of a display
* @param disp pointer to a display (NULL to use the default display)
* @return the physical horizontal resolution of the display
*/
-lv_coord_t lv_disp_get_physical_hor_res(const lv_disp_t * disp);
+lv_coord_t lv_display_get_physical_horizontal_resolution(const lv_display_t * disp);
/**
* Get the physical vertical resolution of a display
* @param disp pointer to a display (NULL to use the default display)
* @return the physical vertical resolution of the display
*/
-lv_coord_t lv_disp_get_physical_ver_res(const lv_disp_t * disp);
+lv_coord_t lv_display_get_physical_vertical_resolution(const lv_display_t * disp);
/**
* Get the horizontal offset from the full / physical display
* @param disp pointer to a display (NULL to use the default display)
* @return the horizontal offset from the physical display
*/
-lv_coord_t lv_disp_get_offset_x(const lv_disp_t * disp);
+lv_coord_t lv_display_get_offset_x(const lv_display_t * disp);
/**
* Get the vertical offset from the full / physical display
* @param disp pointer to a display (NULL to use the default display)
* @return the horizontal offset from the physical display
*/
-lv_coord_t lv_disp_get_offset_y(const lv_disp_t * disp);
+lv_coord_t lv_display_get_offset_y(const lv_display_t * disp);
/**
* Get the current rotation of this display.
* @param disp pointer to a display (NULL to use the default display)
* @return the current rotation
*/
-lv_disp_rotation_t lv_disp_get_rotation(lv_disp_t * disp);
+lv_display_rotation_t lv_display_get_rotation(lv_display_t * disp);
/**
* Get the DPI of the display
* @param disp pointer to a display (NULL to use the default display)
* @return dpi of the display
*/
-lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp);
+lv_coord_t lv_display_get_dpi(const lv_display_t * disp);
/*---------------------
* BUFFERING
@@ -238,17 +238,17 @@ lv_coord_t lv_disp_get_dpi(const lv_disp_t * disp);
* @param disp pointer to a display
* @param buf1 first buffer
* @param buf2 second buffer (can be `NULL`)
- * @param render_mode LV_DISP_RENDER_MODE_PARTIAL/DIRECT/FULL
+ * @param render_mode LV_DISPLAY_RENDER_MODE_PARTIAL/DIRECT/FULL
*/
-void lv_disp_set_draw_buffers(lv_disp_t * disp, void * buf1, void * buf2, uint32_t buf_size_in_bytes,
- lv_disp_render_mode_t render_mode);
+void lv_display_set_draw_buffers(lv_display_t * disp, void * buf1, void * buf2, uint32_t buf_size_in_bytes,
+ lv_display_render_mode_t render_mode);
/**
* Set the flush callback which will be called to copy the rendered image to the display.
* @param disp pointer to a display
* @param flush_cb the flush callback (`px_map` contains the rendered image as raw pixel map and it should be copied to `area` on the display)
*/
-void lv_disp_set_flush_cb(lv_disp_t * disp, lv_disp_flush_cb_t flush_cb);
+void lv_display_set_flush_cb(lv_display_t * disp, lv_display_flush_cb_t flush_cb);
/**
* Set the color format of the display.
* If set to other than `LV_COLOR_FORMAT_NATIVE` the layer's `buffer_convert` function will be used
@@ -258,28 +258,28 @@ void lv_disp_set_flush_cb(lv_disp_t * disp, lv_disp_flush_cb_t flush_cb);
* `LV_COLOR_FORMAT_NATIVE_REVERSE` to change endianness.
*
*/
-void lv_disp_set_color_format(lv_disp_t * disp, lv_color_format_t color_format);
+void lv_display_set_color_format(lv_display_t * disp, lv_color_format_t color_format);
/**
* Get the color format of the display
* @param disp pointer to a display
* @return the color format
*/
-lv_color_format_t lv_disp_get_color_format(lv_disp_t * disp);
+lv_color_format_t lv_display_get_color_format(lv_display_t * disp);
/**
* Enable anti-aliasing for the render engine
* @param disp pointer to a display
* @param en true/false
*/
-void lv_disp_set_antialiasing(lv_disp_t * disp, bool en);
+void lv_display_set_antialiasing(lv_display_t * disp, bool en);
/**
* Get if anti-aliasing is enabled for a display or not
* @param disp pointer to a display (NULL to use the default display)
* @return true/false
*/
-bool lv_disp_get_antialiasing(lv_disp_t * disp);
+bool lv_display_get_antialiasing(lv_display_t * disp);
//! @cond Doxygen_Suppress
@@ -288,7 +288,7 @@ bool lv_disp_get_antialiasing(lv_disp_t * disp);
* Call from the display driver when the flushing is finished
* @param disp pointer to display whose `flush_cb` was called
*/
-LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_t * disp);
+LV_ATTRIBUTE_FLUSH_READY void lv_display_flush_ready(lv_display_t * disp);
/**
* Tell if it's the last area of the refreshing process.
@@ -297,12 +297,12 @@ LV_ATTRIBUTE_FLUSH_READY void lv_disp_flush_ready(lv_disp_t * disp);
* @return true: it's the last area to flush;
* false: there are other areas too which will be refreshed soon
*/
-LV_ATTRIBUTE_FLUSH_READY bool lv_disp_flush_is_last(lv_disp_t * disp);
+LV_ATTRIBUTE_FLUSH_READY bool lv_display_flush_is_last(lv_display_t * disp);
//! @endcond
-bool lv_disp_is_double_buffered(lv_disp_t * disp);
+bool lv_display_is_double_buffered(lv_display_t * disp);
/*---------------------
* SCREENS
@@ -314,7 +314,7 @@ bool lv_disp_is_double_buffered(lv_disp_t * disp);
* (NULL to use the default screen)
* @return pointer to the active screen object (loaded by 'lv_scr_load()')
*/
-struct _lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp);
+struct _lv_obj_t * lv_display_get_scr_act(lv_display_t * disp);
/**
* Return with a pointer to the previous screen. Only used during screen transitions.
@@ -322,27 +322,27 @@ struct _lv_obj_t * lv_disp_get_scr_act(lv_disp_t * disp);
* (NULL to use the default screen)
* @return pointer to the previous screen object or NULL if not used now
*/
-struct _lv_obj_t * lv_disp_get_scr_prev(lv_disp_t * disp);
+struct _lv_obj_t * lv_display_get_scr_prev(lv_display_t * disp);
/**
* Make a screen active
* @param scr pointer to a screen
*/
-void lv_disp_load_scr(struct _lv_obj_t * scr);
+void lv_display_load_scr(struct _lv_obj_t * scr);
/**
* Return the top layer. The top layer is the same on all screens and it is above the normal screen layer.
* @param disp pointer to display which top layer should be get. (NULL to use the default screen)
* @return pointer to the top layer object
*/
-struct _lv_obj_t * lv_disp_get_layer_top(lv_disp_t * disp);
+struct _lv_obj_t * lv_display_get_layer_top(lv_display_t * disp);
/**
* Return the sys. layer. The system layer is the same on all screen and it is above the normal screen and the top layer.
* @param disp pointer to display which sys. layer should be retrieved. (NULL to use the default screen)
* @return pointer to the sys layer object
*/
-struct _lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp);
+struct _lv_obj_t * lv_display_get_layer_sys(lv_display_t * disp);
/**
@@ -351,7 +351,7 @@ struct _lv_obj_t * lv_disp_get_layer_sys(lv_disp_t * disp);
* @param disp pointer to display (NULL to use the default screen)
* @return pointer to the bottom layer object
*/
-struct _lv_obj_t * lv_disp_get_layer_bottom(lv_disp_t * disp);
+struct _lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp);
/**
@@ -371,7 +371,7 @@ void lv_scr_load_anim(struct _lv_obj_t * scr, lv_scr_load_anim_t anim_type, uint
*/
static inline struct _lv_obj_t * lv_scr_act(void)
{
- return lv_disp_get_scr_act(lv_disp_get_default());
+ return lv_display_get_scr_act(lv_display_get_default());
}
/**
@@ -380,7 +380,7 @@ static inline struct _lv_obj_t * lv_scr_act(void)
*/
static inline struct _lv_obj_t * lv_layer_top(void)
{
- return lv_disp_get_layer_top(lv_disp_get_default());
+ return lv_display_get_layer_top(lv_display_get_default());
}
/**
@@ -389,7 +389,7 @@ static inline struct _lv_obj_t * lv_layer_top(void)
*/
static inline struct _lv_obj_t * lv_layer_sys(void)
{
- return lv_disp_get_layer_sys(lv_disp_get_default());
+ return lv_display_get_layer_sys(lv_display_get_default());
}
/**
@@ -398,7 +398,7 @@ static inline struct _lv_obj_t * lv_layer_sys(void)
*/
static inline struct _lv_obj_t * lv_layer_bottom(void)
{
- return lv_disp_get_layer_bottom(lv_disp_get_default());
+ return lv_display_get_layer_bottom(lv_display_get_default());
}
/**
@@ -407,7 +407,7 @@ static inline struct _lv_obj_t * lv_layer_bottom(void)
*/
static inline void lv_scr_load(struct _lv_obj_t * scr)
{
- lv_disp_load_scr(scr);
+ lv_display_load_scr(scr);
}
@@ -422,63 +422,63 @@ static inline void lv_scr_load(struct _lv_obj_t * scr)
* @param filter event code to react or `LV_EVENT_ALL`
* @param user_data optional user_data
*/
-void lv_disp_add_event(lv_disp_t * disp, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data);
+void lv_display_add_event(lv_display_t * disp, lv_event_cb_t event_cb, lv_event_code_t filter, void * user_data);
-uint32_t lv_disp_get_event_count(lv_disp_t * disp);
+uint32_t lv_display_get_event_count(lv_display_t * disp);
-lv_event_dsc_t * lv_disp_get_event_dsc(lv_disp_t * disp, uint32_t index);
+lv_event_dsc_t * lv_display_get_event_dsc(lv_display_t * disp, uint32_t index);
-bool lv_disp_remove_event(lv_disp_t * disp, uint32_t index);
+bool lv_display_remove_event(lv_display_t * disp, uint32_t index);
/**
* Send amn event to a display
* @param disp pointer to a display
* @param code an event code. LV_EVENT_...
* @param param optional param
- * @return LV_RES_OK: disp wasn't deleted in the event.
+ * @return LV_RESULT_OK: disp wasn't deleted in the event.
*/
-lv_res_t lv_disp_send_event(lv_disp_t * disp, lv_event_code_t code, void * param);
+lv_result_t lv_display_send_event(lv_display_t * disp, lv_event_code_t code, void * param);
/**
* Set the theme of a display. If there are no user created widgets yet the screens' theme will be updated
* @param disp pointer to a display
* @param th pointer to a theme
*/
-void lv_disp_set_theme(lv_disp_t * disp, struct _lv_theme_t * th);
+void lv_display_set_theme(lv_display_t * disp, struct _lv_theme_t * th);
/**
* Get the theme of a display
* @param disp pointer to a display
* @return the display's theme (can be NULL)
*/
-struct _lv_theme_t * lv_disp_get_theme(lv_disp_t * disp);
+struct _lv_theme_t * lv_display_get_theme(lv_display_t * disp);
/**
* Get elapsed time since last user activity on a display (e.g. click)
* @param disp pointer to a display (NULL to get the overall smallest inactivity)
* @return elapsed ticks (milliseconds) since the last activity
*/
-uint32_t lv_disp_get_inactive_time(const lv_disp_t * disp);
+uint32_t lv_display_get_inactive_time(const lv_display_t * disp);
/**
* Manually trigger an activity on a display
* @param disp pointer to a display (NULL to use the default display)
*/
-void lv_disp_trig_activity(lv_disp_t * disp);
+void lv_display_trig_activity(lv_display_t * disp);
/**
* Temporarily enable and disable the invalidation of the display.
* @param disp pointer to a display (NULL to use the default display)
* @param en true: enable invalidation; false: invalidation
*/
-void lv_disp_enable_invalidation(lv_disp_t * disp, bool en);
+void lv_display_enable_invalidation(lv_display_t * disp, bool en);
/**
* Get display invalidation is enabled.
* @param disp pointer to a display (NULL to use the default display)
* @return return true if invalidation is enabled
*/
-bool lv_disp_is_invalidation_enabled(lv_disp_t * disp);
+bool lv_display_is_invalidation_enabled(lv_display_t * disp);
/**
* Get a pointer to the screen refresher timer to
@@ -486,12 +486,12 @@ bool lv_disp_is_invalidation_enabled(lv_disp_t * disp);
* @param disp pointer to a display
* @return pointer to the display refresher timer. (NULL on error)
*/
-lv_timer_t * _lv_disp_get_refr_timer(lv_disp_t * disp);
+lv_timer_t * _lv_display_get_refr_timer(lv_display_t * disp);
-void lv_disp_set_user_data(lv_disp_t * disp, void * user_data);
-void lv_disp_set_driver_data(lv_disp_t * disp, void * driver_data);
-void * lv_disp_get_user_data(lv_disp_t * disp);
-void * lv_disp_get_driver_data(lv_disp_t * disp);
+void lv_display_set_user_data(lv_display_t * disp, void * user_data);
+void lv_display_set_driver_data(lv_display_t * disp, void * driver_data);
+void * lv_display_get_user_data(lv_display_t * disp);
+void * lv_display_get_driver_data(lv_display_t * disp);
/**********************
* MACROS
@@ -506,14 +506,14 @@ void * lv_disp_get_driver_data(lv_disp_t * disp);
/**
* The horizontal resolution of the currently active display.
*/
-#define LV_HOR_RES lv_disp_get_hor_res(lv_disp_get_default())
+#define LV_HOR_RES lv_display_get_horizontal_resolution(lv_display_get_default())
#endif
#ifndef LV_VER_RES
/**
* The vertical resolution of the currently active display.
*/
-#define LV_VER_RES lv_disp_get_ver_res(lv_disp_get_default())
+#define LV_VER_RES lv_display_get_vertical_resolution(lv_display_get_default())
#endif
@@ -524,7 +524,7 @@ void * lv_disp_get_driver_data(lv_disp_t * disp);
* https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp
*/
#define _LV_DPX_CALC(dpi, n) ((n) == 0 ? 0 :LV_MAX((( (dpi) * (n) + 80) / 160), 1)) /*+80 for rounding*/
-#define LV_DPX(n) _LV_DPX_CALC(lv_disp_get_dpi(NULL), n)
+#define LV_DPX(n) _LV_DPX_CALC(lv_display_get_dpi(NULL), n)
/**
* Scale the given number of pixels (a distance or size) relative to a 160 DPI display
@@ -548,9 +548,9 @@ static inline lv_coord_t lv_dpx(lv_coord_t n)
* @param n the number of pixels to scale
* @return `n x current_dpi/160`
*/
-static inline lv_coord_t lv_disp_dpx(const lv_disp_t * disp, lv_coord_t n)
+static inline lv_coord_t lv_display_dpx(const lv_display_t * disp, lv_coord_t n)
{
- return _LV_DPX_CALC(lv_disp_get_dpi(disp), n);
+ return _LV_DPX_CALC(lv_display_get_dpi(disp), n);
}
@@ -558,4 +558,4 @@ static inline lv_coord_t lv_disp_dpx(const lv_disp_t * disp, lv_coord_t n)
} /*extern "C"*/
#endif
-#endif /*LV_DISP_H*/
+#endif /*LV_DISPLAY_H*/
diff --git a/src/disp/lv_disp_private.h b/src/display/lv_display_private.h
similarity index 84%
rename from src/disp/lv_disp_private.h
rename to src/display/lv_display_private.h
index 019200e70d..cdc4cae696 100644
--- a/src/disp/lv_disp_private.h
+++ b/src/display/lv_display_private.h
@@ -1,10 +1,10 @@
/**
- * @file lv_disp_private.h
+ * @file lv_display_private.h
*
*/
-#ifndef LV_DISP_PRIVATE_H
-#define LV_DISP_PRIVATE_H
+#ifndef LV_DISPLAY_PRIVATE_H
+#define LV_DISPLAY_PRIVATE_H
#ifdef __cplusplus
extern "C" {
@@ -15,7 +15,7 @@ extern "C" {
*********************/
#include "../core/lv_obj.h"
#include "../draw/lv_draw.h"
-#include "lv_disp.h"
+#include "lv_display.h"
/*********************
* DEFINES
@@ -28,9 +28,9 @@ extern "C" {
* TYPEDEFS
**********************/
-struct _lv_disp_t;
+struct _lv_display_t;
-struct _lv_disp_t {
+struct _lv_display_t {
/*---------------------
* Resolution
@@ -66,9 +66,9 @@ struct _lv_disp_t {
uint8_t * buf_act;
uint32_t buf_size_in_bytes;
- /** MANDATORY: Write the internal buffer (draw_buf) to the display. 'lv_disp_flush_ready()' has to be
+ /** MANDATORY: Write the internal buffer (draw_buf) to the display. 'lv_display_flush_ready()' has to be
* called when finished*/
- lv_disp_flush_cb_t flush_cb;
+ lv_display_flush_cb_t flush_cb;
/*1: flushing is in progress. (It can't be a bit field because when it's cleared from IRQ Read-Modify-Write issue might occur)*/
volatile int flushing;
@@ -78,7 +78,7 @@ struct _lv_disp_t {
volatile uint32_t last_area : 1; /*1: the last area is being rendered*/
volatile uint32_t last_part : 1; /*1: the last part of the current area is being rendered*/
- lv_disp_render_mode_t render_mode;
+ lv_display_render_mode_t render_mode;
uint32_t antialiasing : 1; /**< 1: anti-aliasing is enabled on this display.*/
/** 1: The current screen rendering is in progress*/
@@ -96,8 +96,8 @@ struct _lv_disp_t {
* Layer
*--------------------*/
lv_layer_t * layer_head;
- void (*layer_init)(struct _lv_disp_t * disp, lv_layer_t * layer);
- void (*layer_deinit)(struct _lv_disp_t * disp, lv_layer_t * layer);
+ void (*layer_init)(struct _lv_display_t * disp, lv_layer_t * layer);
+ void (*layer_deinit)(struct _lv_display_t * disp, lv_layer_t * layer);
/*---------------------
* Screens
@@ -108,9 +108,9 @@ struct _lv_disp_t {
struct _lv_obj_t * act_scr; /**< Currently active screen on this display*/
struct _lv_obj_t * prev_scr; /**< Previous screen. Used during screen animations*/
struct _lv_obj_t * scr_to_load; /**< The screen prepared to load in lv_scr_load_anim*/
- struct _lv_obj_t * bottom_layer; /**< @see lv_disp_get_layer_bottom*/
- struct _lv_obj_t * top_layer; /**< @see lv_disp_get_layer_top*/
- struct _lv_obj_t * sys_layer; /**< @see lv_disp_get_layer_sys*/
+ struct _lv_obj_t * bottom_layer; /**< @see lv_display_get_layer_bottom*/
+ struct _lv_obj_t * top_layer; /**< @see lv_display_get_layer_top*/
+ struct _lv_obj_t * sys_layer; /**< @see lv_display_get_layer_sys*/
uint32_t screen_cnt;
uint8_t draw_prev_over_act : 1;/** 1: Draw previous screen over active screen*/
uint8_t del_prev : 1; /** 1: Automatically delete the previous screen when the screen load animation is ready*/
@@ -126,7 +126,7 @@ struct _lv_disp_t {
lv_event_list_t event_list;
uint32_t sw_rotate : 1; /**< 1: use software rotation (slower)*/
- uint32_t rotation : 2; /**< Element of @lv_disp_rotation_t*/
+ uint32_t rotation : 2; /**< Element of @lv_display_rotation_t*/
/**< The theme assigned to the screen*/
struct _lv_theme_t * theme;
@@ -153,4 +153,4 @@ struct _lv_disp_t {
} /*extern "C"*/
#endif
-#endif /*LV_DISP_PRIVATE_H*/
+#endif /*LV_DISPLAY_PRIVATE_H*/
diff --git a/src/draw/lv_draw.c b/src/draw/lv_draw.c
index 865b2c0894..0742830602 100644
--- a/src/draw/lv_draw.c
+++ b/src/draw/lv_draw.c
@@ -8,7 +8,7 @@
*********************/
#include "lv_draw.h"
#include "sw/lv_draw_sw.h"
-#include "../disp/lv_disp_private.h"
+#include "../display/lv_display_private.h"
#include "../core/lv_global.h"
#include "../core/lv_refr.h"
#include "../stdlib/lv_string.h"
@@ -122,7 +122,7 @@ void lv_draw_dispatch(void)
{
LV_PROFILER_BEGIN;
bool one_taken = false;
- lv_disp_t * disp = lv_disp_get_next(NULL);
+ lv_display_t * disp = lv_display_get_next(NULL);
while(disp) {
lv_layer_t * layer = disp->layer_head;
while(layer) {
@@ -134,12 +134,12 @@ void lv_draw_dispatch(void)
if(!one_taken) {
lv_draw_dispatch_request();
}
- disp = lv_disp_get_next(disp);
+ disp = lv_display_get_next(disp);
}
LV_PROFILER_END;
}
-bool lv_draw_dispatch_layer(struct _lv_disp_t * disp, lv_layer_t * layer)
+bool lv_draw_dispatch_layer(struct _lv_display_t * disp, lv_layer_t * layer)
{
/*Remove the finished tasks first*/
lv_draw_task_t * t_prev = NULL;
@@ -269,8 +269,8 @@ lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_tas
LV_PROFILER_BEGIN;
/*If the first task is screen sized, there cannot be independent areas*/
if(layer->draw_task_head) {
- lv_coord_t hor_res = lv_disp_get_hor_res(_lv_refr_get_disp_refreshing());
- lv_coord_t ver_res = lv_disp_get_ver_res(_lv_refr_get_disp_refreshing());
+ lv_coord_t hor_res = lv_display_get_horizontal_resolution(_lv_refr_get_disp_refreshing());
+ lv_coord_t ver_res = lv_display_get_vertical_resolution(_lv_refr_get_disp_refreshing());
lv_draw_task_t * t = layer->draw_task_head;
if(t->state != LV_DRAW_TASK_STATE_QUEUED &&
t->area.x1 <= 0 && t->area.x2 >= hor_res - 1 &&
@@ -298,7 +298,7 @@ lv_draw_task_t * lv_draw_get_next_available_task(lv_layer_t * layer, lv_draw_tas
lv_layer_t * lv_draw_layer_create(lv_layer_t * parent_layer, lv_color_format_t color_format, const lv_area_t * area)
{
- lv_disp_t * disp = _lv_refr_get_disp_refreshing();
+ lv_display_t * disp = _lv_refr_get_disp_refreshing();
lv_layer_t * new_layer = lv_malloc(sizeof(lv_layer_t));
LV_ASSERT_MALLOC(new_layer);
if(new_layer == NULL) return NULL;
diff --git a/src/draw/lv_draw.h b/src/draw/lv_draw.h
index eecdd37db6..f973d79905 100644
--- a/src/draw/lv_draw.h
+++ b/src/draw/lv_draw.h
@@ -16,7 +16,7 @@ extern "C" {
#include "../lv_conf_internal.h"
#include "../misc/lv_style.h"
-#include "../misc/lv_txt.h"
+#include "../misc/lv_text.h"
#include "../misc/lv_profiler.h"
#include "../misc/lv_cache.h"
#include "lv_image_decoder.h"
@@ -33,7 +33,7 @@ extern "C" {
**********************/
struct _lv_draw_image_dsc_t;
-struct _lv_disp_t;
+struct _lv_display_t;
typedef enum {
LV_DRAW_TASK_TYPE_FILL,
@@ -196,7 +196,7 @@ void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t);
void lv_draw_dispatch(void);
-bool lv_draw_dispatch_layer(struct _lv_disp_t * disp, lv_layer_t * layer);
+bool lv_draw_dispatch_layer(struct _lv_display_t * disp, lv_layer_t * layer);
/**
* Wait for a new dispatch request.
diff --git a/src/draw/lv_draw_image.c b/src/draw/lv_draw_image.c
index 814c296d6a..d7051ab5bb 100644
--- a/src/draw/lv_draw_image.c
+++ b/src/draw/lv_draw_image.c
@@ -7,7 +7,7 @@
* INCLUDES
*********************/
#include "lv_draw_image.h"
-#include "../disp/lv_disp.h"
+#include "../display/lv_display.h"
#include "../misc/lv_log.h"
#include "../misc/lv_math.h"
#include "../core/lv_refr.h"
@@ -43,7 +43,7 @@ void lv_draw_image_dsc_init(lv_draw_image_dsc_t * dsc)
lv_memzero(dsc, sizeof(lv_draw_image_dsc_t));
dsc->recolor = lv_color_black();
dsc->opa = LV_OPA_COVER;
- dsc->zoom = LV_ZOOM_NONE;
+ dsc->zoom = LV_SCALE_NONE;
dsc->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0;
}
@@ -77,8 +77,8 @@ void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
lv_draw_image_dsc_t * new_image_dsc = lv_malloc(sizeof(*dsc));
lv_memcpy(new_image_dsc, dsc, sizeof(*dsc));
- lv_res_t res = lv_image_decoder_get_info(new_image_dsc->src, &new_image_dsc->header);
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_image_decoder_get_info(new_image_dsc->src, &new_image_dsc->header);
+ if(res != LV_RESULT_OK) {
LV_LOG_WARN("Couldn't get info about the image");
lv_free(new_image_dsc);
return;
diff --git a/src/draw/lv_draw_image.h b/src/draw/lv_draw_image.h
index e14a8d866d..ffcec4d114 100644
--- a/src/draw/lv_draw_image.h
+++ b/src/draw/lv_draw_image.h
@@ -43,7 +43,7 @@ typedef struct _lv_draw_image_dsc_t {
lv_image_header_t header;
- lv_coord_t angle;
+ lv_coord_t rotation;
lv_coord_t zoom;
lv_point_t pivot;
diff --git a/src/draw/lv_draw_label.c b/src/draw/lv_draw_label.c
index ae650be8ce..7ccd94d418 100644
--- a/src/draw/lv_draw_label.c
+++ b/src/draw/lv_draw_label.c
@@ -146,8 +146,8 @@ void lv_draw_label_interate_letters(lv_draw_unit_t * draw_unit, const lv_draw_la
else {
/*If EXPAND is enabled then not limit the text's width to the object's width*/
lv_point_t p;
- lv_txt_get_size(&p, dsc->text, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX,
- dsc->flag);
+ lv_text_get_size(&p, dsc->text, dsc->font, dsc->letter_space, dsc->line_space, LV_COORD_MAX,
+ dsc->flag);
w = p.x;
}
@@ -184,14 +184,14 @@ void lv_draw_label_interate_letters(lv_draw_unit_t * draw_unit, const lv_draw_la
pos.y += dsc->hint->y;
}
- uint32_t line_end = line_start + _lv_txt_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL,
- dsc->flag);
+ uint32_t line_end = line_start + _lv_text_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL,
+ dsc->flag);
/*Go the first visible line*/
while(pos.y + line_height_font < draw_unit->clip_area->y1) {
/*Go to next line*/
line_start = line_end;
- line_end += _lv_txt_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL, dsc->flag);
+ line_end += _lv_text_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL, dsc->flag);
pos.y += line_height;
/*Save at the threshold coordinate*/
@@ -206,14 +206,14 @@ void lv_draw_label_interate_letters(lv_draw_unit_t * draw_unit, const lv_draw_la
/*Align to middle*/
if(align == LV_TEXT_ALIGN_CENTER) {
- line_width = lv_txt_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
+ line_width = lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
pos.x += (lv_area_get_width(coords) - line_width) / 2;
}
/*Align to the right*/
else if(align == LV_TEXT_ALIGN_RIGHT) {
- line_width = lv_txt_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
+ line_width = lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
pos.x += lv_area_get_width(coords) - line_width;
}
@@ -259,17 +259,17 @@ void lv_draw_label_interate_letters(lv_draw_unit_t * draw_unit, const lv_draw_la
uint32_t logical_char_pos = 0;
if(sel_start != 0xFFFF && sel_end != 0xFFFF) {
#if LV_USE_BIDI
- logical_char_pos = _lv_txt_encoded_get_char_id(dsc->text, line_start);
- uint32_t t = _lv_txt_encoded_get_char_id(bidi_txt, i);
+ logical_char_pos = _lv_text_encoded_get_char_id(dsc->text, line_start);
+ uint32_t t = _lv_text_encoded_get_char_id(bidi_txt, i);
logical_char_pos += _lv_bidi_get_logical_pos(bidi_txt, NULL, line_end - line_start, base_dir, t, NULL);
#else
- logical_char_pos = _lv_txt_encoded_get_char_id(dsc->text, line_start + i);
+ logical_char_pos = _lv_text_encoded_get_char_id(dsc->text, line_start + i);
#endif
}
uint32_t letter;
uint32_t letter_next;
- _lv_txt_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &i);
+ _lv_text_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &i);
letter_w = lv_font_get_glyph_width(font, letter, letter_next);
@@ -327,20 +327,20 @@ void lv_draw_label_interate_letters(lv_draw_unit_t * draw_unit, const lv_draw_la
#endif
/*Go to next line*/
line_start = line_end;
- line_end += _lv_txt_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL, dsc->flag);
+ line_end += _lv_text_get_next_line(&dsc->text[line_start], font, dsc->letter_space, w, NULL, dsc->flag);
pos.x = coords->x1;
/*Align to middle*/
if(align == LV_TEXT_ALIGN_CENTER) {
line_width =
- lv_txt_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
+ lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
pos.x += (lv_area_get_width(coords) - line_width) / 2;
}
/*Align to the right*/
else if(align == LV_TEXT_ALIGN_RIGHT) {
line_width =
- lv_txt_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
+ lv_text_get_width(&dsc->text[line_start], line_end - line_start, font, dsc->letter_space);
pos.x += lv_area_get_width(coords) - line_width;
}
diff --git a/src/draw/lv_draw_label.h b/src/draw/lv_draw_label.h
index ff9009d9ad..e79130d33c 100644
--- a/src/draw/lv_draw_label.h
+++ b/src/draw/lv_draw_label.h
@@ -15,7 +15,7 @@ extern "C" {
*********************/
#include "lv_draw.h"
#include "../misc/lv_bidi.h"
-#include "../misc/lv_txt.h"
+#include "../misc/lv_text.h"
#include "../misc/lv_color.h"
#include "../misc/lv_style.h"
diff --git a/src/draw/lv_draw_rect.c b/src/draw/lv_draw_rect.c
index 376187cd52..67dfdb2c92 100644
--- a/src/draw/lv_draw_rect.c
+++ b/src/draw/lv_draw_rect.c
@@ -176,19 +176,19 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
lv_image_src_t src_type = lv_image_src_get_type(dsc->bg_image_src);
- lv_res_t res = LV_RES_OK;
+ lv_result_t res = LV_RESULT_OK;
lv_image_header_t header;
if(src_type == LV_IMAGE_SRC_VARIABLE || src_type == LV_IMAGE_SRC_FILE) {
res = lv_image_decoder_get_info(dsc->bg_image_src, &header);
}
else if(src_type == LV_IMAGE_SRC_UNKNOWN) {
- res = LV_RES_INV;
+ res = LV_RESULT_INVALID;
}
else {
lv_memzero(&header, sizeof(header));
}
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
lv_draw_bg_image_dsc_t * bg_image_dsc = lv_malloc(sizeof(lv_draw_bg_image_dsc_t));
t->draw_dsc = bg_image_dsc;
bg_image_dsc->base = dsc->base;
diff --git a/src/draw/lv_image_buf.c b/src/draw/lv_image_buf.c
index 2fb224f0d5..1d66af93fb 100644
--- a/src/draw/lv_image_buf.c
+++ b/src/draw/lv_image_buf.c
@@ -62,7 +62,7 @@ void lv_image_buf_free(lv_image_dsc_t * dsc)
void _lv_image_buf_get_transformed_area(lv_area_t * res, lv_coord_t w, lv_coord_t h, lv_coord_t angle, uint16_t zoom,
const lv_point_t * pivot)
{
- if(angle == 0 && zoom == LV_ZOOM_NONE) {
+ if(angle == 0 && zoom == LV_SCALE_NONE) {
res->x1 = 0;
res->y1 = 0;
res->x2 = w - 1;
diff --git a/src/draw/lv_image_decoder.c b/src/draw/lv_image_decoder.c
index 4ef24e44b5..fb5ee46af5 100644
--- a/src/draw/lv_image_decoder.c
+++ b/src/draw/lv_image_decoder.c
@@ -32,9 +32,9 @@ typedef struct {
/**********************
* STATIC PROTOTYPES
**********************/
-static lv_res_t decode_indexed_line(lv_color_format_t color_format, const lv_color32_t * palette, lv_coord_t x,
- lv_coord_t y,
- lv_coord_t w_px, const uint8_t * in, lv_color32_t * out);
+static lv_result_t decode_indexed_line(lv_color_format_t color_format, const lv_color32_t * palette, lv_coord_t x,
+ lv_coord_t y,
+ lv_coord_t w_px, const uint8_t * in, lv_color32_t * out);
static uint32_t img_width_to_stride(lv_image_header_t * header);
static lv_fs_res_t fs_read_file_at(lv_fs_file_t * f, uint32_t pos, uint8_t * buff, uint32_t btr, uint32_t * br);
@@ -79,26 +79,26 @@ void _lv_image_decoder_init(void)
* Try the created image decoder one by one. Once one is able to get info that info will be used.
* @param src the image source. E.g. file name or variable.
* @param header the image info will be stored here
- * @return LV_RES_OK: success; LV_RES_INV: wasn't able to get info about the image
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: wasn't able to get info about the image
*/
-lv_res_t lv_image_decoder_get_info(const void * src, lv_image_header_t * header)
+lv_result_t lv_image_decoder_get_info(const void * src, lv_image_header_t * header)
{
lv_memzero(header, sizeof(lv_image_header_t));
- if(src == NULL) return LV_RES_INV;
+ if(src == NULL) return LV_RESULT_INVALID;
lv_image_src_t src_type = lv_image_src_get_type(src);
if(src_type == LV_IMAGE_SRC_VARIABLE) {
const lv_image_dsc_t * img_dsc = src;
- if(img_dsc->data == NULL) return LV_RES_INV;
+ if(img_dsc->data == NULL) return LV_RESULT_INVALID;
}
- lv_res_t res = LV_RES_INV;
+ lv_result_t res = LV_RESULT_INVALID;
lv_image_decoder_t * d;
_LV_LL_READ(img_decoder_ll_p, d) {
if(d->info_cb) {
res = d->info_cb(d, src, header);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
if(header->stride == 0) header->stride = img_width_to_stride(header);
break;
}
@@ -108,15 +108,15 @@ lv_res_t lv_image_decoder_get_info(const void * src, lv_image_header_t * header)
return res;
}
-lv_res_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, lv_color_t color, int32_t frame_id)
+lv_result_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, lv_color_t color, int32_t frame_id)
{
lv_memzero(dsc, sizeof(lv_image_decoder_dsc_t));
- if(src == NULL) return LV_RES_INV;
+ if(src == NULL) return LV_RESULT_INVALID;
lv_image_src_t src_type = lv_image_src_get_type(src);
if(src_type == LV_IMAGE_SRC_VARIABLE) {
const lv_image_dsc_t * img_dsc = src;
- if(img_dsc->data == NULL) return LV_RES_INV;
+ if(img_dsc->data == NULL) return LV_RESULT_INVALID;
}
dsc->color = color;
@@ -129,7 +129,7 @@ lv_res_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, l
LV_ASSERT_MALLOC(dsc->src);
if(dsc->src == NULL) {
LV_LOG_WARN("out of memory");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
lv_strcpy((char *)dsc->src, src);
}
@@ -137,7 +137,7 @@ lv_res_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, l
dsc->src = src;
}
- lv_res_t res = LV_RES_INV;
+ lv_result_t res = LV_RESULT_INVALID;
lv_image_decoder_t * decoder;
_LV_LL_READ(img_decoder_ll_p, decoder) {
@@ -145,7 +145,7 @@ lv_res_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, l
if(decoder->info_cb == NULL || decoder->open_cb == NULL) continue;
res = decoder->info_cb(decoder, src, &dsc->header);
- if(res != LV_RES_OK) continue;
+ if(res != LV_RESULT_OK) continue;
if(dsc->header.stride == 0) dsc->header.stride = img_width_to_stride(&dsc->header);
@@ -153,7 +153,7 @@ lv_res_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, l
res = decoder->open_cb(decoder, dsc);
/*Opened successfully. It is a good decoder for this image source*/
- if(res == LV_RES_OK) return res;
+ if(res == LV_RESULT_OK) return res;
/*Prepare for the next loop*/
lv_memzero(&dsc->header, sizeof(lv_image_header_t));
@@ -177,11 +177,12 @@ lv_res_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, l
* @param y start Y coordinate (from top)
* @param len number of pixels to read
* @param buf store the data here
- * @return LV_RES_OK: success; LV_RES_INV: an error occurred
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: an error occurred
*/
-lv_res_t lv_image_decoder_get_area(lv_image_decoder_dsc_t * dsc, const lv_area_t * full_area, lv_area_t * decoded_area)
+lv_result_t lv_image_decoder_get_area(lv_image_decoder_dsc_t * dsc, const lv_area_t * full_area,
+ lv_area_t * decoded_area)
{
- lv_res_t res = LV_RES_INV;
+ lv_result_t res = LV_RESULT_INVALID;
if(dsc->decoder->get_area_cb) res = dsc->decoder->get_area_cb(dsc->decoder, dsc, full_area, decoded_area);
return res;
@@ -274,9 +275,9 @@ void lv_image_decoder_set_close_cb(lv_image_decoder_t * decoder, lv_image_decode
* @param decoder the decoder where this function belongs
* @param src the image source: pointer to an `lv_image_dsc_t` variable, a file path or a symbol
* @param header store the image data here
- * @return LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error.
+ * @return LV_RESULT_OK: the info is successfully stored in `header`; LV_RESULT_INVALID: unknown format or other error.
*/
-lv_res_t lv_image_decoder_built_in_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
+lv_result_t lv_image_decoder_built_in_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
{
LV_UNUSED(decoder); /*Unused*/
@@ -289,7 +290,7 @@ lv_res_t lv_image_decoder_built_in_info(lv_image_decoder_t * decoder, const void
}
else if(src_type == LV_IMAGE_SRC_FILE) {
/*Support only "*.bin" files*/
- if(strcmp(lv_fs_get_ext(src), "bin")) return LV_RES_INV;
+ if(strcmp(lv_fs_get_ext(src), "bin")) return LV_RESULT_INVALID;
lv_fs_file_t f;
lv_fs_res_t res = lv_fs_open(&f, src, LV_FS_MODE_RD);
@@ -299,7 +300,7 @@ lv_res_t lv_image_decoder_built_in_info(lv_image_decoder_t * decoder, const void
lv_fs_close(&f);
if(res != LV_FS_RES_OK || rn != sizeof(lv_image_header_t)) {
LV_LOG_WARN("Image get info get read file header");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
}
}
@@ -314,9 +315,9 @@ lv_res_t lv_image_decoder_built_in_info(lv_image_decoder_t * decoder, const void
}
else {
LV_LOG_WARN("Image get info found unknown src type");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
static lv_image_decoder_built_in_data_t * get_decoder_data(lv_image_decoder_dsc_t * dsc)
@@ -341,27 +342,27 @@ static lv_image_decoder_built_in_data_t * get_decoder_data(lv_image_decoder_dsc_
* Open a built in image
* @param decoder the decoder where this function belongs
* @param dsc pointer to decoder descriptor. `src`, `color` are already initialized in it.
- * @return LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error.
+ * @return LV_RESULT_OK: the info is successfully stored in `header`; LV_RESULT_INVALID: unknown format or other error.
*/
-lv_res_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
+lv_result_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
{
LV_UNUSED(decoder);
/*Open the file if it's a file*/
if(dsc->src_type == LV_IMAGE_SRC_FILE) {
/*Support only "*.bin" files*/
- if(strcmp(lv_fs_get_ext(dsc->src), "bin")) return LV_RES_INV;
+ if(strcmp(lv_fs_get_ext(dsc->src), "bin")) return LV_RESULT_INVALID;
lv_fs_file_t f;
lv_fs_res_t res = lv_fs_open(&f, dsc->src, LV_FS_MODE_RD);
if(res != LV_FS_RES_OK) {
LV_LOG_WARN("Built-in image decoder can't open the file");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
/*If the file was open successfully save the file descriptor*/
lv_image_decoder_built_in_data_t * decoder_data = get_decoder_data(dsc);
if(decoder_data == NULL) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
lv_memcpy(&decoder_data->f, &f, sizeof(f));
@@ -375,7 +376,7 @@ lv_res_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_d
if(palette == NULL) {
LV_LOG_ERROR("out of memory");
lv_fs_close(&f);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
uint32_t rn;
@@ -384,7 +385,7 @@ lv_res_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_d
LV_LOG_WARN("Built-in image decoder can't read the palette");
lv_free(palette);
lv_fs_close(&f);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
dsc->palette = palette;
@@ -393,7 +394,7 @@ lv_res_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_d
decoder_data->palette = palette; /*Free decoder data on close*/
/*It needs to be read by get_area_cb later*/
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
if(dsc->header.cf == LV_COLOR_FORMAT_A8) {
@@ -404,7 +405,7 @@ lv_res_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_d
if(data == NULL) {
LV_LOG_ERROR("out of memory");
lv_fs_close(&f);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
uint32_t rn;
@@ -413,23 +414,23 @@ lv_res_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_d
LV_LOG_WARN("Built-in image decoder can't read the palette");
lv_free(data);
lv_fs_close(&f);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
decoder_data->img_data = data;
dsc->img_data = data;
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/*It needs to be read by get_area_cb later*/
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) {
/*The variables should have valid data*/
lv_image_dsc_t * img_dsc = (lv_image_dsc_t *)dsc->src;
if(img_dsc->data == NULL) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
lv_color_format_t cf = img_dsc->header.cf;
@@ -437,13 +438,13 @@ lv_res_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_d
/*Need decoder data to store converted image*/
lv_image_decoder_built_in_data_t * decoder_data = get_decoder_data(dsc);
if(decoder_data == NULL) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
uint8_t * img_data = lv_malloc(sizeof(lv_color32_t) * img_dsc->header.w * img_dsc->header.h);
LV_ASSERT_NULL(img_data);
if(img_data == NULL) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
decoder_data->img_data = img_data; /*Put to decoder data for later free*/
@@ -469,10 +470,10 @@ lv_res_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_d
dsc->img_data = ((lv_image_dsc_t *)dsc->src)->data;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
/**
@@ -495,8 +496,8 @@ void lv_image_decoder_built_in_close(lv_image_decoder_t * decoder, lv_image_deco
}
}
-lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
- const lv_area_t * full_area, lv_area_t * decoded_area)
+lv_result_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
+ const lv_area_t * full_area, lv_area_t * decoded_area)
{
LV_UNUSED(decoder); /*Unused*/
@@ -508,10 +509,10 @@ lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_ima
|| cf == LV_COLOR_FORMAT_RGB565 || cf == LV_COLOR_FORMAT_RGB565A8;
if(!supported) {
LV_LOG_WARN("CF: %d is not supported", cf);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- lv_res_t res = LV_RES_INV;
+ lv_result_t res = LV_RESULT_INVALID;
lv_image_decoder_built_in_data_t * decoder_data = dsc->user_data;
lv_fs_file_t * f = &decoder_data->f;
uint32_t bpp = lv_color_format_get_bpp(cf);
@@ -527,7 +528,7 @@ lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_ima
img_data = lv_malloc(len);
LV_ASSERT_NULL(img_data);
if(img_data == NULL)
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
*decoded_area = *full_area;
decoded_area->y2 = decoded_area->y1;
@@ -540,7 +541,7 @@ lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_ima
}
if(decoded_area->y1 > full_area->y2) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
if(LV_COLOR_FORMAT_IS_INDEXED(cf)) {
@@ -549,7 +550,7 @@ lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_ima
uint8_t * buf = lv_malloc(len);
LV_ASSERT_NULL(buf);
if(buf == NULL)
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
offset += dsc->palette_size * 4; /*Skip palette*/
offset += decoded_area->y1 * ((dsc->header.w * bpp + 7) / 8); /*Move to y1*/
@@ -557,14 +558,14 @@ lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_ima
res = fs_read_file_at(f, offset, buf, len, NULL);
if(res != LV_FS_RES_OK) {
lv_free(buf);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
decode_indexed_line(cf, dsc->palette, x_fraction, 0, w_px, buf, (lv_color32_t *)img_data);
lv_free(buf);
dsc->img_data = img_data; /*Return decoded image*/
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
if(cf == LV_COLOR_FORMAT_ARGB8888 || cf == LV_COLOR_FORMAT_XRGB8888 || cf == LV_COLOR_FORMAT_RGB888
@@ -574,11 +575,11 @@ lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_ima
offset += decoded_area->x1 * bpp / 8; /*Move to x1*/
res = fs_read_file_at(f, offset, img_data, len, NULL);
if(res != LV_FS_RES_OK) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
dsc->img_data = img_data; /*Return decoded image*/
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
@@ -589,7 +590,7 @@ lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_ima
offset += decoded_area->x1 * bpp / 8; /*Move to x1*/
res = fs_read_file_at(f, offset, img_data, len, NULL);
if(res != LV_FS_RES_OK) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
/*Now the A8 mask*/
@@ -599,23 +600,23 @@ lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_ima
offset += decoded_area->x1 * 1; /*Move to x1*/
res = fs_read_file_at(f, offset, img_data + len, w_px * 1, NULL);
if(res != LV_FS_RES_OK) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
dsc->img_data = img_data; /*Return decoded image*/
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
/**********************
* STATIC FUNCTIONS
**********************/
-static lv_res_t decode_indexed_line(lv_color_format_t color_format, const lv_color32_t * palette, lv_coord_t x,
- lv_coord_t y,
- lv_coord_t w_px, const uint8_t * in, lv_color32_t * out)
+static lv_result_t decode_indexed_line(lv_color_format_t color_format, const lv_color32_t * palette, lv_coord_t x,
+ lv_coord_t y,
+ lv_coord_t w_px, const uint8_t * in, lv_color32_t * out)
{
uint8_t px_size;
uint16_t mask;
@@ -654,7 +655,7 @@ static lv_res_t decode_indexed_line(lv_color_format_t color_format, const lv_col
shift = 0;
break;
default:
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
mask = (1 << px_size) - 1; /*E.g. px_size = 2; mask = 0x03*/
@@ -670,7 +671,7 @@ static lv_res_t decode_indexed_line(lv_color_format_t color_format, const lv_col
in++;
}
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
static uint32_t img_width_to_stride(lv_image_header_t * header)
diff --git a/src/draw/lv_image_decoder.h b/src/draw/lv_image_decoder.h
index b1ab2c396d..7b71ba834c 100644
--- a/src/draw/lv_image_decoder.h
+++ b/src/draw/lv_image_decoder.h
@@ -53,18 +53,18 @@ struct _lv_image_decoder_t;
* @param src the image source. Can be a pointer to a C array or a file name (Use
* `lv_image_src_get_type` to determine the type)
* @param header store the info here
- * @return LV_RES_OK: info written correctly; LV_RES_INV: failed
+ * @return LV_RESULT_OK: info written correctly; LV_RESULT_INVALID: failed
*/
-typedef lv_res_t (*lv_image_decoder_info_f_t)(struct _lv_image_decoder_t * decoder, const void * src,
- lv_image_header_t * header);
+typedef lv_result_t (*lv_image_decoder_info_f_t)(struct _lv_image_decoder_t * decoder, const void * src,
+ lv_image_header_t * header);
/**
* Open an image for decoding. Prepare it as it is required to read it later
* @param decoder pointer to the decoder the function associated with
* @param dsc pointer to decoder descriptor. `src`, `color` are already initialized in it.
*/
-typedef lv_res_t (*lv_image_decoder_open_f_t)(struct _lv_image_decoder_t * decoder,
- struct _lv_image_decoder_dsc_t * dsc);
+typedef lv_result_t (*lv_image_decoder_open_f_t)(struct _lv_image_decoder_t * decoder,
+ struct _lv_image_decoder_dsc_t * dsc);
/**
* Decode `len` pixels starting from the given `x`, `y` coordinates and store them in `buf`.
@@ -75,11 +75,11 @@ typedef lv_res_t (*lv_image_decoder_open_f_t)(struct _lv_image_decoder_t * decod
* @param y start y coordinate
* @param len number of pixels to decode
* @param buf a buffer to store the decoded pixels
- * @return LV_RES_OK: ok; LV_RES_INV: failed
+ * @return LV_RESULT_OK: ok; LV_RESULT_INVALID: failed
*/
-typedef lv_res_t (*lv_image_decoder_get_area_cb_t)(struct _lv_image_decoder_t * decoder,
- struct _lv_image_decoder_dsc_t * dsc,
- const lv_area_t * full_area, lv_area_t * decoded_area);
+typedef lv_result_t (*lv_image_decoder_get_area_cb_t)(struct _lv_image_decoder_t * decoder,
+ struct _lv_image_decoder_dsc_t * dsc,
+ const lv_area_t * full_area, lv_area_t * decoded_area);
/**
* Close the pending decoding. Free resources etc.
@@ -153,9 +153,9 @@ void _lv_image_decoder_init(void);
* 2) Variable: Pointer to an `lv_image_dsc_t` variable
* 3) Symbol: E.g. `LV_SYMBOL_OK`
* @param header the image info will be stored here
- * @return LV_RES_OK: success; LV_RES_INV: wasn't able to get info about the image
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: wasn't able to get info about the image
*/
-lv_res_t lv_image_decoder_get_info(const void * src, lv_image_header_t * header);
+lv_result_t lv_image_decoder_get_info(const void * src, lv_image_header_t * header);
/**
* Open an image.
@@ -167,10 +167,10 @@ lv_res_t lv_image_decoder_get_info(const void * src, lv_image_header_t * header)
* 3) Symbol: E.g. `LV_SYMBOL_OK`
* @param color The color of the image with `LV_IMAGE_CF_ALPHA_...`
* @param frame_id the index of the frame. Used only with animated images, set 0 for normal images
- * @return LV_RES_OK: opened the image. `dsc->img_data` and `dsc->header` are set.
- * LV_RES_INV: none of the registered image decoders were able to open the image.
+ * @return LV_RESULT_OK: opened the image. `dsc->img_data` and `dsc->header` are set.
+ * LV_RESULT_INVALID: none of the registered image decoders were able to open the image.
*/
-lv_res_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, lv_color_t color, int32_t frame_id);
+lv_result_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, lv_color_t color, int32_t frame_id);
/**
* Read a line from an opened image
@@ -179,9 +179,10 @@ lv_res_t lv_image_decoder_open(lv_image_decoder_dsc_t * dsc, const void * src, l
* @param y start Y coordinate (from top)
* @param len number of pixels to read
* @param buf store the data here
- * @return LV_RES_OK: success; LV_RES_INV: an error occurred
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: an error occurred
*/
-lv_res_t lv_image_decoder_get_area(lv_image_decoder_dsc_t * dsc, const lv_area_t * full_area, lv_area_t * decoded_area);
+lv_result_t lv_image_decoder_get_area(lv_image_decoder_dsc_t * dsc, const lv_area_t * full_area,
+ lv_area_t * decoded_area);
/**
* Close a decoding session
@@ -234,23 +235,20 @@ void lv_image_decoder_set_close_cb(lv_image_decoder_t * decoder, lv_image_decode
* @param decoder the decoder where this function belongs
* @param src the image source: pointer to an `lv_image_dsc_t` variable, a file path or a symbol
* @param header store the image data here
- * @return LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error.
+ * @return LV_RESULT_OK: the info is successfully stored in `header`; LV_RESULT_INVALID: unknown format or other error.
*/
-lv_res_t lv_image_decoder_built_in_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
+lv_result_t lv_image_decoder_built_in_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
-lv_res_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
- const lv_area_t * full_area, lv_area_t * decoded_area);
-
-lv_res_t lv_img_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
- const lv_area_t * full_area, lv_area_t * decoded_area);
+lv_result_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
+ const lv_area_t * full_area, lv_area_t * decoded_area);
/**
* Open a built in image
* @param decoder the decoder where this function belongs
* @param dsc pointer to decoder descriptor. `src`, `style` are already initialized in it.
- * @return LV_RES_OK: the info is successfully stored in `header`; LV_RES_INV: unknown format or other error.
+ * @return LV_RESULT_OK: the info is successfully stored in `header`; LV_RESULT_INVALID: unknown format or other error.
*/
-lv_res_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc);
+lv_result_t lv_image_decoder_built_in_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc);
/**
* Close the pending decoding. Free resources etc.
diff --git a/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c b/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c
index 24e6656e9a..6580ad6f19 100644
--- a/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c
+++ b/src/draw/sw/blend/lv_draw_sw_blend_to_argb8888.c
@@ -11,7 +11,7 @@
#include "lv_draw_sw_blend.h"
#include "../../../misc/lv_math.h"
-#include "../../../disp/lv_disp.h"
+#include "../../../display/lv_display.h"
#include "../../../core/lv_refr.h"
#include "../../../misc/lv_color.h"
#include "../../../stdlib/lv_string.h"
diff --git a/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c b/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c
index d4b80fb19e..f788a2d557 100644
--- a/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c
+++ b/src/draw/sw/blend/lv_draw_sw_blend_to_rgb565.c
@@ -11,7 +11,7 @@
#include "lv_draw_sw_blend.h"
#include "../../../misc/lv_math.h"
-#include "../../../disp/lv_disp.h"
+#include "../../../display/lv_display.h"
#include "../../../core/lv_refr.h"
#include "../../../misc/lv_color.h"
#include "../../../stdlib/lv_string.h"
diff --git a/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c b/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c
index 581cb865a9..3809c55219 100644
--- a/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c
+++ b/src/draw/sw/blend/lv_draw_sw_blend_to_rgb888.c
@@ -11,7 +11,7 @@
#include "lv_draw_sw_blend.h"
#include "../../../misc/lv_math.h"
-#include "../../../disp/lv_disp.h"
+#include "../../../display/lv_display.h"
#include "../../../core/lv_refr.h"
#include "../../../misc/lv_color.h"
#include "../../../stdlib/lv_string.h"
diff --git a/src/draw/sw/lv_draw_sw.c b/src/draw/sw/lv_draw_sw.c
index d8a1503123..4907ec215c 100644
--- a/src/draw/sw/lv_draw_sw.c
+++ b/src/draw/sw/lv_draw_sw.c
@@ -11,7 +11,7 @@
#include "../../core/lv_refr.h"
#include "lv_draw_sw.h"
-#include "../../disp/lv_disp_private.h"
+#include "../../display/lv_display_private.h"
#include "../../stdlib/lv_string.h"
/*********************
@@ -182,7 +182,7 @@ static void execute_drawing(lv_draw_sw_unit_t * u)
if(!_lv_area_intersect(&draw_area, &t->area, u->base_unit.clip_area)) return;
int32_t idx = 0;
- lv_disp_t * disp = _lv_refr_get_disp_refreshing();
+ lv_display_t * disp = _lv_refr_get_disp_refreshing();
lv_draw_unit_t * draw_unit_tmp = disp->draw_unit_head;
while(draw_unit_tmp != (lv_draw_unit_t *)u) {
draw_unit_tmp = draw_unit_tmp->next;
@@ -198,7 +198,7 @@ static void execute_drawing(lv_draw_sw_unit_t * u)
lv_draw_sw_fill((lv_draw_unit_t *)u, &rect_dsc, &draw_area);
lv_point_t txt_size;
- lv_txt_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE);
lv_area_t txt_area;
txt_area.x1 = draw_area.x1;
diff --git a/src/draw/sw/lv_draw_sw.h b/src/draw/sw/lv_draw_sw.h
index fb760daed5..5687a358ad 100644
--- a/src/draw/sw/lv_draw_sw.h
+++ b/src/draw/sw/lv_draw_sw.h
@@ -18,7 +18,7 @@ extern "C" {
#include "../../misc/lv_area.h"
#include "../../misc/lv_color.h"
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../../osal/lv_os.h"
/*********************
diff --git a/src/draw/sw/lv_draw_sw_bg_img.c b/src/draw/sw/lv_draw_sw_bg_img.c
index 25b593c4ed..aea9d60436 100644
--- a/src/draw/sw/lv_draw_sw_bg_img.c
+++ b/src/draw/sw/lv_draw_sw_bg_img.c
@@ -11,7 +11,7 @@
#include "blend/lv_draw_sw_blend.h"
#include "../../misc/lv_math.h"
-#include "../../misc/lv_txt_ap.h"
+#include "../../misc/lv_text_ap.h"
#include "../../core/lv_refr.h"
#include "../../misc/lv_assert.h"
#include "../lv_draw_mask.h"
@@ -56,7 +56,7 @@ void lv_draw_sw_bg_image(lv_draw_unit_t * draw_unit, const lv_draw_bg_image_dsc_
lv_image_src_t src_type = lv_image_src_get_type(dsc->src);
if(src_type == LV_IMAGE_SRC_SYMBOL) {
lv_point_t size;
- lv_txt_get_size(&size, dsc->src, dsc->font, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&size, dsc->src, dsc->font, 0, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
lv_area_t a;
a.x1 = coords->x1 + lv_area_get_width(coords) / 2 - size.x / 2;
a.x2 = a.x1 + size.x - 1;
diff --git a/src/draw/sw/lv_draw_sw_border.c b/src/draw/sw/lv_draw_sw_border.c
index 11de501ceb..f54953db86 100644
--- a/src/draw/sw/lv_draw_sw_border.c
+++ b/src/draw/sw/lv_draw_sw_border.c
@@ -11,7 +11,7 @@
#include "blend/lv_draw_sw_blend.h"
#include "../../misc/lv_math.h"
-#include "../../misc/lv_txt_ap.h"
+#include "../../misc/lv_text_ap.h"
#include "../../core/lv_refr.h"
#include "../../misc/lv_assert.h"
#include "../../stdlib/lv_string.h"
diff --git a/src/draw/sw/lv_draw_sw_fill.c b/src/draw/sw/lv_draw_sw_fill.c
index 181f3532e8..12ec7888a2 100644
--- a/src/draw/sw/lv_draw_sw_fill.c
+++ b/src/draw/sw/lv_draw_sw_fill.c
@@ -12,7 +12,7 @@
#include "blend/lv_draw_sw_blend.h"
#include "lv_draw_sw_gradient.h"
#include "../../misc/lv_math.h"
-#include "../../misc/lv_txt_ap.h"
+#include "../../misc/lv_text_ap.h"
#include "../../core/lv_refr.h"
#include "../../misc/lv_assert.h"
#include "../../stdlib/lv_string.h"
diff --git a/src/draw/sw/lv_draw_sw_gradient.c b/src/draw/sw/lv_draw_sw_gradient.c
index 7ca5280792..5f440fd59f 100644
--- a/src/draw/sw/lv_draw_sw_gradient.c
+++ b/src/draw/sw/lv_draw_sw_gradient.c
@@ -29,7 +29,7 @@
/**********************
* STATIC PROTOTYPES
**********************/
-typedef lv_res_t (*op_cache_t)(lv_grad_t * c, void * ctx);
+typedef lv_result_t (*op_cache_t)(lv_grad_t * c, void * ctx);
static lv_grad_t * allocate_item(const lv_grad_dsc_t * g, lv_coord_t w, lv_coord_t h);
/**********************
diff --git a/src/draw/sw/lv_draw_sw_img.c b/src/draw/sw/lv_draw_sw_img.c
index f2ad9f77dd..aaed3a434a 100644
--- a/src/draw/sw/lv_draw_sw_img.c
+++ b/src/draw/sw/lv_draw_sw_img.c
@@ -9,8 +9,8 @@
#include "lv_draw_sw.h"
#if LV_USE_DRAW_SW
-#include "../../disp/lv_disp.h"
-#include "../../disp/lv_disp_private.h"
+#include "../../display/lv_display.h"
+#include "../../display/lv_display_private.h"
#include "../../misc/lv_log.h"
#include "../../core/lv_refr.h"
#include "../../stdlib/lv_mem.h"
@@ -22,7 +22,7 @@
/*********************
* DEFINES
*********************/
-#define MAX_BUF_SIZE (uint32_t) 4 * lv_draw_buf_width_to_stride(lv_disp_get_hor_res(_lv_refr_get_disp_refreshing()), lv_disp_get_color_format(_lv_refr_get_disp_refreshing()))
+#define MAX_BUF_SIZE (uint32_t) 4 * lv_draw_buf_width_to_stride(lv_display_get_horizontal_resolution(_lv_refr_get_disp_refreshing()), lv_display_get_color_format(_lv_refr_get_disp_refreshing()))
/**********************
* TYPEDEFS
@@ -71,11 +71,11 @@ void lv_draw_sw_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dr
#if LV_USE_LAYER_DEBUG || LV_USE_PARALLEL_DRAW_DEBUG
lv_area_t area_rot;
lv_area_copy(&area_rot, coords);
- if(draw_dsc->angle || draw_dsc->zoom != LV_ZOOM_NONE) {
+ if(draw_dsc->rotation || draw_dsc->zoom != LV_SCALE_NONE) {
int32_t w = lv_area_get_width(coords);
int32_t h = lv_area_get_height(coords);
- _lv_image_buf_get_transformed_area(&area_rot, w, h, draw_dsc->angle, draw_dsc->zoom, &draw_dsc->pivot);
+ _lv_image_buf_get_transformed_area(&area_rot, w, h, draw_dsc->rotation, draw_dsc->zoom, &draw_dsc->pivot);
area_rot.x1 += coords->x1;
area_rot.y1 += coords->y1;
@@ -104,7 +104,7 @@ void lv_draw_sw_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dr
#if LV_USE_PARALLEL_DRAW_DEBUG
uint32_t idx = 0;
- lv_disp_t * disp = _lv_refr_get_disp_refreshing();
+ lv_display_t * disp = _lv_refr_get_disp_refreshing();
lv_draw_unit_t * draw_unit_tmp = disp->draw_unit_head;
while(draw_unit_tmp != draw_unit) {
draw_unit_tmp = draw_unit_tmp->next;
@@ -121,7 +121,7 @@ void lv_draw_sw_layer(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dr
lv_draw_sw_rect(draw_unit, &rect_dsc, &area_rot);
lv_point_t txt_size;
- lv_txt_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&txt_size, "W", LV_FONT_DEFAULT, 0, 0, 100, LV_TEXT_FLAG_NONE);
lv_area_t txt_area;
txt_area.x1 = draw_area.x1;
@@ -150,11 +150,11 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_image(lv_draw_unit_t * draw_unit, const lv
{
lv_area_t transformed_area;
lv_area_copy(&transformed_area, coords);
- if(draw_dsc->angle || draw_dsc->zoom != LV_ZOOM_NONE) {
+ if(draw_dsc->rotation || draw_dsc->zoom != LV_SCALE_NONE) {
int32_t w = lv_area_get_width(coords);
int32_t h = lv_area_get_height(coords);
- _lv_image_buf_get_transformed_area(&transformed_area, w, h, draw_dsc->angle, draw_dsc->zoom, &draw_dsc->pivot);
+ _lv_image_buf_get_transformed_area(&transformed_area, w, h, draw_dsc->rotation, draw_dsc->zoom, &draw_dsc->pivot);
transformed_area.x1 += coords->x1;
transformed_area.y1 += coords->y1;
@@ -169,8 +169,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_image(lv_draw_unit_t * draw_unit, const lv
}
lv_image_decoder_dsc_t decoder_dsc;
- lv_res_t res = lv_image_decoder_open(&decoder_dsc, draw_dsc->src, draw_dsc->recolor, -1);
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_image_decoder_open(&decoder_dsc, draw_dsc->src, draw_dsc->recolor, -1);
+ if(res != LV_RESULT_OK) {
LV_LOG_ERROR("Failed to open image");
return;
}
@@ -195,13 +195,13 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_image(lv_draw_unit_t * draw_unit, const lv
relative_decoded_area.y1 = LV_COORD_MIN;
relative_decoded_area.x2 = LV_COORD_MIN;
relative_decoded_area.y2 = LV_COORD_MIN;
- res = LV_RES_OK;
- while(res == LV_RES_OK) {
+ res = LV_RESULT_OK;
+ while(res == LV_RESULT_OK) {
res = lv_image_decoder_get_area(&decoder_dsc, &relative_full_area_to_decode, &relative_decoded_area);
lv_area_t absolute_decoded_area = relative_decoded_area;
lv_area_move(&absolute_decoded_area, coords->x1, coords->y1);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
/*Limit draw area to the current decoded area and draw the image*/
lv_area_t draw_area_sub;
if(_lv_area_intersect(&draw_area_sub, &draw_area, &absolute_decoded_area)) {
@@ -219,7 +219,7 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_image(lv_draw_unit_t * draw_unit, const lv
static void img_draw_core(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * draw_dsc, const lv_area_t * draw_area,
const lv_image_decoder_dsc_t * src, lv_draw_image_sup_t * sup, const lv_area_t * img_coords)
{
- bool transformed = draw_dsc->angle != 0 || draw_dsc->zoom != LV_ZOOM_NONE ? true : false;
+ bool transformed = draw_dsc->rotation != 0 || draw_dsc->zoom != LV_SCALE_NONE ? true : false;
lv_draw_sw_blend_dsc_t blend_dsc;
const uint8_t * src_buf = src->img_data;
diff --git a/src/draw/sw/lv_draw_sw_letter.c b/src/draw/sw/lv_draw_sw_letter.c
index 65215bc817..4f99ea2222 100644
--- a/src/draw/sw/lv_draw_sw_letter.c
+++ b/src/draw/sw/lv_draw_sw_letter.c
@@ -9,7 +9,7 @@
#include "lv_draw_sw.h"
#if LV_USE_DRAW_SW
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../../misc/lv_math.h"
#include "../../misc/lv_assert.h"
#include "../../misc/lv_area.h"
@@ -93,8 +93,8 @@ LV_ATTRIBUTE_FAST_MEM static void draw_letter_cb(lv_draw_unit_t * draw_unit, lv_
#if LV_USE_IMGFONT
lv_draw_image_dsc_t img_dsc;
lv_draw_image_dsc_init(&img_dsc);
- img_dsc.angle = 0;
- img_dsc.zoom = LV_ZOOM_NONE;
+ img_dsc.rotation = 0;
+ img_dsc.zoom = LV_SCALE_NONE;
img_dsc.opa = glyph_draw_dsc->opa;
img_dsc.src = glyph_draw_dsc->bitmap;
lv_draw_sw_image(draw_unit, &img_dsc, glyph_draw_dsc->letter_coords);
diff --git a/src/draw/sw/lv_draw_sw_line.c b/src/draw/sw/lv_draw_sw_line.c
index 503ae5e13b..b7edaa8efd 100644
--- a/src/draw/sw/lv_draw_sw_line.c
+++ b/src/draw/sw/lv_draw_sw_line.c
@@ -346,7 +346,7 @@ LV_ATTRIBUTE_FAST_MEM static void draw_line_skew(lv_draw_unit_t * draw_unit, con
/*Draw the background line by line*/
int32_t h;
- uint32_t hor_res = (uint32_t)lv_disp_get_hor_res(_lv_refr_get_disp_refreshing());
+ uint32_t hor_res = (uint32_t)lv_display_get_horizontal_resolution(_lv_refr_get_disp_refreshing());
size_t mask_buf_size = LV_MIN(lv_area_get_size(&blend_area), hor_res);
lv_opa_t * mask_buf = lv_malloc(mask_buf_size);
diff --git a/src/draw/sw/lv_draw_sw_transform.c b/src/draw/sw/lv_draw_sw_transform.c
index c540d6e006..5d82e10e87 100644
--- a/src/draw/sw/lv_draw_sw_transform.c
+++ b/src/draw/sw/lv_draw_sw_transform.c
@@ -86,7 +86,7 @@ void lv_draw_sw_transform(lv_draw_unit_t * draw_unit, const lv_area_t * dest_are
LV_UNUSED(sup);
point_transform_dsc_t tr_dsc;
- tr_dsc.angle = -draw_dsc->angle;
+ tr_dsc.angle = -draw_dsc->rotation;
tr_dsc.zoom = (256 * 256) / draw_dsc->zoom;
tr_dsc.pivot = draw_dsc->pivot;
@@ -570,7 +570,7 @@ static void transform_a8(const uint8_t * src, lv_coord_t src_w, lv_coord_t src_h
static void transform_point_upscaled(point_transform_dsc_t * t, int32_t xin, int32_t yin, int32_t * xout,
int32_t * yout)
{
- if(t->angle == 0 && t->zoom == LV_ZOOM_NONE) {
+ if(t->angle == 0 && t->zoom == LV_SCALE_NONE) {
*xout = xin * 256;
*yout = yin * 256;
return;
@@ -583,7 +583,7 @@ static void transform_point_upscaled(point_transform_dsc_t * t, int32_t xin, int
*xout = ((int32_t)(xin * t->zoom)) + (t->pivot_x_256);
*yout = ((int32_t)(yin * t->zoom)) + (t->pivot_y_256);
}
- else if(t->zoom == LV_ZOOM_NONE) {
+ else if(t->zoom == LV_SCALE_NONE) {
*xout = ((t->cosma * xin - t->sinma * yin) >> 2) + (t->pivot_x_256);
*yout = ((t->sinma * xin + t->cosma * yin) >> 2) + (t->pivot_y_256);
}
diff --git a/src/indev/lv_indev.c b/src/indev/lv_indev.c
index acdedf1ee5..5001992ce8 100644
--- a/src/indev/lv_indev.c
+++ b/src/indev/lv_indev.c
@@ -8,7 +8,7 @@
********************/
#include "lv_indev_private.h"
#include "lv_indev_scroll.h"
-#include "../disp/lv_disp_private.h"
+#include "../display/lv_display_private.h"
#include "../core/lv_global.h"
#include "../core/lv_obj.h"
#include "../core/lv_group.h"
@@ -65,7 +65,7 @@ static void indev_encoder_proc(lv_indev_t * i, lv_indev_data_t * data);
static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data);
static void indev_proc_press(lv_indev_t * indev);
static void indev_proc_release(lv_indev_t * indev);
-static lv_obj_t * pointer_search_obj(lv_disp_t * disp, lv_point_t * p);
+static lv_obj_t * pointer_search_obj(lv_display_t * disp, lv_point_t * p);
static void indev_proc_reset_query_handler(lv_indev_t * indev);
static void indev_click_focus(lv_indev_t * indev);
static void indev_gesture(lv_indev_t * indev);
@@ -92,7 +92,7 @@ static void indev_reset_core(lv_indev_t * indev, lv_obj_t * obj);
lv_indev_t * lv_indev_create(void)
{
- lv_disp_t * disp = lv_disp_get_default();
+ lv_display_t * disp = lv_display_get_default();
if(disp == NULL) {
LV_LOG_WARN("no display was created so far");
}
@@ -107,7 +107,7 @@ lv_indev_t * lv_indev_create(void)
indev->reset_query = 1;
indev->read_timer = lv_timer_create(lv_indev_read_timer_cb, LV_DEF_REFR_PERIOD, indev);
- indev->disp = lv_disp_get_default();
+ indev->disp = lv_display_get_default();
indev->type = LV_INDEV_TYPE_NONE;
indev->scroll_limit = LV_INDEV_DEF_SCROLL_LIMIT;
indev->scroll_throw = LV_INDEV_DEF_SCROLL_THROW;
@@ -308,14 +308,14 @@ lv_group_t * lv_indev_get_group(const lv_indev_t * indev)
return indev->group;
}
-lv_disp_t * lv_indev_get_disp(const lv_indev_t * indev)
+lv_display_t * lv_indev_get_disp(const lv_indev_t * indev)
{
if(indev == NULL) return NULL;
return indev->disp;
}
-void lv_indev_set_disp(lv_indev_t * indev, lv_disp_t * disp)
+void lv_indev_set_disp(lv_indev_t * indev, lv_display_t * disp)
{
if(indev == NULL) return;
@@ -362,7 +362,7 @@ void lv_indev_set_cursor(lv_indev_t * indev, lv_obj_t * cur_obj)
if(indev->type != LV_INDEV_TYPE_POINTER) return;
indev->cursor = cur_obj;
- lv_obj_set_parent(indev->cursor, lv_disp_get_layer_sys(indev->disp));
+ lv_obj_set_parent(indev->cursor, lv_display_get_layer_sys(indev->disp));
lv_obj_set_pos(indev->cursor, indev->pointer.act_point.x, indev->pointer.act_point.y);
lv_obj_clear_flag(indev->cursor, LV_OBJ_FLAG_CLICKABLE);
lv_obj_add_flag(indev->cursor, LV_OBJ_FLAG_IGNORE_LAYOUT | LV_OBJ_FLAG_FLOATING);
@@ -508,16 +508,16 @@ lv_obj_t * lv_indev_search_obj(lv_obj_t * obj, lv_point_t * point)
*/
static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data)
{
- lv_disp_t * disp = i->disp;
+ lv_display_t * disp = i->disp;
/*Save the raw points so they can be used again in indev_read_core*/
i->pointer.last_raw_point.x = data->point.x;
i->pointer.last_raw_point.y = data->point.y;
- if(disp->rotation == LV_DISP_ROTATION_180 || disp->rotation == LV_DISP_ROTATION_270) {
+ if(disp->rotation == LV_DISPLAY_ROTATION_180 || disp->rotation == LV_DISPLAY_ROTATION_270) {
data->point.x = disp->hor_res - data->point.x - 1;
data->point.y = disp->ver_res - data->point.y - 1;
}
- if(disp->rotation == LV_DISP_ROTATION_90 || disp->rotation == LV_DISP_ROTATION_270) {
+ if(disp->rotation == LV_DISPLAY_ROTATION_90 || disp->rotation == LV_DISPLAY_ROTATION_270) {
lv_coord_t tmp = data->point.y;
data->point.y = data->point.x;
data->point.x = disp->ver_res - tmp - 1;
@@ -527,13 +527,13 @@ static void indev_pointer_proc(lv_indev_t * i, lv_indev_data_t * data)
if(data->point.x < 0) {
LV_LOG_WARN("X is %d which is smaller than zero", (int)data->point.x);
}
- if(data->point.x >= lv_disp_get_hor_res(i->disp)) {
+ if(data->point.x >= lv_display_get_horizontal_resolution(i->disp)) {
LV_LOG_WARN("X is %d which is greater than hor. res", (int)data->point.x);
}
if(data->point.y < 0) {
LV_LOG_WARN("Y is %d which is smaller than zero", (int)data->point.y);
}
- if(data->point.y >= lv_disp_get_ver_res(i->disp)) {
+ if(data->point.y >= lv_display_get_vertical_resolution(i->disp)) {
LV_LOG_WARN("Y is %d which is greater than ver. res", (int)data->point.y);
}
@@ -589,7 +589,7 @@ static void indev_keypad_proc(lv_indev_t * i, lv_indev_data_t * data)
i->keypad.last_key = data->key;
/*Save the previous state so we can detect state changes below and also set the last state now
- *so if any event handler on the way returns `LV_RES_INV` the last state is remembered
+ *so if any event handler on the way returns `LV_RESULT_INVALID` the last state is remembered
*for the next time*/
uint32_t prev_state = i->keypad.last_state;
i->keypad.last_state = data->state;
@@ -980,7 +980,7 @@ static void indev_button_proc(lv_indev_t * i, lv_indev_data_t * data)
/**
* Process the pressed state of LV_INDEV_TYPE_POINTER input devices
* @param indev pointer to an input device 'proc'
- * @return LV_RES_OK: no indev reset required; LV_RES_INV: indev reset is required
+ * @return LV_RESULT_OK: no indev reset required; LV_RESULT_INVALID: indev reset is required
*/
static void indev_proc_press(lv_indev_t * indev)
{
@@ -990,7 +990,7 @@ static void indev_proc_press(lv_indev_t * indev)
if(indev->wait_until_release != 0) return;
- lv_disp_t * disp = indev_act->disp;
+ lv_display_t * disp = indev_act->disp;
bool new_obj_searched = false;
/*If there is no last object then search*/
@@ -1163,13 +1163,13 @@ static void indev_proc_release(lv_indev_t * indev)
lv_point_t pivot = { 0, 0 };
lv_obj_t * parent = scroll_obj;
while(parent) {
- angle += lv_obj_get_style_transform_angle(parent, 0);
- int32_t zoom_act = lv_obj_get_style_transform_zoom_safe(parent, 0);
+ angle += lv_obj_get_style_transform_rotation(parent, 0);
+ int32_t zoom_act = lv_obj_get_style_transform_scale_safe(parent, 0);
zoom = (zoom * zoom_act) >> 8;
parent = lv_obj_get_parent(parent);
}
- if(angle != 0 || zoom != LV_ZOOM_NONE) {
+ if(angle != 0 || zoom != LV_SCALE_NONE) {
angle = -angle;
zoom = (256 * 256) / zoom;
lv_point_transform(&indev->pointer.scroll_throw_vect, angle, zoom, &pivot);
@@ -1185,18 +1185,18 @@ static void indev_proc_release(lv_indev_t * indev)
}
}
-static lv_obj_t * pointer_search_obj(lv_disp_t * disp, lv_point_t * p)
+static lv_obj_t * pointer_search_obj(lv_display_t * disp, lv_point_t * p)
{
- indev_obj_act = lv_indev_search_obj(lv_disp_get_layer_sys(disp), p);
+ indev_obj_act = lv_indev_search_obj(lv_display_get_layer_sys(disp), p);
if(indev_obj_act) return indev_obj_act;
- indev_obj_act = lv_indev_search_obj(lv_disp_get_layer_top(disp), p);
+ indev_obj_act = lv_indev_search_obj(lv_display_get_layer_top(disp), p);
if(indev_obj_act) return indev_obj_act;
- indev_obj_act = lv_indev_search_obj(lv_disp_get_scr_act(disp), p);
+ indev_obj_act = lv_indev_search_obj(lv_display_get_scr_act(disp), p);
if(indev_obj_act) return indev_obj_act;
- indev_obj_act = lv_indev_search_obj(lv_disp_get_layer_bottom(disp), p);
+ indev_obj_act = lv_indev_search_obj(lv_display_get_layer_bottom(disp), p);
return indev_obj_act;
}
diff --git a/src/indev/lv_indev.h b/src/indev/lv_indev.h
index 93af4031b6..54bf0f4370 100644
--- a/src/indev/lv_indev.h
+++ b/src/indev/lv_indev.h
@@ -25,10 +25,10 @@ extern "C" {
* TYPEDEFS
**********************/
struct _lv_obj_t;
-struct _lv_disp_t;
+struct _lv_display_t;
struct _lv_group_t;
struct _lv_indev_t;
-struct _lv_disp_t;
+struct _lv_display_t;
typedef struct _lv_indev_t lv_indev_t;
/** Possible input device types*/
@@ -129,9 +129,9 @@ lv_indev_state_t lv_indev_get_state(const lv_indev_t * indev);
lv_group_t * lv_indev_get_group(const lv_indev_t * indev);
-struct _lv_disp_t * lv_indev_get_disp(const lv_indev_t * indev);
+struct _lv_display_t * lv_indev_get_disp(const lv_indev_t * indev);
-void lv_indev_set_disp(lv_indev_t * indev, struct _lv_disp_t * disp);
+void lv_indev_set_disp(lv_indev_t * indev, struct _lv_display_t * disp);
void * lv_indev_get_user_data(const lv_indev_t * indev);
diff --git a/src/indev/lv_indev_private.h b/src/indev/lv_indev_private.h
index 924da73102..01e813847d 100644
--- a/src/indev/lv_indev_private.h
+++ b/src/indev/lv_indev_private.h
@@ -51,7 +51,7 @@ struct _lv_indev_t {
void * user_data;
/**< Pointer to the assigned display*/
- struct _lv_disp_t * disp;
+ struct _lv_display_t * disp;
/**< Timer to periodically read the input device*/
lv_timer_t * read_timer;
diff --git a/src/indev/lv_indev_scroll.c b/src/indev/lv_indev_scroll.c
index 80f6249e82..c1d7206b76 100644
--- a/src/indev/lv_indev_scroll.c
+++ b/src/indev/lv_indev_scroll.c
@@ -67,13 +67,13 @@ void _lv_indev_scroll_handler(lv_indev_t * indev)
int16_t zoom = 256;
lv_obj_t * parent = scroll_obj;
while(parent) {
- angle += lv_obj_get_style_transform_angle(parent, 0);
- int32_t zoom_act = lv_obj_get_style_transform_zoom_safe(parent, 0);
+ angle += lv_obj_get_style_transform_rotation(parent, 0);
+ int32_t zoom_act = lv_obj_get_style_transform_scale_safe(parent, 0);
zoom = (zoom * zoom_act) >> 8;
parent = lv_obj_get_parent(parent);
}
- if(angle != 0 || zoom != LV_ZOOM_NONE) {
+ if(angle != 0 || zoom != LV_SCALE_NONE) {
angle = -angle;
zoom = (256 * 256) / zoom;
lv_point_t pivot = { 0, 0 };
@@ -293,14 +293,14 @@ static lv_obj_t * find_scroll_obj(lv_indev_t * indev)
lv_point_t pivot = { 0, 0 };
lv_obj_t * parent = obj_act;
while(parent) {
- angle += lv_obj_get_style_transform_angle(parent, 0);
- int32_t zoom_act = lv_obj_get_style_transform_zoom_safe(parent, 0);
+ angle += lv_obj_get_style_transform_rotation(parent, 0);
+ int32_t zoom_act = lv_obj_get_style_transform_scale_safe(parent, 0);
zoom = (zoom * zoom_act) >> 8;
parent = lv_obj_get_parent(parent);
}
lv_point_t obj_scroll_sum = indev->pointer.scroll_sum;
- if(angle != 0 || zoom != LV_ZOOM_NONE) {
+ if(angle != 0 || zoom != LV_SCALE_NONE) {
angle = -angle;
zoom = (256 * 256) / zoom;
lv_point_transform(&obj_scroll_sum, angle, zoom, &pivot);
diff --git a/src/libs/barcode/lv_barcode.c b/src/libs/barcode/lv_barcode.c
index 83e875c239..208008a47d 100644
--- a/src/libs/barcode/lv_barcode.c
+++ b/src/libs/barcode/lv_barcode.c
@@ -83,17 +83,17 @@ void lv_barcode_set_scale(lv_obj_t * obj, uint16_t scale)
barcode->scale = scale;
}
-lv_res_t lv_barcode_update(lv_obj_t * obj, const char * data)
+lv_result_t lv_barcode_update(lv_obj_t * obj, const char * data)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
LV_ASSERT_NULL(data);
- lv_res_t res = LV_RES_INV;
+ lv_result_t res = LV_RESULT_INVALID;
lv_barcode_t * barcode = (lv_barcode_t *)obj;
if(data == NULL || lv_strlen(data) == 0) {
LV_LOG_WARN("data is empty");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
size_t len = code128_estimate_len(data);
@@ -103,7 +103,7 @@ lv_res_t lv_barcode_update(lv_obj_t * obj, const char * data)
LV_ASSERT_MALLOC(out_buf);
if(!out_buf) {
LV_LOG_ERROR("malloc failed for out_buf");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
lv_coord_t barcode_w = code128_encode_gs1(data, out_buf, len);
@@ -127,7 +127,7 @@ lv_res_t lv_barcode_update(lv_obj_t * obj, const char * data)
}
}
- res = LV_RES_OK;
+ res = LV_RESULT_OK;
failed:
lv_free(out_buf);
diff --git a/src/libs/barcode/lv_barcode.h b/src/libs/barcode/lv_barcode.h
index 3b534bdb3d..d6075ae486 100644
--- a/src/libs/barcode/lv_barcode.h
+++ b/src/libs/barcode/lv_barcode.h
@@ -70,9 +70,9 @@ void lv_barcode_set_scale(lv_obj_t * obj, uint16_t scale);
* Set the data of a barcode object
* @param obj pointer to barcode object
* @param data data to display
- * @return LV_RES_OK: if no error; LV_RES_INV: on error
+ * @return LV_RESULT_OK: if no error; LV_RESULT_INVALID: on error
*/
-lv_res_t lv_barcode_update(lv_obj_t * obj, const char * data);
+lv_result_t lv_barcode_update(lv_obj_t * obj, const char * data);
/**
* Get the dark color of a barcode object
diff --git a/src/libs/bmp/lv_bmp.c b/src/libs/bmp/lv_bmp.c
index b7984dc3a8..3a1d3151d8 100644
--- a/src/libs/bmp/lv_bmp.c
+++ b/src/libs/bmp/lv_bmp.c
@@ -31,10 +31,10 @@ typedef struct {
/**********************
* STATIC PROTOTYPES
**********************/
-static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
-static lv_res_t decoder_open(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc);
+static lv_result_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
+static lv_result_t decoder_open(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc);
-static lv_res_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
+static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
const lv_area_t * full_area, lv_area_t * decoded_area);
static void decoder_close(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc);
@@ -67,9 +67,9 @@ void lv_bmp_init(void)
* Get info about a PNG image
* @param src can be file name or pointer to a C array
* @param header store the info here
- * @return LV_RES_OK: no error; LV_RES_INV: can't get the info
+ * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't get the info
*/
-static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
+static lv_result_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
{
LV_UNUSED(decoder);
@@ -82,7 +82,7 @@ static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_
/*Save the data in the header*/
lv_fs_file_t f;
lv_fs_res_t res = lv_fs_open(&f, src, LV_FS_MODE_RD);
- if(res != LV_FS_RES_OK) return LV_RES_INV;
+ if(res != LV_FS_RES_OK) return LV_RESULT_INVALID;
uint8_t headers[54];
lv_fs_read(&f, headers, 54, NULL);
@@ -109,18 +109,18 @@ static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_
break;
default:
LV_LOG_WARN("Not supported bpp: %d", bpp);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
/* BMP file as data not supported for simplicity.
* Convert them to LVGL compatible C arrays directly. */
else if(src_type == LV_IMAGE_SRC_VARIABLE) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_INV; /*If didn't succeeded earlier then it's an error*/
+ return LV_RESULT_INVALID; /*If didn't succeeded earlier then it's an error*/
}
@@ -130,7 +130,7 @@ static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_
* @param style style of the image object (unused now but certain formats might use it)
* @return pointer to the decoded image or `LV_IMAGE_DECODER_OPEN_FAIL` if failed
*/
-static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
+static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
{
LV_UNUSED(decoder);
@@ -139,21 +139,21 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
const char * fn = dsc->src;
if(strcmp(lv_fs_get_ext(fn), "bmp") != 0) {
- return LV_RES_INV; /*Check the extension*/
+ return LV_RESULT_INVALID; /*Check the extension*/
}
bmp_dsc_t b;
memset(&b, 0x00, sizeof(b));
lv_fs_res_t res = lv_fs_open(&b.f, dsc->src, LV_FS_MODE_RD);
- if(res == LV_RES_OK) return LV_RES_INV;
+ if(res == LV_RESULT_OK) return LV_RESULT_INVALID;
uint8_t header[54];
lv_fs_read(&b.f, header, 54, NULL);
if(0x42 != header[0] || 0x4d != header[1]) {
lv_fs_close(&b.f);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
memcpy(&b.px_offset, header + 10, 4);
@@ -164,22 +164,22 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
dsc->user_data = lv_malloc(sizeof(bmp_dsc_t));
LV_ASSERT_MALLOC(dsc->user_data);
- if(dsc->user_data == NULL) return LV_RES_INV;
+ if(dsc->user_data == NULL) return LV_RESULT_INVALID;
memcpy(dsc->user_data, &b, sizeof(b));
dsc->img_data = NULL;
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/* BMP file as data not supported for simplicity.
* Convert them to LVGL compatible C arrays directly. */
else if(dsc->src_type == LV_IMAGE_SRC_VARIABLE) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_INV; /*If not returned earlier then it failed*/
+ return LV_RESULT_INVALID; /*If not returned earlier then it failed*/
}
-static lv_res_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
+static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
const lv_area_t * full_area, lv_area_t * decoded_area)
{
LV_UNUSED(decoder);
@@ -198,7 +198,7 @@ static lv_res_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_
if(decoded_area->y1 > full_area->y2) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
else {
lv_coord_t y = (b->px_height - 1) - (decoded_area->y1); /*BMP images are stored upside down*/
@@ -207,7 +207,7 @@ static lv_res_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_
lv_fs_seek(&b->f, p, LV_FS_SEEK_SET);
lv_fs_read(&b->f, (void *)dsc->img_data, line_width_byte, NULL);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
diff --git a/src/libs/ffmpeg/lv_ffmpeg.c b/src/libs/ffmpeg/lv_ffmpeg.c
index 7e1c4eae62..f5344f7276 100644
--- a/src/libs/ffmpeg/lv_ffmpeg.c
+++ b/src/libs/ffmpeg/lv_ffmpeg.c
@@ -65,8 +65,8 @@ struct lv_image_pixel_color_s {
* STATIC PROTOTYPES
**********************/
-static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
-static lv_res_t decoder_open(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc);
+static lv_result_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
+static lv_result_t decoder_open(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc);
static void decoder_close(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc);
static struct ffmpeg_context_s * ffmpeg_open_file(const char * path);
@@ -135,10 +135,10 @@ lv_obj_t * lv_ffmpeg_player_create(lv_obj_t * parent)
return obj;
}
-lv_res_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path)
+lv_result_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
- lv_res_t res = LV_RES_INV;
+ lv_result_t res = LV_RESULT_INVALID;
lv_ffmpeg_player_t * player = (lv_ffmpeg_player_t *)obj;
@@ -190,7 +190,7 @@ lv_res_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path)
LV_LOG_WARN("unable to get frame refresh period");
}
- res = LV_RES_OK;
+ res = LV_RESULT_OK;
failed:
return res;
@@ -246,7 +246,7 @@ void lv_ffmpeg_player_set_auto_restart(lv_obj_t * obj, bool en)
* STATIC FUNCTIONS
**********************/
-static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
+static lv_result_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
{
LV_UNUSED(decoder);
@@ -258,17 +258,17 @@ static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_
if(ffmpeg_get_image_header(fn, header) < 0) {
LV_LOG_ERROR("ffmpeg can't get image header");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/* If didn't succeeded earlier then it's an error */
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
-static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
+static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
{
LV_UNUSED(decoder);
@@ -278,19 +278,19 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
struct ffmpeg_context_s * ffmpeg_ctx = ffmpeg_open_file(path);
if(ffmpeg_ctx == NULL) {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
if(ffmpeg_image_allocate(ffmpeg_ctx) < 0) {
LV_LOG_ERROR("ffmpeg image allocate failed");
ffmpeg_close(ffmpeg_ctx);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
if(ffmpeg_update_next_frame(ffmpeg_ctx) < 0) {
ffmpeg_close(ffmpeg_ctx);
LV_LOG_ERROR("ffmpeg update frame failed");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
ffmpeg_close_src_ctx(ffmpeg_ctx);
@@ -300,11 +300,11 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
dsc->img_data = img_data;
/* The image is fully decoded. Return with its pointer */
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/* If not returned earlier then it failed */
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
diff --git a/src/libs/ffmpeg/lv_ffmpeg.h b/src/libs/ffmpeg/lv_ffmpeg.h
index 97191942cc..56b80c91b2 100644
--- a/src/libs/ffmpeg/lv_ffmpeg.h
+++ b/src/libs/ffmpeg/lv_ffmpeg.h
@@ -69,9 +69,9 @@ lv_obj_t * lv_ffmpeg_player_create(lv_obj_t * parent);
* Set the path of the file to be played
* @param obj pointer to a ffmpeg_player object
* @param path video file path
- * @return LV_RES_OK: no error; LV_RES_INV: can't get the info.
+ * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't get the info.
*/
-lv_res_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path);
+lv_result_t lv_ffmpeg_player_set_src(lv_obj_t * obj, const char * path);
/**
* Set command control video player
diff --git a/src/libs/freetype/lv_freetype.c b/src/libs/freetype/lv_freetype.c
index ce6e2d4405..093cc342e7 100644
--- a/src/libs/freetype/lv_freetype.c
+++ b/src/libs/freetype/lv_freetype.c
@@ -91,20 +91,20 @@ static const uint8_t * freetype_get_glyph_bitmap_cb(const lv_font_t * font,
* GLOBAL FUNCTIONS
**********************/
-lv_res_t lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_bytes)
+lv_result_t lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_bytes)
{
FT_Error error;
lv_freetype_context_t * context = ft_ctx = lv_malloc(sizeof(lv_freetype_context_t));
LV_ASSERT_MALLOC(context);
if(!context) {
LV_LOG_ERROR("malloc failed for lv_freetype_context_t");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
error = FT_Init_FreeType(&context->library);
if(error) {
FT_ERROR_MSG("FT_Init_FreeType", error);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
error = FTC_Manager_New(context->library,
@@ -117,7 +117,7 @@ lv_res_t lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_b
if(error) {
FT_Done_FreeType(context->library);
FT_ERROR_MSG("FTC_Manager_New", error);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
error = FTC_CMapCache_New(context->cache_manager, &context->cmap_cache);
@@ -140,11 +140,11 @@ lv_res_t lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_b
}
#endif
- return LV_RES_OK;
+ return LV_RESULT_OK;
failed:
FTC_Manager_Done(context->cache_manager);
FT_Done_FreeType(context->library);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
void lv_freetype_uninit(void)
diff --git a/src/libs/freetype/lv_freetype.h b/src/libs/freetype/lv_freetype.h
index 2f30589855..8ebedbc624 100644
--- a/src/libs/freetype/lv_freetype.h
+++ b/src/libs/freetype/lv_freetype.h
@@ -39,9 +39,9 @@ typedef enum {
* @param max_sizes Maximum number of opened FT_Size objects managed by this cache instance. Use 0 for defaults.
* @param max_bytes Maximum number of bytes to use for cached data nodes. Use 0 for defaults.
* Note that this value does not account for managed FT_Face and FT_Size objects.
- * @return LV_RES_OK on success, otherwise LV_RES_INV.
+ * @return LV_RESULT_OK on success, otherwise LV_RESULT_INVALID.
*/
-lv_res_t lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_bytes);
+lv_result_t lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_bytes);
/**
* Uninitialize the freetype library
diff --git a/src/libs/gif/lv_gif.c b/src/libs/gif/lv_gif.c
index 9e0f5aef77..85f05dd25c 100644
--- a/src/libs/gif/lv_gif.c
+++ b/src/libs/gif/lv_gif.c
@@ -147,7 +147,7 @@ static void next_frame_task_cb(lv_timer_t * t)
int has_next = gd_get_frame(gifobj->gif);
if(has_next == 0) {
/*It was the last repeat*/
- lv_res_t res = lv_obj_send_event(obj, LV_EVENT_READY, NULL);
+ lv_result_t res = lv_obj_send_event(obj, LV_EVENT_READY, NULL);
lv_timer_pause(t);
if(res != LV_FS_RES_OK) return;
}
diff --git a/src/libs/jpg/lv_jpg.c b/src/libs/jpg/lv_jpg.c
index e6a73ec582..22786a9aba 100644
--- a/src/libs/jpg/lv_jpg.c
+++ b/src/libs/jpg/lv_jpg.c
@@ -64,10 +64,10 @@
/**********************
* STATIC PROTOTYPES
**********************/
-static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
-static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc);
+static lv_result_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
+static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc);
-static lv_res_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
+static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
const lv_area_t * full_area, lv_area_t * decoded_area);
static void decoder_close(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc);
static size_t input_func(JDEC * jd, uint8_t * buff, size_t ndata);
@@ -98,7 +98,7 @@ void lv_jpg_init(void)
* STATIC FUNCTIONS
**********************/
-static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
+static lv_result_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
{
LV_UNUSED(decoder);
@@ -115,7 +115,7 @@ static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_
header->w = img_dsc->header.w;
header->h = img_dsc->header.h;
header->stride = img_dsc->header.w * 3;
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
@@ -125,7 +125,7 @@ static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_
lv_fs_file_t f;
lv_fs_res_t res;
res = lv_fs_open(&f, fn, LV_FS_MODE_RD);
- if(res != LV_FS_RES_OK) return LV_RES_INV;
+ if(res != LV_FS_RES_OK) return LV_RESULT_INVALID;
uint8_t workb[TJPGD_WORKBUFF_SIZE];
JDEC jd;
@@ -133,7 +133,7 @@ static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_
if(rc) {
LV_LOG_WARN("jd_prepare error: %d", rc);
lv_fs_close(&f);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
header->always_zero = 0;
header->cf = LV_COLOR_FORMAT_RAW;
@@ -142,10 +142,10 @@ static lv_res_t decoder_info(lv_image_decoder_t * decoder, const void * src, lv_
header->stride = jd.width * 3;
lv_fs_close(&f);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
static size_t input_func(JDEC * jd, uint8_t * buff, size_t ndata)
@@ -167,7 +167,7 @@ static size_t input_func(JDEC * jd, uint8_t * buff, size_t ndata)
return 0;
}
-static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
+static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
{
LV_UNUSED(decoder);
lv_fs_file_t * f = lv_malloc(sizeof(lv_fs_file_t));
@@ -180,7 +180,7 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
res = lv_fs_open(f, (const char *)&path, LV_FS_MODE_RD);
if(res != LV_FS_RES_OK) {
lv_free(f);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
}
}
@@ -191,7 +191,7 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
res = lv_fs_open(f, fn, LV_FS_MODE_RD);
if(res != LV_FS_RES_OK) {
lv_free(f);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
}
}
@@ -211,13 +211,13 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
if(rc != JDR_OK) {
lv_free(workb_temp);
lv_free(jd);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-static lv_res_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
+static lv_result_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc,
const lv_area_t * full_area, lv_area_t * decoded_area)
{
LV_UNUSED(decoder);
@@ -263,7 +263,7 @@ static lv_res_t decoder_get_area(lv_image_decoder_t * decoder, lv_image_decoder_
decoded_area->y1); /* Output the MCU (YCbCr to RGB, scaling and output) */
if(rc != JDR_OK) return rc;
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/**
diff --git a/src/libs/png/lv_png.c b/src/libs/png/lv_png.c
index f972736a3d..5e360022fb 100644
--- a/src/libs/png/lv_png.c
+++ b/src/libs/png/lv_png.c
@@ -24,12 +24,12 @@
/**********************
* STATIC PROTOTYPES
**********************/
-static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
-static lv_res_t decoder_open(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc);
+static lv_result_t decoder_info(struct _lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header);
+static lv_result_t decoder_open(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc);
static void decoder_close(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc);
static void convert_color_depth(uint8_t * img_p, uint32_t px_cnt);
static const void * decode_png_data(const void * png_data, size_t png_data_size);
-static lv_res_t try_cache(lv_image_decoder_dsc_t * dsc);
+static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc);
/**********************
* STATIC VARIABLES
@@ -62,9 +62,9 @@ void lv_png_init(void)
* Get info about a PNG image
* @param src can be file name or pointer to a C array
* @param header store the info here
- * @return LV_RES_OK: no error; LV_RES_INV: can't get the info
+ * @return LV_RESULT_OK: no error; LV_RESULT_INVALID: can't get the info
*/
-static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
+static lv_result_t decoder_info(struct _lv_image_decoder_t * decoder, const void * src, lv_image_header_t * header)
{
(void) decoder; /*Unused*/
lv_image_src_t src_type = lv_image_src_get_type(src); /*Get the source type*/
@@ -81,7 +81,7 @@ static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, const void *
uint32_t size[2];
lv_fs_file_t f;
lv_fs_res_t res = lv_fs_open(&f, fn, LV_FS_MODE_RD);
- if(res != LV_FS_RES_OK) return LV_RES_INV;
+ if(res != LV_FS_RES_OK) return LV_RESULT_INVALID;
lv_fs_seek(&f, 16, LV_FS_SEEK_SET);
@@ -89,7 +89,7 @@ static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, const void *
lv_fs_read(&f, &size, 8, &rn);
lv_fs_close(&f);
- if(rn != 8) return LV_RES_INV;
+ if(rn != 8) return LV_RESULT_INVALID;
/*Save the data in the header*/
header->always_zero = 0;
@@ -98,7 +98,7 @@ static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, const void *
header->w = (lv_coord_t)((size[0] & 0xff000000) >> 24) + ((size[0] & 0x00ff0000) >> 8);
header->h = (lv_coord_t)((size[1] & 0xff000000) >> 24) + ((size[1] & 0x00ff0000) >> 8);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
/*If it's a PNG file in a C array...*/
@@ -107,8 +107,8 @@ static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, const void *
const uint32_t data_size = img_dsc->data_size;
const uint32_t * size = ((uint32_t *)img_dsc->data) + 4;
const uint8_t magic[] = {0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a};
- if(data_size < sizeof(magic)) return LV_RES_INV;
- if(memcmp(magic, img_dsc->data, sizeof(magic))) return LV_RES_INV;
+ if(data_size < sizeof(magic)) return LV_RESULT_INVALID;
+ if(memcmp(magic, img_dsc->data, sizeof(magic))) return LV_RESULT_INVALID;
header->always_zero = 0;
header->cf = LV_COLOR_FORMAT_ARGB8888;
@@ -127,10 +127,10 @@ static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, const void *
header->h = (lv_coord_t)((size[1] & 0xff000000) >> 24) + ((size[1] & 0x00ff0000) >> 8);
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
- return LV_RES_INV; /*If didn't succeeded earlier then it's an error*/
+ return LV_RESULT_INVALID; /*If didn't succeeded earlier then it's an error*/
}
@@ -140,13 +140,13 @@ static lv_res_t decoder_info(struct _lv_image_decoder_t * decoder, const void *
* @param style style of the image object (unused now but certain formats might use it)
* @return pointer to the decoded image or `LV_IMAGE_DECODER_OPEN_FAIL` if failed
*/
-static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
+static lv_result_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_t * dsc)
{
(void) decoder; /*Unused*/
/*Check the cache first*/
- if(try_cache(dsc) == LV_RES_OK) return LV_RES_OK;
+ if(try_cache(dsc) == LV_RESULT_OK) return LV_RESULT_OK;
const uint8_t * png_data = NULL;
size_t png_data_size = 0;
@@ -160,7 +160,7 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
lv_free((void *)png_data);
}
LV_LOG_WARN("error %u: %s\n", error, lodepng_error_text(error));
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
}
}
@@ -170,14 +170,14 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
png_data_size = img_dsc->data_size;
}
else {
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
lv_cache_lock();
lv_cache_entry_t * cache = lv_cache_add(dsc->header.w * dsc->header.h * 4);
if(cache == NULL) {
lv_cache_unlock();
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
uint32_t t = lv_tick_get();
@@ -201,7 +201,7 @@ static lv_res_t decoder_open(lv_image_decoder_t * decoder, lv_image_decoder_dsc_
dsc->user_data = cache;
lv_cache_unlock();
- return LV_RES_OK; /*If not returned earlier then it failed*/
+ return LV_RESULT_OK; /*If not returned earlier then it failed*/
}
static void decoder_close(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc)
@@ -214,7 +214,7 @@ static void decoder_close(lv_image_decoder_t * dec, lv_image_decoder_dsc_t * dsc
}
-static lv_res_t try_cache(lv_image_decoder_dsc_t * dsc)
+static lv_result_t try_cache(lv_image_decoder_dsc_t * dsc)
{
lv_cache_lock();
if(dsc->src_type == LV_IMAGE_SRC_FILE) {
@@ -225,7 +225,7 @@ static lv_res_t try_cache(lv_image_decoder_dsc_t * dsc)
dsc->img_data = lv_cache_get_data(cache);
dsc->user_data = cache; /*Save the cache to release it in decoder_close*/
lv_cache_unlock();
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
@@ -237,12 +237,12 @@ static lv_res_t try_cache(lv_image_decoder_dsc_t * dsc)
dsc->img_data = lv_cache_get_data(cache);
dsc->user_data = cache; /*Save the cache to release it in decoder_close*/
lv_cache_unlock();
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
lv_cache_unlock();
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
static const void * decode_png_data(const void * png_data, size_t png_data_size)
diff --git a/src/libs/qrcode/lv_qrcode.c b/src/libs/qrcode/lv_qrcode.c
index 33b672df38..fff932bcaa 100644
--- a/src/libs/qrcode/lv_qrcode.c
+++ b/src/libs/qrcode/lv_qrcode.c
@@ -93,7 +93,7 @@ void lv_qrcode_set_light_color(lv_obj_t * obj, lv_color_t color)
qrcode->light_color = color;
}
-lv_res_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len)
+lv_result_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_qrcode_t * qrcode = (lv_qrcode_t *)obj;
@@ -101,7 +101,7 @@ lv_res_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len)
lv_image_dsc_t * img_dsc = lv_canvas_get_image(obj);
if(!img_dsc->data) {
LV_LOG_ERROR("canvas buffer is NULL");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
lv_canvas_set_palette(obj, 0, lv_color_to_32(qrcode->dark_color, 0xff));
@@ -109,14 +109,14 @@ lv_res_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len)
lv_color_t c = lv_color_from_int(1);
lv_canvas_fill_bg(obj, c, LV_OPA_COVER);
- if(data_len > qrcodegen_BUFFER_LEN_MAX) return LV_RES_INV;
+ if(data_len > qrcodegen_BUFFER_LEN_MAX) return LV_RESULT_INVALID;
int32_t qr_version = qrcodegen_getMinFitVersion(qrcodegen_Ecc_MEDIUM, data_len);
- if(qr_version <= 0) return LV_RES_INV;
+ if(qr_version <= 0) return LV_RESULT_INVALID;
int32_t qr_size = qrcodegen_version2size(qr_version);
- if(qr_size <= 0) return LV_RES_INV;
+ if(qr_size <= 0) return LV_RESULT_INVALID;
int32_t scale = img_dsc->header.w / qr_size;
- if(scale <= 0) return LV_RES_INV;
+ if(scale <= 0) return LV_RESULT_INVALID;
int32_t remain = img_dsc->header.w % qr_size;
/* The qr version is incremented by four point */
@@ -140,7 +140,7 @@ lv_res_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len)
if(!ok) {
lv_free(qr0);
lv_free(data_tmp);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
lv_coord_t obj_w = img_dsc->header.w;
@@ -200,7 +200,7 @@ lv_res_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len)
lv_free(qr0);
lv_free(data_tmp);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/**********************
diff --git a/src/libs/qrcode/lv_qrcode.h b/src/libs/qrcode/lv_qrcode.h
index e5eef8fd51..7b2df4ef46 100644
--- a/src/libs/qrcode/lv_qrcode.h
+++ b/src/libs/qrcode/lv_qrcode.h
@@ -70,9 +70,9 @@ void lv_qrcode_set_light_color(lv_obj_t * obj, lv_color_t color);
* @param obj pointer to a QR code object
* @param data data to display
* @param data_len length of data in bytes
- * @return LV_RES_OK: if no error; LV_RES_INV: on error
+ * @return LV_RESULT_OK: if no error; LV_RESULT_INVALID: on error
*/
-lv_res_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len);
+lv_result_t lv_qrcode_update(lv_obj_t * obj, const void * data, uint32_t data_len);
/**********************
* MACROS
diff --git a/src/lv_api_map.h b/src/lv_api_map.h
index 4ef8a079be..ed6a65b581 100644
--- a/src/lv_api_map.h
+++ b/src/lv_api_map.h
@@ -19,6 +19,16 @@ extern "C" {
* DEFINES
*********************/
+
+#define LV_DISP_ROTATION_0 LV_DISPLAY_ROTATION_0
+#define LV_DISP_ROTATION_90 LV_DISPLAY_ROTATION_90
+#define LV_DISP_ROTATION_180 LV_DISPLAY_ROTATION_180
+#define LV_DISP_ROTATION_270 LV_DISPLAY_ROTATION_270
+
+#define LV_DISP_RENDER_MODE_PARTIAL LV_DISPLAY_RENDER_MODE_PARTIAL
+#define LV_DISP_RENDER_MODE_DIRECT LV_DISPLAY_RENDER_MODE_DIRECT
+#define LV_DISP_RENDER_MODE_FULL LV_DISPLAY_RENDER_MODE_FULL
+
#define LV_BTNMATRIX_BTN_NONE LV_BUTTONMATRIX_BUTTON_NONE
#define LV_BTNMATRIX_CTRL_HIDDEN LV_BUTTONMATRIX_CTRL_HIDDEN
@@ -32,12 +42,13 @@ extern "C" {
#define LV_BTNMATRIX_CTRL_CUSTOM_1 LV_BUTTONMATRIX_CTRL_CUSTOM_1
#define LV_BTNMATRIX_CTRL_CUSTOM_2 LV_BUTTONMATRIX_CTRL_CUSTOM_2
-
/**********************
* TYPEDEFS
**********************/
-
+typedef lv_result_t lv_res_t ;
typedef lv_image_dsc_t lv_img_dsc_t;
+typedef lv_display_rotation_t lv_disp_rotation_t;
+typedef lv_display_render_mode_t lv_disp_render_t;
/**********************
* GLOBAL PROTOTYPES
@@ -48,7 +59,6 @@ static inline LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_task_handler(void)
return lv_timer_handler();
}
-
/**
* Move the object to the foreground.
* It will look like if it was created as the last child of its parent.
@@ -81,6 +91,62 @@ static inline void lv_obj_move_background(lv_obj_t * obj)
/**********************
* MACROS
**********************/
+#define LV_RES_OK LV_RESULT_OK
+#define LV_RES_INV LV_RESULT_INVALID
+
+
+#define lv_disp_create lv_display_create
+#define lv_disp_remove lv_display_remove
+#define lv_disp_set_default lv_display_set_default
+#define lv_disp_get_default lv_display_get_default
+#define lv_disp_get_next lv_display_get_next
+#define lv_disp_set_res lv_display_set_resolution
+#define lv_disp_set_physical_res lv_display_set_physical_res
+#define lv_disp_set_offset lv_display_set_offset
+#define lv_disp_set_rotation lv_display_set_rotation
+#define lv_disp_set_dpi lv_display_set_dpi
+#define lv_disp_get_hor_res lv_display_get_horizontal_resolution
+#define lv_disp_get_ver_res lv_display_get_vertical_resolution
+#define lv_disp_get_physical_hor_res lv_display_get_physical_horizontal_resolution
+#define lv_disp_get_physical_ver_res lv_display_get_physical_vertical_resolution
+#define lv_disp_get_offset_x lv_display_get_offset_x
+#define lv_disp_get_offset_y lv_display_get_offset_y
+#define lv_disp_get_rotation lv_display_get_rotation
+#define lv_disp_get_dpi lv_display_get_dpi
+#define lv_disp_set_draw_buffers lv_display_set_draw_buffers
+#define lv_disp_set_flush_cb lv_display_set_flush_cb
+#define lv_disp_set_color_format lv_display_set_color_format
+#define lv_disp_get_color_format lv_display_get_color_format
+#define lv_disp_set_antialiasing lv_display_set_antialiasing
+#define lv_disp_get_antialiasing lv_display_get_antialiasing
+#define lv_disp_flush_ready lv_display_flush_ready
+#define lv_disp_flush_is_last lv_display_flush_is_last
+#define lv_disp_is_double_buffered lv_display_is_double_buffered
+#define lv_disp_get_scr_act lv_display_get_scr_act
+#define lv_disp_get_scr_prev lv_display_get_scr_prev
+#define lv_disp_load_scr lv_display_load_scr
+#define lv_disp_get_layer_top lv_display_get_layer_top
+#define lv_disp_get_layer_sys lv_display_get_layer_sys
+#define lv_disp_get_layer_bottom lv_display_get_layer_bottom
+#define lv_disp_add_event lv_display_add_event
+#define lv_disp_get_event_count lv_display_get_event_count
+#define lv_disp_get_event_dsc lv_display_get_event_dsc
+#define lv_disp_remove_event lv_display_remove_event
+#define lv_disp_send_event lv_display_send_event
+#define lv_disp_set_theme lv_display_set_theme
+#define lv_disp_get_theme lv_display_get_theme
+#define lv_disp_get_inactive_time lv_display_get_inactive_time
+#define lv_disp_trig_activity lv_display_trig_activity
+#define lv_disp_enable_invalidation lv_display_enable_invalidation
+#define lv_disp_is_invalidation_enabled lv_display_is_invalidation_enabled
+#define lv_disp_set_user_data lv_display_set_user_data
+#define lv_disp_set_driver_data lv_display_set_driver_data
+#define lv_disp_get_user_data lv_display_get_user_data
+#define lv_disp_get_driver_data lv_display_get_driver_data
+
+#define lv_txt_get_size lv_text_get_size
+#define lv_txt_get_width lv_text_get_width
+
#define lv_img_create lv_image_create
#define lv_img_set_src lv_image_set_src
#define lv_img_set_offset_x lv_image_set_offset_x
@@ -125,6 +191,19 @@ static inline void lv_obj_move_background(lv_obj_t * obj)
#define lv_msgbox_get_btns lv_msgbox_get_buttons
+#define lv_image_set_angle lv_image_set_rotation
+#define lv_image_get_angle lv_image_get_rotation
+#define lv_image_set_zoom lv_image_set_scale
+#define lv_image_get_zoom lv_image_get_scale
+
+#define lv_obj_get_style_transform_zoom lv_obj_get_style_transform_scale
+#define lv_obj_get_style_transform_angle lv_obj_get_style_transform_rotation
+#define lv_obj_set_style_transform_zoom lv_obj_set_style_transform_scale
+#define lv_obj_set_style_transform_angle lv_obj_set_style_transform_rotation
+#define lv_style_set_transform_angle lv_style_set_transform_rotation
+#define lv_style_set_transform_zoom lv_style_set_transform_scale
+#define LV_ZOOM_NONE LV_SCALE_NONE
+
/**********************
* MACROS
**********************/
diff --git a/src/lv_conf_internal.h b/src/lv_conf_internal.h
index 615565998e..925b90e7ab 100644
--- a/src/lv_conf_internal.h
+++ b/src/lv_conf_internal.h
@@ -663,11 +663,11 @@
/*Maximum buffer size to allocate for rotation.
*Only used if software rotation is enabled in the display driver.*/
-#ifndef LV_DISP_ROT_MAX_BUF
- #ifdef CONFIG_LV_DISP_ROT_MAX_BUF
- #define LV_DISP_ROT_MAX_BUF CONFIG_LV_DISP_ROT_MAX_BUF
+#ifndef LV_DISPLAY_ROT_MAX_BUF
+ #ifdef CONFIG_LV_DISPLAY_ROT_MAX_BUF
+ #define LV_DISPLAY_ROT_MAX_BUF CONFIG_LV_DISPLAY_ROT_MAX_BUF
#else
- #define LV_DISP_ROT_MAX_BUF (10*1024)
+ #define LV_DISPLAY_ROT_MAX_BUF (10*1024)
#endif
#endif
@@ -766,7 +766,7 @@
#endif
#endif
-/*Define a custom attribute to `lv_disp_flush_ready` function*/
+/*Define a custom attribute to `lv_display_flush_ready` function*/
#ifndef LV_ATTRIBUTE_FLUSH_READY
#ifdef CONFIG_LV_ATTRIBUTE_FLUSH_READY
#define LV_ATTRIBUTE_FLUSH_READY CONFIG_LV_ATTRIBUTE_FLUSH_READY
@@ -2355,7 +2355,7 @@
#ifdef CONFIG_LV_SDL_RENDER_MODE
#define LV_SDL_RENDER_MODE CONFIG_LV_SDL_RENDER_MODE
#else
- #define LV_SDL_RENDER_MODE LV_DISP_RENDER_MODE_DIRECT /*LV_DISP_RENDER_MODE_DIRECT is recommended for best performance*/
+ #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/
#endif
#endif
#ifndef LV_SDL_BUF_COUNT
@@ -2416,7 +2416,7 @@
#ifdef CONFIG_LV_LINUX_FBDEV_RENDER_MODE
#define LV_LINUX_FBDEV_RENDER_MODE CONFIG_LV_LINUX_FBDEV_RENDER_MODE
#else
- #define LV_LINUX_FBDEV_RENDER_MODE LV_DISP_RENDER_MODE_PARTIAL
+ #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
#endif
#endif
#ifndef LV_LINUX_FBDEV_BUFFER_COUNT
diff --git a/src/lv_conf_kconfig.h b/src/lv_conf_kconfig.h
index c6bc0127b6..abea620d9f 100644
--- a/src/lv_conf_kconfig.h
+++ b/src/lv_conf_kconfig.h
@@ -224,11 +224,11 @@ extern "C" {
*-----------------*/
#ifdef CONFIG_LV_LINUX_FBDEV_RENDER_MODE_PARTIAL
-# define CONFIG_LV_LINUX_FBDEV_RENDER_MODE LV_DISP_RENDER_MODE_PARTIAL
+# define CONFIG_LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
#elif defined(CONFIG_LV_LINUX_FBDEV_RENDER_MODE_DIRECT)
-# define CONFIG_LV_LINUX_FBDEV_RENDER_MODE LV_DISP_RENDER_MODE_DIRECT
+# define CONFIG_LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT
#elif defined(CONFIG_LV_LINUX_FBDEV_RENDER_MODE_FULL)
-# define CONFIG_LV_LINUX_FBDEV_RENDER_MODE LV_DISP_RENDER_MODE_FULL
+# define CONFIG_LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_FULL
#endif
#ifdef __cplusplus
diff --git a/src/lv_init.c b/src/lv_init.c
index 40eef1f14c..3de1888ced 100644
--- a/src/lv_init.c
+++ b/src/lv_init.c
@@ -8,7 +8,7 @@
*********************/
#include "core/lv_global.h"
#include "core/lv_obj.h"
-#include "disp/lv_disp_private.h"
+#include "display/lv_display_private.h"
#include "indev/lv_indev_private.h"
#include "layouts/lv_layout.h"
#include "libs/bmp/lv_bmp.h"
@@ -62,7 +62,7 @@ static inline void lv_global_init(lv_global_t * global)
lv_memset(global, 0, sizeof(lv_global_t));
- _lv_ll_init(&(global->disp_ll), sizeof(lv_disp_t));
+ _lv_ll_init(&(global->disp_ll), sizeof(lv_display_t));
_lv_ll_init(&(global->indev_ll), sizeof(lv_indev_t));
global->memory_zero = ZERO_MEM_SENTINEL;
@@ -255,7 +255,7 @@ void lv_deinit(void)
_lv_sysmon_builtin_deinit();
#endif
- lv_disp_set_default(NULL);
+ lv_display_set_default(NULL);
#if LV_USE_SPAN != 0
lv_span_stack_deinit();
diff --git a/src/lvgl_private.h b/src/lvgl_private.h
index 883751409a..c6fc5990af 100644
--- a/src/lvgl_private.h
+++ b/src/lvgl_private.h
@@ -13,7 +13,7 @@ extern "C" {
/*********************
* INCLUDES
*********************/
-#include "disp/lv_disp_private.h"
+#include "display/lv_display_private.h"
#include "indev/lv_indev_private.h"
/*********************
diff --git a/src/misc/lv_assert.h b/src/misc/lv_assert.h
index 56c1bef400..0ad66ed681 100644
--- a/src/misc/lv_assert.h
+++ b/src/misc/lv_assert.h
@@ -67,7 +67,7 @@ extern "C" {
#endif
#if LV_USE_ASSERT_MEM_INTEGRITY
-# define LV_ASSERT_MEM_INTEGRITY() LV_ASSERT_MSG(lv_mem_test() == LV_RES_OK, "Memory integrity error");
+# define LV_ASSERT_MEM_INTEGRITY() LV_ASSERT_MSG(lv_mem_test() == LV_RESULT_OK, "Memory integrity error");
#else
# define LV_ASSERT_MEM_INTEGRITY()
#endif
diff --git a/src/misc/lv_async.c b/src/misc/lv_async.c
index d76d2ab11c..6f6602af0b 100644
--- a/src/misc/lv_async.c
+++ b/src/misc/lv_async.c
@@ -42,33 +42,33 @@ static void lv_async_timer_cb(lv_timer_t * timer);
* GLOBAL FUNCTIONS
**********************/
-lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data)
+lv_result_t lv_async_call(lv_async_cb_t async_xcb, void * user_data)
{
/*Allocate an info structure*/
lv_async_info_t * info = lv_malloc(sizeof(lv_async_info_t));
if(info == NULL)
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
/*Create a new timer*/
lv_timer_t * timer = lv_timer_create(lv_async_timer_cb, 0, info);
if(timer == NULL) {
lv_free(info);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
info->cb = async_xcb;
info->user_data = user_data;
lv_timer_set_repeat_count(timer, 1);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data)
+lv_result_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data)
{
lv_timer_t * timer = lv_timer_get_next(NULL);
- lv_res_t res = LV_RES_INV;
+ lv_result_t res = LV_RESULT_INVALID;
while(timer != NULL) {
/*Find the next timer node*/
@@ -82,7 +82,7 @@ lv_res_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data)
if(info->cb == async_xcb && info->user_data == user_data) {
lv_timer_del(timer);
lv_free(info);
- res = LV_RES_OK;
+ res = LV_RESULT_OK;
}
}
diff --git a/src/misc/lv_async.h b/src/misc/lv_async.h
index 4ad5756d9d..362a0ffade 100644
--- a/src/misc/lv_async.h
+++ b/src/misc/lv_async.h
@@ -41,14 +41,14 @@ typedef void (*lv_async_cb_t)(void *);
* the `func_name(object, callback, ...)` convention)
* @param user_data custom parameter
*/
-lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data);
+lv_result_t lv_async_call(lv_async_cb_t async_xcb, void * user_data);
/**
* Cancel an asynchronous function call
* @param async_xcb a callback which is the task itself.
* @param user_data custom parameter
*/
-lv_res_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data);
+lv_result_t lv_async_call_cancel(lv_async_cb_t async_xcb, void * user_data);
/**********************
* MACROS
diff --git a/src/misc/lv_bidi.c b/src/misc/lv_bidi.c
index 23d579c02d..065efd0728 100644
--- a/src/misc/lv_bidi.c
+++ b/src/misc/lv_bidi.c
@@ -8,7 +8,7 @@
*********************/
#include
#include "lv_bidi.h"
-#include "lv_txt.h"
+#include "lv_text.h"
#include "../stdlib/lv_mem.h"
#include "../stdlib/lv_string.h"
@@ -116,7 +116,7 @@ lv_base_dir_t _lv_bidi_detect_base_dir(const char * txt)
uint32_t i = 0;
uint32_t letter;
while(txt[i] != '\0') {
- letter = _lv_txt_encoded_next(txt, &i);
+ letter = _lv_text_encoded_next(txt, &i);
lv_base_dir_t dir;
dir = lv_bidi_get_letter_dir(letter);
@@ -250,7 +250,7 @@ void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t le
/*Process neutral chars in the beginning*/
while(rd < len) {
- uint32_t letter = _lv_txt_encoded_next(str_in, &rd);
+ uint32_t letter = _lv_text_encoded_next(str_in, &rd);
pos_conv_rd++;
dir = lv_bidi_get_letter_dir(letter);
if(dir == LV_BASE_DIR_NEUTRAL) dir = bracket_process(&ctx, str_in, rd, len, letter, base_dir);
@@ -258,7 +258,7 @@ void _lv_bidi_process_paragraph(const char * str_in, char * str_out, uint32_t le
}
if(rd && str_in[rd] != '\0') {
- _lv_txt_encoded_prev(str_in, &rd);
+ _lv_text_encoded_prev(str_in, &rd);
pos_conv_rd--;
}
@@ -335,10 +335,10 @@ static uint32_t lv_bidi_get_next_paragraph(const char * txt)
{
uint32_t i = 0;
- _lv_txt_encoded_next(txt, &i);
+ _lv_text_encoded_next(txt, &i);
while(txt[i] != '\0' && txt[i] != '\n' && txt[i] != '\r') {
- _lv_txt_encoded_next(txt, &i);
+ _lv_text_encoded_next(txt, &i);
}
return i;
@@ -368,7 +368,7 @@ static bool lv_bidi_letter_is_weak(uint32_t letter)
static const char weaks[] = "0123456789";
do {
- uint32_t x = _lv_txt_encoded_next(weaks, &i);
+ uint32_t x = _lv_text_encoded_next(weaks, &i);
if(letter == x) {
return true;
}
@@ -419,7 +419,7 @@ static uint32_t get_txt_len(const char * txt, uint32_t max_len)
uint32_t i = 0;
while(i < max_len && txt[i] != '\0') {
- _lv_txt_encoded_next(txt, &i);
+ _lv_text_encoded_next(txt, &i);
len++;
}
@@ -444,13 +444,13 @@ static lv_base_dir_t get_next_run(lv_bidi_ctx_t * ctx, const char * txt, lv_base
uint16_t pos_conv_i = 0;
- letter = _lv_txt_encoded_next(txt, NULL);
+ letter = _lv_text_encoded_next(txt, NULL);
lv_base_dir_t dir = lv_bidi_get_letter_dir(letter);
if(dir == LV_BASE_DIR_NEUTRAL) dir = bracket_process(ctx, txt, 0, max_len, letter, base_dir);
/*Find the first strong char. Skip the neutrals*/
while(dir == LV_BASE_DIR_NEUTRAL || dir == LV_BASE_DIR_WEAK) {
- letter = _lv_txt_encoded_next(txt, &i);
+ letter = _lv_text_encoded_next(txt, &i);
pos_conv_i++;
dir = lv_bidi_get_letter_dir(letter);
@@ -475,7 +475,7 @@ static lv_base_dir_t get_next_run(lv_bidi_ctx_t * ctx, const char * txt, lv_base
/*Find the next char which has different direction*/
lv_base_dir_t next_dir = base_dir;
while(i_prev < max_len && txt[i] != '\0' && txt[i] != '\n' && txt[i] != '\r') {
- letter = _lv_txt_encoded_next(txt, &i);
+ letter = _lv_text_encoded_next(txt, &i);
pos_conv_i++;
next_dir = lv_bidi_get_letter_dir(letter);
if(next_dir == LV_BASE_DIR_NEUTRAL) next_dir = bracket_process(ctx, txt, i, max_len, letter, base_dir);
@@ -538,7 +538,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t *
uint16_t pos_conv_wr = 0;
while(i) {
- uint32_t letter = _lv_txt_encoded_prev(src, &i);
+ uint32_t letter = _lv_text_encoded_prev(src, &i);
uint16_t pos_conv_letter = --pos_conv_i;
/*Keep weak letters (numbers) as LTR*/
@@ -548,7 +548,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t *
uint16_t pos_conv_last_weak = pos_conv_i;
uint16_t pos_conv_first_weak = pos_conv_i;
while(i) {
- letter = _lv_txt_encoded_prev(src, &i);
+ letter = _lv_text_encoded_prev(src, &i);
pos_conv_letter = --pos_conv_i;
/*No need to call `char_change_to_pair` because there not such chars here*/
@@ -556,7 +556,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t *
/*Finish on non-weak char*/
/*but treat number and currency related chars as weak*/
if(lv_bidi_letter_is_weak(letter) == false && letter != '.' && letter != ',' && letter != '$' && letter != '%') {
- _lv_txt_encoded_next(src, &i); /*Rewind one letter*/
+ _lv_text_encoded_next(src, &i); /*Rewind one letter*/
pos_conv_i++;
first_weak = i;
pos_conv_first_weak = pos_conv_i;
@@ -577,7 +577,7 @@ static void rtl_reverse(char * dest, const char * src, uint32_t len, uint16_t *
/*Simply store in reversed order*/
else {
- uint32_t letter_size = _lv_txt_encoded_size((const char *)&src[i]);
+ uint32_t letter_size = _lv_text_encoded_size((const char *)&src[i]);
/*Swap arithmetical symbols*/
if(letter_size == 1) {
uint32_t new_letter = letter = char_change_to_pair(letter);
@@ -626,7 +626,7 @@ static lv_base_dir_t bracket_process(lv_bidi_ctx_t * ctx, const char * txt, uint
*If a char with base dir. direction is found then the brackets will have `base_dir` direction*/
uint32_t txt_i = next_pos;
while(txt_i < len) {
- uint32_t letter_next = _lv_txt_encoded_next(txt, &txt_i);
+ uint32_t letter_next = _lv_text_encoded_next(txt, &txt_i);
if(letter_next == bracket_right[i]) {
/*Closing bracket found*/
break;
@@ -648,9 +648,9 @@ static lv_base_dir_t bracket_process(lv_bidi_ctx_t * ctx, const char * txt, uint
/*If there were no matching strong chars in the brackets then check the previous chars*/
txt_i = next_pos;
- if(txt_i) _lv_txt_encoded_prev(txt, &txt_i);
+ if(txt_i) _lv_text_encoded_prev(txt, &txt_i);
while(txt_i > 0) {
- uint32_t letter_next = _lv_txt_encoded_prev(txt, &txt_i);
+ uint32_t letter_next = _lv_text_encoded_prev(txt, &txt_i);
lv_base_dir_t letter_dir = lv_bidi_get_letter_dir(letter_next);
if(letter_dir == LV_BASE_DIR_LTR || letter_dir == LV_BASE_DIR_RTL) {
bracket_dir = letter_dir;
diff --git a/src/misc/lv_bidi.h b/src/misc/lv_bidi.h
index 6807f82d21..6ffa3c355a 100644
--- a/src/misc/lv_bidi.h
+++ b/src/misc/lv_bidi.h
@@ -17,7 +17,7 @@ extern "C" {
#include
#include
-#include "lv_txt.h"
+#include "lv_text.h"
/*********************
* DEFINES
diff --git a/src/misc/lv_event.c b/src/misc/lv_event.c
index da559dcd18..f580667588 100644
--- a/src/misc/lv_event.c
+++ b/src/misc/lv_event.c
@@ -60,9 +60,9 @@ void _lv_event_pop(lv_event_t * e)
event_head = e->prev;
}
-lv_res_t lv_event_send(lv_event_list_t * list, lv_event_t * e, bool preprocess)
+lv_result_t lv_event_send(lv_event_list_t * list, lv_event_t * e, bool preprocess)
{
- if(list == NULL) return LV_RES_OK;
+ if(list == NULL) return LV_RESULT_OK;
uint32_t i = 0;
for(i = 0; i < list->cnt; i++) {
@@ -73,14 +73,14 @@ lv_res_t lv_event_send(lv_event_list_t * list, lv_event_t * e, bool preprocess)
if(filter == LV_EVENT_ALL || filter == e->code) {
e->user_data = list->dsc[i].user_data;
list->dsc[i].cb(e);
- if(e->stop_processing) return LV_RES_OK;
+ if(e->stop_processing) return LV_RESULT_OK;
/*Stop if the object is deleted*/
- if(e->deleted) return LV_RES_INV;
+ if(e->deleted) return LV_RESULT_INVALID;
}
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
void lv_event_add(lv_event_list_t * list, lv_event_cb_t cb, lv_event_code_t filter,
diff --git a/src/misc/lv_event.h b/src/misc/lv_event.h
index a43bc8f9ea..387e519942 100644
--- a/src/misc/lv_event.h
+++ b/src/misc/lv_event.h
@@ -150,7 +150,7 @@ void _lv_event_push(lv_event_t * e);
void _lv_event_pop(lv_event_t * e);
-lv_res_t lv_event_send(lv_event_list_t * list, lv_event_t * e, bool preprocess);
+lv_result_t lv_event_send(lv_event_list_t * list, lv_event_t * e, bool preprocess);
void lv_event_add(lv_event_list_t * list, lv_event_cb_t cb, lv_event_code_t filter, void * user_data);
@@ -231,7 +231,7 @@ uint32_t lv_event_register_id(void);
/**
* Nested events can be called and one of them might belong to an object that is being deleted.
- * Mark this object's `event_temp_data` deleted to know that its `lv_obj_send_event` should return `LV_RES_INV`
+ * Mark this object's `event_temp_data` deleted to know that its `lv_obj_send_event` should return `LV_RESULT_INVALID`
* @param target pointer to an event target which was deleted
*/
void _lv_event_mark_deleted(void * target);
diff --git a/src/misc/lv_style.c b/src/misc/lv_style.c
index a6ea069091..2041fb7638 100644
--- a/src/misc/lv_style.c
+++ b/src/misc/lv_style.c
@@ -48,8 +48,8 @@ const uint8_t _lv_style_builtin_prop_flag_lookup_table[_LV_STYLE_NUM_BUILT_IN_PR
[LV_STYLE_TRANSFORM_HEIGHT] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM,
[LV_STYLE_TRANSLATE_X] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE | LV_STYLE_PROP_FLAG_PARENT_LAYOUT_UPDATE,
[LV_STYLE_TRANSLATE_Y] = LV_STYLE_PROP_FLAG_LAYOUT_UPDATE | LV_STYLE_PROP_FLAG_PARENT_LAYOUT_UPDATE,
- [LV_STYLE_TRANSFORM_ZOOM] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYER_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM,
- [LV_STYLE_TRANSFORM_ANGLE] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYER_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM,
+ [LV_STYLE_TRANSFORM_SCALE] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYER_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM,
+ [LV_STYLE_TRANSFORM_ROTATION] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYER_UPDATE | LV_STYLE_PROP_FLAG_TRANSFORM,
[LV_STYLE_PAD_TOP] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE,
[LV_STYLE_PAD_BOTTOM] = LV_STYLE_PROP_FLAG_EXT_DRAW_UPDATE | LV_STYLE_PROP_FLAG_LAYOUT_UPDATE,
@@ -345,9 +345,9 @@ lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop)
const lv_color_t black = LV_COLOR_MAKE(0x00, 0x00, 0x00);
const lv_color_t white = LV_COLOR_MAKE(0xff, 0xff, 0xff);
switch(prop) {
- case LV_STYLE_TRANSFORM_ZOOM:
+ case LV_STYLE_TRANSFORM_SCALE:
return (lv_style_value_t) {
- .num = LV_ZOOM_NONE
+ .num = LV_SCALE_NONE
};
case LV_STYLE_BG_COLOR:
return (lv_style_value_t) {
diff --git a/src/misc/lv_style.h b/src/misc/lv_style.h
index c20fb0f708..b279430839 100644
--- a/src/misc/lv_style.h
+++ b/src/misc/lv_style.h
@@ -19,7 +19,7 @@ extern "C" {
#include "lv_color.h"
#include "lv_area.h"
#include "lv_anim.h"
-#include "lv_txt.h"
+#include "lv_text.h"
#include "lv_types.h"
#include "lv_assert.h"
#include "lv_bidi.h"
@@ -48,8 +48,8 @@ extern "C" {
/**
* Other constants
*/
-#define LV_ZOOM_NONE 256 /*Value for not zooming the image*/
-LV_EXPORT_CONST_INT(LV_ZOOM_NONE);
+#define LV_SCALE_NONE 256 /*Value for not zooming the image*/
+LV_EXPORT_CONST_INT(LV_SCALE_NONE);
// *INDENT-OFF*
#if LV_USE_ASSERT_STYLE
@@ -315,8 +315,8 @@ enum _lv_style_prop_t {
LV_STYLE_TRANSFORM_HEIGHT = 106,
LV_STYLE_TRANSLATE_X = 107,
LV_STYLE_TRANSLATE_Y = 108,
- LV_STYLE_TRANSFORM_ZOOM = 109,
- LV_STYLE_TRANSFORM_ANGLE = 110,
+ LV_STYLE_TRANSFORM_SCALE = 109,
+ LV_STYLE_TRANSFORM_ROTATION = 110,
LV_STYLE_TRANSFORM_PIVOT_X = 111,
LV_STYLE_TRANSFORM_PIVOT_Y = 112,
@@ -476,8 +476,8 @@ void lv_style_set_prop(lv_style_t * style, lv_style_prop_t prop, lv_style_value_
* @param style pointer to a style
* @param prop the ID of a property
* @param value pointer to a `lv_style_value_t` variable to store the value
- * @return LV_RES_INV: the property wasn't found in the style (`value` is unchanged)
- * LV_RES_OK: the property was fond, and `value` is set accordingly
+ * @return LV_RESULT_INVALID: the property wasn't found in the style (`value` is unchanged)
+ * LV_RESULT_OK: the property was fond, and `value` is set accordingly
* @note For performance reasons there are no sanity check on `style`
*/
lv_style_res_t lv_style_get_prop(const lv_style_t * style, lv_style_prop_t prop, lv_style_value_t * value);
@@ -510,8 +510,8 @@ lv_style_value_t lv_style_prop_get_default(lv_style_prop_t prop);
* @param style pointer to a style
* @param prop the ID of a property
* @param value pointer to a `lv_style_value_t` variable to store the value
- * @return LV_RES_INV: the property wasn't found in the style (`value` is unchanged)
- * LV_RES_OK: the property was fond, and `value` is set accordingly
+ * @return LV_RESULT_INVALID: the property wasn't found in the style (`value` is unchanged)
+ * LV_RESULT_OK: the property was fond, and `value` is set accordingly
* @note For performance reasons there are no sanity check on `style`
* @note This function is the same as ::lv_style_get_prop but inlined. Use it only on performance critical places
*/
diff --git a/src/misc/lv_style_gen.c b/src/misc/lv_style_gen.c
index cbdb966403..6cd1c1e3be 100644
--- a/src/misc/lv_style_gen.c
+++ b/src/misc/lv_style_gen.c
@@ -140,25 +140,25 @@ void lv_style_set_translate_y(lv_style_t * style, lv_coord_t value)
const lv_style_prop_t _lv_style_const_prop_id_TRANSLATE_Y = LV_STYLE_TRANSLATE_Y;
-void lv_style_set_transform_zoom(lv_style_t * style, lv_coord_t value)
+void lv_style_set_transform_scale(lv_style_t * style, lv_coord_t value)
{
lv_style_value_t v = {
.num = (int32_t)value
};
- lv_style_set_prop(style, LV_STYLE_TRANSFORM_ZOOM, v);
+ lv_style_set_prop(style, LV_STYLE_TRANSFORM_SCALE, v);
}
-const lv_style_prop_t _lv_style_const_prop_id_TRANSFORM_ZOOM = LV_STYLE_TRANSFORM_ZOOM;
+const lv_style_prop_t _lv_style_const_prop_id_TRANSFORM_SCALE = LV_STYLE_TRANSFORM_SCALE;
-void lv_style_set_transform_angle(lv_style_t * style, lv_coord_t value)
+void lv_style_set_transform_rotation(lv_style_t * style, lv_coord_t value)
{
lv_style_value_t v = {
.num = (int32_t)value
};
- lv_style_set_prop(style, LV_STYLE_TRANSFORM_ANGLE, v);
+ lv_style_set_prop(style, LV_STYLE_TRANSFORM_ROTATION, v);
}
-const lv_style_prop_t _lv_style_const_prop_id_TRANSFORM_ANGLE = LV_STYLE_TRANSFORM_ANGLE;
+const lv_style_prop_t _lv_style_const_prop_id_TRANSFORM_ROTATION = LV_STYLE_TRANSFORM_ROTATION;
void lv_style_set_transform_pivot_x(lv_style_t * style, lv_coord_t value)
{
diff --git a/src/misc/lv_style_gen.h b/src/misc/lv_style_gen.h
index 4be79ddd70..0bbe4b30a5 100644
--- a/src/misc/lv_style_gen.h
+++ b/src/misc/lv_style_gen.h
@@ -36,10 +36,10 @@ void lv_style_set_translate_x(lv_style_t * style, lv_coord_t value);
extern const lv_style_prop_t _lv_style_const_prop_id_TRANSLATE_X;
void lv_style_set_translate_y(lv_style_t * style, lv_coord_t value);
extern const lv_style_prop_t _lv_style_const_prop_id_TRANSLATE_Y;
-void lv_style_set_transform_zoom(lv_style_t * style, lv_coord_t value);
-extern const lv_style_prop_t _lv_style_const_prop_id_TRANSFORM_ZOOM;
-void lv_style_set_transform_angle(lv_style_t * style, lv_coord_t value);
-extern const lv_style_prop_t _lv_style_const_prop_id_TRANSFORM_ANGLE;
+void lv_style_set_transform_scale(lv_style_t * style, lv_coord_t value);
+extern const lv_style_prop_t _lv_style_const_prop_id_TRANSFORM_SCALE;
+void lv_style_set_transform_rotation(lv_style_t * style, lv_coord_t value);
+extern const lv_style_prop_t _lv_style_const_prop_id_TRANSFORM_ROTATION;
void lv_style_set_transform_pivot_x(lv_style_t * style, lv_coord_t value);
extern const lv_style_prop_t _lv_style_const_prop_id_TRANSFORM_PIVOT_X;
void lv_style_set_transform_pivot_y(lv_style_t * style, lv_coord_t value);
@@ -284,14 +284,14 @@ extern const lv_style_prop_t _lv_style_const_prop_id_GRID_CELL_ROW_SPAN;
.prop_ptr = &_lv_style_const_prop_id_TRANSLATE_Y, .value = { .num = (int32_t)val } \
}
-#define LV_STYLE_CONST_TRANSFORM_ZOOM(val) \
+#define LV_STYLE_CONST_TRANSFORM_SCALE(val) \
{ \
- .prop_ptr = &_lv_style_const_prop_id_TRANSFORM_ZOOM, .value = { .num = (int32_t)val } \
+ .prop_ptr = &_lv_style_const_prop_id_TRANSFORM_SCALE, .value = { .num = (int32_t)val } \
}
-#define LV_STYLE_CONST_TRANSFORM_ANGLE(val) \
+#define LV_STYLE_CONST_TRANSFORM_ROTATION(val) \
{ \
- .prop_ptr = &_lv_style_const_prop_id_TRANSFORM_ANGLE, .value = { .num = (int32_t)val } \
+ .prop_ptr = &_lv_style_const_prop_id_TRANSFORM_ROTATION, .value = { .num = (int32_t)val } \
}
#define LV_STYLE_CONST_TRANSFORM_PIVOT_X(val) \
@@ -738,4 +738,5 @@ extern const lv_style_prop_t _lv_style_const_prop_id_GRID_CELL_ROW_SPAN;
{ \
.prop_ptr = &_lv_style_const_prop_id_GRID_CELL_ROW_SPAN, .value = { .num = (int32_t)val } \
}
+
#endif /* LV_STYLE_GEN_H */
diff --git a/src/misc/lv_txt.c b/src/misc/lv_text.c
similarity index 75%
rename from src/misc/lv_txt.c
rename to src/misc/lv_text.c
index 7d01c01a45..4355ca2e3c 100644
--- a/src/misc/lv_txt.c
+++ b/src/misc/lv_text.c
@@ -1,5 +1,5 @@
/**
- * @file lv_txt.c
+ * @file lv_text.c
*
*/
@@ -7,8 +7,8 @@
* INCLUDES
*********************/
#include
-#include "lv_txt.h"
-#include "lv_txt_ap.h"
+#include "lv_text.h"
+#include "lv_text_ap.h"
#include "lv_math.h"
#include "lv_log.h"
#include "lv_assert.h"
@@ -29,23 +29,23 @@
**********************/
#if LV_TXT_ENC == LV_TXT_ENC_UTF8
- static uint8_t lv_txt_utf8_size(const char * str);
- static uint32_t lv_txt_unicode_to_utf8(uint32_t letter_uni);
- static uint32_t lv_txt_utf8_conv_wc(uint32_t c);
- static uint32_t lv_txt_utf8_next(const char * txt, uint32_t * i);
- static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i_start);
- static uint32_t lv_txt_utf8_get_byte_id(const char * txt, uint32_t utf8_id);
- static uint32_t lv_txt_utf8_get_char_id(const char * txt, uint32_t byte_id);
- static uint32_t lv_txt_utf8_get_length(const char * txt);
+ static uint8_t lv_text_utf8_size(const char * str);
+ static uint32_t lv_text_unicode_to_utf8(uint32_t letter_uni);
+ static uint32_t lv_text_utf8_conv_wc(uint32_t c);
+ static uint32_t lv_text_utf8_next(const char * txt, uint32_t * i);
+ static uint32_t lv_text_utf8_prev(const char * txt, uint32_t * i_start);
+ static uint32_t lv_text_utf8_get_byte_id(const char * txt, uint32_t utf8_id);
+ static uint32_t lv_text_utf8_get_char_id(const char * txt, uint32_t byte_id);
+ static uint32_t lv_text_utf8_get_length(const char * txt);
#elif LV_TXT_ENC == LV_TXT_ENC_ASCII
- static uint8_t lv_txt_iso8859_1_size(const char * str);
- static uint32_t lv_txt_unicode_to_iso8859_1(uint32_t letter_uni);
- static uint32_t lv_txt_iso8859_1_conv_wc(uint32_t c);
- static uint32_t lv_txt_iso8859_1_next(const char * txt, uint32_t * i);
- static uint32_t lv_txt_iso8859_1_prev(const char * txt, uint32_t * i_start);
- static uint32_t lv_txt_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id);
- static uint32_t lv_txt_iso8859_1_get_char_id(const char * txt, uint32_t byte_id);
- static uint32_t lv_txt_iso8859_1_get_length(const char * txt);
+ static uint8_t lv_text_iso8859_1_size(const char * str);
+ static uint32_t lv_text_unicode_to_iso8859_1(uint32_t letter_uni);
+ static uint32_t lv_text_iso8859_1_conv_wc(uint32_t c);
+ static uint32_t lv_text_iso8859_1_next(const char * txt, uint32_t * i);
+ static uint32_t lv_text_iso8859_1_prev(const char * txt, uint32_t * i_start);
+ static uint32_t lv_text_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id);
+ static uint32_t lv_text_iso8859_1_get_char_id(const char * txt, uint32_t byte_id);
+ static uint32_t lv_text_iso8859_1_get_length(const char * txt);
#endif
/**********************
* STATIC VARIABLES
@@ -55,23 +55,23 @@
* GLOBAL VARIABLES
**********************/
#if LV_TXT_ENC == LV_TXT_ENC_UTF8
- uint8_t (*_lv_txt_encoded_size)(const char *) = lv_txt_utf8_size;
- uint32_t (*_lv_txt_unicode_to_encoded)(uint32_t) = lv_txt_unicode_to_utf8;
- uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t) = lv_txt_utf8_conv_wc;
- uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *) = lv_txt_utf8_next;
- uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *) = lv_txt_utf8_prev;
- uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t) = lv_txt_utf8_get_byte_id;
- uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t) = lv_txt_utf8_get_char_id;
- uint32_t (*_lv_txt_get_encoded_length)(const char *) = lv_txt_utf8_get_length;
+ uint8_t (*_lv_text_encoded_size)(const char *) = lv_text_utf8_size;
+ uint32_t (*_lv_text_unicode_to_encoded)(uint32_t) = lv_text_unicode_to_utf8;
+ uint32_t (*_lv_text_encoded_conv_wc)(uint32_t) = lv_text_utf8_conv_wc;
+ uint32_t (*_lv_text_encoded_next)(const char *, uint32_t *) = lv_text_utf8_next;
+ uint32_t (*_lv_text_encoded_prev)(const char *, uint32_t *) = lv_text_utf8_prev;
+ uint32_t (*_lv_text_encoded_get_byte_id)(const char *, uint32_t) = lv_text_utf8_get_byte_id;
+ uint32_t (*_lv_text_encoded_get_char_id)(const char *, uint32_t) = lv_text_utf8_get_char_id;
+ uint32_t (*_lv_text_get_encoded_length)(const char *) = lv_text_utf8_get_length;
#elif LV_TXT_ENC == LV_TXT_ENC_ASCII
- uint8_t (*_lv_txt_encoded_size)(const char *) = lv_txt_iso8859_1_size;
- uint32_t (*_lv_txt_unicode_to_encoded)(uint32_t) = lv_txt_unicode_to_iso8859_1;
- uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t) = lv_txt_iso8859_1_conv_wc;
- uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *) = lv_txt_iso8859_1_next;
- uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *) = lv_txt_iso8859_1_prev;
- uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t) = lv_txt_iso8859_1_get_byte_id;
- uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t) = lv_txt_iso8859_1_get_char_id;
- uint32_t (*_lv_txt_get_encoded_length)(const char *) = lv_txt_iso8859_1_get_length;
+ uint8_t (*_lv_text_encoded_size)(const char *) = lv_text_iso8859_1_size;
+ uint32_t (*_lv_text_unicode_to_encoded)(uint32_t) = lv_text_unicode_to_iso8859_1;
+ uint32_t (*_lv_text_encoded_conv_wc)(uint32_t) = lv_text_iso8859_1_conv_wc;
+ uint32_t (*_lv_text_encoded_next)(const char *, uint32_t *) = lv_text_iso8859_1_next;
+ uint32_t (*_lv_text_encoded_prev)(const char *, uint32_t *) = lv_text_iso8859_1_prev;
+ uint32_t (*_lv_text_encoded_get_byte_id)(const char *, uint32_t) = lv_text_iso8859_1_get_byte_id;
+ uint32_t (*_lv_text_encoded_get_char_id)(const char *, uint32_t) = lv_text_iso8859_1_get_char_id;
+ uint32_t (*_lv_text_get_encoded_length)(const char *) = lv_text_iso8859_1_get_length;
#endif
@@ -89,8 +89,8 @@
* GLOBAL FUNCTIONS
**********************/
-void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space,
- lv_coord_t line_space, lv_coord_t max_width, lv_text_flag_t flag)
+void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space,
+ lv_coord_t line_space, lv_coord_t max_width, lv_text_flag_t flag)
{
size_res->x = 0;
size_res->y = 0;
@@ -106,7 +106,7 @@ void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t *
/*Calc. the height and longest line*/
while(text[line_start] != '\0') {
- new_line_start += _lv_txt_get_next_line(&text[line_start], font, letter_space, max_width, NULL, flag);
+ new_line_start += _lv_text_get_next_line(&text[line_start], font, letter_space, max_width, NULL, flag);
if((unsigned long)size_res->y + (unsigned long)letter_height + (unsigned long)line_space > LV_MAX_OF(lv_coord_t)) {
LV_LOG_WARN("integer overflow while calculating text height");
@@ -118,7 +118,7 @@ void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t *
}
/*Calculate the longest line*/
- lv_coord_t act_line_length = lv_txt_get_width(&text[line_start], new_line_start - line_start, font, letter_space);
+ lv_coord_t act_line_length = lv_text_get_width(&text[line_start], new_line_start - line_start, font, letter_space);
size_res->x = LV_MAX(act_line_length, size_res->x);
line_start = new_line_start;
@@ -145,7 +145,7 @@ void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t *
*
* If the first character is a break character, returns the next index.
*
- * Example calls from lv_txt_get_next_line() assuming sufficient max_width and
+ * Example calls from lv_text_get_next_line() assuming sufficient max_width and
* txt = "Test text\n"
* 0123456789
*
@@ -153,7 +153,7 @@ void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t *
* 1. Return i=4, pointing at breakchar ' ', for the string "Test"
* 2. Return i=5, since i=4 was a breakchar.
* 3. Return i=9, pointing at breakchar '\n'
- * 4. Parenting lv_txt_get_next_line() would detect subsequent '\0'
+ * 4. Parenting lv_text_get_next_line() would detect subsequent '\0'
*
* TODO: Returned word_w_ptr may overestimate the returned word's width when
* max_width is reached. In current usage, this has no impact.
@@ -167,9 +167,9 @@ void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t *
* @param force Force return the fraction of the word that can fit in the provided space.
* @return the index of the first char of the next word (in byte index not letter index. With UTF-8 they are different)
*/
-static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font,
- lv_coord_t letter_space, lv_coord_t max_width,
- lv_text_flag_t flag, uint32_t * word_w_ptr, bool force)
+static uint32_t lv_text_get_next_word(const char * txt, const lv_font_t * font,
+ lv_coord_t letter_space, lv_coord_t max_width,
+ lv_text_flag_t flag, uint32_t * word_w_ptr, bool force)
{
if(txt == NULL || txt[0] == '\0') return 0;
if(font == NULL) return 0;
@@ -185,12 +185,12 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font,
uint32_t break_index = NO_BREAK_FOUND; /*only used for "long" words*/
uint32_t break_letter_count = 0; /*Number of characters up to the long word break point*/
- letter = _lv_txt_encoded_next(txt, &i_next);
+ letter = _lv_text_encoded_next(txt, &i_next);
i_next_next = i_next;
/*Obtain the full word, regardless if it fits or not in max_width*/
while(txt[i] != '\0') {
- letter_next = _lv_txt_encoded_next(txt, &i_next_next);
+ letter_next = _lv_text_encoded_next(txt, &i_next_next);
word_len++;
letter_w = lv_font_get_glyph_width(font, letter, letter_next);
@@ -208,14 +208,14 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font,
}
/*Check for new line chars and breakchars*/
- if(letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter)) {
+ if(letter == '\n' || letter == '\r' || _lv_text_is_break_char(letter)) {
/*Update the output width on the first character if it fits.
*Must do this here in case first letter is a break character.*/
if(i == 0 && break_index == NO_BREAK_FOUND && word_w_ptr != NULL) *word_w_ptr = cur_w;
word_len--;
break;
}
- else if(_lv_txt_is_a_word(letter_next) || _lv_txt_is_a_word(letter)) {
+ else if(_lv_text_is_a_word(letter_next) || _lv_text_is_a_word(letter)) {
/*Found a word for single letter, usually true for CJK*/
*word_w_ptr = cur_w;
i = i_next;
@@ -257,7 +257,7 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font,
int32_t n_move = LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN - (word_len - break_letter_count);
/*Move pointer "i" backwards*/
for(; n_move > 0; n_move--) {
- _lv_txt_encoded_prev(txt, &i);
+ _lv_text_encoded_prev(txt, &i);
// TODO: it would be appropriate to update the returned word width here
// However, in current usage, this doesn't impact anything.
}
@@ -271,9 +271,9 @@ static uint32_t lv_txt_get_next_word(const char * txt, const lv_font_t * font,
#endif
}
-uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font,
- lv_coord_t letter_space, lv_coord_t max_width,
- lv_coord_t * used_width, lv_text_flag_t flag)
+uint32_t _lv_text_get_next_line(const char * txt, const lv_font_t * font,
+ lv_coord_t letter_space, lv_coord_t max_width,
+ lv_coord_t * used_width, lv_text_flag_t flag)
{
if(used_width) *used_width = 0;
@@ -300,7 +300,7 @@ uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font,
while(txt[i] != '\0' && max_width > 0) {
uint32_t word_w = 0;
- uint32_t advance = lv_txt_get_next_word(&txt[i], font, letter_space, max_width, flag, &word_w, i == 0);
+ uint32_t advance = lv_text_get_next_word(&txt[i], font, letter_space, max_width, flag, &word_w, i == 0);
max_width -= word_w;
line_w += word_w;
@@ -321,7 +321,7 @@ uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font,
/*Always step at least one to avoid infinite loops*/
if(i == 0) {
- uint32_t letter = _lv_txt_encoded_next(txt, &i);
+ uint32_t letter = _lv_text_encoded_next(txt, &i);
if(used_width != NULL) {
line_w = lv_font_get_glyph_width(font, letter, '\0');
}
@@ -334,7 +334,7 @@ uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font,
return i;
}
-lv_coord_t lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t * font, lv_coord_t letter_space)
+lv_coord_t lv_text_get_width(const char * txt, uint32_t length, const lv_font_t * font, lv_coord_t letter_space)
{
if(txt == NULL) return 0;
if(font == NULL) return 0;
@@ -347,7 +347,7 @@ lv_coord_t lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t *
while(i < length) {
uint32_t letter;
uint32_t letter_next;
- _lv_txt_encoded_letter_next_2(txt, &letter, &letter_next, &i);
+ _lv_text_encoded_letter_next_2(txt, &letter, &letter_next, &i);
lv_coord_t char_width = lv_font_get_glyph_width(font, letter, letter_next);
if(char_width > 0) {
@@ -365,7 +365,7 @@ lv_coord_t lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t *
return width;
}
-void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt)
+void _lv_text_ins(char * txt_buf, uint32_t pos, const char * ins_txt)
{
if(txt_buf == NULL || ins_txt == NULL) return;
@@ -374,7 +374,7 @@ void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt)
if(ins_len == 0) return;
size_t new_len = ins_len + old_len;
- pos = _lv_txt_encoded_get_byte_id(txt_buf, pos); /*Convert to byte index instead of letter index*/
+ pos = _lv_text_encoded_get_byte_id(txt_buf, pos); /*Convert to byte index instead of letter index*/
/*Copy the second part into the end to make place to text to insert*/
size_t i;
@@ -386,14 +386,14 @@ void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt)
lv_memcpy(txt_buf + pos, ins_txt, ins_len);
}
-void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len)
+void _lv_text_cut(char * txt, uint32_t pos, uint32_t len)
{
if(txt == NULL) return;
size_t old_len = lv_strlen(txt);
- pos = _lv_txt_encoded_get_byte_id(txt, pos); /*Convert to byte index instead of letter index*/
- len = _lv_txt_encoded_get_byte_id(&txt[pos], len);
+ pos = _lv_text_encoded_get_byte_id(txt, pos); /*Convert to byte index instead of letter index*/
+ len = _lv_text_encoded_get_byte_id(&txt[pos], len);
/*Copy the second part into the end to make place to text to insert*/
uint32_t i;
@@ -402,7 +402,7 @@ void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len)
}
}
-char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap)
+char * _lv_text_set_text_vfmt(const char * fmt, va_list ap)
{
/*Allocate space for the new text by using trick from C99 standard section 7.19.6.12*/
va_list ap_copy;
@@ -422,13 +422,13 @@ char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap)
lv_vsnprintf(raw_txt, len + 1, fmt, ap);
/*Get the size of the Arabic text and process it*/
- size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt);
+ size_t len_ap = _lv_text_ap_calc_bytes_cnt(raw_txt);
text = lv_malloc(len_ap + 1);
LV_ASSERT_MALLOC(text);
if(text == NULL) {
return NULL;
}
- _lv_txt_ap_proc(raw_txt, text);
+ _lv_text_ap_proc(raw_txt, text);
lv_free(raw_txt);
#else
@@ -444,10 +444,10 @@ char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap)
return text;
}
-void _lv_txt_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t * letter_next, uint32_t * ofs)
+void _lv_text_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t * letter_next, uint32_t * ofs)
{
- *letter = _lv_txt_encoded_next(txt, ofs);
- *letter_next = *letter != '\0' ? _lv_txt_encoded_next(&txt[*ofs], NULL) : 0;
+ *letter = _lv_text_encoded_next(txt, ofs);
+ *letter_next = *letter != '\0' ? _lv_text_encoded_next(&txt[*ofs], NULL) : 0;
}
#if LV_TXT_ENC == LV_TXT_ENC_UTF8
@@ -460,7 +460,7 @@ void _lv_txt_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t
* @param str pointer to a character in a string
* @return length of the UTF-8 character (1,2,3 or 4), 0 on invalid code.
*/
-static uint8_t lv_txt_utf8_size(const char * str)
+static uint8_t lv_text_utf8_size(const char * str)
{
if(LV_IS_ASCII(str[0]))
return 1;
@@ -478,7 +478,7 @@ static uint8_t lv_txt_utf8_size(const char * str)
* @param letter_uni a Unicode letter
* @return UTF-8 coded character in Little Endian to be compatible with C chars (e.g. 'Á', 'Ű')
*/
-static uint32_t lv_txt_unicode_to_utf8(uint32_t letter_uni)
+static uint32_t lv_text_unicode_to_utf8(uint32_t letter_uni)
{
if(letter_uni < 128) return letter_uni;
uint8_t bytes[4];
@@ -514,7 +514,7 @@ static uint32_t lv_txt_unicode_to_utf8(uint32_t letter_uni)
* @param c a wide character or a Little endian number
* @return `c` in big endian
*/
-static uint32_t lv_txt_utf8_conv_wc(uint32_t c)
+static uint32_t lv_text_utf8_conv_wc(uint32_t c)
{
#if LV_BIG_ENDIAN_SYSTEM == 0
/*Swap the bytes (UTF-8 is big endian, but the MCUs are little endian)*/
@@ -542,7 +542,7 @@ static uint32_t lv_txt_utf8_conv_wc(uint32_t c)
* NULL to use txt[0] as index
* @return the decoded Unicode character or 0 on invalid UTF-8 code
*/
-static uint32_t lv_txt_utf8_next(const char * txt, uint32_t * i)
+static uint32_t lv_text_utf8_next(const char * txt, uint32_t * i)
{
/**
* Unicode to UTF-8
@@ -617,7 +617,7 @@ static uint32_t lv_txt_utf8_next(const char * txt, uint32_t * i)
* UTF-8 char in 'txt'.
* @return the decoded Unicode character or 0 on invalid UTF-8 code
*/
-static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i)
+static uint32_t lv_text_utf8_prev(const char * txt, uint32_t * i)
{
uint8_t c_size;
uint8_t cnt = 0;
@@ -627,7 +627,7 @@ static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i)
do {
if(cnt >= 4) return 0; /*No UTF-8 char found before the initial*/
- c_size = _lv_txt_encoded_size(&txt[*i]);
+ c_size = _lv_text_encoded_size(&txt[*i]);
if(c_size == 0) {
if(*i != 0)
(*i)--;
@@ -638,7 +638,7 @@ static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i)
} while(c_size == 0);
uint32_t i_tmp = *i;
- uint32_t letter = _lv_txt_encoded_next(txt, &i_tmp); /*Character found, get it*/
+ uint32_t letter = _lv_text_encoded_next(txt, &i_tmp); /*Character found, get it*/
return letter;
}
@@ -650,12 +650,12 @@ static uint32_t lv_txt_utf8_prev(const char * txt, uint32_t * i)
* @param utf8_id character index
* @return byte index of the 'utf8_id'th letter
*/
-static uint32_t lv_txt_utf8_get_byte_id(const char * txt, uint32_t utf8_id)
+static uint32_t lv_text_utf8_get_byte_id(const char * txt, uint32_t utf8_id)
{
uint32_t i;
uint32_t byte_cnt = 0;
for(i = 0; i < utf8_id && txt[byte_cnt] != '\0'; i++) {
- uint8_t c_size = _lv_txt_encoded_size(&txt[byte_cnt]);
+ uint8_t c_size = _lv_text_encoded_size(&txt[byte_cnt]);
/* If the char was invalid tell it's 1 byte long*/
byte_cnt += c_size ? c_size : 1;
}
@@ -670,13 +670,13 @@ static uint32_t lv_txt_utf8_get_byte_id(const char * txt, uint32_t utf8_id)
* @param byte_id byte index
* @return character index of the letter at 'byte_id'th position
*/
-static uint32_t lv_txt_utf8_get_char_id(const char * txt, uint32_t byte_id)
+static uint32_t lv_text_utf8_get_char_id(const char * txt, uint32_t byte_id)
{
uint32_t i = 0;
uint32_t char_cnt = 0;
while(i < byte_id) {
- _lv_txt_encoded_next(txt, &i); /*'i' points to the next letter so use the prev. value*/
+ _lv_text_encoded_next(txt, &i); /*'i' points to the next letter so use the prev. value*/
char_cnt++;
}
@@ -689,13 +689,13 @@ static uint32_t lv_txt_utf8_get_char_id(const char * txt, uint32_t byte_id)
* @param txt a '\0' terminated char string
* @return number of characters
*/
-static uint32_t lv_txt_utf8_get_length(const char * txt)
+static uint32_t lv_text_utf8_get_length(const char * txt)
{
uint32_t len = 0;
uint32_t i = 0;
while(txt[i] != '\0') {
- _lv_txt_encoded_next(txt, &i);
+ _lv_text_encoded_next(txt, &i);
len++;
}
@@ -712,7 +712,7 @@ static uint32_t lv_txt_utf8_get_length(const char * txt)
* @param str pointer to a character in a string
* @return length of the UTF-8 character (1,2,3 or 4). O on invalid code
*/
-static uint8_t lv_txt_iso8859_1_size(const char * str)
+static uint8_t lv_text_iso8859_1_size(const char * str)
{
LV_UNUSED(str); /*Unused*/
return 1;
@@ -723,7 +723,7 @@ static uint8_t lv_txt_iso8859_1_size(const char * str)
* @param letter_uni a Unicode letter
* @return ISO8859-1 coded character in Little Endian to be compatible with C chars (e.g. 'Á', 'Ű')
*/
-static uint32_t lv_txt_unicode_to_iso8859_1(uint32_t letter_uni)
+static uint32_t lv_text_unicode_to_iso8859_1(uint32_t letter_uni)
{
if(letter_uni < 256)
return letter_uni;
@@ -737,7 +737,7 @@ static uint32_t lv_txt_unicode_to_iso8859_1(uint32_t letter_uni)
* @param c a character, e.g. 'A'
* @return same as `c`
*/
-static uint32_t lv_txt_iso8859_1_conv_wc(uint32_t c)
+static uint32_t lv_text_iso8859_1_conv_wc(uint32_t c)
{
return c;
}
@@ -750,7 +750,7 @@ static uint32_t lv_txt_iso8859_1_conv_wc(uint32_t c)
* NULL to use txt[0] as index
* @return the decoded Unicode character or 0 on invalid UTF-8 code
*/
-static uint32_t lv_txt_iso8859_1_next(const char * txt, uint32_t * i)
+static uint32_t lv_text_iso8859_1_next(const char * txt, uint32_t * i)
{
if(i == NULL) return txt[0]; /*Get the next char*/
@@ -765,7 +765,7 @@ static uint32_t lv_txt_iso8859_1_next(const char * txt, uint32_t * i)
* @param i start byte index in 'txt' where to start. After the call it will point to the previous UTF-8 char in 'txt'.
* @return the decoded Unicode character or 0 on invalid UTF-8 code
*/
-static uint32_t lv_txt_iso8859_1_prev(const char * txt, uint32_t * i)
+static uint32_t lv_text_iso8859_1_prev(const char * txt, uint32_t * i)
{
if(i == NULL) return *(txt - 1); /*Get the prev. char*/
@@ -782,7 +782,7 @@ static uint32_t lv_txt_iso8859_1_prev(const char * txt, uint32_t * i)
* @param utf8_id character index
* @return byte index of the 'utf8_id'th letter
*/
-static uint32_t lv_txt_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id)
+static uint32_t lv_text_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id)
{
LV_UNUSED(txt); /*Unused*/
return utf8_id; /*In Non encoded no difference*/
@@ -795,7 +795,7 @@ static uint32_t lv_txt_iso8859_1_get_byte_id(const char * txt, uint32_t utf8_id)
* @param byte_id byte index
* @return character index of the letter at 'byte_id'th position
*/
-static uint32_t lv_txt_iso8859_1_get_char_id(const char * txt, uint32_t byte_id)
+static uint32_t lv_text_iso8859_1_get_char_id(const char * txt, uint32_t byte_id)
{
LV_UNUSED(txt); /*Unused*/
return byte_id; /*In Non encoded no difference*/
@@ -807,7 +807,7 @@ static uint32_t lv_txt_iso8859_1_get_char_id(const char * txt, uint32_t byte_id)
* @param txt a '\0' terminated char string
* @return number of characters
*/
-static uint32_t lv_txt_iso8859_1_get_length(const char * txt)
+static uint32_t lv_text_iso8859_1_get_length(const char * txt)
{
return lv_strlen(txt);
}
diff --git a/src/misc/lv_txt.h b/src/misc/lv_text.h
similarity index 82%
rename from src/misc/lv_txt.h
rename to src/misc/lv_text.h
index 07dafae047..40729e6886 100644
--- a/src/misc/lv_txt.h
+++ b/src/misc/lv_text.h
@@ -1,10 +1,10 @@
/**
- * @file lv_txt.h
+ * @file lv_text.h
*
*/
-#ifndef LV_TXT_H
-#define LV_TXT_H
+#ifndef LV_TEXT_H
+#define LV_TEXT_H
#ifdef __cplusplus
extern "C" {
@@ -82,8 +82,8 @@ typedef uint8_t lv_text_align_t;
* line breaks
*/
-void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space,
- lv_coord_t line_space, lv_coord_t max_width, lv_text_flag_t flag);
+void lv_text_get_size(lv_point_t * size_res, const char * text, const lv_font_t * font, lv_coord_t letter_space,
+ lv_coord_t line_space, lv_coord_t max_width, lv_text_flag_t flag);
/**
* Get the next line of text. Check line length and break chars too.
@@ -98,8 +98,8 @@ void lv_txt_get_size(lv_point_t * size_res, const char * text, const lv_font_t *
* @return the index of the first char of the new line (in byte index not letter index. With UTF-8
* they are different)
*/
-uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coord_t letter_space,
- lv_coord_t max_width, lv_coord_t * used_width, lv_text_flag_t flag);
+uint32_t _lv_text_get_next_line(const char * txt, const lv_font_t * font, lv_coord_t letter_space,
+ lv_coord_t max_width, lv_coord_t * used_width, lv_text_flag_t flag);
/**
* Give the length of a text with a given font
@@ -110,7 +110,7 @@ uint32_t _lv_txt_get_next_line(const char * txt, const lv_font_t * font, lv_coor
* @param letter_space letter space
* @return length of a char_num long text
*/
-lv_coord_t lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t * font, lv_coord_t letter_space);
+lv_coord_t lv_text_get_width(const char * txt, uint32_t length, const lv_font_t * font, lv_coord_t letter_space);
/**
* Insert a string into an other
@@ -118,7 +118,7 @@ lv_coord_t lv_txt_get_width(const char * txt, uint32_t length, const lv_font_t *
* @param pos position to insert (0: before the original text, 1: after the first char etc.)
* @param ins_txt text to insert, must be '\0' terminated
*/
-void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt);
+void _lv_text_ins(char * txt_buf, uint32_t pos, const char * ins_txt);
/**
* Delete a part of a string
@@ -127,7 +127,7 @@ void _lv_txt_ins(char * txt_buf, uint32_t pos, const char * ins_txt);
* char etc.)
* @param len number of characters to delete
*/
-void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len);
+void _lv_text_cut(char * txt, uint32_t pos, uint32_t len);
/**
* return a new formatted text. Memory will be allocated to store the text.
@@ -136,7 +136,7 @@ void _lv_txt_cut(char * txt, uint32_t pos, uint32_t len);
* @return pointer to the allocated text string.
*/
-char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap) LV_FORMAT_ATTRIBUTE(1, 0);
+char * _lv_text_set_text_vfmt(const char * fmt, va_list ap) LV_FORMAT_ATTRIBUTE(1, 0);
/**
* Decode two encoded character from a string.
@@ -147,14 +147,14 @@ char * _lv_txt_set_text_vfmt(const char * fmt, va_list ap) LV_FORMAT_ATTRIBUTE(1
* After the call it will point to the next encoded char in 'txt'.
* NULL to use txt[0] as index
*/
-void _lv_txt_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t * letter_next, uint32_t * ofs);
+void _lv_text_encoded_letter_next_2(const char * txt, uint32_t * letter, uint32_t * letter_next, uint32_t * ofs);
/**
* Test if char is break char or not (a text can broken here or not)
* @param letter a letter
* @return false: 'letter' is not break char
*/
-static inline bool _lv_txt_is_break_char(uint32_t letter)
+static inline bool _lv_text_is_break_char(uint32_t letter)
{
uint8_t i;
bool ret = false;
@@ -176,7 +176,7 @@ static inline bool _lv_txt_is_break_char(uint32_t letter)
* @param letter a letter
* @return false: 'letter' is not break char
*/
-static inline bool _lv_txt_is_a_word(uint32_t letter)
+static inline bool _lv_text_is_a_word(uint32_t letter)
{
/*Cheap check on invalid letter*/
if(letter == 0) return false;
@@ -208,21 +208,21 @@ static inline bool _lv_txt_is_a_word(uint32_t letter)
* @param str pointer to a character in a string
* @return length of the encoded character (1,2,3 ...). O in invalid
*/
-extern uint8_t (*_lv_txt_encoded_size)(const char *);
+extern uint8_t (*_lv_text_encoded_size)(const char *);
/**
* Convert a Unicode letter to encoded
* @param letter_uni a Unicode letter
* @return Encoded character in Little Endian to be compatible with C chars (e.g. 'Á', 'Ü')
*/
-extern uint32_t (*_lv_txt_unicode_to_encoded)(uint32_t);
+extern uint32_t (*_lv_text_unicode_to_encoded)(uint32_t);
/**
* Convert a wide character, e.g. 'Á' little endian to be compatible with the encoded format.
* @param c a wide character
* @return `c` in the encoded format
*/
-extern uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t c);
+extern uint32_t (*_lv_text_encoded_conv_wc)(uint32_t c);
/**
* Decode the next encoded character from a string.
@@ -232,7 +232,7 @@ extern uint32_t (*_lv_txt_encoded_conv_wc)(uint32_t c);
* NULL to use txt[0] as index
* @return the decoded Unicode character or 0 on invalid data code
*/
-extern uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *);
+extern uint32_t (*_lv_text_encoded_next)(const char *, uint32_t *);
/**
* Get the previous encoded character form a string.
@@ -241,7 +241,7 @@ extern uint32_t (*_lv_txt_encoded_next)(const char *, uint32_t *);
* encoded char in 'txt'.
* @return the decoded Unicode character or 0 on invalid data
*/
-extern uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *);
+extern uint32_t (*_lv_text_encoded_prev)(const char *, uint32_t *);
/**
* Convert a letter index (in the encoded text) to byte index.
@@ -250,7 +250,7 @@ extern uint32_t (*_lv_txt_encoded_prev)(const char *, uint32_t *);
* @param enc_id letter index
* @return byte index of the 'enc_id'th letter
*/
-extern uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t);
+extern uint32_t (*_lv_text_encoded_get_byte_id)(const char *, uint32_t);
/**
* Convert a byte index (in an encoded text) to character index.
@@ -259,7 +259,7 @@ extern uint32_t (*_lv_txt_encoded_get_byte_id)(const char *, uint32_t);
* @param byte_id byte index
* @return character index of the letter at 'byte_id'th position
*/
-extern uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t);
+extern uint32_t (*_lv_text_encoded_get_char_id)(const char *, uint32_t);
/**
* Get the number of characters (and NOT bytes) in a string.
@@ -267,7 +267,7 @@ extern uint32_t (*_lv_txt_encoded_get_char_id)(const char *, uint32_t);
* @param txt a '\0' terminated char string
* @return number of characters
*/
-extern uint32_t (*_lv_txt_get_encoded_length)(const char *);
+extern uint32_t (*_lv_text_get_encoded_length)(const char *);
/**********************
* MACROS
@@ -277,4 +277,4 @@ extern uint32_t (*_lv_txt_get_encoded_length)(const char *);
} /*extern "C"*/
#endif
-#endif /*LV_TXT_H*/
+#endif /*LV_TEXT_H*/
diff --git a/src/misc/lv_txt_ap.c b/src/misc/lv_text_ap.c
similarity index 91%
rename from src/misc/lv_txt_ap.c
rename to src/misc/lv_text_ap.c
index 2b008b9daa..c38e037341 100644
--- a/src/misc/lv_txt_ap.c
+++ b/src/misc/lv_text_ap.c
@@ -1,5 +1,5 @@
/**
- * @file lv_txt_ap.c
+ * @file lv_text_ap.c
*
*/
@@ -8,8 +8,8 @@
*********************/
#include
#include "lv_bidi.h"
-#include "lv_txt.h"
-#include "lv_txt_ap.h"
+#include "lv_text.h"
+#include "lv_text_ap.h"
#include "../stdlib/lv_mem.h"
#include "../draw/lv_draw.h"
@@ -37,8 +37,8 @@ typedef struct {
**********************/
#if LV_USE_ARABIC_PERSIAN_CHARS == 1
static uint32_t lv_ap_get_char_index(uint16_t c);
-static uint32_t lv_txt_lam_alef(uint32_t ch_curr, uint32_t ch_next);
-static bool lv_txt_is_arabic_vowel(uint16_t c);
+static uint32_t lv_text_lam_alef(uint32_t ch_curr, uint32_t ch_next);
+static bool lv_text_is_arabic_vowel(uint16_t c);
/**********************
* STATIC VARIABLES
@@ -106,7 +106,7 @@ const ap_chars_map_t ap_chars_map[] = {
/**********************
* GLOBAL FUNCTIONS
**********************/
-uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt)
+uint32_t _lv_text_ap_calc_bytes_cnt(const char * txt)
{
uint32_t txt_length = 0;
uint32_t chars_cnt = 0;
@@ -114,12 +114,12 @@ uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt)
uint32_t i, j;
uint32_t ch_enc;
- txt_length = _lv_txt_get_encoded_length(txt);
+ txt_length = _lv_text_get_encoded_length(txt);
i = 0;
j = 0;
while(i < txt_length) {
- ch_enc = _lv_txt_encoded_next(txt, &j);
+ ch_enc = _lv_text_encoded_next(txt, &j);
current_ap_idx = lv_ap_get_char_index(ch_enc);
if(current_ap_idx != LV_UNDEF_ARABIC_PERSIAN_CHARS)
@@ -140,7 +140,7 @@ uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt)
return chars_cnt + 1;
}
-void _lv_txt_ap_proc(const char * txt, char * txt_out)
+void _lv_text_ap_proc(const char * txt, char * txt_out)
{
uint32_t txt_length = 0;
uint32_t index_current, idx_next, idx_previous, i, j;
@@ -148,7 +148,7 @@ void _lv_txt_ap_proc(const char * txt, char * txt_out)
uint32_t * ch_fin;
char * txt_out_temp;
- txt_length = _lv_txt_get_encoded_length(txt);
+ txt_length = _lv_text_get_encoded_length(txt);
ch_enc = (uint32_t *)lv_malloc(sizeof(uint32_t) * (txt_length + 1));
ch_fin = (uint32_t *)lv_malloc(sizeof(uint32_t) * (txt_length + 1));
@@ -156,7 +156,7 @@ void _lv_txt_ap_proc(const char * txt, char * txt_out)
i = 0;
j = 0;
while(j < txt_length)
- ch_enc[j++] = _lv_txt_encoded_next(txt, &i);
+ ch_enc[j++] = _lv_text_encoded_next(txt, &i);
ch_enc[j] = 0;
@@ -167,13 +167,13 @@ void _lv_txt_ap_proc(const char * txt, char * txt_out)
index_current = lv_ap_get_char_index(ch_enc[i]);
idx_next = lv_ap_get_char_index(ch_enc[i + 1]);
- if(lv_txt_is_arabic_vowel(ch_enc[i])) { // Current character is a vowel
+ if(lv_text_is_arabic_vowel(ch_enc[i])) { // Current character is a vowel
ch_fin[j] = ch_enc[i];
i++;
j++;
continue; // Skip this character
}
- else if(lv_txt_is_arabic_vowel(ch_enc[i + 1])) { // Next character is a vowel
+ else if(lv_text_is_arabic_vowel(ch_enc[i + 1])) { // Next character is a vowel
idx_next = lv_ap_get_char_index(ch_enc[i + 2]); // Skip the vowel character to join with the character after it
}
@@ -190,7 +190,7 @@ void _lv_txt_ap_proc(const char * txt, char * txt_out)
uint8_t conjunction_to_next = ((i == txt_length - 1) ||
idx_next == LV_UNDEF_ARABIC_PERSIAN_CHARS) ? 0 : ap_chars_map[idx_next].ap_chars_conjunction.conj_to_previous;
- uint32_t lam_alef = lv_txt_lam_alef(index_current, idx_next);
+ uint32_t lam_alef = lv_text_lam_alef(index_current, idx_next);
if(lam_alef) {
if(conjunction_to_previuse) {
lam_alef ++;
@@ -268,7 +268,7 @@ static uint32_t lv_ap_get_char_index(uint16_t c)
return LV_UNDEF_ARABIC_PERSIAN_CHARS;
}
-static uint32_t lv_txt_lam_alef(uint32_t ch_curr, uint32_t ch_next)
+static uint32_t lv_text_lam_alef(uint32_t ch_curr, uint32_t ch_next)
{
uint32_t ch_code = 0;
if(ap_chars_map[ch_curr].char_offset != 34) {
@@ -293,7 +293,7 @@ static uint32_t lv_txt_lam_alef(uint32_t ch_curr, uint32_t ch_next)
return 0;
}
-static bool lv_txt_is_arabic_vowel(uint16_t c)
+static bool lv_text_is_arabic_vowel(uint16_t c)
{
return (c >= 0x064B) && (c <= 0x0652);
}
diff --git a/src/misc/lv_txt_ap.h b/src/misc/lv_text_ap.h
similarity index 76%
rename from src/misc/lv_txt_ap.h
rename to src/misc/lv_text_ap.h
index e2d94b8da4..71e8b95b6c 100644
--- a/src/misc/lv_txt_ap.h
+++ b/src/misc/lv_text_ap.h
@@ -1,10 +1,10 @@
/**
- * @file lv_txt_ap.h
+ * @file lv_text_ap.h
*
*/
-#ifndef LV_TXT_AP_H
-#define LV_TXT_AP_H
+#ifndef LV_TEXT_AP_H
+#define LV_TEXT_AP_H
#ifdef __cplusplus
extern "C" {
@@ -14,7 +14,7 @@ extern "C" {
* INCLUDES
*********************/
#include
-#include "lv_txt.h"
+#include "lv_text.h"
#include "../draw/lv_draw.h"
#if LV_USE_ARABIC_PERSIAN_CHARS == 1
@@ -33,8 +33,8 @@ extern "C" {
/**********************
* GLOBAL PROTOTYPES
**********************/
-uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt);
-void _lv_txt_ap_proc(const char * txt, char * txt_out);
+uint32_t _lv_text_ap_calc_bytes_cnt(const char * txt);
+void _lv_text_ap_proc(const char * txt, char * txt_out);
/**********************
* MACROS
@@ -46,4 +46,4 @@ void _lv_txt_ap_proc(const char * txt, char * txt_out);
} /*extern "C"*/
#endif
-#endif /*LV_TXT_AP_H*/
+#endif /*LV_TEXT_AP_H*/
diff --git a/src/misc/lv_types.h b/src/misc/lv_types.h
index 216d437fd3..481ed64e1b 100644
--- a/src/misc/lv_types.h
+++ b/src/misc/lv_types.h
@@ -51,16 +51,16 @@ extern "C" {
/**
* LVGL error codes.
*/
-enum _lv_res_t {
- LV_RES_INV = 0, /*Typically indicates that the object is deleted (become invalid) in the action
+enum _lv_result_t {
+ LV_RESULT_INVALID = 0, /*Typically indicates that the object is deleted (become invalid) in the action
function or an operation was failed*/
- LV_RES_OK, /*The object is valid (no deleted) after the action*/
+ LV_RESULT_OK, /*The object is valid (no deleted) after the action*/
};
#ifdef DOXYGEN
-typedef _lv_res_t lv_res_t;
+typedef _lv_result_t lv_result_t;
#else
-typedef uint8_t lv_res_t;
+typedef uint8_t lv_result_t;
#endif /*DOXYGEN*/
diff --git a/src/osal/lv_cmsis_rtos2.c b/src/osal/lv_cmsis_rtos2.c
index 4e2a1b539a..028520f180 100644
--- a/src/osal/lv_cmsis_rtos2.c
+++ b/src/osal/lv_cmsis_rtos2.c
@@ -42,8 +42,8 @@
* GLOBAL FUNCTIONS
**********************/
-lv_res_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
- void * user_data)
+lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
+ void * user_data)
{
static const osPriority_t prio_map[] = {
[LV_THREAD_PRIO_LOWEST] = osPriorityLow,
@@ -62,24 +62,24 @@ lv_res_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*call
if(NULL == *thread) {
LV_LOG_WARN("Error: Failed to create a cmsis-rtos2 thread.");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_delete(lv_thread_t * thread)
+lv_result_t lv_thread_delete(lv_thread_t * thread)
{
osThreadDetach(*thread);
osStatus_t status = osThreadTerminate(*thread);
if(status == osOK) {
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
-lv_res_t lv_mutex_init(lv_mutex_t * mutex)
+lv_result_t lv_mutex_init(lv_mutex_t * mutex)
{
const osMutexAttr_t Thread_Mutex_attr = {
"LVGLMutex",
@@ -89,98 +89,98 @@ lv_res_t lv_mutex_init(lv_mutex_t * mutex)
*mutex = osMutexNew(&Thread_Mutex_attr);
if(*mutex == NULL) {
LV_LOG_WARN("Error: failed to create cmsis-rtos mutex");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_lock(lv_mutex_t * mutex)
+lv_result_t lv_mutex_lock(lv_mutex_t * mutex)
{
osStatus_t status = osMutexAcquire(*mutex, 0U);
if(status != osOK) {
LV_LOG_WARN("Error: failed to lock cmsis-rtos2 mutex %d", (int)status);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_lock_isr(lv_mutex_t * mutex)
+lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex)
{
osStatus_t status = osMutexAcquire(*mutex, 0U);
if(status != osOK) {
LV_LOG_WARN("Error: failed to lock cmsis-rtos2 mutex in an ISR %d", (int)status);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_unlock(lv_mutex_t * mutex)
+lv_result_t lv_mutex_unlock(lv_mutex_t * mutex)
{
osStatus_t status = osMutexRelease(*mutex);
if(status != osOK) {
LV_LOG_WARN("Error: failed to release cmsis-rtos2 mutex %d", (int)status);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_delete(lv_mutex_t * mutex)
+lv_result_t lv_mutex_delete(lv_mutex_t * mutex)
{
osStatus_t status = osMutexDelete(*mutex);
if(status != osOK) {
LV_LOG_WARN("Error: failed to delete cmsis-rtos2 mutex %d", (int)status);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_init(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync)
{
*sync = osEventFlagsNew(NULL);
if(NULL == *sync) {
LV_LOG_WARN("Error: failed to create a cmsis-rtos2 EventFlag");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_wait(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync)
{
uint32_t ret = osEventFlagsWait(*sync, 0x01, osFlagsWaitAny, osWaitForever);
if(ret & (1 << 31)) {
LV_LOG_WARN("Error: failed to wait a cmsis-rtos2 EventFlag %d", ret);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_signal(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync)
{
uint32_t ret = osEventFlagsSet(*sync, 0x01);
if(ret & (1 << 31)) {
LV_LOG_WARN("Error: failed to set a cmsis-rtos2 EventFlag %d", ret);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_delete(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync)
{
osStatus_t status = osEventFlagsDelete(*sync);
if(status != osOK) {
LV_LOG_WARN("Error: failed to delete a cmsis-rtos2 EventFlag %d", (int)status);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/**********************
diff --git a/src/osal/lv_freertos.c b/src/osal/lv_freertos.c
index 8a74eae27a..49192402d2 100644
--- a/src/osal/lv_freertos.c
+++ b/src/osal/lv_freertos.c
@@ -63,9 +63,9 @@ static void prvTestAndDecrement(lv_thread_sync_t * pxCond,
* GLOBAL FUNCTIONS
**********************/
-lv_res_t lv_thread_init(lv_thread_t * pxThread, lv_thread_prio_t xSchedPriority,
- void (*pvStartRoutine)(void *), size_t usStackSize,
- void * xAttr)
+lv_result_t lv_thread_init(lv_thread_t * pxThread, lv_thread_prio_t xSchedPriority,
+ void (*pvStartRoutine)(void *), size_t usStackSize,
+ void * xAttr)
{
pxThread->xTaskArg = xAttr;
pxThread->pvStartRoutine = pvStartRoutine;
@@ -81,27 +81,27 @@ lv_res_t lv_thread_init(lv_thread_t * pxThread, lv_thread_prio_t xSchedPriority,
/* Ensure that the FreeRTOS task was successfully created. */
if(xTaskCreateStatus != pdPASS) {
LV_LOG_ERROR("xTaskCreate failed!");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_delete(lv_thread_t * pxThread)
+lv_result_t lv_thread_delete(lv_thread_t * pxThread)
{
vTaskDelete(pxThread->xTaskHandle);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_init(lv_mutex_t * pxMutex)
+lv_result_t lv_mutex_init(lv_mutex_t * pxMutex)
{
prvMutexInit(pxMutex);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_lock(lv_mutex_t * pxMutex)
+lv_result_t lv_mutex_lock(lv_mutex_t * pxMutex)
{
/* If mutex in uninitialized, perform initialization. */
prvCheckMutexInit(pxMutex);
@@ -109,13 +109,13 @@ lv_res_t lv_mutex_lock(lv_mutex_t * pxMutex)
BaseType_t xMutexTakeStatus = xSemaphoreTake(pxMutex->xMutex, portMAX_DELAY);
if(xMutexTakeStatus != pdTRUE) {
LV_LOG_ERROR("xSemaphoreTake failed!");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_lock_isr(lv_mutex_t * pxMutex)
+lv_result_t lv_mutex_lock_isr(lv_mutex_t * pxMutex)
{
/* If mutex in uninitialized, perform initialization. */
prvCheckMutexInit(pxMutex);
@@ -125,7 +125,7 @@ lv_res_t lv_mutex_lock_isr(lv_mutex_t * pxMutex)
BaseType_t xMutexTakeStatus = xSemaphoreTakeFromISR(pxMutex->xMutex, &xHigherPriorityTaskWoken);
if(xMutexTakeStatus != pdTRUE) {
LV_LOG_ERROR("xSemaphoreTake failed!");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
/* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch
@@ -134,10 +134,10 @@ lv_res_t lv_mutex_lock_isr(lv_mutex_t * pxMutex)
use and may be called portEND_SWITCHING_ISR(). */
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_unlock(lv_mutex_t * pxMutex)
+lv_result_t lv_mutex_unlock(lv_mutex_t * pxMutex)
{
/* If mutex in uninitialized, perform initialization. */
prvCheckMutexInit(pxMutex);
@@ -145,21 +145,21 @@ lv_res_t lv_mutex_unlock(lv_mutex_t * pxMutex)
BaseType_t xMutexGiveStatus = xSemaphoreGive(pxMutex->xMutex);
if(xMutexGiveStatus != pdTRUE) {
LV_LOG_ERROR("xSemaphoreGive failed!");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_delete(lv_mutex_t * pxMutex)
+lv_result_t lv_mutex_delete(lv_mutex_t * pxMutex)
{
vSemaphoreDelete(pxMutex->xMutex);
pxMutex->xIsInitialized = pdFALSE;
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_init(lv_thread_sync_t * pxCond)
+lv_result_t lv_thread_sync_init(lv_thread_sync_t * pxCond)
{
#if USE_FREERTOS_TASK_NOTIFY
/* Store the handle of the calling task. */
@@ -168,12 +168,12 @@ lv_res_t lv_thread_sync_init(lv_thread_sync_t * pxCond)
prvCondInit(pxCond);
#endif
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_wait(lv_thread_sync_t * pxCond)
+lv_result_t lv_thread_sync_wait(lv_thread_sync_t * pxCond)
{
- lv_res_t lvRes = LV_RES_OK;
+ lv_result_t lvRes = LV_RESULT_OK;
#if USE_FREERTOS_TASK_NOTIFY
LV_UNUSED(pxCond);
@@ -210,7 +210,7 @@ lv_res_t lv_thread_sync_wait(lv_thread_sync_t * pxCond)
if(xCondWaitStatus != pdTRUE) {
LV_LOG_ERROR("xSemaphoreTake(xCondWaitSemaphore) failed!");
- lvRes = LV_RES_INV;
+ lvRes = LV_RESULT_INVALID;
/* Atomically decrements thread waiting by 1.
* If iLocalWaitingThreads is updated by other thread(s) in between,
@@ -221,7 +221,7 @@ lv_res_t lv_thread_sync_wait(lv_thread_sync_t * pxCond)
}
else {
LV_LOG_ERROR("xSemaphoreGive(xSyncMutex) failed!");
- lvRes = LV_RES_INV;
+ lvRes = LV_RESULT_INVALID;
/* Atomically decrements thread waiting by 1.
* If iLocalWaitingThreads is updated by other thread(s) in between,
@@ -240,7 +240,7 @@ lv_res_t lv_thread_sync_wait(lv_thread_sync_t * pxCond)
return lvRes;
}
-lv_res_t lv_thread_sync_signal(lv_thread_sync_t * pxCond)
+lv_result_t lv_thread_sync_signal(lv_thread_sync_t * pxCond)
{
#if USE_FREERTOS_TASK_NOTIFY
/* Send a notification to the task waiting. */
@@ -281,10 +281,10 @@ lv_res_t lv_thread_sync_signal(lv_thread_sync_t * pxCond)
xSemaphoreGive(pxCond->xSyncMutex);
#endif
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_delete(lv_thread_sync_t * pxCond)
+lv_result_t lv_thread_sync_delete(lv_thread_sync_t * pxCond)
{
#if USE_FREERTOS_TASK_NOTIFY
LV_UNUSED(pxCond);
@@ -297,7 +297,7 @@ lv_res_t lv_thread_sync_delete(lv_thread_sync_t * pxCond)
pxCond->xIsInitialized = pdFALSE;
#endif
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/**********************
diff --git a/src/osal/lv_os.h b/src/osal/lv_os.h
index 15d65dbf8d..488686a715 100644
--- a/src/osal/lv_os.h
+++ b/src/osal/lv_os.h
@@ -65,80 +65,80 @@ typedef enum {
* @param callback function of the thread
* @param stack_size stack size in bytes
* @param user_data arbitrary data, will be available in the callback
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
- void * user_data);
+lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
+ void * user_data);
/**
* Delete a thread
* @param thread the thread to delete
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_thread_delete(lv_thread_t * thread);
+lv_result_t lv_thread_delete(lv_thread_t * thread);
/**
* Create a mutex
* @param mutex a variable in which the thread will be stored
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_mutex_init(lv_mutex_t * mutex);
+lv_result_t lv_mutex_init(lv_mutex_t * mutex);
/**
* Lock a mutex
* @param mutex the mutex to lock
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_mutex_lock(lv_mutex_t * mutex);
+lv_result_t lv_mutex_lock(lv_mutex_t * mutex);
/**
* Lock a mutex from interrupt
* @param mutex the mutex to lock
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_mutex_lock_isr(lv_mutex_t * mutex);
+lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex);
/**
* Unlock a mutex
* @param mutex the mutex to unlock
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_mutex_unlock(lv_mutex_t * mutex);
+lv_result_t lv_mutex_unlock(lv_mutex_t * mutex);
/**
* Delete a mutex
* @param mutex the mutex to delete
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_mutex_delete(lv_mutex_t * mutex);
+lv_result_t lv_mutex_delete(lv_mutex_t * mutex);
/**
* Create a thread synchronization object
* @param sync a variable in which the sync will be stored
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_thread_sync_init(lv_thread_sync_t * sync);
+lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync);
/**
* Wait for a "signal" on a sync object
* @param sync a sync object
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_thread_sync_wait(lv_thread_sync_t * sync);
+lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync);
/**
* Send a wake-up signal to a sync object
* @param sync a sync object
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_thread_sync_signal(lv_thread_sync_t * sync);
+lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync);
/**
* Delete a sync object
* @param sync a sync object to delete
- * @return LV_RES_OK: success; LV_RES_INV: failure
+ * @return LV_RESULT_OK: success; LV_RESULT_INVALID: failure
*/
-lv_res_t lv_thread_sync_delete(lv_thread_sync_t * sync);
+lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync);
/**********************
* MACROS
diff --git a/src/osal/lv_os_none.c b/src/osal/lv_os_none.c
index 75c9f1fea9..b66f3d9c54 100644
--- a/src/osal/lv_os_none.c
+++ b/src/osal/lv_os_none.c
@@ -37,8 +37,8 @@
**********************/
-lv_res_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
- void * user_data)
+lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
+ void * user_data)
{
LV_UNUSED(thread);
LV_UNUSED(callback);
@@ -46,73 +46,73 @@ lv_res_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*call
LV_UNUSED(stack_size);
LV_UNUSED(user_data);
LV_ASSERT(0);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
-lv_res_t lv_thread_delete(lv_thread_t * thread)
+lv_result_t lv_thread_delete(lv_thread_t * thread)
{
LV_UNUSED(thread);
LV_ASSERT(0);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
-lv_res_t lv_mutex_init(lv_mutex_t * mutex)
+lv_result_t lv_mutex_init(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_lock(lv_mutex_t * mutex)
+lv_result_t lv_mutex_lock(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_lock_isr(lv_mutex_t * mutex)
+lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_unlock(lv_mutex_t * mutex)
+lv_result_t lv_mutex_unlock(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_delete(lv_mutex_t * mutex)
+lv_result_t lv_mutex_delete(lv_mutex_t * mutex)
{
LV_UNUSED(mutex);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_init(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync)
{
LV_UNUSED(sync);
LV_ASSERT(0);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
-lv_res_t lv_thread_sync_wait(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync)
{
LV_UNUSED(sync);
LV_ASSERT(0);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
-lv_res_t lv_thread_sync_signal(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync)
{
LV_UNUSED(sync);
LV_ASSERT(0);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
-lv_res_t lv_thread_sync_delete(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync)
{
LV_UNUSED(sync);
LV_ASSERT(0);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
/**********************
diff --git a/src/osal/lv_pthread.c b/src/osal/lv_pthread.c
index d7928baa90..df89259df0 100644
--- a/src/osal/lv_pthread.c
+++ b/src/osal/lv_pthread.c
@@ -38,87 +38,87 @@ static void * generic_callback(void * user_data);
* GLOBAL FUNCTIONS
**********************/
-lv_res_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
- void * user_data)
+lv_result_t lv_thread_init(lv_thread_t * thread, lv_thread_prio_t prio, void (*callback)(void *), size_t stack_size,
+ void * user_data)
{
LV_UNUSED(prio);
LV_UNUSED(stack_size);
thread->callback = callback;
thread->user_data = user_data;
pthread_create(&thread->thread, NULL, generic_callback, thread);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_delete(lv_thread_t * thread)
+lv_result_t lv_thread_delete(lv_thread_t * thread)
{
LV_UNUSED(thread);
/*How?*/
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_mutex_init(lv_mutex_t * mutex)
+lv_result_t lv_mutex_init(lv_mutex_t * mutex)
{
int ret = pthread_mutex_init(mutex, NULL);
if(ret) {
LV_LOG_WARN("Error: %d", ret);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
else {
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
-lv_res_t lv_mutex_lock(lv_mutex_t * mutex)
+lv_result_t lv_mutex_lock(lv_mutex_t * mutex)
{
int ret = pthread_mutex_lock(mutex);
if(ret) {
LV_LOG_WARN("Error: %d", ret);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
else {
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
-lv_res_t lv_mutex_lock_isr(lv_mutex_t * mutex)
+lv_result_t lv_mutex_lock_isr(lv_mutex_t * mutex)
{
int ret = pthread_mutex_lock(mutex);
if(ret) {
LV_LOG_WARN("Error: %d", ret);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
else {
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
-lv_res_t lv_mutex_unlock(lv_mutex_t * mutex)
+lv_result_t lv_mutex_unlock(lv_mutex_t * mutex)
{
int ret = pthread_mutex_unlock(mutex);
if(ret) {
LV_LOG_WARN("Error: %d", ret);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
else {
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
}
-lv_res_t lv_mutex_delete(lv_mutex_t * mutex)
+lv_result_t lv_mutex_delete(lv_mutex_t * mutex)
{
pthread_mutex_destroy(mutex);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_init(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_init(lv_thread_sync_t * sync)
{
pthread_mutex_init(&sync->mutex, 0);
pthread_cond_init(&sync->cond, 0);
sync->v = false;
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_wait(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_wait(lv_thread_sync_t * sync)
{
pthread_mutex_lock(&sync->mutex);
while(!sync->v) {
@@ -126,24 +126,24 @@ lv_res_t lv_thread_sync_wait(lv_thread_sync_t * sync)
}
sync->v = false;
pthread_mutex_unlock(&sync->mutex);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_signal(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_signal(lv_thread_sync_t * sync)
{
pthread_mutex_lock(&sync->mutex);
sync->v = true;
pthread_cond_signal(&sync->cond);
pthread_mutex_unlock(&sync->mutex);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
-lv_res_t lv_thread_sync_delete(lv_thread_sync_t * sync)
+lv_result_t lv_thread_sync_delete(lv_thread_sync_t * sync)
{
pthread_mutex_destroy(&sync->mutex);
pthread_cond_destroy(&sync->cond);
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/**********************
diff --git a/src/others/imgfont/lv_imgfont.c b/src/others/imgfont/lv_imgfont.c
index a8761293e4..f669db34d6 100644
--- a/src/others/imgfont/lv_imgfont.c
+++ b/src/others/imgfont/lv_imgfont.c
@@ -121,7 +121,7 @@ static bool imgfont_get_glyph_dsc(const lv_font_t * font, lv_font_glyph_dsc_t *
#else
lv_image_header_t header;
- if(lv_image_decoder_get_info(img_src, &header) != LV_RES_OK) {
+ if(lv_image_decoder_get_info(img_src, &header) != LV_RESULT_OK) {
return false;
}
diff --git a/src/others/snapshot/lv_snapshot.c b/src/others/snapshot/lv_snapshot.c
index 854dfd8b2b..83f74a8b51 100644
--- a/src/others/snapshot/lv_snapshot.c
+++ b/src/others/snapshot/lv_snapshot.c
@@ -10,9 +10,9 @@
#if LV_USE_SNAPSHOT
#include
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../../core/lv_refr.h"
-#include "../../disp/lv_disp_private.h"
+#include "../../display/lv_display_private.h"
#include "../../stdlib/lv_string.h"
/*********************
@@ -80,10 +80,10 @@ uint32_t lv_snapshot_buf_size_needed(lv_obj_t * obj, lv_color_format_t cf)
* @param buf the buffer to store image data.
* @param buff_size provided buffer size in bytes.
*
- * @return LV_RES_OK on success, LV_RES_INV on error.
+ * @return LV_RESULT_OK on success, LV_RESULT_INVALID on error.
*/
-lv_res_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_color_format_t cf, lv_image_dsc_t * dsc, void * buf,
- uint32_t buff_size)
+lv_result_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_color_format_t cf, lv_image_dsc_t * dsc, void * buf,
+ uint32_t buff_size)
{
LV_ASSERT_NULL(obj);
LV_ASSERT_NULL(dsc);
@@ -97,10 +97,10 @@ lv_res_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_color_format_t cf, lv_image_
break;
default:
LV_LOG_WARN("Not supported color format");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
- if(lv_snapshot_buf_size_needed(obj, cf) > buff_size || buff_size == 0) return LV_RES_INV;
+ if(lv_snapshot_buf_size_needed(obj, cf) > buff_size || buff_size == 0) return LV_RESULT_INVALID;
/*Width and height determine snapshot image size.*/
lv_coord_t w = lv_obj_get_width(obj);
@@ -139,7 +139,7 @@ lv_res_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_color_format_t cf, lv_image_
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/** Take snapshot for object with its children, alloc the memory needed.
@@ -168,7 +168,7 @@ lv_image_dsc_t * lv_snapshot_take(lv_obj_t * obj, lv_color_format_t cf)
return NULL;
}
- if(lv_snapshot_take_to_buf(obj, cf, dsc, buf, buff_size) == LV_RES_INV) {
+ if(lv_snapshot_take_to_buf(obj, cf, dsc, buf, buff_size) == LV_RESULT_INVALID) {
lv_free(buf);
lv_free(dsc);
return NULL;
diff --git a/src/others/snapshot/lv_snapshot.h b/src/others/snapshot/lv_snapshot.h
index 2dd26eae3b..f383f378ae 100644
--- a/src/others/snapshot/lv_snapshot.h
+++ b/src/others/snapshot/lv_snapshot.h
@@ -66,10 +66,10 @@ uint32_t lv_snapshot_buf_size_needed(lv_obj_t * obj, lv_color_format_t cf);
* @param buf the buffer to store image data.
* @param buff_size provided buffer size in bytes.
*
- * @return LV_RES_OK on success, LV_RES_INV on error.
+ * @return LV_RESULT_OK on success, LV_RESULT_INVALID on error.
*/
-lv_res_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_color_format_t cf, lv_image_dsc_t * dsc, void * buf,
- uint32_t buff_size);
+lv_result_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_color_format_t cf, lv_image_dsc_t * dsc, void * buf,
+ uint32_t buff_size);
/**********************
diff --git a/src/others/sysmon/lv_sysmon.c b/src/others/sysmon/lv_sysmon.c
index d8ce0bb08b..c04741c759 100644
--- a/src/others/sysmon/lv_sysmon.c
+++ b/src/others/sysmon/lv_sysmon.c
@@ -215,7 +215,7 @@ static void perf_monitor_event_cb(lv_event_t * e)
static void perf_monitor_init(void)
{
- lv_disp_t * disp = lv_disp_get_default();
+ lv_display_t * disp = lv_display_get_default();
lv_obj_t * sysmon = lv_sysmon_create(lv_layer_sys());
lv_obj_align(sysmon, LV_USE_PERF_MONITOR_POS, 0, 0);
@@ -226,7 +226,7 @@ static void perf_monitor_init(void)
lv_obj_set_user_data(sysmon, info);
lv_obj_add_event(sysmon, perf_monitor_event_cb, LV_EVENT_REFRESH, NULL);
- lv_disp_add_event(disp, perf_monitor_disp_event_cb, LV_EVENT_ALL, sysmon);
+ lv_display_add_event(disp, perf_monitor_disp_event_cb, LV_EVENT_ALL, sysmon);
#if LV_USE_PERF_MONITOR_LOG_MODE
/*Reduce rendering performance consumption*/
diff --git a/src/stdlib/builtin/lv_mem_core_builtin.c b/src/stdlib/builtin/lv_mem_core_builtin.c
index 5dc7c102b4..cc7e09d3a7 100644
--- a/src/stdlib/builtin/lv_mem_core_builtin.c
+++ b/src/stdlib/builtin/lv_mem_core_builtin.c
@@ -209,7 +209,7 @@ void lv_mem_monitor_core(lv_mem_monitor_t * mon_p)
}
-lv_res_t lv_mem_test_core(void)
+lv_result_t lv_mem_test_core(void)
{
#if LV_USE_OS
lv_mutex_lock(&state.mutex);
@@ -219,7 +219,7 @@ lv_res_t lv_mem_test_core(void)
#if LV_USE_OS
lv_mutex_unlock(&state.mutex);
#endif
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
lv_pool_t * pool_p;
@@ -229,7 +229,7 @@ lv_res_t lv_mem_test_core(void)
#if LV_USE_OS
lv_mutex_unlock(&state.mutex);
#endif
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
}
@@ -237,7 +237,7 @@ lv_res_t lv_mem_test_core(void)
#if LV_USE_OS
lv_mutex_unlock(&state.mutex);
#endif
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/**********************
diff --git a/src/stdlib/clib/lv_mem_core_clib.c b/src/stdlib/clib/lv_mem_core_clib.c
index 0be2da665d..efd67eb818 100644
--- a/src/stdlib/clib/lv_mem_core_clib.c
+++ b/src/stdlib/clib/lv_mem_core_clib.c
@@ -83,10 +83,10 @@ void lv_mem_monitor_core(lv_mem_monitor_t * mon_p)
}
-lv_res_t lv_mem_test_core(void)
+lv_result_t lv_mem_test_core(void)
{
/*Not supported*/
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/**********************
diff --git a/src/stdlib/lv_mem.c b/src/stdlib/lv_mem.c
index 3e1927cc97..c2c49a4a5b 100644
--- a/src/stdlib/lv_mem.c
+++ b/src/stdlib/lv_mem.c
@@ -40,7 +40,7 @@ void * lv_malloc_core(size_t size);
void * lv_realloc_core(void * p, size_t new_size);
void lv_free_core(void * p);
void lv_mem_monitor_core(lv_mem_monitor_t * mon_p);
-lv_res_t lv_mem_test_core(void);
+lv_result_t lv_mem_test_core(void);
/**********************
@@ -139,11 +139,11 @@ void * lv_realloc(void * data_p, size_t new_size)
return new_p;
}
-lv_res_t lv_mem_test(void)
+lv_result_t lv_mem_test(void)
{
if(zero_mem != ZERO_MEM_SENTINEL) {
LV_LOG_WARN("zero_mem is written");
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
return lv_mem_test_core();
diff --git a/src/stdlib/lv_mem.h b/src/stdlib/lv_mem.h
index 196fca6df4..e15ab7c566 100644
--- a/src/stdlib/lv_mem.h
+++ b/src/stdlib/lv_mem.h
@@ -114,13 +114,13 @@ void * lv_realloc_core(void * p, size_t new_size);
void lv_mem_monitor_core(lv_mem_monitor_t * mon_p);
-lv_res_t lv_mem_test_core(void);
+lv_result_t lv_mem_test_core(void);
/**
* @brief Tests the memory allocation system by allocating and freeing a block of memory.
- * @return LV_RES_OK if the memory allocation system is working properly, or LV_RES_INV if there is an error.
+ * @return LV_RESULT_OK if the memory allocation system is working properly, or LV_RESULT_INVALID if there is an error.
*/
-lv_res_t lv_mem_test(void);
+lv_result_t lv_mem_test(void);
/**
* Give information about the work memory of dynamic allocation
diff --git a/src/stdlib/micropython/lv_mem_core_micropython.c b/src/stdlib/micropython/lv_mem_core_micropython.c
index e5816924e2..f2add336c3 100644
--- a/src/stdlib/micropython/lv_mem_core_micropython.c
+++ b/src/stdlib/micropython/lv_mem_core_micropython.c
@@ -83,10 +83,10 @@ void lv_mem_monitor_core(lv_mem_monitor_t * mon_p)
}
-lv_res_t lv_mem_test_core(void)
+lv_result_t lv_mem_test_core(void)
{
/*Not supported*/
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/**********************
diff --git a/src/themes/basic/lv_theme_basic.c b/src/themes/basic/lv_theme_basic.c
index 41e98e3fcd..f183c11ebc 100644
--- a/src/themes/basic/lv_theme_basic.c
+++ b/src/themes/basic/lv_theme_basic.c
@@ -155,7 +155,7 @@ void lv_theme_basic_deinit(void)
}
}
-lv_theme_t * lv_theme_basic_init(lv_disp_t * disp)
+lv_theme_t * lv_theme_basic_init(lv_display_t * disp)
{
/*This trick is required only to avoid the garbage collection of
*styles' data if LVGL is used in a binding (e.g. Micropython)
@@ -175,7 +175,7 @@ lv_theme_t * lv_theme_basic_init(lv_disp_t * disp)
style_init(theme);
- if(disp == NULL || lv_disp_get_theme(disp) == (lv_theme_t *)theme) {
+ if(disp == NULL || lv_display_get_theme(disp) == (lv_theme_t *)theme) {
lv_obj_report_style_change(NULL);
}
diff --git a/src/themes/basic/lv_theme_basic.h b/src/themes/basic/lv_theme_basic.h
index 01b095a48e..959bd4c770 100644
--- a/src/themes/basic/lv_theme_basic.h
+++ b/src/themes/basic/lv_theme_basic.h
@@ -14,7 +14,7 @@ extern "C" {
* INCLUDES
*********************/
#include "../lv_theme.h"
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#if LV_USE_THEME_BASIC
@@ -35,7 +35,7 @@ extern "C" {
* @param disp pointer to display to attach the theme
* @return a pointer to reference this theme later
*/
-lv_theme_t * lv_theme_basic_init(lv_disp_t * disp);
+lv_theme_t * lv_theme_basic_init(lv_display_t * disp);
/**
* Check if the theme is initialized
diff --git a/src/themes/default/lv_theme_default.c b/src/themes/default/lv_theme_default.c
index b75df42517..8a4eecfa7d 100644
--- a/src/themes/default/lv_theme_default.c
+++ b/src/themes/default/lv_theme_default.c
@@ -219,7 +219,7 @@ static void style_init(struct _my_theme_t * theme)
LV_STYLE_BG_OPA, LV_STYLE_BG_COLOR,
LV_STYLE_TRANSFORM_WIDTH, LV_STYLE_TRANSFORM_HEIGHT,
LV_STYLE_TRANSLATE_Y, LV_STYLE_TRANSLATE_X,
- LV_STYLE_TRANSFORM_ZOOM, LV_STYLE_TRANSFORM_ANGLE,
+ LV_STYLE_TRANSFORM_SCALE, LV_STYLE_TRANSFORM_ROTATION,
LV_STYLE_COLOR_FILTER_OPA, LV_STYLE_COLOR_FILTER_DSC,
0
};
@@ -664,7 +664,7 @@ static void style_init(struct _my_theme_t * theme)
* GLOBAL FUNCTIONS
**********************/
-lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark,
+lv_theme_t * lv_theme_default_init(lv_display_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark,
const lv_font_t * font)
{
/*This trick is required only to avoid the garbage collection of
@@ -678,9 +678,9 @@ lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, l
struct _my_theme_t * theme = theme_def;
- lv_disp_t * new_disp = disp == NULL ? lv_disp_get_default() : disp;
- lv_coord_t new_dpi = lv_disp_get_dpi(new_disp);
- lv_coord_t hor_res = lv_disp_get_hor_res(new_disp);
+ lv_display_t * new_disp = disp == NULL ? lv_display_get_default() : disp;
+ lv_coord_t new_dpi = lv_display_get_dpi(new_disp);
+ lv_coord_t hor_res = lv_display_get_horizontal_resolution(new_disp);
disp_size_t new_size;
if(hor_res <= 320) new_size = DISP_SMALL;
@@ -711,7 +711,7 @@ lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, l
style_init(theme);
- if(disp == NULL || lv_disp_get_theme(disp) == (lv_theme_t *)theme) lv_obj_report_style_change(NULL);
+ if(disp == NULL || lv_display_get_theme(disp) == (lv_theme_t *)theme) lv_obj_report_style_change(NULL);
theme->inited = true;
diff --git a/src/themes/default/lv_theme_default.h b/src/themes/default/lv_theme_default.h
index afec672ae2..72d9acbfa1 100644
--- a/src/themes/default/lv_theme_default.h
+++ b/src/themes/default/lv_theme_default.h
@@ -38,7 +38,7 @@ extern "C" {
* @param font pointer to a font to use.
* @return a pointer to reference this theme later
*/
-lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark,
+lv_theme_t * lv_theme_default_init(lv_display_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark,
const lv_font_t * font);
/**
diff --git a/src/themes/lv_theme.c b/src/themes/lv_theme.c
index 6007d42f11..b856a9a12f 100644
--- a/src/themes/lv_theme.c
+++ b/src/themes/lv_theme.c
@@ -36,8 +36,8 @@ static void apply_theme_recursion(lv_theme_t * th, lv_obj_t * obj);
lv_theme_t * lv_theme_get_from_obj(lv_obj_t * obj)
{
- lv_disp_t * disp = obj ? lv_obj_get_disp(obj) : lv_disp_get_default();
- return lv_disp_get_theme(disp);
+ lv_display_t * disp = obj ? lv_obj_get_disp(obj) : lv_display_get_default();
+ return lv_display_get_theme(disp);
}
/**
diff --git a/src/themes/lv_theme.h b/src/themes/lv_theme.h
index 969b35f8ae..076240b6b8 100644
--- a/src/themes/lv_theme.h
+++ b/src/themes/lv_theme.h
@@ -24,7 +24,7 @@ extern "C" {
**********************/
struct _lv_theme_t;
-struct _lv_disp_t;
+struct _lv_display_t;
typedef void (*lv_theme_apply_cb_t)(struct _lv_theme_t *, lv_obj_t *);
@@ -32,7 +32,7 @@ typedef struct _lv_theme_t {
lv_theme_apply_cb_t apply_cb;
struct _lv_theme_t * parent; /**< Apply the current theme's style on top of this theme.*/
void * user_data;
- struct _lv_disp_t * disp;
+ struct _lv_display_t * disp;
lv_color_t color_primary;
lv_color_t color_secondary;
const lv_font_t * font_small;
diff --git a/src/themes/mono/lv_theme_mono.c b/src/themes/mono/lv_theme_mono.c
index 0c84053515..59c0c6a78f 100644
--- a/src/themes/mono/lv_theme_mono.c
+++ b/src/themes/mono/lv_theme_mono.c
@@ -167,7 +167,7 @@ static void style_init(struct _my_theme_t * theme, bool dark_bg, const lv_font_t
#if LV_USE_CHART
style_init_reset(&theme->styles.chart_indic);
lv_style_set_radius(&theme->styles.chart_indic, LV_RADIUS_CIRCLE);
- lv_style_set_size(&theme->styles.chart_indic, lv_disp_dpx(theme->base.disp, 8), lv_disp_dpx(theme->base.disp, 8));
+ lv_style_set_size(&theme->styles.chart_indic, lv_display_dpx(theme->base.disp, 8), lv_display_dpx(theme->base.disp, 8));
lv_style_set_bg_color(&theme->styles.chart_indic, COLOR_FG);
lv_style_set_bg_opa(&theme->styles.chart_indic, LV_OPA_COVER);
#endif
@@ -192,7 +192,7 @@ void lv_theme_mono_deinit(void)
}
}
-lv_theme_t * lv_theme_mono_init(lv_disp_t * disp, bool dark_bg, const lv_font_t * font)
+lv_theme_t * lv_theme_mono_init(lv_display_t * disp, bool dark_bg, const lv_font_t * font)
{
/*This trick is required only to avoid the garbage collection of
*styles' data if LVGL is used in a binding (e.g. Micropython)
@@ -212,7 +212,7 @@ lv_theme_t * lv_theme_mono_init(lv_disp_t * disp, bool dark_bg, const lv_font_t
style_init(theme, dark_bg, font);
- if(disp == NULL || lv_disp_get_theme(disp) == (lv_theme_t *) theme) lv_obj_report_style_change(NULL);
+ if(disp == NULL || lv_display_get_theme(disp) == (lv_theme_t *) theme) lv_obj_report_style_change(NULL);
theme->inited = true;
diff --git a/src/themes/mono/lv_theme_mono.h b/src/themes/mono/lv_theme_mono.h
index 642d1ee77a..fafe27f245 100644
--- a/src/themes/mono/lv_theme_mono.h
+++ b/src/themes/mono/lv_theme_mono.h
@@ -36,7 +36,7 @@ extern "C" {
* @param font pointer to a font to use.
* @return a pointer to reference this theme later
*/
-lv_theme_t * lv_theme_mono_init(lv_disp_t * disp, bool dark_bg, const lv_font_t * font);
+lv_theme_t * lv_theme_mono_init(lv_display_t * disp, bool dark_bg, const lv_font_t * font);
/**
* Check if the theme is initialized
diff --git a/src/widgets/animimage/lv_animimage.c b/src/widgets/animimage/lv_animimage.c
index 31665705e4..39a0da491e 100644
--- a/src/widgets/animimage/lv_animimage.c
+++ b/src/widgets/animimage/lv_animimage.c
@@ -17,7 +17,7 @@
#include "../../draw/lv_image_decoder.h"
#include "../../misc/lv_assert.h"
#include "../../misc/lv_fs.h"
-#include "../../misc/lv_txt.h"
+#include "../../misc/lv_text.h"
#include "../../misc/lv_math.h"
#include "../../misc/lv_log.h"
#include "../../misc/lv_anim.h"
diff --git a/src/widgets/arc/lv_arc.c b/src/widgets/arc/lv_arc.c
index 2d0f680642..6156328e33 100644
--- a/src/widgets/arc/lv_arc.c
+++ b/src/widgets/arc/lv_arc.c
@@ -389,7 +389,7 @@ void lv_arc_rotate_obj_to_angle(const lv_obj_t * obj, lv_obj_t * obj_to_rotate,
lv_coord_t pivot_y = obj_to_rotate->coords.y1 - center.y;
lv_obj_set_style_transform_pivot_x(obj_to_rotate, -pivot_x, 0);
lv_obj_set_style_transform_pivot_y(obj_to_rotate, -pivot_y, 0);
- lv_obj_set_style_transform_angle(obj_to_rotate, angle * 10 + 900, 0);
+ lv_obj_set_style_transform_rotation(obj_to_rotate, angle * 10 + 900, 0);
}
@@ -432,11 +432,11 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -551,7 +551,7 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e)
lv_arc_set_value(obj, new_value); /*set_value caches the last_angle for the next iteration*/
if(new_value != old_value) {
res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
}
@@ -585,7 +585,7 @@ static void lv_arc_event(const lv_obj_class_t * class_p, lv_event_t * e)
if(old_value != arc->value) {
res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
}
else if(code == LV_EVENT_HIT_TEST) {
diff --git a/src/widgets/bar/lv_bar.c b/src/widgets/bar/lv_bar.c
index 304e51b88c..36c3532957 100644
--- a/src/widgets/bar/lv_bar.c
+++ b/src/widgets/bar/lv_bar.c
@@ -503,11 +503,11 @@ static void lv_bar_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
diff --git a/src/widgets/buttonmatrix/lv_buttonmatrix.c b/src/widgets/buttonmatrix/lv_buttonmatrix.c
index f83768a53d..4b23751ee7 100644
--- a/src/widgets/buttonmatrix/lv_buttonmatrix.c
+++ b/src/widgets/buttonmatrix/lv_buttonmatrix.c
@@ -14,8 +14,8 @@
#include "../../core/lv_group.h"
#include "../../draw/lv_draw.h"
#include "../../core/lv_refr.h"
-#include "../../misc/lv_txt.h"
-#include "../../misc/lv_txt_ap.h"
+#include "../../misc/lv_text.h"
+#include "../../misc/lv_text_ap.h"
#include "../../stdlib/lv_string.h"
/*********************
@@ -392,11 +392,11 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -444,7 +444,7 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e
button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) == false) {
uint32_t b = btnm->btn_id_sel;
res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &b);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
}
}
@@ -481,7 +481,7 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e
button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) == false) {
uint32_t b = btnm->btn_id_sel;
res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &b);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
}
@@ -496,7 +496,7 @@ static void lv_buttonmatrix_event(const lv_obj_class_t * class_p, lv_event_t * e
button_is_hidden(btnm->ctrl_bits[btnm->btn_id_sel]) == false) {
uint32_t b = btnm->btn_id_sel;
res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &b);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
}
}
@@ -777,15 +777,15 @@ static void draw_main(lv_event_t * e)
#if LV_USE_ARABIC_PERSIAN_CHARS
/*Get the size of the Arabic text and process it*/
- size_t len_ap = _lv_txt_ap_calc_bytes_cnt(txt);
+ size_t len_ap = _lv_text_ap_calc_bytes_cnt(txt);
if(len_ap < sizeof(txt_ap)) {
- _lv_txt_ap_proc(txt, txt_ap);
+ _lv_text_ap_proc(txt, txt_ap);
txt = txt_ap;
}
#endif
lv_point_t txt_size;
- lv_txt_get_size(&txt_size, txt, font, letter_space,
- line_space, lv_area_get_width(&area_obj), draw_label_dsc_act.flag);
+ lv_text_get_size(&txt_size, txt, font, letter_space,
+ line_space, lv_area_get_width(&area_obj), draw_label_dsc_act.flag);
btn_area.x1 += (lv_area_get_width(&btn_area) - txt_size.x) / 2;
btn_area.y1 += (lv_area_get_height(&btn_area) - txt_size.y) / 2;
@@ -985,7 +985,7 @@ static void invalidate_button_area(const lv_obj_t * obj, uint16_t btn_idx)
lv_coord_t col_gap = lv_obj_get_style_pad_column(obj, LV_PART_MAIN);
/*Be sure to have a minimal extra space if row/col_gap is small*/
- lv_coord_t dpi = lv_disp_get_dpi(lv_obj_get_disp(obj));
+ lv_coord_t dpi = lv_display_get_dpi(lv_obj_get_disp(obj));
row_gap = LV_MAX(row_gap, dpi / 10);
col_gap = LV_MAX(col_gap, dpi / 10);
diff --git a/src/widgets/calendar/lv_calendar.c b/src/widgets/calendar/lv_calendar.c
index f425686c55..9f81b56bc2 100644
--- a/src/widgets/calendar/lv_calendar.c
+++ b/src/widgets/calendar/lv_calendar.c
@@ -208,7 +208,7 @@ uint16_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * obj)
return calendar->highlighted_dates_num;
}
-lv_res_t lv_calendar_get_pressed_date(const lv_obj_t * obj, lv_calendar_date_t * date)
+lv_result_t lv_calendar_get_pressed_date(const lv_obj_t * obj, lv_calendar_date_t * date)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_calendar_t * calendar = (lv_calendar_t *)obj;
@@ -218,7 +218,7 @@ lv_res_t lv_calendar_get_pressed_date(const lv_obj_t * obj, lv_calendar_date_t *
date->year = 0;
date->month = 0;
date->day = 0;
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
const char * txt = lv_buttonmatrix_get_button_text(calendar->btnm, lv_buttonmatrix_get_selected_button(calendar->btnm));
@@ -229,7 +229,7 @@ lv_res_t lv_calendar_get_pressed_date(const lv_obj_t * obj, lv_calendar_date_t *
date->year = calendar->showed_date.year;
date->month = calendar->showed_date.month;
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
diff --git a/src/widgets/calendar/lv_calendar.h b/src/widgets/calendar/lv_calendar.h
index c3e1704047..1a87484bc5 100644
--- a/src/widgets/calendar/lv_calendar.h
+++ b/src/widgets/calendar/lv_calendar.h
@@ -143,9 +143,9 @@ uint16_t lv_calendar_get_highlighted_dates_num(const lv_obj_t * calendar);
* Get the currently pressed day
* @param calendar pointer to a calendar object
* @param date store the pressed date here
- * @return LV_RES_OK: there is a valid pressed date; LV_RES_INV: there is no pressed data
+ * @return LV_RESULT_OK: there is a valid pressed date; LV_RESULT_INVALID: there is no pressed data
*/
-lv_res_t lv_calendar_get_pressed_date(const lv_obj_t * calendar, lv_calendar_date_t * date);
+lv_result_t lv_calendar_get_pressed_date(const lv_obj_t * calendar, lv_calendar_date_t * date);
/*=====================
* Other functions
diff --git a/src/widgets/canvas/lv_canvas.c b/src/widgets/canvas/lv_canvas.c
index 77122c35c9..5602eeda50 100644
--- a/src/widgets/canvas/lv_canvas.c
+++ b/src/widgets/canvas/lv_canvas.c
@@ -12,7 +12,7 @@
#include "../../misc/lv_math.h"
#include "../../draw/lv_draw.h"
#include "../../core/lv_refr.h"
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../../draw/sw/lv_draw_sw.h"
#include "../../stdlib/lv_string.h"
diff --git a/src/widgets/chart/lv_chart.c b/src/widgets/chart/lv_chart.c
index 7dd0c33b8b..0bb85aabcf 100644
--- a/src/widgets/chart/lv_chart.c
+++ b/src/widgets/chart/lv_chart.c
@@ -188,7 +188,7 @@ void lv_chart_set_zoom_x(lv_obj_t * obj, uint16_t zoom_x)
lv_chart_t * chart = (lv_chart_t *)obj;
if(chart->zoom_x == zoom_x) return;
- if(LV_ZOOM_NONE > zoom_x) zoom_x = LV_ZOOM_NONE;
+ if(LV_SCALE_NONE > zoom_x) zoom_x = LV_SCALE_NONE;
chart->zoom_x = zoom_x;
lv_obj_refresh_self_size(obj);
@@ -203,7 +203,7 @@ void lv_chart_set_zoom_y(lv_obj_t * obj, uint16_t zoom_y)
lv_chart_t * chart = (lv_chart_t *)obj;
if(chart->zoom_y == zoom_y) return;
- if(LV_ZOOM_NONE > zoom_y) zoom_y = LV_ZOOM_NONE;
+ if(LV_SCALE_NONE > zoom_y) zoom_y = LV_SCALE_NONE;
chart->zoom_y = zoom_y;
lv_obj_refresh_self_size(obj);
@@ -683,8 +683,8 @@ static void lv_chart_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj)
chart->pressed_point_id = LV_CHART_POINT_NONE;
chart->type = LV_CHART_TYPE_LINE;
chart->update_mode = LV_CHART_UPDATE_MODE_SHIFT;
- chart->zoom_x = LV_ZOOM_NONE;
- chart->zoom_y = LV_ZOOM_NONE;
+ chart->zoom_x = LV_SCALE_NONE;
+ chart->zoom_y = LV_SCALE_NONE;
LV_TRACE_OBJ_CREATE("finished");
}
@@ -724,10 +724,10 @@ static void lv_chart_event(const lv_obj_class_t * class_p, lv_event_t * e)
LV_UNUSED(class_p);
/*Call the ancestor's event handler*/
- lv_res_t res;
+ lv_result_t res;
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -1369,8 +1369,8 @@ static void draw_y_ticks(lv_obj_t * obj, lv_layer_t * layer, lv_chart_axis_t axi
/*reserve appropriate area*/
lv_point_t size;
- lv_txt_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
- LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
+ LV_TEXT_FLAG_NONE);
/*set the area at some distance of the major tick len left of the tick*/
lv_area_t a;
@@ -1489,8 +1489,8 @@ static void draw_x_ticks(lv_obj_t * obj, lv_layer_t * layer, lv_chart_axis_t axi
label_dsc.text_local = true;
/*reserve appropriate area*/
lv_point_t size;
- lv_txt_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
- LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
+ LV_TEXT_FLAG_NONE);
/*set the area at some distance of the major tick len under of the tick*/
lv_area_t a;
diff --git a/src/widgets/chart/lv_chart.h b/src/widgets/chart/lv_chart.h
index d62184b95e..4062cd6079 100644
--- a/src/widgets/chart/lv_chart.h
+++ b/src/widgets/chart/lv_chart.h
@@ -189,14 +189,14 @@ void lv_chart_set_div_line_count(lv_obj_t * obj, uint8_t hdiv, uint8_t vdiv);
/**
* Zoom into the chart in X direction
* @param obj pointer to a chart object
- * @param zoom_x zoom in x direction. LV_ZOOM_NONE or 256 for no zoom, 512 double zoom
+ * @param zoom_x zoom in x direction. LV_SCALE_NONE or 256 for no zoom, 512 double zoom
*/
void lv_chart_set_zoom_x(lv_obj_t * obj, uint16_t zoom_x);
/**
* Zoom into the chart in Y direction
* @param obj pointer to a chart object
- * @param zoom_y zoom in y direction. LV_ZOOM_NONE or 256 for no zoom, 512 double zoom
+ * @param zoom_y zoom in y direction. LV_SCALE_NONE or 256 for no zoom, 512 double zoom
*/
void lv_chart_set_zoom_y(lv_obj_t * obj, uint16_t zoom_y);
diff --git a/src/widgets/checkbox/lv_checkbox.c b/src/widgets/checkbox/lv_checkbox.c
index e5eed9b8de..c75c696480 100644
--- a/src/widgets/checkbox/lv_checkbox.c
+++ b/src/widgets/checkbox/lv_checkbox.c
@@ -10,7 +10,7 @@
#if LV_USE_CHECKBOX != 0
#include "../../misc/lv_assert.h"
-#include "../../misc/lv_txt_ap.h"
+#include "../../misc/lv_text_ap.h"
#include "../../core/lv_group.h"
#include "../../draw/lv_draw.h"
#include "../../stdlib/lv_string.h"
@@ -74,7 +74,7 @@ void lv_checkbox_set_text(lv_obj_t * obj, const char * txt)
size_t len;
#if LV_USE_ARABIC_PERSIAN_CHARS
- len = _lv_txt_ap_calc_bytes_cnt(txt) + 1;
+ len = _lv_text_ap_calc_bytes_cnt(txt) + 1;
#else
len = lv_strlen(txt) + 1;
#endif
@@ -86,7 +86,7 @@ void lv_checkbox_set_text(lv_obj_t * obj, const char * txt)
if(NULL == cb->txt) return;
#if LV_USE_ARABIC_PERSIAN_CHARS
- _lv_txt_ap_proc(txt, cb->txt);
+ _lv_text_ap_proc(txt, cb->txt);
#else
lv_strcpy(cb->txt, txt);
#endif
@@ -165,10 +165,10 @@ static void lv_checkbox_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -183,7 +183,7 @@ static void lv_checkbox_event(const lv_obj_class_t * class_p, lv_event_t * e)
lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN);
lv_point_t txt_size;
- lv_txt_get_size(&txt_size, cb->txt, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&txt_size, cb->txt, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
lv_coord_t bg_colp = lv_obj_get_style_pad_column(obj, LV_PART_MAIN);
lv_coord_t marker_leftp = lv_obj_get_style_pad_left(obj, LV_PART_INDICATOR);
@@ -248,7 +248,7 @@ static void lv_checkbox_draw(lv_event_t * e)
lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN);
lv_point_t txt_size;
- lv_txt_get_size(&txt_size, cb->txt, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&txt_size, cb->txt, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
lv_draw_label_dsc_t txt_dsc;
lv_draw_label_dsc_init(&txt_dsc);
diff --git a/src/widgets/dropdown/lv_dropdown.c b/src/widgets/dropdown/lv_dropdown.c
index a3c8892384..b24d612902 100644
--- a/src/widgets/dropdown/lv_dropdown.c
+++ b/src/widgets/dropdown/lv_dropdown.c
@@ -14,11 +14,11 @@
#include "../../draw/lv_draw.h"
#include "../../core/lv_group.h"
#include "../../indev/lv_indev.h"
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../../font/lv_symbol_def.h"
#include "../../misc/lv_anim.h"
#include "../../misc/lv_math.h"
-#include "../../misc/lv_txt_ap.h"
+#include "../../misc/lv_text_ap.h"
#include "../../stdlib/lv_string.h"
#include
@@ -50,8 +50,8 @@ static void draw_list(lv_event_t * e);
static void draw_box(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint16_t id, lv_state_t state);
static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint16_t id, lv_state_t state);
-static lv_res_t btn_release_handler(lv_obj_t * obj);
-static lv_res_t list_release_handler(lv_obj_t * list_obj);
+static lv_result_t btn_release_handler(lv_obj_t * obj);
+static lv_result_t list_release_handler(lv_obj_t * list_obj);
static void list_press_handler(lv_obj_t * page);
static uint16_t get_id_on_point(lv_obj_t * dropdown_obj, lv_coord_t y);
static void position_to_selected(lv_obj_t * obj);
@@ -133,7 +133,7 @@ void lv_dropdown_set_options(lv_obj_t * obj, const char * options)
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
size_t len = lv_strlen(options) + 1;
#else
- size_t len = _lv_txt_ap_calc_bytes_cnt(options) + 1;
+ size_t len = _lv_text_ap_calc_bytes_cnt(options) + 1;
#endif
if(dropdown->options != NULL && dropdown->static_txt == 0) {
@@ -149,7 +149,7 @@ void lv_dropdown_set_options(lv_obj_t * obj, const char * options)
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
lv_strcpy(dropdown->options, options);
#else
- _lv_txt_ap_proc(options, dropdown->options);
+ _lv_text_ap_proc(options, dropdown->options);
#endif
/*Now the text is dynamically allocated*/
@@ -209,7 +209,7 @@ void lv_dropdown_add_option(lv_obj_t * obj, const char * option, uint32_t pos)
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
size_t ins_len = lv_strlen(option) + 1;
#else
- size_t ins_len = _lv_txt_ap_calc_bytes_cnt(option) + 1;
+ size_t ins_len = _lv_text_ap_calc_bytes_cnt(option) + 1;
#endif
size_t new_len = ins_len + old_len + 2; /*+2 for terminating NULL and possible \n*/
@@ -233,7 +233,7 @@ void lv_dropdown_add_option(lv_obj_t * obj, const char * option, uint32_t pos)
/*Add delimiter to existing options*/
if((insert_pos > 0) && (pos >= dropdown->option_cnt))
- _lv_txt_ins(dropdown->options, _lv_txt_encoded_get_char_id(dropdown->options, insert_pos++), "\n");
+ _lv_text_ins(dropdown->options, _lv_text_encoded_get_char_id(dropdown->options, insert_pos++), "\n");
/*Insert the new option, adding \n if necessary*/
char * ins_buf = lv_malloc(ins_len + 2); /*+ 2 for terminating NULL and possible \n*/
@@ -242,11 +242,11 @@ void lv_dropdown_add_option(lv_obj_t * obj, const char * option, uint32_t pos)
#if LV_USE_ARABIC_PERSIAN_CHARS == 0
lv_strcpy(ins_buf, option);
#else
- _lv_txt_ap_proc(option, ins_buf);
+ _lv_text_ap_proc(option, ins_buf);
#endif
if(pos < dropdown->option_cnt) strcat(ins_buf, "\n");
- _lv_txt_ins(dropdown->options, _lv_txt_encoded_get_char_id(dropdown->options, insert_pos), ins_buf);
+ _lv_text_ins(dropdown->options, _lv_text_encoded_get_char_id(dropdown->options, insert_pos), ins_buf);
lv_free(ins_buf);
dropdown->option_cnt++;
@@ -653,11 +653,11 @@ static void lv_dropdown_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -686,7 +686,7 @@ static void lv_dropdown_event(const lv_obj_class_t * class_p, lv_event_t * e)
}
else if(code == LV_EVENT_RELEASED) {
res = btn_release_handler(obj);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
else if(code == LV_EVENT_STYLE_CHANGED) {
lv_obj_refresh_self_size(obj);
@@ -730,7 +730,7 @@ static void lv_dropdown_event(const lv_obj_class_t * class_p, lv_event_t * e)
lv_obj_t * indev_obj = lv_indev_get_obj_act();
if(indev_obj != obj) {
res = btn_release_handler(obj);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
}
}
@@ -743,13 +743,13 @@ static void lv_dropdown_list_event(const lv_obj_class_t * class_p, lv_event_t *
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
lv_event_code_t code = lv_event_get_code(e);
if(code != LV_EVENT_DRAW_POST) {
res = lv_obj_event_base(MY_CLASS_LIST, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
lv_obj_t * list = lv_event_get_target(e);
lv_obj_t * dropdown_obj = ((lv_dropdown_list_t *)list)->dropdown;
@@ -770,7 +770,7 @@ static void lv_dropdown_list_event(const lv_obj_class_t * class_p, lv_event_t *
else if(code == LV_EVENT_DRAW_POST) {
draw_list(e);
res = lv_obj_event_base(MY_CLASS_LIST, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
}
@@ -809,15 +809,15 @@ static void draw_main(lv_event_t * e)
lv_coord_t symbol_h;
if(symbol_type == LV_IMAGE_SRC_SYMBOL) {
lv_point_t size;
- lv_txt_get_size(&size, dropdown->symbol, symbol_dsc.font, symbol_dsc.letter_space, symbol_dsc.line_space, LV_COORD_MAX,
- symbol_dsc.flag);
+ lv_text_get_size(&size, dropdown->symbol, symbol_dsc.font, symbol_dsc.letter_space, symbol_dsc.line_space, LV_COORD_MAX,
+ symbol_dsc.flag);
symbol_w = size.x;
symbol_h = size.y;
}
else {
lv_image_header_t header;
- lv_res_t res = lv_image_decoder_get_info(dropdown->symbol, &header);
- if(res == LV_RES_OK) {
+ lv_result_t res = lv_image_decoder_get_info(dropdown->symbol, &header);
+ if(res == LV_RESULT_OK) {
symbol_w = header.w;
symbol_h = header.h;
}
@@ -851,7 +851,7 @@ static void draw_main(lv_event_t * e)
lv_obj_init_draw_image_dsc(obj, LV_PART_INDICATOR, &img_dsc);
img_dsc.pivot.x = symbol_w / 2;
img_dsc.pivot.y = symbol_h / 2;
- img_dsc.angle = lv_obj_get_style_transform_angle(obj, LV_PART_INDICATOR);
+ img_dsc.rotation = lv_obj_get_style_transform_rotation(obj, LV_PART_INDICATOR);
img_dsc.src = dropdown->symbol;
lv_draw_image(layer, &img_dsc, &symbol_area);
}
@@ -862,8 +862,8 @@ static void draw_main(lv_event_t * e)
lv_obj_init_draw_label_dsc(obj, LV_PART_MAIN, &label_dsc);
lv_point_t size;
- lv_txt_get_size(&size, opt_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
- label_dsc.flag);
+ lv_text_get_size(&size, opt_txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
+ label_dsc.flag);
lv_area_t txt_area;
txt_area.y1 = obj->coords.y1 + top;
@@ -1015,7 +1015,7 @@ static void draw_box_label(lv_obj_t * dropdown_obj, lv_layer_t * layer, uint16_t
}
-static lv_res_t btn_release_handler(lv_obj_t * obj)
+static lv_result_t btn_release_handler(lv_obj_t * obj)
{
lv_dropdown_t * dropdown = (lv_dropdown_t *)obj;
lv_indev_t * indev = lv_indev_get_act();
@@ -1024,10 +1024,10 @@ static lv_res_t btn_release_handler(lv_obj_t * obj)
lv_dropdown_close(obj);
if(dropdown->sel_opt_id_orig != dropdown->sel_opt_id) {
dropdown->sel_opt_id_orig = dropdown->sel_opt_id;
- lv_res_t res;
+ lv_result_t res;
uint32_t id = dropdown->sel_opt_id; /*Just to use uint32_t in event data*/
res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &id);
- if(res != LV_RES_OK) return res;
+ if(res != LV_RESULT_OK) return res;
lv_obj_invalidate(obj);
}
lv_indev_type_t indev_type = lv_indev_get_type(indev);
@@ -1043,15 +1043,15 @@ static lv_res_t btn_release_handler(lv_obj_t * obj)
dropdown->sel_opt_id = dropdown->sel_opt_id_orig;
lv_obj_invalidate(obj);
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/**
* Called when a drop down list is released to open it or set new option
* @param list pointer to the drop down list's list
- * @return LV_RES_INV if the list is not being deleted in the user callback. Else LV_RES_OK
+ * @return LV_RESULT_INVALID if the list is not being deleted in the user callback. Else LV_RESULT_OK
*/
-static lv_res_t list_release_handler(lv_obj_t * list_obj)
+static lv_result_t list_release_handler(lv_obj_t * list_obj)
{
lv_dropdown_list_t * list = (lv_dropdown_list_t *) list_obj;
lv_obj_t * dropdown_obj = list->dropdown;
@@ -1081,10 +1081,10 @@ static lv_res_t list_release_handler(lv_obj_t * list_obj)
if(dropdown->text == NULL) lv_obj_invalidate(dropdown_obj);
uint32_t id = dropdown->sel_opt_id; /*Just to use uint32_t in event data*/
- lv_res_t res = lv_obj_send_event(dropdown_obj, LV_EVENT_VALUE_CHANGED, &id);
- if(res != LV_RES_OK) return res;
+ lv_result_t res = lv_obj_send_event(dropdown_obj, LV_EVENT_VALUE_CHANGED, &id);
+ if(res != LV_RESULT_OK) return res;
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
static void list_press_handler(lv_obj_t * list_obj)
diff --git a/src/widgets/image/lv_image.c b/src/widgets/image/lv_image.c
index 52ccf999b6..2d926a4e7f 100644
--- a/src/widgets/image/lv_image.c
+++ b/src/widgets/image/lv_image.c
@@ -133,7 +133,7 @@ void lv_image_set_src(lv_obj_t * obj, const void * src)
lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN);
lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN);
lv_point_t size;
- lv_txt_get_size(&size, src, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&size, src, font, letter_space, line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
header.w = size.x;
header.h = size.y;
}
@@ -146,7 +146,7 @@ void lv_image_set_src(lv_obj_t * obj, const void * src)
lv_obj_refresh_self_size(obj);
/*Provide enough room for the rotated corners*/
- if(img->angle || img->zoom != LV_ZOOM_NONE) lv_obj_refresh_ext_draw_size(obj);
+ if(img->rotation || img->zoom != LV_SCALE_NONE) lv_obj_refresh_ext_draw_size(obj);
lv_obj_invalidate(obj);
}
@@ -171,16 +171,16 @@ void lv_image_set_offset_y(lv_obj_t * obj, lv_coord_t y)
lv_obj_invalidate(obj);
}
-void lv_image_set_angle(lv_obj_t * obj, int16_t angle)
+void lv_image_set_rotation(lv_obj_t * obj, int16_t angle)
{
while(angle >= 3600) angle -= 3600;
while(angle < 0) angle += 3600;
lv_image_t * img = (lv_image_t *)obj;
- if(angle == img->angle) return;
+ if(angle == img->rotation) return;
if(img->obj_size_mode == LV_IMAGE_SIZE_MODE_REAL) {
- img->angle = angle;
+ img->rotation = angle;
lv_obj_invalidate_area(obj, &obj->coords);
return;
}
@@ -191,23 +191,23 @@ void lv_image_set_angle(lv_obj_t * obj, int16_t angle)
lv_area_t a;
lv_point_t pivot_px;
lv_image_get_pivot(obj, &pivot_px);
- _lv_image_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &pivot_px);
+ _lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->zoom, &pivot_px);
a.x1 += obj->coords.x1;
a.y1 += obj->coords.y1;
a.x2 += obj->coords.x1;
a.y2 += obj->coords.y1;
lv_obj_invalidate_area(obj, &a);
- img->angle = angle;
+ img->rotation = angle;
/* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate
* the whole ext draw area */
- lv_disp_t * disp = lv_obj_get_disp(obj);
- lv_disp_enable_invalidation(disp, false);
+ lv_display_t * disp = lv_obj_get_disp(obj);
+ lv_display_enable_invalidation(disp, false);
lv_obj_refresh_ext_draw_size(obj);
- lv_disp_enable_invalidation(disp, true);
+ lv_display_enable_invalidation(disp, true);
- _lv_image_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &pivot_px);
+ _lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->zoom, &pivot_px);
a.x1 += obj->coords.x1;
a.y1 += obj->coords.y1;
a.x2 += obj->coords.x1;
@@ -233,7 +233,7 @@ void lv_image_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
lv_area_t a;
lv_point_t pivot_px;
lv_image_get_pivot(obj, &pivot_px);
- _lv_image_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &pivot_px);
+ _lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->zoom, &pivot_px);
a.x1 += obj->coords.x1;
a.y1 += obj->coords.y1;
a.x2 += obj->coords.x1;
@@ -245,13 +245,13 @@ void lv_image_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
/* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate
* the whole ext draw area */
- lv_disp_t * disp = lv_obj_get_disp(obj);
- lv_disp_enable_invalidation(disp, false);
+ lv_display_t * disp = lv_obj_get_disp(obj);
+ lv_display_enable_invalidation(disp, false);
lv_obj_refresh_ext_draw_size(obj);
- lv_disp_enable_invalidation(disp, true);
+ lv_display_enable_invalidation(disp, true);
lv_image_get_pivot(obj, &pivot_px);
- _lv_image_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &pivot_px);
+ _lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->zoom, &pivot_px);
a.x1 += obj->coords.x1;
a.y1 += obj->coords.y1;
a.x2 += obj->coords.x1;
@@ -259,7 +259,7 @@ void lv_image_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
lv_obj_invalidate_area(obj, &a);
}
-void lv_image_set_zoom(lv_obj_t * obj, uint16_t zoom)
+void lv_image_set_scale(lv_obj_t * obj, uint16_t zoom)
{
lv_image_t * img = (lv_image_t *)obj;
if(zoom == img->zoom) return;
@@ -278,7 +278,7 @@ void lv_image_set_zoom(lv_obj_t * obj, uint16_t zoom)
lv_area_t a;
lv_point_t pivot_px;
lv_image_get_pivot(obj, &pivot_px);
- _lv_image_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &pivot_px);
+ _lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->zoom, &pivot_px);
a.x1 += obj->coords.x1 - 1;
a.y1 += obj->coords.y1 - 1;
a.x2 += obj->coords.x1 + 1;
@@ -289,12 +289,12 @@ void lv_image_set_zoom(lv_obj_t * obj, uint16_t zoom)
/* Disable invalidations because lv_obj_refresh_ext_draw_size would invalidate
* the whole ext draw area */
- lv_disp_t * disp = lv_obj_get_disp(obj);
- lv_disp_enable_invalidation(disp, false);
+ lv_display_t * disp = lv_obj_get_disp(obj);
+ lv_display_enable_invalidation(disp, false);
lv_obj_refresh_ext_draw_size(obj);
- lv_disp_enable_invalidation(disp, true);
+ lv_display_enable_invalidation(disp, true);
- _lv_image_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &pivot_px);
+ _lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->zoom, &pivot_px);
a.x1 += obj->coords.x1 - 1;
a.y1 += obj->coords.y1 - 1;
a.x2 += obj->coords.x1 + 1;
@@ -352,13 +352,13 @@ lv_coord_t lv_image_get_offset_y(lv_obj_t * obj)
return img->offset.y;
}
-lv_coord_t lv_image_get_angle(lv_obj_t * obj)
+lv_coord_t lv_image_get_rotation(lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_image_t * img = (lv_image_t *)obj;
- return img->angle;
+ return img->rotation;
}
void lv_image_get_pivot(lv_obj_t * obj, lv_point_t * pivot)
@@ -371,7 +371,7 @@ void lv_image_get_pivot(lv_obj_t * obj, lv_point_t * pivot)
pivot->y = lv_pct_to_px(img->pivot.y, img->h);
}
-lv_coord_t lv_image_get_zoom(lv_obj_t * obj)
+lv_coord_t lv_image_get_scale(lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@@ -412,8 +412,8 @@ static void lv_image_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj)
img->cf = LV_COLOR_FORMAT_UNKNOWN;
img->w = lv_obj_get_width(obj);
img->h = lv_obj_get_height(obj);
- img->angle = 0;
- img->zoom = LV_ZOOM_NONE;
+ img->rotation = 0;
+ img->zoom = LV_SCALE_NONE;
img->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0;
img->offset.x = 0;
img->offset.y = 0;
@@ -448,7 +448,7 @@ static lv_point_t lv_image_get_transformed_size(lv_obj_t * obj)
lv_point_t pivot_px;
lv_image_get_pivot(obj, &pivot_px);
_lv_image_buf_get_transformed_area(&area_transform, img->w, img->h,
- img->angle, img->zoom, &pivot_px);
+ img->rotation, img->zoom, &pivot_px);
return (lv_point_t) {
lv_area_get_width(&area_transform), lv_area_get_height(&area_transform)
@@ -464,8 +464,8 @@ static void lv_image_event(const lv_obj_class_t * class_p, lv_event_t * e)
/*Ancestor events will be called during drawing*/
if(code != LV_EVENT_DRAW_MAIN && code != LV_EVENT_DRAW_POST) {
/*Call the ancestor's event handler*/
- lv_res_t res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_event_base(MY_CLASS, e);
+ if(res != LV_RESULT_OK) return;
}
lv_obj_t * obj = lv_event_get_target(e);
@@ -488,11 +488,11 @@ static void lv_image_event(const lv_obj_class_t * class_p, lv_event_t * e)
lv_coord_t * s = lv_event_get_param(e);
/*If the image has angle provide enough room for the rotated corners*/
- if(img->angle || img->zoom != LV_ZOOM_NONE) {
+ if(img->rotation || img->zoom != LV_SCALE_NONE) {
lv_area_t a;
lv_coord_t w = lv_obj_get_width(obj);
lv_coord_t h = lv_obj_get_height(obj);
- _lv_image_buf_get_transformed_area(&a, w, h, img->angle, img->zoom, &pivot_px);
+ _lv_image_buf_get_transformed_area(&a, w, h, img->rotation, img->zoom, &pivot_px);
*s = LV_MAX(*s, -a.x1);
*s = LV_MAX(*s, -a.y1);
*s = LV_MAX(*s, a.x2 - w);
@@ -505,12 +505,12 @@ static void lv_image_event(const lv_obj_class_t * class_p, lv_event_t * e)
/*If the object is exactly image sized (not cropped, not mosaic) and transformed
*perform hit test on its transformed area*/
if(img->w == lv_obj_get_width(obj) && img->h == lv_obj_get_height(obj) &&
- (img->zoom != LV_ZOOM_NONE || img->angle != 0 || img->pivot.x != img->w / 2 || img->pivot.y != img->h / 2)) {
+ (img->zoom != LV_SCALE_NONE || img->rotation != 0 || img->pivot.x != img->w / 2 || img->pivot.y != img->h / 2)) {
lv_coord_t w = lv_obj_get_width(obj);
lv_coord_t h = lv_obj_get_height(obj);
lv_area_t coords;
- _lv_image_buf_get_transformed_area(&coords, w, h, img->angle, img->zoom, &pivot_px);
+ _lv_image_buf_get_transformed_area(&coords, w, h, img->rotation, img->zoom, &pivot_px);
coords.x1 += obj->coords.x1;
coords.y1 += obj->coords.y1;
coords.x2 += obj->coords.x1;
@@ -564,13 +564,13 @@ static void draw_image(lv_event_t * e)
return;
}
- if(img->angle != 0) {
+ if(img->rotation != 0) {
info->res = LV_COVER_RES_NOT_COVER;
return;
}
const lv_area_t * clip_area = lv_event_get_param(e);
- if(img->zoom == LV_ZOOM_NONE) {
+ if(img->zoom == LV_SCALE_NONE) {
if(_lv_area_is_in(clip_area, &obj->coords, 0) == false) {
info->res = LV_COVER_RES_NOT_COVER;
return;
@@ -617,7 +617,7 @@ static void draw_image(lv_event_t * e)
}
else {
_lv_image_buf_get_transformed_area(&bg_coords, obj_w, obj_h,
- img->angle, img->zoom, &bg_pivot);
+ img->rotation, img->zoom, &bg_pivot);
/*Modify the coordinates to draw the background for the rotated and scaled coordinates*/
bg_coords.x1 += obj->coords.x1;
@@ -630,8 +630,8 @@ static void draw_image(lv_event_t * e)
lv_area_copy(&ori_coords, &obj->coords);
lv_area_copy(&obj->coords, &bg_coords);
- lv_res_t res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_event_base(MY_CLASS, e);
+ if(res != LV_RESULT_OK) return;
lv_area_copy(&obj->coords, &ori_coords);
@@ -668,7 +668,7 @@ static void draw_image(lv_event_t * e)
lv_obj_init_draw_image_dsc(obj, LV_PART_MAIN, &img_dsc);
img_dsc.zoom = img->zoom;
- img_dsc.angle = img->angle;
+ img_dsc.rotation = img->rotation;
img_dsc.pivot.x = pivot_px.x;
img_dsc.pivot.y = pivot_px.y;
img_dsc.antialias = img->antialias;
diff --git a/src/widgets/image/lv_image.h b/src/widgets/image/lv_image.h
index 371db3b9ed..525ee5a331 100644
--- a/src/widgets/image/lv_image.h
+++ b/src/widgets/image/lv_image.h
@@ -43,7 +43,7 @@ typedef struct {
lv_point_t offset;
lv_coord_t w; /*Width of the image (Handled by the library)*/
lv_coord_t h; /*Height of the image (Handled by the library)*/
- lv_coord_t angle; /*rotation angle of the image*/
+ lv_coord_t rotation; /*rotation angle of the image*/
lv_point_t pivot; /*rotation center of the image*/
lv_coord_t zoom; /*256 means no zoom, 512 double size, 128 half size*/
uint8_t src_type : 2; /*See: lv_image_src_t*/
@@ -120,9 +120,9 @@ void lv_image_set_offset_y(lv_obj_t * obj, lv_coord_t y);
* The image will be rotated around the set pivot set by `lv_image_set_pivot()`
* Note that indexed and alpha only images can't be transformed.
* @param obj pointer to an image object
- * @param angle rotation angle in degree with 0.1 degree resolution (0..3600: clock wise)
+ * @param angle rotation in degree with 0.1 degree resolution (0..3600: clock wise)
*/
-void lv_image_set_angle(lv_obj_t * obj, int16_t angle);
+void lv_image_set_rotation(lv_obj_t * obj, int16_t angle);
/**
* Set the rotation center of the image.
@@ -146,7 +146,7 @@ void lv_image_set_pivot(lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
* @example 128 half size
* @example 512 double size
*/
-void lv_image_set_zoom(lv_obj_t * obj, uint16_t zoom);
+void lv_image_set_scale(lv_obj_t * obj, uint16_t zoom);
/**
* Enable/disable anti-aliasing for the transformations (rotate, zoom) or not.
@@ -189,11 +189,11 @@ lv_coord_t lv_image_get_offset_x(lv_obj_t * obj);
lv_coord_t lv_image_get_offset_y(lv_obj_t * obj);
/**
- * Get the rotation angle of the image.
+ * Get the rotation of the image.
* @param obj pointer to an image object
- * @return rotation angle in 0.1 degrees (0..3600)
+ * @return rotation in 0.1 degrees (0..3600)
*/
-lv_coord_t lv_image_get_angle(lv_obj_t * obj);
+lv_coord_t lv_image_get_rotation(lv_obj_t * obj);
/**
* Get the pivot (rotation center) of the image.
@@ -208,7 +208,7 @@ void lv_image_get_pivot(lv_obj_t * obj, lv_point_t * pivot);
* @param obj pointer to an image object
* @return zoom factor (256: no zoom)
*/
-lv_coord_t lv_image_get_zoom(lv_obj_t * obj);
+lv_coord_t lv_image_get_scale(lv_obj_t * obj);
/**
* Get whether the transformations (rotate, zoom) are anti-aliased or not
diff --git a/src/widgets/imgbtn/lv_imgbtn.c b/src/widgets/imgbtn/lv_imgbtn.c
index de37cf783a..b1d178baa1 100644
--- a/src/widgets/imgbtn/lv_imgbtn.c
+++ b/src/widgets/imgbtn/lv_imgbtn.c
@@ -180,8 +180,8 @@ static void lv_imgbtn_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res = lv_obj_event_base(&lv_imgbtn_class, e);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_event_base(&lv_imgbtn_class, e);
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -366,8 +366,8 @@ static void update_src_info(lv_imgbtn_src_info_t * info, const void * src)
return;
}
- lv_res_t res = lv_image_decoder_get_info(src, &info->header);
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_image_decoder_get_info(src, &info->header);
+ if(res != LV_RESULT_OK) {
LV_LOG_WARN("can't get info");
return;
}
diff --git a/src/widgets/keyboard/lv_keyboard.c b/src/widgets/keyboard/lv_keyboard.c
index 7653232917..4db74c15cb 100644
--- a/src/widgets/keyboard/lv_keyboard.c
+++ b/src/widgets/keyboard/lv_keyboard.c
@@ -355,22 +355,22 @@ void lv_keyboard_def_event_cb(lv_event_t * e)
return;
}
else if(strcmp(txt, LV_SYMBOL_CLOSE) == 0 || strcmp(txt, LV_SYMBOL_KEYBOARD) == 0) {
- lv_res_t res = lv_obj_send_event(obj, LV_EVENT_CANCEL, NULL);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_send_event(obj, LV_EVENT_CANCEL, NULL);
+ if(res != LV_RESULT_OK) return;
if(keyboard->ta) {
res = lv_obj_send_event(keyboard->ta, LV_EVENT_CANCEL, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
return;
}
else if(strcmp(txt, LV_SYMBOL_OK) == 0) {
- lv_res_t res = lv_obj_send_event(obj, LV_EVENT_READY, NULL);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_send_event(obj, LV_EVENT_READY, NULL);
+ if(res != LV_RESULT_OK) return;
if(keyboard->ta) {
res = lv_obj_send_event(keyboard->ta, LV_EVENT_READY, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
return;
}
@@ -381,8 +381,8 @@ void lv_keyboard_def_event_cb(lv_event_t * e)
if(strcmp(txt, "Enter") == 0 || strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) {
lv_textarea_add_char(keyboard->ta, '\n');
if(lv_textarea_get_one_line(keyboard->ta)) {
- lv_res_t res = lv_obj_send_event(keyboard->ta, LV_EVENT_READY, NULL);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_send_event(keyboard->ta, LV_EVENT_READY, NULL);
+ if(res != LV_RESULT_OK) return;
}
}
else if(strcmp(txt, LV_SYMBOL_LEFT) == 0) {
diff --git a/src/widgets/label/lv_label.c b/src/widgets/label/lv_label.c
index d489647b1f..7b9241adab 100644
--- a/src/widgets/label/lv_label.c
+++ b/src/widgets/label/lv_label.c
@@ -11,12 +11,12 @@
#include "../../core/lv_obj.h"
#include "../../misc/lv_assert.h"
#include "../../core/lv_group.h"
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../../draw/lv_draw.h"
#include "../../misc/lv_color.h"
#include "../../misc/lv_math.h"
#include "../../misc/lv_bidi.h"
-#include "../../misc/lv_txt_ap.h"
+#include "../../misc/lv_text_ap.h"
#include "../../stdlib/lv_sprintf.h"
#include "../../stdlib/lv_string.h"
@@ -25,7 +25,7 @@
*********************/
#define MY_CLASS &lv_label_class
-#define LV_LABEL_DEF_SCROLL_SPEED (lv_disp_get_dpi(lv_obj_get_disp(obj)) / 3)
+#define LV_LABEL_DEF_SCROLL_SPEED (lv_display_get_dpi(lv_obj_get_disp(obj)) / 3)
#define LV_LABEL_SCROLL_DELAY 300
#define LV_LABEL_DOT_END_INV 0xFFFFFFFF
#define LV_LABEL_HINT_HEIGHT_LIMIT 1024 /*Enable "hint" to buffer info about labels larger than this. (Speed up drawing)*/
@@ -108,7 +108,7 @@ void lv_label_set_text(lv_obj_t * obj, const char * text)
if(label->text == NULL) return;
#if LV_USE_ARABIC_PERSIAN_CHARS
- _lv_txt_ap_proc(label->text, label->text);
+ _lv_text_ap_proc(label->text, label->text);
#endif
}
@@ -153,7 +153,7 @@ void lv_label_set_text_fmt(lv_obj_t * obj, const char * fmt, ...)
va_list args;
va_start(args, fmt);
- label->text = _lv_txt_set_text_vfmt(fmt, args);
+ label->text = _lv_text_set_text_vfmt(fmt, args);
va_end(args);
label->static_txt = 0; /*Now the text is dynamically allocated*/
@@ -301,7 +301,7 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t
lv_text_flag_t flag = get_label_flags(label);
if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) flag |= LV_TEXT_FLAG_FIT;
- const uint32_t byte_id = _lv_txt_encoded_get_byte_id(txt, char_id);
+ const uint32_t byte_id = _lv_text_encoded_get_byte_id(txt, char_id);
/*Search the line of the index letter*/
const lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN);
const lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_MAIN);
@@ -317,7 +317,7 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t
uint32_t line_start = 0;
uint32_t new_line_start = 0;
while(txt[new_line_start] != '\0') {
- new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag);
+ new_line_start += _lv_text_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag);
if(byte_id < new_line_start || txt[new_line_start] == '\0')
break; /*The line of 'index' letter begins at 'line_start'*/
@@ -346,7 +346,7 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t
bidi_txt = &txt[line_start];
}
else {
- uint32_t line_char_id = _lv_txt_encoded_get_char_id(&txt[line_start], byte_id - line_start);
+ uint32_t line_char_id = _lv_text_encoded_get_char_id(&txt[line_start], byte_id - line_start);
bool is_rtl;
uint32_t visual_char_pos = _lv_bidi_get_visual_pos(&txt[line_start], &mutable_bidi_txt, new_line_start - line_start,
@@ -354,7 +354,7 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t
bidi_txt = mutable_bidi_txt;
if(is_rtl) visual_char_pos++;
- visual_byte_pos = _lv_txt_encoded_get_byte_id(bidi_txt, visual_char_pos);
+ visual_byte_pos = _lv_text_encoded_get_byte_id(bidi_txt, visual_char_pos);
}
#else
bidi_txt = &txt[line_start];
@@ -362,7 +362,7 @@ void lv_label_get_letter_pos(const lv_obj_t * obj, uint32_t char_id, lv_point_t
#endif
/*Calculate the x coordinate*/
- lv_coord_t x = lv_txt_get_width(bidi_txt, visual_byte_pos, font, letter_space);
+ lv_coord_t x = lv_text_get_width(bidi_txt, visual_byte_pos, font, letter_space);
if(char_id != line_start) x += letter_space;
uint32_t length = new_line_start - line_start;
@@ -402,14 +402,14 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in)
/*Search the line of the index letter*/;
while(txt[line_start] != '\0') {
- new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag);
+ new_line_start += _lv_text_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag);
if(pos.y <= y + letter_height) {
/*The line is found (stored in 'line_start')*/
/*Include the NULL terminator in the last line*/
uint32_t tmp = new_line_start;
uint32_t letter;
- letter = _lv_txt_encoded_prev(txt, &tmp);
+ letter = _lv_text_encoded_prev(txt, &tmp);
if(letter != '\n' && txt[new_line_start] == '\0') new_line_start++;
break;
}
@@ -444,7 +444,7 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in)
/*Be careful 'i' already points to the next character*/
uint32_t letter;
uint32_t letter_next;
- _lv_txt_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &i);
+ _lv_text_encoded_letter_next_2(bidi_txt, &letter, &letter_next, &i);
lv_coord_t gw = lv_font_get_glyph_width(font, letter, letter_next);
@@ -462,7 +462,7 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in)
uint32_t logical_pos;
#if LV_USE_BIDI
/*Handle Bidi*/
- uint32_t cid = _lv_txt_encoded_get_char_id(bidi_txt, i);
+ uint32_t cid = _lv_text_encoded_get_char_id(bidi_txt, i);
if(txt[line_start + i] == '\0') {
logical_pos = i;
}
@@ -474,10 +474,10 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * obj, lv_point_t * pos_in)
}
lv_free(bidi_txt);
#else
- logical_pos = _lv_txt_encoded_get_char_id(bidi_txt, i);
+ logical_pos = _lv_text_encoded_get_char_id(bidi_txt, i);
#endif
- return logical_pos + _lv_txt_encoded_get_char_id(txt, line_start);
+ return logical_pos + _lv_text_encoded_get_char_id(txt, line_start);
}
bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos)
@@ -503,7 +503,7 @@ bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos)
/*Search the line of the index letter*/
lv_coord_t y = 0;
while(txt[line_start] != '\0') {
- new_line_start += _lv_txt_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag);
+ new_line_start += _lv_text_get_next_line(&txt[line_start], font, letter_space, max_w, NULL, flag);
if(pos->y <= y + letter_height) break; /*The line is found (stored in 'line_start')*/
y += letter_height + line_space;
@@ -516,11 +516,11 @@ bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos)
lv_coord_t x = 0;
if(align == LV_TEXT_ALIGN_CENTER) {
- const lv_coord_t line_w = lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, letter_space);
+ const lv_coord_t line_w = lv_text_get_width(&txt[line_start], new_line_start - line_start, font, letter_space);
x += lv_area_get_width(&txt_coords) / 2 - line_w / 2;
}
else if(align == LV_TEXT_ALIGN_RIGHT) {
- const lv_coord_t line_w = lv_txt_get_width(&txt[line_start], new_line_start - line_start, font, letter_space);
+ const lv_coord_t line_w = lv_text_get_width(&txt[line_start], new_line_start - line_start, font, letter_space);
x += lv_area_get_width(&txt_coords) - line_w;
}
@@ -534,7 +534,7 @@ bool lv_label_is_char_under_pos(const lv_obj_t * obj, lv_point_t * pos)
while(i <= new_line_start - 1) {
/*Get the current letter and the next letter for kerning*/
/*Be careful 'i' already points to the next character*/
- _lv_txt_encoded_letter_next_2(txt, &letter, &letter_next, &i);
+ _lv_text_encoded_letter_next_2(txt, &letter, &letter_next, &i);
last_x = x;
x += lv_font_get_glyph_width(font, letter, letter_next);
@@ -602,10 +602,10 @@ void lv_label_ins_text(lv_obj_t * obj, uint32_t pos, const char * txt)
if(label->text == NULL) return;
if(pos == LV_LABEL_POS_LAST) {
- pos = _lv_txt_get_encoded_length(label->text);
+ pos = _lv_text_get_encoded_length(label->text);
}
- _lv_txt_ins(label->text, pos, txt);
+ _lv_text_ins(label->text, pos, txt);
lv_label_set_text(obj, NULL);
}
@@ -621,7 +621,7 @@ void lv_label_cut_text(lv_obj_t * obj, uint32_t pos, uint32_t cnt)
char * label_txt = lv_label_get_text(obj);
/*Delete the characters*/
- _lv_txt_cut(label_txt, pos, cnt);
+ _lv_text_cut(label_txt, pos, cnt);
/*Refresh the label*/
lv_label_refr_text(obj);
@@ -681,8 +681,8 @@ static void lv_label_event(const lv_obj_class_t * class_p, lv_event_t * e)
LV_UNUSED(class_p);
/*Call the ancestor's event handler*/
- const lv_res_t res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ const lv_result_t res = lv_obj_event_base(MY_CLASS, e);
+ if(res != LV_RESULT_OK) return;
const lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -715,7 +715,7 @@ static void lv_label_event(const lv_obj_class_t * class_p, lv_event_t * e)
if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) w = LV_COORD_MAX;
else w = lv_obj_get_content_width(obj);
- lv_txt_get_size(&label->size_cache, label->text, font, letter_space, line_space, w, flag);
+ lv_text_get_size(&label->size_cache, label->text, font, letter_space, line_space, w, flag);
label->invalid_size_cache = false;
}
@@ -770,8 +770,8 @@ static void draw_main(lv_event_t * e)
if((label->long_mode == LV_LABEL_LONG_SCROLL || label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) &&
(label_draw_dsc.align == LV_TEXT_ALIGN_CENTER || label_draw_dsc.align == LV_TEXT_ALIGN_RIGHT)) {
lv_point_t size;
- lv_txt_get_size(&size, label->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space,
- LV_COORD_MAX, flag);
+ lv_text_get_size(&size, label->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space,
+ LV_COORD_MAX, flag);
if(size.x > lv_area_get_width(&txt_coords)) {
label_draw_dsc.align = LV_TEXT_ALIGN_LEFT;
}
@@ -803,8 +803,8 @@ static void draw_main(lv_event_t * e)
if(label->long_mode == LV_LABEL_LONG_SCROLL_CIRCULAR) {
lv_point_t size;
- lv_txt_get_size(&size, label->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space,
- LV_COORD_MAX, flag);
+ lv_text_get_size(&size, label->text, label_draw_dsc.font, label_draw_dsc.letter_space, label_draw_dsc.line_space,
+ LV_COORD_MAX, flag);
/*Draw the text again on label to the original to make a circular effect */
if(size.x > lv_area_get_width(&txt_coords)) {
@@ -879,7 +879,7 @@ static void lv_label_refr_text(lv_obj_t * obj)
if(label->expand != 0) flag |= LV_TEXT_FLAG_EXPAND;
if(lv_obj_get_style_width(obj, LV_PART_MAIN) == LV_SIZE_CONTENT && !obj->w_layout) flag |= LV_TEXT_FLAG_FIT;
- lv_txt_get_size(&size, label->text, font, letter_space, line_space, max_w, flag);
+ lv_text_get_size(&size, label->text, font, letter_space, line_space, max_w, flag);
lv_obj_refresh_self_size(obj);
@@ -1082,7 +1082,7 @@ static void lv_label_refr_text(lv_obj_t * obj)
else if(size.y <= lv_font_get_line_height(font)) { /*No dots are required for one-line texts*/
label->dot_end = LV_LABEL_DOT_END_INV;
}
- else if(_lv_txt_get_encoded_length(label->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/
+ else if(_lv_text_get_encoded_length(label->text) <= LV_LABEL_DOT_NUM) { /*Don't turn to dots all the characters*/
label->dot_end = LV_LABEL_DOT_END_INV;
}
else {
@@ -1107,9 +1107,9 @@ static void lv_label_refr_text(lv_obj_t * obj)
/*Be sure there is space for the dots*/
size_t txt_len = lv_strlen(label->text);
- uint32_t byte_id = _lv_txt_encoded_get_byte_id(label->text, letter_id);
+ uint32_t byte_id = _lv_text_encoded_get_byte_id(label->text, letter_id);
while(byte_id + LV_LABEL_DOT_NUM > txt_len) {
- _lv_txt_encoded_prev(label->text, &byte_id);
+ _lv_text_encoded_prev(label->text, &byte_id);
letter_id--;
}
@@ -1118,8 +1118,8 @@ static void lv_label_refr_text(lv_obj_t * obj)
uint32_t i;
uint8_t len = 0;
for(i = 0; i <= LV_LABEL_DOT_NUM; i++) {
- len += _lv_txt_encoded_size(&label->text[byte_id]);
- _lv_txt_encoded_next(label->text, &byte_id);
+ len += _lv_text_encoded_size(&label->text[byte_id]);
+ _lv_text_encoded_next(label->text, &byte_id);
if(len > LV_LABEL_DOT_NUM || byte_id > txt_len) {
break;
}
@@ -1150,7 +1150,7 @@ static void lv_label_revert_dots(lv_obj_t * obj)
if(label->dot_end == LV_LABEL_DOT_END_INV) return;
const uint32_t letter_i = label->dot_end - LV_LABEL_DOT_NUM;
- const uint32_t byte_i = _lv_txt_encoded_get_byte_id(label->text, letter_i);
+ const uint32_t byte_i = _lv_text_encoded_get_byte_id(label->text, letter_i);
/*Restore the characters*/
uint8_t i = 0;
@@ -1248,7 +1248,7 @@ static size_t get_text_length(const char * text)
{
size_t len = 0;
#if LV_USE_ARABIC_PERSIAN_CHARS
- len = _lv_txt_ap_calc_bytes_cnt(text);
+ len = _lv_text_ap_calc_bytes_cnt(text);
#else
len = lv_strlen(text) + 1;
#endif
@@ -1259,7 +1259,7 @@ static size_t get_text_length(const char * text)
static void copy_text_to_label(lv_label_t * label, const char * text)
{
#if LV_USE_ARABIC_PERSIAN_CHARS
- _lv_txt_ap_proc(text, label->text);
+ _lv_text_ap_proc(text, label->text);
#else
lv_strcpy(label->text, text);
#endif
@@ -1280,11 +1280,11 @@ static void calculate_x_coordinate(lv_coord_t * x, const lv_text_align_t align,
const lv_font_t * font, lv_coord_t letter_space, lv_area_t * txt_coords)
{
if(align == LV_TEXT_ALIGN_CENTER) {
- const lv_coord_t line_w = lv_txt_get_width(txt, length, font, letter_space);
+ const lv_coord_t line_w = lv_text_get_width(txt, length, font, letter_space);
*x += lv_area_get_width(txt_coords) / 2 - line_w / 2;
}
else if(align == LV_TEXT_ALIGN_RIGHT) {
- const lv_coord_t line_w = lv_txt_get_width(txt, length, font, letter_space);
+ const lv_coord_t line_w = lv_text_get_width(txt, length, font, letter_space);
*x += lv_area_get_width(txt_coords) - line_w;
}
else {
diff --git a/src/widgets/label/lv_label.h b/src/widgets/label/lv_label.h
index 897c352cf5..05bd23a09f 100644
--- a/src/widgets/label/lv_label.h
+++ b/src/widgets/label/lv_label.h
@@ -21,7 +21,7 @@ extern "C" {
#include "../../core/lv_obj.h"
#include "../../font/lv_font.h"
#include "../../font/lv_symbol_def.h"
-#include "../../misc/lv_txt.h"
+#include "../../misc/lv_text.h"
#include "../../draw/lv_draw.h"
/*********************
diff --git a/src/widgets/led/lv_led.c b/src/widgets/led/lv_led.c
index 13e6b6db42..459ddce9a7 100644
--- a/src/widgets/led/lv_led.c
+++ b/src/widgets/led/lv_led.c
@@ -161,13 +161,13 @@ static void lv_led_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/* Call the ancestor's event handler */
lv_event_code_t code = lv_event_get_code(e);
if(code != LV_EVENT_DRAW_MAIN && code != LV_EVENT_DRAW_MAIN_END) {
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
lv_obj_t * obj = lv_event_get_target(e);
diff --git a/src/widgets/line/lv_line.c b/src/widgets/line/lv_line.c
index 45f53b4b2b..0ba04e9dec 100644
--- a/src/widgets/line/lv_line.c
+++ b/src/widgets/line/lv_line.c
@@ -135,11 +135,11 @@ static void lv_line_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
diff --git a/src/widgets/list/lv_list.c b/src/widgets/list/lv_list.c
index 61abe81774..850992f766 100644
--- a/src/widgets/list/lv_list.c
+++ b/src/widgets/list/lv_list.c
@@ -8,7 +8,7 @@
*********************/
#include "lv_list.h"
#include "../../layouts/flex/lv_flex.h"
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../label/lv_label.h"
#include "../image/lv_image.h"
#include "../button/lv_button.h"
diff --git a/src/widgets/meter/lv_meter.c b/src/widgets/meter/lv_meter.c
index 2eb6b24838..529160aa5b 100644
--- a/src/widgets/meter/lv_meter.c
+++ b/src/widgets/meter/lv_meter.c
@@ -299,8 +299,8 @@ static void lv_meter_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_event_base(MY_CLASS, e);
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -463,8 +463,8 @@ static void draw_ticks_and_labels(lv_obj_t * obj, lv_layer_t * layer, const lv_a
lv_point_t label_size;
label_dsc_tmp.text = buf;
- lv_txt_get_size(&label_size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space,
- LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&label_size, buf, label_dsc.font, label_dsc.letter_space, label_dsc.line_space,
+ LV_COORD_MAX, LV_TEXT_FLAG_NONE);
lv_area_t label_cord;
label_cord.x1 = p.x - label_size.x / 2;
@@ -535,7 +535,7 @@ static void draw_needles(lv_obj_t * obj, lv_layer_t * layer, const lv_area_t * s
img_dsc.pivot.y = indic->type_data.needle_img.pivot.y;
angle = angle * 10;
if(angle > 3600) angle -= 3600;
- img_dsc.angle = angle;
+ img_dsc.rotation = angle;
img_dsc.src = indic->type_data.needle_img.src;
lv_draw_image(layer, &img_dsc, &a);
@@ -611,7 +611,7 @@ static void inv_line(lv_obj_t * obj, lv_meter_indicator_t * indic, int32_t value
scale_center.x -= indic->type_data.needle_img.pivot.x;
scale_center.y -= indic->type_data.needle_img.pivot.y;
lv_area_t a;
- _lv_image_buf_get_transformed_area(&a, info.w, info.h, angle, LV_ZOOM_NONE, &indic->type_data.needle_img.pivot);
+ _lv_image_buf_get_transformed_area(&a, info.w, info.h, angle, LV_SCALE_NONE, &indic->type_data.needle_img.pivot);
a.x1 += scale_center.x - 2;
a.y1 += scale_center.y - 2;
a.x2 += scale_center.x + 2;
diff --git a/src/widgets/msgbox/lv_msgbox.c b/src/widgets/msgbox/lv_msgbox.c
index 403f47685b..dcf84df9a1 100644
--- a/src/widgets/msgbox/lv_msgbox.c
+++ b/src/widgets/msgbox/lv_msgbox.c
@@ -13,7 +13,7 @@
#include "../button/lv_button.h"
#include "../buttonmatrix/lv_buttonmatrix.h"
#include "../../misc/lv_assert.h"
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../../layouts/flex/lv_flex.h"
#include "../../stdlib/lv_string.h"
diff --git a/src/widgets/objx_templ/lv_objx_templ.c b/src/widgets/objx_templ/lv_objx_templ.c
index ad7b75a3e5..1b27112938 100644
--- a/src/widgets/objx_templ/lv_objx_templ.c
+++ b/src/widgets/objx_templ/lv_objx_templ.c
@@ -124,11 +124,11 @@ static void lv_templ_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = LV_EVENT_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
/*Add the widget specific event handling here*/
}
diff --git a/src/widgets/roller/lv_roller.c b/src/widgets/roller/lv_roller.c
index f9aa7d5190..2e36470cbb 100644
--- a/src/widgets/roller/lv_roller.c
+++ b/src/widgets/roller/lv_roller.c
@@ -38,7 +38,7 @@ static void draw_main(lv_event_t * e);
static void draw_label(lv_event_t * e);
static void get_sel_area(lv_obj_t * obj, lv_area_t * sel_area);
static void refr_position(lv_obj_t * obj, lv_anim_enable_t animen);
-static lv_res_t release_handler(lv_obj_t * obj);
+static lv_result_t release_handler(lv_obj_t * obj);
static void inf_normalize(lv_obj_t * obj_scrl);
static lv_obj_t * get_label(const lv_obj_t * obj);
static lv_coord_t get_selected_label_width(const lv_obj_t * obj);
@@ -327,11 +327,11 @@ static void lv_roller_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
const lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -432,14 +432,14 @@ static void lv_roller_label_event(const lv_obj_class_t * class_p, lv_event_t * e
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
lv_event_code_t code = lv_event_get_code(e);
/*LV_EVENT_DRAW_MAIN will be called in the draw function*/
if(code != LV_EVENT_DRAW_MAIN) {
/* Call the ancestor's event handler */
res = lv_obj_event_base(MY_CLASS_LABEL, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
lv_obj_t * label = lv_event_get_target(e);
@@ -494,8 +494,8 @@ static void draw_main(lv_event_t * e)
/*Get the size of the "selected text"*/
lv_point_t res_p;
- lv_txt_get_size(&res_p, lv_label_get_text(label), label_dsc.font, label_dsc.letter_space, label_dsc.line_space,
- lv_obj_get_width(obj), LV_TEXT_FLAG_EXPAND);
+ lv_text_get_size(&res_p, lv_label_get_text(label), label_dsc.font, label_dsc.letter_space, label_dsc.line_space,
+ lv_obj_get_width(obj), LV_TEXT_FLAG_EXPAND);
/*Move the selected label proportionally with the background label*/
lv_coord_t roller_h = lv_obj_get_height(obj);
@@ -671,10 +671,10 @@ static void refr_position(lv_obj_t * obj, lv_anim_enable_t anim_en)
}
}
-static lv_res_t release_handler(lv_obj_t * obj)
+static lv_result_t release_handler(lv_obj_t * obj)
{
lv_obj_t * label = get_label(obj);
- if(label == NULL) return LV_RES_OK;
+ if(label == NULL) return LV_RESULT_OK;
lv_indev_t * indev = lv_indev_get_act();
lv_roller_t * roller = (lv_roller_t *)obj;
@@ -710,7 +710,7 @@ static lv_res_t release_handler(lv_obj_t * obj)
uint32_t letter_cnt = 0;
for(letter_cnt = 0; letter_cnt < letter_i; letter_cnt++) {
- uint32_t letter = _lv_txt_encoded_next(txt, &i);
+ uint32_t letter = _lv_text_encoded_next(txt, &i);
/*Count he lines to reach the clicked letter. But ignore the last '\n' because it
* still belongs to the clicked line*/
if(letter == '\n' && i_prev != letter_i) new_opt++;
@@ -752,7 +752,7 @@ static lv_res_t release_handler(lv_obj_t * obj)
}
uint32_t id = roller->sel_opt_id; /*Just to use uint32_t in event data*/
- lv_res_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &id);
+ lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, &id);
return res;
}
@@ -803,7 +803,7 @@ static lv_coord_t get_selected_label_width(const lv_obj_t * obj)
lv_coord_t letter_space = lv_obj_get_style_text_letter_space(obj, LV_PART_SELECTED);
const char * txt = lv_label_get_text(label);
lv_point_t size;
- lv_txt_get_size(&size, txt, font, letter_space, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&size, txt, font, letter_space, 0, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
return size.x;
}
@@ -825,8 +825,8 @@ static void transform_vect_recursive(lv_obj_t * roller, lv_point_t * vect)
int32_t zoom = 256;
lv_obj_t * parent = roller;
while(parent) {
- angle += lv_obj_get_style_transform_angle(parent, 0);
- int32_t zoom_act = lv_obj_get_style_transform_zoom_safe(parent, 0);
+ angle += lv_obj_get_style_transform_rotation(parent, 0);
+ int32_t zoom_act = lv_obj_get_style_transform_scale_safe(parent, 0);
zoom = (zoom * zoom_act) >> 8;
parent = lv_obj_get_parent(parent);
}
diff --git a/src/widgets/scale/lv_scale.c b/src/widgets/scale/lv_scale.c
index 51d9fb9bd2..0835ec5d77 100644
--- a/src/widgets/scale/lv_scale.c
+++ b/src/widgets/scale/lv_scale.c
@@ -309,8 +309,8 @@ static void lv_scale_event(const lv_obj_class_t * class_p, lv_event_t * event)
LV_UNUSED(class_p);
/*Call the ancestor's event handler*/
- lv_res_t res = lv_obj_event_base(MY_CLASS, event);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_event_base(MY_CLASS, event);
+ if(res != LV_RESULT_OK) return;
lv_event_code_t event_code = lv_event_get_code(event);
lv_obj_t * obj = lv_event_get_target(event);
@@ -971,8 +971,8 @@ static void scale_get_label_coords(lv_obj_t * obj, lv_draw_label_dsc_t * label_d
/* Reserve appropriate size for the tick label */
lv_point_t label_size;
- lv_txt_get_size(&label_size, label_dsc->text,
- label_dsc->font, label_dsc->letter_space, label_dsc->line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&label_size, label_dsc->text,
+ label_dsc->font, label_dsc->letter_space, label_dsc->line_space, LV_COORD_MAX, LV_TEXT_FLAG_NONE);
/* Set the label draw area at some distance of the major tick */
if((LV_SCALE_MODE_HORIZONTAL_BOTTOM == scale->mode) || (LV_SCALE_MODE_HORIZONTAL_TOP == scale->mode)) {
@@ -1025,11 +1025,11 @@ static void scale_set_line_properties(lv_obj_t * obj, lv_draw_line_dsc_t * line_
{
if(section_style) {
lv_style_value_t value;
- lv_res_t res;
+ lv_result_t res;
/* Line width */
res = lv_style_get_prop(section_style, LV_STYLE_LINE_WIDTH, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
line_dsc->width = (lv_coord_t)value.num;
}
else {
@@ -1038,7 +1038,7 @@ static void scale_set_line_properties(lv_obj_t * obj, lv_draw_line_dsc_t * line_
/* Line color */
res = lv_style_get_prop(section_style, LV_STYLE_LINE_COLOR, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
line_dsc->color = value.color;
}
else {
@@ -1047,7 +1047,7 @@ static void scale_set_line_properties(lv_obj_t * obj, lv_draw_line_dsc_t * line_
/* Line opa */
res = lv_style_get_prop(section_style, LV_STYLE_LINE_OPA, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
line_dsc->opa = (lv_opa_t)value.num;
}
else {
@@ -1074,11 +1074,11 @@ static void scale_set_arc_properties(lv_obj_t * obj, lv_draw_arc_dsc_t * arc_dsc
{
if(section_style) {
lv_style_value_t value;
- lv_res_t res;
+ lv_result_t res;
/* Line width */
res = lv_style_get_prop(section_style, LV_STYLE_ARC_WIDTH, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
arc_dsc->width = (lv_coord_t)value.num;
}
else {
@@ -1087,7 +1087,7 @@ static void scale_set_arc_properties(lv_obj_t * obj, lv_draw_arc_dsc_t * arc_dsc
/* Line color */
res = lv_style_get_prop(section_style, LV_STYLE_ARC_COLOR, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
arc_dsc->color = value.color;
}
else {
@@ -1096,7 +1096,7 @@ static void scale_set_arc_properties(lv_obj_t * obj, lv_draw_arc_dsc_t * arc_dsc
/* Line opa */
res = lv_style_get_prop(section_style, LV_STYLE_ARC_OPA, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
arc_dsc->opa = (lv_opa_t)value.num;
}
else {
@@ -1124,11 +1124,11 @@ static void scale_set_indicator_label_properties(lv_obj_t * obj, lv_draw_label_d
{
if(indicator_section_style) {
lv_style_value_t value;
- lv_res_t res;
+ lv_result_t res;
/* Text color */
res = lv_style_get_prop(indicator_section_style, LV_STYLE_TEXT_COLOR, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
label_dsc->color = value.color;
}
else {
@@ -1137,7 +1137,7 @@ static void scale_set_indicator_label_properties(lv_obj_t * obj, lv_draw_label_d
/* Text opa */
res = lv_style_get_prop(indicator_section_style, LV_STYLE_TEXT_OPA, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
label_dsc->opa = (lv_opa_t)value.num;
}
else {
@@ -1146,7 +1146,7 @@ static void scale_set_indicator_label_properties(lv_obj_t * obj, lv_draw_label_d
/* Text letter space */
res = lv_style_get_prop(indicator_section_style, LV_STYLE_TEXT_LETTER_SPACE, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
label_dsc->letter_space = (lv_coord_t)value.num;
}
else {
@@ -1155,7 +1155,7 @@ static void scale_set_indicator_label_properties(lv_obj_t * obj, lv_draw_label_d
/* Text font */
res = lv_style_get_prop(indicator_section_style, LV_STYLE_TEXT_FONT, &value);
- if(res == LV_RES_OK) {
+ if(res == LV_RESULT_OK) {
label_dsc->font = (const lv_font_t *)value.ptr;
}
else {
diff --git a/src/widgets/slider/lv_slider.c b/src/widgets/slider/lv_slider.c
index 15308c9c75..c1e76c4ef5 100644
--- a/src/widgets/slider/lv_slider.c
+++ b/src/widgets/slider/lv_slider.c
@@ -13,7 +13,7 @@
#include "../../core/lv_group.h"
#include "../../indev/lv_indev.h"
#include "../../indev/lv_indev_private.h"
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
#include "../../draw/lv_draw.h"
#include "../../stdlib/lv_string.h"
#include "../../misc/lv_math.h"
@@ -101,11 +101,11 @@ static void lv_slider_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -192,7 +192,7 @@ static void lv_slider_event(const lv_obj_class_t * class_p, lv_event_t * e)
lv_coord_t knob_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_KNOB);
/*The smaller size is the knob diameter*/
- lv_coord_t zoom = lv_obj_get_style_transform_zoom(obj, LV_PART_KNOB);
+ lv_coord_t zoom = lv_obj_get_style_transform_scale(obj, LV_PART_KNOB);
lv_coord_t trans_w = lv_obj_get_style_transform_width(obj, LV_PART_KNOB);
lv_coord_t trans_h = lv_obj_get_style_transform_height(obj, LV_PART_KNOB);
lv_coord_t knob_size = LV_MIN(lv_obj_get_width(obj) + 2 * trans_w, lv_obj_get_height(obj) + 2 * trans_h) >> 1;
@@ -222,7 +222,7 @@ static void lv_slider_event(const lv_obj_class_t * class_p, lv_event_t * e)
}
res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
else if(code == LV_EVENT_DRAW_MAIN) {
draw_knob(e);
@@ -473,8 +473,8 @@ static void update_knob_pos(lv_obj_t * obj, bool check_drag)
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLL_CHAIN_HOR);
lv_obj_invalidate(obj);
- lv_res_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
- if(res != LV_RES_OK)
+ lv_result_t res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
+ if(res != LV_RESULT_OK)
return;
}
}
diff --git a/src/widgets/span/lv_span.c b/src/widgets/span/lv_span.c
index 2e81932c5c..dd34f46489 100644
--- a/src/widgets/span/lv_span.c
+++ b/src/widgets/span/lv_span.c
@@ -55,9 +55,9 @@ static int32_t lv_span_get_style_text_decor(lv_obj_t * par, lv_span_t * span);
static inline void span_text_check(const char ** text);
static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer);
-static bool lv_txt_get_snippet(const char * txt, const lv_font_t * font, lv_coord_t letter_space,
- lv_coord_t max_width, lv_text_flag_t flag, lv_coord_t * use_width,
- uint32_t * end_ofs);
+static bool lv_text_get_snippet(const char * txt, const lv_font_t * font, lv_coord_t letter_space,
+ lv_coord_t max_width, lv_text_flag_t flag, lv_coord_t * use_width,
+ uint32_t * end_ofs);
static void lv_snippet_clear(void);
static uint16_t lv_get_snippet_cnt(void);
@@ -402,8 +402,8 @@ uint32_t lv_spangroup_get_expand_width(lv_obj_t * obj, uint32_t max_width)
if(max_width > 0 && width >= max_width) {
return max_width;
}
- uint32_t letter = _lv_txt_encoded_next(cur_txt, &j);
- uint32_t letter_next = _lv_txt_encoded_next(&cur_txt[j], NULL);
+ uint32_t letter = _lv_text_encoded_next(cur_txt, &j);
+ uint32_t letter_next = _lv_text_encoded_next(&cur_txt[j], NULL);
uint16_t letter_w = lv_font_get_glyph_width(font, letter, letter_next);
width = width + letter_w + letter_space;
}
@@ -470,8 +470,8 @@ lv_coord_t lv_spangroup_get_expand_height(lv_obj_t * obj, lv_coord_t width)
/* get current span text line info */
uint32_t next_ofs = 0;
lv_coord_t use_width = 0;
- bool isfill = lv_txt_get_snippet(&cur_txt[cur_txt_ofs], snippet.font, snippet.letter_space,
- max_w, txt_flag, &use_width, &next_ofs);
+ bool isfill = lv_text_get_snippet(&cur_txt[cur_txt_ofs], snippet.font, snippet.letter_space,
+ max_w, txt_flag, &use_width, &next_ofs);
/* break word deal width */
if(isfill && next_ofs > 0 && snippet_cnt > 0) {
@@ -480,11 +480,11 @@ lv_coord_t lv_spangroup_get_expand_height(lv_obj_t * obj, lv_coord_t width)
}
uint32_t tmp_ofs = next_ofs;
- uint32_t letter = _lv_txt_encoded_prev(&cur_txt[cur_txt_ofs], &tmp_ofs);
- if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter))) {
+ uint32_t letter = _lv_text_encoded_prev(&cur_txt[cur_txt_ofs], &tmp_ofs);
+ if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_text_is_break_char(letter))) {
tmp_ofs = 0;
- letter = _lv_txt_encoded_next(&cur_txt[cur_txt_ofs + next_ofs], &tmp_ofs);
- if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter))) {
+ letter = _lv_text_encoded_next(&cur_txt[cur_txt_ofs + next_ofs], &tmp_ofs);
+ if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_text_is_break_char(letter))) {
break;
}
}
@@ -558,7 +558,7 @@ static void lv_spangroup_event(const lv_obj_class_t * class_p, lv_event_t * e)
LV_UNUSED(class_p);
/* Call the ancestor's event handler */
- if(lv_obj_event_base(MY_CLASS, e) != LV_RES_OK) return;
+ if(lv_obj_event_base(MY_CLASS, e) != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -621,9 +621,9 @@ static void draw_main(lv_event_t * e)
/**
* @return true for txt fill the max_width.
*/
-static bool lv_txt_get_snippet(const char * txt, const lv_font_t * font,
- lv_coord_t letter_space, lv_coord_t max_width, lv_text_flag_t flag,
- lv_coord_t * use_width, uint32_t * end_ofs)
+static bool lv_text_get_snippet(const char * txt, const lv_font_t * font,
+ lv_coord_t letter_space, lv_coord_t max_width, lv_text_flag_t flag,
+ lv_coord_t * use_width, uint32_t * end_ofs)
{
if(txt == NULL || txt[0] == '\0') {
*end_ofs = 0;
@@ -638,7 +638,7 @@ static bool lv_txt_get_snippet(const char * txt, const lv_font_t * font,
real_max_width++;
#endif
- uint32_t ofs = _lv_txt_get_next_line(txt, font, letter_space, real_max_width, use_width, flag);
+ uint32_t ofs = _lv_text_get_next_line(txt, font, letter_space, real_max_width, use_width, flag);
*end_ofs = ofs;
if(txt[ofs] == '\0' && *use_width < max_width) {
@@ -680,8 +680,8 @@ static const lv_font_t * lv_span_get_style_text_font(lv_obj_t * par, lv_span_t *
{
const lv_font_t * font;
lv_style_value_t value;
- lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_FONT, &value);
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_FONT, &value);
+ if(res != LV_RESULT_OK) {
font = lv_obj_get_style_text_font(par, LV_PART_MAIN);
}
else {
@@ -694,8 +694,8 @@ static lv_coord_t lv_span_get_style_text_letter_space(lv_obj_t * par, lv_span_t
{
lv_coord_t letter_space;
lv_style_value_t value;
- lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_LETTER_SPACE, &value);
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_LETTER_SPACE, &value);
+ if(res != LV_RESULT_OK) {
letter_space = lv_obj_get_style_text_letter_space(par, LV_PART_MAIN);
}
else {
@@ -707,8 +707,8 @@ static lv_coord_t lv_span_get_style_text_letter_space(lv_obj_t * par, lv_span_t
static lv_color_t lv_span_get_style_text_color(lv_obj_t * par, lv_span_t * span)
{
lv_style_value_t value;
- lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_COLOR, &value);
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_COLOR, &value);
+ if(res != LV_RESULT_OK) {
value.color = lv_obj_get_style_text_color(par, LV_PART_MAIN);
}
return value.color;
@@ -718,8 +718,8 @@ static lv_opa_t lv_span_get_style_text_opa(lv_obj_t * par, lv_span_t * span)
{
lv_opa_t opa;
lv_style_value_t value;
- lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_OPA, &value);
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_OPA, &value);
+ if(res != LV_RESULT_OK) {
opa = (lv_opa_t)lv_obj_get_style_text_opa(par, LV_PART_MAIN);
}
else {
@@ -732,8 +732,8 @@ static lv_blend_mode_t lv_span_get_style_text_blend_mode(lv_obj_t * par, lv_span
{
lv_blend_mode_t mode;
lv_style_value_t value;
- lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_BLEND_MODE, &value);
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_style_get_prop(&span->style, LV_STYLE_BLEND_MODE, &value);
+ if(res != LV_RESULT_OK) {
mode = (lv_blend_mode_t)lv_obj_get_style_blend_mode(par, LV_PART_MAIN);
}
else {
@@ -746,8 +746,8 @@ static int32_t lv_span_get_style_text_decor(lv_obj_t * par, lv_span_t * span)
{
int32_t decor;
lv_style_value_t value;
- lv_res_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_DECOR, &value);
- if(res != LV_RES_OK) {
+ lv_result_t res = lv_style_get_prop(&span->style, LV_STYLE_TEXT_DECOR, &value);
+ if(res != LV_RESULT_OK) {
decor = (lv_text_decor_t)lv_obj_get_style_text_decor(par, LV_PART_MAIN);;
}
else {
@@ -862,22 +862,22 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer)
/* get current span text line info */
uint32_t next_ofs = 0;
lv_coord_t use_width = 0;
- bool isfill = lv_txt_get_snippet(&cur_txt[cur_txt_ofs], snippet.font, snippet.letter_space,
- max_w, txt_flag, &use_width, &next_ofs);
+ bool isfill = lv_text_get_snippet(&cur_txt[cur_txt_ofs], snippet.font, snippet.letter_space,
+ max_w, txt_flag, &use_width, &next_ofs);
if(isfill) {
if(next_ofs > 0 && lv_get_snippet_cnt() > 0) {
- /* To prevent infinite loops, the _lv_txt_get_next_line() may return incomplete words, */
+ /* To prevent infinite loops, the _lv_text_get_next_line() may return incomplete words, */
/* This phenomenon should be avoided when lv_get_snippet_cnt() > 0 */
if(max_w < use_width) {
break;
}
uint32_t tmp_ofs = next_ofs;
- uint32_t letter = _lv_txt_encoded_prev(&cur_txt[cur_txt_ofs], &tmp_ofs);
- if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter))) {
+ uint32_t letter = _lv_text_encoded_prev(&cur_txt[cur_txt_ofs], &tmp_ofs);
+ if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_text_is_break_char(letter))) {
tmp_ofs = 0;
- letter = _lv_txt_encoded_next(&cur_txt[cur_txt_ofs + next_ofs], &tmp_ofs);
- if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_txt_is_break_char(letter))) {
+ letter = _lv_text_encoded_next(&cur_txt[cur_txt_ofs + next_ofs], &tmp_ofs);
+ if(!(letter == '\0' || letter == '\n' || letter == '\r' || _lv_text_is_break_char(letter))) {
break;
}
}
@@ -921,8 +921,8 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer)
if(txt_pos.y + max_line_h + next_line_h - line_space > coords.y2 + 1) { /* for overflow if is end line. */
if(last_snippet->txt[last_snippet->bytes] != '\0') {
last_snippet->bytes = lv_strlen(last_snippet->txt);
- last_snippet->txt_w = lv_txt_get_width(last_snippet->txt, last_snippet->bytes, last_snippet->font,
- last_snippet->letter_space);
+ last_snippet->txt_w = lv_text_get_width(last_snippet->txt, last_snippet->bytes, last_snippet->font,
+ last_snippet->letter_space);
}
ellipsis_valid = spans->overflow == LV_SPAN_OVERFLOW_ELLIPSIS;
is_end_line = true;
@@ -986,8 +986,8 @@ static void lv_draw_span(lv_obj_t * obj, lv_layer_t * layer)
if(pos.x > clip_area.x2) {
break;
}
- uint32_t letter = _lv_txt_encoded_next(bidi_txt, &j);
- uint32_t letter_next = _lv_txt_encoded_next(&bidi_txt[j], NULL);
+ uint32_t letter = _lv_text_encoded_next(bidi_txt, &j);
+ uint32_t letter_next = _lv_text_encoded_next(&bidi_txt[j], NULL);
int32_t letter_w = lv_font_get_glyph_width(pinfo->font, letter, letter_next);
/* skip invalid fields */
diff --git a/src/widgets/spinbox/lv_spinbox.c b/src/widgets/spinbox/lv_spinbox.c
index be60e73d95..5c1bc848ea 100644
--- a/src/widgets/spinbox/lv_spinbox.c
+++ b/src/widgets/spinbox/lv_spinbox.c
@@ -364,9 +364,9 @@ static void lv_spinbox_event(const lv_obj_class_t * class_p, lv_event_t * e)
LV_UNUSED(class_p);
/*Call the ancestor's event handler*/
- lv_res_t res = LV_RES_OK;
+ lv_result_t res = LV_RESULT_OK;
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
const lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
diff --git a/src/widgets/switch/lv_switch.c b/src/widgets/switch/lv_switch.c
index c94a7299a0..d93ac2429c 100644
--- a/src/widgets/switch/lv_switch.c
+++ b/src/widgets/switch/lv_switch.c
@@ -14,7 +14,7 @@
#include "../../misc/lv_math.h"
#include "../../misc/lv_anim.h"
#include "../../indev/lv_indev.h"
-#include "../../disp/lv_disp.h"
+#include "../../display/lv_display.h"
/*********************
* DEFINES
@@ -109,11 +109,11 @@ static void lv_switch_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
diff --git a/src/widgets/table/lv_table.c b/src/widgets/table/lv_table.c
index ad4a2a0ee8..9ce7d9454a 100644
--- a/src/widgets/table/lv_table.c
+++ b/src/widgets/table/lv_table.c
@@ -11,8 +11,8 @@
#include "../../indev/lv_indev.h"
#include "../../misc/lv_assert.h"
-#include "../../misc/lv_txt.h"
-#include "../../misc/lv_txt_ap.h"
+#include "../../misc/lv_text.h"
+#include "../../misc/lv_text_ap.h"
#include "../../misc/lv_math.h"
#include "../../stdlib/lv_sprintf.h"
#include "../../draw/lv_draw.h"
@@ -39,7 +39,7 @@ static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_
lv_coord_t cell_left, lv_coord_t cell_right, lv_coord_t cell_top, lv_coord_t cell_bottom);
static void refr_size_form_row(lv_obj_t * obj, uint32_t start_row);
static void refr_cell_size(lv_obj_t * obj, uint32_t row, uint32_t col);
-static lv_res_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col);
+static lv_result_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col);
static size_t get_cell_txt_len(const char * txt);
static void copy_cell_txt(char * dst, const char * txt);
static void get_cell_area(lv_obj_t * obj, uint16_t row, uint16_t col, lv_area_t * area);
@@ -154,14 +154,14 @@ void lv_table_set_cell_value_fmt(lv_obj_t * obj, uint16_t row, uint16_t col, con
lv_vsnprintf(raw_txt, len + 1, fmt, ap2);
/*Get the size of the Arabic text and process it*/
- size_t len_ap = _lv_txt_ap_calc_bytes_cnt(raw_txt);
+ size_t len_ap = _lv_text_ap_calc_bytes_cnt(raw_txt);
table->cell_data[cell] = lv_realloc(table->cell_data[cell], len_ap + 1);
LV_ASSERT_MALLOC(table->cell_data[cell]);
if(table->cell_data[cell] == NULL) {
va_end(ap2);
return;
}
- _lv_txt_ap_proc(raw_txt, &table->cell_data[cell][1]);
+ _lv_text_ap_proc(raw_txt, &table->cell_data[cell][1]);
lv_free(raw_txt);
#else
@@ -457,11 +457,11 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -485,9 +485,9 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e)
else if(code == LV_EVENT_PRESSED || code == LV_EVENT_PRESSING) {
uint16_t col;
uint16_t row;
- lv_res_t pr_res = get_pressed_cell(obj, &row, &col);
+ lv_result_t pr_res = get_pressed_cell(obj, &row, &col);
- if(pr_res == LV_RES_OK && (table->col_act != col || table->row_act != row)) {
+ if(pr_res == LV_RESULT_OK && (table->col_act != col || table->row_act != row)) {
table->col_act = col;
table->row_act = row;
lv_obj_invalidate(obj);
@@ -499,7 +499,7 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e)
lv_obj_t * scroll_obj = lv_indev_get_scroll_obj(indev);
if(table->col_act != LV_TABLE_CELL_NONE && table->row_act != LV_TABLE_CELL_NONE && scroll_obj == NULL) {
res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
lv_indev_type_t indev_type = lv_indev_get_type(lv_indev_get_act());
@@ -566,7 +566,7 @@ static void lv_table_event(const lv_obj_class_t * class_p, lv_event_t * e)
scroll_to_selected_cell(obj);
res = lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
}
}
else if(code == LV_EVENT_DRAW_MAIN) {
@@ -735,9 +735,9 @@ static void draw_main(lv_event_t * e)
bool crop = ctrl & LV_TABLE_CELL_CTRL_TEXT_CROP;
if(crop) txt_flags = LV_TEXT_FLAG_EXPAND;
- lv_txt_get_size(&txt_size, table->cell_data[cell] + 1, label_dsc_def.font,
- label_dsc_act.letter_space, label_dsc_act.line_space,
- lv_area_get_width(&txt_area), txt_flags);
+ lv_text_get_size(&txt_size, table->cell_data[cell] + 1, label_dsc_def.font,
+ label_dsc_act.letter_space, label_dsc_act.line_space,
+ lv_area_get_width(&txt_area), txt_flags);
/*Align the content to the middle if not cropped*/
if(!crop) {
@@ -878,8 +878,8 @@ static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_
lv_point_t txt_size;
txt_w -= cell_left + cell_right;
- lv_txt_get_size(&txt_size, table->cell_data[cell] + 1, font,
- letter_space, line_space, txt_w, LV_TEXT_FLAG_NONE);
+ lv_text_get_size(&txt_size, table->cell_data[cell] + 1, font,
+ letter_space, line_space, txt_w, LV_TEXT_FLAG_NONE);
h_max = LV_MAX(txt_size.y + cell_top + cell_bottom, h_max);
/*Skip until one element after the last merged column*/
@@ -891,7 +891,7 @@ static lv_coord_t get_row_height(lv_obj_t * obj, uint16_t row_id, const lv_font_
return h_max;
}
-static lv_res_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col)
+static lv_result_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col)
{
lv_table_t * table = (lv_table_t *)obj;
@@ -899,7 +899,7 @@ static lv_res_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col)
if(type != LV_INDEV_TYPE_POINTER && type != LV_INDEV_TYPE_BUTTON) {
if(col) *col = LV_TABLE_CELL_NONE;
if(row) *row = LV_TABLE_CELL_NONE;
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
lv_point_t p;
@@ -939,7 +939,7 @@ static lv_res_t get_pressed_cell(lv_obj_t * obj, uint16_t * row, uint16_t * col)
}
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
/* Returns number of bytes to allocate based on chars configuration */
@@ -948,7 +948,7 @@ static size_t get_cell_txt_len(const char * txt)
size_t retval = 0;
#if LV_USE_ARABIC_PERSIAN_CHARS
- retval = _lv_txt_ap_calc_bytes_cnt(txt) + 1;
+ retval = _lv_text_ap_calc_bytes_cnt(txt) + 1;
#else
/* cell_data layout: [ctrl][txt][trailing '\0' terminator]
* +2 because of the trailing '\0' and the ctrl */
@@ -962,7 +962,7 @@ static size_t get_cell_txt_len(const char * txt)
static void copy_cell_txt(char * dst, const char * txt)
{
#if LV_USE_ARABIC_PERSIAN_CHARS
- _lv_txt_ap_proc(txt, &dst[1]);
+ _lv_text_ap_proc(txt, &dst[1]);
#else
lv_strcpy(&dst[1], txt);
#endif
diff --git a/src/widgets/tabview/lv_tabview.c b/src/widgets/tabview/lv_tabview.c
index 8697d74d6b..3535c59dda 100644
--- a/src/widgets/tabview/lv_tabview.c
+++ b/src/widgets/tabview/lv_tabview.c
@@ -294,8 +294,8 @@ static void lv_tabview_destructor(const lv_obj_class_t * class_p, lv_obj_t * obj
static void lv_tabview_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res = lv_obj_event_base(&lv_tabview_class, e);
- if(res != LV_RES_OK) return;
+ lv_result_t res = lv_obj_event_base(&lv_tabview_class, e);
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * target = lv_event_get_target(e);
diff --git a/src/widgets/textarea/lv_textarea.c b/src/widgets/textarea/lv_textarea.c
index 0a12b750a5..7f43329c03 100644
--- a/src/widgets/textarea/lv_textarea.c
+++ b/src/widgets/textarea/lv_textarea.c
@@ -16,7 +16,7 @@
#include "../../draw/lv_draw.h"
#include "../../misc/lv_assert.h"
#include "../../misc/lv_anim.h"
-#include "../../misc/lv_txt.h"
+#include "../../misc/lv_text.h"
#include "../../misc/lv_math.h"
#include "../../stdlib/lv_string.h"
@@ -56,7 +56,7 @@ static bool char_is_accepted(lv_obj_t * obj, uint32_t c);
static void start_cursor_blink(lv_obj_t * obj);
static void refr_cursor_area(lv_obj_t * obj);
static void update_cursor_position_on_click(lv_event_t * e);
-static lv_res_t insert_handler(lv_obj_t * obj, const char * txt);
+static lv_result_t insert_handler(lv_obj_t * obj, const char * txt);
static void draw_placeholder(lv_event_t * e);
static void draw_cursor(lv_event_t * e);
static void auto_hide_characters(lv_obj_t * obj);
@@ -119,10 +119,10 @@ void lv_textarea_add_char(lv_obj_t * obj, uint32_t c)
if(c != 0) while(*letter_buf == 0) ++letter_buf;
#endif
- lv_res_t res = insert_handler(obj, letter_buf);
- if(res != LV_RES_OK) return;
+ lv_result_t res = insert_handler(obj, letter_buf);
+ if(res != LV_RESULT_OK) return;
- uint32_t c_uni = _lv_txt_encoded_next((const char *)&c, NULL);
+ uint32_t c_uni = _lv_text_encoded_next((const char *)&c, NULL);
if(char_is_accepted(obj, c_uni) == false) {
LV_LOG_INFO("Character is not accepted by the text area (too long text or not in the accepted list)");
@@ -147,7 +147,7 @@ void lv_textarea_add_char(lv_obj_t * obj, uint32_t c)
LV_ASSERT_MALLOC(ta->pwd_tmp);
if(ta->pwd_tmp == NULL) return;
- _lv_txt_ins(ta->pwd_tmp, ta->cursor.pos, (const char *)letter_buf);
+ _lv_text_ins(ta->pwd_tmp, ta->cursor.pos, (const char *)letter_buf);
/*Auto hide characters*/
auto_hide_characters(obj);
@@ -172,14 +172,14 @@ void lv_textarea_add_text(lv_obj_t * obj, const char * txt)
if(lv_textarea_get_accepted_chars(obj) || lv_textarea_get_max_length(obj)) {
uint32_t i = 0;
while(txt[i] != '\0') {
- uint32_t c = _lv_txt_encoded_next(txt, &i);
- lv_textarea_add_char(obj, _lv_txt_unicode_to_encoded(c));
+ uint32_t c = _lv_text_encoded_next(txt, &i);
+ lv_textarea_add_char(obj, _lv_text_unicode_to_encoded(c));
}
return;
}
- lv_res_t res = insert_handler(obj, txt);
- if(res != LV_RES_OK) return;
+ lv_result_t res = insert_handler(obj, txt);
+ if(res != LV_RESULT_OK) return;
/*If the textarea is empty, invalidate it to hide the placeholder*/
if(ta->placeholder_txt) {
@@ -197,14 +197,14 @@ void lv_textarea_add_text(lv_obj_t * obj, const char * txt)
LV_ASSERT_MALLOC(ta->pwd_tmp);
if(ta->pwd_tmp == NULL) return;
- _lv_txt_ins(ta->pwd_tmp, ta->cursor.pos, txt);
+ _lv_text_ins(ta->pwd_tmp, ta->cursor.pos, txt);
/*Auto hide characters*/
auto_hide_characters(obj);
}
/*Move the cursor after the new text*/
- lv_textarea_set_cursor_pos(obj, lv_textarea_get_cursor_pos(obj) + _lv_txt_get_encoded_length(txt));
+ lv_textarea_set_cursor_pos(obj, lv_textarea_get_cursor_pos(obj) + _lv_text_get_encoded_length(txt));
lv_obj_send_event(obj, LV_EVENT_VALUE_CHANGED, NULL);
}
@@ -220,13 +220,13 @@ void lv_textarea_del_char(lv_obj_t * obj)
char del_buf[2] = {LV_KEY_DEL, '\0'};
- lv_res_t res = insert_handler(obj, del_buf);
- if(res != LV_RES_OK) return;
+ lv_result_t res = insert_handler(obj, del_buf);
+ if(res != LV_RESULT_OK) return;
char * label_txt = lv_label_get_text(ta->label);
/*Delete a character*/
- _lv_txt_cut(label_txt, ta->cursor.pos - 1, 1);
+ _lv_text_cut(label_txt, ta->cursor.pos - 1, 1);
/*Refresh the label*/
lv_label_set_text(ta->label, label_txt);
@@ -239,7 +239,7 @@ void lv_textarea_del_char(lv_obj_t * obj)
}
if(ta->pwd_mode) {
- _lv_txt_cut(ta->pwd_tmp, ta->cursor.pos - 1, 1);
+ _lv_text_cut(ta->pwd_tmp, ta->cursor.pos - 1, 1);
ta->pwd_tmp = lv_realloc(ta->pwd_tmp, lv_strlen(ta->pwd_tmp) + 1);
LV_ASSERT_MALLOC(ta->pwd_tmp);
@@ -285,8 +285,8 @@ void lv_textarea_set_text(lv_obj_t * obj, const char * txt)
}
uint32_t i = 0;
while(txt[i] != '\0') {
- uint32_t c = _lv_txt_encoded_next(txt, &i);
- lv_textarea_add_char(obj, _lv_txt_unicode_to_encoded(c));
+ uint32_t c = _lv_text_encoded_next(txt, &i);
+ lv_textarea_add_char(obj, _lv_text_unicode_to_encoded(c));
}
}
else {
@@ -348,7 +348,7 @@ void lv_textarea_set_cursor_pos(lv_obj_t * obj, int32_t pos)
lv_textarea_t * ta = (lv_textarea_t *)obj;
if((uint32_t)ta->cursor.pos == (uint32_t)pos) return;
- uint32_t len = _lv_txt_get_encoded_length(lv_label_get_text(ta->label));
+ uint32_t len = _lv_text_get_encoded_length(lv_label_get_text(ta->label));
if(pos < 0) pos = len + pos;
@@ -707,8 +707,8 @@ uint32_t lv_textarea_get_current_char(lv_obj_t * obj)
const char * txt = lv_textarea_get_text(obj);
lv_textarea_t * ta = (lv_textarea_t *)obj;
uint32_t pos = ta->cursor.pos;
- if(_lv_txt_get_encoded_length(txt) >= pos && pos > 0)
- return _lv_txt_encoded_prev(txt, &pos);
+ if(_lv_text_get_encoded_length(txt) >= pos && pos > 0)
+ return _lv_text_encoded_prev(txt, &pos);
else
return 0;
}
@@ -873,10 +873,10 @@ static void lv_textarea_event(const lv_obj_class_t * class_p, lv_event_t * e)
{
LV_UNUSED(class_p);
- lv_res_t res;
+ lv_result_t res;
/*Call the ancestor's event handler*/
res = lv_obj_event_base(MY_CLASS, e);
- if(res != LV_RES_OK) return;
+ if(res != LV_RESULT_OK) return;
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
@@ -991,7 +991,7 @@ static void pwd_char_hider(lv_obj_t * obj)
/* When ta->label is empty we get 0 back */
char * txt = lv_label_get_text(ta->label);
- uint32_t enc_len = _lv_txt_get_encoded_length(txt);
+ uint32_t enc_len = _lv_text_get_encoded_length(txt);
if(enc_len == 0) return;
const char * bullet = lv_textarea_get_password_bullet(obj);
@@ -1021,7 +1021,7 @@ static bool char_is_accepted(lv_obj_t * obj, uint32_t c)
lv_textarea_t * ta = (lv_textarea_t *)obj;
/*Too many characters?*/
- if(ta->max_length > 0 && _lv_txt_get_encoded_length(lv_textarea_get_text(obj)) >= ta->max_length) {
+ if(ta->max_length > 0 && _lv_text_get_encoded_length(lv_textarea_get_text(obj)) >= ta->max_length) {
return false;
}
@@ -1030,7 +1030,7 @@ static bool char_is_accepted(lv_obj_t * obj, uint32_t c)
uint32_t i = 0;
while(ta->accepted_chars[i] != '\0') {
- uint32_t a = _lv_txt_encoded_next(ta->accepted_chars, &i);
+ uint32_t a = _lv_text_encoded_next(ta->accepted_chars, &i);
if(a == c) return true; /*Accepted*/
}
@@ -1069,8 +1069,8 @@ static void refr_cursor_area(lv_obj_t * obj)
uint32_t cur_pos = lv_textarea_get_cursor_pos(obj);
const char * txt = lv_label_get_text(ta->label);
- uint32_t byte_pos = _lv_txt_encoded_get_byte_id(txt, cur_pos);
- uint32_t letter = _lv_txt_encoded_next(&txt[byte_pos], NULL);
+ uint32_t byte_pos = _lv_text_encoded_get_byte_id(txt, cur_pos);
+ uint32_t letter = _lv_text_encoded_next(&txt[byte_pos], NULL);
/* Letter height and width */
const lv_coord_t letter_h = lv_font_get_line_height(font);
@@ -1094,8 +1094,8 @@ static void refr_cursor_area(lv_obj_t * obj)
letter_pos.y += letter_h + line_space;
if(letter != '\0') {
- byte_pos += _lv_txt_encoded_size(&txt[byte_pos]);
- letter = _lv_txt_encoded_next(&txt[byte_pos], NULL);
+ byte_pos += _lv_text_encoded_size(&txt[byte_pos]);
+ letter = _lv_text_encoded_next(&txt[byte_pos], NULL);
}
uint32_t tmp = letter;
@@ -1256,26 +1256,26 @@ static void update_cursor_position_on_click(lv_event_t * e)
#endif
}
-/* Returns LV_RES_OK when no operation were performed
- * Returns LV_RES_INV when a user defined text was inserted */
-static lv_res_t insert_handler(lv_obj_t * obj, const char * txt)
+/* Returns LV_RESULT_OK when no operation were performed
+ * Returns LV_RESULT_INVALID when a user defined text was inserted */
+static lv_result_t insert_handler(lv_obj_t * obj, const char * txt)
{
ta_insert_replace = NULL;
lv_obj_send_event(obj, LV_EVENT_INSERT, (char *)txt);
/* Drop txt if insert replace is set to '\0' */
if(ta_insert_replace && ta_insert_replace[0] == '\0')
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
if(ta_insert_replace) {
/*Add the replaced text directly it's different from the original*/
if(strcmp(ta_insert_replace, txt)) {
lv_textarea_add_text(obj, ta_insert_replace);
- return LV_RES_INV;
+ return LV_RESULT_INVALID;
}
}
- return LV_RES_OK;
+ return LV_RESULT_OK;
}
static void draw_placeholder(lv_event_t * e)
@@ -1333,7 +1333,7 @@ static void draw_cursor(lv_event_t * e)
lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_CURSOR) + border_width;
lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_CURSOR) + border_width;
char letter_buf[8] = {0};
- lv_memcpy(letter_buf, &txt[ta->cursor.txt_byte_pos], _lv_txt_encoded_size(&txt[ta->cursor.txt_byte_pos]));
+ lv_memcpy(letter_buf, &txt[ta->cursor.txt_byte_pos], _lv_text_encoded_size(&txt[ta->cursor.txt_byte_pos]));
cur_area.x1 += left;
cur_area.y1 += top;
diff --git a/src/widgets/textarea/lv_textarea.h b/src/widgets/textarea/lv_textarea.h
index 73aecd7f6d..cbffa8c72a 100644
--- a/src/widgets/textarea/lv_textarea.h
+++ b/src/widgets/textarea/lv_textarea.h
@@ -86,7 +86,7 @@ lv_obj_t * lv_textarea_create(lv_obj_t * parent);
/**
* Insert a character to the current cursor position.
- * To add a wide char, e.g. 'Á' use `_lv_txt_encoded_conv_wc('Á')`
+ * To add a wide char, e.g. 'Á' use `_lv_text_encoded_conv_wc('Á')`
* @param obj pointer to a text area object
* @param c a character (e.g. 'a')
*/
diff --git a/src/widgets/win/lv_win.c b/src/widgets/win/lv_win.c
index 640df1d716..4f848f3031 100644
--- a/src/widgets/win/lv_win.c
+++ b/src/widgets/win/lv_win.c
@@ -94,7 +94,7 @@ static void lv_win_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj)
lv_obj_set_flex_flow(obj, LV_FLEX_FLOW_COLUMN);
lv_obj_t * header = lv_obj_create(obj);
- lv_obj_set_size(header, LV_PCT(100), lv_disp_get_dpi(lv_obj_get_disp(obj)) / 2);
+ lv_obj_set_size(header, LV_PCT(100), lv_display_get_dpi(lv_obj_get_disp(obj)) / 2);
lv_obj_set_flex_flow(header, LV_FLEX_FLOW_ROW);
lv_obj_set_flex_align(header, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
diff --git a/tests/src/lv_test_init.c b/tests/src/lv_test_init.c
index 82400be0f0..99ea2ea946 100644
--- a/tests/src/lv_test_init.c
+++ b/tests/src/lv_test_init.c
@@ -10,7 +10,7 @@
#define VER_RES 480
static void hal_init(void);
-static void dummy_flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * color_p);
+static void dummy_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p);
uint8_t * last_flushed_buf;
lv_indev_t * lv_test_mouse_indev;
@@ -33,9 +33,9 @@ static void hal_init(void)
{
static lv_color32_t test_fb[HOR_RES * VER_RES];
- lv_disp_t * disp = lv_disp_create(HOR_RES, VER_RES);
- lv_disp_set_draw_buffers(disp, test_fb, NULL, HOR_RES * VER_RES, LV_DISP_RENDER_MODE_DIRECT);
- lv_disp_set_flush_cb(disp, dummy_flush_cb);
+ lv_display_t * disp = lv_display_create(HOR_RES, VER_RES);
+ lv_display_set_draw_buffers(disp, test_fb, NULL, HOR_RES * VER_RES, LV_DISPLAY_RENDER_MODE_DIRECT);
+ lv_display_set_flush_cb(disp, dummy_flush_cb);
lv_test_mouse_indev = lv_indev_create();
lv_indev_set_type(lv_test_mouse_indev, LV_INDEV_TYPE_POINTER);
@@ -51,12 +51,12 @@ static void hal_init(void)
}
-static void dummy_flush_cb(lv_disp_t * disp, const lv_area_t * area, uint8_t * color_p)
+static void dummy_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * color_p)
{
LV_UNUSED(area);
LV_UNUSED(color_p);
last_flushed_buf = color_p;
- lv_disp_flush_ready(disp);
+ lv_display_flush_ready(disp);
}
void lv_test_assert_fail(void)
diff --git a/tests/src/test_cases/draw/test_clip_corner.c b/tests/src/test_cases/draw/test_clip_corner.c
index 6eee38b020..6fd87fe723 100644
--- a/tests/src/test_cases/draw/test_clip_corner.c
+++ b/tests/src/test_cases/draw/test_clip_corner.c
@@ -19,7 +19,7 @@ static lv_obj_t * create_panel(lv_coord_t radius, bool transform)
lv_obj_set_style_pad_all(parent, 3, 0);
lv_obj_set_style_radius(parent, radius, 0);
lv_obj_set_style_clip_corner(parent, true, 0);
- if(transform) lv_obj_set_style_transform_angle(parent, 300, 0);
+ if(transform) lv_obj_set_style_transform_rotation(parent, 300, 0);
lv_obj_t * label = lv_label_create(parent);
diff --git a/tests/src/test_cases/draw/test_draw_layer.c b/tests/src/test_cases/draw/test_draw_layer.c
index f1bfe622a1..5f5d580d3d 100644
--- a/tests/src/test_cases/draw/test_draw_layer.c
+++ b/tests/src/test_cases/draw/test_draw_layer.c
@@ -57,18 +57,18 @@ void test_layer_mixed_rgb(void)
lv_obj_set_style_blend_mode(obj, LV_BLEND_MODE_SUBTRACTIVE, 0);
obj = create_test_obj("angle = 30°", true);
- lv_obj_set_style_transform_angle(obj, 300, 0);
+ lv_obj_set_style_transform_rotation(obj, 300, 0);
lv_obj_add_flag(obj, LV_OBJ_FLAG_FLEX_IN_NEW_TRACK);
obj = create_test_obj("Zoom = 120%", true);
- lv_obj_set_style_transform_zoom(obj, 307, 0);
+ lv_obj_set_style_transform_scale(obj, 307, 0);
obj = create_test_obj("Zoom = 70%", true);
- lv_obj_set_style_transform_zoom(obj, 180, 0);
+ lv_obj_set_style_transform_scale(obj, 180, 0);
obj = create_test_obj("Zoom = 70%\nAngle = 70°", true);
- lv_obj_set_style_transform_zoom(obj, 180, 0);
- lv_obj_set_style_transform_angle(obj, 700, 0);
+ lv_obj_set_style_transform_scale(obj, 180, 0);
+ lv_obj_set_style_transform_rotation(obj, 700, 0);
TEST_ASSERT_EQUAL_SCREENSHOT("draw/layer_mixed_rgb.png");
}
@@ -92,18 +92,18 @@ void test_layer_mixed_argb(void)
lv_obj_set_style_blend_mode(obj, LV_BLEND_MODE_SUBTRACTIVE, 0);
obj = create_test_obj("angle = 30°", false);
- lv_obj_set_style_transform_angle(obj, 300, 0);
+ lv_obj_set_style_transform_rotation(obj, 300, 0);
lv_obj_add_flag(obj, LV_OBJ_FLAG_FLEX_IN_NEW_TRACK);
obj = create_test_obj("Zoom = 120%", false);
- lv_obj_set_style_transform_zoom(obj, 307, 0);
+ lv_obj_set_style_transform_scale(obj, 307, 0);
obj = create_test_obj("Zoom = 70%", false);
- lv_obj_set_style_transform_zoom(obj, 180, 0);
+ lv_obj_set_style_transform_scale(obj, 180, 0);
obj = create_test_obj("Zoom = 70%\nAngle = 70°", false);
- lv_obj_set_style_transform_zoom(obj, 180, 0);
- lv_obj_set_style_transform_angle(obj, 700, 0);
+ lv_obj_set_style_transform_scale(obj, 180, 0);
+ lv_obj_set_style_transform_rotation(obj, 700, 0);
TEST_ASSERT_EQUAL_SCREENSHOT("draw/layer_mixed_argb.png");
}
@@ -136,8 +136,8 @@ void test_layer_large_transform(void)
obj = create_test_obj(lorem_ipsum, false);
lv_obj_set_width(lv_obj_get_child(obj, 0), lv_pct(100));
lv_obj_set_size(obj, 200, 150);
- lv_obj_set_style_transform_zoom(obj, 200, 0);
- lv_obj_set_style_transform_angle(obj, 200, 0);
+ lv_obj_set_style_transform_scale(obj, 200, 0);
+ lv_obj_set_style_transform_rotation(obj, 200, 0);
TEST_ASSERT_EQUAL_SCREENSHOT("draw/layer_large_transform.png");
}
diff --git a/tests/src/test_cases/draw/test_draw_transform.c b/tests/src/test_cases/draw/test_draw_transform.c
index 39a39c7ddd..a5c45dfa54 100644
--- a/tests/src/test_cases/draw/test_draw_transform.c
+++ b/tests/src/test_cases/draw/test_draw_transform.c
@@ -58,24 +58,24 @@ static void draw_images(lv_layer_t * layer, lv_draw_image_dsc_t * dsc)
lv_draw_image(layer, dsc, &area);
lv_area_move(&area, 110, 0);
- dsc->angle = 900;
+ dsc->rotation = 900;
lv_draw_image(layer, dsc, &area);
lv_area_move(&area, 110, 0);
- dsc->angle = 1800;
+ dsc->rotation = 1800;
lv_draw_image(layer, dsc, &area);
lv_area_move(&area, 110, 0);
- dsc->angle = -900;
+ dsc->rotation = -900;
lv_draw_image(layer, dsc, &area);
lv_area_move(&area, 150, 0);
- dsc->angle = 300;
+ dsc->rotation = 300;
lv_draw_image(layer, dsc, &area);
dsc->pivot.x = 0;
dsc->pivot.y = 0;
- dsc->angle = 300;
+ dsc->rotation = 300;
lv_area_move(&area, 150, 0);
lv_draw_image(layer, dsc, &area);
@@ -86,7 +86,7 @@ static void draw_images(lv_layer_t * layer, lv_draw_image_dsc_t * dsc)
area.y2 = 249;
dsc->pivot.x = 50;
dsc->pivot.y = 50;
- dsc->angle = 0;
+ dsc->rotation = 0;
dsc->zoom = 128;
lv_draw_image(layer, dsc, &area);
@@ -105,7 +105,7 @@ static void draw_images(lv_layer_t * layer, lv_draw_image_dsc_t * dsc)
lv_draw_image(layer, dsc, &area);
/* Zoom + Angle*/
- dsc->angle = 650;
+ dsc->rotation = 650;
dsc->zoom = 200;
lv_area_move(&area, 200, 0);
lv_draw_image(layer, dsc, &area);
@@ -126,22 +126,22 @@ static void draw_images(lv_layer_t * layer, lv_draw_image_dsc_t * dsc)
area.y2 = 409;
dsc->pivot.x = 50;
dsc->pivot.y = 50;
- dsc->angle = 0;
+ dsc->rotation = 0;
dsc->zoom = 256;
lv_draw_image(layer, dsc, &area);
lv_area_move(&area, 180, 0);
- dsc->angle = 300;
+ dsc->rotation = 300;
dsc->zoom = 200;
lv_draw_image(layer, dsc, &area);
lv_area_move(&area, 150, 0);
- dsc->angle = 1400;
+ dsc->rotation = 1400;
dsc->zoom = 150;
lv_draw_image(layer, dsc, &area);
lv_area_move(&area, 120, 0);
- dsc->angle = 2000;
+ dsc->rotation = 2000;
dsc->zoom = 100;
lv_draw_image(layer, dsc, &area);
}
diff --git a/tests/src/test_cases/libs/test_barcode.c b/tests/src/test_cases/libs/test_barcode.c
index b1ba546765..1eb036de8e 100644
--- a/tests/src/test_cases/libs/test_barcode.c
+++ b/tests/src/test_cases/libs/test_barcode.c
@@ -37,8 +37,8 @@ void test_barcode_normal(void)
TEST_ASSERT_EQUAL_COLOR(lv_barcode_get_light_color(barcode), light_color);
TEST_ASSERT_EQUAL(lv_barcode_get_scale(barcode), scale);
- lv_res_t res = lv_barcode_update(barcode, "https://lvgl.io");
- TEST_ASSERT_EQUAL(res, LV_RES_OK);
+ lv_result_t res = lv_barcode_update(barcode, "https://lvgl.io");
+ TEST_ASSERT_EQUAL(res, LV_RESULT_OK);
TEST_ASSERT_EQUAL_SCREENSHOT("barcode_1.png");
}
diff --git a/tests/src/test_cases/test_config.c b/tests/src/test_cases/test_config.c
index 13672de5b5..78a5d39704 100644
--- a/tests/src/test_cases/test_config.c
+++ b/tests/src/test_cases/test_config.c
@@ -8,11 +8,11 @@ void test_config(void);
void test_config(void)
{
TEST_ASSERT_EQUAL(130, LV_DPI_DEF);
- TEST_ASSERT_EQUAL(130, lv_disp_get_dpi(NULL));
+ TEST_ASSERT_EQUAL(130, lv_display_get_dpi(NULL));
TEST_ASSERT_EQUAL(800, LV_HOR_RES);
- TEST_ASSERT_EQUAL(800, lv_disp_get_hor_res(NULL));
+ TEST_ASSERT_EQUAL(800, lv_display_get_horizontal_resolution(NULL));
TEST_ASSERT_EQUAL(480, LV_VER_RES);
- TEST_ASSERT_EQUAL(480, lv_disp_get_ver_res(NULL));
+ TEST_ASSERT_EQUAL(480, lv_display_get_vertical_resolution(NULL));
TEST_ASSERT_EQUAL(32, LV_COLOR_DEPTH);
}
diff --git a/tests/src/test_cases/test_obj_flags.c b/tests/src/test_cases/test_obj_flags.c
index 4552ed6bcc..08013d0e35 100644
--- a/tests/src/test_cases/test_obj_flags.c
+++ b/tests/src/test_cases/test_obj_flags.c
@@ -98,23 +98,23 @@ void test_obj_flag_overflow_visible_1(void)
TEST_ASSERT_EQUAL_SCREENSHOT("obj_flag_overflow_visible_1_3.png");
/*Test with rotation*/
- lv_obj_set_style_transform_angle(obj_main, 300, 0);
+ lv_obj_set_style_transform_rotation(obj_main, 300, 0);
lv_obj_set_style_transform_pivot_x(obj_main, 200, 0);
lv_obj_set_style_transform_pivot_y(obj_main, 150, 0);
- lv_obj_set_style_transform_angle(obj_child_1, 300, 0);
+ lv_obj_set_style_transform_rotation(obj_child_1, 300, 0);
lv_obj_set_style_transform_pivot_x(obj_child_1, 100, 0);
lv_obj_set_style_transform_pivot_y(obj_child_1, 100, 0);
- lv_obj_set_style_transform_angle(obj_child_2, 300, 0);
+ lv_obj_set_style_transform_rotation(obj_child_2, 300, 0);
lv_obj_set_style_transform_pivot_x(obj_child_2, 100, 0);
lv_obj_set_style_transform_pivot_y(obj_child_2, 100, 0);
- lv_obj_set_style_transform_angle(btn_1, 300, 0);
+ lv_obj_set_style_transform_rotation(btn_1, 300, 0);
lv_obj_set_style_transform_pivot_x(btn_1, 100, 0);
lv_obj_set_style_transform_pivot_y(btn_1, 100, 0);
- lv_obj_set_style_transform_angle(btn_2, 300, 0);
+ lv_obj_set_style_transform_rotation(btn_2, 300, 0);
lv_obj_set_style_transform_pivot_x(btn_2, 100, 0);
lv_obj_set_style_transform_pivot_y(btn_2, 100, 0);
diff --git a/tests/src/test_cases/test_txt.c b/tests/src/test_cases/test_txt.c
index 51917289e5..6cff9727ae 100644
--- a/tests/src/test_cases/test_txt.c
+++ b/tests/src/test_cases/test_txt.c
@@ -12,7 +12,7 @@ void test_txt_should_insert_string_into_another(void)
strcpy(target, msg);
- _lv_txt_ins(target, msg_len, suffix);
+ _lv_text_ins(target, msg_len, suffix);
TEST_ASSERT_EQUAL_STRING("Hello World", target);
}
@@ -25,21 +25,21 @@ void test_txt_should_handle_null_pointers_when_inserting(void)
strcpy(target, msg);
- _lv_txt_ins(target, msg_len, NULL);
+ _lv_text_ins(target, msg_len, NULL);
TEST_ASSERT_EQUAL_STRING("Hello ", target);
}
void test_txt_cut_should_handle_null_pointer_to_txt(void)
{
- _lv_txt_cut(NULL, 0, 6);
+ _lv_text_cut(NULL, 0, 6);
}
void test_txt_cut_happy_path(void)
{
char msg[] = "Hello World";
- _lv_txt_cut(msg, 0, 6);
+ _lv_text_cut(msg, 0, 6);
TEST_ASSERT_EQUAL_STRING("World", msg);
}
@@ -48,7 +48,7 @@ void test_txt_cut_should_handle_len_longer_than_string_length(void)
{
char msg[] = "Hello World";
- _lv_txt_cut(msg, 0, 30);
+ _lv_text_cut(msg, 0, 30);
TEST_ASSERT_EQUAL_UINT8(msg[0], 0x00);
}
@@ -58,7 +58,7 @@ void test_txt_get_encoded_next_should_decode_valid_ascii(void)
char msg[] = "Hello World!";
uint32_t result = 0;
- result = _lv_txt_encoded_next(msg, NULL);
+ result = _lv_text_encoded_next(msg, NULL);
TEST_ASSERT_EQUAL_UINT32((uint32_t) 'H', result);
}
@@ -68,7 +68,7 @@ void test_txt_get_encoded_next_detect_valid_2_byte_input(void)
char msg[] = "\xc3\xb1";
uint32_t result = 0;
- result = _lv_txt_encoded_next(msg, NULL);
+ result = _lv_text_encoded_next(msg, NULL);
TEST_ASSERT_EQUAL_UINT32(241, result);
}
@@ -78,7 +78,7 @@ void test_txt_get_encoded_next_detect_invalid_2_byte_input(void)
char msg[] = "\xc3\x28";
uint32_t result = 0;
- result = _lv_txt_encoded_next(msg, NULL);
+ result = _lv_text_encoded_next(msg, NULL);
TEST_ASSERT_EQUAL_UINT32(0, result);
}
@@ -88,7 +88,7 @@ void test_txt_get_encoded_next_detect_valid_3_byte_input(void)
char msg[] = "\xe2\x82\xa1";
uint32_t result = 0;
- result = _lv_txt_encoded_next(msg, NULL);
+ result = _lv_text_encoded_next(msg, NULL);
TEST_ASSERT_EQUAL_UINT32(8353, result);
}
@@ -98,7 +98,7 @@ void test_txt_get_encoded_next_detect_invalid_3_byte_input(void)
char msg[] = "\xe2\x28\xa1";
uint32_t result = 0;
- result = _lv_txt_encoded_next(msg, NULL);
+ result = _lv_text_encoded_next(msg, NULL);
TEST_ASSERT_EQUAL_UINT32(0, result);
}
@@ -108,7 +108,7 @@ void test_txt_get_encoded_next_detect_valid_4_byte_input(void)
char msg[] = "\xf0\x90\x8c\xbc";
uint32_t result = 0;
- result = _lv_txt_encoded_next(msg, NULL);
+ result = _lv_text_encoded_next(msg, NULL);
TEST_ASSERT_EQUAL_UINT32(66364, result);
}
@@ -118,7 +118,7 @@ void test_txt_get_encoded_next_detect_invalid_4_byte_input(void)
char msg[] = "\xf0\x28\x8c\x28";
uint32_t result = 0;
- result = _lv_txt_encoded_next(msg, NULL);
+ result = _lv_text_encoded_next(msg, NULL);
TEST_ASSERT_EQUAL_UINT32(0, result);
}
@@ -131,7 +131,7 @@ void test_txt_next_line_should_handle_empty_string(void)
lv_coord_t max_width = 0;
lv_text_flag_t flag = LV_TEXT_FLAG_NONE;
- uint32_t next_line = _lv_txt_get_next_line("", font_ptr, letter_space, max_width, NULL, flag);
+ uint32_t next_line = _lv_text_get_next_line("", font_ptr, letter_space, max_width, NULL, flag);
TEST_ASSERT_EQUAL_UINT32(0, next_line);
}
diff --git a/tests/src/test_cases/widgets/test_calendar.c b/tests/src/test_cases/widgets/test_calendar.c
index 5384f47617..f61c5425ee 100644
--- a/tests/src/test_cases/widgets/test_calendar.c
+++ b/tests/src/test_cases/widgets/test_calendar.c
@@ -196,9 +196,9 @@ void test_calendar_get_pressed_date_null(void)
lv_calendar_date_t pressed_date;
- lv_res_t result = lv_calendar_get_pressed_date(calendar, &pressed_date);
+ lv_result_t result = lv_calendar_get_pressed_date(calendar, &pressed_date);
- TEST_ASSERT_EQUAL(result, LV_RES_INV);
+ TEST_ASSERT_EQUAL(result, LV_RESULT_INVALID);
}
void test_calendar_get_btnmatrix(void)
diff --git a/tests/src/test_cases/widgets/test_chart.c b/tests/src/test_cases/widgets/test_chart.c
index ac38a5f052..103efc2b23 100644
--- a/tests/src/test_cases/widgets/test_chart.c
+++ b/tests/src/test_cases/widgets/test_chart.c
@@ -107,13 +107,13 @@ void test_chart_one_point_when_setting_point_count_to_zero(void)
void test_chart_set_zoom_y_to_none_when_factor_is_less_than_256(void)
{
lv_chart_set_zoom_y(chart, 128);
- TEST_ASSERT_EQUAL(LV_ZOOM_NONE, lv_chart_get_zoom_y(chart));
+ TEST_ASSERT_EQUAL(LV_SCALE_NONE, lv_chart_get_zoom_y(chart));
}
void test_chart_set_zoom_x_to_none_when_factor_is_less_than_256(void)
{
lv_chart_set_zoom_x(chart, 128);
- TEST_ASSERT_EQUAL(LV_ZOOM_NONE, lv_chart_get_zoom_x(chart));
+ TEST_ASSERT_EQUAL(LV_SCALE_NONE, lv_chart_get_zoom_x(chart));
}
#endif
diff --git a/tests/src/test_cases/widgets/test_win.c b/tests/src/test_cases/widgets/test_win.c
index 604560d6d2..252ed2c348 100644
--- a/tests/src/test_cases/widgets/test_win.c
+++ b/tests/src/test_cases/widgets/test_win.c
@@ -39,7 +39,7 @@ void test_win_should_have_valid_documented_defualt_values(void)
TEST_ASSERT_EQUAL(content, lv_obj_get_child(win, 1));
// Check that the header is correctly sized and empty
- TEST_ASSERT_EQUAL(lv_disp_get_dpi(lv_obj_get_disp(win)) / 2, lv_obj_get_height(header));
+ TEST_ASSERT_EQUAL(lv_display_get_dpi(lv_obj_get_disp(win)) / 2, lv_obj_get_height(header));
TEST_ASSERT_EQUAL(0, lv_obj_get_child_cnt(header));
// Check that the content is empty