refactor: replace lv_coord_t with int32_t

This commit is contained in:
Gabor Kiss-Vamosi 2023-10-31 19:25:01 +01:00
parent d456b1cb4d
commit a5a58e39d2
194 changed files with 2431 additions and 2434 deletions

View File

@ -36,8 +36,8 @@ static void next_scene_timer_cb(lv_timer_t * timer);
static void rnd_reset(void);
static int32_t rnd_next(int32_t min, int32_t max);
static void shake_anim_y_cb(void * var, int32_t v);
static void shake_anim(lv_obj_t * obj, lv_coord_t y_max);
static void scroll_anim(lv_obj_t * obj, lv_coord_t y_max);
static void shake_anim(lv_obj_t * obj, int32_t y_max);
static void scroll_anim(lv_obj_t * obj, int32_t y_max);
static void scroll_anim_y_cb(void * var, int32_t v);
static void color_anim_cb(void * var, int32_t v);
static void color_anim(lv_obj_t * obj);
@ -522,7 +522,7 @@ static void scroll_anim_y_cb(void * var, int32_t v)
lv_obj_scroll_to_y(var, v, LV_ANIM_OFF);
}
static void scroll_anim(lv_obj_t * obj, lv_coord_t y_max)
static void scroll_anim(lv_obj_t * obj, int32_t y_max)
{
uint32_t t = lv_anim_speed_to_time(lv_display_get_dpi(NULL), 0, y_max);
@ -542,7 +542,7 @@ static void shake_anim_y_cb(void * var, int32_t v)
lv_obj_set_style_translate_y(var, v, 0);
}
static void shake_anim(lv_obj_t * obj, lv_coord_t y_max)
static void shake_anim(lv_obj_t * obj, int32_t y_max)
{
uint32_t t1 = rnd_next(300, 3000);
uint32_t t2 = rnd_next(300, 3000);

View File

@ -18,7 +18,7 @@
#define SPINBOX_UPDATE_STYLE_VALUE(item) \
do { \
lv_obj_t* sbox = ui->ctrl_pad.tab.layout.spinbox_##item; \
lv_coord_t val = lv_obj_get_style_##item(obj, LV_PART_MAIN); \
int32_t val = lv_obj_get_style_##item(obj, LV_PART_MAIN); \
lv_spinbox_set_value(sbox, val); \
} while(0)
@ -94,7 +94,7 @@ static void ctrl_pad_btn_remove_event_handler(lv_event_t * e)
void ctrl_pad_obj_update(lv_obj_t * obj, view_t * ui)
{
lv_obj_t * spinbox = ui->ctrl_pad.tab.layout.spinbox_width;
lv_coord_t value = lv_obj_get_width(obj);
int32_t value = lv_obj_get_width(obj);
lv_spinbox_set_value(spinbox, value);
spinbox = ui->ctrl_pad.tab.layout.spinbox_height;

View File

@ -101,7 +101,7 @@ static card_info_t card_info[] = {
static const void * get_imgfont_path(const lv_font_t * font,
uint32_t unicode, uint32_t unicode_next,
lv_coord_t * offset_y, void * user_data)
int32_t * offset_y, void * user_data)
{
LV_UNUSED(user_data);
LV_UNUSED(unicode_next);
@ -164,8 +164,8 @@ void lv_demo_multilang(void)
lv_obj_set_style_bg_grad_color(lv_screen_active(), lv_color_hex(0xf9f9f9), 0);
lv_obj_set_style_bg_grad_dir(lv_screen_active(), LV_GRAD_DIR_HOR, 0);
static const lv_coord_t grid_cols[] = {LV_GRID_CONTENT, 4, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const lv_coord_t grid_rows[] = {LV_GRID_CONTENT, -10, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_cols[] = {LV_GRID_CONTENT, 4, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const int32_t grid_rows[] = {LV_GRID_CONTENT, -10, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
lv_style_init(&style_card_cont);
lv_style_set_width(&style_card_cont, lv_pct(100));
@ -270,8 +270,8 @@ static void scroll_event_cb(lv_event_t * e)
lv_obj_t * cont = lv_event_get_target(e);
if(lv_indev_get_scroll_obj(indev) != cont) return;
lv_coord_t w = lv_obj_get_width(cont);
lv_coord_t scroll_x = lv_obj_get_scroll_x(cont) - lv_indev_scroll_throw_predict(indev, LV_DIR_HOR);
int32_t w = lv_obj_get_width(cont);
int32_t scroll_x = lv_obj_get_scroll_x(cont) - lv_indev_scroll_throw_predict(indev, LV_DIR_HOR);
if(scroll_x < w / 2) {
lv_obj_set_scroll_snap_x(cont, LV_SCROLL_SNAP_NONE);

View File

@ -86,11 +86,11 @@ lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent)
lv_style_set_radius(&style_scrollbar, LV_RADIUS_CIRCLE);
lv_style_set_pad_right(&style_scrollbar, 4);
static const lv_coord_t grid_cols[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_cols[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
#if LV_DEMO_MUSIC_LARGE
static const lv_coord_t grid_rows[] = {35, 30, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_rows[] = {35, 30, LV_GRID_TEMPLATE_LAST};
#else
static const lv_coord_t grid_rows[] = {22, 17, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_rows[] = {22, 17, LV_GRID_TEMPLATE_LAST};
#endif
lv_style_init(&style_btn);
lv_style_set_bg_opa(&style_btn, LV_OPA_TRANSP);

View File

@ -91,7 +91,7 @@ static const lv_font_t * font_large;
static uint32_t track_id;
static bool playing;
static bool start_anim;
static lv_coord_t start_anim_values[40];
static int32_t start_anim_values[40];
static lv_obj_t * play_obj;
static const uint16_t (* spectrum)[4];
static uint32_t spectrum_len;
@ -120,7 +120,7 @@ static void _image_set_zoom_anim_cb(void * obj, int32_t zoom)
*/
static void _obj_set_x_anim_cb(void * obj, int32_t x)
{
lv_obj_set_x((lv_obj_t *)obj, (lv_coord_t)x);
lv_obj_set_x((lv_obj_t *)obj, (int32_t)x);
}
lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)
@ -168,19 +168,19 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)
/*Arrange the content into a grid*/
#if LV_DEMO_MUSIC_SQUARE || LV_DEMO_MUSIC_ROUND
static const lv_coord_t grid_cols[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_rows[] = {LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
0, /*Spectrum obj, set later*/
LV_GRID_CONTENT, /*Title box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Icon box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Control box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Handle box*/
LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_TEMPLATE_LAST
};
static const int32_t grid_cols[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t grid_rows[] = {LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
0, /*Spectrum obj, set later*/
LV_GRID_CONTENT, /*Title box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Icon box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Control box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Handle box*/
LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_TEMPLATE_LAST
};
grid_rows[1] = LV_VER_RES;
@ -192,26 +192,26 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)
lv_obj_set_grid_cell(ctrl_box, LV_GRID_ALIGN_STRETCH, 0, 1, LV_ALIGN_CENTER, 6, 1);
lv_obj_set_grid_cell(handle_box, LV_GRID_ALIGN_STRETCH, 0, 1, LV_ALIGN_CENTER, 8, 1);
#elif LV_DEMO_MUSIC_LANDSCAPE == 0
static const lv_coord_t grid_cols[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const lv_coord_t grid_rows[] = {LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_FR(1), /*Spacer*/
LV_GRID_CONTENT, /*Title box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Icon box*/
LV_GRID_FR(3), /*Spacer*/
static const int32_t grid_cols[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const int32_t grid_rows[] = {LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_FR(1), /*Spacer*/
LV_GRID_CONTENT, /*Title box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Icon box*/
LV_GRID_FR(3), /*Spacer*/
# if LV_DEMO_MUSIC_LARGE == 0
250, /*Spectrum obj*/
250, /*Spectrum obj*/
# else
480, /*Spectrum obj*/
480, /*Spectrum obj*/
# endif
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Control box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Handle box*/
LV_GRID_FR(1), /*Spacer*/
LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_TEMPLATE_LAST
};
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Control box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Handle box*/
LV_GRID_FR(1), /*Spacer*/
LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_TEMPLATE_LAST
};
lv_obj_set_grid_dsc_array(cont, grid_cols, grid_rows);
lv_obj_set_style_grid_row_align(cont, LV_GRID_ALIGN_SPACE_BETWEEN, 0);
@ -222,20 +222,20 @@ lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent)
lv_obj_set_grid_cell(handle_box, LV_GRID_ALIGN_STRETCH, 0, 1, LV_GRID_ALIGN_CENTER, 10, 1);
#else
/*Arrange the content into a grid*/
static const lv_coord_t grid_cols[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const lv_coord_t grid_rows[] = {LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_FR(1), /*Spacer*/
LV_GRID_CONTENT, /*Title box*/
LV_GRID_FR(1), /*Spacer*/
LV_GRID_CONTENT, /*Icon box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Control box*/
LV_GRID_FR(1), /*Spacer*/
LV_GRID_CONTENT, /*Handle box*/
LV_GRID_FR(1), /*Spacer*/
LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_TEMPLATE_LAST
};
static const int32_t grid_cols[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const int32_t grid_rows[] = {LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_FR(1), /*Spacer*/
LV_GRID_CONTENT, /*Title box*/
LV_GRID_FR(1), /*Spacer*/
LV_GRID_CONTENT, /*Icon box*/
LV_GRID_FR(3), /*Spacer*/
LV_GRID_CONTENT, /*Control box*/
LV_GRID_FR(1), /*Spacer*/
LV_GRID_CONTENT, /*Handle box*/
LV_GRID_FR(1), /*Spacer*/
LV_DEMO_MUSIC_HANDLE_SIZE, /*Spacing*/
LV_GRID_TEMPLATE_LAST
};
lv_obj_set_grid_dsc_array(cont, grid_cols, grid_rows);
lv_obj_set_style_grid_row_align(cont, LV_GRID_ALIGN_SPACE_BETWEEN, 0);
@ -563,8 +563,8 @@ static lv_obj_t * create_ctrl_box(lv_obj_t * parent)
#else
lv_obj_set_style_pad_bottom(cont, 8, 0);
#endif
static const lv_coord_t grid_col[] = {LV_GRID_FR(2), LV_GRID_FR(3), LV_GRID_FR(5), LV_GRID_FR(5), LV_GRID_FR(5), LV_GRID_FR(3), LV_GRID_FR(2), LV_GRID_TEMPLATE_LAST};
static const lv_coord_t grid_row[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_col[] = {LV_GRID_FR(2), LV_GRID_FR(3), LV_GRID_FR(5), LV_GRID_FR(5), LV_GRID_FR(5), LV_GRID_FR(3), LV_GRID_FR(2), LV_GRID_TEMPLATE_LAST};
static const int32_t grid_row[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
lv_obj_set_grid_dsc_array(cont, grid_col, grid_row);
LV_IMAGE_DECLARE(img_lv_demo_music_btn_loop);
@ -803,11 +803,11 @@ static void spectrum_draw_event_cb(lv_event_t * e)
uint16_t r[64];
uint32_t i;
lv_coord_t min_a = 5;
int32_t min_a = 5;
#if LV_DEMO_MUSIC_LARGE == 0
lv_coord_t r_in = 1;
int32_t r_in = 1;
#else
lv_coord_t r_in = 160;
int32_t r_in = 160;
#endif
r_in = (r_in * lv_image_get_zoom(album_image_obj)) >> 8;
for(i = 0; i < BAR_CNT; i++) r[i] = r_in + min_a + 77;
@ -929,7 +929,7 @@ static void spectrum_anim_cb(void * a, int32_t v)
static void start_anim_cb(void * a, int32_t v)
{
lv_coord_t * av = a;
int32_t * av = a;
*av = v;
lv_obj_invalidate(spectrum_obj);
}

View File

@ -33,9 +33,9 @@ typedef struct {
* STATIC PROTOTYPES
**********************/
static lv_opa_t opa_saved;
static void add_to_cell(lv_obj_t * obj, lv_coord_t col, lv_coord_t row);
static void add_to_cell(lv_obj_t * obj, int32_t col, int32_t row);
static lv_obj_t * fill_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row)
static lv_obj_t * fill_obj_create(lv_obj_t * parent, int32_t col, int32_t row)
{
lv_color_t colors[] = {lv_color_hex3(0x000),
lv_color_hex3(0xfff),
@ -113,7 +113,7 @@ static void fill_cb(lv_obj_t * parent)
}
}
static lv_obj_t * border_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row)
static lv_obj_t * border_obj_create(lv_obj_t * parent, int32_t col, int32_t row)
{
lv_obj_t * obj = lv_obj_create(parent);
@ -209,7 +209,7 @@ static void border_cb(lv_obj_t * parent)
}
}
static lv_obj_t * box_shadow_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row)
static lv_obj_t * box_shadow_obj_create(lv_obj_t * parent, int32_t col, int32_t row)
{
lv_obj_t * obj = lv_obj_create(parent);
lv_obj_remove_style_all(obj);
@ -225,8 +225,8 @@ static lv_obj_t * box_shadow_obj_create(lv_obj_t * parent, lv_coord_t col, lv_co
static void box_shadow_cb(lv_obj_t * parent)
{
static const lv_coord_t grid_rows[] = {45, 45, 45, 45, 45, 45, LV_GRID_TEMPLATE_LAST};
static const lv_coord_t grid_cols[] = {68, 68, 68, 68, 68, 68, 68, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_rows[] = {45, 45, 45, 45, 45, 45, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_cols[] = {68, 68, 68, 68, 68, 68, 68, LV_GRID_TEMPLATE_LAST};
lv_obj_set_grid_dsc_array(parent, grid_cols, grid_rows);
lv_point_t ofs[] = {
@ -275,7 +275,7 @@ static void box_shadow_cb(lv_obj_t * parent)
}
static lv_obj_t * text_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row)
static lv_obj_t * text_obj_create(lv_obj_t * parent, int32_t col, int32_t row)
{
lv_obj_t * obj = lv_label_create(parent);
@ -314,7 +314,7 @@ static void text_cb(lv_obj_t * parent)
}
static lv_obj_t * image_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row, bool recolor)
static lv_obj_t * image_obj_create(lv_obj_t * parent, int32_t col, int32_t row, bool recolor)
{
lv_obj_t * obj = lv_image_create(parent);
lv_obj_remove_style_all(obj);
@ -407,7 +407,7 @@ static void image_recolored_cb(lv_obj_t * parent)
}
static lv_obj_t * line_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row, lv_point_precise_t p[])
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);
lv_obj_remove_style_all(obj);
@ -434,7 +434,7 @@ static void line_cb(lv_obj_t * parent)
{{DEF_WIDTH - 5, 5}, {5, DEF_HEIGHT - 5}}, /* / */
};
lv_coord_t widths[] = {1, 3, 5, 10};
int32_t widths[] = {1, 3, 5, 10};
uint32_t r;
for(r = 0; r < 2; r++) {
@ -450,7 +450,7 @@ static void line_cb(lv_obj_t * parent)
}
}
static lv_obj_t * arc_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row, lv_coord_t w,
static lv_obj_t * arc_obj_create(lv_obj_t * parent, int32_t col, int32_t row, int32_t w,
lv_value_precise_t start, lv_value_precise_t end)
{
lv_obj_t * obj = lv_arc_create(parent);
@ -478,7 +478,7 @@ static void arc_core_cb(lv_obj_t * parent, const void * img_src)
{0, 360},
};
lv_coord_t widths[] = {1, 5, 10, 100};
int32_t widths[] = {1, 5, 10, 100};
uint32_t r;
for(r = 0; r < 2; r++) {
@ -538,7 +538,7 @@ static void triangle_draw_event_cb(lv_event_t * e)
}
static lv_obj_t * triangle_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row, lv_point_t p[])
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);
lv_obj_remove_style_all(obj);
@ -613,7 +613,7 @@ static void triangle_cb(lv_obj_t * parent)
}
static lv_obj_t * layer_obj_create(lv_obj_t * parent, lv_coord_t col, lv_coord_t row, lv_blend_mode_t blend_mode)
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);
lv_obj_remove_style_all(obj);
@ -642,7 +642,7 @@ static void layer_core_cb(lv_obj_t * parent, lv_blend_mode_t blend_mode)
uint32_t i;
for(i = 0; i < 2; i++) {
lv_coord_t row = 4 * i;
int32_t row = 4 * i;
lv_obj_t * obj;
obj = layer_obj_create(parent, 0, row, blend_mode);
@ -752,8 +752,8 @@ void lv_demo_render(lv_demo_render_scene_t id, lv_opa_t opa)
lv_obj_set_style_bg_color(main_parent, lv_color_hex3(0xaaf), 0);
lv_obj_set_size(main_parent, 480, 272);
static const lv_coord_t grid_cols[] = {60, 60, 60, 60, 60, 60, 60, 60, LV_GRID_TEMPLATE_LAST};
static const lv_coord_t grid_rows[] = {34, 34, 34, 34, 34, 34, 34, 34, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_cols[] = {60, 60, 60, 60, 60, 60, 60, 60, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_rows[] = {34, 34, 34, 34, 34, 34, 34, 34, LV_GRID_TEMPLATE_LAST};
lv_obj_set_grid_dsc_array(main_parent, grid_cols, grid_rows);
opa_saved = opa;
@ -772,7 +772,7 @@ const char * lv_demo_render_get_scene_name(lv_demo_render_scene_t id)
* STATIC FUNCTIONS
**********************/
static void add_to_cell(lv_obj_t * obj, lv_coord_t col, lv_coord_t row)
static void add_to_cell(lv_obj_t * obj, int32_t col, int32_t row)
{
lv_obj_set_grid_cell(obj, LV_GRID_ALIGN_CENTER, col, 1, LV_GRID_ALIGN_CENTER, row, 1);
}

View File

@ -48,8 +48,8 @@ LV_IMAGE_DECLARE(img_transform_avatar_15)
**********************/
void lv_demo_transform(void)
{
static const lv_coord_t grid_cols[] = {LV_GRID_CONTENT, 4, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const lv_coord_t grid_rows[] = {LV_GRID_CONTENT, -10, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
static const int32_t grid_cols[] = {LV_GRID_CONTENT, 4, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const int32_t grid_rows[] = {LV_GRID_CONTENT, -10, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
lv_style_init(&style_card);
lv_style_set_width(&style_card, 300);
@ -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_display_get_horizontal_resolution(NULL);
int32_t disp_w = lv_display_get_horizontal_resolution(NULL);
lv_obj_t * arc = lv_arc_create(lv_screen_active());
lv_obj_set_size(arc, disp_w - 20, disp_w - 20);
lv_arc_set_range(arc, 0, 270);

View File

@ -105,7 +105,7 @@ void lv_demo_widgets(void)
font_large = LV_FONT_DEFAULT;
font_normal = LV_FONT_DEFAULT;
lv_coord_t tab_h;
int32_t tab_h;
if(disp_size == DISP_LARGE) {
tab_h = 70;
#if LV_FONT_MONTSERRAT_24
@ -346,15 +346,15 @@ static void profile_create(lv_obj_t * parent)
lv_obj_t * sw2 = lv_switch_create(panel3);
if(disp_size == DISP_LARGE) {
static lv_coord_t grid_main_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_main_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
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 lv_coord_t grid_1_col_dsc[] = {LV_GRID_CONTENT, 5, LV_GRID_CONTENT, LV_GRID_FR(2), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_1_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, 10, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
static int32_t grid_1_col_dsc[] = {LV_GRID_CONTENT, 5, LV_GRID_CONTENT, LV_GRID_FR(2), LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t grid_1_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, 10, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_2_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_2_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*/
5, /*Separator*/
LV_GRID_CONTENT, /*Box title*/
@ -405,13 +405,13 @@ static void profile_create(lv_obj_t * parent)
lv_obj_set_grid_cell(team_player_label, LV_GRID_ALIGN_START, 1, 1, LV_GRID_ALIGN_START, 5, 1);
}
else if(disp_size == DISP_MEDIUM) {
static lv_coord_t grid_main_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_main_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
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 lv_coord_t grid_1_col_dsc[] = {LV_GRID_CONTENT, 1, LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_1_row_dsc[] = {
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[] = {
LV_GRID_CONTENT, /*Name*/
LV_GRID_CONTENT, /*Description*/
LV_GRID_CONTENT, /*Email*/
@ -421,8 +421,8 @@ static void profile_create(lv_obj_t * parent)
LV_GRID_TEMPLATE_LAST
};
static lv_coord_t grid_2_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_2_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*/
5, /*Separator*/
LV_GRID_CONTENT, /*Box title*/
@ -477,28 +477,28 @@ static void profile_create(lv_obj_t * parent)
lv_obj_set_grid_cell(sw1, LV_GRID_ALIGN_START, 0, 1, LV_GRID_ALIGN_START, 7, 1);
}
else if(disp_size == DISP_SMALL) {
static lv_coord_t grid_main_col_dsc[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_main_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
static int32_t grid_main_col_dsc[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
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 lv_coord_t grid_1_col_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_1_row_dsc[] = {LV_GRID_CONTENT, /*Avatar*/
LV_GRID_CONTENT, /*Name*/
LV_GRID_CONTENT, /*Description*/
LV_GRID_CONTENT, /*Email*/
LV_GRID_CONTENT, /*Phone number*/
LV_GRID_CONTENT, /*Button1*/
LV_GRID_CONTENT, /*Button2*/
LV_GRID_TEMPLATE_LAST
};
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*/
LV_GRID_CONTENT, /*Name*/
LV_GRID_CONTENT, /*Description*/
LV_GRID_CONTENT, /*Email*/
LV_GRID_CONTENT, /*Phone number*/
LV_GRID_CONTENT, /*Button1*/
LV_GRID_CONTENT, /*Button2*/
LV_GRID_TEMPLATE_LAST
};
lv_obj_set_grid_dsc_array(panel1, grid_1_col_dsc, grid_1_row_dsc);
static lv_coord_t grid_2_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_2_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*/
5, /*Separator*/
LV_GRID_CONTENT, /*Box title*/
@ -554,8 +554,8 @@ 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 lv_coord_t col_dsc[] = {40, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const lv_coord_t row_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), 40, LV_GRID_TEMPLATE_LAST};
static const int32_t col_dsc[] = {40, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const int32_t row_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), 40, LV_GRID_TEMPLATE_LAST};
lv_obj_set_grid_dsc_array(parent, col_dsc, row_dsc);
lv_obj_set_style_pad_column(parent, 0, 0);
@ -653,7 +653,7 @@ static void analytics_create(lv_obj_t * parent)
if(disp_size < DISP_LARGE) lv_obj_add_flag(lv_obj_get_parent(scale3), LV_OBJ_FLAG_FLEX_IN_NEW_TRACK);
lv_obj_update_layout(parent);
lv_coord_t scale_w;
int32_t scale_w;
if(disp_size == DISP_MEDIUM) {
scale_w = 200;
lv_obj_set_size(scale1, scale_w, scale_w);
@ -907,8 +907,8 @@ void shop_create(lv_obj_t * parent)
lv_chart_set_next_value(chart3, ser4, lv_rand(60, 90));
if(disp_size == DISP_LARGE) {
static lv_coord_t grid1_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid1_row_dsc[] = {
static int32_t grid1_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t grid1_row_dsc[] = {
LV_GRID_CONTENT, /*Title*/
LV_GRID_CONTENT, /*Sub title*/
20, /*Spacer*/
@ -929,8 +929,8 @@ void shop_create(lv_obj_t * parent)
lv_obj_set_grid_cell(chart3, LV_GRID_ALIGN_STRETCH, 1, 1, LV_GRID_ALIGN_STRETCH, 0, 5);
}
else if(disp_size == DISP_MEDIUM) {
static lv_coord_t grid1_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid1_row_dsc[] = {
static int32_t grid1_col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t grid1_row_dsc[] = {
LV_GRID_CONTENT, /*Title + Date*/
LV_GRID_CONTENT, /*Amount + Hint*/
200, /*Chart*/
@ -949,8 +949,8 @@ void shop_create(lv_obj_t * parent)
lv_obj_set_grid_cell(chart3, LV_GRID_ALIGN_END, 0, 2, LV_GRID_ALIGN_STRETCH, 2, 1);
}
else if(disp_size == DISP_SMALL) {
static lv_coord_t grid1_col_dsc[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid1_row_dsc[] = {
static int32_t grid1_col_dsc[] = {LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t grid1_row_dsc[] = {
LV_GRID_CONTENT, /*Title*/
LV_GRID_CONTENT, /*Date*/
LV_GRID_CONTENT, /*Amount*/
@ -1095,8 +1095,8 @@ static void color_changer_create(lv_obj_t * parent)
static void color_changer_anim_cb(void * var, int32_t v)
{
lv_obj_t * obj = var;
lv_coord_t max_w = lv_obj_get_width(lv_obj_get_parent(obj)) - LV_DPX(20);
lv_coord_t w;
int32_t max_w = lv_obj_get_width(lv_obj_get_parent(obj)) - LV_DPX(20);
int32_t w;
if(disp_size == DISP_SMALL) {
w = lv_map(v, 0, 256, LV_DPX(52), max_w);
@ -1215,8 +1215,8 @@ static lv_obj_t * create_scale_box(lv_obj_t * parent, const char * title, const
lv_label_set_text(label3, text3);
if(disp_size == DISP_MEDIUM) {
static lv_coord_t grid_col_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_FR(8), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t grid_col_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_FR(8), LV_GRID_TEMPLATE_LAST};
static int32_t grid_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
lv_obj_set_grid_dsc_array(cont, grid_col_dsc, grid_row_dsc);
lv_obj_set_grid_cell(title_label, LV_GRID_ALIGN_START, 0, 4, LV_GRID_ALIGN_START, 0, 1);
@ -1229,8 +1229,8 @@ static lv_obj_t * create_scale_box(lv_obj_t * parent, const char * title, const
lv_obj_set_grid_cell(label3, LV_GRID_ALIGN_STRETCH, 3, 1, LV_GRID_ALIGN_CENTER, 4, 1);
}
else {
static lv_coord_t grid_col_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
static int32_t grid_col_dsc[] = {LV_GRID_CONTENT, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t grid_row_dsc[] = {LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
lv_obj_set_grid_dsc_array(cont, grid_col_dsc, grid_row_dsc);
lv_obj_set_grid_cell(title_label, LV_GRID_ALIGN_START, 0, 2, LV_GRID_ALIGN_START, 0, 1);
lv_obj_set_grid_cell(scale, LV_GRID_ALIGN_START, 0, 2, LV_GRID_ALIGN_START, 1, 1);
@ -1247,8 +1247,8 @@ static lv_obj_t * create_scale_box(lv_obj_t * parent, const char * title, const
static lv_obj_t * create_shop_item(lv_obj_t * parent, const void * img_src, const char * name, const char * category,
const char * price)
{
static lv_coord_t grid_col_dsc[] = {LV_GRID_CONTENT, 5, LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t grid_row_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t grid_col_dsc[] = {LV_GRID_CONTENT, 5, LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t grid_row_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
lv_obj_t * cont = lv_obj_create(parent);
lv_obj_remove_style_all(cont);
@ -1356,7 +1356,7 @@ static void slider_event_cb(lv_event_t * e)
lv_obj_t * obj = lv_event_get_target(e);
if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) {
lv_coord_t * s = lv_event_get_param(e);
int32_t * s = lv_event_get_param(e);
*s = LV_MAX(*s, 60);
}
else if(code == LV_EVENT_DRAW_TASK_ADDED) {
@ -1428,9 +1428,9 @@ static void chart_event_cb(lv_event_t * e)
tri_dsc.p[2].y = (int32_t)LV_MAX(draw_line_dsc->p1_y, draw_line_dsc->p2_y);
tri_dsc.bg_grad.dir = LV_GRAD_DIR_VER;
lv_coord_t full_h = lv_obj_get_height(obj);
lv_coord_t fract_uppter = (int32_t)(LV_MIN(draw_line_dsc->p1_y, draw_line_dsc->p2_y) - obj->coords.y1) * 255 / full_h;
lv_coord_t fract_lower = (int32_t)(LV_MAX(draw_line_dsc->p1_y, draw_line_dsc->p2_y) - obj->coords.y1) * 255 / full_h;
int32_t full_h = lv_obj_get_height(obj);
int32_t fract_uppter = (int32_t)(LV_MIN(draw_line_dsc->p1_y, draw_line_dsc->p2_y) - obj->coords.y1) * 255 / full_h;
int32_t fract_lower = (int32_t)(LV_MAX(draw_line_dsc->p1_y, draw_line_dsc->p2_y) - obj->coords.y1) * 255 / full_h;
tri_dsc.bg_grad.stops[0].color = ser->color;
tri_dsc.bg_grad.stops[0].opa = 255 - fract_uppter;
tri_dsc.bg_grad.stops[0].frac = 0;

View File

@ -21,7 +21,7 @@ Naming and API
`LINK <https://github.com/lvgl/lvgl/pull/3390#discussion_r885915769>`__
- |check| Replace `disp_drv->direct_mode/full_refresh` with enum.
- |check| Consider flat directory structure. E.g. `extra/widgets` to `widgets`
- |uncheck| Use `uint32_t` and `int32_t` in APIs where possible. Consider hardcoding `lv_coord_t` as `int32_t`.
- |uncheck| Use `uint32_t` and `int32_t` in APIs where possible. Consider hardcoding `int32_t` as `int32_t`.
- |check| To define a new stdlib API use defines `LV_USE_CUSTOM_...` and
let the user implement `lv_...` functions somewhere (instead of defining the name of the custom functions)
(see `here <https://github.com/lvgl/lvgl/issues/3481#issuecomment-1206434501>`__)
@ -45,12 +45,12 @@ Architecture
- |check| Drop `lv_mem_buf_get` as tlsf should be fast enough for normal allocations too.
Fragmentation is also lower if processes can completely clean up after themselves.
- |check| More color formats: 24 bit, ARGB1555, ARGB4444 etc
(see `here <https://forum.lvgl.io/t/keypad-input-device-why-lv-event-long-pressed-only-on-enter/10263>`__)
(see `here <https://forum.lvgl.io/t/keypad-input-device-why-lv-event-long-pressed-only-on-enter/10263>`__)
- |check| Unified caching #3116 #3415
- |check| Variable binding. I.e create properties which can be bound to objects and those objects are notified on value change. Maybe based on `lv_msg`?
- |uncheck| Add GPU abstraction for display rotation
- |uncheck| Add GPU abstraction for display rotation
- |check| Replace the `read_line_cb` of the image decoders with `get_area_cb`
- |check| Limit the image caching size in bytes instead of image count
- |check| Limit the image caching size in bytes instead of image count
- |check| lv_draw_buf for unified stride, buffer and cache invalidation management. `4241 <https://github.com/lvgl/lvgl/pull/4241>`__
- |uncheck| SVG support: integrate an SVG render library `4388 <https://github.com/lvgl/lvgl/issues/4388>`__
- |uncheck| Introduce optional ``float`` support. `4648 <https://github.com/lvgl/lvgl/issues/4648>`__

View File

@ -43,8 +43,8 @@ For example:
.. code:: c
static lv_coord_t column_dsc[] = {100, 400, LV_GRID_TEMPLATE_LAST}; /*2 columns with 100 and 400 ps width*/
static lv_coord_t row_dsc[] = {100, 100, 100, LV_GRID_TEMPLATE_LAST}; /*3 100 px tall rows*/
static int32_t column_dsc[] = {100, 400, LV_GRID_TEMPLATE_LAST}; /*2 columns with 100 and 400 ps width*/
static int32_t row_dsc[] = {100, 100, 100, LV_GRID_TEMPLATE_LAST}; /*3 100 px tall rows*/
To set the descriptors on a parent use
:c:expr:`lv_obj_set_grid_dsc_array(obj, col_dsc, row_dsc)`.

View File

@ -256,10 +256,10 @@ the following functions:
.. code:: c
lv_coord_t w = lv_obj_get_width(obj);
lv_coord_t h = lv_obj_get_height(obj);
lv_coord_t content_w = lv_obj_get_content_width(obj);
lv_coord_t content_h = lv_obj_get_content_height(obj);
int32_t w = lv_obj_get_width(obj);
int32_t h = lv_obj_get_height(obj);
int32_t content_w = lv_obj_get_content_width(obj);
int32_t content_h = lv_obj_get_content_height(obj);
Using styles
************

View File

@ -73,7 +73,7 @@ draw the button under the text and it's not necessary to redraw the
display under the rest of the button too.
The difference between buffering modes regarding the drawing mechanism
is the following:
is the following:
1. **One buffer** - LVGL needs to wait for :cpp:func:`lv_disp_flush_ready` (called from ``flush_cb``) before starting to redraw the next part.
2. **Two buffers** - LVGL can immediately draw to the second buffer when the first is sent to ``flush_cb`` because the
@ -128,14 +128,14 @@ applied real-time:
- :cpp:enumerator:`LV_DRAW_MASK_TYPE_MAP`: The mask is stored in a bitmap array and the
necessary parts are applied
Masks are used to create almost every basic primitive:
Masks are used to create almost every basic primitive:
- **letters**: Create a mask from the letter and draw a rectangle with the letter's color using the mask.
- **line**: Created from four "line masks" to mask out the left, right, top and bottom part of the line to get a perfectly perpendicular perimeter.
- **rounded rectangle**: A mask is created real-time to add a radius to the corners.
- **clip corner**: To clip overflowing content (usually children) on rounded corners, a rounded rectangle mask is also applied.
- **rectangle border**: Same as a rounded rectangle but the inner part is masked out too.
- **arc drawing**: A circular border is drawn but an arc mask is applied too.
- **line**: Created from four "line masks" to mask out the left, right, top and bottom part of the line to get a perfectly perpendicular perimeter.
- **rounded rectangle**: A mask is created real-time to add a radius to the corners.
- **clip corner**: To clip overflowing content (usually children) on rounded corners, a rounded rectangle mask is also applied.
- **rectangle border**: Same as a rounded rectangle but the inner part is masked out too.
- **arc drawing**: A circular border is drawn but an arc mask is applied too.
- **ARGB images**: The alpha channel is separated into a mask and the image is drawn as a normal RGB image.
Using masks
@ -287,7 +287,7 @@ documentation.
uint32_t text_length; /**< Size of the text buffer containing null-terminated text string calculated during drawing.*/
uint32_t part; /**< The current part for which the event is sent*/
uint32_t id; /**< The index of the part. E.g. a button's index on button matrix or table cell index.*/
lv_coord_t radius; /**< E.g. the radius of an arc (not the corner radius).*/
int32_t radius; /**< E.g. the radius of an arc (not the corner radius).*/
int32_t value; /**< A value calculated during drawing. E.g. Chart's tick line value.*/
const void * sub_part_ptr; /**< A pointer the identifies something in the part. E.g. chart series. */
} lv_obj_draw_part_dsc_t;

View File

@ -107,7 +107,7 @@ Drawing events
--------------
- :cpp:enumerator:`LV_EVENT_COVER_CHECK`: Check if an object fully covers an area. The event parameter is :cpp:struct:`lv_cover_check_info_t` ``*``.
- :cpp:enumerator:`LV_EVENT_REFR_EXT_DRAW_SIZE`: Get the required extra draw area around an object (e.g. for a shadow). The event parameter is :cpp:type:`lv_coord_t` ``*`` to store the size. Only overwrite it with a larger value.
- :cpp:enumerator:`LV_EVENT_REFR_EXT_DRAW_SIZE`: Get the required extra draw area around an object (e.g. for a shadow). The event parameter is :cpp:type:`int32_t` ``*`` to store the size. Only overwrite it with a larger value.
- :cpp:enumerator:`LV_EVENT_DRAW_MAIN_BEGIN`: Starting the main drawing phase.
- :cpp:enumerator:`LV_EVENT_DRAW_MAIN`: Perform the main drawing
- :cpp:enumerator:`LV_EVENT_DRAW_MAIN_END`: Finishing the main drawing phase

View File

@ -354,12 +354,12 @@ to open is an animation.
Image post-processing
---------------------
Considering that some hardware has special requirements for image formats,
such as alpha premultiplication and stride alignment, most image decoders (such as PNG decoders)
may not directly output image data that meets hardware requirements.
Considering that some hardware has special requirements for image formats,
such as alpha premultiplication and stride alignment, most image decoders (such as PNG decoders)
may not directly output image data that meets hardware requirements.
For this reason, LVGL provides a solution for image post-processing.
First, call a custom post-processing function after ``lv_image_decoder_open`` to adjust the data in the image cache,
For this reason, LVGL provides a solution for image post-processing.
First, call a custom post-processing function after ``lv_image_decoder_open`` to adjust the data in the image cache,
and then mark the processing status in ``cache_entry->process_state`` (to avoid repeated post-processing).
See the detailed code below:
@ -402,8 +402,8 @@ See the detailed code below:
}
if(!(entry->process_state & IMAGE_PROCESS_STATE_STRIDE_ALIGNED)) {
lv_coord_t image_w = dsc->header.w;
lv_coord_t image_h = dsc->header.h;
int32_t image_w = dsc->header.w;
int32_t image_h = dsc->header.h;
uint32_t width_byte = image_w * lv_color_format_get_size(color_format);
uint32_t stride = lv_draw_buf_width_to_stride(image_w, color_format);
@ -426,7 +426,7 @@ See the detailed code below:
/* Copy image data */
const uint8_t * cur = ori_image;
for(lv_coord_t y = 0; y < image_h; y++) {
for(int32_t y = 0; y < image_h; y++) {
lv_memcpy(new_image, cur, width_byte);
new_image += stride;
cur += width_byte;

View File

@ -176,14 +176,14 @@ can do custom GPU operations. Here is a complete example:
dsc->blend_mode == LV_BLEND_MODE_NORMAL && lv_area_get_size(&blend_area) > 100) {
/*Got the first pixel on the buffer*/
lv_coord_t dest_stride = lv_area_get_width(draw_ctx->buf_area); /*Width of the destination buffer*/
int32_t dest_stride = lv_area_get_width(draw_ctx->buf_area); /*Width of the destination buffer*/
lv_color_t * dest_buf = draw_ctx->buf;
dest_buf += dest_stride * (blend_area.y1 - draw_ctx->buf_area->y1) + (blend_area.x1 - draw_ctx->buf_area->x1);
/*Make the blend area relative to the buffer*/
/*Make the blend area relative to the buffer*/
lv_area_move(&blend_area, -draw_ctx->buf_area->x1, -draw_ctx->buf_area->y1);
/*Call your custom gou fill function to fill blend_area, on dest_buf with dsc->color*/
/*Call your custom gou fill function to fill blend_area, on dest_buf with dsc->color*/
my_gpu_fill(dest_buf, dest_stride, &blend_area, dsc->color);
}
/*Fallback: the GPU doesn't support these settings. Call the SW renderer.*/
@ -199,7 +199,7 @@ The implementation of wait callback is much simpler:
void my_gpu_wait(lv_draw_ctx_t * draw_ctx)
{
while(my_gpu_is_working());
/*Call SW renderer's wait callback too*/
lv_draw_sw_wait_for_finish(draw_ctx);
}
@ -220,12 +220,12 @@ rectangles you can replace the original software drawer too. A custom
{
/*Draw the background*/
my_bg_drawer(draw_ctx, coords, dsc->bg_color, dsc->radius);
/*Draw the border if any*/
if(dsc->border_width) {
my_border_drawer(draw_ctx, coords, dsc->border_width, dsc->border_color, dsc->border_opa)
}
/*Draw the outline if any*/
if(dsc->outline_width) {
my_outline_drawer(draw_ctx, coords, dsc->outline_width, dsc->outline_color, dsc->outline_opa, dsc->outline_pad)

View File

@ -69,7 +69,7 @@ an array for the data points. ``axis`` can have the following values:
:cpp:expr:`lv_chart_set_ext_y_array(chart, ser, value_array)` makes the chart
use an external array for the given series. ``value_array`` should look
like this: ``lv_coord_t * value_array[num_points]``. The array size
like this: ``int32_t * value_array[num_points]``. The array size
needs to be large enough to hold all the points of that series. The
array's pointer will be saved in the chart so it needs to be global,
static or dynamically allocated. Note: you should call

View File

@ -36,8 +36,8 @@ static void anim_x_cb(void * var, int32_t v);
*/
void lv_example_anim_3(void)
{
static lv_coord_t col_dsc[] = {LV_GRID_FR(1), 200, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static lv_coord_t row_dsc[] = {30, 10, 10, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t col_dsc[] = {LV_GRID_FR(1), 200, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static int32_t row_dsc[] = {30, 10, 10, LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
/*Create a container with grid*/
lv_obj_t * cont = lv_obj_create(lv_screen_active());

View File

@ -7,8 +7,8 @@ static lv_obj_t * obj1 = NULL;
static lv_obj_t * obj2 = NULL;
static lv_obj_t * obj3 = NULL;
static const lv_coord_t obj_width = 90;
static const lv_coord_t obj_height = 70;
static const int32_t obj_width = 90;
static const int32_t obj_height = 70;
static void set_width(void * var, int32_t v)
{

View File

@ -6,8 +6,8 @@
*/
void lv_example_grid_1(void)
{
static lv_coord_t col_dsc[] = {70, 70, 70, LV_GRID_TEMPLATE_LAST};
static lv_coord_t row_dsc[] = {50, 50, 50, LV_GRID_TEMPLATE_LAST};
static int32_t col_dsc[] = {70, 70, 70, LV_GRID_TEMPLATE_LAST};
static int32_t row_dsc[] = {50, 50, 50, LV_GRID_TEMPLATE_LAST};
/*Create a container with grid*/
lv_obj_t * cont = lv_obj_create(lv_screen_active());

View File

@ -7,8 +7,8 @@
*/
void lv_example_grid_2(void)
{
static lv_coord_t col_dsc[] = {70, 70, 70, LV_GRID_TEMPLATE_LAST};
static lv_coord_t row_dsc[] = {50, 50, 50, LV_GRID_TEMPLATE_LAST};
static int32_t col_dsc[] = {70, 70, 70, LV_GRID_TEMPLATE_LAST};
static int32_t row_dsc[] = {50, 50, 50, LV_GRID_TEMPLATE_LAST};
/*Create a container with grid*/
lv_obj_t * cont = lv_obj_create(lv_screen_active());

View File

@ -9,12 +9,12 @@ void lv_example_grid_3(void)
/*Column 1: fix width 60 px
*Column 2: 1 unit from the remaining free space
*Column 3: 2 unit from the remaining free space*/
static lv_coord_t col_dsc[] = {60, LV_GRID_FR(1), LV_GRID_FR(2), LV_GRID_TEMPLATE_LAST};
static int32_t col_dsc[] = {60, LV_GRID_FR(1), LV_GRID_FR(2), LV_GRID_TEMPLATE_LAST};
/*Row 1: fix width 50 px
*Row 2: 1 unit from the remaining free space
*Row 3: fix width 50 px*/
static lv_coord_t row_dsc[] = {50, LV_GRID_FR(1), 50, LV_GRID_TEMPLATE_LAST};
static int32_t row_dsc[] = {50, LV_GRID_FR(1), 50, LV_GRID_TEMPLATE_LAST};
/*Create a container with grid*/
lv_obj_t * cont = lv_obj_create(lv_screen_active());

View File

@ -6,8 +6,8 @@
*/
void lv_example_grid_4(void)
{
static lv_coord_t col_dsc[] = {60, 60, 60, LV_GRID_TEMPLATE_LAST};
static lv_coord_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST};
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)*/

View File

@ -18,8 +18,8 @@ void lv_example_grid_5(void)
{
/*60x60 cells*/
static lv_coord_t col_dsc[] = {60, 60, 60, LV_GRID_TEMPLATE_LAST};
static lv_coord_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST};
static int32_t col_dsc[] = {60, 60, 60, LV_GRID_TEMPLATE_LAST};
static int32_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST};
/*Create a container with grid*/
lv_obj_t * cont = lv_obj_create(lv_screen_active());

View File

@ -7,8 +7,8 @@
void lv_example_grid_6(void)
{
static lv_coord_t col_dsc[] = {60, 60, 60, LV_GRID_TEMPLATE_LAST};
static lv_coord_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST};
static int32_t col_dsc[] = {60, 60, 60, LV_GRID_TEMPLATE_LAST};
static int32_t row_dsc[] = {45, 45, 45, LV_GRID_TEMPLATE_LAST};
/*Create a container with grid*/
lv_obj_t * cont = lv_obj_create(lv_screen_active());

View File

@ -38,8 +38,8 @@ void lv_example_fragment_2(void)
lv_obj_t * root = lv_obj_create(lv_screen_active());
lv_obj_set_size(root, LV_PCT(100), LV_PCT(100));
lv_obj_set_layout(root, LV_LAYOUT_GRID);
static const lv_coord_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const lv_coord_t row_dsc[] = {LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
static const int32_t col_dsc[] = {LV_GRID_FR(1), LV_GRID_FR(1), LV_GRID_TEMPLATE_LAST};
static const int32_t row_dsc[] = {LV_GRID_FR(1), LV_GRID_CONTENT, LV_GRID_TEMPLATE_LAST};
lv_obj_set_grid_dsc_array(root, col_dsc, row_dsc);
container = lv_obj_create(root);
lv_obj_remove_style_all(container);

View File

@ -7,7 +7,7 @@
LV_IMAGE_DECLARE(emoji_F617)
char path_buf[128];
static const void * get_imgfont_path(const lv_font_t * font, uint32_t unicode, uint32_t unicode_next,
lv_coord_t * offset_y, void * user_data)
int32_t * offset_y, void * user_data)
{
LV_UNUSED(font);
LV_UNUSED(unicode_next);

View File

@ -4,7 +4,7 @@
void lv_example_monkey_3(void)
{
static lv_point_t btn_points[3];
lv_coord_t hor_res = LV_HOR_RES;
int32_t hor_res = LV_HOR_RES;
/*Create button monkey test*/
lv_monkey_config_t config;

View File

@ -26,12 +26,12 @@
static void touchpad_init(void);
static void touchpad_read(lv_indev_t * indev, lv_indev_data_t * data);
static bool touchpad_is_pressed(void);
static void touchpad_get_xy(lv_coord_t * x, lv_coord_t * y);
static void touchpad_get_xy(int32_t * x, int32_t * y);
static void mouse_init(void);
static void mouse_read(lv_indev_t * indev, lv_indev_data_t * data);
static bool mouse_is_pressed(void);
static void mouse_get_xy(lv_coord_t * x, lv_coord_t * y);
static void mouse_get_xy(int32_t * x, int32_t * y);
static void keypad_init(void);
static void keypad_read(lv_indev_t * indev, lv_indev_data_t * data);
@ -182,8 +182,8 @@ static void touchpad_init(void)
/*Will be called by the library to read the touchpad*/
static void touchpad_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
{
static lv_coord_t last_x = 0;
static lv_coord_t last_y = 0;
static int32_t last_x = 0;
static int32_t last_y = 0;
/*Save the pressed coordinates and the state*/
if(touchpad_is_pressed()) {
@ -208,7 +208,7 @@ static bool touchpad_is_pressed(void)
}
/*Get the x and y coordinates if the touchpad is pressed*/
static void touchpad_get_xy(lv_coord_t * x, lv_coord_t * y)
static void touchpad_get_xy(int32_t * x, int32_t * y)
{
/*Your code comes here*/
@ -250,7 +250,7 @@ static bool mouse_is_pressed(void)
}
/*Get the x and y coordinates if the mouse is pressed*/
static void mouse_get_xy(lv_coord_t * x, lv_coord_t * y)
static void mouse_get_xy(int32_t * x, int32_t * y)
{
/*Your code comes here*/

View File

@ -7,9 +7,9 @@ static void scroll_event_cb(lv_event_t * e)
lv_area_t cont_a;
lv_obj_get_coords(cont, &cont_a);
lv_coord_t cont_y_center = cont_a.y1 + lv_area_get_height(&cont_a) / 2;
int32_t cont_y_center = cont_a.y1 + lv_area_get_height(&cont_a) / 2;
lv_coord_t r = lv_obj_get_height(cont) * 7 / 10;
int32_t r = lv_obj_get_height(cont) * 7 / 10;
uint32_t i;
uint32_t child_cnt = lv_obj_get_child_cnt(cont);
for(i = 0; i < child_cnt; i++) {
@ -17,13 +17,13 @@ static void scroll_event_cb(lv_event_t * e)
lv_area_t child_a;
lv_obj_get_coords(child, &child_a);
lv_coord_t child_y_center = child_a.y1 + lv_area_get_height(&child_a) / 2;
int32_t child_y_center = child_a.y1 + lv_area_get_height(&child_a) / 2;
lv_coord_t diff_y = child_y_center - cont_y_center;
int32_t diff_y = child_y_center - cont_y_center;
diff_y = LV_ABS(diff_y);
/*Get the x of diff_y on a circle.*/
lv_coord_t x;
int32_t x;
/*If diff_y is out of the circle use the last point of the circle (the radius)*/
if(diff_y >= r) {
x = r;

View File

@ -11,7 +11,7 @@ static void event_cb(lv_event_t * e)
lv_obj_invalidate(chart);
}
if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) {
lv_coord_t * s = lv_event_get_param(e);
int32_t * s = lv_event_get_param(e);
*s = LV_MAX(*s, 20);
}
else if(code == LV_EVENT_DRAW_POST_END) {
@ -25,8 +25,8 @@ static void event_cb(lv_event_t * e)
lv_point_t p;
lv_chart_get_point_pos_by_id(chart, ser, id, &p);
lv_coord_t * y_array = lv_chart_get_y_array(chart, ser);
lv_coord_t value = y_array[id];
int32_t * y_array = lv_chart_get_y_array(chart, ser);
int32_t value = y_array[id];
char buf[16];
lv_snprintf(buf, sizeof(buf), LV_SYMBOL_DUMMY"$%d", value);

View File

@ -11,8 +11,8 @@ static void draw_event_cb(lv_event_t * e)
lv_draw_fill_dsc_t * fill_dsc = draw_task->draw_dsc;
lv_obj_t * chart = lv_event_get_target(e);
lv_coord_t * y_array = lv_chart_get_y_array(chart, lv_chart_get_series_next(chart, NULL));
lv_coord_t v = y_array[base_dsc->id2];
int32_t * y_array = lv_chart_get_y_array(chart, lv_chart_get_series_next(chart, NULL));
int32_t v = y_array[base_dsc->id2];
uint32_t ratio = v * 255 / 100;
fill_dsc->color = lv_color_mix(lv_palette_main(LV_PALETTE_GREEN), lv_palette_main(LV_PALETTE_RED), ratio);

View File

@ -10,8 +10,6 @@ def event_cb(e):
chart.invalidate()
if code == lv.EVENT.REFR_EXT_DRAW_SIZE:
# s = lv.coord_t.__cast__(e.get_param())
# print("s: {:d}".format(s))
e.set_ext_draw_size(20)
elif code == lv.EVENT.DRAW_POST_END:

View File

@ -70,9 +70,9 @@ static void add_faded_area(lv_event_t * e)
tri_dsc.p[2].y = LV_MAX(draw_line_dsc->p1_y, draw_line_dsc->p2_y);
tri_dsc.bg_grad.dir = LV_GRAD_DIR_VER;
lv_coord_t full_h = lv_obj_get_height(obj);
lv_coord_t fract_uppter = (int32_t)(LV_MIN(draw_line_dsc->p1_y, draw_line_dsc->p2_y) - obj->coords.y1) * 255 / full_h;
lv_coord_t fract_lower = (int32_t)(LV_MAX(draw_line_dsc->p1_y, draw_line_dsc->p2_y) - obj->coords.y1) * 255 / full_h;
int32_t full_h = lv_obj_get_height(obj);
int32_t fract_uppter = (int32_t)(LV_MIN(draw_line_dsc->p1_y, draw_line_dsc->p2_y) - obj->coords.y1) * 255 / full_h;
int32_t fract_lower = (int32_t)(LV_MAX(draw_line_dsc->p1_y, draw_line_dsc->p2_y) - obj->coords.y1) * 255 / full_h;
tri_dsc.bg_grad.stops[0].color = ser->color;
tri_dsc.bg_grad.stops[0].opa = 255 - fract_uppter;
tri_dsc.bg_grad.stops[0].frac = 0;

View File

@ -15,8 +15,8 @@ static void draw_event_cb(lv_event_t * e)
rect_draw_dsc->bg_opa = (LV_OPA_COVER * base_dsc->id2) / (cnt - 1);
/*Make smaller values blue, higher values red*/
lv_coord_t * x_array = lv_chart_get_x_array(obj, ser);
lv_coord_t * y_array = lv_chart_get_y_array(obj, ser);
int32_t * x_array = lv_chart_get_x_array(obj, ser);
int32_t * y_array = lv_chart_get_y_array(obj, ser);
/*dsc->id is the tells drawing order, but we need the ID of the point being drawn.*/
uint32_t start_point = lv_chart_get_x_start_point(obj, ser);
uint32_t p_act = (start_point + base_dsc->id2) % cnt; /*Consider start point to get the index of the array*/

View File

@ -11,7 +11,7 @@ static void add_data(lv_timer_t * t)
uint16_t p = lv_chart_get_point_count(chart);
uint16_t s = lv_chart_get_x_start_point(chart, ser);
lv_coord_t * a = lv_chart_get_y_array(chart, ser);
int32_t * a = lv_chart_get_y_array(chart, ser);
a[(s + 1) % p] = LV_CHART_POINT_NONE;
a[(s + 2) % p] = LV_CHART_POINT_NONE;

View File

@ -11,8 +11,8 @@ static void drag_event_handler(lv_event_t * e)
lv_point_t vect;
lv_indev_get_vect(indev, &vect);
lv_coord_t x = lv_obj_get_x(obj) + vect.x;
lv_coord_t y = lv_obj_get_y(obj) + vect.y;
int32_t x = lv_obj_get_x(obj) + vect.x;
int32_t y = lv_obj_get_y(obj) + vect.y;
lv_obj_set_pos(obj, x, y);
}

View File

@ -17,8 +17,8 @@ static void mask_event_cb(lv_event_t * e)
else if(code == LV_EVENT_DRAW_MAIN_BEGIN) {
/* add mask */
const lv_font_t * font = lv_obj_get_style_text_font(obj, LV_PART_MAIN);
lv_coord_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN);
lv_coord_t font_h = lv_font_get_line_height(font);
int32_t line_space = lv_obj_get_style_text_line_space(obj, LV_PART_MAIN);
int32_t font_h = lv_font_get_line_height(font);
lv_area_t roller_coords;
lv_obj_get_coords(obj, &roller_coords);

View File

@ -30,7 +30,7 @@ void lv_example_spinbox_1(void)
lv_obj_set_width(spinbox, 100);
lv_obj_center(spinbox);
lv_coord_t h = lv_obj_get_height(spinbox);
int32_t h = lv_obj_get_height(spinbox);
lv_obj_t * btn = lv_button_create(lv_screen_active());
lv_obj_set_size(btn, h, h);

View File

@ -7,35 +7,35 @@ import sys
props = [
{'section': 'Size and position', 'dsc':'Properties related to size, position, alignment and layout of the objects.' },
{'name': 'WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':'Widget dependent', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':'Widget dependent', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the width of object. Pixel, percentage and `LV_SIZE_CONTENT` values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'MIN_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets a minimal width. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'MAX_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':'LV_COORD_MAX', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':'LV_COORD_MAX', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets a maximal width. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'HEIGHT',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':'Widget dependent', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':'Widget dependent', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the height of object. Pixel, percentage and `LV_SIZE_CONTENT` can be used. Percentage values are relative to the height of the parent's content area."},
{'name': 'MIN_HEIGHT',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets a minimal height. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'MAX_HEIGHT',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':'LV_COORD_MAX', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':'LV_COORD_MAX', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets a maximal height. Pixel and percentage values can be used. Percentage values are relative to the height of the parent's content area."},
{'name': 'X',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the X coordinate of the object considering the set `align`. Pixel and percentage values can be used. Percentage values are relative to the width of the parent's content area."},
{'name': 'Y',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the Y coordinate of the object considering the set `align`. Pixel and percentage values can be used. Percentage values are relative to the height of the parent's content area."},
{'name': 'ALIGN',
@ -43,81 +43,81 @@ props = [
'dsc': "Set the alignment which tells from which point of the parent the X and Y coordinates should be interpreted. The possible values are: `LV_ALIGN_DEFAULT`, `LV_ALIGN_TOP_LEFT/MID/RIGHT`, `LV_ALIGN_BOTTOM_LEFT/MID/RIGHT`, `LV_ALIGN_LEFT/RIGHT_MID`, `LV_ALIGN_CENTER`. `LV_ALIGN_DEFAULT` means `LV_ALIGN_TOP_LEFT` with LTR base direction and `LV_ALIGN_TOP_RIGHT` with RTL base direction."},
{'name': 'TRANSFORM_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Make the object wider on both sides with this value. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's width." },
{'name': 'TRANSFORM_HEIGHT',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Make the object higher on both sides with this value. Pixel and percentage (with `lv_pct(x)`) values can be used. Percentage values are relative to the object's height." },
{'name': 'TRANSLATE_X',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Move the object with this value in X 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 width." },
{'name': 'TRANSLATE_Y',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_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_SCALE_X',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'dsc': "Zoom an objects horizontally. The value 256 (or `LV_SCALE_NONE`) means normal size, 128 half size, 512 double size, and so on" },
{'name': 'TRANSFORM_SCALE_Y',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'dsc': "Zoom an objects vertically. The value 256 (or `LV_SCALE_NONE`) means normal size, 128 half size, 512 double size, and so on" },
{'name': 'TRANSFORM_ROTATION',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_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."},
{'name': 'TRANSFORM_PIVOT_X',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the pivot point's X coordinate for transformations. Relative to the object's top left corner'"},
{'name': 'TRANSFORM_PIVOT_Y',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the pivot point's Y coordinate for transformations. Relative to the object's top left corner'"},
{'section': 'Padding', 'dsc' : "Properties to describe spacing between the parent's sides and the children and among the children. Very similar to the padding properties in HTML."},
{'name': 'PAD_TOP',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding on the top. It makes the content area smaller in this direction."},
{'name': 'PAD_BOTTOM',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding on the bottom. It makes the content area smaller in this direction."},
{'name': 'PAD_LEFT',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding on the left. It makes the content area smaller in this direction."},
{'name': 'PAD_RIGHT',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding on the right. It makes the content area smaller in this direction."},
{'name': 'PAD_ROW',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding between the rows. Used by the layouts."},
{'name': 'PAD_COLUMN',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the padding between the columns. Used by the layouts."},
{'section': 'Margin', 'dsc' : "Properties to describe spacing around an object. Very similar to the margin properties in HTML."},
{'name': 'MARGIN_TOP',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the margin on the top. The object will keep this space from its siblings in layouts. "},
{'name': 'MARGIN_BOTTOM',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the margin on the bottom. The object will keep this space from its siblings in layouts."},
{'name': 'MARGIN_LEFT',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the margin on the left. The object will keep this space from its siblings in layouts."},
{'name': 'MARGIN_RIGHT',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Sets the margin on the right. The object will keep this space from its siblings in layouts."},
{'section': 'Background', 'dsc':'Properties to describe the background color and image of the objects.' },
@ -138,11 +138,11 @@ props = [
'dsc': "Set the direction of the gradient of the background. The possible values are `LV_GRAD_DIR_NONE/HOR/VER`."},
{'name': 'BG_MAIN_STOP',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the point from which the background color should start for gradients. 0 means to top/left side, 255 the bottom/right side, 128 the center, and so on"},
{'name': 'BG_GRAD_STOP',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':255, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':255, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the point from which the background's gradient color should start. 0 means to top/left side, 255 the bottom/right side, 128 the center, and so on"},
{'name': 'BG_MAIN_OPA',
@ -187,7 +187,7 @@ props = [
'dsc': "Set the opacity of the border. 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': 'BORDER_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the width of the border. Only pixel values can be used."},
{'name': 'BORDER_SIDE',
@ -200,7 +200,7 @@ props = [
{'section': 'Outline', 'dsc':'Properties to describe the outline. It\'s like a border but drawn outside of the rectangles.' },
{'name': 'OUTLINE_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the width of the outline in pixels. "},
{'name': 'OUTLINE_COLOR',
@ -212,24 +212,24 @@ props = [
'dsc': "Set the opacity of the outline. 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': 'OUTLINE_PAD',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the padding of the outline, i.e. the gap between object and the outline."},
{'section': 'Shadow', 'dsc':'Properties to describe the shadow drawn under the rectangles.' },
{'name': 'SHADOW_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the width of the shadow in pixels. The value should be >= 0."},
{'name': 'SHADOW_OFFSET_X',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set an offset on the shadow in pixels in X direction. "},
{'name': 'SHADOW_OFFSET_Y',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set an offset on the shadow in pixels in Y direction. "},
{'name': 'SHADOW_SPREAD',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Make the shadow calculation to use a larger or smaller rectangle as base. The value can be in pixel to make the area larger/smaller"},
{'name': 'SHADOW_COLOR',
@ -255,15 +255,15 @@ props = [
{'section': 'Line', 'dsc':'Properties to describe line-like objects' },
{'name': 'LINE_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the width of the lines in pixel."},
{'name': 'LINE_DASH_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the width of dashes in pixel. Note that dash works only on horizontal and vertical lines"},
{'name': 'LINE_DASH_GAP',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the gap between dashes in pixel. Note that dash works only on horizontal and vertical lines"},
{'name': 'LINE_ROUNDED',
@ -280,7 +280,7 @@ props = [
{'section': 'Arc', 'dsc':'TODO' },
{'name': 'ARC_WIDTH',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 1,
'dsc': "Set the width (thickness) of the arcs in pixel."},
{'name': 'ARC_ROUNDED',
@ -313,11 +313,11 @@ props = [
'dsc': "Set the font of the text (a pointer `lv_font_t *`). "},
{'name': 'TEXT_LETTER_SPACE',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 1, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 1, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the letter space in pixels"},
{'name': 'TEXT_LINE_SPACE',
'style_type': 'num', 'var_type': 'lv_coord_t' , 'default':0, 'inherited': 1, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t' , 'default':0, 'inherited': 1, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the line space in pixels."},
{'name': 'TEXT_DECOR',
@ -330,7 +330,7 @@ props = [
{'section': 'Miscellaneous', 'dsc':'Mixed properties for various purposes.' },
{'name': 'RADIUS',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':0, 'inherited': 0, 'layout': 0, 'ext_draw': 0,
'dsc': "Set the radius on every corner. The value is interpreted in pixel (>= 0) or `LV_RADIUS_CIRCLE` for max. radius"},
{'name': 'CLIP_CORNER',
@ -415,7 +415,7 @@ props = [
{'name': 'GRID_COLUMN_DSC_ARRAY',
'style_type': 'ptr', 'var_type': 'const lv_coord_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'ptr', 'var_type': 'const int32_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "An array to describe the columns of the grid. Should be LV_GRID_TEMPLATE_LAST terminated"},
{'name': 'GRID_COLUMN_ALIGN',
@ -424,7 +424,7 @@ props = [
{'name': 'GRID_ROW_DSC_ARRAY',
'style_type': 'ptr', 'var_type': 'const lv_coord_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'ptr', 'var_type': 'const int32_t *', 'default':'`NULL`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "An array to describe the rows of the grid. Should be LV_GRID_TEMPLATE_LAST terminated"},
{'name': 'GRID_ROW_ALIGN',
@ -432,7 +432,7 @@ props = [
'dsc': "Defines how to distribute the rows."},
{'name': 'GRID_CELL_COLUMN_POS',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the column in which the object should be placed"},
{'name': 'GRID_CELL_X_ALIGN',
@ -440,11 +440,11 @@ props = [
'dsc': "Set how to align the object horizontally."},
{'name': 'GRID_CELL_COLUMN_SPAN',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set how many columns the object should span. Needs to be >= 1"},
{'name': 'GRID_CELL_ROW_POS',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set the row in which the object should be placed"},
{'name': 'GRID_CELL_Y_ALIGN',
@ -452,7 +452,7 @@ props = [
'dsc': "Set how to align the object vertically."},
{'name': 'GRID_CELL_ROW_SPAN',
'style_type': 'num', 'var_type': 'lv_coord_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'style_type': 'num', 'var_type': 'int32_t', 'default':'`LV_GRID_ALIGN_START`', 'inherited': 0, 'layout': 1, 'ext_draw': 0,
'dsc': "Set how many rows the object should span. Needs to be >= 1"},
]

View File

@ -323,8 +323,8 @@ static void lv_obj_constructor(const lv_obj_class_t * class_p, lv_obj_t * obj)
lv_obj_t * parent = obj->parent;
if(parent) {
lv_coord_t sl = lv_obj_get_scroll_left(parent);
lv_coord_t st = lv_obj_get_scroll_top(parent);
int32_t sl = lv_obj_get_scroll_left(parent);
int32_t st = lv_obj_get_scroll_top(parent);
obj->coords.y1 = parent->coords.y1 + lv_obj_get_style_pad_top(parent, LV_PART_MAIN) - st;
obj->coords.y2 = obj->coords.y1 - 1;
@ -402,9 +402,9 @@ static void lv_obj_draw(lv_event_t * e)
}
/*Most trivial test. Is the mask fully IN the object? If no it surely doesn't cover it*/
lv_coord_t r = lv_obj_get_style_radius(obj, LV_PART_MAIN);
lv_coord_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN);
lv_coord_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN);
int32_t r = lv_obj_get_style_radius(obj, LV_PART_MAIN);
int32_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN);
int32_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN);
lv_area_t coords;
lv_area_copy(&coords, &obj->coords);
lv_area_increase(&coords, w, h);
@ -438,8 +438,8 @@ static void lv_obj_draw(lv_event_t * e)
draw_dsc.border_post = 1;
}
lv_coord_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN);
lv_coord_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN);
int32_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN);
int32_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN);
lv_area_t coords;
lv_area_copy(&coords, &obj->coords);
lv_area_increase(&coords, w, h);
@ -460,8 +460,8 @@ static void lv_obj_draw(lv_event_t * e)
draw_dsc.shadow_opa = LV_OPA_TRANSP;
lv_obj_init_draw_rect_dsc(obj, LV_PART_MAIN, &draw_dsc);
lv_coord_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN);
lv_coord_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN);
int32_t w = lv_obj_get_style_transform_width(obj, LV_PART_MAIN);
int32_t h = lv_obj_get_style_transform_height(obj, LV_PART_MAIN);
lv_area_t coords;
lv_area_copy(&coords, &obj->coords);
lv_area_increase(&coords, w, h);
@ -598,8 +598,8 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e)
else if(lv_obj_has_flag(obj, LV_OBJ_FLAG_SCROLLABLE | LV_OBJ_FLAG_SCROLL_WITH_ARROW) && !lv_obj_is_editable(obj)) {
/*scroll by keypad or encoder*/
lv_anim_enable_t anim_enable = LV_ANIM_OFF;
lv_coord_t sl = lv_obj_get_scroll_left(obj);
lv_coord_t sr = lv_obj_get_scroll_right(obj);
int32_t sl = lv_obj_get_scroll_left(obj);
int32_t sr = lv_obj_get_scroll_right(obj);
char c = *((char *)lv_event_get_param(e));
if(c == LV_KEY_DOWN) {
/*use scroll_to_x/y functions to enforce scroll limits*/
@ -666,7 +666,7 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e)
lv_obj_remove_state(obj, LV_STATE_FOCUSED | LV_STATE_EDITED | LV_STATE_FOCUS_KEY);
}
else if(code == LV_EVENT_SIZE_CHANGED) {
lv_coord_t align = lv_obj_get_style_align(obj, LV_PART_MAIN);
int32_t align = lv_obj_get_style_align(obj, LV_PART_MAIN);
uint16_t layout = lv_obj_get_style_layout(obj, LV_PART_MAIN);
if(layout || align) {
lv_obj_mark_layout_as_dirty(obj);
@ -680,16 +680,16 @@ static void lv_obj_event(const lv_obj_class_t * class_p, lv_event_t * e)
}
}
else if(code == LV_EVENT_CHILD_CHANGED) {
lv_coord_t w = lv_obj_get_style_width(obj, LV_PART_MAIN);
lv_coord_t h = lv_obj_get_style_height(obj, LV_PART_MAIN);
lv_coord_t align = lv_obj_get_style_align(obj, LV_PART_MAIN);
int32_t w = lv_obj_get_style_width(obj, LV_PART_MAIN);
int32_t h = lv_obj_get_style_height(obj, LV_PART_MAIN);
int32_t align = lv_obj_get_style_align(obj, LV_PART_MAIN);
uint16_t layout = lv_obj_get_style_layout(obj, LV_PART_MAIN);
if(layout || align || w == LV_SIZE_CONTENT || h == LV_SIZE_CONTENT) {
lv_obj_mark_layout_as_dirty(obj);
}
}
else if(code == LV_EVENT_REFR_EXT_DRAW_SIZE) {
lv_coord_t d = lv_obj_calculate_ext_draw_size(obj, LV_PART_MAIN);
int32_t d = lv_obj_calculate_ext_draw_size(obj, LV_PART_MAIN);
lv_event_set_ext_draw_size(e, d);
}
else if(code == LV_EVENT_DRAW_MAIN || code == LV_EVENT_DRAW_POST || code == LV_EVENT_COVER_CHECK) {

View File

@ -210,8 +210,8 @@ typedef struct {
lv_point_t scroll; /**< The current X/Y scroll offset*/
lv_coord_t ext_click_pad; /**< Extra click padding in all direction*/
lv_coord_t ext_draw_size; /**< EXTend the size in every direction for drawing.*/
int32_t ext_click_pad; /**< Extra click padding in all direction*/
int32_t ext_draw_size; /**< EXTend the size in every direction for drawing.*/
lv_scrollbar_mode_t scrollbar_mode : 2; /**< How to display scrollbars*/
lv_scroll_snap_t scroll_snap_x : 2; /**< Where to align the snappable children horizontally*/

View File

@ -72,8 +72,8 @@ typedef struct _lv_obj_class_t {
void * user_data;
const char * name;
lv_coord_t width_def;
lv_coord_t height_def;
int32_t width_def;
int32_t height_def;
uint32_t editable : 2; /**< Value from ::lv_obj_class_editable_t*/
uint32_t group_def : 2; /**< Value from ::lv_obj_class_group_def_t*/
uint32_t instance_size : 16;

View File

@ -250,35 +250,35 @@ void lv_obj_init_draw_arc_dsc(lv_obj_t * obj, uint32_t part, lv_draw_arc_dsc_t *
draw_dsc->rounded = lv_obj_get_style_arc_rounded(obj, part);
}
lv_coord_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint32_t part)
int32_t lv_obj_calculate_ext_draw_size(lv_obj_t * obj, uint32_t part)
{
lv_coord_t s = 0;
int32_t s = 0;
lv_coord_t sh_width = lv_obj_get_style_shadow_width(obj, part);
int32_t sh_width = lv_obj_get_style_shadow_width(obj, part);
if(sh_width) {
lv_opa_t sh_opa = lv_obj_get_style_shadow_opa(obj, part);
if(sh_opa > LV_OPA_MIN) {
sh_width = sh_width / 2 + 1; /*The blur adds only half width*/
sh_width += lv_obj_get_style_shadow_spread(obj, part);
lv_coord_t sh_ofs_x = lv_obj_get_style_shadow_offset_x(obj, part);
lv_coord_t sh_ofs_y = lv_obj_get_style_shadow_offset_y(obj, part);
int32_t sh_ofs_x = lv_obj_get_style_shadow_offset_x(obj, part);
int32_t sh_ofs_y = lv_obj_get_style_shadow_offset_y(obj, part);
sh_width += LV_MAX(LV_ABS(sh_ofs_x), LV_ABS(sh_ofs_y));
s = LV_MAX(s, sh_width);
}
}
lv_coord_t outline_width = lv_obj_get_style_outline_width(obj, part);
int32_t outline_width = lv_obj_get_style_outline_width(obj, part);
if(outline_width) {
lv_opa_t outline_opa = lv_obj_get_style_outline_opa(obj, part);
if(outline_opa > LV_OPA_MIN) {
lv_coord_t outline_pad = lv_obj_get_style_outline_pad(obj, part);
int32_t outline_pad = lv_obj_get_style_outline_pad(obj, part);
s = LV_MAX(s, outline_pad + outline_width);
}
}
lv_coord_t w = lv_obj_get_style_transform_width(obj, part);
lv_coord_t h = lv_obj_get_style_transform_height(obj, part);
lv_coord_t wh = LV_MAX(w, h);
int32_t w = lv_obj_get_style_transform_width(obj, part);
int32_t h = lv_obj_get_style_transform_height(obj, part);
int32_t wh = LV_MAX(w, h);
if(wh > 0) s += wh;
return s;
@ -288,8 +288,8 @@ void lv_obj_refresh_ext_draw_size(lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_coord_t s_old = _lv_obj_get_ext_draw_size(obj);
lv_coord_t s_new = 0;
int32_t s_old = _lv_obj_get_ext_draw_size(obj);
int32_t s_new = 0;
lv_obj_send_event(obj, LV_EVENT_REFR_EXT_DRAW_SIZE, &s_new);
if(s_new != s_old) lv_obj_invalidate(obj);
@ -308,7 +308,7 @@ void lv_obj_refresh_ext_draw_size(lv_obj_t * obj)
if(s_new != s_old) lv_obj_invalidate(obj);
}
lv_coord_t _lv_obj_get_ext_draw_size(const lv_obj_t * obj)
int32_t _lv_obj_get_ext_draw_size(const lv_obj_t * obj)
{
if(obj->spec_attr) return obj->spec_attr->ext_draw_size;
else return 0;

View File

@ -92,7 +92,7 @@ void lv_obj_init_draw_arc_dsc(struct _lv_obj_t * obj, uint32_t part, lv_draw_arc
* @param part part of the object
* @return the extra size required around the object
*/
lv_coord_t lv_obj_calculate_ext_draw_size(struct _lv_obj_t * obj, uint32_t part);
int32_t lv_obj_calculate_ext_draw_size(struct _lv_obj_t * obj, uint32_t part);
/**
* Send a 'LV_EVENT_REFR_EXT_DRAW_SIZE' Call the ancestor's event handler to the object to refresh the value of the extended draw size.
@ -106,7 +106,7 @@ void lv_obj_refresh_ext_draw_size(struct _lv_obj_t * obj);
* @param obj pointer to an object
* @return the size extended draw area around the real coordinates
*/
lv_coord_t _lv_obj_get_ext_draw_size(const 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);

View File

@ -230,10 +230,10 @@ lv_anim_t * lv_event_get_scroll_anim(lv_event_t * e)
}
}
void lv_event_set_ext_draw_size(lv_event_t * e, lv_coord_t size)
void lv_event_set_ext_draw_size(lv_event_t * e, int32_t size)
{
if(e->code == LV_EVENT_REFR_EXT_DRAW_SIZE) {
lv_coord_t * cur_size = lv_event_get_param(e);
int32_t * cur_size = lv_event_get_param(e);
*cur_size = LV_MAX(*cur_size, size);
}
else {

View File

@ -155,7 +155,7 @@ lv_anim_t * lv_event_get_scroll_anim(lv_event_t * e);
* @param e pointer to an event
* @param size The new extra draw size
*/
void lv_event_set_ext_draw_size(lv_event_t * e, lv_coord_t size);
void lv_event_set_ext_draw_size(lv_event_t * e, int32_t size);
/**
* Get a pointer to an `lv_point_t` variable in which the self size should be saved (width in `point->x` and height `point->y`).

View File

@ -25,8 +25,8 @@
/**********************
* STATIC PROTOTYPES
**********************/
static lv_coord_t calc_content_width(lv_obj_t * obj);
static lv_coord_t calc_content_height(lv_obj_t * obj);
static int32_t calc_content_width(lv_obj_t * obj);
static int32_t calc_content_height(lv_obj_t * obj);
static void layout_update_core(lv_obj_t * obj);
static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv);
@ -42,7 +42,7 @@ static void transform_point(const lv_obj_t * obj, lv_point_t * p, bool inv);
* GLOBAL FUNCTIONS
**********************/
void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
void lv_obj_set_pos(lv_obj_t * obj, int32_t x, int32_t y)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -50,7 +50,7 @@ void lv_obj_set_pos(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
lv_obj_set_y(obj, y);
}
void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x)
void lv_obj_set_x(lv_obj_t * obj, int32_t x)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -64,7 +64,7 @@ void lv_obj_set_x(lv_obj_t * obj, lv_coord_t x)
}
}
void lv_obj_set_y(lv_obj_t * obj, lv_coord_t y)
void lv_obj_set_y(lv_obj_t * obj, int32_t y)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -91,7 +91,7 @@ bool lv_obj_refr_size(lv_obj_t * obj)
bool w_is_content = false;
bool w_is_pct = false;
lv_coord_t w;
int32_t w;
if(obj->w_layout) {
w = lv_obj_get_width(obj);
}
@ -99,7 +99,7 @@ bool lv_obj_refr_size(lv_obj_t * obj)
w = lv_obj_get_style_width(obj, LV_PART_MAIN);
w_is_content = w == LV_SIZE_CONTENT;
w_is_pct = LV_COORD_IS_PCT(w);
lv_coord_t parent_w = lv_obj_get_content_width(parent);
int32_t parent_w = lv_obj_get_content_width(parent);
if(w_is_content) {
w = calc_content_width(obj);
@ -116,12 +116,12 @@ bool lv_obj_refr_size(lv_obj_t * obj)
}
}
lv_coord_t minw = lv_obj_get_style_min_width(obj, LV_PART_MAIN);
lv_coord_t maxw = lv_obj_get_style_max_width(obj, LV_PART_MAIN);
int32_t minw = lv_obj_get_style_min_width(obj, LV_PART_MAIN);
int32_t maxw = lv_obj_get_style_max_width(obj, LV_PART_MAIN);
w = lv_clamp_width(w, minw, maxw, parent_w);
}
lv_coord_t h;
int32_t h;
bool h_is_content = false;
bool h_is_pct = false;
if(obj->h_layout) {
@ -131,7 +131,7 @@ bool lv_obj_refr_size(lv_obj_t * obj)
h = lv_obj_get_style_height(obj, LV_PART_MAIN);
h_is_content = h == LV_SIZE_CONTENT;
h_is_pct = LV_COORD_IS_PCT(h);
lv_coord_t parent_h = lv_obj_get_content_height(parent);
int32_t parent_h = lv_obj_get_content_height(parent);
if(h_is_content) {
h = calc_content_height(obj);
@ -148,8 +148,8 @@ bool lv_obj_refr_size(lv_obj_t * obj)
}
}
lv_coord_t minh = lv_obj_get_style_min_height(obj, LV_PART_MAIN);
lv_coord_t maxh = lv_obj_get_style_max_height(obj, LV_PART_MAIN);
int32_t minh = lv_obj_get_style_min_height(obj, LV_PART_MAIN);
int32_t maxh = lv_obj_get_style_max_height(obj, LV_PART_MAIN);
h = lv_clamp_height(h, minh, maxh, parent_h);
}
@ -204,7 +204,7 @@ bool lv_obj_refr_size(lv_obj_t * obj)
return true;
}
void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h)
void lv_obj_set_size(lv_obj_t * obj, int32_t w, int32_t h)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -212,7 +212,7 @@ void lv_obj_set_size(lv_obj_t * obj, lv_coord_t w, lv_coord_t h)
lv_obj_set_height(obj, h);
}
void lv_obj_set_width(lv_obj_t * obj, lv_coord_t w)
void lv_obj_set_width(lv_obj_t * obj, int32_t w)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_result_t res_w;
@ -225,7 +225,7 @@ 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)
void lv_obj_set_height(lv_obj_t * obj, int32_t h)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_result_t res_h;
@ -238,17 +238,17 @@ void lv_obj_set_height(lv_obj_t * obj, lv_coord_t h)
}
}
void lv_obj_set_content_width(lv_obj_t * obj, lv_coord_t w)
void lv_obj_set_content_width(lv_obj_t * obj, int32_t w)
{
lv_coord_t left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
lv_coord_t right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
int32_t left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
int32_t right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
lv_obj_set_width(obj, w + left + right);
}
void lv_obj_set_content_height(lv_obj_t * obj, lv_coord_t h)
void lv_obj_set_content_height(lv_obj_t * obj, int32_t h)
{
lv_coord_t top = lv_obj_get_style_space_top(obj, LV_PART_MAIN);
lv_coord_t bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN);
int32_t top = lv_obj_get_style_space_top(obj, LV_PART_MAIN);
int32_t bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN);
lv_obj_set_height(obj, h + top + bottom);
}
@ -311,13 +311,13 @@ void lv_obj_set_align(lv_obj_t * obj, lv_align_t align)
lv_obj_set_style_align(obj, align, 0);
}
void lv_obj_align(lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs)
void lv_obj_align(lv_obj_t * obj, lv_align_t align, int32_t x_ofs, int32_t y_ofs)
{
lv_obj_set_style_align(obj, align, 0);
lv_obj_set_pos(obj, x_ofs, y_ofs);
}
void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs)
void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, int32_t x_ofs, int32_t y_ofs)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -326,18 +326,18 @@ void lv_obj_align_to(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv
LV_ASSERT_OBJ(base, MY_CLASS);
lv_coord_t x = 0;
lv_coord_t y = 0;
int32_t x = 0;
int32_t y = 0;
lv_obj_t * parent = lv_obj_get_parent(obj);
LV_ASSERT_OBJ(parent, MY_CLASS);
lv_coord_t pleft = lv_obj_get_style_space_left(parent, LV_PART_MAIN);
lv_coord_t ptop = lv_obj_get_style_space_top(parent, LV_PART_MAIN);
int32_t pleft = lv_obj_get_style_space_left(parent, LV_PART_MAIN);
int32_t ptop = lv_obj_get_style_space_top(parent, LV_PART_MAIN);
lv_coord_t bleft = lv_obj_get_style_space_left(base, LV_PART_MAIN);
lv_coord_t btop = lv_obj_get_style_space_top(base, LV_PART_MAIN);
int32_t bleft = lv_obj_get_style_space_left(base, LV_PART_MAIN);
int32_t btop = lv_obj_get_style_space_top(base, LV_PART_MAIN);
if(align == LV_ALIGN_DEFAULT) {
if(lv_obj_get_style_base_dir(base, LV_PART_MAIN) == LV_BASE_DIR_RTL) align = LV_ALIGN_TOP_RIGHT;
@ -469,11 +469,11 @@ void lv_obj_get_coords(const lv_obj_t * obj, lv_area_t * coords)
lv_area_copy(coords, &obj->coords);
}
lv_coord_t lv_obj_get_x(const lv_obj_t * obj)
int32_t lv_obj_get_x(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_coord_t rel_x;
int32_t rel_x;
lv_obj_t * parent = lv_obj_get_parent(obj);
if(parent) {
rel_x = obj->coords.x1 - parent->coords.x1;
@ -486,18 +486,18 @@ lv_coord_t lv_obj_get_x(const lv_obj_t * obj)
return rel_x;
}
lv_coord_t lv_obj_get_x2(const lv_obj_t * obj)
int32_t lv_obj_get_x2(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
return lv_obj_get_x(obj) + lv_obj_get_width(obj);
}
lv_coord_t lv_obj_get_y(const lv_obj_t * obj)
int32_t lv_obj_get_y(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_coord_t rel_y;
int32_t rel_y;
lv_obj_t * parent = lv_obj_get_parent(obj);
if(parent) {
rel_y = obj->coords.y1 - parent->coords.y1;
@ -510,54 +510,54 @@ lv_coord_t lv_obj_get_y(const lv_obj_t * obj)
return rel_y;
}
lv_coord_t lv_obj_get_y2(const lv_obj_t * obj)
int32_t lv_obj_get_y2(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
return lv_obj_get_y(obj) + lv_obj_get_height(obj);
}
lv_coord_t lv_obj_get_x_aligned(const lv_obj_t * obj)
int32_t lv_obj_get_x_aligned(const lv_obj_t * obj)
{
return lv_obj_get_style_x(obj, LV_PART_MAIN);
}
lv_coord_t lv_obj_get_y_aligned(const lv_obj_t * obj)
int32_t lv_obj_get_y_aligned(const lv_obj_t * obj)
{
return lv_obj_get_style_y(obj, LV_PART_MAIN);
}
lv_coord_t lv_obj_get_width(const lv_obj_t * obj)
int32_t lv_obj_get_width(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
return lv_area_get_width(&obj->coords);
}
lv_coord_t lv_obj_get_height(const lv_obj_t * obj)
int32_t lv_obj_get_height(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
return lv_area_get_height(&obj->coords);
}
lv_coord_t lv_obj_get_content_width(const lv_obj_t * obj)
int32_t lv_obj_get_content_width(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_coord_t left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
lv_coord_t right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
int32_t left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
int32_t right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
return lv_obj_get_width(obj) - left - right;
}
lv_coord_t lv_obj_get_content_height(const lv_obj_t * obj)
int32_t lv_obj_get_content_height(const lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_coord_t top = lv_obj_get_style_space_top(obj, LV_PART_MAIN);
lv_coord_t bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN);
int32_t top = lv_obj_get_style_space_top(obj, LV_PART_MAIN);
int32_t bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN);
return lv_obj_get_height(obj) - top - bottom;
}
@ -574,14 +574,14 @@ void lv_obj_get_content_coords(const lv_obj_t * obj, lv_area_t * area)
}
lv_coord_t lv_obj_get_self_width(const lv_obj_t * obj)
int32_t lv_obj_get_self_width(const lv_obj_t * obj)
{
lv_point_t p = {0, LV_COORD_MIN};
lv_obj_send_event((lv_obj_t *)obj, LV_EVENT_GET_SELF_SIZE, &p);
return p.x;
}
lv_coord_t lv_obj_get_self_height(const lv_obj_t * obj)
int32_t lv_obj_get_self_height(const lv_obj_t * obj)
{
lv_point_t p = {LV_COORD_MIN, 0};
lv_obj_send_event((lv_obj_t *)obj, LV_EVENT_GET_SELF_SIZE, &p);
@ -590,8 +590,8 @@ lv_coord_t lv_obj_get_self_height(const lv_obj_t * obj)
bool lv_obj_refresh_self_size(lv_obj_t * obj)
{
lv_coord_t w_set = lv_obj_get_style_width(obj, LV_PART_MAIN);
lv_coord_t h_set = lv_obj_get_style_height(obj, LV_PART_MAIN);
int32_t w_set = lv_obj_get_style_width(obj, LV_PART_MAIN);
int32_t h_set = lv_obj_get_style_height(obj, LV_PART_MAIN);
if(w_set != LV_SIZE_CONTENT && h_set != LV_SIZE_CONTENT) return false;
lv_obj_mark_layout_as_dirty(obj);
@ -604,8 +604,8 @@ void lv_obj_refr_pos(lv_obj_t * obj)
lv_obj_t * parent = lv_obj_get_parent(obj);
lv_coord_t x = lv_obj_get_style_x(obj, LV_PART_MAIN);
lv_coord_t y = lv_obj_get_style_y(obj, LV_PART_MAIN);
int32_t x = lv_obj_get_style_x(obj, LV_PART_MAIN);
int32_t y = lv_obj_get_style_y(obj, LV_PART_MAIN);
if(parent == NULL) {
lv_obj_move_to(obj, x, y);
@ -613,16 +613,16 @@ void lv_obj_refr_pos(lv_obj_t * obj)
}
/*Handle percentage value*/
lv_coord_t pw = lv_obj_get_content_width(parent);
lv_coord_t ph = lv_obj_get_content_height(parent);
int32_t pw = lv_obj_get_content_width(parent);
int32_t ph = lv_obj_get_content_height(parent);
if(LV_COORD_IS_PCT(x)) x = (pw * LV_COORD_GET_PCT(x)) / 100;
if(LV_COORD_IS_PCT(y)) y = (ph * LV_COORD_GET_PCT(y)) / 100;
/*Handle percentage value of translate*/
lv_coord_t tr_x = lv_obj_get_style_translate_x(obj, LV_PART_MAIN);
lv_coord_t tr_y = lv_obj_get_style_translate_y(obj, LV_PART_MAIN);
lv_coord_t w = lv_obj_get_width(obj);
lv_coord_t h = lv_obj_get_height(obj);
int32_t tr_x = lv_obj_get_style_translate_x(obj, LV_PART_MAIN);
int32_t tr_y = lv_obj_get_style_translate_y(obj, LV_PART_MAIN);
int32_t w = lv_obj_get_width(obj);
int32_t h = lv_obj_get_height(obj);
if(LV_COORD_IS_PCT(tr_x)) tr_x = (w * LV_COORD_GET_PCT(tr_x)) / 100;
if(LV_COORD_IS_PCT(tr_y)) tr_y = (h * LV_COORD_GET_PCT(tr_y)) / 100;
@ -675,7 +675,7 @@ void lv_obj_refr_pos(lv_obj_t * obj)
lv_obj_move_to(obj, x, y);
}
void lv_obj_move_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
void lv_obj_move_to(lv_obj_t * obj, int32_t x, int32_t y)
{
/*Convert x and y to absolute coordinates*/
lv_obj_t * parent = obj->parent;
@ -744,7 +744,7 @@ void lv_obj_move_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y)
}
}
void lv_obj_move_children_by(lv_obj_t * obj, lv_coord_t x_diff, lv_coord_t y_diff, bool ignore_floating)
void lv_obj_move_children_by(lv_obj_t * obj, int32_t x_diff, int32_t y_diff, bool ignore_floating)
{
uint32_t i;
uint32_t child_cnt = lv_obj_get_child_cnt(obj);
@ -818,7 +818,7 @@ void lv_obj_invalidate(const lv_obj_t * obj)
/*Truncate the area to the object*/
lv_area_t obj_coords;
lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj);
int32_t ext_size = _lv_obj_get_ext_draw_size(obj);
lv_area_copy(&obj_coords, &obj->coords);
obj_coords.x1 -= ext_size;
obj_coords.y1 -= ext_size;
@ -845,7 +845,7 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
/*Truncate the area to the object*/
lv_area_t obj_coords;
lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj);
int32_t ext_size = _lv_obj_get_ext_draw_size(obj);
lv_area_copy(&obj_coords, &obj->coords);
lv_area_increase(&obj_coords, ext_size, ext_size);
@ -863,7 +863,7 @@ bool lv_obj_area_is_visible(const lv_obj_t * obj, lv_area_t * area)
/*Truncate to the parent and if no common parts break*/
lv_area_t parent_coords = parent->coords;
if(lv_obj_has_flag(parent, LV_OBJ_FLAG_OVERFLOW_VISIBLE)) {
lv_coord_t parent_ext_size = _lv_obj_get_ext_draw_size(parent);
int32_t parent_ext_size = _lv_obj_get_ext_draw_size(parent);
lv_area_increase(&parent_coords, parent_ext_size, parent_ext_size);
}
@ -881,7 +881,7 @@ bool lv_obj_is_visible(const lv_obj_t * obj)
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_area_t obj_coords;
lv_coord_t ext_size = _lv_obj_get_ext_draw_size(obj);
int32_t ext_size = _lv_obj_get_ext_draw_size(obj);
lv_area_copy(&obj_coords, &obj->coords);
obj_coords.x1 -= ext_size;
obj_coords.y1 -= ext_size;
@ -891,7 +891,7 @@ bool lv_obj_is_visible(const lv_obj_t * obj)
return lv_obj_area_is_visible(obj, &obj_coords);
}
void lv_obj_set_ext_click_area(lv_obj_t * obj, lv_coord_t size)
void lv_obj_set_ext_click_area(lv_obj_t * obj, int32_t size)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -927,14 +927,14 @@ bool lv_obj_hit_test(lv_obj_t * obj, const lv_point_t * point)
return res;
}
lv_coord_t lv_clamp_width(lv_coord_t width, lv_coord_t min_width, lv_coord_t max_width, lv_coord_t ref_width)
int32_t lv_clamp_width(int32_t width, int32_t min_width, int32_t max_width, int32_t ref_width)
{
if(LV_COORD_IS_PCT(min_width)) min_width = (ref_width * LV_COORD_GET_PCT(min_width)) / 100;
if(LV_COORD_IS_PCT(max_width)) max_width = (ref_width * LV_COORD_GET_PCT(max_width)) / 100;
return LV_CLAMP(min_width, width, max_width);
}
lv_coord_t lv_clamp_height(lv_coord_t height, lv_coord_t min_height, lv_coord_t max_height, lv_coord_t ref_height)
int32_t lv_clamp_height(int32_t height, int32_t min_height, int32_t max_height, int32_t ref_height)
{
if(LV_COORD_IS_PCT(min_height)) min_height = (ref_height * LV_COORD_GET_PCT(min_height)) / 100;
if(LV_COORD_IS_PCT(max_height)) max_height = (ref_height * LV_COORD_GET_PCT(max_height)) / 100;
@ -947,24 +947,24 @@ lv_coord_t lv_clamp_height(lv_coord_t height, lv_coord_t min_height, lv_coord_t
* STATIC FUNCTIONS
**********************/
static lv_coord_t calc_content_width(lv_obj_t * obj)
static int32_t calc_content_width(lv_obj_t * obj)
{
lv_coord_t scroll_x_tmp = lv_obj_get_scroll_x(obj);
int32_t scroll_x_tmp = lv_obj_get_scroll_x(obj);
if(obj->spec_attr) obj->spec_attr->scroll.x = 0;
lv_coord_t space_right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
lv_coord_t space_left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
int32_t space_right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
int32_t space_left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
lv_coord_t self_w;
int32_t self_w;
self_w = lv_obj_get_self_width(obj) + space_left + space_right;
lv_coord_t child_res = LV_COORD_MIN;
int32_t child_res = LV_COORD_MIN;
uint32_t i;
uint32_t child_cnt = lv_obj_get_child_cnt(obj);
/*With RTL find the left most coordinate*/
if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) == LV_BASE_DIR_RTL) {
for(i = 0; i < child_cnt; i++) {
lv_coord_t child_res_tmp = LV_COORD_MIN;
int32_t child_res_tmp = LV_COORD_MIN;
lv_obj_t * child = obj->spec_attr->children[i];
if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue;
@ -1000,7 +1000,7 @@ static lv_coord_t calc_content_width(lv_obj_t * obj)
/*Else find the right most coordinate*/
else {
for(i = 0; i < child_cnt; i++) {
lv_coord_t child_res_tmp = LV_COORD_MIN;
int32_t child_res_tmp = LV_COORD_MIN;
lv_obj_t * child = obj->spec_attr->children[i];
if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue;
@ -1042,22 +1042,22 @@ static lv_coord_t calc_content_width(lv_obj_t * obj)
return LV_MAX(child_res, self_w);
}
static lv_coord_t calc_content_height(lv_obj_t * obj)
static int32_t calc_content_height(lv_obj_t * obj)
{
lv_coord_t scroll_y_tmp = lv_obj_get_scroll_y(obj);
int32_t scroll_y_tmp = lv_obj_get_scroll_y(obj);
if(obj->spec_attr) obj->spec_attr->scroll.y = 0;
lv_coord_t space_top = lv_obj_get_style_space_top(obj, LV_PART_MAIN);
lv_coord_t space_bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN);
int32_t space_top = lv_obj_get_style_space_top(obj, LV_PART_MAIN);
int32_t space_bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN);
lv_coord_t self_h;
int32_t self_h;
self_h = lv_obj_get_self_height(obj) + space_top + space_bottom;
lv_coord_t child_res = LV_COORD_MIN;
int32_t child_res = LV_COORD_MIN;
uint32_t i;
uint32_t child_cnt = lv_obj_get_child_cnt(obj);
for(i = 0; i < child_cnt; i++) {
lv_coord_t child_res_tmp = LV_COORD_MIN;
int32_t child_res_tmp = LV_COORD_MIN;
lv_obj_t * child = obj->spec_attr->children[i];
if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue;
@ -1117,9 +1117,9 @@ 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_rotation(obj, 0);
lv_coord_t zoom_x = lv_obj_get_style_transform_scale_x_safe(obj, 0);
lv_coord_t zoom_y = lv_obj_get_style_transform_scale_y_safe(obj, 0);
int32_t angle = lv_obj_get_style_transform_rotation(obj, 0);
int32_t zoom_x = lv_obj_get_style_transform_scale_x_safe(obj, 0);
int32_t zoom_y = lv_obj_get_style_transform_scale_y_safe(obj, 0);
if(angle == 0 && zoom_x == LV_SCALE_NONE && zoom_y == LV_SCALE_NONE) return;

View File

@ -37,7 +37,7 @@ extern "C" {
* @note The position is interpreted on the content area of the parent
* @note The values can be set in pixel or in percentage of parent size with `lv_pct(v)`
*/
void lv_obj_set_pos(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
void lv_obj_set_pos(struct _lv_obj_t * obj, int32_t x, int32_t y);
/**
* Set the x coordinate of an object
@ -48,7 +48,7 @@ void lv_obj_set_pos(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
* @note The position is interpreted on the content area of the parent
* @note The values can be set in pixel or in percentage of parent size with `lv_pct(v)`
*/
void lv_obj_set_x(struct _lv_obj_t * obj, lv_coord_t x);
void lv_obj_set_x(struct _lv_obj_t * obj, int32_t x);
/**
* Set the y coordinate of an object
@ -59,7 +59,7 @@ void lv_obj_set_x(struct _lv_obj_t * obj, lv_coord_t x);
* @note The position is interpreted on the content area of the parent
* @note The values can be set in pixel or in percentage of parent size with `lv_pct(v)`
*/
void lv_obj_set_y(struct _lv_obj_t * obj, lv_coord_t y);
void lv_obj_set_y(struct _lv_obj_t * obj, int32_t y);
/**
* Set the size of an object.
@ -72,7 +72,7 @@ void lv_obj_set_y(struct _lv_obj_t * obj, lv_coord_t y);
* LV_SIZE_PCT(x) to set size in percentage of the parent's content area size (the size without paddings).
* x should be in [0..1000]% range
*/
void lv_obj_set_size(struct _lv_obj_t * obj, lv_coord_t w, lv_coord_t h);
void lv_obj_set_size(struct _lv_obj_t * obj, int32_t w, int32_t h);
/**
* Recalculate the size of the object
@ -91,7 +91,7 @@ bool lv_obj_refr_size(struct _lv_obj_t * obj);
* lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings).
* x should be in [0..1000]% range
*/
void lv_obj_set_width(struct _lv_obj_t * obj, lv_coord_t w);
void lv_obj_set_width(struct _lv_obj_t * obj, int32_t w);
/**
* Set the height of an object
@ -103,21 +103,21 @@ void lv_obj_set_width(struct _lv_obj_t * obj, lv_coord_t w);
* lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings).
* x should be in [0..1000]% range
*/
void lv_obj_set_height(struct _lv_obj_t * obj, lv_coord_t h);
void lv_obj_set_height(struct _lv_obj_t * obj, int32_t h);
/**
* Set the width reduced by the left and right padding and the border width.
* @param obj pointer to an object
* @param w the width without paddings in pixels
*/
void lv_obj_set_content_width(struct _lv_obj_t * obj, lv_coord_t w);
void lv_obj_set_content_width(struct _lv_obj_t * obj, int32_t w);
/**
* Set the height reduced by the top and bottom padding and the border width.
* @param obj pointer to an object
* @param h the height without paddings in pixels
*/
void lv_obj_set_content_height(struct _lv_obj_t * obj, lv_coord_t h);
void lv_obj_set_content_height(struct _lv_obj_t * obj, int32_t h);
/**
* Set a layout for an object
@ -162,7 +162,7 @@ void lv_obj_set_align(struct _lv_obj_t * obj, lv_align_t align);
* @param x_ofs x coordinate offset after alignment
* @param y_ofs y coordinate offset after alignment
*/
void lv_obj_align(struct _lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs);
void lv_obj_align(struct _lv_obj_t * obj, lv_align_t align, int32_t x_ofs, int32_t y_ofs);
/**
* Align an object to an other object.
@ -173,8 +173,8 @@ void lv_obj_align(struct _lv_obj_t * obj, lv_align_t align, lv_coord_t x_ofs, lv
* @param y_ofs y coordinate offset after alignment
* @note if the position or size of `base` changes `obj` needs to be aligned manually again
*/
void lv_obj_align_to(struct _lv_obj_t * obj, const struct _lv_obj_t * base, lv_align_t align, lv_coord_t x_ofs,
lv_coord_t y_ofs);
void lv_obj_align_to(struct _lv_obj_t * obj, const struct _lv_obj_t * base, lv_align_t align, int32_t x_ofs,
int32_t y_ofs);
/**
* Align an object to the center on its parent.
@ -204,7 +204,7 @@ void lv_obj_get_coords(const struct _lv_obj_t * obj, lv_area_t * coords);
* @note Scrolling of the parent doesn't change the returned value.
* @note The returned value is always the distance from the parent even if `obj` is positioned by a layout.
*/
lv_coord_t lv_obj_get_x(const struct _lv_obj_t * obj);
int32_t lv_obj_get_x(const struct _lv_obj_t * obj);
/**
* Get the x2 coordinate of object.
@ -216,7 +216,7 @@ lv_coord_t lv_obj_get_x(const struct _lv_obj_t * obj);
* @note Scrolling of the parent doesn't change the returned value.
* @note The returned value is always the distance from the parent even if `obj` is positioned by a layout.
*/
lv_coord_t lv_obj_get_x2(const struct _lv_obj_t * obj);
int32_t lv_obj_get_x2(const struct _lv_obj_t * obj);
/**
* Get the y coordinate of object.
@ -228,7 +228,7 @@ lv_coord_t lv_obj_get_x2(const struct _lv_obj_t * obj);
* @note Scrolling of the parent doesn't change the returned value.
* @note The returned value is always the distance from the parent even if `obj` is positioned by a layout.
*/
lv_coord_t lv_obj_get_y(const struct _lv_obj_t * obj);
int32_t lv_obj_get_y(const struct _lv_obj_t * obj);
/**
* Get the y2 coordinate of object.
@ -240,21 +240,21 @@ lv_coord_t lv_obj_get_y(const struct _lv_obj_t * obj);
* @note Scrolling of the parent doesn't change the returned value.
* @note The returned value is always the distance from the parent even if `obj` is positioned by a layout.
*/
lv_coord_t lv_obj_get_y2(const struct _lv_obj_t * obj);
int32_t lv_obj_get_y2(const struct _lv_obj_t * obj);
/**
* Get the actually set x coordinate of object, i.e. the offset form the set alignment
* @param obj pointer to an object
* @return the set x coordinate
*/
lv_coord_t lv_obj_get_x_aligned(const struct _lv_obj_t * obj);
int32_t lv_obj_get_x_aligned(const struct _lv_obj_t * obj);
/**
* Get the actually set y coordinate of object, i.e. the offset form the set alignment
* @param obj pointer to an object
* @return the set y coordinate
*/
lv_coord_t lv_obj_get_y_aligned(const struct _lv_obj_t * obj);
int32_t lv_obj_get_y_aligned(const struct _lv_obj_t * obj);
/**
* Get the width of an object
@ -263,7 +263,7 @@ lv_coord_t lv_obj_get_y_aligned(const struct _lv_obj_t * obj);
* call `lv_obj_update_layout(obj)`.
* @return the width in pixels
*/
lv_coord_t lv_obj_get_width(const struct _lv_obj_t * obj);
int32_t lv_obj_get_width(const struct _lv_obj_t * obj);
/**
* Get the height of an object
@ -272,7 +272,7 @@ lv_coord_t lv_obj_get_width(const struct _lv_obj_t * obj);
* call `lv_obj_update_layout(obj)`.
* @return the height in pixels
*/
lv_coord_t lv_obj_get_height(const struct _lv_obj_t * obj);
int32_t lv_obj_get_height(const struct _lv_obj_t * obj);
/**
* Get the width reduced by the left and right padding and the border width.
@ -281,7 +281,7 @@ lv_coord_t lv_obj_get_height(const struct _lv_obj_t * obj);
* call `lv_obj_update_layout(obj)`.
* @return the width which still fits into its parent without causing overflow (making the parent scrollable)
*/
lv_coord_t lv_obj_get_content_width(const struct _lv_obj_t * obj);
int32_t lv_obj_get_content_width(const struct _lv_obj_t * obj);
/**
* Get the height reduced by the top and bottom padding and the border width.
@ -290,7 +290,7 @@ lv_coord_t lv_obj_get_content_width(const struct _lv_obj_t * obj);
* call `lv_obj_update_layout(obj)`.
* @return the height which still fits into the parent without causing overflow (making the parent scrollable)
*/
lv_coord_t lv_obj_get_content_height(const struct _lv_obj_t * obj);
int32_t lv_obj_get_content_height(const struct _lv_obj_t * obj);
/**
* Get the area reduced by the paddings and the border width.
@ -308,7 +308,7 @@ void lv_obj_get_content_coords(const struct _lv_obj_t * obj, lv_area_t * area);
* @note This size independent from the real size of the widget.
* It just tells how large the internal ("virtual") content is.
*/
lv_coord_t lv_obj_get_self_width(const struct _lv_obj_t * obj);
int32_t lv_obj_get_self_width(const struct _lv_obj_t * obj);
/**
* Get the height occupied by the "parts" of the widget. E.g. the height of all rows of a table.
@ -317,7 +317,7 @@ lv_coord_t lv_obj_get_self_width(const struct _lv_obj_t * obj);
* @note This size independent from the real size of the widget.
* It just tells how large the internal ("virtual") content is.
*/
lv_coord_t lv_obj_get_self_height(const struct _lv_obj_t * obj);
int32_t lv_obj_get_self_height(const struct _lv_obj_t * obj);
/**
* Handle if the size of the internal ("virtual") content of an object has changed.
@ -328,10 +328,10 @@ bool lv_obj_refresh_self_size(struct _lv_obj_t * obj);
void lv_obj_refr_pos(struct _lv_obj_t * obj);
void lv_obj_move_to(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y);
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, lv_coord_t x_diff, lv_coord_t y_diff, bool ignore_floating);
void lv_obj_move_children_by(struct _lv_obj_t * obj, int32_t x_diff, int32_t y_diff, bool ignore_floating);
/**
* Transform a point using the angle and zoom style properties of an object
@ -385,7 +385,7 @@ bool lv_obj_is_visible(const struct _lv_obj_t * obj);
* @param obj pointer to an object
* @param size extended clickable area in all 4 directions [px]
*/
void lv_obj_set_ext_click_area(struct _lv_obj_t * obj, lv_coord_t size);
void lv_obj_set_ext_click_area(struct _lv_obj_t * obj, int32_t size);
/**
* Get the an area where to object can be clicked.
@ -411,7 +411,7 @@ bool lv_obj_hit_test(struct _lv_obj_t * obj, const lv_point_t * point);
* @param ref_width the reference width used when min/max width is in percentage
* @return the clamped width
*/
lv_coord_t lv_clamp_width(lv_coord_t width, lv_coord_t min_width, lv_coord_t max_width, lv_coord_t ref_width);
int32_t lv_clamp_width(int32_t width, int32_t min_width, int32_t max_width, int32_t ref_width);
/**
* Clamp a height between min and max height. If the min/max height is in percentage value use the ref_height
@ -421,7 +421,7 @@ lv_coord_t lv_clamp_width(lv_coord_t width, lv_coord_t min_width, lv_coord_t max
* @param ref_height the reference height used when min/max height is in percentage
* @return the clamped height
*/
lv_coord_t lv_clamp_height(lv_coord_t height, lv_coord_t min_height, lv_coord_t max_height, lv_coord_t ref_height);
int32_t lv_clamp_height(int32_t height, int32_t min_height, int32_t max_height, int32_t ref_height);
/**********************
* MACROS

View File

@ -113,53 +113,53 @@ lv_scroll_snap_t lv_obj_get_scroll_snap_y(const lv_obj_t * obj)
else return LV_SCROLL_SNAP_NONE;
}
lv_coord_t lv_obj_get_scroll_x(const lv_obj_t * obj)
int32_t lv_obj_get_scroll_x(const lv_obj_t * obj)
{
if(obj->spec_attr == NULL) return 0;
return -obj->spec_attr->scroll.x;
}
lv_coord_t lv_obj_get_scroll_y(const lv_obj_t * obj)
int32_t lv_obj_get_scroll_y(const lv_obj_t * obj)
{
if(obj->spec_attr == NULL) return 0;
return -obj->spec_attr->scroll.y;
}
lv_coord_t lv_obj_get_scroll_top(lv_obj_t * obj)
int32_t lv_obj_get_scroll_top(lv_obj_t * obj)
{
if(obj->spec_attr == NULL) return 0;
return -obj->spec_attr->scroll.y;
}
lv_coord_t lv_obj_get_scroll_bottom(lv_obj_t * obj)
int32_t lv_obj_get_scroll_bottom(lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
lv_coord_t child_res = LV_COORD_MIN;
int32_t child_res = LV_COORD_MIN;
uint32_t i;
uint32_t child_cnt = lv_obj_get_child_cnt(obj);
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = obj->spec_attr->children[i];
if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue;
lv_coord_t tmp_y = child->coords.y2 + lv_obj_get_style_margin_bottom(child, LV_PART_MAIN);
int32_t tmp_y = child->coords.y2 + lv_obj_get_style_margin_bottom(child, LV_PART_MAIN);
child_res = LV_MAX(child_res, tmp_y);
}
lv_coord_t space_top = lv_obj_get_style_space_top(obj, LV_PART_MAIN);
lv_coord_t space_bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN);
int32_t space_top = lv_obj_get_style_space_top(obj, LV_PART_MAIN);
int32_t space_bottom = lv_obj_get_style_space_bottom(obj, LV_PART_MAIN);
if(child_res != LV_COORD_MIN) {
child_res -= (obj->coords.y2 - space_bottom);
}
lv_coord_t self_h = lv_obj_get_self_height(obj);
int32_t self_h = lv_obj_get_self_height(obj);
self_h = self_h - (lv_obj_get_height(obj) - space_top - space_bottom);
self_h -= lv_obj_get_scroll_y(obj);
return LV_MAX(child_res, self_h);
}
lv_coord_t lv_obj_get_scroll_left(lv_obj_t * obj)
int32_t lv_obj_get_scroll_left(lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -171,19 +171,19 @@ lv_coord_t lv_obj_get_scroll_left(lv_obj_t * obj)
}
/*With RTL base direction scrolling the left is normal so find the left most coordinate*/
lv_coord_t space_right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
lv_coord_t space_left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
int32_t space_right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
int32_t space_left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
lv_coord_t child_res = 0;
int32_t child_res = 0;
uint32_t i;
lv_coord_t x1 = LV_COORD_MAX;
int32_t x1 = LV_COORD_MAX;
uint32_t child_cnt = lv_obj_get_child_cnt(obj);
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = obj->spec_attr->children[i];
if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue;
lv_coord_t tmp_x = child->coords.x1 - lv_obj_get_style_margin_left(child, LV_PART_MAIN);
int32_t tmp_x = child->coords.x1 - lv_obj_get_style_margin_left(child, LV_PART_MAIN);
x1 = LV_MIN(x1, tmp_x);
}
@ -195,14 +195,14 @@ lv_coord_t lv_obj_get_scroll_left(lv_obj_t * obj)
child_res = LV_COORD_MIN;
}
lv_coord_t self_w = lv_obj_get_self_width(obj);
int32_t self_w = lv_obj_get_self_width(obj);
self_w = self_w - (lv_obj_get_width(obj) - space_right - space_left);
self_w += lv_obj_get_scroll_x(obj);
return LV_MAX(child_res, self_w);
}
lv_coord_t lv_obj_get_scroll_right(lv_obj_t * obj)
int32_t lv_obj_get_scroll_right(lv_obj_t * obj)
{
LV_ASSERT_OBJ(obj, MY_CLASS);
@ -214,25 +214,25 @@ lv_coord_t lv_obj_get_scroll_right(lv_obj_t * obj)
}
/*With other base direction (LTR) scrolling to the right is normal so find the right most coordinate*/
lv_coord_t child_res = LV_COORD_MIN;
int32_t child_res = LV_COORD_MIN;
uint32_t i;
uint32_t child_cnt = lv_obj_get_child_cnt(obj);
for(i = 0; i < child_cnt; i++) {
lv_obj_t * child = obj->spec_attr->children[i];
if(lv_obj_has_flag_any(child, LV_OBJ_FLAG_HIDDEN | LV_OBJ_FLAG_FLOATING)) continue;
lv_coord_t tmp_x = child->coords.x2 + lv_obj_get_style_margin_right(child, LV_PART_MAIN);
int32_t tmp_x = child->coords.x2 + lv_obj_get_style_margin_right(child, LV_PART_MAIN);
child_res = LV_MAX(child_res, tmp_x);
}
lv_coord_t space_right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
lv_coord_t space_left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
int32_t space_right = lv_obj_get_style_space_right(obj, LV_PART_MAIN);
int32_t space_left = lv_obj_get_style_space_left(obj, LV_PART_MAIN);
if(child_res != LV_COORD_MIN) {
child_res -= (obj->coords.x2 - space_right);
}
lv_coord_t self_w;
int32_t self_w;
self_w = lv_obj_get_self_width(obj);
self_w = self_w - (lv_obj_get_width(obj) - space_right - space_left);
self_w -= lv_obj_get_scroll_x(obj);
@ -253,7 +253,7 @@ void lv_obj_get_scroll_end(struct _lv_obj_t * obj, lv_point_t * end)
* Other functions
*====================*/
void lv_obj_scroll_by_bounded(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enable_t anim_en)
void lv_obj_scroll_by_bounded(lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en)
{
if(dx == 0 && dy == 0) return;
@ -261,13 +261,13 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_a
lv_obj_update_layout(obj);
/*Don't let scroll more than naturally possible by the size of the content*/
lv_coord_t x_current = -lv_obj_get_scroll_x(obj);
lv_coord_t x_bounded = x_current + dx;
int32_t x_current = -lv_obj_get_scroll_x(obj);
int32_t x_bounded = x_current + dx;
if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) != LV_BASE_DIR_RTL) {
if(x_bounded > 0) x_bounded = 0;
if(x_bounded < 0) {
lv_coord_t scroll_max = lv_obj_get_scroll_left(obj) + lv_obj_get_scroll_right(obj);
int32_t scroll_max = lv_obj_get_scroll_left(obj) + lv_obj_get_scroll_right(obj);
if(scroll_max < 0) scroll_max = 0;
if(x_bounded < -scroll_max) x_bounded = -scroll_max;
@ -276,7 +276,7 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_a
else {
if(x_bounded < 0) x_bounded = 0;
if(x_bounded > 0) {
lv_coord_t scroll_max = lv_obj_get_scroll_left(obj) + lv_obj_get_scroll_right(obj);
int32_t scroll_max = lv_obj_get_scroll_left(obj) + lv_obj_get_scroll_right(obj);
if(scroll_max < 0) scroll_max = 0;
if(x_bounded > scroll_max) x_bounded = scroll_max;
@ -284,12 +284,12 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_a
}
/*Don't let scroll more than naturally possible by the size of the content*/
lv_coord_t y_current = -lv_obj_get_scroll_y(obj);
lv_coord_t y_bounded = y_current + dy;
int32_t y_current = -lv_obj_get_scroll_y(obj);
int32_t y_bounded = y_current + dy;
if(y_bounded > 0) y_bounded = 0;
if(y_bounded < 0) {
lv_coord_t scroll_max = lv_obj_get_scroll_top(obj) + lv_obj_get_scroll_bottom(obj);
int32_t scroll_max = lv_obj_get_scroll_top(obj) + lv_obj_get_scroll_bottom(obj);
if(scroll_max < 0) scroll_max = 0;
if(y_bounded < -scroll_max) y_bounded = -scroll_max;
}
@ -302,7 +302,7 @@ void lv_obj_scroll_by_bounded(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_a
}
void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enable_t 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;
if(anim_en == LV_ANIM_ON) {
@ -317,7 +317,7 @@ void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enab
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);
lv_coord_t sx = lv_obj_get_scroll_x(obj);
int32_t sx = lv_obj_get_scroll_x(obj);
lv_anim_set_values(&a, -sx, -sx + dx);
lv_anim_set_exec_cb(&a, scroll_x_anim);
lv_anim_set_path_cb(&a, lv_anim_path_ease_out);
@ -333,7 +333,7 @@ void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enab
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);
lv_coord_t sy = lv_obj_get_scroll_y(obj);
int32_t sy = lv_obj_get_scroll_y(obj);
lv_anim_set_values(&a, -sy, -sy + dy);
lv_anim_set_exec_cb(&a, scroll_y_anim);
lv_anim_set_path_cb(&a, lv_anim_path_ease_out);
@ -361,28 +361,28 @@ void lv_obj_scroll_by(lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enab
}
}
void lv_obj_scroll_to(lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en)
void lv_obj_scroll_to(lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en)
{
lv_obj_scroll_to_x(obj, x, anim_en);
lv_obj_scroll_to_y(obj, y, anim_en);
}
void lv_obj_scroll_to_x(lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en)
void lv_obj_scroll_to_x(lv_obj_t * obj, int32_t x, lv_anim_enable_t anim_en)
{
lv_anim_delete(obj, scroll_x_anim);
lv_coord_t scroll_x = lv_obj_get_scroll_x(obj);
lv_coord_t diff = -x + scroll_x;
int32_t scroll_x = lv_obj_get_scroll_x(obj);
int32_t diff = -x + scroll_x;
lv_obj_scroll_by_bounded(obj, diff, 0, anim_en);
}
void lv_obj_scroll_to_y(lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t anim_en)
void lv_obj_scroll_to_y(lv_obj_t * obj, int32_t y, lv_anim_enable_t anim_en)
{
lv_anim_delete(obj, scroll_y_anim);
lv_coord_t scroll_y = lv_obj_get_scroll_y(obj);
lv_coord_t diff = -y + scroll_y;
int32_t scroll_y = lv_obj_get_scroll_y(obj);
int32_t diff = -y + scroll_y;
lv_obj_scroll_by_bounded(obj, 0, diff, anim_en);
}
@ -411,7 +411,7 @@ void lv_obj_scroll_to_view_recursive(lv_obj_t * obj, lv_anim_enable_t anim_en)
}
}
lv_result_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, int32_t x, int32_t y)
{
if(x == 0 && y == 0) return LV_RESULT_OK;
@ -467,10 +467,10 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
if(indev == NULL) return;
}
lv_coord_t st = lv_obj_get_scroll_top(obj);
lv_coord_t sb = lv_obj_get_scroll_bottom(obj);
lv_coord_t sl = lv_obj_get_scroll_left(obj);
lv_coord_t sr = lv_obj_get_scroll_right(obj);
int32_t st = lv_obj_get_scroll_top(obj);
int32_t sb = lv_obj_get_scroll_bottom(obj);
int32_t sl = lv_obj_get_scroll_left(obj);
int32_t sr = lv_obj_get_scroll_right(obj);
lv_dir_t dir = lv_obj_get_scroll_dir(obj);
@ -495,19 +495,19 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
bool rtl = lv_obj_get_style_base_dir(obj, LV_PART_SCROLLBAR) == LV_BASE_DIR_RTL;
lv_coord_t top_space = lv_obj_get_style_pad_top(obj, LV_PART_SCROLLBAR);
lv_coord_t bottom_space = lv_obj_get_style_pad_bottom(obj, LV_PART_SCROLLBAR);
lv_coord_t left_space = lv_obj_get_style_pad_left(obj, LV_PART_SCROLLBAR);
lv_coord_t right_space = lv_obj_get_style_pad_right(obj, LV_PART_SCROLLBAR);
lv_coord_t thickness = lv_obj_get_style_width(obj, LV_PART_SCROLLBAR);
int32_t top_space = lv_obj_get_style_pad_top(obj, LV_PART_SCROLLBAR);
int32_t bottom_space = lv_obj_get_style_pad_bottom(obj, LV_PART_SCROLLBAR);
int32_t left_space = lv_obj_get_style_pad_left(obj, LV_PART_SCROLLBAR);
int32_t right_space = lv_obj_get_style_pad_right(obj, LV_PART_SCROLLBAR);
int32_t thickness = lv_obj_get_style_width(obj, LV_PART_SCROLLBAR);
lv_coord_t obj_h = lv_obj_get_height(obj);
lv_coord_t obj_w = lv_obj_get_width(obj);
int32_t obj_h = lv_obj_get_height(obj);
int32_t obj_w = lv_obj_get_width(obj);
/*Space required for the vertical and horizontal scrollbars*/
lv_coord_t ver_reg_space = ver_draw ? thickness : 0;
lv_coord_t hor_req_space = hor_draw ? thickness : 0;
lv_coord_t rem;
int32_t ver_reg_space = ver_draw ? thickness : 0;
int32_t hor_req_space = hor_draw ? thickness : 0;
int32_t rem;
if(lv_obj_get_style_bg_opa(obj, LV_PART_SCROLLBAR) < LV_OPA_MIN &&
lv_obj_get_style_border_opa(obj, LV_PART_SCROLLBAR) < LV_OPA_MIN) {
@ -515,7 +515,7 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
}
/*Draw vertical scrollbar if the mode is ON or can be scrolled in this direction*/
lv_coord_t content_h = obj_h + st + sb;
int32_t content_h = obj_h + st + sb;
if(ver_draw && content_h) {
ver_area->y1 = obj->coords.y1;
ver_area->y2 = obj->coords.y2;
@ -528,17 +528,17 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
ver_area->x1 = ver_area->x2 - thickness + 1;
}
lv_coord_t sb_h = ((obj_h - top_space - bottom_space - hor_req_space) * obj_h) / content_h;
int32_t sb_h = ((obj_h - top_space - bottom_space - hor_req_space) * obj_h) / content_h;
sb_h = LV_MAX(sb_h, SCROLLBAR_MIN_SIZE);
rem = (obj_h - top_space - bottom_space - hor_req_space) -
sb_h; /*Remaining size from the scrollbar track that is not the scrollbar itself*/
lv_coord_t scroll_h = content_h - obj_h; /*The size of the content which can be really scrolled*/
int32_t scroll_h = content_h - obj_h; /*The size of the content which can be really scrolled*/
if(scroll_h <= 0) {
ver_area->y1 = obj->coords.y1 + top_space;
ver_area->y2 = obj->coords.y2 - bottom_space - hor_req_space - 1;
}
else {
lv_coord_t sb_y = (rem * sb) / scroll_h;
int32_t sb_y = (rem * sb) / scroll_h;
sb_y = rem - sb_y;
ver_area->y1 = obj->coords.y1 + sb_y + top_space;
@ -559,18 +559,18 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
}
/*Draw horizontal scrollbar if the mode is ON or can be scrolled in this direction*/
lv_coord_t content_w = obj_w + sl + sr;
int32_t content_w = obj_w + sl + sr;
if(hor_draw && content_w) {
hor_area->y2 = obj->coords.y2 - bottom_space;
hor_area->y1 = hor_area->y2 - thickness + 1;
hor_area->x1 = obj->coords.x1;
hor_area->x2 = obj->coords.x2;
lv_coord_t sb_w = ((obj_w - left_space - right_space - ver_reg_space) * obj_w) / content_w;
int32_t sb_w = ((obj_w - left_space - right_space - ver_reg_space) * obj_w) / content_w;
sb_w = LV_MAX(sb_w, SCROLLBAR_MIN_SIZE);
rem = (obj_w - left_space - right_space - ver_reg_space) -
sb_w; /*Remaining size from the scrollbar track that is not the scrollbar itself*/
lv_coord_t scroll_w = content_w - obj_w; /*The size of the content which can be really scrolled*/
int32_t scroll_w = content_w - obj_w; /*The size of the content which can be really scrolled*/
if(scroll_w <= 0) {
if(rtl) {
hor_area->x1 = obj->coords.x1 + left_space + ver_reg_space - 1;
@ -582,7 +582,7 @@ void lv_obj_get_scrollbar_area(lv_obj_t * obj, lv_area_t * hor_area, lv_area_t *
}
}
else {
lv_coord_t sb_x = (rem * sr) / scroll_w;
int32_t sb_x = (rem * sr) / scroll_w;
sb_x = rem - sb_x;
if(rtl) {
@ -638,8 +638,8 @@ void lv_obj_readjust_scroll(lv_obj_t * obj, lv_anim_enable_t anim_en)
/*Be sure the bottom side is not remains scrolled in*/
/*With snapping the content can't be scrolled in*/
if(lv_obj_get_scroll_snap_y(obj) == LV_SCROLL_SNAP_NONE) {
lv_coord_t st = lv_obj_get_scroll_top(obj);
lv_coord_t sb = lv_obj_get_scroll_bottom(obj);
int32_t st = lv_obj_get_scroll_top(obj);
int32_t sb = lv_obj_get_scroll_bottom(obj);
if(sb < 0 && st > 0) {
sb = LV_MIN(st, -sb);
lv_obj_scroll_by(obj, 0, sb, anim_en);
@ -647,8 +647,8 @@ void lv_obj_readjust_scroll(lv_obj_t * obj, lv_anim_enable_t anim_en)
}
if(lv_obj_get_scroll_snap_x(obj) == LV_SCROLL_SNAP_NONE) {
lv_coord_t sl = lv_obj_get_scroll_left(obj);
lv_coord_t sr = lv_obj_get_scroll_right(obj);
int32_t sl = lv_obj_get_scroll_left(obj);
int32_t sr = lv_obj_get_scroll_right(obj);
if(lv_obj_get_style_base_dir(obj, LV_PART_MAIN) != LV_BASE_DIR_RTL) {
/*Be sure the left side is not remains scrolled in*/
if(sr < 0 && sl > 0) {
@ -693,31 +693,31 @@ static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_p
if(!lv_obj_has_flag(parent, LV_OBJ_FLAG_SCROLLABLE)) return;
lv_dir_t scroll_dir = lv_obj_get_scroll_dir(parent);
lv_coord_t snap_goal = 0;
lv_coord_t act = 0;
int32_t snap_goal = 0;
int32_t act = 0;
const lv_area_t * area_tmp;
lv_coord_t y_scroll = 0;
int32_t y_scroll = 0;
lv_scroll_snap_t snap_y = lv_obj_get_scroll_snap_y(parent);
if(snap_y != LV_SCROLL_SNAP_NONE) area_tmp = &child->coords;
else area_tmp = area;
lv_coord_t stop = lv_obj_get_style_space_top(parent, LV_PART_MAIN);
lv_coord_t sbottom = lv_obj_get_style_space_bottom(parent, LV_PART_MAIN);
lv_coord_t top_diff = parent->coords.y1 + stop - area_tmp->y1 - scroll_value->y;
lv_coord_t bottom_diff = -(parent->coords.y2 - sbottom - area_tmp->y2 - scroll_value->y);
lv_coord_t parent_h = lv_obj_get_height(parent) - stop - sbottom;
int32_t stop = lv_obj_get_style_space_top(parent, LV_PART_MAIN);
int32_t sbottom = lv_obj_get_style_space_bottom(parent, LV_PART_MAIN);
int32_t top_diff = parent->coords.y1 + stop - area_tmp->y1 - scroll_value->y;
int32_t bottom_diff = -(parent->coords.y2 - sbottom - area_tmp->y2 - scroll_value->y);
int32_t parent_h = lv_obj_get_height(parent) - stop - sbottom;
if((top_diff >= 0 && bottom_diff >= 0)) y_scroll = 0;
else if(top_diff > 0) {
y_scroll = top_diff;
/*Do not let scrolling in*/
lv_coord_t st = lv_obj_get_scroll_top(parent);
int32_t st = lv_obj_get_scroll_top(parent);
if(st - y_scroll < 0) y_scroll = 0;
}
else if(bottom_diff > 0) {
y_scroll = -bottom_diff;
/*Do not let scrolling in*/
lv_coord_t sb = lv_obj_get_scroll_bottom(parent);
int32_t sb = lv_obj_get_scroll_bottom(parent);
if(sb + y_scroll < 0) y_scroll = 0;
}
@ -739,30 +739,30 @@ static void scroll_area_into_view(const lv_area_t * area, lv_obj_t * child, lv_p
break;
}
lv_coord_t x_scroll = 0;
int32_t x_scroll = 0;
lv_scroll_snap_t snap_x = lv_obj_get_scroll_snap_x(parent);
if(snap_x != LV_SCROLL_SNAP_NONE) area_tmp = &child->coords;
else area_tmp = area;
lv_coord_t sleft = lv_obj_get_style_space_left(parent, LV_PART_MAIN);
lv_coord_t sright = lv_obj_get_style_space_right(parent, LV_PART_MAIN);
lv_coord_t left_diff = parent->coords.x1 + sleft - area_tmp->x1 - scroll_value->x;
lv_coord_t right_diff = -(parent->coords.x2 - sright - area_tmp->x2 - scroll_value->x);
int32_t sleft = lv_obj_get_style_space_left(parent, LV_PART_MAIN);
int32_t sright = lv_obj_get_style_space_right(parent, LV_PART_MAIN);
int32_t left_diff = parent->coords.x1 + sleft - area_tmp->x1 - scroll_value->x;
int32_t right_diff = -(parent->coords.x2 - sright - area_tmp->x2 - scroll_value->x);
if((left_diff >= 0 && right_diff >= 0)) x_scroll = 0;
else if(left_diff > 0) {
x_scroll = left_diff;
/*Do not let scrolling in*/
lv_coord_t sl = lv_obj_get_scroll_left(parent);
int32_t sl = lv_obj_get_scroll_left(parent);
if(sl - x_scroll < 0) x_scroll = 0;
}
else if(right_diff > 0) {
x_scroll = -right_diff;
/*Do not let scrolling in*/
lv_coord_t sr = lv_obj_get_scroll_right(parent);
int32_t sr = lv_obj_get_scroll_right(parent);
if(sr + x_scroll < 0) x_scroll = 0;
}
lv_coord_t parent_w = lv_obj_get_width(parent) - sleft - sright;
int32_t parent_w = lv_obj_get_width(parent) - sleft - sright;
switch(snap_x) {
case LV_SCROLL_SNAP_START:
snap_goal = parent->coords.x1 + sleft;

View File

@ -132,7 +132,7 @@ lv_scroll_snap_t lv_obj_get_scroll_snap_y(const struct _lv_obj_t * obj);
* If scrolled return > 0
* If scrolled in (elastic scroll) return < 0
*/
lv_coord_t lv_obj_get_scroll_x(const struct _lv_obj_t * obj);
int32_t lv_obj_get_scroll_x(const struct _lv_obj_t * obj);
/**
* Get current Y scroll position.
@ -142,7 +142,7 @@ lv_coord_t lv_obj_get_scroll_x(const struct _lv_obj_t * obj);
* If scrolled return > 0
* If scrolled inside return < 0
*/
lv_coord_t lv_obj_get_scroll_y(const struct _lv_obj_t * obj);
int32_t lv_obj_get_scroll_y(const struct _lv_obj_t * obj);
/**
* Return the height of the area above the object.
@ -151,7 +151,7 @@ lv_coord_t lv_obj_get_scroll_y(const struct _lv_obj_t * obj);
* @param obj pointer to an object
* @return the scrollable area above the object in pixels
*/
lv_coord_t lv_obj_get_scroll_top(struct _lv_obj_t * obj);
int32_t lv_obj_get_scroll_top(struct _lv_obj_t * obj);
/**
* Return the height of the area below the object.
@ -160,7 +160,7 @@ lv_coord_t lv_obj_get_scroll_top(struct _lv_obj_t * obj);
* @param obj pointer to an object
* @return the scrollable area below the object in pixels
*/
lv_coord_t lv_obj_get_scroll_bottom(struct _lv_obj_t * obj);
int32_t lv_obj_get_scroll_bottom(struct _lv_obj_t * obj);
/**
* Return the width of the area on the left the object.
@ -169,7 +169,7 @@ lv_coord_t lv_obj_get_scroll_bottom(struct _lv_obj_t * obj);
* @param obj pointer to an object
* @return the scrollable area on the left the object in pixels
*/
lv_coord_t lv_obj_get_scroll_left(struct _lv_obj_t * obj);
int32_t lv_obj_get_scroll_left(struct _lv_obj_t * obj);
/**
* Return the width of the area on the right the object.
@ -178,7 +178,7 @@ lv_coord_t lv_obj_get_scroll_left(struct _lv_obj_t * obj);
* @param obj pointer to an object
* @return the scrollable area on the right the object in pixels
*/
lv_coord_t lv_obj_get_scroll_right(struct _lv_obj_t * obj);
int32_t lv_obj_get_scroll_right(struct _lv_obj_t * obj);
/**
* Get the X and Y coordinates where the scrolling will end for this object if a scrolling animation is in progress.
@ -201,7 +201,7 @@ void lv_obj_get_scroll_end(struct _lv_obj_t * obj, lv_point_t * end);
* @note > 0 value means scroll right/bottom (show the more content on the right/bottom)
* @note e.g. dy = -20 means scroll down 20 px
*/
void lv_obj_scroll_by(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en);
void lv_obj_scroll_by(struct _lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en);
/**
* Scroll by a given amount of pixels.
@ -212,7 +212,7 @@ void lv_obj_scroll_by(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_ani
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
* @note e.g. dy = -20 means scroll down 20 px
*/
void lv_obj_scroll_by_bounded(struct _lv_obj_t * obj, lv_coord_t dx, lv_coord_t dy, lv_anim_enable_t anim_en);
void lv_obj_scroll_by_bounded(struct _lv_obj_t * obj, int32_t dx, int32_t dy, lv_anim_enable_t anim_en);
/**
* Scroll to a given coordinate on an object.
@ -222,7 +222,7 @@ void lv_obj_scroll_by_bounded(struct _lv_obj_t * obj, lv_coord_t dx, lv_coord_t
* @param y pixels to scroll vertically
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
*/
void lv_obj_scroll_to(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_anim_enable_t anim_en);
void lv_obj_scroll_to(struct _lv_obj_t * obj, int32_t x, int32_t y, lv_anim_enable_t anim_en);
/**
* Scroll to a given X coordinate on an object.
@ -231,7 +231,7 @@ void lv_obj_scroll_to(struct _lv_obj_t * obj, lv_coord_t x, lv_coord_t y, lv_ani
* @param x pixels to scroll horizontally
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
*/
void lv_obj_scroll_to_x(struct _lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t anim_en);
void lv_obj_scroll_to_x(struct _lv_obj_t * obj, int32_t x, lv_anim_enable_t anim_en);
/**
* Scroll to a given Y coordinate on an object
@ -240,7 +240,7 @@ void lv_obj_scroll_to_x(struct _lv_obj_t * obj, lv_coord_t x, lv_anim_enable_t a
* @param y pixels to scroll vertically
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
*/
void lv_obj_scroll_to_y(struct _lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t anim_en);
void lv_obj_scroll_to_y(struct _lv_obj_t * obj, int32_t y, lv_anim_enable_t anim_en);
/**
* Scroll to an object until it becomes visible on its parent
@ -268,7 +268,7 @@ void lv_obj_scroll_to_view_recursive(struct _lv_obj_t * obj, lv_anim_enable_t an
* @return `LV_RESULT_INVALID`: to object was deleted in `LV_EVENT_SCROLL`;
* `LV_RESULT_OK`: if the object is still valid
*/
lv_result_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, int32_t x, int32_t y);
/**
* Tell whether an object is being scrolled or not at this moment

View File

@ -532,8 +532,8 @@ void _lv_obj_style_create_transition(lv_obj_t * obj, lv_part_t part, lv_state_t
if(tr_dsc->prop == LV_STYLE_RADIUS) {
if(v1.num == LV_RADIUS_CIRCLE || v2.num == LV_RADIUS_CIRCLE) {
lv_coord_t whalf = lv_obj_get_width(obj) / 2;
lv_coord_t hhalf = lv_obj_get_height(obj) / 2;
int32_t whalf = lv_obj_get_width(obj) / 2;
int32_t hhalf = lv_obj_get_height(obj) / 2;
if(v1.num == LV_RADIUS_CIRCLE) v1.num = LV_MIN(whalf + 1, hhalf + 1);
if(v2.num == LV_RADIUS_CIRCLE) v2.num = LV_MIN(whalf + 1, hhalf + 1);
}

View File

@ -226,7 +226,7 @@ static inline lv_part_t lv_obj_style_get_selector_part(lv_style_selector_t selec
#include "lv_obj_style_gen.h"
static inline void lv_obj_set_style_pad_all(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
static inline void lv_obj_set_style_pad_all(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_obj_set_style_pad_left(obj, value, selector);
lv_obj_set_style_pad_right(obj, value, selector);
@ -234,19 +234,19 @@ static inline void lv_obj_set_style_pad_all(struct _lv_obj_t * obj, lv_coord_t v
lv_obj_set_style_pad_bottom(obj, value, selector);
}
static inline void lv_obj_set_style_pad_hor(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
static inline void lv_obj_set_style_pad_hor(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_obj_set_style_pad_left(obj, value, selector);
lv_obj_set_style_pad_right(obj, value, selector);
}
static inline void lv_obj_set_style_pad_ver(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
static inline void lv_obj_set_style_pad_ver(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_obj_set_style_pad_top(obj, value, selector);
lv_obj_set_style_pad_bottom(obj, value, selector);
}
static inline void lv_obj_set_style_margin_all(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
static inline void lv_obj_set_style_margin_all(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_obj_set_style_margin_left(obj, value, selector);
lv_obj_set_style_margin_right(obj, value, selector);
@ -254,79 +254,79 @@ static inline void lv_obj_set_style_margin_all(struct _lv_obj_t * obj, lv_coord_
lv_obj_set_style_margin_bottom(obj, value, selector);
}
static inline void lv_obj_set_style_margin_hor(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
static inline void lv_obj_set_style_margin_hor(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_obj_set_style_margin_left(obj, value, selector);
lv_obj_set_style_margin_right(obj, value, selector);
}
static inline void lv_obj_set_style_margin_ver(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
static inline void lv_obj_set_style_margin_ver(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_obj_set_style_margin_top(obj, value, selector);
lv_obj_set_style_margin_bottom(obj, value, selector);
}
static inline void lv_obj_set_style_pad_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
static inline void lv_obj_set_style_pad_gap(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_obj_set_style_pad_row(obj, value, selector);
lv_obj_set_style_pad_column(obj, value, selector);
}
static inline void lv_obj_set_style_size(struct _lv_obj_t * obj, lv_coord_t width, lv_coord_t height,
static inline void lv_obj_set_style_size(struct _lv_obj_t * obj, int32_t width, int32_t height,
lv_style_selector_t selector)
{
lv_obj_set_style_width(obj, width, selector);
lv_obj_set_style_height(obj, height, selector);
}
static inline void lv_obj_set_style_transform_scale(struct _lv_obj_t * obj, lv_coord_t value,
static inline void lv_obj_set_style_transform_scale(struct _lv_obj_t * obj, int32_t value,
lv_style_selector_t selector)
{
lv_obj_set_style_transform_scale_x(obj, value, selector);
lv_obj_set_style_transform_scale_y(obj, value, selector);
}
static inline lv_coord_t lv_obj_get_style_space_left(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_space_left(const struct _lv_obj_t * obj, uint32_t part)
{
lv_coord_t padding = lv_obj_get_style_pad_left(obj, part);
lv_coord_t border_width = lv_obj_get_style_border_width(obj, part);
int32_t padding = lv_obj_get_style_pad_left(obj, part);
int32_t border_width = lv_obj_get_style_border_width(obj, part);
lv_border_side_t border_side = lv_obj_get_style_border_side(obj, part);
return (border_side & LV_BORDER_SIDE_LEFT) ? padding + border_width : padding;
}
static inline lv_coord_t lv_obj_get_style_space_right(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_space_right(const struct _lv_obj_t * obj, uint32_t part)
{
lv_coord_t padding = lv_obj_get_style_pad_right(obj, part);
lv_coord_t border_width = lv_obj_get_style_border_width(obj, part);
int32_t padding = lv_obj_get_style_pad_right(obj, part);
int32_t border_width = lv_obj_get_style_border_width(obj, part);
lv_border_side_t border_side = lv_obj_get_style_border_side(obj, part);
return (border_side & LV_BORDER_SIDE_RIGHT) ? padding + border_width : padding;
}
static inline lv_coord_t lv_obj_get_style_space_top(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_space_top(const struct _lv_obj_t * obj, uint32_t part)
{
lv_coord_t padding = lv_obj_get_style_pad_top(obj, part);
lv_coord_t border_width = lv_obj_get_style_border_width(obj, part);
int32_t padding = lv_obj_get_style_pad_top(obj, part);
int32_t border_width = lv_obj_get_style_border_width(obj, part);
lv_border_side_t border_side = lv_obj_get_style_border_side(obj, part);
return (border_side & LV_BORDER_SIDE_TOP) ? padding + border_width : padding;
}
static inline lv_coord_t lv_obj_get_style_space_bottom(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_space_bottom(const struct _lv_obj_t * obj, uint32_t part)
{
lv_coord_t padding = lv_obj_get_style_pad_bottom(obj, part);
lv_coord_t border_width = lv_obj_get_style_border_width(obj, part);
int32_t padding = lv_obj_get_style_pad_bottom(obj, part);
int32_t border_width = lv_obj_get_style_border_width(obj, part);
lv_border_side_t border_side = lv_obj_get_style_border_side(obj, part);
return (border_side & LV_BORDER_SIDE_BOTTOM) ? padding + border_width : padding;
}
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_scale_x_safe(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_transform_scale_x_safe(const struct _lv_obj_t * obj, uint32_t part)
{
int16_t zoom = lv_obj_get_style_transform_scale_x(obj, part);
return zoom != 0 ? zoom : 1;
}
static inline lv_coord_t lv_obj_get_style_transform_scale_y_safe(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_transform_scale_y_safe(const struct _lv_obj_t * obj, uint32_t part)
{
int16_t zoom = lv_obj_get_style_transform_scale_y(obj, part);
return zoom != 0 ? zoom : 1;

View File

@ -10,7 +10,7 @@
#include "lv_obj.h"
void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -18,7 +18,7 @@ void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_s
lv_obj_set_local_style_prop(obj, LV_STYLE_WIDTH, v, selector);
}
void lv_obj_set_style_min_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_min_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -26,7 +26,7 @@ void lv_obj_set_style_min_width(struct _lv_obj_t * obj, lv_coord_t value, lv_sty
lv_obj_set_local_style_prop(obj, LV_STYLE_MIN_WIDTH, v, selector);
}
void lv_obj_set_style_max_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_max_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -34,7 +34,7 @@ void lv_obj_set_style_max_width(struct _lv_obj_t * obj, lv_coord_t value, lv_sty
lv_obj_set_local_style_prop(obj, LV_STYLE_MAX_WIDTH, v, selector);
}
void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_height(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -42,7 +42,7 @@ void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_
lv_obj_set_local_style_prop(obj, LV_STYLE_HEIGHT, v, selector);
}
void lv_obj_set_style_min_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_min_height(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -50,7 +50,7 @@ void lv_obj_set_style_min_height(struct _lv_obj_t * obj, lv_coord_t value, lv_st
lv_obj_set_local_style_prop(obj, LV_STYLE_MIN_HEIGHT, v, selector);
}
void lv_obj_set_style_max_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_max_height(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -58,7 +58,7 @@ void lv_obj_set_style_max_height(struct _lv_obj_t * obj, lv_coord_t value, lv_st
lv_obj_set_local_style_prop(obj, LV_STYLE_MAX_HEIGHT, v, selector);
}
void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -66,7 +66,7 @@ void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selec
lv_obj_set_local_style_prop(obj, LV_STYLE_X, v, selector);
}
void lv_obj_set_style_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -82,7 +82,7 @@ void lv_obj_set_style_align(struct _lv_obj_t * obj, lv_align_t value, lv_style_s
lv_obj_set_local_style_prop(obj, LV_STYLE_ALIGN, v, selector);
}
void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -90,7 +90,7 @@ void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value,
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_WIDTH, v, selector);
}
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_transform_height(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -98,7 +98,7 @@ void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, lv_coord_t value,
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_HEIGHT, v, 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_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -106,7 +106,7 @@ void lv_obj_set_style_translate_x(struct _lv_obj_t * obj, lv_coord_t value, lv_s
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSLATE_X, v, 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_translate_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -114,7 +114,7 @@ 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_scale_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_transform_scale_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -122,7 +122,7 @@ void lv_obj_set_style_transform_scale_x(struct _lv_obj_t * obj, lv_coord_t value
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_SCALE_X, v, selector);
}
void lv_obj_set_style_transform_scale_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_transform_scale_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -130,7 +130,7 @@ void lv_obj_set_style_transform_scale_y(struct _lv_obj_t * obj, lv_coord_t value
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_SCALE_Y, v, 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_rotation(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -138,7 +138,7 @@ void lv_obj_set_style_transform_rotation(struct _lv_obj_t * obj, lv_coord_t valu
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)
void lv_obj_set_style_transform_pivot_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -146,7 +146,7 @@ void lv_obj_set_style_transform_pivot_x(struct _lv_obj_t * obj, lv_coord_t value
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_PIVOT_X, v, 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_transform_pivot_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -154,7 +154,7 @@ void lv_obj_set_style_transform_pivot_y(struct _lv_obj_t * obj, lv_coord_t value
lv_obj_set_local_style_prop(obj, LV_STYLE_TRANSFORM_PIVOT_Y, v, selector);
}
void lv_obj_set_style_pad_top(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, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -162,7 +162,7 @@ void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_TOP, v, selector);
}
void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -170,7 +170,7 @@ void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_st
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_BOTTOM, v, selector);
}
void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -178,7 +178,7 @@ void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t value, lv_styl
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_LEFT, v, selector);
}
void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -186,7 +186,7 @@ void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t value, lv_sty
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_RIGHT, v, selector);
}
void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -194,7 +194,7 @@ void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t value, lv_style
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_ROW, v, selector);
}
void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -202,7 +202,7 @@ void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_t value, lv_st
lv_obj_set_local_style_prop(obj, LV_STYLE_PAD_COLUMN, v, selector);
}
void lv_obj_set_style_margin_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_margin_top(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -210,7 +210,7 @@ void lv_obj_set_style_margin_top(struct _lv_obj_t * obj, lv_coord_t value, lv_st
lv_obj_set_local_style_prop(obj, LV_STYLE_MARGIN_TOP, v, selector);
}
void lv_obj_set_style_margin_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_margin_bottom(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -218,7 +218,7 @@ void lv_obj_set_style_margin_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv
lv_obj_set_local_style_prop(obj, LV_STYLE_MARGIN_BOTTOM, v, selector);
}
void lv_obj_set_style_margin_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_margin_left(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -226,7 +226,7 @@ void lv_obj_set_style_margin_left(struct _lv_obj_t * obj, lv_coord_t value, lv_s
lv_obj_set_local_style_prop(obj, LV_STYLE_MARGIN_LEFT, v, selector);
}
void lv_obj_set_style_margin_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_margin_right(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -266,7 +266,7 @@ void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_dir_t value, l
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_GRAD_DIR, v, selector);
}
void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -274,7 +274,7 @@ void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_
lv_obj_set_local_style_prop(obj, LV_STYLE_BG_MAIN_STOP, v, selector);
}
void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -362,7 +362,7 @@ void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_styl
lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_OPA, v, selector);
}
void lv_obj_set_style_border_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_border_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -386,7 +386,7 @@ void lv_obj_set_style_border_post(struct _lv_obj_t * obj, bool value, lv_style_s
lv_obj_set_local_style_prop(obj, LV_STYLE_BORDER_POST, v, selector);
}
void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -410,7 +410,7 @@ void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_sty
lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_OPA, v, selector);
}
void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -418,7 +418,7 @@ void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_s
lv_obj_set_local_style_prop(obj, LV_STYLE_OUTLINE_PAD, v, selector);
}
void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -426,7 +426,7 @@ void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_WIDTH, v, selector);
}
void lv_obj_set_style_shadow_offset_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_shadow_offset_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -434,7 +434,7 @@ void lv_obj_set_style_shadow_offset_x(struct _lv_obj_t * obj, lv_coord_t value,
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFFSET_X, v, selector);
}
void lv_obj_set_style_shadow_offset_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_shadow_offset_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -442,7 +442,7 @@ void lv_obj_set_style_shadow_offset_y(struct _lv_obj_t * obj, lv_coord_t value,
lv_obj_set_local_style_prop(obj, LV_STYLE_SHADOW_OFFSET_Y, v, selector);
}
void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -490,7 +490,7 @@ void lv_obj_set_style_image_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value,
lv_obj_set_local_style_prop(obj, LV_STYLE_IMAGE_RECOLOR_OPA, v, selector);
}
void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_line_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -498,7 +498,7 @@ void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_t value, lv_st
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_WIDTH, v, selector);
}
void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -506,7 +506,7 @@ void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_coord_t value,
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_DASH_WIDTH, v, selector);
}
void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -538,7 +538,7 @@ void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_
lv_obj_set_local_style_prop(obj, LV_STYLE_LINE_OPA, v, selector);
}
void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -602,7 +602,7 @@ void lv_obj_set_style_text_font(struct _lv_obj_t * obj, const lv_font_t * value,
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_FONT, v, selector);
}
void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -610,7 +610,7 @@ void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv_coord_t value
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_LETTER_SPACE, v, selector);
}
void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -634,7 +634,7 @@ void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value,
lv_obj_set_local_style_prop(obj, LV_STYLE_TEXT_ALIGN, v, selector);
}
void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_radius(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -780,7 +780,7 @@ void lv_obj_set_style_flex_grow(struct _lv_obj_t * obj, uint8_t value, lv_style_
lv_obj_set_local_style_prop(obj, LV_STYLE_FLEX_GROW, v, selector);
}
void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value,
void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const int32_t * value,
lv_style_selector_t selector)
{
lv_style_value_t v = {
@ -797,7 +797,7 @@ void lv_obj_set_style_grid_column_align(struct _lv_obj_t * obj, lv_grid_align_t
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_COLUMN_ALIGN, v, selector);
}
void lv_obj_set_style_grid_row_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value, lv_style_selector_t selector)
void lv_obj_set_style_grid_row_dsc_array(struct _lv_obj_t * obj, const int32_t * value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.ptr = value
@ -813,7 +813,7 @@ void lv_obj_set_style_grid_row_align(struct _lv_obj_t * obj, lv_grid_align_t val
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_ROW_ALIGN, v, selector);
}
void lv_obj_set_style_grid_cell_column_pos(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_grid_cell_column_pos(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -829,7 +829,7 @@ void lv_obj_set_style_grid_cell_x_align(struct _lv_obj_t * obj, lv_grid_align_t
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_X_ALIGN, v, selector);
}
void lv_obj_set_style_grid_cell_column_span(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_grid_cell_column_span(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -837,7 +837,7 @@ void lv_obj_set_style_grid_cell_column_span(struct _lv_obj_t * obj, lv_coord_t v
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_COLUMN_SPAN, v, selector);
}
void lv_obj_set_style_grid_cell_row_pos(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_grid_cell_row_pos(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value
@ -853,7 +853,7 @@ void lv_obj_set_style_grid_cell_y_align(struct _lv_obj_t * obj, lv_grid_align_t
lv_obj_set_local_style_prop(obj, LV_STYLE_GRID_CELL_Y_ALIGN, v, selector);
}
void lv_obj_set_style_grid_cell_row_span(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector)
void lv_obj_set_style_grid_cell_row_span(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector)
{
lv_style_value_t v = {
.num = (int32_t)value

View File

@ -14,52 +14,52 @@
#include "../misc/lv_style.h"
#include "../core/lv_obj_style.h"
static inline lv_coord_t lv_obj_get_style_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_min_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_min_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MIN_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_max_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_max_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MAX_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_height(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_height(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_HEIGHT);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_min_height(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_min_height(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MIN_HEIGHT);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_max_height(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_max_height(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MAX_HEIGHT);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_x(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_x(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_X);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_y(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_y(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_Y);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_align_t lv_obj_get_style_align(const struct _lv_obj_t * obj, uint32_t part)
@ -68,118 +68,118 @@ static inline lv_align_t lv_obj_get_style_align(const struct _lv_obj_t * obj, ui
return (lv_align_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_transform_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_transform_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_transform_height(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_transform_height(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_HEIGHT);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_translate_x(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_translate_x(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSLATE_X);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_translate_y(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_translate_y(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSLATE_Y);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_transform_scale_x(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_transform_scale_x(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_SCALE_X);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_transform_scale_y(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_transform_scale_y(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_SCALE_Y);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_transform_rotation(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_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_ROTATION);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_transform_pivot_x(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_transform_pivot_x(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_PIVOT_X);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_transform_pivot_y(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_transform_pivot_y(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TRANSFORM_PIVOT_Y);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_pad_top(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_pad_top(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_TOP);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_pad_bottom(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_pad_bottom(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_BOTTOM);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_pad_left(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_pad_left(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_LEFT);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_pad_right(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_pad_right(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_RIGHT);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_pad_row(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_pad_row(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_ROW);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_pad_column(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_pad_column(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_PAD_COLUMN);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_margin_top(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_margin_top(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MARGIN_TOP);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_margin_bottom(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_margin_bottom(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MARGIN_BOTTOM);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_margin_left(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_margin_left(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MARGIN_LEFT);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_margin_right(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_margin_right(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_MARGIN_RIGHT);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_color_t lv_obj_get_style_bg_color(const struct _lv_obj_t * obj, uint32_t part)
@ -219,16 +219,16 @@ static inline lv_grad_dir_t lv_obj_get_style_bg_grad_dir(const struct _lv_obj_t
return (lv_grad_dir_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_bg_main_stop(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_bg_main_stop(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_MAIN_STOP);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_bg_grad_stop(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_bg_grad_stop(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BG_GRAD_STOP);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_opa_t lv_obj_get_style_bg_main_opa(const struct _lv_obj_t * obj, uint32_t part)
@ -305,10 +305,10 @@ static inline lv_opa_t lv_obj_get_style_border_opa(const struct _lv_obj_t * obj,
return (lv_opa_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_border_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_border_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_BORDER_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_border_side_t lv_obj_get_style_border_side(const struct _lv_obj_t * obj, uint32_t part)
@ -323,10 +323,10 @@ static inline bool lv_obj_get_style_border_post(const struct _lv_obj_t * obj, ui
return (bool)v.num;
}
static inline lv_coord_t lv_obj_get_style_outline_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_outline_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_color_t lv_obj_get_style_outline_color(const struct _lv_obj_t * obj, uint32_t part)
@ -348,34 +348,34 @@ static inline lv_opa_t lv_obj_get_style_outline_opa(const struct _lv_obj_t * obj
return (lv_opa_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_outline_pad(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_outline_pad(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_OUTLINE_PAD);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_shadow_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_shadow_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_shadow_offset_x(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_shadow_offset_x(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFFSET_X);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_shadow_offset_y(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_shadow_offset_y(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_OFFSET_Y);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_shadow_spread(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_shadow_spread(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_SHADOW_SPREAD);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_color_t lv_obj_get_style_shadow_color(const struct _lv_obj_t * obj, uint32_t part)
@ -422,22 +422,22 @@ static inline lv_opa_t lv_obj_get_style_image_recolor_opa(const struct _lv_obj_t
return (lv_opa_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_line_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_line_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_line_dash_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_line_dash_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_line_dash_gap(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_line_dash_gap(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_LINE_DASH_GAP);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline bool lv_obj_get_style_line_rounded(const struct _lv_obj_t * obj, uint32_t part)
@ -464,10 +464,10 @@ static inline lv_opa_t lv_obj_get_style_line_opa(const struct _lv_obj_t * obj, u
return (lv_opa_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_arc_width(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_arc_width(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_ARC_WIDTH);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline bool lv_obj_get_style_arc_rounded(const struct _lv_obj_t * obj, uint32_t part)
@ -524,16 +524,16 @@ static inline const lv_font_t * lv_obj_get_style_text_font(const struct _lv_obj_
return (const lv_font_t *)v.ptr;
}
static inline lv_coord_t lv_obj_get_style_text_letter_space(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_text_letter_space(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LETTER_SPACE);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_text_line_space(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_text_line_space(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_TEXT_LINE_SPACE);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_text_decor_t lv_obj_get_style_text_decor(const struct _lv_obj_t * obj, uint32_t part)
@ -548,10 +548,10 @@ static inline lv_text_align_t lv_obj_get_style_text_align(const struct _lv_obj_t
return (lv_text_align_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_radius(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_radius(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_RADIUS);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline bool lv_obj_get_style_clip_corner(const struct _lv_obj_t * obj, uint32_t part)
@ -657,10 +657,10 @@ static inline uint8_t lv_obj_get_style_flex_grow(const struct _lv_obj_t * obj, u
return (uint8_t)v.num;
}
static inline const lv_coord_t * lv_obj_get_style_grid_column_dsc_array(const struct _lv_obj_t * obj, uint32_t part)
static inline const int32_t * lv_obj_get_style_grid_column_dsc_array(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_COLUMN_DSC_ARRAY);
return (const lv_coord_t *)v.ptr;
return (const int32_t *)v.ptr;
}
static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const struct _lv_obj_t * obj, uint32_t part)
@ -669,10 +669,10 @@ static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const struct _l
return (lv_grid_align_t)v.num;
}
static inline const lv_coord_t * lv_obj_get_style_grid_row_dsc_array(const struct _lv_obj_t * obj, uint32_t part)
static inline const int32_t * lv_obj_get_style_grid_row_dsc_array(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_ROW_DSC_ARRAY);
return (const lv_coord_t *)v.ptr;
return (const int32_t *)v.ptr;
}
static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const struct _lv_obj_t * obj, uint32_t part)
@ -681,10 +681,10 @@ static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const struct _lv_o
return (lv_grid_align_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_grid_cell_column_pos(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_grid_cell_column_pos(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_COLUMN_POS);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_grid_align_t lv_obj_get_style_grid_cell_x_align(const struct _lv_obj_t * obj, uint32_t part)
@ -693,16 +693,16 @@ static inline lv_grid_align_t lv_obj_get_style_grid_cell_x_align(const struct _l
return (lv_grid_align_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_grid_cell_column_span(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_grid_cell_column_span(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_COLUMN_SPAN);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_grid_cell_row_pos(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_grid_cell_row_pos(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_ROW_POS);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
static inline lv_grid_align_t lv_obj_get_style_grid_cell_y_align(const struct _lv_obj_t * obj, uint32_t part)
@ -711,46 +711,46 @@ static inline lv_grid_align_t lv_obj_get_style_grid_cell_y_align(const struct _l
return (lv_grid_align_t)v.num;
}
static inline lv_coord_t lv_obj_get_style_grid_cell_row_span(const struct _lv_obj_t * obj, uint32_t part)
static inline int32_t lv_obj_get_style_grid_cell_row_span(const struct _lv_obj_t * obj, uint32_t part)
{
lv_style_value_t v = lv_obj_get_style_prop(obj, part, LV_STYLE_GRID_CELL_ROW_SPAN);
return (lv_coord_t)v.num;
return (int32_t)v.num;
}
void lv_obj_set_style_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_min_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_max_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_min_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_max_height(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_min_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_max_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_height(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_min_height(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_max_height(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_align(struct _lv_obj_t * obj, lv_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
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_scale_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_scale_y(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);
void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_top(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_bottom(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_left(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_right(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_height(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_translate_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_scale_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_scale_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_rotation(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_pivot_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_transform_pivot_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_top(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_bottom(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_left(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_right(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_row(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_pad_column(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_top(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_bottom(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_left(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_margin_right(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_dir(struct _lv_obj_t * obj, lv_grad_dir_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_main_stop(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_stop(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_main_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_bg_grad(struct _lv_obj_t * obj, const lv_grad_dsc_t * value, lv_style_selector_t selector);
@ -761,29 +761,29 @@ void lv_obj_set_style_bg_image_recolor_opa(struct _lv_obj_t * obj, lv_opa_t valu
void lv_obj_set_style_bg_image_tiled(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_border_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_side(struct _lv_obj_t * obj, lv_border_side_t value, lv_style_selector_t selector);
void lv_obj_set_style_border_post(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_offset_x(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_offset_y(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_outline_pad(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_offset_x(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_offset_y(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_spread(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_shadow_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_image_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_image_recolor(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_image_recolor_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_dash_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_dash_gap(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_line_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_line_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_width(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_rounded(struct _lv_obj_t * obj, bool value, lv_style_selector_t selector);
void lv_obj_set_style_arc_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_arc_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
@ -791,11 +791,11 @@ void lv_obj_set_style_arc_image_src(struct _lv_obj_t * obj, const void * value,
void lv_obj_set_style_text_color(struct _lv_obj_t * obj, lv_color_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_opa(struct _lv_obj_t * obj, lv_opa_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_font(struct _lv_obj_t * obj, const lv_font_t * value, lv_style_selector_t selector);
void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_letter_space(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_line_space(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_decor(struct _lv_obj_t * obj, lv_text_decor_t value, lv_style_selector_t selector);
void lv_obj_set_style_text_align(struct _lv_obj_t * obj, lv_text_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_radius(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_radius(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
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);
@ -815,17 +815,17 @@ void lv_obj_set_style_flex_main_place(struct _lv_obj_t * obj, lv_flex_align_t va
void lv_obj_set_style_flex_cross_place(struct _lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_flex_track_place(struct _lv_obj_t * obj, lv_flex_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_flex_grow(struct _lv_obj_t * obj, uint8_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value,
void lv_obj_set_style_grid_column_dsc_array(struct _lv_obj_t * obj, const int32_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_grid_column_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_row_dsc_array(struct _lv_obj_t * obj, const lv_coord_t * value,
void lv_obj_set_style_grid_row_dsc_array(struct _lv_obj_t * obj, const int32_t * value,
lv_style_selector_t selector);
void lv_obj_set_style_grid_row_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_column_pos(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_column_pos(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_x_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_column_span(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_row_pos(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_column_span(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_row_pos(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_y_align(struct _lv_obj_t * obj, lv_grid_align_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_row_span(struct _lv_obj_t * obj, lv_coord_t value, lv_style_selector_t selector);
void lv_obj_set_style_grid_cell_row_span(struct _lv_obj_t * obj, int32_t value, lv_style_selector_t selector);
#endif /* LV_OBJ_STYLE_GEN_H */

View File

@ -35,7 +35,7 @@
static void lv_obj_delete_async_cb(void * obj);
static void obj_delete_core(lv_obj_t * obj);
static lv_obj_tree_walk_res_t walk_core(lv_obj_t * obj, lv_obj_tree_walk_cb_t cb, void * user_data);
static lv_obj_tree_walk_res_t dump_tree_core(lv_obj_t * obj, lv_coord_t depth);
static lv_obj_tree_walk_res_t dump_tree_core(lv_obj_t * obj, int32_t depth);
/**********************
* STATIC VARIABLES
@ -514,7 +514,7 @@ static lv_obj_tree_walk_res_t walk_core(lv_obj_t * obj, lv_obj_tree_walk_cb_t cb
return LV_OBJ_TREE_WALK_NEXT;
}
static lv_obj_tree_walk_res_t dump_tree_core(lv_obj_t * obj, lv_coord_t depth)
static lv_obj_tree_walk_res_t dump_tree_core(lv_obj_t * obj, int32_t depth)
{
lv_obj_tree_walk_res_t res;
const char * id;

View File

@ -41,7 +41,7 @@ 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_display_t * disp, lv_coord_t area_w, lv_coord_t area_h);
static uint32_t get_max_row(lv_display_t * disp, int32_t area_w, int32_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 void wait_for_flushing(lv_display_t * disp);
@ -95,7 +95,7 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
/*Truncate the clip area to `obj size + ext size` area*/
lv_area_t obj_coords_ext;
lv_obj_get_coords(obj, &obj_coords_ext);
lv_coord_t ext_draw_size = _lv_obj_get_ext_draw_size(obj);
int32_t ext_draw_size = _lv_obj_get_ext_draw_size(obj);
lv_area_increase(&obj_coords_ext, ext_draw_size, ext_draw_size);
if(!_lv_area_intersect(&clip_coords_for_obj, &clip_area_ori, &obj_coords_ext)) return;
@ -145,7 +145,7 @@ void lv_obj_redraw(lv_layer_t * layer, lv_obj_t * obj)
layer->clip_area = clip_coords_for_children;
bool clip_corner = lv_obj_get_style_clip_corner(obj, LV_PART_MAIN);
lv_coord_t radius = 0;
int32_t radius = 0;
if(clip_corner) {
radius = lv_obj_get_style_radius(obj, LV_PART_MAIN);
if(radius == 0) clip_corner = false;
@ -607,15 +607,15 @@ static void refr_area(const lv_area_t * area_p)
/*Normal refresh: draw the area in parts*/
/*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_display_get_vertical_resolution(disp_refr) ?
lv_display_get_vertical_resolution(disp_refr) - 1 : area_p->y2;
int32_t w = lv_area_get_width(area_p);
int32_t h = lv_area_get_height(area_p);
int32_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);
lv_coord_t row;
lv_coord_t row_last = 0;
int32_t row;
int32_t row_last = 0;
lv_area_t sub_area;
for(row = area_p->y1; row + max_row - 1 <= y2; row += max_row) {
/*Calc. the next y coordinates of draw_buf*/
@ -801,7 +801,7 @@ 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)
{
lv_coord_t ext_draw_size = _lv_obj_get_ext_draw_size(obj);
int32_t ext_draw_size = _lv_obj_get_ext_draw_size(obj);
lv_area_t obj_coords_ext;
lv_obj_get_coords(obj, &obj_coords_ext);
lv_area_increase(&obj_coords_ext, ext_draw_size, ext_draw_size);
@ -878,7 +878,7 @@ void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
uint32_t max_rgb_row_height = lv_area_get_height(&layer_area_full);
uint32_t max_argb_row_height = lv_area_get_height(&layer_area_full);
if(layer_type == LV_LAYER_TYPE_SIMPLE) {
lv_coord_t w = lv_area_get_width(&layer_area_full);
int32_t w = lv_area_get_width(&layer_area_full);
uint8_t px_size = lv_color_format_get_size(disp_refr->color_format);
max_rgb_row_height = LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE / w / px_size;
max_argb_row_height = LV_DRAW_SW_LAYER_SIMPLE_BUF_SIZE / w / sizeof(lv_color32_t);
@ -928,7 +928,7 @@ void refr_obj(lv_layer_t * layer, lv_obj_t * obj)
}
static uint32_t get_max_row(lv_display_t * disp, lv_coord_t area_w, lv_coord_t area_h)
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);
uint32_t px_size_disp = lv_color_format_get_size(disp->color_format);
@ -943,7 +943,7 @@ static uint32_t get_max_row(lv_display_t * disp, lv_coord_t area_w, lv_coord_t a
tmp.x2 = 0;
tmp.y1 = 0;
lv_coord_t h_tmp = max_row;
int32_t h_tmp = max_row;
do {
tmp.y2 = h_tmp - 1;
lv_display_send_event(disp_refr, LV_EVENT_INVALIDATE_AREA, &tmp);

View File

@ -152,9 +152,9 @@ void lv_linux_drm_set_file(lv_display_t * disp, const char * file, int64_t conne
LV_LOG_INFO("DRM subsystem and buffer mapped successfully");
lv_coord_t hor_res = drm_dev->width;
lv_coord_t ver_res = drm_dev->height;
lv_coord_t width = drm_dev->mmWidth;
int32_t hor_res = drm_dev->width;
int32_t ver_res = drm_dev->height;
int32_t width = drm_dev->mmWidth;
lv_display_set_draw_buffers(disp, drm_dev->intermediate_buffer, NULL, drm_dev->intermediate_buffer_size,
LV_DISPLAY_RENDER_MODE_DIRECT);

View File

@ -189,9 +189,9 @@ void lv_linux_fbdev_set_file(lv_display_t * disp, const char * file)
LV_LOG_INFO("The framebuffer device was mapped to memory successfully");
lv_coord_t hor_res = dsc->vinfo.xres;
lv_coord_t ver_res = dsc->vinfo.yres;
lv_coord_t width = dsc->vinfo.width;
int32_t hor_res = dsc->vinfo.xres;
int32_t ver_res = dsc->vinfo.yres;
int32_t width = dsc->vinfo.width;
uint32_t draw_buf_size = hor_res * dsc->vinfo.bits_per_pixel >> 3;
if(LV_LINUX_FBDEV_BUFFER_COUNT < 1) {
draw_buf_size *= LV_LINUX_FBDEV_BUFFER_SIZE;
@ -230,7 +230,7 @@ static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * colo
return;
}
lv_coord_t w = lv_area_get_width(area);
int32_t w = lv_area_get_width(area);
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;

View File

@ -44,7 +44,7 @@ typedef struct {
* STATIC PROTOTYPES
**********************/
static lv_coord_t align_round_up(lv_coord_t v, uint16_t align);
static int32_t align_round_up(int32_t v, uint16_t align);
static void rounder_cb(lv_event_t * e);
static void flush_cb(lv_display_t * disp, const lv_area_t * area_p,
uint8_t * color_p);
@ -109,7 +109,7 @@ lv_display_t * lv_nuttx_lcd_create(const char * dev_path)
* STATIC FUNCTIONS
**********************/
static lv_coord_t align_round_up(lv_coord_t v, uint16_t align)
static int32_t align_round_up(int32_t v, uint16_t align)
{
return (v + align - 1) & ~(align - 1);
}
@ -120,8 +120,8 @@ static void rounder_cb(lv_event_t * e)
lv_nuttx_lcd_t * lcd = lv_event_get_user_data(e);
lv_area_t * area = lv_event_get_param(e);
struct lcddev_area_align_s * align_info = &lcd->align_info;
lv_coord_t w;
lv_coord_t h;
int32_t w;
int32_t h;
area->x1 &= ~(align_info->col_start_align - 1);
area->y1 &= ~(align_info->row_start_align - 1);

View File

@ -100,8 +100,8 @@ static void touchscreen_read(lv_indev_t * drv, lv_indev_data_t * data)
if(touch_flags & TOUCH_DOWN || touch_flags & TOUCH_MOVE) {
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;
int32_t ver_max = disp_drv->ver_res - 1;
int32_t hor_max = disp_drv->hor_res - 1;
data->point.x = LV_CLAMP(0, sample.point[0].x, hor_max);
data->point.y = LV_CLAMP(0, sample.point[0].y, ver_max);

View File

@ -117,8 +117,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_display_get_horizontal_resolution(disp);
lv_coord_t ver_res = lv_display_get_vertical_resolution(disp);
int32_t hor_res = lv_display_get_horizontal_resolution(disp);
int32_t ver_res = lv_display_get_vertical_resolution(disp);
uint8_t zoom = lv_sdl_window_get_zoom(disp);
switch(event->type) {

View File

@ -68,7 +68,7 @@ static lv_timer_t * event_handler_timer;
* GLOBAL FUNCTIONS
**********************/
lv_display_t * lv_sdl_window_create(lv_coord_t hor_res, lv_coord_t ver_res)
lv_display_t * lv_sdl_window_create(int32_t hor_res, int32_t ver_res)
{
if(!inited) {
SDL_Init(SDL_INIT_VIDEO);
@ -171,7 +171,7 @@ static void flush_cb(lv_display_t * disp, const lv_area_t * area, uint8_t * px_m
uint8_t * fb_tmp = dsc->fb_act;
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_display_get_horizontal_resolution(disp) * px_size;
int32_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++) {
@ -265,8 +265,8 @@ static void window_create(lv_display_t * disp)
flag |= SDL_WINDOW_FULLSCREEN;
#endif
lv_coord_t hor_res = lv_display_get_horizontal_resolution(disp);
lv_coord_t ver_res = lv_display_get_vertical_resolution(disp);
int32_t hor_res = lv_display_get_horizontal_resolution(disp);
int32_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*/
@ -286,7 +286,7 @@ static void window_create(lv_display_t * disp)
static void window_update(lv_display_t * disp)
{
lv_sdl_window_t * dsc = lv_display_get_driver_data(disp);
lv_coord_t hor_res = lv_display_get_horizontal_resolution(disp);
int32_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);
@ -299,8 +299,8 @@ static void window_update(lv_display_t * disp)
static void texture_resize(lv_display_t * disp)
{
lv_coord_t hor_res = lv_display_get_horizontal_resolution(disp);
lv_coord_t ver_res = lv_display_get_vertical_resolution(disp);
int32_t hor_res = lv_display_get_horizontal_resolution(disp);
int32_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);

View File

@ -31,7 +31,7 @@ extern "C" {
* GLOBAL PROTOTYPES
**********************/
lv_display_t * lv_sdl_window_create(lv_coord_t hor_res, lv_coord_t ver_res);
lv_display_t * lv_sdl_window_create(int32_t hor_res, int32_t ver_res);
void lv_sdl_window_set_zoom(lv_display_t * disp, uint8_t zoom);

View File

@ -54,7 +54,7 @@ static void disp_event_cb(lv_event_t * e);
* GLOBAL FUNCTIONS
**********************/
lv_display_t * lv_display_create(lv_coord_t hor_res, lv_coord_t ver_res)
lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res)
{
lv_display_t * disp = _lv_ll_ins_head(disp_ll_p);
LV_ASSERT_MALLOC(disp);
@ -207,7 +207,7 @@ lv_display_t * lv_display_get_next(lv_display_t * disp)
* RESOLUTION
*--------------------*/
void lv_display_set_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord_t ver_res)
void lv_display_set_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver_res)
{
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
@ -220,7 +220,7 @@ void lv_display_set_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord
update_resolution(disp);
}
void lv_display_set_physical_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord_t ver_res)
void lv_display_set_physical_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver_res)
{
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
@ -232,7 +232,7 @@ void lv_display_set_physical_resolution(lv_display_t * disp, lv_coord_t hor_res,
}
void lv_display_set_offset(lv_display_t * disp, lv_coord_t x, lv_coord_t y)
void lv_display_set_offset(lv_display_t * disp, int32_t x, int32_t y)
{
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
@ -244,7 +244,7 @@ void lv_display_set_offset(lv_display_t * disp, lv_coord_t x, lv_coord_t y)
}
void lv_display_set_dpi(lv_display_t * disp, lv_coord_t dpi)
void lv_display_set_dpi(lv_display_t * disp, int32_t dpi)
{
if(disp == NULL) disp = lv_display_get_default();
if(disp == NULL) return;
@ -252,7 +252,7 @@ void lv_display_set_dpi(lv_display_t * disp, lv_coord_t dpi)
disp->dpi = dpi;
}
lv_coord_t lv_display_get_horizontal_resolution(const lv_display_t * disp)
int32_t lv_display_get_horizontal_resolution(const lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
@ -270,7 +270,7 @@ lv_coord_t lv_display_get_horizontal_resolution(const lv_display_t * disp)
}
}
lv_coord_t lv_display_get_vertical_resolution(const lv_display_t * disp)
int32_t lv_display_get_vertical_resolution(const lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
@ -288,7 +288,7 @@ lv_coord_t lv_display_get_vertical_resolution(const lv_display_t * disp)
}
}
lv_coord_t lv_display_get_physical_horizontal_resolution(const lv_display_t * disp)
int32_t lv_display_get_physical_horizontal_resolution(const lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
@ -306,7 +306,7 @@ lv_coord_t lv_display_get_physical_horizontal_resolution(const lv_display_t * di
}
}
lv_coord_t lv_display_get_physical_vertical_resolution(const lv_display_t * disp)
int32_t lv_display_get_physical_vertical_resolution(const lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
@ -324,7 +324,7 @@ lv_coord_t lv_display_get_physical_vertical_resolution(const lv_display_t * disp
}
}
lv_coord_t lv_display_get_offset_x(const lv_display_t * disp)
int32_t lv_display_get_offset_x(const lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
@ -345,7 +345,7 @@ lv_coord_t lv_display_get_offset_x(const lv_display_t * disp)
}
}
lv_coord_t lv_display_get_offset_y(const lv_display_t * disp)
int32_t lv_display_get_offset_y(const lv_display_t * disp)
{
if(disp == NULL) disp = lv_display_get_default();
@ -366,7 +366,7 @@ lv_coord_t lv_display_get_offset_y(const lv_display_t * disp)
}
}
lv_coord_t lv_display_get_dpi(const lv_display_t * disp)
int32_t lv_display_get_dpi(const lv_display_t * disp)
{
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*/
@ -856,8 +856,8 @@ void * lv_display_get_driver_data(lv_display_t * disp)
static void update_resolution(lv_display_t * disp)
{
lv_coord_t hor_res = lv_display_get_horizontal_resolution(disp);
lv_coord_t ver_res = lv_display_get_vertical_resolution(disp);
int32_t hor_res = lv_display_get_horizontal_resolution(disp);
int32_t ver_res = lv_display_get_vertical_resolution(disp);
lv_area_t prev_coords;
lv_obj_get_coords(disp->sys_layer, &prev_coords);

View File

@ -97,7 +97,7 @@ typedef void (*lv_display_flush_wait_cb_t)(struct _lv_display_t * disp);
* @param ver_res vertical resolution in pixels
* @return pointer to a display object or `NULL` on error
*/
lv_display_t * lv_display_create(lv_coord_t hor_res, lv_coord_t ver_res);
lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res);
/**
* Remove a display
@ -136,7 +136,7 @@ lv_display_t * lv_display_get_next(lv_display_t * disp);
* @param hor_res the new horizontal resolution
* @param ver_res the new vertical resolution
*/
void lv_display_set_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord_t ver_res);
void lv_display_set_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver_res);
/**
* It's not mandatory to use the whole display for LVGL, however in some cases physical resolution is important.
@ -146,7 +146,7 @@ void lv_display_set_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord
* @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_display_set_physical_resolution(lv_display_t * disp, lv_coord_t hor_res, lv_coord_t ver_res);
void lv_display_set_physical_resolution(lv_display_t * disp, int32_t hor_res, int32_t ver_res);
/**
* If physical resolution is not the same as the normal resolution
@ -155,7 +155,7 @@ void lv_display_set_physical_resolution(lv_display_t * disp, lv_coord_t hor_res,
* @param x X offset
* @param y Y offset
*/
void lv_display_set_offset(lv_display_t * disp, lv_coord_t x, lv_coord_t y);
void lv_display_set_offset(lv_display_t * disp, int32_t x, int32_t y);
/**
* Set the rotation of this display. LVGL will swap the horizontal and vertical resolutions internally.
@ -172,49 +172,49 @@ void lv_display_set_rotation(lv_display_t * disp, lv_display_rotation_t rotation
* @param disp pointer to a display
* @param dpi the new DPI
*/
void lv_display_set_dpi(lv_display_t * disp, lv_coord_t dpi);
void lv_display_set_dpi(lv_display_t * disp, int32_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_display_get_horizontal_resolution(const lv_display_t * disp);
int32_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_display_get_vertical_resolution(const lv_display_t * disp);
int32_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_display_get_physical_horizontal_resolution(const lv_display_t * disp);
int32_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_display_get_physical_vertical_resolution(const lv_display_t * disp);
int32_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_display_get_offset_x(const lv_display_t * disp);
int32_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_display_get_offset_y(const lv_display_t * disp);
int32_t lv_display_get_offset_y(const lv_display_t * disp);
/**
* Get the current rotation of this display.
@ -228,7 +228,7 @@ lv_display_rotation_t lv_display_get_rotation(lv_display_t * disp);
* @param disp pointer to a display (NULL to use the default display)
* @return dpi of the display
*/
lv_coord_t lv_display_get_dpi(const lv_display_t * disp);
int32_t lv_display_get_dpi(const lv_display_t * disp);
/*---------------------
* BUFFERING
@ -547,7 +547,7 @@ void * lv_display_get_driver_data(lv_display_t * disp);
* @param n the number of pixels to scale
* @return `n x current_dpi/160`
*/
static inline lv_coord_t lv_dpx(lv_coord_t n)
static inline int32_t lv_dpx(int32_t n)
{
return LV_DPX(n);
}
@ -561,7 +561,7 @@ 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_display_dpx(const lv_display_t * disp, lv_coord_t n)
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);
}

View File

@ -37,22 +37,22 @@ struct _lv_display_t {
*--------------------*/
/** Horizontal resolution.*/
lv_coord_t hor_res;
int32_t hor_res;
/** Vertical resolution.*/
lv_coord_t ver_res;
int32_t ver_res;
/** Horizontal resolution of the full / physical display. Set to -1 for fullscreen mode.*/
lv_coord_t physical_hor_res;
int32_t physical_hor_res;
/** Vertical resolution of the full / physical display. Set to -1 for fullscreen mode.*/
lv_coord_t physical_ver_res;
int32_t physical_ver_res;
/** Horizontal offset from the full / physical display. Set to 0 for fullscreen mode.*/
lv_coord_t offset_x;
int32_t offset_x;
/** Vertical offset from the full / physical display. Set to 0 for fullscreen mode.*/
lv_coord_t offset_y;
int32_t offset_y;
uint32_t dpi; /** DPI (dot per inch) of the display. Default value is `LV_DPI_DEF`.*/

View File

@ -283,8 +283,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_display_get_horizontal_resolution(_lv_refr_get_disp_refreshing());
lv_coord_t ver_res = lv_display_get_vertical_resolution(_lv_refr_get_disp_refreshing());
int32_t hor_res = lv_display_get_horizontal_resolution(_lv_refr_get_disp_refreshing());
int32_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 &&
@ -370,7 +370,7 @@ void * lv_draw_layer_alloc_buf(lv_layer_t * layer)
return lv_draw_buf_align(layer->buf, layer->color_format);
}
void * lv_draw_layer_go_to_xy(lv_layer_t * layer, lv_coord_t x, lv_coord_t y)
void * lv_draw_layer_go_to_xy(lv_layer_t * layer, int32_t x, int32_t y)
{
uint32_t stride = lv_draw_buf_width_to_stride(lv_area_get_width(&layer->buf_area), layer->color_format);
return lv_draw_buf_go_to_xy(layer->buf, stride, layer->color_format, x, y);

View File

@ -245,7 +245,7 @@ void * lv_draw_layer_alloc_buf(lv_layer_t * layer);
* @param y the target X coordinate
* @return `buf` offset to point to the given X and Y coordinate
*/
void * lv_draw_layer_go_to_xy(lv_layer_t * layer, lv_coord_t x, lv_coord_t y);
void * lv_draw_layer_go_to_xy(lv_layer_t * layer, int32_t x, int32_t y);
/**********************
* GLOBAL VARIABLES

View File

@ -66,11 +66,11 @@ void lv_draw_arc(lv_layer_t * layer, const lv_draw_arc_dsc_t * dsc)
LV_PROFILER_END;
}
void lv_draw_arc_get_area(lv_coord_t x, lv_coord_t y, uint16_t radius, lv_value_precise_t start_angle,
void lv_draw_arc_get_area(int32_t x, int32_t y, uint16_t radius, lv_value_precise_t start_angle,
lv_value_precise_t end_angle,
lv_coord_t w, bool rounded, lv_area_t * area)
int32_t w, bool rounded, lv_area_t * area)
{
lv_coord_t rout = radius;
int32_t rout = radius;
int32_t start_angle_int = (int32_t) start_angle;
int32_t end_angle_int = (int32_t) end_angle;
@ -86,8 +86,8 @@ void lv_draw_arc_get_area(lv_coord_t x, lv_coord_t y, uint16_t radius, lv_value
if(start_angle_int > 360) start_angle_int -= 360;
if(end_angle_int > 360) end_angle_int -= 360;
lv_coord_t rin = radius - w;
lv_coord_t extra_area = rounded ? w / 2 + 1 : 0;
int32_t rin = radius - w;
int32_t extra_area = rounded ? w / 2 + 1 : 0;
uint8_t start_quarter = start_angle_int / 90;
uint8_t end_quarter = end_angle_int / 90;

View File

@ -29,7 +29,7 @@ typedef struct {
lv_draw_dsc_base_t base;
lv_color_t color;
lv_coord_t width;
int32_t width;
lv_value_precise_t start_angle;
lv_value_precise_t end_angle;
lv_point_t center;
@ -60,9 +60,9 @@ void lv_draw_arc(struct _lv_layer_t * layer, const lv_draw_arc_dsc_t * dsc);
* @param rounded true: the arc is rounded
* @param area store the area to invalidate here
*/
void lv_draw_arc_get_area(lv_coord_t x, lv_coord_t y, uint16_t radius, lv_value_precise_t start_angle,
void lv_draw_arc_get_area(int32_t x, int32_t y, uint16_t radius, lv_value_precise_t start_angle,
lv_value_precise_t end_angle,
lv_coord_t w, bool rounded, lv_area_t * area);
int32_t w, bool rounded, lv_area_t * area);
/**********************
* MACROS

View File

@ -28,8 +28,8 @@ static void * buf_malloc(size_t size, lv_color_format_t color_format);
static void buf_free(void * buf);
static void * buf_align(void * buf, lv_color_format_t color_format);
static uint32_t width_to_stride(uint32_t w, lv_color_format_t color_format);
static void * buf_go_to_xy(const void * buf, uint32_t stride, lv_color_format_t color_format, lv_coord_t x,
lv_coord_t y);
static void * buf_go_to_xy(const void * buf, uint32_t stride, lv_color_format_t color_format, int32_t x,
int32_t y);
static void buf_clear(void * buf, uint32_t w, uint32_t h, lv_color_format_t color_format, const lv_area_t * a);
@ -96,8 +96,8 @@ void lv_draw_buf_invalidate_cache(void * buf, uint32_t stride, lv_color_format_t
if(handlers.invalidate_cache_cb) handlers.invalidate_cache_cb(buf, stride, color_format, area);
}
void * lv_draw_buf_go_to_xy(const void * buf, uint32_t stride, lv_color_format_t color_format, lv_coord_t x,
lv_coord_t y)
void * lv_draw_buf_go_to_xy(const void * buf, uint32_t stride, lv_color_format_t color_format, int32_t x,
int32_t y)
{
if(handlers.go_to_xy_cb) return handlers.go_to_xy_cb(buf, stride, color_format, x, y);
else return NULL;
@ -157,8 +157,8 @@ static uint32_t width_to_stride(uint32_t w, lv_color_format_t color_format)
return (width_byte + LV_DRAW_BUF_STRIDE_ALIGN - 1) & ~(LV_DRAW_BUF_STRIDE_ALIGN - 1);
}
static void * buf_go_to_xy(const void * buf, uint32_t stride, lv_color_format_t color_format, lv_coord_t x,
lv_coord_t y)
static void * buf_go_to_xy(const void * buf, uint32_t stride, lv_color_format_t color_format, int32_t x,
int32_t y)
{
const uint8_t * buf_tmp = buf;
buf_tmp += stride * y;
@ -181,7 +181,7 @@ static void buf_clear(void * buf, uint32_t w, uint32_t h, lv_color_format_t colo
bufc += a->x1 * px_size;
uint32_t line_length = lv_area_get_width(a) * px_size;
lv_coord_t y;
int32_t y;
for(y = a->y1; y <= a->y2; y++) {
lv_memzero(bufc, line_length);
bufc += stride;
@ -211,7 +211,7 @@ static void buf_copy(void * dest_buf, uint32_t dest_w, uint32_t dest_h, const lv
src_bufc += src_area_to_copy->x1 * px_size;
uint32_t line_length = lv_area_get_width(dest_area_to_copy) * px_size;
lv_coord_t y;
int32_t y;
for(y = dest_area_to_copy->y1; y <= dest_area_to_copy->y2; y++) {
lv_memcpy(dest_bufc, src_bufc, line_length);
dest_bufc += dest_stride;

View File

@ -36,7 +36,7 @@ typedef void (*lv_draw_buf_invalidate_cache_cb)(void * buf, uint32_t stride, lv_
typedef uint32_t (*lv_draw_buf_width_to_stride_cb)(uint32_t w, lv_color_format_t color_format);
typedef void * (*lv_draw_buf_go_to_xy_cb)(const void * buf, uint32_t stride, lv_color_format_t color_format,
lv_coord_t x, lv_coord_t y);
int32_t x, int32_t y);
typedef void (*lv_draw_buf_clear_cb)(void * buf, uint32_t w, uint32_t h, lv_color_format_t color_format,
const lv_area_t * a);
@ -123,8 +123,8 @@ uint32_t lv_draw_buf_width_to_stride(uint32_t w, lv_color_format_t color_format)
* @param y the target X coordinate
* @return `buf` offset to point to the given X and Y coordinate
*/
void * lv_draw_buf_go_to_xy(const void * buf, uint32_t stride, lv_color_format_t color_format, lv_coord_t x,
lv_coord_t y);
void * lv_draw_buf_go_to_xy(const void * buf, uint32_t stride, lv_color_format_t color_format, int32_t x,
int32_t y);
/**
* Clear an area on the buffer

View File

@ -43,9 +43,9 @@ typedef struct _lv_draw_image_dsc_t {
lv_image_header_t header;
lv_coord_t rotation;
lv_coord_t zoom_x;
lv_coord_t zoom_y;
int32_t rotation;
int32_t zoom_x;
int32_t zoom_y;
lv_point_t pivot;
lv_color_t recolor;

View File

@ -240,8 +240,8 @@ void lv_draw_label_iterate_letters(lv_draw_unit_t * draw_unit, const lv_draw_lab
lv_draw_fill_dsc_t fill_dsc;
lv_draw_fill_dsc_init(&fill_dsc);
fill_dsc.opa = dsc->opa;
lv_coord_t underline_width = font->underline_thickness ? font->underline_thickness : 1;
lv_coord_t line_start_x;
int32_t underline_width = font->underline_thickness ? font->underline_thickness : 1;
int32_t line_start_x;
uint32_t i;
int32_t letter_w;

View File

@ -57,10 +57,10 @@ typedef struct {
lv_color_t color;
lv_color_t sel_color;
lv_color_t sel_bg_color;
lv_coord_t line_space;
lv_coord_t letter_space;
lv_coord_t ofs_x;
lv_coord_t ofs_y;
int32_t line_space;
int32_t letter_space;
int32_t ofs_x;
int32_t ofs_y;
lv_opa_t opa;
lv_base_dir_t bidi_dir;
lv_text_align_t align;

View File

@ -33,9 +33,9 @@ typedef struct {
lv_value_precise_t p2_x;
lv_value_precise_t p2_y;
lv_color_t color;
lv_coord_t width;
lv_coord_t dash_width;
lv_coord_t dash_gap;
int32_t width;
int32_t dash_width;
int32_t dash_gap;
lv_opa_t opa;
lv_blend_mode_t blend_mode : 2;
uint8_t round_start : 1;

View File

@ -29,7 +29,7 @@ typedef struct {
lv_draw_dsc_base_t base;
lv_area_t area;
lv_coord_t radius;
int32_t radius;
} lv_draw_mask_rect_dsc_t;
struct _lv_layer_t;

View File

@ -32,7 +32,7 @@ LV_EXPORT_CONST_INT(LV_RADIUS_CIRCLE);
typedef struct {
lv_draw_dsc_base_t base;
lv_coord_t radius;
int32_t radius;
/*Background*/
lv_opa_t bg_opa;
@ -49,30 +49,30 @@ typedef struct {
/*Border*/
lv_color_t border_color;
lv_coord_t border_width;
int32_t border_width;
lv_opa_t border_opa;
lv_border_side_t border_side : 5;
uint8_t border_post : 1; /*The border will be drawn later*/
/*Outline*/
lv_color_t outline_color;
lv_coord_t outline_width;
lv_coord_t outline_pad;
int32_t outline_width;
int32_t outline_pad;
lv_opa_t outline_opa;
/*Shadow*/
lv_color_t shadow_color;
lv_coord_t shadow_width;
lv_coord_t shadow_offset_x;
lv_coord_t shadow_offset_y;
lv_coord_t shadow_spread;
int32_t shadow_width;
int32_t shadow_offset_x;
int32_t shadow_offset_y;
int32_t shadow_spread;
lv_opa_t shadow_opa;
} lv_draw_rect_dsc_t;
typedef struct {
lv_draw_dsc_base_t base;
lv_coord_t radius;
int32_t radius;
lv_opa_t opa;
lv_color_t color;
@ -82,7 +82,7 @@ typedef struct {
typedef struct {
lv_draw_dsc_base_t base;
lv_coord_t radius;
int32_t radius;
const void * src;
const void * font;
@ -96,10 +96,10 @@ typedef struct {
typedef struct {
lv_draw_dsc_base_t base;
lv_coord_t radius;
int32_t radius;
lv_color_t color;
lv_coord_t width;
int32_t width;
lv_opa_t opa;
lv_border_side_t side : 5;
@ -108,13 +108,13 @@ typedef struct {
typedef struct {
lv_draw_dsc_base_t base;
lv_coord_t radius;
int32_t radius;
lv_color_t color;
lv_coord_t width;
lv_coord_t spread;
lv_coord_t ofs_x;
lv_coord_t ofs_y;
int32_t width;
int32_t spread;
int32_t ofs_x;
int32_t ofs_y;
lv_opa_t opa;
uint8_t bg_cover : 1;
} lv_draw_box_shadow_dsc_t;

View File

@ -59,7 +59,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_x,
void _lv_image_buf_get_transformed_area(lv_area_t * res, int32_t w, int32_t h, int32_t angle, uint16_t zoom_x,
uint16_t zoom_y,
const lv_point_t * pivot)
{

View File

@ -116,7 +116,7 @@ void lv_image_buf_free(lv_image_dsc_t * dsc);
* @param zoom_y zoom in y direction, (256 no zoom)
* @param pivot x,y pivot coordinates of rotation
*/
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_x,
void _lv_image_buf_get_transformed_area(lv_area_t * res, int32_t w, int32_t h, int32_t angle, uint16_t zoom_x,
uint16_t zoom_y,
const lv_point_t * pivot);

View File

@ -32,9 +32,9 @@ typedef struct {
/**********************
* STATIC PROTOTYPES
**********************/
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 lv_result_t decode_indexed_line(lv_color_format_t color_format, const lv_color32_t * palette, int32_t x,
int32_t y,
int32_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);
@ -678,7 +678,7 @@ lv_result_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_
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);
lv_coord_t w_px = lv_area_get_width(full_area);
int32_t w_px = lv_area_get_width(full_area);
uint8_t * img_data = NULL;
uint32_t offset = sizeof(lv_image_header_t); /*All image starts with image header*/
@ -707,7 +707,7 @@ lv_result_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_
}
if(LV_COLOR_FORMAT_IS_INDEXED(cf)) {
lv_coord_t x_fraction = decoded_area->x1 % (8 / bpp);
int32_t x_fraction = decoded_area->x1 % (8 / bpp);
uint32_t len = (w_px * bpp + 7) / 8 + 1; /*10px for 1bpp may across 3bytes*/
uint8_t * buf = lv_malloc(len);
LV_ASSERT_NULL(buf);
@ -776,16 +776,16 @@ lv_result_t lv_image_decoder_built_in_get_area(lv_image_decoder_t * decoder, lv_
* STATIC FUNCTIONS
**********************/
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 lv_result_t decode_indexed_line(lv_color_format_t color_format, const lv_color32_t * palette, int32_t x,
int32_t y,
int32_t w_px, const uint8_t * in, lv_color32_t * out)
{
uint8_t px_size;
uint16_t mask;
out += w_px * y;
lv_coord_t w_byte = 0;
int32_t w_byte = 0;
int8_t shift = 0;
switch(color_format) {
case LV_COLOR_FORMAT_I1:
@ -822,7 +822,7 @@ static lv_result_t decode_indexed_line(lv_color_format_t color_format, const lv_
mask = (1 << px_size) - 1; /*E.g. px_size = 2; mask = 0x03*/
lv_coord_t i;
int32_t i;
for(i = 0; i < w_px; i++) {
uint8_t val_act = (*in >> shift) & mask;
out[i] = palette[val_act];

View File

@ -32,7 +32,7 @@
* STATIC PROTOTYPES
**********************/
static void _pxp_fill(uint8_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
static void _pxp_fill(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride,
lv_color_format_t dest_cf, const lv_draw_fill_dsc_t * dsc);
/**********************
@ -68,7 +68,7 @@ void lv_draw_pxp_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc
return; /*Fully clipped, nothing to do*/
uint8_t * dest_buf = layer->draw_buf.buf;
lv_coord_t dest_stride = lv_draw_buf_get_stride(&layer->draw_buf);
int32_t dest_stride = lv_draw_buf_get_stride(&layer->draw_buf);
lv_color_format_t dest_cf = layer->draw_buf.color_format;
_pxp_fill(dest_buf, &blend_area, dest_stride, dest_cf, dsc);
@ -78,11 +78,11 @@ void lv_draw_pxp_fill(lv_draw_unit_t * draw_unit, const lv_draw_fill_dsc_t * dsc
* STATIC FUNCTIONS
**********************/
static void _pxp_fill(uint8_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
static void _pxp_fill(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride,
lv_color_format_t dest_cf, const lv_draw_fill_dsc_t * dsc)
{
lv_coord_t dest_w = lv_area_get_width(dest_area);
lv_coord_t dest_h = lv_area_get_height(dest_area);
int32_t dest_w = lv_area_get_width(dest_area);
int32_t dest_h = lv_area_get_height(dest_area);
lv_pxp_reset();

View File

@ -35,19 +35,19 @@
**********************/
/* Blit w/ recolor for images w/o opa and alpha channel */
static void _pxp_blit_recolor(uint8_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
static void _pxp_blit_recolor(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride,
lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area,
lv_coord_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc);
int32_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc);
/* Blit w/ transformation for images w/o opa and alpha channel */
static void _pxp_blit_transform(uint8_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
static void _pxp_blit_transform(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride,
lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area,
lv_coord_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc);
int32_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc);
/* Blit simple w/ opa and alpha channel */
static void _pxp_blit(uint8_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
static void _pxp_blit(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride,
lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area,
lv_coord_t src_stride, lv_color_format_t src_cf, lv_opa_t opa);
int32_t src_stride, lv_color_format_t src_cf, lv_opa_t opa);
/**********************
* STATIC VARIABLES
@ -92,11 +92,11 @@ void lv_draw_pxp_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dsc
src_area.y1 = blend_area.y1 - (coords->y1 - layer->draw_buf_ofs.y);
src_area.x2 = src_area.x1 + lv_area_get_width(coords) - 1;
src_area.y2 = src_area.y1 + lv_area_get_height(coords) - 1;
lv_coord_t src_stride = img_dsc->header.stride;
int32_t src_stride = img_dsc->header.stride;
lv_color_format_t src_cf = img_dsc->header.cf;
uint8_t * dest_buf = layer->draw_buf.buf;
lv_coord_t dest_stride = lv_draw_buf_get_stride(&layer->draw_buf);
int32_t dest_stride = lv_draw_buf_get_stride(&layer->draw_buf);
lv_color_format_t dest_cf = layer->draw_buf.color_format;
bool has_recolor = (dsc->recolor_opa != LV_OPA_TRANSP);
@ -115,15 +115,15 @@ void lv_draw_pxp_img(lv_draw_unit_t * draw_unit, const lv_draw_image_dsc_t * dsc
* STATIC FUNCTIONS
**********************/
static void _pxp_blit_recolor(uint8_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
static void _pxp_blit_recolor(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride,
lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area,
lv_coord_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc)
int32_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc)
{
lv_coord_t dest_w = lv_area_get_width(dest_area);
lv_coord_t dest_h = lv_area_get_height(dest_area);
lv_coord_t src_w = lv_area_get_width(src_area);
lv_coord_t src_h = lv_area_get_height(src_area);
int32_t dest_w = lv_area_get_width(dest_area);
int32_t dest_h = lv_area_get_height(dest_area);
int32_t src_w = lv_area_get_width(src_area);
int32_t src_h = lv_area_get_height(src_area);
bool src_has_alpha = (src_cf == LV_COLOR_FORMAT_ARGB8888);
uint8_t src_px_size = lv_color_format_get_size(src_cf);
@ -181,21 +181,21 @@ static void _pxp_blit_recolor(uint8_t * dest_buf, const lv_area_t * dest_area, l
lv_pxp_run();
}
static void _pxp_blit_transform(uint8_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
static void _pxp_blit_transform(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride,
lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area,
lv_coord_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc)
int32_t src_stride, lv_color_format_t src_cf, const lv_draw_image_dsc_t * dsc)
{
lv_coord_t src_w = lv_area_get_width(src_area);
lv_coord_t src_h = lv_area_get_height(src_area);
lv_coord_t dest_w = lv_area_get_width(dest_area);
lv_coord_t dest_h = lv_area_get_height(dest_area);
int32_t src_w = lv_area_get_width(src_area);
int32_t src_h = lv_area_get_height(src_area);
int32_t dest_w = lv_area_get_width(dest_area);
int32_t dest_h = lv_area_get_height(dest_area);
lv_point_t pivot = dsc->pivot;
/*The offsets are now relative to the transformation result with pivot ULC*/
lv_coord_t piv_offset_x = 0;
lv_coord_t piv_offset_y = 0;
int32_t piv_offset_x = 0;
int32_t piv_offset_y = 0;
lv_coord_t trim_size = 0;
int32_t trim_size = 0;
bool has_rotation = (dsc->rotation != 0);
bool has_scale = (dsc->zoom != LV_SCALE_NONE);
@ -239,7 +239,7 @@ static void _pxp_blit_transform(uint8_t * dest_buf, const lv_area_t * dest_area,
if(has_scale) {
float scale_factor_fp = (float)dsc->zoom / LV_SCALE_NONE;
lv_coord_t scale_factor_int = (lv_coord_t)scale_factor_fp;
int32_t scale_factor_int = (int32_t)scale_factor_fp;
/*Any scale_factor in (k, k + 1] will result in a trim equal to k*/
if(scale_factor_fp == scale_factor_int)
@ -288,14 +288,14 @@ static void _pxp_blit_transform(uint8_t * dest_buf, const lv_area_t * dest_area,
lv_pxp_run();
}
static void _pxp_blit(uint8_t * dest_buf, const lv_area_t * dest_area, lv_coord_t dest_stride,
static void _pxp_blit(uint8_t * dest_buf, const lv_area_t * dest_area, int32_t dest_stride,
lv_color_format_t dest_cf, const uint8_t * src_buf, const lv_area_t * src_area,
lv_coord_t src_stride, lv_color_format_t src_cf, lv_opa_t opa)
int32_t src_stride, lv_color_format_t src_cf, lv_opa_t opa)
{
lv_coord_t dest_w = lv_area_get_width(dest_area);
lv_coord_t dest_h = lv_area_get_height(dest_area);
lv_coord_t src_w = lv_area_get_width(src_area);
lv_coord_t src_h = lv_area_get_height(src_area);
int32_t dest_w = lv_area_get_width(dest_area);
int32_t dest_h = lv_area_get_height(dest_area);
int32_t src_w = lv_area_get_width(src_area);
int32_t src_h = lv_area_get_height(src_area);
bool src_has_alpha = (src_cf == LV_COLOR_FORMAT_ARGB8888);
uint8_t src_px_size = lv_color_format_get_size(src_cf);

View File

@ -43,7 +43,7 @@ static void _invalidate_cache(lv_draw_buf_t * draw_buf, const char * area);
static uint32_t _width_to_stride(uint32_t w, lv_color_format_t cf);
static void * _go_to_xy(lv_draw_buf_t * draw_buf, lv_coord_t x, lv_coord_t y);
static void * _go_to_xy(lv_draw_buf_t * draw_buf, int32_t x, int32_t y);
static void _vglite_buf_clear(lv_draw_buf_t * draw_buf, const lv_area_t * area);
@ -120,7 +120,7 @@ static uint32_t _width_to_stride(uint32_t w, lv_color_format_t cf)
return (width_bytes + align_bytes - 1) & ~(align_bytes - 1);
}
static void * _go_to_xy(lv_draw_buf_t * draw_buf, lv_coord_t x, lv_coord_t y)
static void * _go_to_xy(lv_draw_buf_t * draw_buf, int32_t x, int32_t y)
{
uint8_t bits_per_pixel = vglite_get_px_size(draw_buf->color_format);
uint32_t stride = lv_draw_buf_get_stride(draw_buf);

View File

@ -575,7 +575,7 @@ static void _vglite_draw_arc(const lv_point_t * center, const lv_area_t * clip_a
lv_memset(arc_path, 0, sizeof(arc_path));
/*** Init path ***/
lv_coord_t width = dsc->width; /* inner arc radius = outer arc radius - width */
int32_t width = dsc->width; /* inner arc radius = outer arc radius - width */
uint16_t radius = dsc->radius;
if(width > radius)

View File

@ -73,7 +73,7 @@ void lv_draw_vglite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_
lv_layer_t * layer = draw_unit->target_layer;
lv_area_t rel_coords;
lv_coord_t width = dsc->width;
int32_t width = dsc->width;
/* Move border inwards to align with software rendered border */
rel_coords.x1 = coords->x1 + ceil(width / 2.0f);
@ -82,7 +82,7 @@ void lv_draw_vglite_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_
rel_coords.y2 = coords->y2 - floor(width / 2.0f);
/* Move outline outwards to align with software rendered outline */
//lv_coord_t outline_pad = dsc->outline_pad - 1;
//int32_t outline_pad = dsc->outline_pad - 1;
//rel_coords.x1 = coords->x1 - outline_pad - floor(dsc->outline_width / 2.0f);
//rel_coords.x2 = coords->x2 + outline_pad + ceil(dsc->outline_width / 2.0f);
//rel_coords.y1 = coords->y1 - outline_pad - floor(dsc->outline_width / 2.0f);
@ -109,20 +109,20 @@ static void _vglite_draw_border(const lv_area_t * coords, const lv_area_t * clip
const lv_draw_border_dsc_t * dsc)
{
vg_lite_error_t err = VG_LITE_SUCCESS;
lv_coord_t radius = dsc->radius;
int32_t radius = dsc->radius;
vg_lite_buffer_t * vgbuf = vglite_get_dest_buf();
if(radius < 0)
return;
lv_coord_t border_half = (lv_coord_t)floor(dsc->width / 2.0f);
int32_t border_half = (int32_t)floor(dsc->width / 2.0f);
if(radius > border_half)
radius = radius - border_half;
//else {
// /* Draw outline - always has radius, leave the same radius in the circle case */
// lv_coord_t outline_half = (lv_coord_t)ceil(dsc->outline_width / 2.0f);
// if(radius < (lv_coord_t)LV_RADIUS_CIRCLE - outline_half)
// int32_t outline_half = (int32_t)ceil(dsc->outline_width / 2.0f);
// if(radius < (int32_t)LV_RADIUS_CIRCLE - outline_half)
// radius = radius + outline_half;
//}
@ -147,7 +147,7 @@ static void _vglite_draw_border(const lv_area_t * coords, const lv_area_t * clip
vg_lite_matrix_t matrix;
vg_lite_identity(&matrix);
lv_coord_t line_width = dsc->width;
int32_t line_width = dsc->width;
/*** Draw border ***/
err = vg_lite_set_draw_path_type(&path, VG_LITE_DRAW_STROKE_PATH);

View File

@ -163,9 +163,9 @@ static void _vglite_draw_rect(const lv_area_t * coords, const lv_area_t * clip_a
const lv_draw_fill_dsc_t * dsc)
{
vg_lite_error_t err = VG_LITE_SUCCESS;
lv_coord_t width = lv_area_get_width(coords);
lv_coord_t height = lv_area_get_height(coords);
lv_coord_t radius = dsc->radius;
int32_t width = lv_area_get_width(coords);
int32_t height = lv_area_get_height(coords);
int32_t radius = dsc->radius;
vg_lite_buffer_t * vgbuf = vglite_get_dest_buf();
if(dsc->radius < 0)

View File

@ -246,7 +246,7 @@ static void _move_buf_close_to_area(void ** buf, lv_area_t * area, uint32_t stri
uint16_t align_pixels = align_bytes * 8 / bits_per_pixel;
if(area->x1 >= (lv_coord_t)(area->x1 % align_pixels)) {
if(area->x1 >= (int32_t)(area->x1 % align_pixels)) {
uint16_t shift_x = area->x1 - (area->x1 % align_pixels);
area->x1 -= shift_x;
@ -313,8 +313,8 @@ static void _vglite_blit_split(void * dest_buf, lv_area_t * dest_area, uint32_t
lv_area_get_width(dest_area), lv_area_get_height(dest_area),
(uintptr_t)src_buf, (uintptr_t)dest_buf);
lv_coord_t width = LV_MIN(lv_area_get_width(src_area), lv_area_get_width(dest_area));
lv_coord_t height = LV_MIN(lv_area_get_height(src_area), lv_area_get_height(dest_area));
int32_t width = LV_MIN(lv_area_get_width(src_area), lv_area_get_width(dest_area));
int32_t height = LV_MIN(lv_area_get_height(src_area), lv_area_get_height(dest_area));
/* Number of tiles needed */
uint8_t total_tiles_x = (src_area->x1 + width + VGLITE_BLIT_SPLIT_THR - 1) /

View File

@ -112,7 +112,7 @@ static void _vglite_draw_line(const lv_point_t * point1, const lv_point_t * poin
vg_lite_blend_t vglite_blend_mode = vglite_get_blend_mode(dsc->blend_mode);
/*** Init path ***/
lv_coord_t width = dsc->width;
int32_t width = dsc->width;
int32_t line_path[] = { /*VG line path*/
VLC_OP_MOVE, point1->x, point1->y,

View File

@ -76,14 +76,14 @@ void vglite_set_dest_buf(const lv_draw_buf_t * draw_buf)
lv_draw_buf_get_stride(draw_buf), draw_buf->color_format);
}
void vglite_set_src_buf(const void * buf, lv_coord_t width, lv_coord_t height, uint32_t stride,
void vglite_set_src_buf(const void * buf, int32_t width, int32_t height, uint32_t stride,
lv_color_format_t cf)
{
vglite_set_buf(&_src_vgbuf, (void *)buf, width, height, stride, cf);
}
void vglite_set_buf(vg_lite_buffer_t * vgbuf, void * buf,
lv_coord_t width, lv_coord_t height, uint32_t stride,
int32_t width, int32_t height, uint32_t stride,
lv_color_format_t cf)
{
vg_lite_buffer_format_t vgformat = vglite_get_buf_format(cf);

View File

@ -89,7 +89,7 @@ void vglite_set_dest_buf(const lv_draw_buf_t * draw_buf);
* @param[in] cf Source buffer color format
*
*/
void vglite_set_src_buf(const void * buf, lv_coord_t width, lv_coord_t height, uint32_t stride,
void vglite_set_src_buf(const void * buf, int32_t width, int32_t height, uint32_t stride,
lv_color_format_t cf);
/**
@ -104,7 +104,7 @@ void vglite_set_src_buf(const void * buf, lv_coord_t width, lv_coord_t height, u
*
*/
void vglite_set_buf(vg_lite_buffer_t * vgbuf, void * buf,
lv_coord_t width, lv_coord_t height, uint32_t stride,
int32_t width, int32_t height, uint32_t stride,
lv_color_format_t cf);
/**********************

View File

@ -44,11 +44,11 @@
**********************/
void vglite_create_rect_path_data(int32_t * path_data, uint32_t * path_data_size,
lv_coord_t radius,
int32_t radius,
const lv_area_t * coords)
{
lv_coord_t rect_width = lv_area_get_width(coords);
lv_coord_t rect_height = lv_area_get_height(coords);
int32_t rect_width = lv_area_get_width(coords);
int32_t rect_height = lv_area_get_height(coords);
/* Get the final radius. Can't be larger than the half of the shortest side */
int32_t shortest_side = LV_MIN(rect_width, rect_height);
@ -57,7 +57,7 @@ void vglite_create_rect_path_data(int32_t * path_data, uint32_t * path_data_size
/* Path data element index */
uint8_t pidx = 0;
if((radius == (lv_coord_t)LV_RADIUS_CIRCLE) && (rect_width == rect_height)) {
if((radius == (int32_t)LV_RADIUS_CIRCLE) && (rect_width == rect_height)) {
/* Get the control point offset for rounded cases */
int32_t cpoff = (int32_t)((float)final_radius * BEZIER_OPTIM_CIRCLE);

View File

@ -72,7 +72,7 @@ extern "C" {
*
*/
void vglite_create_rect_path_data(int32_t * path_data, uint32_t * path_data_size,
lv_coord_t radius,
int32_t radius,
const lv_area_t * coords);
/**********************

View File

@ -40,7 +40,7 @@ typedef struct {
const lv_opa_t * mask_buf; /**< NULL if ignored, or an alpha mask to apply on `blend_area`*/
lv_draw_sw_mask_res_t mask_res; /**< The result of the previous mask operation */
const lv_area_t * mask_area; /**< The area of `mask_buf` with absolute coordinates*/
lv_coord_t mask_stride;
int32_t mask_stride;
lv_blend_mode_t blend_mode; /**< E.g. LV_BLEND_MODE_ADDITIVE*/
} lv_draw_sw_blend_dsc_t;
@ -49,24 +49,24 @@ struct _lv_draw_unit_t;
typedef struct {
void * dest_buf;
lv_coord_t dest_w;
lv_coord_t dest_h;
lv_coord_t dest_stride;
int32_t dest_w;
int32_t dest_h;
int32_t dest_stride;
const lv_opa_t * mask_buf;
lv_coord_t mask_stride;
int32_t mask_stride;
lv_color_t color;
lv_opa_t opa;
} _lv_draw_sw_blend_fill_dsc_t;
typedef struct {
void * dest_buf;
lv_coord_t dest_w;
lv_coord_t dest_h;
lv_coord_t dest_stride;
int32_t dest_w;
int32_t dest_h;
int32_t dest_stride;
const lv_opa_t * mask_buf;
lv_coord_t mask_stride;
int32_t mask_stride;
const void * src_buf;
lv_coord_t src_stride;
int32_t src_stride;
lv_color_format_t src_color_format;
lv_opa_t opa;
lv_blend_mode_t blend_mode;

View File

@ -68,8 +68,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_argb8888(_lv_draw_sw_blend_
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
const lv_opa_t * mask = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
lv_coord_t dest_stride = dsc->dest_stride;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_stride = dsc->dest_stride;
lv_color_mix_alpha_cache_t cache;
lv_color_mix_with_alpha_cache_init(&cache);
@ -183,11 +183,11 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
lv_color32_t * dest_buf_c32 = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride;
int32_t dest_stride = dsc->dest_stride;
const lv_color16_t * src_buf_c16 = (const lv_color16_t *) dsc->src_buf;
lv_coord_t src_stride = dsc->src_stride;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
lv_color32_t color_argb;
lv_color_mix_alpha_cache_t cache;
@ -264,11 +264,11 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
lv_color32_t * dest_buf_c32 = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride;
int32_t dest_stride = dsc->dest_stride;
const uint8_t * src_buf = dsc->src_buf;
lv_coord_t src_stride = dsc->src_stride * src_px_size;
int32_t src_stride = dsc->src_stride * src_px_size;
const lv_opa_t * mask_buf = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
lv_color32_t color_argb;
lv_color_mix_alpha_cache_t cache;
@ -369,11 +369,11 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
lv_color32_t * dest_buf_c32 = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride;
int32_t dest_stride = dsc->dest_stride;
const lv_color32_t * src_buf_c32 = dsc->src_buf;
lv_coord_t src_stride = dsc->src_stride;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
lv_color32_t color_argb;
lv_color_mix_alpha_cache_t cache;

View File

@ -68,9 +68,9 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_rgb565(_lv_draw_sw_blend_fi
uint16_t color16 = lv_color_to_u16(dsc->color);
lv_opa_t opa = dsc->opa;
const lv_opa_t * mask = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
uint16_t * dest_buf_u16 = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride;
int32_t dest_stride = dsc->dest_stride;
int32_t x;
int32_t y;
@ -232,11 +232,11 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
uint16_t * dest_buf_u16 = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride;
int32_t dest_stride = dsc->dest_stride;
const uint16_t * src_buf_u16 = dsc->src_buf;
lv_coord_t src_stride = dsc->src_stride;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
int32_t x;
int32_t y;
@ -332,11 +332,11 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
uint16_t * dest_buf_u16 = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride;
int32_t dest_stride = dsc->dest_stride;
const uint8_t * src_buf_u8 = dsc->src_buf;
lv_coord_t src_stride = dsc->src_stride * src_px_size;
int32_t src_stride = dsc->src_stride * src_px_size;
const lv_opa_t * mask_buf = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_x;
int32_t src_x;
@ -433,11 +433,11 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
uint16_t * dest_buf_u16 = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride;
int32_t dest_stride = dsc->dest_stride;
const uint8_t * src_buf_u8 = dsc->src_buf;
lv_coord_t src_stride = dsc->src_stride * 4;
int32_t src_stride = dsc->src_stride * 4;
const lv_opa_t * mask_buf = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_x;
int32_t src_x;

View File

@ -63,8 +63,8 @@ LV_ATTRIBUTE_FAST_MEM void lv_draw_sw_blend_color_to_rgb888(_lv_draw_sw_blend_fi
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
const lv_opa_t * mask = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
lv_coord_t dest_stride = dsc->dest_stride;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_stride = dsc->dest_stride;
int32_t x;
int32_t y;
@ -227,11 +227,11 @@ LV_ATTRIBUTE_FAST_MEM static void rgb565_image_blend(_lv_draw_sw_blend_image_dsc
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
uint8_t * dest_buf_u8 = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride * dest_px_size;
int32_t dest_stride = dsc->dest_stride * dest_px_size;
const lv_color16_t * src_buf_c16 = (const lv_color16_t *) dsc->src_buf;
lv_coord_t src_stride = dsc->src_stride;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
int32_t src_x;
int32_t dest_x;
@ -316,11 +316,11 @@ LV_ATTRIBUTE_FAST_MEM static void rgb888_image_blend(_lv_draw_sw_blend_image_dsc
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
uint8_t * dest_buf = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride * dest_px_size;
int32_t dest_stride = dsc->dest_stride * dest_px_size;
const uint8_t * src_buf = dsc->src_buf;
lv_coord_t src_stride = dsc->src_stride * src_px_size;
int32_t src_stride = dsc->src_stride * src_px_size;
const lv_opa_t * mask_buf = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_x;
int32_t src_x;
@ -405,11 +405,11 @@ LV_ATTRIBUTE_FAST_MEM static void argb8888_image_blend(_lv_draw_sw_blend_image_d
int32_t h = dsc->dest_h;
lv_opa_t opa = dsc->opa;
uint8_t * dest_buf = dsc->dest_buf;
lv_coord_t dest_stride = dsc->dest_stride * dest_px_size;
int32_t dest_stride = dsc->dest_stride * dest_px_size;
const lv_color32_t * src_buf_c32 = dsc->src_buf;
lv_coord_t src_stride = dsc->src_stride;
int32_t src_stride = dsc->src_stride;
const lv_opa_t * mask_buf = dsc->mask_buf;
lv_coord_t mask_stride = dsc->mask_stride;
int32_t mask_stride = dsc->mask_stride;
int32_t dest_x;
int32_t src_x;

View File

@ -77,7 +77,7 @@ void lv_draw_sw_triangle(lv_draw_unit_t * draw_unit, const lv_draw_triangle_dsc_
void lv_draw_sw_mask_rect(lv_draw_unit_t * draw_unit, const lv_draw_mask_rect_dsc_t * dsc, const lv_area_t * coords);
void lv_draw_sw_transform(lv_draw_unit_t * draw_unit, const lv_area_t * dest_area, const void * src_buf,
lv_coord_t src_w, lv_coord_t src_h, lv_coord_t src_stride,
int32_t src_w, int32_t src_h, int32_t src_stride,
const lv_draw_image_dsc_t * draw_dsc, const lv_draw_image_sup_t * sup, lv_color_format_t cf, void * dest_buf);
/***********************

View File

@ -18,8 +18,8 @@
static void add_circle(const lv_opa_t * circle_mask, const lv_area_t * blend_area, const lv_area_t * circle_area,
lv_opa_t * mask_buf, lv_coord_t width);
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area);
lv_opa_t * mask_buf, int32_t width);
static void get_rounded_area(int16_t angle, int32_t radius, uint8_t thickness, lv_area_t * res_area);
/*********************
* DEFINES
@ -54,7 +54,7 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c
if(dsc->width == 0) return;
if(dsc->start_angle == dsc->end_angle) return;
lv_coord_t width = dsc->width;
int32_t width = dsc->width;
if(width > dsc->radius) width = dsc->radius;
lv_area_t area_out = *coords;
@ -108,9 +108,9 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c
mask_in_param_valid = true;
}
lv_coord_t blend_h = lv_area_get_height(&clipped_area);
lv_coord_t blend_w = lv_area_get_width(&clipped_area);
lv_coord_t h;
int32_t blend_h = lv_area_get_height(&clipped_area);
int32_t blend_w = lv_area_get_width(&clipped_area);
int32_t h;
lv_opa_t * mask_buf = lv_malloc(blend_w);
lv_area_t blend_area = clipped_area;
@ -130,7 +130,7 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c
img_area.y1 = 0;
img_area.x2 = decoder_dsc.header.w - 1;
img_area.y2 = decoder_dsc.header.h - 1;
lv_coord_t ofs = decoder_dsc.header.w / 2;
int32_t ofs = decoder_dsc.header.w / 2;
lv_area_move(&img_area, dsc->center.x - ofs, dsc->center.y - ofs);
blend_dsc.src_area = &img_area;
blend_dsc.src_buf = decoder_dsc.img_data;
@ -218,7 +218,7 @@ void lv_draw_sw_arc(lv_draw_unit_t * draw_unit, const lv_draw_arc_dsc_t * dsc, c
**********************/
static void add_circle(const lv_opa_t * circle_mask, const lv_area_t * blend_area, const lv_area_t * circle_area,
lv_opa_t * mask_buf, lv_coord_t width)
lv_opa_t * mask_buf, int32_t width)
{
lv_area_t circle_common_area;
if(_lv_area_intersect(&circle_common_area, circle_area, blend_area)) {
@ -237,7 +237,7 @@ static void add_circle(const lv_opa_t * circle_mask, const lv_area_t * blend_are
}
static void get_rounded_area(int16_t angle, lv_coord_t radius, uint8_t thickness, lv_area_t * res_area)
static void get_rounded_area(int16_t angle, int32_t radius, uint8_t thickness, lv_area_t * res_area)
{
int32_t thick_half = thickness / 2;
uint8_t thick_corr = (thickness & 0x01) ? 0 : 1;

View File

@ -31,7 +31,7 @@
* STATIC PROTOTYPES
**********************/
static void draw_border_complex(lv_draw_unit_t * draw_unit, const lv_area_t * outer_area, const lv_area_t * inner_area,
lv_coord_t rout, lv_coord_t rin, lv_color_t color, lv_opa_t opa);
int32_t rout, int32_t rin, lv_color_t color, lv_opa_t opa);
static void draw_border_simple(lv_draw_unit_t * draw_unit, const lv_area_t * outer_area, const lv_area_t * inner_area,
lv_color_t color, lv_opa_t opa);
@ -69,7 +69,7 @@ void lv_draw_sw_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_t *
area_inner.y1 += ((dsc->side & LV_BORDER_SIDE_TOP) ? dsc->width : - (dsc->width + rout));
area_inner.y2 -= ((dsc->side & LV_BORDER_SIDE_BOTTOM) ? dsc->width : - (dsc->width + rout));
lv_coord_t rin = rout - dsc->width;
int32_t rin = rout - dsc->width;
if(rin < 0) rin = 0;
if(rout == 0 && rin == 0) {
@ -86,7 +86,7 @@ void lv_draw_sw_border(lv_draw_unit_t * draw_unit, const lv_draw_border_dsc_t *
**********************/
void draw_border_complex(lv_draw_unit_t * draw_unit, const lv_area_t * outer_area, const lv_area_t * inner_area,
lv_coord_t rout, lv_coord_t rin, lv_color_t color, lv_opa_t opa)
int32_t rout, int32_t rin, lv_color_t color, lv_opa_t opa)
{
#if LV_DRAW_SW_COMPLEX
/*Get clipped draw area which is the real draw area.
@ -129,7 +129,7 @@ void draw_border_complex(lv_draw_unit_t * draw_unit, const lv_area_t * outer_are
core_area.x2 = LV_MIN(outer_area->x2 - rout, inner_area->x2);
core_area.y1 = LV_MAX(outer_area->y1 + rout, inner_area->y1);
core_area.y2 = LV_MIN(outer_area->y2 - rout, inner_area->y2);
lv_coord_t core_w = lv_area_get_width(&core_area);
int32_t core_w = lv_area_get_width(&core_area);
bool top_side = outer_area->y1 <= inner_area->y1;
bool bottom_side = outer_area->y2 >= inner_area->y2;
@ -190,17 +190,17 @@ void draw_border_complex(lv_draw_unit_t * draw_unit, const lv_area_t * outer_are
}
/*Draw the corners*/
lv_coord_t blend_w;
int32_t blend_w;
/*Left and right corner together if they are close to each other*/
if(!split_hor) {
/*Calculate the top corner and mirror it to the bottom*/
blend_area.x1 = draw_area.x1;
blend_area.x2 = draw_area.x2;
lv_coord_t max_h = LV_MAX(rout, inner_area->y1 - outer_area->y1);
int32_t max_h = LV_MAX(rout, inner_area->y1 - outer_area->y1);
for(h = 0; h < max_h; h++) {
lv_coord_t top_y = outer_area->y1 + h;
lv_coord_t bottom_y = outer_area->y2 - h;
int32_t top_y = outer_area->y1 + h;
int32_t bottom_y = outer_area->y2 - h;
if(top_y < draw_area.y1 && bottom_y > draw_area.y2) continue; /*This line is clipped now*/
lv_memset(mask_buf, 0xff, draw_area_w);

Some files were not shown because too many files have changed in this diff Show More