ci: upgrade astyle tool (#4776)
Install from source to use the latest version
This commit is contained in:
12
.github/workflows/check_style.yml
vendored
12
.github/workflows/check_style.yml
vendored
@@ -13,11 +13,17 @@ jobs:
|
||||
with:
|
||||
persist-credentials: false
|
||||
fetch-depth: 0
|
||||
- name: Checkout astyle
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: szepeviktor/astyle
|
||||
path: astyle
|
||||
- name: Install astyle
|
||||
run: |
|
||||
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
|
||||
sudo apt-get update -y -qq
|
||||
sudo apt-get install astyle
|
||||
cd astyle/build/gcc/
|
||||
make
|
||||
sudo make install
|
||||
astyle --version
|
||||
- name: Format code
|
||||
run: python code-format.py
|
||||
working-directory: scripts
|
||||
|
||||
@@ -141,7 +141,6 @@ static void rotated_argb_image_cb(void)
|
||||
lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
lv_obj_set_style_pad_row(lv_screen_active(), 20, 0);
|
||||
|
||||
|
||||
LV_IMG_DECLARE(img_benchmark_cogwheel_argb);
|
||||
uint32_t hor_cnt = (lv_display_get_horizontal_resolution(NULL) - 16) / 116;
|
||||
uint32_t ver_cnt = (lv_display_get_vertical_resolution(NULL) - 116) / 116;
|
||||
@@ -233,7 +232,6 @@ static void multiple_arcs_cb(void)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void containers_cb(void)
|
||||
{
|
||||
|
||||
@@ -416,7 +414,6 @@ void lv_demo_benchmark(void)
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
static void load_scene(uint32_t scene)
|
||||
{
|
||||
lv_obj_t * scr = lv_screen_active();
|
||||
@@ -429,7 +426,6 @@ static void load_scene(uint32_t scene)
|
||||
lv_obj_set_layout(scr, LV_LAYOUT_NONE);
|
||||
lv_obj_set_flex_align(lv_screen_active(), LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
|
||||
|
||||
lv_anim_delete(scr, scroll_anim_y_cb);
|
||||
lv_anim_delete(scr, shake_anim_y_cb);
|
||||
lv_anim_delete(scr, color_anim_cb);
|
||||
@@ -441,8 +437,6 @@ static void load_scene(uint32_t scene)
|
||||
if(scenes[scene].create_cb) scenes[scene].create_cb();
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void next_scene_timer_cb(lv_timer_t * timer)
|
||||
{
|
||||
LV_UNUSED(timer);
|
||||
@@ -477,7 +471,6 @@ static void sysmon_perf_observer_cb(lv_subject_t * subject, lv_observer_t * obse
|
||||
* SCENE HELPERS
|
||||
*----------------*/
|
||||
|
||||
|
||||
static void color_anim_cb(void * var, int32_t v)
|
||||
{
|
||||
LV_UNUSED(v);
|
||||
@@ -558,7 +551,6 @@ static void shake_anim(lv_obj_t * obj, int32_t y_max)
|
||||
lv_anim_start(&a);
|
||||
}
|
||||
|
||||
|
||||
static lv_obj_t * card_create(void)
|
||||
{
|
||||
lv_obj_t * panel = lv_obj_create(lv_screen_active());
|
||||
@@ -586,8 +578,6 @@ static lv_obj_t * card_create(void)
|
||||
child = lv_label_create(child);
|
||||
lv_label_set_text(child, "Connect");
|
||||
|
||||
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#define SPINBOX_EVENT_ATTACH(item) \
|
||||
lv_obj_add_event(ui->ctrl_pad.tab.layout.spinbox_##item, ctrl_pad_spinbox_event_handler, LV_EVENT_VALUE_CHANGED, ui);
|
||||
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
@@ -226,7 +226,6 @@ static lv_obj_t * add_list_button(lv_obj_t * parent, uint32_t track_id)
|
||||
return btn;
|
||||
}
|
||||
|
||||
|
||||
static void btn_click_event_cb(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * btn = lv_event_get_target(e);
|
||||
@@ -252,4 +251,3 @@ static void list_delete_event_cb(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
#endif /*LV_USE_DEMO_MUSIC*/
|
||||
|
||||
|
||||
@@ -1000,7 +1000,6 @@ static void next_click_event_cb(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void timer_cb(lv_timer_t * t)
|
||||
{
|
||||
LV_UNUSED(t);
|
||||
@@ -1015,7 +1014,6 @@ static void spectrum_end_cb(lv_anim_t * a)
|
||||
_lv_demo_music_album_next(true);
|
||||
}
|
||||
|
||||
|
||||
static void stop_start_anim(lv_timer_t * t)
|
||||
{
|
||||
LV_UNUSED(t);
|
||||
@@ -1028,4 +1026,3 @@ static void album_fade_anim_cb(void * var, int32_t v)
|
||||
lv_obj_set_style_image_opa(var, v, 0);
|
||||
}
|
||||
#endif /*LV_USE_DEMO_MUSIC*/
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ void _lv_demo_music_album_next(bool next);
|
||||
**********************/
|
||||
#endif /*LV_USE_DEMO_MUSIC*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
@@ -274,7 +274,6 @@ static void box_shadow_cb(lv_obj_t * parent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static lv_obj_t * text_obj_create(lv_obj_t * parent, int32_t col, int32_t row)
|
||||
{
|
||||
|
||||
@@ -311,7 +310,6 @@ static void text_cb(lv_obj_t * parent)
|
||||
obj = text_obj_create(parent, 3, 5);
|
||||
lv_obj_set_style_text_decor(obj, LV_TEXT_DECOR_UNDERLINE | LV_TEXT_DECOR_STRIKETHROUGH, 0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
static lv_obj_t * image_obj_create(lv_obj_t * parent, int32_t col, int32_t row, bool recolor)
|
||||
@@ -395,7 +393,6 @@ static void image_core_cb(lv_obj_t * parent, bool recolor)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void image_normal_cb(lv_obj_t * parent)
|
||||
{
|
||||
image_core_cb(parent, false);
|
||||
@@ -406,7 +403,6 @@ static void image_recolored_cb(lv_obj_t * parent)
|
||||
image_core_cb(parent, true);
|
||||
}
|
||||
|
||||
|
||||
static lv_obj_t * line_obj_create(lv_obj_t * parent, int32_t col, int32_t row, lv_point_precise_t p[])
|
||||
{
|
||||
lv_obj_t * obj = lv_line_create(parent);
|
||||
@@ -537,7 +533,6 @@ static void triangle_draw_event_cb(lv_event_t * e)
|
||||
lv_draw_triangle(lv_event_get_layer(e), &dsc);
|
||||
}
|
||||
|
||||
|
||||
static lv_obj_t * triangle_obj_create(lv_obj_t * parent, int32_t col, int32_t row, lv_point_t p[])
|
||||
{
|
||||
lv_obj_t * obj = lv_arc_create(parent);
|
||||
@@ -612,7 +607,6 @@ static void triangle_cb(lv_obj_t * parent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static lv_obj_t * layer_obj_create(lv_obj_t * parent, int32_t col, int32_t row, lv_blend_mode_t blend_mode)
|
||||
{
|
||||
lv_obj_t * obj = lv_obj_create(parent);
|
||||
@@ -761,7 +755,6 @@ void lv_demo_render(lv_demo_render_scene_t id, lv_opa_t opa)
|
||||
if(scenes[id].create_cb) scenes[id].create_cb(main_parent);
|
||||
}
|
||||
|
||||
|
||||
const char * lv_demo_render_get_scene_name(lv_demo_render_scene_t id)
|
||||
{
|
||||
if(id > _LV_DEMO_RENDER_SCENE_NUM) return NULL;
|
||||
|
||||
@@ -65,7 +65,6 @@ void lv_demo_scroll(void)
|
||||
switch_create(panel, "Elastic scroll", LV_OBJ_FLAG_SCROLL_ELASTIC, true);
|
||||
switch_create(panel, "Add scroll momentum", LV_OBJ_FLAG_SCROLL_MOMENTUM, true);
|
||||
|
||||
|
||||
/*Show the switches first*/
|
||||
lv_obj_move_foreground(list);
|
||||
|
||||
|
||||
@@ -88,7 +88,6 @@ static void obj_test_task_cb(lv_timer_t * tmr)
|
||||
lv_obj_set_size(main_page, LV_HOR_RES / 2, LV_VER_RES);
|
||||
lv_obj_set_flex_flow(main_page, LV_FLEX_FLOW_COLUMN);
|
||||
|
||||
|
||||
obj = lv_button_create(main_page);
|
||||
lv_obj_set_size(obj, 100, 70);
|
||||
obj = lv_label_create(obj);
|
||||
|
||||
@@ -211,7 +211,6 @@ void lv_demo_widgets(void)
|
||||
color_changer_create(tv);
|
||||
}
|
||||
|
||||
|
||||
void lv_demo_widgets_start_slideshow(void)
|
||||
{
|
||||
lv_obj_update_layout(tv);
|
||||
@@ -378,7 +377,6 @@ static void profile_create(lv_obj_t * parent)
|
||||
LV_GRID_TEMPLATE_LAST
|
||||
};
|
||||
|
||||
|
||||
lv_obj_set_grid_dsc_array(parent, grid_main_col_dsc, grid_main_row_dsc);
|
||||
|
||||
lv_obj_set_grid_cell(panel1, LV_GRID_ALIGN_STRETCH, 0, 2, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||
@@ -406,7 +404,6 @@ static void profile_create(lv_obj_t * parent)
|
||||
lv_obj_set_grid_cell(gender, LV_GRID_ALIGN_STRETCH, 0, 1, LV_GRID_ALIGN_CENTER, 6, 1);
|
||||
lv_obj_set_grid_cell(gender_label, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 5, 1);
|
||||
|
||||
|
||||
lv_obj_set_grid_cell(panel3, LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_STRETCH, 1, 1);
|
||||
lv_obj_set_grid_dsc_array(panel3, grid_2_col_dsc, grid_2_row_dsc);
|
||||
lv_obj_set_grid_cell(panel3_title, LV_GRID_ALIGN_START, 0, 2, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||
@@ -421,7 +418,6 @@ static void profile_create(lv_obj_t * parent)
|
||||
static int32_t grid_main_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
|
||||
static int32_t grid_main_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
|
||||
|
||||
|
||||
/*Create the top panel*/
|
||||
static int32_t grid_1_col_dsc[] = {LV_GRID_CONTENT, 1, LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
|
||||
static int32_t grid_1_row_dsc[] = {
|
||||
@@ -449,7 +445,6 @@ static void profile_create(lv_obj_t * parent)
|
||||
LV_GRID_TEMPLATE_LAST
|
||||
};
|
||||
|
||||
|
||||
lv_obj_set_grid_dsc_array(parent, grid_main_col_dsc, grid_main_row_dsc);
|
||||
lv_obj_set_grid_cell(panel1, LV_GRID_ALIGN_STRETCH, 0, 2, LV_GRID_ALIGN_CENTER, 0, 1);
|
||||
|
||||
@@ -494,7 +489,6 @@ static void profile_create(lv_obj_t * parent)
|
||||
static int32_t grid_main_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
|
||||
lv_obj_set_grid_dsc_array(parent, grid_main_col_dsc, grid_main_row_dsc);
|
||||
|
||||
|
||||
/*Create the top panel*/
|
||||
static int32_t grid_1_col_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
|
||||
static int32_t grid_1_row_dsc[] = {LV_GRID_CONTENT, /*Avatar*/
|
||||
@@ -509,7 +503,6 @@ static void profile_create(lv_obj_t * parent)
|
||||
|
||||
lv_obj_set_grid_dsc_array(panel1, grid_1_col_dsc, grid_1_row_dsc);
|
||||
|
||||
|
||||
static int32_t grid_2_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
|
||||
static int32_t grid_2_row_dsc[] = {
|
||||
LV_GRID_CONTENT, /*Title*/
|
||||
@@ -564,7 +557,6 @@ static void profile_create(lv_obj_t * parent)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static lv_obj_t * create_chart_with_scales(lv_obj_t * parent, const char * title, const char * hor_text[])
|
||||
{
|
||||
static const int32_t col_dsc[] = {40, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
|
||||
@@ -625,7 +617,6 @@ static void analytics_create(lv_obj_t * parent)
|
||||
lv_obj_set_style_max_height(chart1_cont, 300, 0);
|
||||
lv_obj_set_flex_grow(chart1_cont, 1);
|
||||
|
||||
|
||||
static const char * chart1_texts[] = {"Jan", "Feb", "March", "April", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec", NULL};
|
||||
chart1 = create_chart_with_scales(chart1_cont, "Unique visitors", chart1_texts);
|
||||
|
||||
@@ -641,7 +632,6 @@ static void analytics_create(lv_obj_t * parent)
|
||||
lv_obj_set_flex_grow(chart2_cont, 1);
|
||||
lv_obj_add_flag(chart2_cont, LV_OBJ_FLAG_FLEX_IN_NEW_TRACK);
|
||||
|
||||
|
||||
static const char * chart2_texts[] = {"I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII", NULL};
|
||||
chart2 = create_chart_with_scales(chart2_cont, "Monthly revenue", chart2_texts);
|
||||
lv_chart_set_type(chart2, LV_CHART_TYPE_BAR);
|
||||
@@ -925,7 +915,6 @@ void shop_create(lv_obj_t * parent)
|
||||
lv_obj_set_size(chart3, lv_pct(100), lv_pct(100));
|
||||
lv_obj_set_style_pad_column(chart3, LV_DPX(30), 0);
|
||||
|
||||
|
||||
lv_obj_set_grid_dsc_array(panel1, grid1_col_dsc, grid1_row_dsc);
|
||||
lv_obj_set_grid_cell(title, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 0, 1);
|
||||
lv_obj_set_grid_cell(date, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 1, 1);
|
||||
@@ -1041,7 +1030,6 @@ void shop_create(lv_obj_t * parent)
|
||||
cb = lv_checkbox_create(notifications);
|
||||
lv_checkbox_set_text(cb, "Out of stock");
|
||||
|
||||
|
||||
}
|
||||
|
||||
static void color_changer_create(lv_obj_t * parent)
|
||||
@@ -1549,13 +1537,11 @@ static void chart_event_cb(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void shop_chart_event_cb(lv_event_t * e)
|
||||
{
|
||||
LV_UNUSED(e);
|
||||
}
|
||||
|
||||
|
||||
static void scale1_indic1_anim_cb(void * var, int32_t v)
|
||||
{
|
||||
lv_arc_set_value(var, v);
|
||||
@@ -1573,7 +1559,6 @@ static void scale2_timer_cb(lv_timer_t * timer)
|
||||
static bool down2 = false;
|
||||
static bool down3 = false;
|
||||
|
||||
|
||||
if(down1) {
|
||||
session_desktop -= 137;
|
||||
if(session_desktop < 1400) down1 = false;
|
||||
|
||||
@@ -43,7 +43,6 @@ void lv_example_anim_1(void)
|
||||
lv_label_set_text(label, "Hello animations!");
|
||||
lv_obj_set_pos(label, 100, 10);
|
||||
|
||||
|
||||
lv_obj_t * sw = lv_switch_create(lv_screen_active());
|
||||
lv_obj_center(sw);
|
||||
lv_obj_add_state(sw, LV_STATE_CHECKED);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../lv_examples.h"
|
||||
#if LV_BUILD_EXAMPLES && LV_USE_SWITCH
|
||||
|
||||
|
||||
static void anim_x_cb(void * var, int32_t v)
|
||||
{
|
||||
lv_obj_set_x(var, v);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
/**
|
||||
* Demonstrate cell placement and span
|
||||
*/
|
||||
|
||||
@@ -9,7 +9,6 @@ void lv_example_grid_4(void)
|
||||
static int32_t col_dsc[] = {60, 60, 60, LV_GRID_TEMPLATE_LAST};
|
||||
static int32_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST};
|
||||
|
||||
|
||||
/*Add space between the columns and move the rows to the bottom (end)*/
|
||||
|
||||
/*Create a container with grid*/
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#if LV_BUILD_EXAMPLES
|
||||
#if LV_USE_FFMPEG
|
||||
|
||||
|
||||
/**
|
||||
* Open an image from a file
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include "../../../lvgl.h"
|
||||
|
||||
|
||||
#ifndef LV_ATTRIBUTE_MEM_ALIGN
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../../lvgl.h"
|
||||
#if LV_USE_LODEPNG && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
#ifndef LV_ATTRIBUTE_MEM_ALIGN
|
||||
#define LV_ATTRIBUTE_MEM_ALIGN
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,6 @@ void lv_example_tiny_ttf_3(void)
|
||||
lv_obj_align_to(slider_label, slider, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
|
||||
lv_label_bind_text(slider_label, &subject_font, "%d");
|
||||
|
||||
|
||||
/*Create a label with the new style*/
|
||||
lv_obj_t * label = lv_label_create(lv_screen_active());
|
||||
lv_obj_add_style(label, &style, 0);
|
||||
@@ -40,7 +39,6 @@ void lv_example_tiny_ttf_3(void)
|
||||
lv_label_set_text(label, "Hello world!");
|
||||
lv_obj_center(label);
|
||||
|
||||
|
||||
lv_subject_add_observer(&subject_font, font_size_observer_cb, &style);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ static void exch_table_item(lv_obj_t * tb, int16_t i, int16_t j)
|
||||
lv_table_set_cell_value(tb, j, 1, lv_table_get_cell_value(tb, 0, 2));
|
||||
}
|
||||
|
||||
|
||||
/*Quick sort 3 way*/
|
||||
static void sort_by_file_kind(lv_obj_t * tb, int16_t lo, int16_t hi)
|
||||
{
|
||||
@@ -43,7 +42,6 @@ static void sort_by_file_kind(lv_obj_t * tb, int16_t lo, int16_t hi)
|
||||
sort_by_file_kind(tb, gt + 1, hi);
|
||||
}
|
||||
|
||||
|
||||
static void file_explorer_event_handler(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
|
||||
@@ -37,7 +37,6 @@ void lv_example_fragment_1(void)
|
||||
lv_fragment_manager_replace(manager, fragment, &root);
|
||||
}
|
||||
|
||||
|
||||
static void sample_fragment_ctor(lv_fragment_t * self, void * args)
|
||||
{
|
||||
((struct sample_fragment_t *) self)->name = args;
|
||||
|
||||
@@ -66,7 +66,6 @@ void lv_example_fragment_2(void)
|
||||
lv_obj_add_event(pop_btn, sample_pop_click, LV_EVENT_CLICKED, manager);
|
||||
}
|
||||
|
||||
|
||||
static void sample_fragment_ctor(lv_fragment_t * self, void * args)
|
||||
{
|
||||
LV_UNUSED(args);
|
||||
|
||||
@@ -16,7 +16,6 @@ void lv_example_gridnav_2(void)
|
||||
lv_obj_set_style_bg_color(list1, lv_palette_lighten(LV_PALETTE_BLUE, 5), LV_STATE_FOCUSED);
|
||||
lv_group_add_obj(lv_group_get_default(), list1);
|
||||
|
||||
|
||||
char buf[32];
|
||||
uint32_t i;
|
||||
for(i = 0; i < 15; i++) {
|
||||
|
||||
@@ -46,7 +46,6 @@ void lv_example_gridnav_3(void)
|
||||
label = lv_label_create(btn);
|
||||
lv_label_set_text(label, "Button 2");
|
||||
|
||||
|
||||
/*Create an other container with long text to show how LV_GRIDNAV_CTRL_SCROLL_FIRST works*/
|
||||
lv_obj_t * cont_sub1 = lv_obj_create(cont_main);
|
||||
lv_obj_set_size(cont_sub1, lv_pct(100), 100);
|
||||
@@ -93,9 +92,6 @@ void lv_example_gridnav_3(void)
|
||||
label = lv_label_create(btn);
|
||||
lv_label_set_text(label, "Button 4");
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_GRIDNAV && LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
static void event_handler(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
|
||||
@@ -21,5 +21,4 @@ void lv_example_observer_1(void)
|
||||
lv_label_bind_text(label, &temperature_subject, "%d °C");
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,7 +18,6 @@ void lv_example_observer_2(void)
|
||||
ui_init();
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------------
|
||||
* APPLICATION
|
||||
*
|
||||
|
||||
@@ -60,14 +60,12 @@ void lv_example_observer_3(void)
|
||||
lv_obj_t * set_label = lv_label_create(set_btn);
|
||||
lv_label_set_text(set_label, "Set");
|
||||
|
||||
|
||||
/*Update some subjects to see if the UI is updated as well*/
|
||||
lv_subject_set_int(&hour_subject, 9);
|
||||
lv_subject_set_int(&minute_subject, 30);
|
||||
lv_subject_set_int(&am_pm_subject, TIME_PM);
|
||||
}
|
||||
|
||||
|
||||
static void set_btn_clicked_event_cb(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * set_btn = lv_event_get_target(e);
|
||||
|
||||
@@ -149,7 +149,6 @@ static void cont_observer_cb(lv_subject_t * subject, lv_observer_t * observer)
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void btn_create(lv_obj_t * parent, const char * text)
|
||||
{
|
||||
lv_obj_t * btn = lv_button_create(parent);
|
||||
|
||||
@@ -6,7 +6,6 @@ typedef enum {
|
||||
THEME_MODE_DARK,
|
||||
} theme_mode_t;
|
||||
|
||||
|
||||
static lv_obj_t * my_panel_create(lv_obj_t * parent);
|
||||
static lv_obj_t * my_button_create(lv_obj_t * parent, const char * text, lv_event_cb_t event_cb);
|
||||
static void switch_theme_event_cb(lv_event_t * e);
|
||||
@@ -45,7 +44,6 @@ static void switch_theme_event_cb(lv_event_t * e)
|
||||
else lv_subject_set_int(&theme_subject, THEME_MODE_LIGHT);
|
||||
}
|
||||
|
||||
|
||||
/*-----------------------------------------
|
||||
* my_panel.c
|
||||
*
|
||||
|
||||
@@ -80,7 +80,6 @@ void lv_port_indev_init(void)
|
||||
* You should shape them according to your hardware
|
||||
*/
|
||||
|
||||
|
||||
/*------------------
|
||||
* Touchpad
|
||||
* -----------------*/
|
||||
@@ -122,7 +121,6 @@ void lv_port_indev_init(void)
|
||||
lv_indev_set_type(indev_keypad, LV_INDEV_TYPE_KEYPAD);
|
||||
lv_indev_set_read_cb(indev_keypad, keypad_read);
|
||||
|
||||
|
||||
/*Later you should create group(s) with `lv_group_t * group = lv_group_create()`,
|
||||
*add objects to the group with `lv_group_add_obj(group, obj)`
|
||||
*and assign this input device to group to navigate in it:
|
||||
|
||||
@@ -32,7 +32,6 @@ void lv_example_scroll_4(void);
|
||||
void lv_example_scroll_5(void);
|
||||
void lv_example_scroll_6(void);
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../lv_examples.h"
|
||||
#if LV_BUILD_EXAMPLES && LV_USE_LIST
|
||||
|
||||
|
||||
/**
|
||||
* Styling the scrollbars
|
||||
*/
|
||||
@@ -28,7 +27,6 @@ void lv_example_scroll_4(void)
|
||||
"Fusce molestie rhoncus nisi sit amet tincidunt. \n"
|
||||
"Suspendisse a nunc ut magna ornare volutpat.");
|
||||
|
||||
|
||||
/*Remove the style of scrollbar to have clean start*/
|
||||
lv_obj_remove_style(obj, NULL, LV_PART_SCROLLBAR | LV_STATE_ANY);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../lv_examples.h"
|
||||
#if LV_BUILD_EXAMPLES && LV_FONT_DEJAVU_16_PERSIAN_HEBREW
|
||||
|
||||
|
||||
/**
|
||||
* Scrolling with Right To Left base direction
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../lv_examples.h"
|
||||
#if LV_BUILD_EXAMPLES && LV_USE_IMG
|
||||
|
||||
|
||||
static lv_style_t style_btn;
|
||||
|
||||
/*Will be called when the styles of the base theme are already added
|
||||
@@ -36,8 +35,6 @@ static void new_theme_init_and_set(void)
|
||||
lv_display_set_theme(NULL, &th_new);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Extending the current theme
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "../lv_examples.h"
|
||||
#if LV_BUILD_EXAMPLES && LV_USE_BTN && LV_USE_LABEL
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Opacity and Transformations
|
||||
*/
|
||||
|
||||
@@ -30,8 +30,6 @@ void lv_example_arc_2(void)
|
||||
lv_anim_set_values(&a, 0, 100);
|
||||
lv_anim_start(&a);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -36,5 +36,4 @@ void lv_example_bar_3(void)
|
||||
lv_anim_start(&a);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,7 +8,6 @@ void lv_example_bar_5(void)
|
||||
{
|
||||
lv_obj_t * label;
|
||||
|
||||
|
||||
lv_obj_t * bar_ltr = lv_bar_create(lv_screen_active());
|
||||
lv_obj_set_size(bar_ltr, 200, 20);
|
||||
lv_bar_set_value(bar_ltr, 70, LV_ANIM_OFF);
|
||||
|
||||
@@ -8,7 +8,6 @@ void lv_example_bar_7(void)
|
||||
{
|
||||
lv_obj_t * label;
|
||||
|
||||
|
||||
lv_obj_t * bar_tob = lv_bar_create(lv_screen_active());
|
||||
lv_obj_set_size(bar_tob, 20, 200);
|
||||
lv_bar_set_range(bar_tob, 100, 0);
|
||||
|
||||
@@ -13,7 +13,6 @@ static void event_handler(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static const char * btnm_map[] = {"1", "2", "3", "4", "5", "\n",
|
||||
"6", "7", "8", "9", "0", "\n",
|
||||
"Action1", "Action2", ""
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
static void event_cb(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
|
||||
@@ -34,7 +34,6 @@ void lv_example_buttonmatrix_3(void)
|
||||
lv_style_set_radius(&style_bg, LV_RADIUS_CIRCLE);
|
||||
lv_style_set_border_width(&style_bg, 0);
|
||||
|
||||
|
||||
static lv_style_t style_btn;
|
||||
lv_style_init(&style_btn);
|
||||
lv_style_set_radius(&style_btn, 0);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_CANVAS && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
#define CANVAS_WIDTH 200
|
||||
#define CANVAS_HEIGHT 150
|
||||
|
||||
@@ -35,14 +34,12 @@ void lv_example_canvas_1(void)
|
||||
lv_obj_center(canvas);
|
||||
lv_canvas_fill_bg(canvas, lv_palette_lighten(LV_PALETTE_GREY, 3), LV_OPA_COVER);
|
||||
|
||||
|
||||
lv_layer_t layer;
|
||||
lv_canvas_init_layer(canvas, &layer);
|
||||
|
||||
lv_area_t coords_rect = {30, 20, 100, 70};
|
||||
lv_draw_rect(&layer, &rect_dsc, &coords_rect);
|
||||
|
||||
|
||||
lv_area_t coords_text = {40, 80, 100, 120};
|
||||
lv_draw_label(&layer, &label_dsc, &coords_text);
|
||||
|
||||
|
||||
@@ -35,6 +35,5 @@ void lv_example_canvas_7(void)
|
||||
|
||||
lv_canvas_finish_layer(canvas, &layer);
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_CHART && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
static void event_cb(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
|
||||
@@ -19,7 +19,6 @@ static void draw_event_cb(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Recolor the bars of a chart based on their value
|
||||
*/
|
||||
|
||||
@@ -54,7 +54,6 @@ static void add_faded_area(lv_event_t * e)
|
||||
lv_draw_task_t * draw_task = lv_event_get_draw_task(e);
|
||||
lv_draw_dsc_base_t * base_dsc = draw_task->draw_dsc;
|
||||
|
||||
|
||||
const lv_chart_series_t * ser = lv_chart_get_series_next(obj, NULL);
|
||||
|
||||
/*Draw a triangle below the line witch some opacity gradient*/
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_CHART && LV_DRAW_SW_COMPLEX && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
static void add_data(lv_timer_t * t)
|
||||
{
|
||||
lv_obj_t * chart = t->user_data;
|
||||
|
||||
@@ -24,7 +24,6 @@ static void radio_event_handler(lv_event_t * e)
|
||||
LV_LOG_USER("Selected radio buttons: %d, %d", (int)active_index_1, (int)active_index_2);
|
||||
}
|
||||
|
||||
|
||||
static void radiobutton_create(lv_obj_t * parent, const char * txt)
|
||||
{
|
||||
lv_obj_t * obj = lv_checkbox_create(parent);
|
||||
@@ -44,7 +43,6 @@ void lv_example_checkbox_2(void)
|
||||
* A variable is passed as event user data where the index of the active
|
||||
* radiobutton is saved */
|
||||
|
||||
|
||||
lv_style_init(&style_radio);
|
||||
lv_style_set_radius(&style_radio, LV_RADIUS_CIRCLE);
|
||||
|
||||
@@ -82,5 +80,4 @@ void lv_example_checkbox_2(void)
|
||||
lv_obj_add_state(lv_obj_get_child(cont2, 0), LV_STATE_CHECKED);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
/**
|
||||
* Create a drop down, up, left and right menus
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_IMG && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
void lv_example_image_1(void)
|
||||
{
|
||||
LV_IMAGE_DECLARE(img_cogwheel_argb);
|
||||
|
||||
@@ -7,7 +7,6 @@ static void slider_event_cb(lv_event_t * e);
|
||||
static lv_obj_t * red_slider, * green_slider, * blue_slider, * intense_slider;
|
||||
static lv_obj_t * img1;
|
||||
|
||||
|
||||
/**
|
||||
* Demonstrate runtime image re-coloring
|
||||
*/
|
||||
|
||||
@@ -11,7 +11,6 @@ static void set_zoom(void * img, int32_t v)
|
||||
lv_image_set_zoom(img, v);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show transformations (zoom and rotation) using a pivot point.
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_LIST && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ static void drag_event_handler(lv_event_t * e)
|
||||
lv_obj_set_pos(obj, x, y);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Make an object draggable.
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_SLIDER && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Show how to style a slider.
|
||||
*/
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
|
||||
static lv_obj_t * spinbox;
|
||||
|
||||
|
||||
static void lv_spinbox_increment_event_cb(lv_event_t * e)
|
||||
{
|
||||
lv_event_code_t code = lv_event_get_code(e);
|
||||
@@ -20,7 +19,6 @@ static void lv_spinbox_decrement_event_cb(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lv_example_spinbox_1(void)
|
||||
{
|
||||
spinbox = lv_spinbox_create(lv_screen_active());
|
||||
|
||||
@@ -41,7 +41,6 @@ static void draw_event_cb(lv_event_t * e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lv_example_table_1(void)
|
||||
{
|
||||
lv_obj_t * table = lv_table_create(lv_screen_active());
|
||||
|
||||
@@ -54,7 +54,6 @@ static void change_event_cb(lv_event_t * e)
|
||||
else lv_table_add_cell_ctrl(obj, row, 0, LV_TABLE_CELL_CTRL_CUSTOM_1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A very light-weighted list created from table
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,6 @@ void lv_example_tabview_2(void)
|
||||
lv_obj_set_style_text_color(tab_buttons, lv_palette_lighten(LV_PALETTE_GREY, 5), 0);
|
||||
lv_obj_set_style_border_side(tab_buttons, LV_BORDER_SIDE_RIGHT, LV_PART_ITEMS | LV_STATE_CHECKED);
|
||||
|
||||
|
||||
/*Add 3 tabs (the tabs are page (lv_page) and can be scrolled*/
|
||||
lv_obj_t * tab1 = lv_tabview_add_tab(tabview, "Tab 1");
|
||||
lv_obj_t * tab2 = lv_tabview_add_tab(tabview, "Tab 2");
|
||||
|
||||
@@ -29,7 +29,6 @@ void lv_example_textarea_2(void)
|
||||
lv_obj_add_event(text_ta, ta_event_cb, LV_EVENT_ALL, NULL);
|
||||
lv_obj_align(text_ta, LV_ALIGN_TOP_RIGHT, -5, 20);
|
||||
|
||||
|
||||
/*Create a label and position it above the text box*/
|
||||
lv_obj_t * oneline_label = lv_label_create(lv_screen_active());
|
||||
lv_label_set_text(oneline_label, "Text:");
|
||||
|
||||
@@ -16,7 +16,6 @@ void lv_example_tileview_1(void)
|
||||
lv_label_set_text(label, "Scroll down");
|
||||
lv_obj_center(label);
|
||||
|
||||
|
||||
/*Tile2: a button*/
|
||||
lv_obj_t * tile2 = lv_tileview_add_tile(tv, 0, 1, LV_DIR_TOP | LV_DIR_RIGHT);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_WIN && LV_BUILD_EXAMPLES
|
||||
|
||||
|
||||
static void event_handler(lv_event_t * e)
|
||||
{
|
||||
lv_obj_t * obj = lv_event_get_target(e);
|
||||
@@ -40,7 +39,6 @@ void lv_example_win_1(void)
|
||||
"sure it\n"
|
||||
"overflows. :)");
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -194,7 +194,6 @@ typedef struct _lv_global_t {
|
||||
void * user_data;
|
||||
} lv_global_t;
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
@@ -46,8 +46,6 @@ typedef _lv_key_t lv_key_t;
|
||||
typedef uint8_t lv_key_t;
|
||||
#endif /*DOXYGEN*/
|
||||
|
||||
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -81,7 +79,6 @@ typedef struct _lv_group_t {
|
||||
of list.*/
|
||||
} lv_group_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
LV_GROUP_REFOCUS_POLICY_NEXT = 0,
|
||||
LV_GROUP_REFOCUS_POLICY_PREV = 1
|
||||
@@ -200,7 +197,6 @@ void lv_group_set_focus_cb(lv_group_t * group, lv_group_focus_cb_t focus_cb);
|
||||
*/
|
||||
void lv_group_set_edge_cb(lv_group_t * group, lv_group_edge_cb_t edge_cb);
|
||||
|
||||
|
||||
/**
|
||||
* Set whether the next or previous item in a group is focused if the currently focused obj is
|
||||
* deleted.
|
||||
|
||||
@@ -725,7 +725,6 @@ static void update_obj_state(lv_obj_t * obj, lv_state_t new_state)
|
||||
|
||||
obj->state = new_state;
|
||||
|
||||
|
||||
_lv_obj_style_transition_dsc_t * ts = lv_malloc_zeroed(sizeof(_lv_obj_style_transition_dsc_t) * STYLE_TRANSITION_MAX);
|
||||
uint32_t tsi = 0;
|
||||
uint32_t i;
|
||||
|
||||
@@ -256,7 +256,6 @@ typedef struct _lv_obj_t {
|
||||
*/
|
||||
lv_obj_t * lv_obj_create(lv_obj_t * parent);
|
||||
|
||||
|
||||
/*=====================
|
||||
* Setter functions
|
||||
*====================*/
|
||||
@@ -467,7 +466,6 @@ void lv_objid_builtin_destroy(void);
|
||||
# define LV_TRACE_OBJ_CREATE(...)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
@@ -179,7 +179,6 @@ static void lv_obj_construct(const lv_obj_class_t * class_p, lv_obj_t * obj)
|
||||
obj->class_p = original_class_p;
|
||||
}
|
||||
|
||||
|
||||
if(obj->class_p->constructor_cb) obj->class_p->constructor_cb(class_p, obj);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ extern "C" {
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -104,7 +103,6 @@ bool lv_obj_is_group_def(struct _lv_obj_t * obj);
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
@@ -67,7 +67,6 @@ void lv_obj_init_draw_label_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_l
|
||||
*/
|
||||
void lv_obj_init_draw_image_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_image_dsc_t * draw_dsc);
|
||||
|
||||
|
||||
/**
|
||||
* Initialize a line draw descriptor from an object's styles in its current state
|
||||
* @param obj pointer to an object
|
||||
@@ -108,7 +107,6 @@ void lv_obj_refresh_ext_draw_size(struct _lv_obj_t * obj);
|
||||
*/
|
||||
int32_t _lv_obj_get_ext_draw_size(const struct _lv_obj_t * obj);
|
||||
|
||||
|
||||
lv_layer_type_t _lv_obj_get_layer_type(const struct _lv_obj_t * obj);
|
||||
|
||||
/**********************
|
||||
|
||||
@@ -69,7 +69,6 @@ lv_result_t lv_obj_send_event(lv_obj_t * obj, lv_event_code_t event_code, void *
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
lv_result_t lv_obj_event_base(const lv_obj_class_t * class_p, lv_event_t * e)
|
||||
{
|
||||
const lv_obj_class_t * base;
|
||||
@@ -109,7 +108,6 @@ uint32_t lv_obj_get_event_count(lv_obj_t * obj)
|
||||
return lv_event_get_count(&obj->spec_attr->event_list);
|
||||
}
|
||||
|
||||
|
||||
lv_event_dsc_t * lv_obj_get_event_dsc(lv_obj_t * obj, uint32_t index)
|
||||
{
|
||||
LV_ASSERT_NULL(obj);
|
||||
@@ -151,7 +149,6 @@ lv_obj_t * lv_event_get_target_obj(lv_event_t * e)
|
||||
return lv_event_get_target(e);
|
||||
}
|
||||
|
||||
|
||||
lv_indev_t * lv_event_get_indev(lv_event_t * e)
|
||||
{
|
||||
|
||||
@@ -337,7 +334,6 @@ static lv_result_t event_send_core(lv_event_t * e)
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
static bool event_is_bubbled(lv_event_t * e)
|
||||
{
|
||||
if(e->stop_bubbling) return false;
|
||||
|
||||
@@ -40,7 +40,6 @@ typedef struct {
|
||||
bool res; /**< true: `point` can click the object; false: it cannot*/
|
||||
} lv_hit_test_info_t;
|
||||
|
||||
|
||||
/** Cover check results.*/
|
||||
typedef enum {
|
||||
LV_COVER_RES_COVER = 0,
|
||||
|
||||
@@ -527,7 +527,6 @@ int32_t lv_obj_get_y_aligned(const lv_obj_t * obj)
|
||||
return lv_obj_get_style_y(obj, LV_PART_MAIN);
|
||||
}
|
||||
|
||||
|
||||
int32_t lv_obj_get_width(const lv_obj_t * obj)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
@@ -602,7 +601,6 @@ void lv_obj_refr_pos(lv_obj_t * obj)
|
||||
{
|
||||
if(lv_obj_is_layout_positioned(obj)) return;
|
||||
|
||||
|
||||
lv_obj_t * parent = lv_obj_get_parent(obj);
|
||||
int32_t x = lv_obj_get_style_x(obj, LV_PART_MAIN);
|
||||
int32_t y = lv_obj_get_style_y(obj, LV_PART_MAIN);
|
||||
@@ -797,7 +795,6 @@ void lv_obj_get_transformed_area(const lv_obj_t * obj, lv_area_t * area, bool re
|
||||
area->y2 = LV_MAX4(p[0].y, p[1].y, p[2].y, p[3].y);
|
||||
}
|
||||
|
||||
|
||||
void lv_obj_invalidate_area(const lv_obj_t * obj, const lv_area_t * area)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
@@ -941,8 +938,6 @@ int32_t lv_clamp_height(int32_t height, int32_t min_height, int32_t max_height,
|
||||
return LV_CLAMP(min_height, height, max_height);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
@@ -186,7 +186,6 @@ static inline void lv_obj_center(struct _lv_obj_t * obj)
|
||||
lv_obj_align(obj, LV_ALIGN_CENTER, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Copy the coordinates of an object to an area
|
||||
* @param obj pointer to an object
|
||||
@@ -330,7 +329,6 @@ void lv_obj_refr_pos(struct _lv_obj_t * obj);
|
||||
|
||||
void lv_obj_move_to(struct _lv_obj_t * obj, int32_t x, int32_t y);
|
||||
|
||||
|
||||
void lv_obj_move_children_by(struct _lv_obj_t * obj, int32_t x_diff, int32_t y_diff, bool ignore_floating);
|
||||
|
||||
/**
|
||||
|
||||
@@ -301,7 +301,6 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_en
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void lv_obj_scroll_by(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en)
|
||||
{
|
||||
if(dx == 0 && dy == 0) return;
|
||||
@@ -427,7 +426,6 @@ lv_result_t _lv_obj_scroll_by_raw(lv_obj_t * obj, int32_t x, int32_t y)
|
||||
return LV_RESULT_OK;
|
||||
}
|
||||
|
||||
|
||||
bool lv_obj_is_scrolling(const lv_obj_t * obj)
|
||||
{
|
||||
lv_indev_t * indev = lv_indev_get_next(NULL);
|
||||
@@ -482,7 +480,6 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
|
||||
ver_draw = true;
|
||||
}
|
||||
|
||||
|
||||
bool hor_draw = false;
|
||||
if((dir & LV_DIR_HOR) &&
|
||||
((sm == LV_SCROLLBAR_MODE_ON) ||
|
||||
@@ -670,7 +667,6 @@ void lv_obj_readjust_scroll(lv_obj_t * obj, lv_anim_enable_t anim_en)
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
static void scroll_x_anim(void * obj, int32_t v)
|
||||
{
|
||||
_lv_obj_scroll_by_raw(obj, v + lv_obj_get_scroll_x(obj), 0);
|
||||
|
||||
@@ -258,7 +258,6 @@ void lv_obj_scroll_to_view(struct _lv_obj_t * obj, lv_anim_enable_t anim_en);
|
||||
*/
|
||||
void lv_obj_scroll_to_view_recursive(struct _lv_obj_t * obj, lv_anim_enable_t anim_en);
|
||||
|
||||
|
||||
/**
|
||||
* Low level function to scroll by given x and y coordinates.
|
||||
* `LV_EVENT_SCROLL` is sent.
|
||||
|
||||
@@ -124,7 +124,6 @@ void lv_obj_add_style(lv_obj_t * obj, const lv_style_t * style, lv_style_selecto
|
||||
obj->styles[i].style = style;
|
||||
obj->styles[i].selector = selector;
|
||||
|
||||
|
||||
#if LV_OBJ_STYLE_CACHE
|
||||
uint32_t * prop_is_set = part == LV_PART_MAIN ? &obj->style_main_prop_is_set : &obj->style_other_prop_is_set;
|
||||
if(lv_style_is_const(style)) {
|
||||
@@ -318,7 +317,6 @@ void lv_obj_enable_style_refresh(bool en)
|
||||
style_refr = en;
|
||||
}
|
||||
|
||||
|
||||
static inline lv_style_value_t lv_style_prop_get_default_inlined(lv_style_prop_t prop)
|
||||
{
|
||||
const lv_color_t black = LV_COLOR_MAKE(0x00, 0x00, 0x00);
|
||||
@@ -383,7 +381,6 @@ static inline lv_style_value_t lv_style_prop_get_default_inlined(lv_style_prop_t
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
lv_style_value_t lv_obj_get_style_prop(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop)
|
||||
{
|
||||
LV_ASSERT_NULL(obj)
|
||||
@@ -471,7 +468,6 @@ void lv_obj_set_local_style_prop(lv_obj_t * obj, lv_style_prop_t prop, lv_style_
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
lv_obj_refresh_style(obj, selector, prop);
|
||||
}
|
||||
|
||||
@@ -568,7 +564,6 @@ void _lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t
|
||||
lv_anim_start(&a);
|
||||
}
|
||||
|
||||
|
||||
lv_style_value_t _lv_obj_style_apply_color_filter(const lv_obj_t * obj, uint32_t part, lv_style_value_t v)
|
||||
{
|
||||
if(obj == NULL) return v;
|
||||
@@ -666,7 +661,6 @@ void lv_obj_fade_out(lv_obj_t * obj, uint32_t time, uint32_t delay)
|
||||
lv_anim_start(&a);
|
||||
}
|
||||
|
||||
|
||||
lv_text_align_t lv_obj_calculate_style_text_align(const struct _lv_obj_t * obj, lv_part_t part, const char * txt)
|
||||
{
|
||||
lv_text_align_t align = lv_obj_get_style_text_align(obj, part);
|
||||
@@ -708,7 +702,6 @@ lv_opa_t lv_obj_get_style_opa_recursive(const lv_obj_t * obj, lv_part_t part)
|
||||
return opa_final;
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
@@ -776,7 +769,6 @@ static _lv_obj_style_t * get_trans_style(lv_obj_t * obj, lv_style_selector_t se
|
||||
obj->styles[i] = obj->styles[i - 1];
|
||||
}
|
||||
|
||||
|
||||
lv_memzero(&obj->styles[0], sizeof(_lv_obj_style_t));
|
||||
obj->styles[0].style = lv_malloc(sizeof(lv_style_t));
|
||||
lv_style_init((lv_style_t *)obj->styles[0].style);
|
||||
@@ -786,7 +778,6 @@ static _lv_obj_style_t * get_trans_style(lv_obj_t * obj, lv_style_selector_t se
|
||||
return &obj->styles[0];
|
||||
}
|
||||
|
||||
|
||||
static lv_style_res_t get_prop_core(const lv_obj_t * obj, lv_part_t part, lv_style_prop_t prop, lv_style_value_t * v)
|
||||
{
|
||||
|
||||
@@ -1057,7 +1048,6 @@ static lv_layer_type_t calculate_layer_type(lv_obj_t * obj)
|
||||
return LV_LAYER_TYPE_NONE;
|
||||
}
|
||||
|
||||
|
||||
static void full_cache_refresh(lv_obj_t * obj, lv_part_t part)
|
||||
{
|
||||
#if LV_OBJ_STYLE_CACHE
|
||||
|
||||
@@ -46,7 +46,6 @@ typedef enum {
|
||||
_LV_STYLE_STATE_CMP_DIFF_LAYOUT, /*The differences can be shown with a simple redraw*/
|
||||
} _lv_style_state_cmp_t;
|
||||
|
||||
|
||||
typedef uint32_t lv_style_selector_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -219,7 +218,6 @@ void lv_obj_fade_in(struct _lv_obj_t * obj, uint32_t time, uint32_t delay);
|
||||
*/
|
||||
void lv_obj_fade_out(struct _lv_obj_t * obj, uint32_t time, uint32_t delay);
|
||||
|
||||
|
||||
static inline lv_state_t lv_obj_style_get_selector_state(lv_style_selector_t selector)
|
||||
{
|
||||
return selector & 0xFFFF;
|
||||
@@ -338,7 +336,6 @@ static inline int32_t lv_obj_get_style_transform_scale_y_safe(const struct _lv_o
|
||||
return zoom != 0 ? zoom : 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the `opa` style property from all parents and multiply and `>> 8` them.
|
||||
* @param obj the object whose opacity should be get
|
||||
@@ -347,7 +344,6 @@ static inline int32_t lv_obj_get_style_transform_scale_y_safe(const struct _lv_o
|
||||
*/
|
||||
lv_opa_t lv_obj_get_style_opa_recursive(const struct _lv_obj_t * obj, lv_part_t part);
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
@@ -341,7 +341,6 @@ lv_obj_t * lv_obj_get_sibling(const lv_obj_t * obj, int32_t id)
|
||||
return lv_obj_get_child(parent, (int32_t)lv_obj_get_index(obj) + id);
|
||||
}
|
||||
|
||||
|
||||
uint32_t lv_obj_get_child_cnt(const lv_obj_t * obj)
|
||||
{
|
||||
LV_ASSERT_OBJ(obj, MY_CLASS);
|
||||
@@ -483,7 +482,6 @@ static void obj_delete_core(lv_obj_t * obj)
|
||||
lv_free(obj);
|
||||
}
|
||||
|
||||
|
||||
static lv_obj_tree_walk_res_t walk_core(lv_obj_t * obj, lv_obj_tree_walk_cb_t cb, void * user_data)
|
||||
{
|
||||
lv_obj_tree_walk_res_t res = LV_OBJ_TREE_WALK_NEXT;
|
||||
|
||||
@@ -22,7 +22,6 @@ extern "C" {
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
@@ -187,7 +186,6 @@ void lv_obj_dump_tree(struct _lv_obj_t * start_ob);
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
@@ -405,7 +405,6 @@ refr_clean_up:
|
||||
lv_memzero(disp_refr->inv_area_joined, sizeof(disp_refr->inv_area_joined));
|
||||
disp_refr->inv_p = 0;
|
||||
|
||||
|
||||
refr_finish:
|
||||
|
||||
#if LV_DRAW_SW_COMPLEX == 1
|
||||
@@ -487,7 +486,6 @@ static void refr_sync_areas(void)
|
||||
uint32_t hor_res = lv_display_get_horizontal_resolution(disp_refr);
|
||||
uint32_t ver_res = lv_display_get_vertical_resolution(disp_refr);
|
||||
|
||||
|
||||
/*Iterate through invalidated areas to see if sync area should be copied*/
|
||||
uint16_t i;
|
||||
int8_t j;
|
||||
@@ -803,7 +801,6 @@ static void refr_obj_and_children(lv_layer_t * layer, lv_obj_t * top_obj)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -863,7 +860,6 @@ static bool alpha_test_area_on_obj(lv_obj_t * obj, const lv_area_t * area)
|
||||
else return true;
|
||||
}
|
||||
|
||||
|
||||
void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
|
||||
{
|
||||
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_HIDDEN)) return;
|
||||
@@ -933,7 +929,6 @@ void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static uint32_t get_max_row(lv_display_t * disp, int32_t area_w, int32_t area_h)
|
||||
{
|
||||
bool has_alpha = lv_color_format_has_alpha(disp->color_format);
|
||||
@@ -1044,7 +1039,6 @@ static void call_flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t *
|
||||
LV_PROFILER_END;
|
||||
}
|
||||
|
||||
|
||||
static void wait_for_flushing(lv_display_t * disp)
|
||||
{
|
||||
LV_PROFILER_BEGIN;
|
||||
|
||||
@@ -114,7 +114,6 @@ static int32_t align_round_up(int32_t v, uint16_t align)
|
||||
return (v + align - 1) & ~(align - 1);
|
||||
}
|
||||
|
||||
|
||||
static void rounder_cb(lv_event_t * e)
|
||||
{
|
||||
lv_nuttx_lcd_t * lcd = lv_event_get_user_data(e);
|
||||
|
||||
@@ -114,7 +114,6 @@ void _lv_sdl_keyboard_handler(SDL_Event * event)
|
||||
if(indev == NULL) return;
|
||||
lv_sdl_keyboard_t * dsc = lv_indev_get_driver_data(indev);
|
||||
|
||||
|
||||
/* We only care about SDL_KEYDOWN and SDL_TEXTINPUT events */
|
||||
switch(event->type) {
|
||||
case SDL_KEYDOWN: { /*Button press*/
|
||||
@@ -140,7 +139,6 @@ void _lv_sdl_keyboard_handler(SDL_Event * event)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert a SDL key code to it's LV_KEY_* counterpart or return '\0' if it's not a control character.
|
||||
* @param sdl_key the key code
|
||||
|
||||
@@ -74,7 +74,6 @@ static void sdl_mouse_read(lv_indev_t * indev, lv_indev_data_t * data)
|
||||
data->state = dsc->left_button_down ? LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED;
|
||||
}
|
||||
|
||||
|
||||
void _lv_sdl_mouse_handler(SDL_Event * event)
|
||||
{
|
||||
uint32_t win_id = UINT32_MAX;
|
||||
|
||||
@@ -161,7 +161,6 @@ void lv_sdl_quit()
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map)
|
||||
{
|
||||
lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
|
||||
|
||||
@@ -135,7 +135,6 @@ lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res)
|
||||
return disp;
|
||||
}
|
||||
|
||||
|
||||
void lv_display_remove(lv_display_t * disp)
|
||||
{
|
||||
bool was_default = false;
|
||||
@@ -398,7 +397,6 @@ void lv_display_set_flush_cb(lv_display_t * disp, lv_display_flush_cb_t flush_cb
|
||||
disp->flush_cb = flush_cb;
|
||||
}
|
||||
|
||||
|
||||
void lv_display_set_flush_wait_cb(lv_display_t * disp, lv_display_flush_wait_cb_t wait_cb)
|
||||
{
|
||||
if(disp == NULL) disp = lv_display_get_default();
|
||||
@@ -440,7 +438,6 @@ bool lv_display_get_antialiasing(lv_display_t * disp)
|
||||
return disp->antialiasing;
|
||||
}
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FLUSH_READY void lv_display_flush_ready(lv_display_t * disp)
|
||||
{
|
||||
disp->flushing = 0;
|
||||
@@ -565,7 +562,6 @@ void lv_screen_load_anim(lv_obj_t * new_scr, lv_screen_load_anim_t anim_type, ui
|
||||
lv_obj_remove_local_style_prop(new_scr, LV_STYLE_OPA, 0);
|
||||
lv_obj_remove_local_style_prop(lv_screen_active(), LV_STYLE_OPA, 0);
|
||||
|
||||
|
||||
/*Shortcut for immediate load*/
|
||||
if(time == 0 && delay == 0) {
|
||||
|
||||
@@ -688,7 +684,6 @@ uint32_t lv_display_get_event_count(lv_display_t * disp)
|
||||
return lv_event_get_count(&disp->event_list);
|
||||
}
|
||||
|
||||
|
||||
lv_event_dsc_t * lv_display_get_event_dsc(lv_display_t * disp, uint32_t index)
|
||||
{
|
||||
LV_ASSERT_NULL(disp);
|
||||
|
||||
@@ -63,7 +63,6 @@ typedef enum {
|
||||
LV_DISPLAY_RENDER_MODE_FULL,
|
||||
} lv_display_render_mode_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
LV_SCR_LOAD_ANIM_NONE,
|
||||
LV_SCR_LOAD_ANIM_OVER_LEFT,
|
||||
@@ -83,7 +82,6 @@ typedef enum {
|
||||
LV_SCR_LOAD_ANIM_OUT_BOTTOM,
|
||||
} lv_screen_load_anim_t;
|
||||
|
||||
|
||||
typedef void (*lv_display_flush_cb_t)(struct _lv_display_t * disp, const lv_area_t * area, uint8_t * px_map);
|
||||
typedef void (*lv_display_flush_wait_cb_t)(struct _lv_display_t * disp);
|
||||
|
||||
@@ -261,7 +259,6 @@ void lv_display_set_flush_cb(lv_display_t * disp, lv_display_flush_cb_t flush_cb
|
||||
*/
|
||||
void lv_display_set_flush_wait_cb(lv_display_t * disp, lv_display_flush_wait_cb_t wait_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
|
||||
@@ -294,7 +291,6 @@ void lv_display_set_antialiasing(lv_display_t * disp, bool en);
|
||||
*/
|
||||
bool lv_display_get_antialiasing(lv_display_t * disp);
|
||||
|
||||
|
||||
//! @cond Doxygen_Suppress
|
||||
|
||||
/**
|
||||
@@ -314,7 +310,6 @@ LV_ATTRIBUTE_FLUSH_READY bool lv_display_flush_is_last(lv_display_t * disp);
|
||||
|
||||
//! @endcond
|
||||
|
||||
|
||||
bool lv_display_is_double_buffered(lv_display_t * disp);
|
||||
|
||||
/*---------------------
|
||||
@@ -357,7 +352,6 @@ struct _lv_obj_t * lv_display_get_layer_top(lv_display_t * disp);
|
||||
*/
|
||||
struct _lv_obj_t * lv_display_get_layer_sys(lv_display_t * disp);
|
||||
|
||||
|
||||
/**
|
||||
* Return the bottom layer. The bottom layer is the same on all screen and it is under the normal screen layer.
|
||||
* It's visible only if the the screen is transparent.
|
||||
@@ -366,7 +360,6 @@ struct _lv_obj_t * lv_display_get_layer_sys(lv_display_t * disp);
|
||||
*/
|
||||
struct _lv_obj_t * lv_display_get_layer_bottom(lv_display_t * disp);
|
||||
|
||||
|
||||
/**
|
||||
* Switch screen with animation
|
||||
* @param scr pointer to the new screen to load
|
||||
@@ -423,7 +416,6 @@ static inline void lv_screen_load(struct _lv_obj_t * scr)
|
||||
lv_display_load_scr(scr);
|
||||
}
|
||||
|
||||
|
||||
/*---------------------
|
||||
* OTHERS
|
||||
*--------------------*/
|
||||
@@ -529,7 +521,6 @@ void * lv_display_get_driver_data(lv_display_t * disp);
|
||||
#define LV_VER_RES lv_display_get_vertical_resolution(lv_display_get_default())
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP)
|
||||
* 1 dip is 1 px on a 160 DPI screen
|
||||
@@ -566,7 +557,6 @@ static inline int32_t lv_display_dpx(const lv_display_t * disp, int32_t n)
|
||||
return _LV_DPX_CALC(lv_display_get_dpi(disp), n);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
@@ -101,7 +101,6 @@ lv_draw_task_t * lv_draw_add_task(lv_layer_t * layer, const lv_area_t * coords)
|
||||
return new_task;
|
||||
}
|
||||
|
||||
|
||||
void lv_draw_finalize_task_creation(lv_layer_t * layer, lv_draw_task_t * t)
|
||||
{
|
||||
lv_draw_dsc_base_t * base_dsc = t->draw_dsc;
|
||||
@@ -368,7 +367,6 @@ void * lv_draw_layer_alloc_buf(lv_layer_t * layer)
|
||||
_draw_info.used_memory_for_layers_kb += kb;
|
||||
LV_LOG_INFO("Layer memory used: %d kB\n", _draw_info.used_memory_for_layers_kb);
|
||||
|
||||
|
||||
if(lv_color_format_has_alpha(layer->color_format)) {
|
||||
lv_area_t a;
|
||||
a.x1 = 0;
|
||||
@@ -422,4 +420,3 @@ static bool is_independent(lv_layer_t * layer, lv_draw_task_t * t_check)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,6 @@ typedef struct _lv_draw_unit_t {
|
||||
int32_t (*delete_cb)(struct _lv_draw_unit_t * draw_unit);
|
||||
} lv_draw_unit_t;
|
||||
|
||||
|
||||
typedef struct _lv_layer_t {
|
||||
|
||||
/** The unaligned buffer where drawing will happen*/
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "../stdlib/lv_string.h"
|
||||
#include "../core/lv_global.h"
|
||||
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
@@ -67,7 +66,6 @@ lv_draw_buf_handlers_t * lv_draw_buf_get_handlers(void)
|
||||
return &handlers;
|
||||
}
|
||||
|
||||
|
||||
uint32_t lv_draw_buf_width_to_stride(uint32_t w, lv_color_format_t color_format)
|
||||
{
|
||||
if(handlers.width_to_stride_cb) return handlers.width_to_stride_cb(w, color_format);
|
||||
@@ -108,7 +106,6 @@ void lv_draw_buf_clear(void * buf, uint32_t w, uint32_t h, lv_color_format_t col
|
||||
if(handlers.buf_clear_cb) handlers.buf_clear_cb(buf, w, h, color_format, a);
|
||||
}
|
||||
|
||||
|
||||
void lv_draw_buf_copy(void * dest_buf, uint32_t dest_w, uint32_t dest_h, const lv_area_t * dest_area_to_copy,
|
||||
void * src_buf, uint32_t src_w, uint32_t src_h, const lv_area_t * src_area_to_copy,
|
||||
lv_color_format_t color_format)
|
||||
@@ -122,7 +119,6 @@ void lv_draw_buf_copy(void * dest_buf, uint32_t dest_w, uint32_t dest_h, const l
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
static void * buf_malloc(size_t size_bytes, lv_color_format_t color_format)
|
||||
{
|
||||
LV_UNUSED(color_format);
|
||||
@@ -218,4 +214,3 @@ static void buf_copy(void * dest_buf, uint32_t dest_w, uint32_t dest_h, const lv
|
||||
src_bufc += src_stride;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,6 @@ void lv_draw_image_dsc_init(lv_draw_image_dsc_t * dsc)
|
||||
dsc->antialias = LV_COLOR_DEPTH > 8 ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
void lv_draw_layer(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
|
||||
{
|
||||
lv_draw_task_t * t = lv_draw_add_task(layer, coords);
|
||||
@@ -64,7 +63,6 @@ void lv_draw_layer(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
|
||||
lv_draw_finalize_task_creation(layer, t);
|
||||
}
|
||||
|
||||
|
||||
void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv_area_t * coords)
|
||||
{
|
||||
if(dsc->src == NULL) {
|
||||
@@ -73,7 +71,6 @@ void lv_draw_image(lv_layer_t * layer, const lv_draw_image_dsc_t * dsc, const lv
|
||||
}
|
||||
if(dsc->opa <= LV_OPA_MIN) return;
|
||||
|
||||
|
||||
LV_PROFILER_BEGIN;
|
||||
|
||||
lv_draw_image_dsc_t * new_image_dsc = lv_malloc(sizeof(*dsc));
|
||||
@@ -129,4 +126,3 @@ lv_image_src_t lv_image_src_get_type(const void * src)
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ typedef struct _lv_draw_image_dsc_t {
|
||||
const void * src;
|
||||
lv_image_header_t header;
|
||||
|
||||
|
||||
int32_t rotation;
|
||||
int32_t scale_x;
|
||||
int32_t scale_y;
|
||||
|
||||
@@ -60,7 +60,6 @@ void lv_draw_label_dsc_init(lv_draw_label_dsc_t * dsc)
|
||||
dsc->bidi_dir = LV_BASE_DIR_LTR;
|
||||
}
|
||||
|
||||
|
||||
void lv_draw_letter_dsc_init(lv_draw_glyph_dsc_t * dsc)
|
||||
{
|
||||
lv_memzero(dsc, sizeof(lv_draw_glyph_dsc_t));
|
||||
@@ -91,8 +90,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_label(lv_layer_t * layer, const lv_draw_label
|
||||
lv_draw_finalize_task_creation(layer, t);
|
||||
}
|
||||
|
||||
|
||||
|
||||
LV_ATTRIBUTE_FAST_MEM void lv_draw_letter(lv_layer_t * layer, lv_draw_label_dsc_t * dsc,
|
||||
const lv_point_t * point, uint32_t unicode_letter)
|
||||
{
|
||||
@@ -307,8 +304,6 @@ void lv_draw_label_iterate_letters(lv_draw_unit_t * draw_unit, const lv_draw_lab
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(sel_start != 0xFFFF && sel_end != 0xFFFF && logical_char_pos >= sel_start && logical_char_pos < sel_end) {
|
||||
draw_letter_dsc.color = dsc->sel_color;
|
||||
fill_dsc.color = dsc->sel_bg_color;
|
||||
@@ -318,7 +313,6 @@ void lv_draw_label_iterate_letters(lv_draw_unit_t * draw_unit, const lv_draw_lab
|
||||
draw_letter_dsc.color = dsc->color;
|
||||
}
|
||||
|
||||
|
||||
draw_letter(draw_unit, &draw_letter_dsc, &pos, font, letter, cb);
|
||||
|
||||
if(letter_w > 0) {
|
||||
@@ -359,7 +353,6 @@ void lv_draw_label_iterate_letters(lv_draw_unit_t * draw_unit, const lv_draw_lab
|
||||
LV_ASSERT_MEM_INTEGRITY();
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
@@ -423,4 +416,3 @@ static void draw_letter(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc,
|
||||
cb(draw_unit, dsc, NULL, NULL);
|
||||
LV_PROFILER_END;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ typedef struct _lv_draw_label_hint_t {
|
||||
int32_t coord_y;
|
||||
} lv_draw_label_hint_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
lv_draw_dsc_base_t base;
|
||||
|
||||
@@ -66,9 +65,11 @@ typedef struct {
|
||||
lv_text_align_t align;
|
||||
lv_text_flag_t flag;
|
||||
lv_text_decor_t decor : 3;
|
||||
lv_blend_mode_t blend_mode: 3;
|
||||
uint8_t text_local :
|
||||
1; /**< 1: malloc buffer and copy `text` there. 0: `text` is const and it's pointer will be valid during rendering*/
|
||||
lv_blend_mode_t blend_mode : 3;
|
||||
/**
|
||||
* < 1: malloc buffer and copy `text` there.
|
||||
* 0: `text` is const and it's pointer will be valid during rendering.*/
|
||||
uint8_t text_local : 1;
|
||||
lv_draw_label_hint_t * hint;
|
||||
} lv_draw_label_dsc_t;
|
||||
|
||||
@@ -89,7 +90,6 @@ typedef struct {
|
||||
lv_opa_t opa;
|
||||
} lv_draw_glyph_dsc_t;
|
||||
|
||||
|
||||
typedef void(*lv_draw_letter_cb_t)(lv_draw_unit_t * draw_unit, lv_draw_glyph_dsc_t * dsc, lv_draw_fill_dsc_t * fill_dsc,
|
||||
const lv_area_t * fill_area);
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc);
|
||||
*/
|
||||
void lv_draw_line(struct _lv_layer_t * layer, const lv_draw_line_dsc_t * dsc);
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
@@ -49,7 +49,6 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_mask_rect_dsc_init(lv_draw_mask_rect_dsc_t *
|
||||
*/
|
||||
void lv_draw_mask_rect(struct _lv_layer_t * layer, const lv_draw_mask_rect_dsc_t * dsc);
|
||||
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
@@ -80,7 +80,6 @@ void lv_draw_bg_image_dsc_init(lv_draw_bg_image_dsc_t * dsc)
|
||||
dsc->opa = LV_OPA_COVER;
|
||||
}
|
||||
|
||||
|
||||
void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_area_t * coords)
|
||||
{
|
||||
|
||||
@@ -174,7 +173,6 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
|
||||
|
||||
t = lv_draw_add_task(layer, coords);
|
||||
|
||||
|
||||
lv_image_src_t src_type = lv_image_src_get_type(dsc->bg_image_src);
|
||||
lv_result_t res = LV_RESULT_OK;
|
||||
lv_image_header_t header;
|
||||
@@ -243,7 +241,6 @@ void lv_draw_rect(lv_layer_t * layer, const lv_draw_rect_dsc_t * dsc, const lv_a
|
||||
LV_PROFILER_END;
|
||||
}
|
||||
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
@@ -133,7 +133,6 @@ void lv_draw_box_shadow_dsc_init(lv_draw_box_shadow_dsc_t * dsc);
|
||||
|
||||
void lv_draw_bg_image_dsc_init(lv_draw_bg_image_dsc_t * dsc);
|
||||
|
||||
|
||||
/**
|
||||
* Draw a rectangle
|
||||
* @param layer pointer to a layer
|
||||
|
||||
@@ -46,7 +46,6 @@ typedef struct {
|
||||
* STATIC PROTOTYPES
|
||||
**********************/
|
||||
|
||||
|
||||
static bool _is_identity_or_translation(const lv_matrix_t * matrix)
|
||||
{
|
||||
return (matrix->m[0][0] == 1.0f &&
|
||||
|
||||
@@ -16,7 +16,6 @@ extern "C" {
|
||||
#include "lv_draw.h"
|
||||
#include "../misc/lv_array.h"
|
||||
|
||||
|
||||
#if LV_USE_VECTOR_GRAPHIC
|
||||
|
||||
/**********************
|
||||
@@ -96,12 +95,10 @@ typedef struct {
|
||||
float y;
|
||||
} lv_fpoint_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
float m[3][3];
|
||||
} lv_matrix_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
lv_vector_path_quality_t quality;
|
||||
lv_array_t ops;
|
||||
@@ -148,7 +145,6 @@ typedef struct {
|
||||
lv_area_t scissor_area;
|
||||
} lv_vector_draw_dsc_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
lv_draw_dsc_base_t base;
|
||||
lv_ll_t * task_list; // draw task list.
|
||||
@@ -161,7 +157,6 @@ typedef struct {
|
||||
lv_draw_vector_task_dsc_t tasks;
|
||||
} lv_vector_dsc_t;
|
||||
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user