mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
minor fixes
This commit is contained in:
parent
95b1bd8409
commit
bb08660cb6
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_FLEX
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple row and a column layout with flexbox
|
* A simple row and a column layout with flexbox
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_FLEX
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Arrange items in rows with wrap and place the items to get even space around them.
|
* Arrange items in rows with wrap and place the items to get even space around them.
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_FLEX
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use a built in flex layout and demonstrate flex grow.
|
* Use a built in flex layout and demonstrate flex grow.
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_FLEX
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the order of flex items
|
* Reverse the order of flex items
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_FLEX
|
|
||||||
|
|
||||||
static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
|
static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_FLEX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_FLEX
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RTL base direction changes order of the items.
|
* RTL base direction changes order of the items.
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_GRID
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple grid
|
* A simple grid
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_GRID
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_GRID
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Demonstrate grid's "free unit"
|
* Demonstrate grid's "free unit"
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_GRID
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Demonstrate track placement
|
* Demonstrate track placement
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_GRID
|
|
||||||
|
|
||||||
static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
|
static void row_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
|
||||||
{
|
{
|
||||||
@ -12,7 +11,7 @@ static void column_gap_anim(lv_obj_t * obj, lv_anim_value_t v)
|
|||||||
lv_obj_set_style_pad_column(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v);
|
lv_obj_set_style_pad_column(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Demonstrate margin in grid
|
* Demonstrate column and row gap
|
||||||
*/
|
*/
|
||||||
void lv_example_grid_5(void)
|
void lv_example_grid_5(void)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_GRID && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_GRID
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Demonstrate RTL direction on grid
|
* Demonstrate RTL direction on grid
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
|
||||||
#if LV_USE_ARC
|
#if LV_USE_ARC && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
void lv_example_arc_1(void)
|
void lv_example_arc_1(void)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_ARC
|
|
||||||
|
#if LV_USE_ARC && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An `lv_task` to call periodically to set the angles of the arc
|
* An `lv_task` to call periodically to set the angles of the arc
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_BAR
|
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
void lv_example_bar_1(void)
|
void lv_example_bar_1(void)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_BAR
|
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Example of styling the bar
|
* Example of styling the bar
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_BAR
|
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
static void set_temp(lv_obj_t * bar, int32_t temp)
|
static void set_temp(lv_obj_t * bar, int32_t temp)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_BAR
|
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bar with stripe pattern and ranged value
|
* Bar with stripe pattern and ranged value
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_BAR
|
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bar with LTR and RTL base direction
|
* Bar with LTR and RTL base direction
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_BAR
|
#if LV_USE_BAR && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||||
{
|
{
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_BTN && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_BTN
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_CLICKED) {
|
if(event == LV_EVENT_CLICKED) {
|
||||||
printf("Clicked\n");
|
LV_LOG_USER("Clicked\n");
|
||||||
}
|
}
|
||||||
else if(event == LV_EVENT_VALUE_CHANGED) {
|
else if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
printf("Toggled\n");
|
LV_LOG_USER("Toggled\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_BTNMATRIX
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
@ -8,7 +7,7 @@ static void event_handler(lv_obj_t * obj, lv_event_t event)
|
|||||||
uint32_t id = lv_btnmatrix_get_active_btn(obj);
|
uint32_t id = lv_btnmatrix_get_active_btn(obj);
|
||||||
const char * txt = lv_btnmatrix_get_btn_text(obj, id);
|
const char * txt = lv_btnmatrix_get_btn_text(obj, id);
|
||||||
|
|
||||||
printf("%s was pressed\n", txt);
|
LV_LOG_USER("%s was pressed\n", txt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_BTNMATRIX
|
|
||||||
|
|
||||||
|
|
||||||
void event_cb(lv_obj_t * obj, lv_event_t e)
|
void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_BTNMATRIX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_BTNMATRIX
|
|
||||||
|
|
||||||
|
|
||||||
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||||
{
|
{
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_CALENDAR && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
#if LV_USE_CALENDAR
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
lv_calendar_date_t date;
|
lv_calendar_date_t date;
|
||||||
if(lv_calendar_get_pressed_date(obj, &date)) {
|
if(lv_calendar_get_pressed_date(obj, &date)) {
|
||||||
printf("Clicked date: %02d.%02d.%d\n", date.day, date.month, date.year);
|
LV_LOG_USER("Clicked date: %02d.%02d.%d\n", date.day, date.month, date.year);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_CANVAS
|
#if LV_USE_CANVAS && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
|
|
||||||
#define CANVAS_WIDTH 200
|
#define CANVAS_WIDTH 200
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_CANVAS
|
#if LV_USE_CANVAS && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
#define CANVAS_WIDTH 50
|
#define CANVAS_WIDTH 50
|
||||||
#define CANVAS_HEIGHT 50
|
#define CANVAS_HEIGHT 50
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_CHART
|
#if LV_USE_CHART && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
void lv_example_chart_1(void)
|
void lv_example_chart_1(void)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_CHART
|
#if LV_USE_CHART && LV_DRAW_COMPLEX && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
static lv_obj_t * chart1;
|
static lv_obj_t * chart1;
|
||||||
static lv_chart_series_t * ser1;
|
static lv_chart_series_t * ser1;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_CHART
|
#if LV_USE_CHART && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
static void event_cb(lv_obj_t * chart, lv_event_t e)
|
static void event_cb(lv_obj_t * chart, lv_event_t e)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_CHART
|
#if LV_USE_CHART && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
|
|
||||||
static void event_cb(lv_obj_t * chart, lv_event_t e)
|
static void event_cb(lv_obj_t * chart, lv_event_t e)
|
||||||
@ -15,7 +15,7 @@ static void event_cb(lv_obj_t * chart, lv_event_t e)
|
|||||||
int32_t id = lv_chart_get_pressed_point(chart);
|
int32_t id = lv_chart_get_pressed_point(chart);
|
||||||
if(id < 0) return;
|
if(id < 0) return;
|
||||||
|
|
||||||
printf("Selected point %d\n", id);
|
LV_LOG_USER("Selected point %d\n", id);
|
||||||
|
|
||||||
lv_chart_series_t * ser = lv_chart_get_series_next(chart, NULL);
|
lv_chart_series_t * ser = lv_chart_get_series_next(chart, NULL);
|
||||||
while(ser) {
|
while(ser) {
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_CHECKBOX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_CHECKBOX
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
const char * txt = lv_checkbox_get_text(obj);
|
const char * txt = lv_checkbox_get_text(obj);
|
||||||
const char * state = lv_obj_get_state(obj) & LV_STATE_CHECKED ? "Checked" : "Unchecked";
|
const char * state = lv_obj_get_state(obj) & LV_STATE_CHECKED ? "Checked" : "Unchecked";
|
||||||
printf("%s: %s\n", txt, state);
|
LV_LOG_USER("%s: %s\n", txt, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_COLORWHEEL
|
#if LV_USE_COLORWHEEL && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
void lv_example_colorwheel_1(void)
|
void lv_example_colorwheel_1(void)
|
||||||
{
|
{
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_DROPDOWN
|
|
||||||
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
char buf[32];
|
char buf[32];
|
||||||
lv_dropdown_get_selected_str(obj, buf, sizeof(buf));
|
lv_dropdown_get_selected_str(obj, buf, sizeof(buf));
|
||||||
printf("Option: %s\n", buf);
|
LV_LOG_USER("Option: %s\n", buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_DROPDOWN
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_DROPDOWN && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_DROPDOWN
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a menu from a drop-down list and show some drop-down list features and styling
|
* Create a menu from a drop-down list and show some drop-down list features and styling
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_IMG
|
#if LV_USE_IMG && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
/* Find the image here: https://github.com/lvgl/lv_examples/tree/master/assets */
|
/* Find the image here: https://github.com/lvgl/lv_examples/tree/master/assets */
|
||||||
LV_IMG_DECLARE(img_cogwheel_argb);
|
LV_IMG_DECLARE(img_cogwheel_argb);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_IMG
|
#if LV_USE_IMG && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
static lv_obj_t * create_slider(lv_color_t color);
|
static lv_obj_t * create_slider(lv_color_t color);
|
||||||
static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_IMG
|
#if LV_USE_IMG && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
LV_IMG_DECLARE(img_cogwheel_argb);
|
LV_IMG_DECLARE(img_cogwheel_argb);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_IMG
|
#if LV_USE_IMG && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
LV_IMG_DECLARE(img_skew_strip);
|
LV_IMG_DECLARE(img_skew_strip);
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
|
#if LV_USE_IMGBTN && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_IMGBTN
|
|
||||||
|
|
||||||
void lv_example_imgbtn_1(void)
|
void lv_example_imgbtn_1(void)
|
||||||
{
|
{
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_KEYBOARD
|
#if LV_USE_KEYBOARD && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
|
|
||||||
static void ta_event_cb(lv_obj_t * ta, lv_event_t e)
|
static void ta_event_cb(lv_obj_t * ta, lv_event_t e)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_LABEL
|
#if LV_USE_LABEL && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show line wrap, re-color, line align and text scrolling.
|
* Show line wrap, re-color, line align and text scrolling.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_LABEL
|
#if LV_USE_LABEL && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a fake text shadow
|
* Create a fake text shadow
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_LED
|
#if LV_USE_LED && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create LED's with different brightness and color
|
||||||
|
*/
|
||||||
void lv_example_led_1(void)
|
void lv_example_led_1(void)
|
||||||
{
|
{
|
||||||
/*Create a LED and switch it OFF*/
|
/*Create a LED and switch it OFF*/
|
||||||
@ -11,7 +14,8 @@ void lv_example_led_1(void)
|
|||||||
/*Copy the previous LED and set a brightness*/
|
/*Copy the previous LED and set a brightness*/
|
||||||
lv_obj_t * led2 = lv_led_create(lv_scr_act());
|
lv_obj_t * led2 = lv_led_create(lv_scr_act());
|
||||||
lv_obj_align(led2, NULL, LV_ALIGN_CENTER, 0, 0);
|
lv_obj_align(led2, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||||
lv_led_set_bright(led2, 150);
|
lv_led_set_brightness(led2, 150);
|
||||||
|
lv_led_set_color(led2, LV_COLOR_RED);
|
||||||
|
|
||||||
/*Copy the previous LED and switch it ON*/
|
/*Copy the previous LED and switch it ON*/
|
||||||
lv_obj_t * led3 = lv_led_create(lv_scr_act());
|
lv_obj_t * led3 = lv_led_create(lv_scr_act());
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_LINE
|
#if LV_USE_LINE && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
void lv_example_line_1(void)
|
void lv_example_line_1(void)
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_LIST && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_LIST
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_CLICKED) {
|
if(event == LV_EVENT_CLICKED) {
|
||||||
printf("Clicked: %s\n", lv_list_get_btn_text(obj));
|
LV_LOG_USER("Clicked: %s\n", lv_list_get_btn_text(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void lv_list_example_1(void)
|
void lv_list_example_1(void)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_METER && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_METER
|
|
||||||
|
|
||||||
static lv_obj_t * meter;
|
static lv_obj_t * meter;
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_METER && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_METER
|
|
||||||
|
|
||||||
static lv_obj_t * meter;
|
static lv_obj_t * meter;
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_METER && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_METER
|
|
||||||
|
|
||||||
static lv_obj_t * meter;
|
static lv_obj_t * meter;
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_METER && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_METER
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a pie chart
|
* Create a pie chart
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_MSGBOX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_MSGBOX
|
|
||||||
|
|
||||||
static void event_cb(lv_obj_t * obj, lv_event_t event)
|
static void event_cb(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
printf("Button: %s\n", lv_msgbox_get_active_btn_text(obj));
|
LV_LOG_USER("Button: %s\n", lv_msgbox_get_active_btn_text(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,94 +0,0 @@
|
|||||||
//#include "../../../lvgl.h"
|
|
||||||
//#if LV_USE_MSGBOX
|
|
||||||
//
|
|
||||||
//static void mbox_event_cb(lv_obj_t *obj, lv_event_t evt);
|
|
||||||
//static void btn_event_cb(lv_obj_t *btn, lv_event_t evt);
|
|
||||||
//static void opa_anim(void * bg, lv_anim_value_t v);
|
|
||||||
//
|
|
||||||
//static lv_obj_t *mbox, *info;
|
|
||||||
//static lv_style_t style_modal;
|
|
||||||
//
|
|
||||||
//static const char welcome_info[] = "Welcome to the modal message box demo!\n"
|
|
||||||
// "Press the button to display a message box.";
|
|
||||||
//
|
|
||||||
//static const char in_msg_info[] = "Notice that you cannot touch "
|
|
||||||
// "the button again while the message box is open.";
|
|
||||||
//
|
|
||||||
//void lv_example_msgbox_2(void)
|
|
||||||
//{
|
|
||||||
// lv_style_init(&style_modal);
|
|
||||||
// lv_style_set_bg_color(&style_modal, LV_STATE_DEFAULT, LV_COLOR_BLACK);
|
|
||||||
//
|
|
||||||
// /* Create a button, then set its position and event callback */
|
|
||||||
// lv_obj_t *btn = lv_btn_create(lv_scr_act(), NULL);
|
|
||||||
// lv_obj_set_size(btn, 200, 60);
|
|
||||||
// lv_obj_set_event_cb(btn, btn_event_cb);
|
|
||||||
// lv_obj_align(btn, NULL, LV_ALIGN_IN_TOP_LEFT, 20, 20);
|
|
||||||
//
|
|
||||||
// /* Create a label on the button */
|
|
||||||
// lv_obj_t *label = lv_label_create(btn, NULL);
|
|
||||||
// lv_label_set_text(label, "Display a message box!");
|
|
||||||
//
|
|
||||||
// /* Create an informative label on the screen */
|
|
||||||
// info = lv_label_create(lv_scr_act(), NULL);
|
|
||||||
// lv_label_set_text(info, welcome_info);
|
|
||||||
// lv_label_set_long_mode(info, LV_LABEL_LONG_BREAK); /* Make sure text will wrap */
|
|
||||||
// lv_obj_set_width(info, LV_HOR_RES - 10);
|
|
||||||
// lv_obj_align(info, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 5, -5);
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//static void mbox_event_cb(lv_obj_t *obj, lv_event_t evt)
|
|
||||||
//{
|
|
||||||
// if(evt == LV_EVENT_DELETE && obj == mbox) {
|
|
||||||
// /* Delete the parent modal background */
|
|
||||||
// lv_obj_del_async(lv_obj_get_parent(mbox));
|
|
||||||
// mbox = NULL; /* happens before object is actually deleted! */
|
|
||||||
// lv_label_set_text(info, welcome_info);
|
|
||||||
// } else if(evt == LV_EVENT_VALUE_CHANGED) {
|
|
||||||
// /* A button was clicked */
|
|
||||||
// lv_msgbox_start_auto_close(mbox, 0);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//static void btn_event_cb(lv_obj_t *btn, lv_event_t evt)
|
|
||||||
//{
|
|
||||||
// if(evt == LV_EVENT_CLICKED) {
|
|
||||||
// /* Create a full-screen background */
|
|
||||||
//
|
|
||||||
// /* Create a base object for the modal background */
|
|
||||||
// lv_obj_t *obj = lv_obj_create(lv_scr_act(), NULL);
|
|
||||||
// lv_obj_reset_style_list(obj, LV_OBJ_PART_MAIN);
|
|
||||||
// lv_obj_add_style(obj, LV_OBJ_PART_MAIN, &style_modal);
|
|
||||||
// lv_obj_set_pos(obj, 0, 0);
|
|
||||||
// lv_obj_set_size(obj, LV_HOR_RES, LV_VER_RES);
|
|
||||||
//
|
|
||||||
// static const char * btns2[] = {"Ok", "Cancel", ""};
|
|
||||||
//
|
|
||||||
// /* Create the message box as a child of the modal background */
|
|
||||||
// mbox = lv_msgbox_create(obj, NULL);
|
|
||||||
// lv_msgbox_add_btns(mbox, btns2);
|
|
||||||
// lv_msgbox_set_text(mbox, "Hello world!");
|
|
||||||
// lv_obj_align(mbox, NULL, LV_ALIGN_CENTER, 0, 0);
|
|
||||||
// lv_obj_set_event_cb(mbox, mbox_event_cb);
|
|
||||||
//
|
|
||||||
// /* Fade the message box in with an animation */
|
|
||||||
// lv_anim_t a;
|
|
||||||
// lv_anim_init(&a);
|
|
||||||
// lv_anim_set_var(&a, obj);
|
|
||||||
// lv_anim_set_time(&a, 500);
|
|
||||||
// lv_anim_set_values(&a, LV_OPA_TRANSP, LV_OPA_50);
|
|
||||||
// lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t)opa_anim);
|
|
||||||
// lv_anim_start(&a);
|
|
||||||
//
|
|
||||||
// lv_label_set_text(info, in_msg_info);
|
|
||||||
// lv_obj_align(info, NULL, LV_ALIGN_IN_BOTTOM_LEFT, 5, -5);
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//static void opa_anim(void * bg, lv_anim_value_t v)
|
|
||||||
//{
|
|
||||||
// lv_obj_set_style_local_bg_opa(bg, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, v);
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//#endif
|
|
@ -1,21 +1,22 @@
|
|||||||
//#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
//
|
#if LV_BUILD_EXAMPLES
|
||||||
//void lv_example_obj_1(void)
|
|
||||||
//{
|
void lv_example_obj_1(void)
|
||||||
// lv_obj_t * obj1;
|
{
|
||||||
// obj1 = lv_obj_create(lv_scr_act(), NULL);
|
lv_obj_t * obj1;
|
||||||
// lv_obj_set_size(obj1, 100, 50);
|
obj1 = lv_obj_create(lv_scr_act(), NULL);
|
||||||
// lv_obj_align(obj1, NULL, LV_ALIGN_CENTER, -60, -30);
|
lv_obj_set_size(obj1, 100, 50);
|
||||||
//
|
lv_obj_align(obj1, NULL, LV_ALIGN_CENTER, -60, -30);
|
||||||
// static lv_style_t style_shadow;
|
|
||||||
// lv_style_init(&style_shadow);
|
static lv_style_t style_shadow;
|
||||||
// lv_style_set_shadow_width(&style_shadow, LV_STATE_DEFAULT, 10);
|
lv_style_init(&style_shadow);
|
||||||
// lv_style_set_shadow_spread(&style_shadow, LV_STATE_DEFAULT, 5);
|
lv_style_set_shadow_width(&style_shadow, 10);
|
||||||
// lv_style_set_shadow_color(&style_shadow, LV_STATE_DEFAULT, LV_COLOR_BLUE);
|
lv_style_set_shadow_spread(&style_shadow, 5);
|
||||||
//
|
lv_style_set_shadow_color(&style_shadow, LV_COLOR_BLUE);
|
||||||
// /*Copy the previous object (drag is already enabled)*/
|
|
||||||
// lv_obj_t * obj3;
|
lv_obj_t * obj3;
|
||||||
// obj3 = lv_obj_create(lv_scr_act(), NULL);
|
obj3 = lv_obj_create(lv_scr_act(), NULL);
|
||||||
// lv_obj_add_style(obj3, LV_OBJ_PART_MAIN, &style_shadow);
|
lv_obj_add_style(obj3, LV_PART_MAIN, LV_STATE_DEFAULT, &style_shadow);
|
||||||
// lv_obj_align(obj3, NULL, LV_ALIGN_CENTER, 60, 30);
|
lv_obj_align(obj3, NULL, LV_ALIGN_CENTER, 60, 30);
|
||||||
//}
|
}
|
||||||
|
#endif
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_ROLLER && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_ROLLER
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
char buf[32];
|
char buf[32];
|
||||||
lv_roller_get_selected_str(obj, buf, sizeof(buf));
|
lv_roller_get_selected_str(obj, buf, sizeof(buf));
|
||||||
printf("Selected month: %s\n", buf);
|
LV_LOG_USER("Selected month: %s\n", buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_ROLLER && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_ROLLER
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
char buf[32];
|
char buf[32];
|
||||||
lv_roller_get_selected_str(obj, buf, sizeof(buf));
|
lv_roller_get_selected_str(obj, buf, sizeof(buf));
|
||||||
printf("Selected value: %s\n", buf);
|
LV_LOG_USER("Selected value: %s\n", buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_SLIDER && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_SLIDER
|
|
||||||
|
|
||||||
static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
||||||
static lv_obj_t * slider_label;
|
static lv_obj_t * slider_label;
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_SLIDER && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_SLIDER
|
|
||||||
|
|
||||||
static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_SLIDER && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_SLIDER
|
|
||||||
|
|
||||||
static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
static void slider_event_cb(lv_obj_t * slider, lv_event_t event);
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_SPINBOX && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_SPINBOX
|
|
||||||
|
|
||||||
static lv_obj_t * spinbox;
|
static lv_obj_t * spinbox;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_SPINNER
|
#if LV_USE_SPINNER && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
void lv_example_spinner_1(void)
|
void lv_example_spinner_1(void)
|
||||||
{
|
{
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_SWITCH && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_SWITCH
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
printf("State: %s\n", lv_obj_has_state(obj, LV_STATE_CHECKED) ? "On" : "Off");
|
LV_LOG_USER("State: %s\n", lv_obj_has_state(obj, LV_STATE_CHECKED) ? "On" : "Off");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_TABLE
|
#if LV_USE_TABLE && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
static void event_cb(lv_obj_t * obj, lv_event_t e)
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_TABVIEW
|
#if LV_USE_TABVIEW && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
void lv_example_tabview_1(void)
|
void lv_example_tabview_1(void)
|
||||||
{
|
{
|
||||||
|
@ -1,32 +1,38 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_TEXTAREA && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_TEXTAREA
|
|
||||||
|
|
||||||
lv_obj_t * ta1;
|
|
||||||
lv_obj_t * ta2;
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void btnm_event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
printf("Value: %s\n", lv_textarea_get_text(obj));
|
lv_obj_t * ta = lv_event_get_user_data();
|
||||||
}
|
const char * txt = lv_btnmatrix_get_btn_text(obj, lv_btnmatrix_get_active_btn(obj));
|
||||||
else if(event == LV_EVENT_LONG_PRESSED_REPEAT) {
|
|
||||||
/*For simple test: Long press the Text are to add the text below*/
|
if(strcmp(txt, LV_SYMBOL_BACKSPACE) == 0) lv_textarea_del_char(ta);
|
||||||
const char * txt = "\n\nYou can scroll it if the text is long enough.\n";
|
else if(strcmp(txt, LV_SYMBOL_NEW_LINE) == 0) lv_textarea_add_char(ta, '\n');
|
||||||
static uint16_t i = 0;
|
else lv_textarea_add_text(ta, txt);
|
||||||
if(txt[i] != '\0') {
|
|
||||||
lv_textarea_add_char(ta1, txt[i]);
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_example_textarea_1(void)
|
void lv_example_textarea_1(void)
|
||||||
{
|
{
|
||||||
ta1 = lv_textarea_create(lv_scr_act(), NULL);
|
lv_obj_t * ta = lv_textarea_create(lv_scr_act(), NULL);
|
||||||
lv_obj_align(ta1, NULL, LV_ALIGN_IN_TOP_LEFT, 0, 0);
|
lv_textarea_set_one_line(ta, true);
|
||||||
lv_textarea_set_text(ta1, "A text in a Text Area"); /*Set an initial text*/
|
lv_obj_align(ta, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);
|
||||||
lv_obj_add_event_cb(ta1, event_handler, NULL);
|
lv_obj_add_state(ta, LV_STATE_FOCUSED); /*To be sure the cursor is visible*/
|
||||||
|
|
||||||
|
static const char * btnm_map[] = {"1", "2", "3", "\n",
|
||||||
|
"4", "5", "6", "\n",
|
||||||
|
"7", "8", "9", "\n",
|
||||||
|
LV_SYMBOL_BACKSPACE, "0", LV_SYMBOL_NEW_LINE};
|
||||||
|
|
||||||
|
lv_obj_t * btnm = lv_btnmatrix_create(lv_scr_act(), NULL);
|
||||||
|
lv_obj_set_size(btnm, 200, 150);
|
||||||
|
lv_obj_align(btnm, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, -10);
|
||||||
|
lv_obj_add_event_cb(btnm, btnm_event_handler, ta);
|
||||||
|
lv_obj_clear_flag(btnm, LV_OBJ_FLAG_CLICK_FOCUSABLE); /*To keep the text area focused on button clicks*/
|
||||||
|
lv_btnmatrix_set_map(btnm, btnm_map);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,62 +1,58 @@
|
|||||||
//#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
//#include <stdio.h>
|
#if LV_USE_TEXTAREA && LV_USE_KEYBOARD && LV_BUILD_EXAMPLES
|
||||||
//#if LV_USE_TEXTAREA && LV_USE_KEYBOARD
|
|
||||||
//
|
static void ta_event_cb(lv_obj_t * ta, lv_event_t event);
|
||||||
//static void ta_event_cb(lv_obj_t * ta, lv_event_t event);
|
|
||||||
//
|
static lv_obj_t * kb;
|
||||||
//static lv_obj_t * kb;
|
|
||||||
//
|
void lv_example_textarea_2(void)
|
||||||
//void lv_example_textarea_2(void)
|
{
|
||||||
//{
|
/* Create the password box */
|
||||||
// /* Create the password box */
|
lv_obj_t * pwd_ta = lv_textarea_create(lv_scr_act(), NULL);
|
||||||
// lv_obj_t * pwd_ta = lv_textarea_create(lv_scr_act(), NULL);
|
lv_textarea_set_text(pwd_ta, "");
|
||||||
// lv_textarea_set_text(pwd_ta, "");
|
lv_textarea_set_pwd_mode(pwd_ta, true);
|
||||||
// lv_textarea_set_pwd_mode(pwd_ta, true);
|
lv_textarea_set_one_line(pwd_ta, true);
|
||||||
// lv_textarea_set_one_line(pwd_ta, true);
|
lv_obj_set_width(pwd_ta, LV_HOR_RES / 2 - 20);
|
||||||
// lv_textarea_set_cursor_hidden(pwd_ta, true);
|
lv_obj_set_pos(pwd_ta, 5, 20);
|
||||||
// lv_obj_set_width(pwd_ta, LV_HOR_RES / 2 - 20);
|
lv_obj_add_event_cb(pwd_ta, ta_event_cb, NULL);
|
||||||
// lv_obj_set_pos(pwd_ta, 5, 20);
|
|
||||||
// lv_obj_set_event_cb(pwd_ta, ta_event_cb);
|
/* Create a label and position it above the text box */
|
||||||
//
|
lv_obj_t * pwd_label = lv_label_create(lv_scr_act(), NULL);
|
||||||
// /* Create a label and position it above the text box */
|
lv_label_set_text(pwd_label, "Password:");
|
||||||
// lv_obj_t * pwd_label = lv_label_create(lv_scr_act(), NULL);
|
lv_obj_align(pwd_label, pwd_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
||||||
// lv_label_set_text(pwd_label, "Password:");
|
|
||||||
// lv_obj_align(pwd_label, pwd_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
/* Create the one-line mode text area */
|
||||||
//
|
lv_obj_t * oneline_ta = lv_textarea_create(lv_scr_act(), pwd_ta);
|
||||||
// /* Create the one-line mode text area */
|
lv_textarea_set_pwd_mode(oneline_ta, false);
|
||||||
// lv_obj_t * oneline_ta = lv_textarea_create(lv_scr_act(), pwd_ta);
|
lv_obj_align(oneline_ta, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20);
|
||||||
// lv_textarea_set_pwd_mode(oneline_ta, false);
|
|
||||||
// lv_textarea_set_cursor_hidden(oneline_ta, true);
|
|
||||||
// lv_obj_align(oneline_ta, NULL, LV_ALIGN_IN_TOP_RIGHT, -5, 20);
|
/* Create a label and position it above the text box */
|
||||||
//
|
lv_obj_t * oneline_label = lv_label_create(lv_scr_act(), NULL);
|
||||||
//
|
lv_label_set_text(oneline_label, "Text:");
|
||||||
// /* Create a label and position it above the text box */
|
lv_obj_align(oneline_label, oneline_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
||||||
// lv_obj_t * oneline_label = lv_label_create(lv_scr_act(), NULL);
|
|
||||||
// lv_label_set_text(oneline_label, "Text:");
|
/* Create a keyboard */
|
||||||
// lv_obj_align(oneline_label, oneline_ta, LV_ALIGN_OUT_TOP_LEFT, 0, 0);
|
kb = lv_keyboard_create(lv_scr_act());
|
||||||
//
|
lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
|
||||||
// /* Create a keyboard */
|
|
||||||
// kb = lv_keyboard_create(lv_scr_act(), NULL);
|
lv_keyboard_set_textarea(kb, pwd_ta); /* Focus it on one of the text areas to start */
|
||||||
// lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
|
}
|
||||||
//
|
|
||||||
// lv_keyboard_set_textarea(kb, pwd_ta); /* Focus it on one of the text areas to start */
|
static void ta_event_cb(lv_obj_t * ta, lv_event_t event)
|
||||||
// lv_keyboard_set_cursor_manage(kb, true); /* Automatically show/hide cursors on text areas */
|
{
|
||||||
//}
|
if(event == LV_EVENT_CLICKED) {
|
||||||
//
|
/* Focus on the clicked text area */
|
||||||
//static void ta_event_cb(lv_obj_t * ta, lv_event_t event)
|
if(kb != NULL)
|
||||||
//{
|
lv_keyboard_set_textarea(kb, ta);
|
||||||
// if(event == LV_EVENT_CLICKED) {
|
}
|
||||||
// /* Focus on the clicked text area */
|
|
||||||
// if(kb != NULL)
|
else if(event == LV_EVENT_INSERT) {
|
||||||
// lv_keyboard_set_textarea(kb, ta);
|
const char * str = lv_event_get_param();
|
||||||
// }
|
if(str[0] == '\n') {
|
||||||
//
|
LV_LOG_USER("Ready\n");
|
||||||
// else if(event == LV_EVENT_INSERT) {
|
}
|
||||||
// const char * str = lv_event_get_data();
|
}
|
||||||
// if(str[0] == '\n') {
|
}
|
||||||
// printf("Ready\n");
|
|
||||||
// }
|
#endif
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//#endif
|
|
||||||
|
@ -1,44 +1,43 @@
|
|||||||
//#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
//#include <stdio.h>
|
#if LV_USE_TEXTAREA && LV_USE_KEYBOARD && LV_BUILD_EXAMPLES
|
||||||
//#if LV_USE_TEXTAREA && LV_USE_KEYBOARD
|
|
||||||
//
|
static void ta_event_cb(lv_obj_t * ta, lv_event_t event);
|
||||||
//static void ta_event_cb(lv_obj_t * ta, lv_event_t event);
|
|
||||||
//
|
static lv_obj_t * kb;
|
||||||
//static lv_obj_t * kb;
|
|
||||||
//
|
/**
|
||||||
///**
|
* Automatically format text like a clock. E.g. "12:34"
|
||||||
// * Automatically format text like a clock. E.g. "12:34"
|
* Add the ':' automatically.
|
||||||
// * Add the ':' automatically.
|
*/
|
||||||
// */
|
void lv_example_textarea_3(void)
|
||||||
//void lv_example_textarea_3(void)
|
{
|
||||||
//{
|
/* Create the text area */
|
||||||
// /* Create the text area */
|
lv_obj_t * ta = lv_textarea_create(lv_scr_act(), NULL);
|
||||||
// lv_obj_t * ta = lv_textarea_create(lv_scr_act(), NULL);
|
lv_obj_add_event_cb(ta, ta_event_cb, NULL);
|
||||||
// lv_obj_set_event_cb(ta, ta_event_cb);
|
lv_textarea_set_accepted_chars(ta, "0123456789:");
|
||||||
// lv_textarea_set_accepted_chars(ta, "0123456789:");
|
lv_textarea_set_max_length(ta, 5);
|
||||||
// lv_textarea_set_max_length(ta, 5);
|
lv_textarea_set_one_line(ta, true);
|
||||||
// lv_textarea_set_one_line(ta, true);
|
lv_textarea_set_text(ta, "");
|
||||||
// lv_textarea_set_text(ta, "");
|
|
||||||
//
|
/* Create a keyboard*/
|
||||||
// /* Create a keyboard*/
|
kb = lv_keyboard_create(lv_scr_act());
|
||||||
// kb = lv_keyboard_create(lv_scr_act(), NULL);
|
lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
|
||||||
// lv_obj_set_size(kb, LV_HOR_RES, LV_VER_RES / 2);
|
lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUMBER);
|
||||||
// lv_keyboard_set_mode(kb, LV_KEYBOARD_MODE_NUM);
|
lv_keyboard_set_textarea(kb, ta);
|
||||||
// lv_keyboard_set_textarea(kb, ta);
|
}
|
||||||
//}
|
|
||||||
//
|
static void ta_event_cb(lv_obj_t * ta, lv_event_t event)
|
||||||
//static void ta_event_cb(lv_obj_t * ta, lv_event_t event)
|
{
|
||||||
//{
|
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||||
// if(event == LV_EVENT_VALUE_CHANGED) {
|
const char * txt = lv_textarea_get_text(ta);
|
||||||
// const char * txt = lv_textarea_get_text(ta);
|
if(txt[0] >= '0' && txt[0] <= '9' &&
|
||||||
// if(txt[0] >= '0' && txt[0] <= '9' &&
|
txt[1] >= '0' && txt[1] <= '9' &&
|
||||||
// txt[1] >= '0' && txt[1] <= '9' &&
|
txt[2] != ':')
|
||||||
// txt[2] != ':')
|
{
|
||||||
// {
|
lv_textarea_set_cursor_pos(ta, 2);
|
||||||
// lv_textarea_set_cursor_pos(ta, 2);
|
lv_textarea_add_char(ta, ':');
|
||||||
// lv_textarea_add_char(ta, ':');
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//}
|
|
||||||
//
|
#endif
|
||||||
//#endif
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#if LV_USE_TILEVIEW
|
#if LV_USE_TILEVIEW && LV_BUILD_EXAMPLES
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a 2x2 tile view and allow scrolling only in an "L" shape.
|
* Create a 2x2 tile view and allow scrolling only in an "L" shape.
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
#include "../../../lvgl.h"
|
#include "../../../lvgl.h"
|
||||||
#include <stdio.h>
|
#if LV_USE_WIN && LV_BUILD_EXAMPLES
|
||||||
#if LV_USE_WIN
|
|
||||||
|
|
||||||
|
|
||||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||||
{
|
{
|
||||||
if(event == LV_EVENT_CLICKED) {
|
if(event == LV_EVENT_CLICKED) {
|
||||||
printf("Button: %d\n", lv_obj_get_child_id(obj));
|
LV_LOG_USER("Button: %d\n", lv_obj_get_child_id(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
||||||
/*====================
|
/*====================
|
||||||
COLOR SETTINGS
|
COLOR SETTINGS
|
||||||
*====================*/
|
*====================*/
|
||||||
@ -102,12 +103,38 @@
|
|||||||
* 0: to disable caching */
|
* 0: to disable caching */
|
||||||
#define LV_IMG_CACHE_DEF_SIZE 0
|
#define LV_IMG_CACHE_DEF_SIZE 0
|
||||||
|
|
||||||
|
/*-------------
|
||||||
|
* GPU
|
||||||
|
*-----------*/
|
||||||
|
|
||||||
|
/*Use STM32's DMA2D (aka Chrom Art) GPU*/
|
||||||
|
#define LV_USE_GPU_STM32_DMA2D 0
|
||||||
|
#if LV_USE_GPU_STM32_DMA2D
|
||||||
|
/*Must be defined to include path of CMSIS header of target processor
|
||||||
|
e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
||||||
|
#define LV_GPU_DMA2D_CMSIS_INCLUDE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Use NXP's PXP GPU iMX RTxxx platforms */
|
||||||
|
#define LV_USE_GPU_NXP_PXP 0
|
||||||
|
#if LV_USE_GPU_NXP_PXP
|
||||||
|
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
|
||||||
|
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS
|
||||||
|
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
|
||||||
|
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
|
||||||
|
* */
|
||||||
|
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Use NXP's VG-Lite GPU iMX RTxxx platforms */
|
||||||
|
#define LV_USE_GPU_NXP_VG_LITE 0
|
||||||
|
|
||||||
/*-------------
|
/*-------------
|
||||||
* Logging
|
* Logging
|
||||||
*-----------*/
|
*-----------*/
|
||||||
|
|
||||||
/*Enable the log module*/
|
/*Enable the log module*/
|
||||||
#define LV_USE_LOG 0
|
#define LV_USE_LOG 1
|
||||||
#if LV_USE_LOG
|
#if LV_USE_LOG
|
||||||
|
|
||||||
/* How important log should be added:
|
/* How important log should be added:
|
||||||
@ -120,7 +147,7 @@
|
|||||||
|
|
||||||
/* 1: Print the log with 'printf';
|
/* 1: Print the log with 'printf';
|
||||||
* 0: User need to register a callback with `lv_log_register_print_cb()`*/
|
* 0: User need to register a callback with `lv_log_register_print_cb()`*/
|
||||||
# define LV_LOG_PRINTF 0
|
# define LV_LOG_PRINTF 1
|
||||||
#endif /*LV_USE_LOG*/
|
#endif /*LV_USE_LOG*/
|
||||||
|
|
||||||
/*-------------
|
/*-------------
|
||||||
@ -129,25 +156,23 @@
|
|||||||
|
|
||||||
/* Enable asserts if an operation is failed or an invalid data is found.
|
/* Enable asserts if an operation is failed or an invalid data is found.
|
||||||
* If LV_USE_LOG is enabled an error message will be printed on failure*/
|
* If LV_USE_LOG is enabled an error message will be printed on failure*/
|
||||||
#define LV_USE_ASSERT 1
|
|
||||||
#if LV_USE_ASSERT
|
|
||||||
|
|
||||||
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended) */
|
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended) */
|
||||||
#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
|
#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
|
||||||
#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/
|
#define LV_USE_ASSERT_STYLE 1 /*Check if the styles are properly initialized. (Very fast, recommended)*/
|
||||||
#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
|
#define LV_USE_ASSERT_MEM_INTEGRITY 1 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
|
||||||
#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow) */
|
#define LV_USE_ASSERT_OBJ 1 /*Check the object's type and existence (e.g. not deleted). (Slow) */
|
||||||
|
|
||||||
/*Add a custom handler when assert happens e.g. to restart the MCU*/
|
/*Add a custom handler when assert happens e.g. to restart the MCU*/
|
||||||
#define LV_ASSERT_HANDLER_INCLUDE
|
#define LV_ASSERT_HANDLER_INCLUDE
|
||||||
#define LV_ASSERT_HANDLER while(1); /*Halt by default*/
|
#define LV_ASSERT_HANDLER while(1); /*Halt by default*/
|
||||||
|
|
||||||
#endif /*LV_USE_ASSERT*/
|
|
||||||
|
|
||||||
/*-------------
|
/*-------------
|
||||||
* Others
|
* Others
|
||||||
*-----------*/
|
*-----------*/
|
||||||
|
|
||||||
|
/*1: Show CPU usage and FPS count in the right bottom corner*/
|
||||||
|
#define LV_USE_PERF_MONITOR 0
|
||||||
|
|
||||||
/*Change the built in (v)snprintf functions*/
|
/*Change the built in (v)snprintf functions*/
|
||||||
#define LV_SPRINTF_CUSTOM 0
|
#define LV_SPRINTF_CUSTOM 0
|
||||||
#if LV_SPRINTF_CUSTOM
|
#if LV_SPRINTF_CUSTOM
|
||||||
@ -258,19 +283,16 @@ typedef void * lv_user_data_t;
|
|||||||
* E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2) */
|
* E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2) */
|
||||||
#define LV_FONT_CUSTOM_DECLARE
|
#define LV_FONT_CUSTOM_DECLARE
|
||||||
|
|
||||||
/*Always set a default font*/
|
|
||||||
#define LV_FONT_DEFAULT &lv_font_montserrat_14
|
|
||||||
|
|
||||||
/* Enable handling large font and/or fonts with a lot of characters.
|
/* Enable handling large font and/or fonts with a lot of characters.
|
||||||
* The limit depends on the font size, font face and bpp.
|
* The limit depends on the font size, font face and bpp.
|
||||||
* Compiler error will be triggered if a font needs it.*/
|
* Compiler error will be triggered if a font needs it.*/
|
||||||
#define LV_FONT_FMT_TXT_LARGE 0
|
#define LV_FONT_FMT_TXT_LARGE 0
|
||||||
|
|
||||||
/* Enables/disables support for compressed fonts. */
|
/* Enables/disables support for compressed fonts. */
|
||||||
#define LV_USE_FONT_COMPRESSED 1
|
#define LV_USE_FONT_COMPRESSED 0
|
||||||
|
|
||||||
/* Enable subpixel rendering */
|
/* Enable subpixel rendering */
|
||||||
#define LV_USE_FONT_SUBPX 1
|
#define LV_USE_FONT_SUBPX 0
|
||||||
#if LV_USE_FONT_SUBPX
|
#if LV_USE_FONT_SUBPX
|
||||||
/* Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/
|
/* Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/
|
||||||
#define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/
|
#define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/
|
||||||
@ -308,7 +330,7 @@ typedef void * lv_user_data_t;
|
|||||||
/* Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
|
/* Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
|
||||||
* The direction will be processed according to the Unicode Bidirectioanl Algorithm:
|
* The direction will be processed according to the Unicode Bidirectioanl Algorithm:
|
||||||
* https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
|
* https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
|
||||||
#define LV_USE_BIDI 1
|
#define LV_USE_BIDI 0
|
||||||
#if LV_USE_BIDI
|
#if LV_USE_BIDI
|
||||||
/* Set the default direction. Supported values:
|
/* Set the default direction. Supported values:
|
||||||
* `LV_BIDI_DIR_LTR` Left-to-Right
|
* `LV_BIDI_DIR_LTR` Left-to-Right
|
||||||
@ -322,6 +344,24 @@ typedef void * lv_user_data_t;
|
|||||||
#define LV_USE_ARABIC_PERSIAN_CHARS 0
|
#define LV_USE_ARABIC_PERSIAN_CHARS 0
|
||||||
|
|
||||||
|
|
||||||
|
/*==================
|
||||||
|
* THEME USAGE
|
||||||
|
*================*/
|
||||||
|
/*Set the very basic the attributes*/
|
||||||
|
#define LV_THEME_COLOR_PRIMARY lv_color_hex(0x01a2b1)
|
||||||
|
#define LV_THEME_COLOR_SECONDARY lv_color_hex(0x44d1b6)
|
||||||
|
#define LV_THEME_FONT_SMALL &lv_font_montserrat_14
|
||||||
|
#define LV_THEME_FONT_NORMAL &lv_font_montserrat_14
|
||||||
|
#define LV_THEME_FONT_LARGE &lv_font_montserrat_14
|
||||||
|
#define LV_THEME_FONT_EXTRA_LARGE &lv_font_montserrat_14
|
||||||
|
|
||||||
|
/* An external include file required to see the theme init function.
|
||||||
|
* Relative to "lv_core/lv_obj" */
|
||||||
|
#define LV_THEME_INIT_INCLUDE "../extra/themes/lv_themes.h"
|
||||||
|
|
||||||
|
/* Set a theme initialization function */
|
||||||
|
#define LV_THEME_INIT lv_theme_default_init
|
||||||
|
|
||||||
/*==================
|
/*==================
|
||||||
* WIDGET USAGE
|
* WIDGET USAGE
|
||||||
*================*/
|
*================*/
|
||||||
@ -379,33 +419,45 @@ typedef void * lv_user_data_t;
|
|||||||
/*-----------
|
/*-----------
|
||||||
* Widgets
|
* Widgets
|
||||||
*----------*/
|
*----------*/
|
||||||
#define LV_USE_CALENDAR 0
|
#define LV_USE_CALENDAR 1
|
||||||
#define LV_USE_CALENDAR_HEADER_ARROW 0
|
#if LV_USE_CALENDAR
|
||||||
|
# define LV_CALENDAR_WEEK_STARTS_MONDAY 0
|
||||||
|
# if LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||||
|
# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
|
||||||
|
# else
|
||||||
|
# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
|
||||||
|
# endif
|
||||||
|
|
||||||
#define LV_USE_COLORWHEEL 0
|
# define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
|
||||||
|
# define LV_USE_CALENDAR_HEADER_ARROW 1
|
||||||
|
#endif /*LV_USE_CALENDAR*/
|
||||||
|
|
||||||
#define LV_USE_KEYBOARD 0
|
#define LV_USE_COLORWHEEL 1
|
||||||
|
|
||||||
#define LV_USE_LED 0
|
#define LV_USE_IMGBTN 1
|
||||||
|
|
||||||
#define LV_USE_LIST 0
|
#define LV_USE_KEYBOARD 1
|
||||||
|
|
||||||
#define LV_USE_MSGBOX 0
|
#define LV_USE_LED 1
|
||||||
|
|
||||||
#define LV_USE_SPINBOX 0
|
#define LV_USE_LIST 1
|
||||||
|
|
||||||
#define LV_USE_SPINNER 0
|
#define LV_USE_MSGBOX 1
|
||||||
|
|
||||||
#define LV_USE_TABVIEW 0
|
#define LV_USE_SPINBOX 1
|
||||||
|
|
||||||
#define LV_USE_TILEVIEW 0
|
#define LV_USE_SPINNER 1
|
||||||
|
|
||||||
#define LV_USE_WIN 0
|
#define LV_USE_TABVIEW 1
|
||||||
|
|
||||||
|
#define LV_USE_TILEVIEW 1
|
||||||
|
|
||||||
|
#define LV_USE_WIN 1
|
||||||
|
|
||||||
/*-----------
|
/*-----------
|
||||||
* Themes
|
* Themes
|
||||||
*----------*/
|
*----------*/
|
||||||
/* Use the default theme. If not used a custom theme needs be assigned to the display.*/
|
/* A simple, impressive and very complete theme */
|
||||||
#define LV_USE_THEME_DEFAULT 1
|
#define LV_USE_THEME_DEFAULT 1
|
||||||
#if LV_USE_THEME_DEFAULT
|
#if LV_USE_THEME_DEFAULT
|
||||||
/* 1: Light mode; 0: Dark mode*/
|
/* 1: Light mode; 0: Dark mode*/
|
||||||
@ -428,14 +480,6 @@ typedef void * lv_user_data_t;
|
|||||||
/*Enable the examples to be built with the library*/
|
/*Enable the examples to be built with the library*/
|
||||||
#define LV_BUILD_EXAMPLES 1
|
#define LV_BUILD_EXAMPLES 1
|
||||||
|
|
||||||
/*==================
|
|
||||||
* Non-user section
|
|
||||||
*==================*/
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
|
|
||||||
# define _CRT_SECURE_NO_WARNINGS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*--END OF LV_CONF_H--*/
|
/*--END OF LV_CONF_H--*/
|
||||||
|
|
||||||
#endif /*LV_CONF_H*/
|
#endif /*LV_CONF_H*/
|
||||||
|
2
lvgl.mk
2
lvgl.mk
@ -3,6 +3,6 @@ include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_hal/lv_hal.mk
|
|||||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets/lv_widgets.mk
|
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets/lv_widgets.mk
|
||||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_font/lv_font.mk
|
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_font/lv_font.mk
|
||||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc/lv_misc.mk
|
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc/lv_misc.mk
|
||||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes/lv_themes.mk
|
|
||||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_draw/lv_draw.mk
|
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_draw/lv_draw.mk
|
||||||
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_gpu/lv_gpu.mk
|
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_gpu/lv_gpu.mk
|
||||||
|
include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/extra/extra.mk
|
||||||
|
@ -114,35 +114,17 @@ fout.write(
|
|||||||
/*If running without lv_conf.h add typdesf with default value*/
|
/*If running without lv_conf.h add typdesf with default value*/
|
||||||
#if defined(LV_CONF_SKIP)
|
#if defined(LV_CONF_SKIP)
|
||||||
|
|
||||||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
|
||||||
typedef int16_t lv_coord_t;
|
|
||||||
|
|
||||||
# if LV_USE_ANIMATION
|
|
||||||
/*Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`)*/
|
|
||||||
typedef void * lv_anim_user_data_t;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if LV_USE_GROUP
|
|
||||||
typedef void * lv_group_user_data_t;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if LV_USE_FILESYSTEM
|
|
||||||
typedef void * lv_fs_drv_user_data_t;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
typedef void * lv_img_decoder_user_data_t;
|
|
||||||
|
|
||||||
typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/
|
|
||||||
typedef void * lv_indev_drv_user_data_t; /*Type of user data in the input device driver*/
|
|
||||||
|
|
||||||
typedef void * lv_font_user_data_t;
|
|
||||||
|
|
||||||
# if LV_USE_USER_DATA
|
# if LV_USE_USER_DATA
|
||||||
typedef void * lv_obj_user_data_t;
|
typedef void * lv_obj_user_data_t;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
|
||||||
|
# define _CRT_SECURE_NO_WARNINGS
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
#endif /*defined(LV_CONF_SKIP)*/
|
||||||
|
|
||||||
#endif /*LV_CONF_INTERNAL_H*/
|
#endif /*LV_CONF_INTERNAL_H*/
|
||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
|
1
src/extra/extra.mk
Normal file
1
src/extra/extra.mk
Normal file
@ -0,0 +1 @@
|
|||||||
|
CSRCS += $(shell find -L ../src/extra -name \*.c)
|
@ -260,12 +260,12 @@ static void draw_disc_grad(lv_obj_t * obj, const lv_area_t * mask)
|
|||||||
uint16_t i;
|
uint16_t i;
|
||||||
lv_coord_t cir_w = lv_obj_get_style_arc_width(obj, LV_PART_MAIN);
|
lv_coord_t cir_w = lv_obj_get_style_arc_width(obj, LV_PART_MAIN);
|
||||||
|
|
||||||
/* Mask outer ring of widget to tidy up ragged edges of lines while drawing outer ring */
|
#if LV_DRAW_COMPLEX
|
||||||
|
/* Mask outer and inner ring of widget to tidy up ragged edges of lines while drawing outer ring */
|
||||||
lv_draw_mask_radius_param_t mask_out_param;
|
lv_draw_mask_radius_param_t mask_out_param;
|
||||||
lv_draw_mask_radius_init(&mask_out_param, &obj->coords, LV_RADIUS_CIRCLE, false);
|
lv_draw_mask_radius_init(&mask_out_param, &obj->coords, LV_RADIUS_CIRCLE, false);
|
||||||
int16_t mask_out_id = lv_draw_mask_add(&mask_out_param, 0);
|
int16_t mask_out_id = lv_draw_mask_add(&mask_out_param, 0);
|
||||||
|
|
||||||
|
|
||||||
lv_area_t mask_area;
|
lv_area_t mask_area;
|
||||||
lv_area_copy(&mask_area, &obj->coords);
|
lv_area_copy(&mask_area, &obj->coords);
|
||||||
mask_area.x1 += cir_w;
|
mask_area.x1 += cir_w;
|
||||||
@ -276,25 +276,30 @@ static void draw_disc_grad(lv_obj_t * obj, const lv_area_t * mask)
|
|||||||
lv_draw_mask_radius_init(&mask_in_param, &mask_area, LV_RADIUS_CIRCLE, true);
|
lv_draw_mask_radius_init(&mask_in_param, &mask_area, LV_RADIUS_CIRCLE, true);
|
||||||
int16_t mask_in_id = lv_draw_mask_add(&mask_in_param, 0);
|
int16_t mask_in_id = lv_draw_mask_add(&mask_in_param, 0);
|
||||||
|
|
||||||
/* The inner line ends will be masked out.
|
/* The inner and outer line ends will be masked out.
|
||||||
* So make lines a little bit longer because the masking makes a more even result */
|
* So make lines a little bit longer because the masking makes a more even result */
|
||||||
lv_coord_t cir_w_extra = cir_w + line_dsc.width;
|
lv_coord_t cir_w_extra = line_dsc.width;
|
||||||
|
#else
|
||||||
|
lv_coord_t cir_w_extra = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i <= 360; i += LV_CPICKER_DEF_QF) {
|
for(i = 0; i <= 360; i += LV_CPICKER_DEF_QF) {
|
||||||
line_dsc.color = angle_to_mode_color(obj, i);
|
line_dsc.color = angle_to_mode_color(obj, i);
|
||||||
|
|
||||||
lv_point_t p[2];
|
lv_point_t p[2];
|
||||||
p[0].x = cx + ((r + line_dsc.width) * lv_trigo_sin(i) >> LV_TRIGO_SHIFT);
|
p[0].x = cx + ((r + cir_w_extra) * lv_trigo_sin(i) >> LV_TRIGO_SHIFT);
|
||||||
p[0].y = cy + ((r + line_dsc.width) * lv_trigo_sin(i + 90) >> LV_TRIGO_SHIFT);
|
p[0].y = cy + ((r + cir_w_extra) * lv_trigo_cos(i) >> LV_TRIGO_SHIFT);
|
||||||
p[1].x = cx + ((r - cir_w_extra) * lv_trigo_sin(i) >> LV_TRIGO_SHIFT);
|
p[1].x = cx + ((r - cir_w - cir_w_extra) * lv_trigo_sin(i) >> LV_TRIGO_SHIFT);
|
||||||
p[1].y = cy + ((r - cir_w_extra) * lv_trigo_sin(i + 90) >> LV_TRIGO_SHIFT);
|
p[1].y = cy + ((r - cir_w - cir_w_extra) * lv_trigo_cos(i) >> LV_TRIGO_SHIFT);
|
||||||
|
|
||||||
lv_draw_line(&p[0], &p[1], mask, &line_dsc);
|
lv_draw_line(&p[0], &p[1], mask, &line_dsc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if LV_DRAW_COMPLEX
|
||||||
lv_draw_mask_remove_id(mask_out_id);
|
lv_draw_mask_remove_id(mask_out_id);
|
||||||
lv_draw_mask_remove_id(mask_in_id);
|
lv_draw_mask_remove_id(mask_in_id);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_knob(lv_obj_t * obj, const lv_area_t * mask)
|
static void draw_knob(lv_obj_t * obj, const lv_area_t * mask)
|
||||||
|
@ -81,7 +81,7 @@ void lv_led_set_color(lv_obj_t * led, lv_color_t color)
|
|||||||
* @param led pointer to a LED object
|
* @param led pointer to a LED object
|
||||||
* @param bright LV_LED_BRIGHT_MIN (max. dark) ... LV_LED_BRIGHT_MAX (max. light)
|
* @param bright LV_LED_BRIGHT_MIN (max. dark) ... LV_LED_BRIGHT_MAX (max. light)
|
||||||
*/
|
*/
|
||||||
void lv_led_set_bright(lv_obj_t * obj, uint8_t bright)
|
void lv_led_set_brightness(lv_obj_t * obj, uint8_t bright)
|
||||||
{
|
{
|
||||||
/*Set the brightness*/
|
/*Set the brightness*/
|
||||||
lv_led_t * led = (lv_led_t *) obj;
|
lv_led_t * led = (lv_led_t *) obj;
|
||||||
@ -102,7 +102,7 @@ void lv_led_set_bright(lv_obj_t * obj, uint8_t bright)
|
|||||||
*/
|
*/
|
||||||
void lv_led_on(lv_obj_t * led)
|
void lv_led_on(lv_obj_t * led)
|
||||||
{
|
{
|
||||||
lv_led_set_bright(led, LV_LED_BRIGHT_MAX);
|
lv_led_set_brightness(led, LV_LED_BRIGHT_MAX);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -111,7 +111,7 @@ void lv_led_on(lv_obj_t * led)
|
|||||||
*/
|
*/
|
||||||
void lv_led_off(lv_obj_t * led)
|
void lv_led_off(lv_obj_t * led)
|
||||||
{
|
{
|
||||||
lv_led_set_bright(led, LV_LED_BRIGHT_MIN);
|
lv_led_set_brightness(led, LV_LED_BRIGHT_MIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -92,7 +92,7 @@ lv_obj_t * lv_tabview_add_tab(lv_obj_t * obj, const char * name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
tabview->map = new_map;
|
tabview->map = new_map;
|
||||||
lv_btnmatrix_set_map(btns, new_map);
|
lv_btnmatrix_set_map(btns, (const char **)new_map);
|
||||||
lv_mem_free(old_map);
|
lv_mem_free(old_map);
|
||||||
|
|
||||||
lv_btnmatrix_set_btn_ctrl_all(btns, LV_BTNMATRIX_CTRL_CHECKABLE | LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_NO_REPEAT);
|
lv_btnmatrix_set_btn_ctrl_all(btns, LV_BTNMATRIX_CTRL_CHECKABLE | LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_NO_REPEAT);
|
||||||
@ -179,7 +179,7 @@ static void lv_tabview_constructor(lv_obj_t * obj, lv_obj_t * parent, const lv_o
|
|||||||
lv_btnmatrix_set_one_checked(btnm, true);
|
lv_btnmatrix_set_one_checked(btnm, true);
|
||||||
tabview->map = lv_mem_alloc(sizeof(const char *));
|
tabview->map = lv_mem_alloc(sizeof(const char *));
|
||||||
tabview->map[0] = "";
|
tabview->map[0] = "";
|
||||||
lv_btnmatrix_set_map(btnm, tabview->map);
|
lv_btnmatrix_set_map(btnm, (const char **)tabview->map);
|
||||||
lv_obj_add_event_cb(btnm, btns_event_cb, NULL);
|
lv_obj_add_event_cb(btnm, btns_event_cb, NULL);
|
||||||
lv_obj_add_flag(btnm, LV_OBJ_FLAG_EVENT_BUBBLE);
|
lv_obj_add_flag(btnm, LV_OBJ_FLAG_EVENT_BUBBLE);
|
||||||
|
|
||||||
|
@ -51,6 +51,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
||||||
/*====================
|
/*====================
|
||||||
COLOR SETTINGS
|
COLOR SETTINGS
|
||||||
*====================*/
|
*====================*/
|
||||||
@ -258,6 +259,62 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*-------------
|
||||||
|
* GPU
|
||||||
|
*-----------*/
|
||||||
|
|
||||||
|
/*Use STM32's DMA2D (aka Chrom Art) GPU*/
|
||||||
|
#ifndef LV_USE_GPU_STM32_DMA2D
|
||||||
|
# ifdef CONFIG_LV_USE_GPU_STM32_DMA2D
|
||||||
|
# define LV_USE_GPU_STM32_DMA2D CONFIG_LV_USE_GPU_STM32_DMA2D
|
||||||
|
# else
|
||||||
|
# define LV_USE_GPU_STM32_DMA2D 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#if LV_USE_GPU_STM32_DMA2D
|
||||||
|
/*Must be defined to include path of CMSIS header of target processor
|
||||||
|
e.g. "stm32f769xx.h" or "stm32f429xx.h" */
|
||||||
|
#ifndef LV_GPU_DMA2D_CMSIS_INCLUDE
|
||||||
|
# ifdef CONFIG_LV_GPU_DMA2D_CMSIS_INCLUDE
|
||||||
|
# define LV_GPU_DMA2D_CMSIS_INCLUDE CONFIG_LV_GPU_DMA2D_CMSIS_INCLUDE
|
||||||
|
# else
|
||||||
|
# define LV_GPU_DMA2D_CMSIS_INCLUDE
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Use NXP's PXP GPU iMX RTxxx platforms */
|
||||||
|
#ifndef LV_USE_GPU_NXP_PXP
|
||||||
|
# ifdef CONFIG_LV_USE_GPU_NXP_PXP
|
||||||
|
# define LV_USE_GPU_NXP_PXP CONFIG_LV_USE_GPU_NXP_PXP
|
||||||
|
# else
|
||||||
|
# define LV_USE_GPU_NXP_PXP 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#if LV_USE_GPU_NXP_PXP
|
||||||
|
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
|
||||||
|
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol FSL_RTOS_FREE_RTOS
|
||||||
|
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
|
||||||
|
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
|
||||||
|
* */
|
||||||
|
#ifndef LV_USE_GPU_NXP_PXP_AUTO_INIT
|
||||||
|
# ifdef CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT
|
||||||
|
# define LV_USE_GPU_NXP_PXP_AUTO_INIT CONFIG_LV_USE_GPU_NXP_PXP_AUTO_INIT
|
||||||
|
# else
|
||||||
|
# define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Use NXP's VG-Lite GPU iMX RTxxx platforms */
|
||||||
|
#ifndef LV_USE_GPU_NXP_VG_LITE
|
||||||
|
# ifdef CONFIG_LV_USE_GPU_NXP_VG_LITE
|
||||||
|
# define LV_USE_GPU_NXP_VG_LITE CONFIG_LV_USE_GPU_NXP_VG_LITE
|
||||||
|
# else
|
||||||
|
# define LV_USE_GPU_NXP_VG_LITE 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*-------------
|
/*-------------
|
||||||
* Logging
|
* Logging
|
||||||
*-----------*/
|
*-----------*/
|
||||||
@ -267,7 +324,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_LOG
|
# ifdef CONFIG_LV_USE_LOG
|
||||||
# define LV_USE_LOG CONFIG_LV_USE_LOG
|
# define LV_USE_LOG CONFIG_LV_USE_LOG
|
||||||
# else
|
# else
|
||||||
# define LV_USE_LOG 0
|
# define LV_USE_LOG 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#if LV_USE_LOG
|
#if LV_USE_LOG
|
||||||
@ -292,7 +349,7 @@
|
|||||||
# ifdef CONFIG_LV_LOG_PRINTF
|
# ifdef CONFIG_LV_LOG_PRINTF
|
||||||
# define LV_LOG_PRINTF CONFIG_LV_LOG_PRINTF
|
# define LV_LOG_PRINTF CONFIG_LV_LOG_PRINTF
|
||||||
# else
|
# else
|
||||||
# define LV_LOG_PRINTF 0
|
# define LV_LOG_PRINTF 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#endif /*LV_USE_LOG*/
|
#endif /*LV_USE_LOG*/
|
||||||
@ -303,15 +360,6 @@
|
|||||||
|
|
||||||
/* Enable asserts if an operation is failed or an invalid data is found.
|
/* Enable asserts if an operation is failed or an invalid data is found.
|
||||||
* If LV_USE_LOG is enabled an error message will be printed on failure*/
|
* If LV_USE_LOG is enabled an error message will be printed on failure*/
|
||||||
#ifndef LV_USE_ASSERT
|
|
||||||
# ifdef CONFIG_LV_USE_ASSERT
|
|
||||||
# define LV_USE_ASSERT CONFIG_LV_USE_ASSERT
|
|
||||||
# else
|
|
||||||
# define LV_USE_ASSERT 1
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#if LV_USE_ASSERT
|
|
||||||
|
|
||||||
#ifndef LV_USE_ASSERT_NULL
|
#ifndef LV_USE_ASSERT_NULL
|
||||||
# ifdef CONFIG_LV_USE_ASSERT_NULL
|
# ifdef CONFIG_LV_USE_ASSERT_NULL
|
||||||
# define LV_USE_ASSERT_NULL CONFIG_LV_USE_ASSERT_NULL
|
# define LV_USE_ASSERT_NULL CONFIG_LV_USE_ASSERT_NULL
|
||||||
@ -330,21 +378,21 @@
|
|||||||
# ifdef CONFIG_LV_USE_ASSERT_STYLE
|
# ifdef CONFIG_LV_USE_ASSERT_STYLE
|
||||||
# define LV_USE_ASSERT_STYLE CONFIG_LV_USE_ASSERT_STYLE
|
# define LV_USE_ASSERT_STYLE CONFIG_LV_USE_ASSERT_STYLE
|
||||||
# else
|
# else
|
||||||
# define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/
|
# define LV_USE_ASSERT_STYLE 1 /*Check if the styles are properly initialized. (Very fast, recommended)*/
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef LV_USE_ASSERT_MEM_INTEGRITY
|
#ifndef LV_USE_ASSERT_MEM_INTEGRITY
|
||||||
# ifdef CONFIG_LV_USE_ASSERT_MEM_INTEGRITY
|
# ifdef CONFIG_LV_USE_ASSERT_MEM_INTEGRITY
|
||||||
# define LV_USE_ASSERT_MEM_INTEGRITY CONFIG_LV_USE_ASSERT_MEM_INTEGRITY
|
# define LV_USE_ASSERT_MEM_INTEGRITY CONFIG_LV_USE_ASSERT_MEM_INTEGRITY
|
||||||
# else
|
# else
|
||||||
# define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
|
# define LV_USE_ASSERT_MEM_INTEGRITY 1 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef LV_USE_ASSERT_OBJ
|
#ifndef LV_USE_ASSERT_OBJ
|
||||||
# ifdef CONFIG_LV_USE_ASSERT_OBJ
|
# ifdef CONFIG_LV_USE_ASSERT_OBJ
|
||||||
# define LV_USE_ASSERT_OBJ CONFIG_LV_USE_ASSERT_OBJ
|
# define LV_USE_ASSERT_OBJ CONFIG_LV_USE_ASSERT_OBJ
|
||||||
# else
|
# else
|
||||||
# define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow) */
|
# define LV_USE_ASSERT_OBJ 1 /*Check the object's type and existence (e.g. not deleted). (Slow) */
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -364,12 +412,19 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /*LV_USE_ASSERT*/
|
|
||||||
|
|
||||||
/*-------------
|
/*-------------
|
||||||
* Others
|
* Others
|
||||||
*-----------*/
|
*-----------*/
|
||||||
|
|
||||||
|
/*1: Show CPU usage and FPS count in the right bottom corner*/
|
||||||
|
#ifndef LV_USE_PERF_MONITOR
|
||||||
|
# ifdef CONFIG_LV_USE_PERF_MONITOR
|
||||||
|
# define LV_USE_PERF_MONITOR CONFIG_LV_USE_PERF_MONITOR
|
||||||
|
# else
|
||||||
|
# define LV_USE_PERF_MONITOR 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*Change the built in (v)snprintf functions*/
|
/*Change the built in (v)snprintf functions*/
|
||||||
#ifndef LV_SPRINTF_CUSTOM
|
#ifndef LV_SPRINTF_CUSTOM
|
||||||
# ifdef CONFIG_LV_SPRINTF_CUSTOM
|
# ifdef CONFIG_LV_SPRINTF_CUSTOM
|
||||||
@ -779,15 +834,6 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*Always set a default font*/
|
|
||||||
#ifndef LV_FONT_DEFAULT
|
|
||||||
# ifdef CONFIG_LV_FONT_DEFAULT
|
|
||||||
# define LV_THEME_FONT_NORMAL CONFIG_LV_FONT_DEFAULT
|
|
||||||
# else
|
|
||||||
# define LV_THEME_FONT_NORMAL &lv_font_montserrat_14
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable handling large font and/or fonts with a lot of characters.
|
/* Enable handling large font and/or fonts with a lot of characters.
|
||||||
* The limit depends on the font size, font face and bpp.
|
* The limit depends on the font size, font face and bpp.
|
||||||
* Compiler error will be triggered if a font needs it.*/
|
* Compiler error will be triggered if a font needs it.*/
|
||||||
@ -804,7 +850,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_FONT_COMPRESSED
|
# ifdef CONFIG_LV_USE_FONT_COMPRESSED
|
||||||
# define LV_USE_FONT_COMPRESSED CONFIG_LV_USE_FONT_COMPRESSED
|
# define LV_USE_FONT_COMPRESSED CONFIG_LV_USE_FONT_COMPRESSED
|
||||||
# else
|
# else
|
||||||
# define LV_USE_FONT_COMPRESSED 1
|
# define LV_USE_FONT_COMPRESSED 0
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -813,7 +859,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_FONT_SUBPX
|
# ifdef CONFIG_LV_USE_FONT_SUBPX
|
||||||
# define LV_USE_FONT_SUBPX CONFIG_LV_USE_FONT_SUBPX
|
# define LV_USE_FONT_SUBPX CONFIG_LV_USE_FONT_SUBPX
|
||||||
# else
|
# else
|
||||||
# define LV_USE_FONT_SUBPX 1
|
# define LV_USE_FONT_SUBPX 0
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#if LV_USE_FONT_SUBPX
|
#if LV_USE_FONT_SUBPX
|
||||||
@ -899,7 +945,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_BIDI
|
# ifdef CONFIG_LV_USE_BIDI
|
||||||
# define LV_USE_BIDI CONFIG_LV_USE_BIDI
|
# define LV_USE_BIDI CONFIG_LV_USE_BIDI
|
||||||
# else
|
# else
|
||||||
# define LV_USE_BIDI 1
|
# define LV_USE_BIDI 0
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#if LV_USE_BIDI
|
#if LV_USE_BIDI
|
||||||
@ -927,6 +973,72 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*==================
|
||||||
|
* THEME USAGE
|
||||||
|
*================*/
|
||||||
|
/*Set the very basic the attributes*/
|
||||||
|
#ifndef LV_THEME_COLOR_PRIMARY
|
||||||
|
# ifdef CONFIG_LV_THEME_COLOR_PRIMARY
|
||||||
|
# define LV_THEME_COLOR_PRIMARY CONFIG_LV_THEME_COLOR_PRIMARY
|
||||||
|
# else
|
||||||
|
# define LV_THEME_COLOR_PRIMARY lv_color_hex(0x01a2b1)
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef LV_THEME_COLOR_SECONDARY
|
||||||
|
# ifdef CONFIG_LV_THEME_COLOR_SECONDARY
|
||||||
|
# define LV_THEME_COLOR_SECONDARY CONFIG_LV_THEME_COLOR_SECONDARY
|
||||||
|
# else
|
||||||
|
# define LV_THEME_COLOR_SECONDARY lv_color_hex(0x44d1b6)
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef LV_THEME_FONT_SMALL
|
||||||
|
# ifdef CONFIG_LV_THEME_FONT_SMALL
|
||||||
|
# define LV_THEME_FONT_SMALL CONFIG_LV_THEME_FONT_SMALL
|
||||||
|
# else
|
||||||
|
# define LV_THEME_FONT_SMALL &lv_font_montserrat_14
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef LV_THEME_FONT_NORMAL
|
||||||
|
# ifdef CONFIG_LV_THEME_FONT_NORMAL
|
||||||
|
# define LV_THEME_FONT_NORMAL CONFIG_LV_THEME_FONT_NORMAL
|
||||||
|
# else
|
||||||
|
# define LV_THEME_FONT_NORMAL &lv_font_montserrat_14
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef LV_THEME_FONT_LARGE
|
||||||
|
# ifdef CONFIG_LV_THEME_FONT_LARGE
|
||||||
|
# define LV_THEME_FONT_LARGE CONFIG_LV_THEME_FONT_LARGE
|
||||||
|
# else
|
||||||
|
# define LV_THEME_FONT_LARGE &lv_font_montserrat_14
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#ifndef LV_THEME_FONT_EXTRA_LARGE
|
||||||
|
# ifdef CONFIG_LV_THEME_FONT_EXTRA_LARGE
|
||||||
|
# define LV_THEME_FONT_EXTRA_LARGE CONFIG_LV_THEME_FONT_EXTRA_LARGE
|
||||||
|
# else
|
||||||
|
# define LV_THEME_FONT_EXTRA_LARGE &lv_font_montserrat_14
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* An external include file required to see the theme init function.
|
||||||
|
* Relative to "lv_core/lv_obj" */
|
||||||
|
#ifndef LV_THEME_INIT_INCLUDE
|
||||||
|
# ifdef CONFIG_LV_THEME_INIT_INCLUDE
|
||||||
|
# define LV_THEME_INIT_INCLUDE CONFIG_LV_THEME_INIT_INCLUDE
|
||||||
|
# else
|
||||||
|
# define LV_THEME_INIT_INCLUDE "../extra/themes/lv_themes.h"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Set a theme initialization function */
|
||||||
|
#ifndef LV_THEME_INIT
|
||||||
|
# ifdef CONFIG_LV_THEME_INIT
|
||||||
|
# define LV_THEME_INIT CONFIG_LV_THEME_INIT
|
||||||
|
# else
|
||||||
|
# define LV_THEME_INIT lv_theme_default_init
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*==================
|
/*==================
|
||||||
* WIDGET USAGE
|
* WIDGET USAGE
|
||||||
*================*/
|
*================*/
|
||||||
@ -1114,22 +1226,64 @@
|
|||||||
# ifdef CONFIG_LV_USE_CALENDAR
|
# ifdef CONFIG_LV_USE_CALENDAR
|
||||||
# define LV_USE_CALENDAR CONFIG_LV_USE_CALENDAR
|
# define LV_USE_CALENDAR CONFIG_LV_USE_CALENDAR
|
||||||
# else
|
# else
|
||||||
# define LV_USE_CALENDAR 0
|
# define LV_USE_CALENDAR 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
#if LV_USE_CALENDAR
|
||||||
|
#ifndef LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||||
|
# ifdef CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||||
|
# define LV_CALENDAR_WEEK_STARTS_MONDAY CONFIG_LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||||
|
# else
|
||||||
|
# define LV_CALENDAR_WEEK_STARTS_MONDAY 0
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
# if LV_CALENDAR_WEEK_STARTS_MONDAY
|
||||||
|
#ifndef LV_CALENDAR_DEFAULT_DAY_NAMES
|
||||||
|
# ifdef CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES
|
||||||
|
# define LV_CALENDAR_DEFAULT_DAY_NAMES CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES
|
||||||
|
# else
|
||||||
|
# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
# else
|
||||||
|
#ifndef LV_CALENDAR_DEFAULT_DAY_NAMES
|
||||||
|
# ifdef CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES
|
||||||
|
# define LV_CALENDAR_DEFAULT_DAY_NAMES CONFIG_LV_CALENDAR_DEFAULT_DAY_NAMES
|
||||||
|
# else
|
||||||
|
# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
# endif
|
||||||
|
|
||||||
|
#ifndef LV_CALENDAR_DEFAULT_MONTH_NAMES
|
||||||
|
# ifdef CONFIG_LV_CALENDAR_DEFAULT_MONTH_NAMES
|
||||||
|
# define LV_CALENDAR_DEFAULT_MONTH_NAMES CONFIG_LV_CALENDAR_DEFAULT_MONTH_NAMES
|
||||||
|
# else
|
||||||
|
# define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#ifndef LV_USE_CALENDAR_HEADER_ARROW
|
#ifndef LV_USE_CALENDAR_HEADER_ARROW
|
||||||
# ifdef CONFIG_LV_USE_CALENDAR_HEADER_ARROW
|
# ifdef CONFIG_LV_USE_CALENDAR_HEADER_ARROW
|
||||||
# define LV_USE_CALENDAR_HEADER_ARROW CONFIG_LV_USE_CALENDAR_HEADER_ARROW
|
# define LV_USE_CALENDAR_HEADER_ARROW CONFIG_LV_USE_CALENDAR_HEADER_ARROW
|
||||||
# else
|
# else
|
||||||
# define LV_USE_CALENDAR_HEADER_ARROW 0
|
# define LV_USE_CALENDAR_HEADER_ARROW 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif /*LV_USE_CALENDAR*/
|
||||||
|
|
||||||
#ifndef LV_USE_COLORWHEEL
|
#ifndef LV_USE_COLORWHEEL
|
||||||
# ifdef CONFIG_LV_USE_COLORWHEEL
|
# ifdef CONFIG_LV_USE_COLORWHEEL
|
||||||
# define LV_USE_COLORWHEEL CONFIG_LV_USE_COLORWHEEL
|
# define LV_USE_COLORWHEEL CONFIG_LV_USE_COLORWHEEL
|
||||||
# else
|
# else
|
||||||
# define LV_USE_COLORWHEEL 0
|
# define LV_USE_COLORWHEEL 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef LV_USE_IMGBTN
|
||||||
|
# ifdef CONFIG_LV_USE_IMGBTN
|
||||||
|
# define LV_USE_IMGBTN CONFIG_LV_USE_IMGBTN
|
||||||
|
# else
|
||||||
|
# define LV_USE_IMGBTN 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1137,7 +1291,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_KEYBOARD
|
# ifdef CONFIG_LV_USE_KEYBOARD
|
||||||
# define LV_USE_KEYBOARD CONFIG_LV_USE_KEYBOARD
|
# define LV_USE_KEYBOARD CONFIG_LV_USE_KEYBOARD
|
||||||
# else
|
# else
|
||||||
# define LV_USE_KEYBOARD 0
|
# define LV_USE_KEYBOARD 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1145,7 +1299,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_LED
|
# ifdef CONFIG_LV_USE_LED
|
||||||
# define LV_USE_LED CONFIG_LV_USE_LED
|
# define LV_USE_LED CONFIG_LV_USE_LED
|
||||||
# else
|
# else
|
||||||
# define LV_USE_LED 0
|
# define LV_USE_LED 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1153,7 +1307,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_LIST
|
# ifdef CONFIG_LV_USE_LIST
|
||||||
# define LV_USE_LIST CONFIG_LV_USE_LIST
|
# define LV_USE_LIST CONFIG_LV_USE_LIST
|
||||||
# else
|
# else
|
||||||
# define LV_USE_LIST 0
|
# define LV_USE_LIST 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1161,7 +1315,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_MSGBOX
|
# ifdef CONFIG_LV_USE_MSGBOX
|
||||||
# define LV_USE_MSGBOX CONFIG_LV_USE_MSGBOX
|
# define LV_USE_MSGBOX CONFIG_LV_USE_MSGBOX
|
||||||
# else
|
# else
|
||||||
# define LV_USE_MSGBOX 0
|
# define LV_USE_MSGBOX 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1169,7 +1323,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_SPINBOX
|
# ifdef CONFIG_LV_USE_SPINBOX
|
||||||
# define LV_USE_SPINBOX CONFIG_LV_USE_SPINBOX
|
# define LV_USE_SPINBOX CONFIG_LV_USE_SPINBOX
|
||||||
# else
|
# else
|
||||||
# define LV_USE_SPINBOX 0
|
# define LV_USE_SPINBOX 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1177,7 +1331,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_SPINNER
|
# ifdef CONFIG_LV_USE_SPINNER
|
||||||
# define LV_USE_SPINNER CONFIG_LV_USE_SPINNER
|
# define LV_USE_SPINNER CONFIG_LV_USE_SPINNER
|
||||||
# else
|
# else
|
||||||
# define LV_USE_SPINNER 0
|
# define LV_USE_SPINNER 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1185,7 +1339,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_TABVIEW
|
# ifdef CONFIG_LV_USE_TABVIEW
|
||||||
# define LV_USE_TABVIEW CONFIG_LV_USE_TABVIEW
|
# define LV_USE_TABVIEW CONFIG_LV_USE_TABVIEW
|
||||||
# else
|
# else
|
||||||
# define LV_USE_TABVIEW 0
|
# define LV_USE_TABVIEW 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1193,7 +1347,7 @@
|
|||||||
# ifdef CONFIG_LV_USE_TILEVIEW
|
# ifdef CONFIG_LV_USE_TILEVIEW
|
||||||
# define LV_USE_TILEVIEW CONFIG_LV_USE_TILEVIEW
|
# define LV_USE_TILEVIEW CONFIG_LV_USE_TILEVIEW
|
||||||
# else
|
# else
|
||||||
# define LV_USE_TILEVIEW 0
|
# define LV_USE_TILEVIEW 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1201,14 +1355,14 @@
|
|||||||
# ifdef CONFIG_LV_USE_WIN
|
# ifdef CONFIG_LV_USE_WIN
|
||||||
# define LV_USE_WIN CONFIG_LV_USE_WIN
|
# define LV_USE_WIN CONFIG_LV_USE_WIN
|
||||||
# else
|
# else
|
||||||
# define LV_USE_WIN 0
|
# define LV_USE_WIN 1
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*-----------
|
/*-----------
|
||||||
* Themes
|
* Themes
|
||||||
*----------*/
|
*----------*/
|
||||||
/* Use the default theme. If not used a custom theme needs be assigned to the display.*/
|
/* A simple, impressive and very complete theme */
|
||||||
#ifndef LV_USE_THEME_DEFAULT
|
#ifndef LV_USE_THEME_DEFAULT
|
||||||
# ifdef CONFIG_LV_USE_THEME_DEFAULT
|
# ifdef CONFIG_LV_USE_THEME_DEFAULT
|
||||||
# define LV_USE_THEME_DEFAULT CONFIG_LV_USE_THEME_DEFAULT
|
# define LV_USE_THEME_DEFAULT CONFIG_LV_USE_THEME_DEFAULT
|
||||||
@ -1267,52 +1421,20 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*==================
|
|
||||||
* Non-user section
|
|
||||||
*==================*/
|
|
||||||
|
|
||||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
|
|
||||||
#ifndef _CRT_SECURE_NO_WARNINGS
|
|
||||||
# ifdef CONFIG__CRT_SECURE_NO_WARNINGS
|
|
||||||
# define _CRT_SECURE_NO_WARNINGS CONFIG__CRT_SECURE_NO_WARNINGS
|
|
||||||
# else
|
|
||||||
# define _CRT_SECURE_NO_WARNINGS
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*If running without lv_conf.h add typdesf with default value*/
|
/*If running without lv_conf.h add typdesf with default value*/
|
||||||
#if defined(LV_CONF_SKIP)
|
#if defined(LV_CONF_SKIP)
|
||||||
|
|
||||||
/* Type of coordinates. Should be `int16_t` (or `int32_t` for extreme cases) */
|
|
||||||
typedef int16_t lv_coord_t;
|
|
||||||
|
|
||||||
# if LV_USE_ANIMATION
|
|
||||||
/*Declare the type of the user data of animations (can be e.g. `void *`, `int`, `struct`)*/
|
|
||||||
typedef void * lv_anim_user_data_t;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if LV_USE_GROUP
|
|
||||||
typedef void * lv_group_user_data_t;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# if LV_USE_FILESYSTEM
|
|
||||||
typedef void * lv_fs_drv_user_data_t;
|
|
||||||
# endif
|
|
||||||
|
|
||||||
typedef void * lv_img_decoder_user_data_t;
|
|
||||||
|
|
||||||
typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/
|
|
||||||
typedef void * lv_indev_drv_user_data_t; /*Type of user data in the input device driver*/
|
|
||||||
|
|
||||||
typedef void * lv_font_user_data_t;
|
|
||||||
|
|
||||||
# if LV_USE_USER_DATA
|
# if LV_USE_USER_DATA
|
||||||
typedef void * lv_obj_user_data_t;
|
typedef void * lv_obj_user_data_t;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_WARNINGS) /* Disable warnings for Visual Studio*/
|
||||||
|
# define _CRT_SECURE_NO_WARNINGS
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
#endif /*defined(LV_CONF_SKIP)*/
|
||||||
|
|
||||||
#endif /*LV_CONF_INTERNAL_H*/
|
#endif /*LV_CONF_INTERNAL_H*/
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
CSRCS += lv_grid.c
|
CSRCS += lv_disp.c
|
||||||
CSRCS += lv_group.c
|
CSRCS += lv_group.c
|
||||||
CSRCS += lv_indev.c
|
CSRCS += lv_indev.c
|
||||||
CSRCS += lv_indev_scroll.c
|
CSRCS += lv_indev_scroll.c
|
||||||
CSRCS += lv_disp.c
|
|
||||||
CSRCS += lv_obj.c
|
CSRCS += lv_obj.c
|
||||||
|
CSRCS += lv_obj_class.c
|
||||||
CSRCS += lv_obj_pos.c
|
CSRCS += lv_obj_pos.c
|
||||||
CSRCS += lv_obj_style.c
|
|
||||||
CSRCS += lv_obj_draw.c
|
CSRCS += lv_obj_draw.c
|
||||||
CSRCS += lv_obj_scroll.c
|
CSRCS += lv_obj_scroll.c
|
||||||
|
CSRCS += lv_obj_style.c
|
||||||
|
CSRCS += lv_obj_tree.c
|
||||||
CSRCS += lv_refr.c
|
CSRCS += lv_refr.c
|
||||||
CSRCS += lv_style.c
|
CSRCS += lv_theme.c
|
||||||
CSRCS += lv_flex.c
|
|
||||||
|
|
||||||
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_core
|
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_core
|
||||||
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_core
|
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_core
|
||||||
|
@ -218,8 +218,8 @@ void lv_scr_load_anim(lv_obj_t * new_scr, lv_scr_load_anim_t anim_type, uint32_t
|
|||||||
/*Be sure both screens are in a normal position*/
|
/*Be sure both screens are in a normal position*/
|
||||||
lv_obj_set_pos(new_scr, 0, 0);
|
lv_obj_set_pos(new_scr, 0, 0);
|
||||||
lv_obj_set_pos(lv_scr_act(), 0, 0);
|
lv_obj_set_pos(lv_scr_act(), 0, 0);
|
||||||
// lv_style_remove_prop(lv_obj_get_local_style(new_scr, LV_PART_MAIN, LV_STATE_DEFAULT), LV_STYLE_OPA);
|
lv_obj_remove_local_style_prop(new_scr, LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_OPA);
|
||||||
// lv_style_remove_prop(lv_obj_get_local_style(lv_scr_act(), LV_PART_MAIN, LV_STATE_DEFAULT), LV_STYLE_OPA);
|
lv_obj_remove_local_style_prop(lv_scr_act(), LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_OPA);
|
||||||
|
|
||||||
lv_anim_t a_new;
|
lv_anim_t a_new;
|
||||||
lv_anim_init(&a_new);
|
lv_anim_init(&a_new);
|
||||||
@ -379,7 +379,7 @@ static void scr_load_anim_start(lv_anim_t * a)
|
|||||||
|
|
||||||
static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v)
|
static void opa_scale_anim(lv_obj_t * obj, lv_anim_value_t v)
|
||||||
{
|
{
|
||||||
// lv_obj_set_style_bg_color(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v);
|
lv_obj_set_style_opa(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scr_anim_ready(lv_anim_t * a)
|
static void scr_anim_ready(lv_anim_t * a)
|
||||||
@ -389,5 +389,5 @@ static void scr_anim_ready(lv_anim_t * a)
|
|||||||
if(d->prev_scr && d->del_prev) lv_obj_del(d->prev_scr);
|
if(d->prev_scr && d->del_prev) lv_obj_del(d->prev_scr);
|
||||||
d->prev_scr = NULL;
|
d->prev_scr = NULL;
|
||||||
d->scr_to_load = NULL;
|
d->scr_to_load = NULL;
|
||||||
// lv_style_remove_prop(lv_obj_get_local_style(a->var, LV_PART_MAIN, LV_STATE_DEFAULT), LV_STYLE_OPA);
|
lv_obj_remove_local_style_prop(a->var, LV_PART_MAIN, LV_STATE_DEFAULT, LV_STYLE_OPA);
|
||||||
}
|
}
|
||||||
|
@ -29,12 +29,6 @@
|
|||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
/**********************
|
|
||||||
* GLOBAL PROTOTYPES
|
|
||||||
**********************/
|
|
||||||
void lv_indev_scroll_handler(lv_indev_proc_t * proc);
|
|
||||||
void lv_indev_scroll_throw_handler(lv_indev_proc_t * proc);
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC PROTOTYPES
|
* STATIC PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
@ -769,7 +763,7 @@ static void indev_proc_press(lv_indev_proc_t * proc)
|
|||||||
if(new_obj_searched && proc->types.pointer.last_obj) {
|
if(new_obj_searched && proc->types.pointer.last_obj) {
|
||||||
proc->types.pointer.scroll_throw_vect.x = 0;
|
proc->types.pointer.scroll_throw_vect.x = 0;
|
||||||
proc->types.pointer.scroll_throw_vect.y = 0;
|
proc->types.pointer.scroll_throw_vect.y = 0;
|
||||||
lv_indev_scroll_throw_handler(proc);
|
_lv_indev_scroll_throw_handler(proc);
|
||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -841,7 +835,7 @@ static void indev_proc_press(lv_indev_proc_t * proc)
|
|||||||
|
|
||||||
if(indev_act->proc.wait_until_release) return;
|
if(indev_act->proc.wait_until_release) return;
|
||||||
|
|
||||||
lv_indev_scroll_handler(proc);
|
_lv_indev_scroll_handler(proc);
|
||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
indev_gesture(proc);
|
indev_gesture(proc);
|
||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
@ -923,7 +917,7 @@ static void indev_proc_release(lv_indev_proc_t * proc)
|
|||||||
/*The reset can be set in the signal function.
|
/*The reset can be set in the signal function.
|
||||||
* In case of reset query ignore the remaining parts.*/
|
* In case of reset query ignore the remaining parts.*/
|
||||||
if(scroll_obj) {
|
if(scroll_obj) {
|
||||||
lv_indev_scroll_throw_handler(proc);
|
_lv_indev_scroll_throw_handler(proc);
|
||||||
if(indev_reset_check(proc)) return;
|
if(indev_reset_check(proc)) return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,11 +42,7 @@ static lv_coord_t elastic_diff(lv_obj_t * obj, lv_coord_t diff, lv_coord_t scrol
|
|||||||
* GLOBAL FUNCTIONS
|
* GLOBAL FUNCTIONS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
/**
|
void _lv_indev_scroll_handler(lv_indev_proc_t * proc)
|
||||||
* Handle scrolling. Called by LVGL during input device processing
|
|
||||||
* @param proc pointer to an input device's proc field
|
|
||||||
*/
|
|
||||||
void lv_indev_scroll_handler(lv_indev_proc_t * proc)
|
|
||||||
{
|
{
|
||||||
lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj;
|
lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj;
|
||||||
/*If there is no scroll object yet try to find one*/
|
/*If there is no scroll object yet try to find one*/
|
||||||
@ -97,11 +93,7 @@ void lv_indev_scroll_handler(lv_indev_proc_t * proc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
void _lv_indev_scroll_throw_handler(lv_indev_proc_t * proc)
|
||||||
* Handle throwing after scrolling. Called by LVGL during input device processing
|
|
||||||
* @param proc pointer to an input device's proc field
|
|
||||||
*/
|
|
||||||
void lv_indev_scroll_throw_handler(lv_indev_proc_t * proc)
|
|
||||||
{
|
{
|
||||||
lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj;
|
lv_obj_t * scroll_obj = proc->types.pointer.scroll_obj;
|
||||||
if(scroll_obj == NULL) return;
|
if(scroll_obj == NULL) return;
|
||||||
|
@ -27,6 +27,18 @@ extern "C" {
|
|||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle scrolling. Called by LVGL during input device processing
|
||||||
|
* @param proc pointer to an input device's proc field
|
||||||
|
*/
|
||||||
|
void _lv_indev_scroll_handler(lv_indev_proc_t * proc);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle throwing after scrolling. Called by LVGL during input device processing
|
||||||
|
* @param proc pointer to an input device's proc field
|
||||||
|
*/
|
||||||
|
void _lv_indev_scroll_throw_handler(lv_indev_proc_t * proc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Predict where would a scroll throw end
|
* Predict where would a scroll throw end
|
||||||
* @param indev pointer to an input device
|
* @param indev pointer to an input device
|
||||||
|
@ -59,13 +59,6 @@ typedef struct {
|
|||||||
const lv_anim_path_t * path;
|
const lv_anim_path_t * path;
|
||||||
}trans_set_t;
|
}trans_set_t;
|
||||||
|
|
||||||
/**********************
|
|
||||||
* GLOBAL PROTOTYPES
|
|
||||||
**********************/
|
|
||||||
void lv_obj_style_create_transition(lv_obj_t * obj, lv_style_prop_t prop, uint8_t part, lv_state_t prev_state,
|
|
||||||
lv_state_t new_state, uint32_t time, uint32_t delay, const lv_anim_path_t * path);
|
|
||||||
_lv_style_state_cmp_t lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state1, lv_state_t state2);
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* STATIC PROTOTYPES
|
* STATIC PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
@ -132,7 +125,9 @@ void lv_init(void)
|
|||||||
_lv_ll_init(&LV_GC_ROOT(_lv_disp_ll), sizeof(lv_disp_t));
|
_lv_ll_init(&LV_GC_ROOT(_lv_disp_ll), sizeof(lv_disp_t));
|
||||||
_lv_ll_init(&LV_GC_ROOT(_lv_indev_ll), sizeof(lv_indev_t));
|
_lv_ll_init(&LV_GC_ROOT(_lv_indev_ll), sizeof(lv_indev_t));
|
||||||
|
|
||||||
lv_theme_t * th = LV_THEME_INIT
|
lv_theme_t * th = LV_THEME_INIT(LV_THEME_COLOR_PRIMARY, LV_THEME_COLOR_SECONDARY,
|
||||||
|
LV_THEME_FONT_SMALL, LV_THEME_FONT_NORMAL,
|
||||||
|
LV_THEME_FONT_LARGE, LV_THEME_FONT_EXTRA_LARGE);
|
||||||
|
|
||||||
lv_theme_set_act(th);
|
lv_theme_set_act(th);
|
||||||
|
|
||||||
@ -151,6 +146,15 @@ void lv_init(void)
|
|||||||
LV_LOG_WARN("The strings has no UTF-8 encoding. Some characters won't be displayed.")
|
LV_LOG_WARN("The strings has no UTF-8 encoding. Some characters won't be displayed.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if LV_USE_ASSERT_MEM_INTEGRITY
|
||||||
|
LV_LOG_WARN("Memory integrity checks are enabled via LV_USE_ASSERT_MEM_INTEGRITY which makes LVGL much slower")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if LV_USE_ASSERT_OBJ
|
||||||
|
LV_LOG_WARN("Object sanity checks are enabled via LV_USE_ASSERT_OBJ which makes LVGL much slower")
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
lv_initialized = true;
|
lv_initialized = true;
|
||||||
LV_LOG_INFO("lv_init ready");
|
LV_LOG_INFO("lv_init ready");
|
||||||
}
|
}
|
||||||
@ -248,7 +252,7 @@ lv_res_t lv_event_send(lv_obj_t * obj, lv_event_t event, void * param)
|
|||||||
|
|
||||||
if(res == LV_RES_OK) {
|
if(res == LV_RES_OK) {
|
||||||
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_EVENT_BUBBLE) && obj->parent) {
|
if(lv_obj_has_flag(obj, LV_OBJ_FLAG_EVENT_BUBBLE) && obj->parent) {
|
||||||
lv_res_t res = lv_event_send(obj->parent, event, param);
|
res = lv_event_send(obj->parent, event, param);
|
||||||
if(res != LV_RES_OK) return LV_RES_INV;
|
if(res != LV_RES_OK) return LV_RES_INV;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -273,12 +277,7 @@ uint32_t lv_event_register_id(void)
|
|||||||
return last_id;
|
return last_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
void _lv_event_mark_deleted(lv_obj_t * obj)
|
||||||
* Nested events can be called and one of them might belong to an object that is being deleted.
|
|
||||||
* Mark this object's `event_temp_data` deleted to know that it's `lv_event_send` should return `LV_RES_INV`
|
|
||||||
* @param obj pointer to an obejct to mark as deleted
|
|
||||||
*/
|
|
||||||
void lv_event_mark_deleted(lv_obj_t * obj)
|
|
||||||
{
|
{
|
||||||
lv_event_temp_data_t * t = event_temp_data_head;
|
lv_event_temp_data_t * t = event_temp_data_head;
|
||||||
|
|
||||||
@ -342,7 +341,7 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
|||||||
lv_state_t prev_state = obj->state;
|
lv_state_t prev_state = obj->state;
|
||||||
obj->state = new_state;
|
obj->state = new_state;
|
||||||
|
|
||||||
_lv_style_state_cmp_t cmp_res = lv_obj_style_state_compare(obj, prev_state, new_state);
|
_lv_style_state_cmp_t cmp_res = _lv_obj_style_state_compare(obj, prev_state, new_state);
|
||||||
/*If there is no difference in styles there is nothing else to do*/
|
/*If there is no difference in styles there is nothing else to do*/
|
||||||
if(cmp_res == _LV_STYLE_STATE_CMP_SAME) return;
|
if(cmp_res == _LV_STYLE_STATE_CMP_SAME) return;
|
||||||
|
|
||||||
@ -381,7 +380,7 @@ void lv_obj_set_state(lv_obj_t * obj, lv_state_t new_state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for(i = 0;i < tsi; i++) {
|
for(i = 0;i < tsi; i++) {
|
||||||
lv_obj_style_create_transition(obj, ts[i].prop, ts[i].part, prev_state, new_state, ts[i].time, ts[i].delay, ts[i].path);
|
_lv_obj_style_create_transition(obj, ts[i].prop, ts[i].part, prev_state, new_state, ts[i].time, ts[i].delay, ts[i].path);
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_mem_buf_release(ts);
|
lv_mem_buf_release(ts);
|
||||||
|
@ -343,6 +343,13 @@ void * lv_event_get_user_data(void);
|
|||||||
*/
|
*/
|
||||||
uint32_t lv_event_register_id(void);
|
uint32_t lv_event_register_id(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Nested events can be called and one of them might belong to an object that is being deleted.
|
||||||
|
* Mark this object's `event_temp_data` deleted to know that it's `lv_event_send` should return `LV_RES_INV`
|
||||||
|
* @param obj pointer to an obejct to mark as deleted
|
||||||
|
*/
|
||||||
|
void _lv_event_mark_deleted(lv_obj_t * obj);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send an event to the object
|
* Send an event to the object
|
||||||
* @param obj pointer to an object
|
* @param obj pointer to an object
|
||||||
@ -506,7 +513,7 @@ bool lv_obj_is_valid(const lv_obj_t * obj);
|
|||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
#if LV_USE_ASSERT && LV_USE_ASSERT_OBJ
|
#if LV_USE_ASSERT_OBJ
|
||||||
# define LV_ASSERT_OBJ(obj_p, obj_class) \
|
# define LV_ASSERT_OBJ(obj_p, obj_class) \
|
||||||
LV_ASSERT_MSG(obj_p != NULL, "The object is NULL"); \
|
LV_ASSERT_MSG(obj_p != NULL, "The object is NULL"); \
|
||||||
LV_ASSERT_MSG(lv_obj_has_class(obj_p, obj_class) == true, "Incompatible object type."); \
|
LV_ASSERT_MSG(lv_obj_has_class(obj_p, obj_class) == true, "Incompatible object type."); \
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include "lv_obj.h"
|
#include "lv_obj.h"
|
||||||
|
#include "lv_theme.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
@ -70,7 +71,7 @@ lv_obj_t * lv_obj_create_from_class(const lv_obj_class_t * class_p, lv_obj_t * p
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_obj_destruct(lv_obj_t * obj)
|
void _lv_obj_destruct(lv_obj_t * obj)
|
||||||
{
|
{
|
||||||
if(obj->class_p->destructor_cb) obj->class_p->destructor_cb(obj);
|
if(obj->class_p->destructor_cb) obj->class_p->destructor_cb(obj);
|
||||||
|
|
||||||
@ -79,7 +80,7 @@ void lv_obj_destruct(lv_obj_t * obj)
|
|||||||
obj->class_p = obj->class_p->base_class;
|
obj->class_p = obj->class_p->base_class;
|
||||||
|
|
||||||
/*Call the base class's destructor too*/
|
/*Call the base class's destructor too*/
|
||||||
lv_obj_destruct(obj);
|
_lv_obj_destruct(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ typedef struct _lv_obj_class_t{
|
|||||||
*/
|
*/
|
||||||
struct _lv_obj_t * lv_obj_create_from_class(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * parent, const struct _lv_obj_t * copy);
|
struct _lv_obj_t * lv_obj_create_from_class(const struct _lv_obj_class_t * class_p, struct _lv_obj_t * parent, const struct _lv_obj_t * copy);
|
||||||
|
|
||||||
|
void _lv_obj_destruct(struct _lv_obj_t * obj);
|
||||||
|
|
||||||
lv_res_t lv_obj_signal_base(const lv_obj_class_t * class_p, struct _lv_obj_t * obj, lv_signal_t sign, void * param);
|
lv_res_t lv_obj_signal_base(const lv_obj_class_t * class_p, struct _lv_obj_t * obj, lv_signal_t sign, void * param);
|
||||||
|
|
||||||
lv_draw_res_t lv_obj_draw_base(const lv_obj_class_t * class_p, struct _lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode);
|
lv_draw_res_t lv_obj_draw_base(const lv_obj_class_t * class_p, struct _lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode);
|
||||||
|
@ -174,8 +174,8 @@ void lv_obj_init_draw_rect_dsc(lv_obj_t * obj, uint8_t part, lv_draw_rect_dsc_t
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(draw_dsc->bg_img_opa != LV_OPA_TRANSP) {
|
if(draw_dsc->bg_img_opa != LV_OPA_TRANSP) {
|
||||||
draw_dsc->img_src = lv_obj_get_style_bg_img_src(obj, part);
|
draw_dsc->bg_img_src = lv_obj_get_style_bg_img_src(obj, part);
|
||||||
if(draw_dsc->img_src) {
|
if(draw_dsc->bg_img_src) {
|
||||||
draw_dsc->bg_img_opa = lv_obj_get_style_bg_img_opa(obj, part);
|
draw_dsc->bg_img_opa = lv_obj_get_style_bg_img_opa(obj, part);
|
||||||
if(draw_dsc->bg_img_opa > LV_OPA_MIN) {
|
if(draw_dsc->bg_img_opa > LV_OPA_MIN) {
|
||||||
draw_dsc->bg_img_tiled = lv_obj_get_style_bg_img_tiled(obj, part);
|
draw_dsc->bg_img_tiled = lv_obj_get_style_bg_img_tiled(obj, part);
|
||||||
|
@ -380,7 +380,7 @@ void lv_obj_scroll_to_view_recursive(lv_obj_t * obj, lv_anim_enable_t anim_en)
|
|||||||
{
|
{
|
||||||
lv_obj_t * parent = lv_obj_get_parent(obj);
|
lv_obj_t * parent = lv_obj_get_parent(obj);
|
||||||
while(parent) {
|
while(parent) {
|
||||||
lv_obj_scroll_to_view(obj, LV_ANIM_ON);
|
lv_obj_scroll_to_view(obj, anim_en);
|
||||||
obj = parent;
|
obj = parent;
|
||||||
parent = lv_obj_get_parent(parent);
|
parent = lv_obj_get_parent(parent);
|
||||||
}
|
}
|
||||||
|
@ -136,7 +136,7 @@ void lv_obj_remove_style(lv_obj_t * obj, uint32_t part, uint32_t state, lv_style
|
|||||||
|
|
||||||
/*Shift the styles after `i` by one*/
|
/*Shift the styles after `i` by one*/
|
||||||
uint32_t j;
|
uint32_t j;
|
||||||
for(j = i; j < obj->style_list.style_cnt - 1 ; j++) {
|
for(j = i; j < (uint32_t)obj->style_list.style_cnt - 1 ; j++) {
|
||||||
obj->style_list.styles[j] = obj->style_list.styles[j + 1];
|
obj->style_list.styles[j] = obj->style_list.styles[j + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -250,7 +250,7 @@ bool lv_obj_remove_local_style_prop(lv_obj_t * obj, uint32_t part, uint32_t stat
|
|||||||
return lv_style_remove_prop(obj->style_list.styles[i].style, prop);
|
return lv_style_remove_prop(obj->style_list.styles[i].style, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lv_obj_style_create_transition(lv_obj_t * obj, lv_style_prop_t prop, uint8_t part, lv_state_t prev_state,
|
void _lv_obj_style_create_transition(lv_obj_t * obj, lv_style_prop_t prop, uint8_t part, lv_state_t prev_state,
|
||||||
lv_state_t new_state, uint32_t time, uint32_t delay, const lv_anim_path_t * path)
|
lv_state_t new_state, uint32_t time, uint32_t delay, const lv_anim_path_t * path)
|
||||||
{
|
{
|
||||||
trans_t * tr;
|
trans_t * tr;
|
||||||
@ -306,7 +306,7 @@ void lv_obj_style_create_transition(lv_obj_t * obj, lv_style_prop_t prop, uint8_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_lv_style_state_cmp_t lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state1, lv_state_t state2)
|
_lv_style_state_cmp_t _lv_obj_style_state_compare(lv_obj_t * obj, lv_state_t state1, lv_state_t state2)
|
||||||
{
|
{
|
||||||
lv_obj_style_list_t * list = &obj->style_list;
|
lv_obj_style_list_t * list = &obj->style_list;
|
||||||
_lv_style_state_cmp_t res = _LV_STYLE_STATE_CMP_SAME;
|
_lv_style_state_cmp_t res = _LV_STYLE_STATE_CMP_SAME;
|
||||||
@ -971,12 +971,12 @@ static void trans_anim_ready_cb(lv_anim_t * a)
|
|||||||
|
|
||||||
static void fade_anim_cb(lv_obj_t * obj, lv_anim_value_t v)
|
static void fade_anim_cb(lv_obj_t * obj, lv_anim_value_t v)
|
||||||
{
|
{
|
||||||
// lv_obj_style_set_local_opa_scale(obj, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, v);
|
lv_obj_set_style_opa(obj, LV_PART_MAIN, LV_STATE_DEFAULT, v);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fade_in_anim_ready(lv_anim_t * a)
|
static void fade_in_anim_ready(lv_anim_t * a)
|
||||||
{
|
{
|
||||||
// lv_style_remove_prop(_lv_obj_get_local_style(a->var, LV_OBJ_PART_MAIN), LV_STYLE_OPA_SCALE);
|
lv_obj_remove_local_style_prop(a->var, LV_PART_MAIN,LV_STATE_DEFAULT, LV_STYLE_OPA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -157,6 +157,45 @@ void lv_obj_set_local_style_prop(struct _lv_obj_t * obj, uint32_t part, uint32_t
|
|||||||
*/
|
*/
|
||||||
bool lv_obj_remove_local_style_prop(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_prop_t prop);
|
bool lv_obj_remove_local_style_prop(struct _lv_obj_t * obj, uint32_t part, uint32_t state, lv_style_prop_t prop);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used internally to create a style tarnsition
|
||||||
|
* @param obj
|
||||||
|
* @param prop
|
||||||
|
* @param part
|
||||||
|
* @param prev_state
|
||||||
|
* @param new_state
|
||||||
|
* @param time
|
||||||
|
* @param delay
|
||||||
|
* @param path
|
||||||
|
*/
|
||||||
|
void _lv_obj_style_create_transition(struct _lv_obj_t * obj, lv_style_prop_t prop, uint8_t part, lv_state_t prev_state,
|
||||||
|
lv_state_t new_state, uint32_t time, uint32_t delay, const lv_anim_path_t * path);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used internally to compare the appearance of an object in 2 states
|
||||||
|
* @param obj
|
||||||
|
* @param state1
|
||||||
|
* @param state2
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
_lv_style_state_cmp_t _lv_obj_style_state_compare(struct _lv_obj_t * obj, lv_state_t state1, lv_state_t state2);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fade in an an object and all its children.
|
||||||
|
* @param obj the object to fade in
|
||||||
|
* @param time time of fade
|
||||||
|
* @param delay delay to start the animation
|
||||||
|
*/
|
||||||
|
void lv_obj_fade_in(struct _lv_obj_t * obj, uint32_t time, uint32_t delay);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fade out an an object and all its children.
|
||||||
|
* @param obj the object to fade out
|
||||||
|
* @param time time of fade
|
||||||
|
* @param delay delay to start the animation
|
||||||
|
*/
|
||||||
|
void lv_obj_fade_out(struct _lv_obj_t * obj, uint32_t time, uint32_t delay);
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* OBJ STYLE GET
|
* OBJ STYLE GET
|
||||||
*********************/
|
*********************/
|
||||||
|
@ -25,10 +25,6 @@
|
|||||||
* TYPEDEFS
|
* TYPEDEFS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
/**********************
|
|
||||||
* GLOBAL PROTOTYPES
|
|
||||||
**********************/
|
|
||||||
void lv_event_mark_deleted(lv_obj_t * obj);
|
|
||||||
void lv_obj_destruct(lv_obj_t * obj);
|
void lv_obj_destruct(lv_obj_t * obj);
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
@ -269,12 +265,16 @@ lv_obj_t * lv_obj_get_child(const lv_obj_t * obj, int32_t id)
|
|||||||
|
|
||||||
if(obj->spec_attr == NULL) return NULL;
|
if(obj->spec_attr == NULL) return NULL;
|
||||||
|
|
||||||
|
uint32_t idu;
|
||||||
if(id < 0) {
|
if(id < 0) {
|
||||||
id = obj->spec_attr->child_cnt + id;
|
id = obj->spec_attr->child_cnt + id;
|
||||||
if(id < 0) return NULL;
|
if(id < 0) return NULL;
|
||||||
|
idu = (uint32_t) id;
|
||||||
|
} else {
|
||||||
|
idu = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(id >= obj->spec_attr->child_cnt) return NULL;
|
if(idu >= obj->spec_attr->child_cnt) return NULL;
|
||||||
else return obj->spec_attr->children[id];
|
else return obj->spec_attr->children[id];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,7 +331,7 @@ static void obj_del_core(lv_obj_t * obj)
|
|||||||
child = lv_obj_get_child(obj, 0);
|
child = lv_obj_get_child(obj, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
lv_event_mark_deleted(obj);
|
_lv_event_mark_deleted(obj);
|
||||||
|
|
||||||
/*Remove all style*/
|
/*Remove all style*/
|
||||||
lv_obj_enable_style_refresh(false); /*No need to refresh the style because the object will be deleted*/
|
lv_obj_enable_style_refresh(false); /*No need to refresh the style because the object will be deleted*/
|
||||||
@ -355,7 +355,7 @@ static void obj_del_core(lv_obj_t * obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* All children deleted. Now clean up the object specific data*/
|
/* All children deleted. Now clean up the object specific data*/
|
||||||
lv_obj_destruct(obj);
|
_lv_obj_destruct(obj);
|
||||||
|
|
||||||
/*Remove the object from the child list of its parent*/
|
/*Remove the object from the child list of its parent*/
|
||||||
uint32_t id = lv_obj_get_child_id(obj);
|
uint32_t id = lv_obj_get_child_id(obj);
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
#include "lv_draw_mask.h"
|
#include "lv_draw_mask.h"
|
||||||
#include "../lv_misc/lv_math.h"
|
#include "../lv_misc/lv_math.h"
|
||||||
#include "../lv_misc/lv_log.h"
|
#include "../lv_misc/lv_log.h"
|
||||||
|
#include "../lv_misc/lv_mem.h"
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
* DEFINES
|
* DEFINES
|
||||||
|
@ -299,9 +299,7 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
|||||||
const lv_opa_t * mask, lv_draw_mask_res_t mask_res)
|
const lv_opa_t * mask, lv_draw_mask_res_t mask_res)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if LV_USE_GPU || LV_COLOR_SCREEN_TRANSP
|
|
||||||
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
lv_disp_t * disp = _lv_refr_get_disp_refreshing();
|
||||||
#endif
|
|
||||||
|
|
||||||
/*Get the width of the `disp_area` it will be used to go to the next line*/
|
/*Get the width of the `disp_area` it will be used to go to the next line*/
|
||||||
int32_t disp_w = lv_area_get_width(disp_area);
|
int32_t disp_w = lv_area_get_width(disp_area);
|
||||||
@ -335,12 +333,13 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
|||||||
lv_gpu_stm32_dma2d_fill(disp_buf_first, disp_w, color, draw_area_w, draw_area_h);
|
lv_gpu_stm32_dma2d_fill(disp_buf_first, disp_w, color, draw_area_w, draw_area_h);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#elif LV_USE_GPU
|
#endif
|
||||||
|
|
||||||
if(disp->driver.gpu_fill_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) {
|
if(disp->driver.gpu_fill_cb && lv_area_get_size(draw_area) > GPU_SIZE_LIMIT) {
|
||||||
disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color);
|
disp->driver.gpu_fill_cb(&disp->driver, disp_buf, disp_w, draw_area, color);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
/*Software rendering*/
|
/*Software rendering*/
|
||||||
for(y = 0; y < draw_area_h; y++) {
|
for(y = 0; y < draw_area_h; y++) {
|
||||||
lv_color_fill(disp_buf_first, color, draw_area_w);
|
lv_color_fill(disp_buf_first, color, draw_area_w);
|
||||||
@ -393,14 +392,6 @@ LV_ATTRIBUTE_FAST_MEM static void fill_normal(const lv_area_t * disp_area, lv_co
|
|||||||
}
|
}
|
||||||
/*Masked*/
|
/*Masked*/
|
||||||
else {
|
else {
|
||||||
/*DMA2D could be used here but it's much slower than software rendering*/
|
|
||||||
#if LV_USE_GPU_STM32_DMA2D && 0
|
|
||||||
if(lv_area_get_size(draw_area) > 240) {
|
|
||||||
lv_gpu_stm32_dma2d_fill_mask(disp_buf_first, disp_w, color, mask, opa, draw_area_w, draw_area_h);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*Buffer the result color to avoid recalculating the same color*/
|
/*Buffer the result color to avoid recalculating the same color*/
|
||||||
lv_color_t last_dest_color;
|
lv_color_t last_dest_color;
|
||||||
lv_color_t last_res_color;
|
lv_color_t last_res_color;
|
||||||
@ -693,17 +684,6 @@ LV_ATTRIBUTE_FAST_MEM static void map_normal(const lv_area_t * disp_area, lv_col
|
|||||||
|
|
||||||
/*Simple fill (maybe with opacity), no masking*/
|
/*Simple fill (maybe with opacity), no masking*/
|
||||||
if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) {
|
if(mask_res == LV_DRAW_MASK_RES_FULL_COVER) {
|
||||||
#if LV_USE_GPU
|
|
||||||
if(disp->driver.gpu_blend_cb && (lv_area_get_size(draw_area) > GPU_SIZE_LIMIT)) {
|
|
||||||
for(y = draw_area->y1; y <= draw_area->y2; y++) {
|
|
||||||
disp->driver.gpu_blend_cb(&disp->driver, disp_buf_first, map_buf_first, draw_area_w, opa);
|
|
||||||
disp_buf_first += disp_w;
|
|
||||||
map_buf_first += map_w;
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if(opa > LV_OPA_MAX) {
|
if(opa > LV_OPA_MAX) {
|
||||||
#if LV_USE_GPU_NXP_PXP
|
#if LV_USE_GPU_NXP_PXP
|
||||||
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT) {
|
if(lv_area_get_size(draw_area) >= LV_GPU_NXP_PXP_BLIT_SIZE_LIMIT) {
|
||||||
|
@ -1199,7 +1199,7 @@ static void draw_content(const lv_area_t * coords, const lv_area_t * clip, const
|
|||||||
label_dsc.letter_space = dsc->content_letter_space;
|
label_dsc.letter_space = dsc->content_letter_space;
|
||||||
label_dsc.line_space = dsc->content_line_space;
|
label_dsc.line_space = dsc->content_line_space;
|
||||||
lv_point_t s;
|
lv_point_t s;
|
||||||
lv_txt_get_size(&s, dsc->content_text, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
|
lv_txt_get_size(&s, txt, label_dsc.font, label_dsc.letter_space, label_dsc.line_space, LV_COORD_MAX,
|
||||||
LV_TEXT_FLAG_NONE);
|
LV_TEXT_FLAG_NONE);
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,138 +0,0 @@
|
|||||||
/**
|
|
||||||
* @file lv_assert.c
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*********************
|
|
||||||
* INCLUDES
|
|
||||||
*********************/
|
|
||||||
#include "lv_assert.h"
|
|
||||||
|
|
||||||
#if LV_USE_ASSERT
|
|
||||||
|
|
||||||
#include "lv_mem.h"
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/*********************
|
|
||||||
* DEFINES
|
|
||||||
*********************/
|
|
||||||
#ifndef LV_DEBUG_STR_MAX_LENGTH
|
|
||||||
#define LV_DEBUG_STR_MAX_LENGTH (1024 * 8)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LV_DEBUG_STR_MAX_REPEAT
|
|
||||||
#define LV_DEBUG_STR_MAX_REPEAT 8
|
|
||||||
#endif
|
|
||||||
/**********************
|
|
||||||
* TYPEDEFS
|
|
||||||
**********************/
|
|
||||||
|
|
||||||
/**********************
|
|
||||||
* STATIC PROTOTYPES
|
|
||||||
**********************/
|
|
||||||
|
|
||||||
/**********************
|
|
||||||
* STATIC VARIABLES
|
|
||||||
**********************/
|
|
||||||
|
|
||||||
/**********************
|
|
||||||
* MACROS
|
|
||||||
**********************/
|
|
||||||
|
|
||||||
/**********************
|
|
||||||
* GLOBAL FUNCTIONS
|
|
||||||
**********************/
|
|
||||||
|
|
||||||
bool lv_debug_check_null(const void * p)
|
|
||||||
{
|
|
||||||
if(p) return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool lv_debug_check_mem_integrity(void)
|
|
||||||
{
|
|
||||||
return lv_mem_test() == LV_RES_OK ? true : false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool lv_debug_check_str(const void * str)
|
|
||||||
{
|
|
||||||
const uint8_t * s = (const uint8_t *)str;
|
|
||||||
uint8_t last_byte = 0;
|
|
||||||
uint32_t rep = 0;
|
|
||||||
uint32_t i;
|
|
||||||
|
|
||||||
for(i = 0; i < LV_DEBUG_STR_MAX_LENGTH && s[i] != '\0'; i++) {
|
|
||||||
if(s[i] != last_byte) {
|
|
||||||
last_byte = s[i];
|
|
||||||
rep = 1;
|
|
||||||
}
|
|
||||||
else if(s[i] > 0x7F) {
|
|
||||||
rep++;
|
|
||||||
if(rep > LV_DEBUG_STR_MAX_REPEAT) {
|
|
||||||
LV_LOG_WARN("lv_debug_check_str: a non-ASCII char has repeated more than LV_DEBUG_STR_MAX_REPEAT times)");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(s[i] < 10) {
|
|
||||||
LV_LOG_WARN("lv_debug_check_str: invalid char in the string (< 10 value)");
|
|
||||||
return false; /*Shouldn't occur in strings*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(s[i] == '\0') return true;
|
|
||||||
|
|
||||||
LV_LOG_WARN("lv_debug_check_str: string is longer than LV_DEBUG_STR_MAX_LENGTH");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void lv_debug_log_error(const char * msg, uint64_t value)
|
|
||||||
{
|
|
||||||
static const char hex[] = "0123456789ABCDEF";
|
|
||||||
|
|
||||||
size_t msg_len = strlen(msg);
|
|
||||||
uint32_t value_len = sizeof(unsigned long int);
|
|
||||||
|
|
||||||
if(msg_len < 230) {
|
|
||||||
char buf[255];
|
|
||||||
char * bufp = buf;
|
|
||||||
|
|
||||||
/*Add the function name*/
|
|
||||||
lv_memcpy(bufp, msg, msg_len);
|
|
||||||
bufp += msg_len;
|
|
||||||
|
|
||||||
/*Add value in hey*/
|
|
||||||
*bufp = ' ';
|
|
||||||
bufp ++;
|
|
||||||
*bufp = '(';
|
|
||||||
bufp ++;
|
|
||||||
*bufp = '0';
|
|
||||||
bufp ++;
|
|
||||||
*bufp = 'x';
|
|
||||||
bufp ++;
|
|
||||||
|
|
||||||
int8_t i;
|
|
||||||
for(i = value_len * 2 - 1; i >= 0; i--) {
|
|
||||||
uint8_t x = (unsigned long int)((unsigned long int)value >> (i * 4)) & 0xF;
|
|
||||||
|
|
||||||
*bufp = hex[x];
|
|
||||||
bufp++;
|
|
||||||
}
|
|
||||||
|
|
||||||
*bufp = ')';
|
|
||||||
bufp ++;
|
|
||||||
|
|
||||||
*bufp = '\0';
|
|
||||||
LV_LOG_ERROR(buf);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
LV_LOG_ERROR(msg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**********************
|
|
||||||
* STATIC FUNCTIONS
|
|
||||||
**********************/
|
|
||||||
|
|
||||||
#endif /*LV_USE_ASSERT*/
|
|
@ -14,8 +14,6 @@ extern "C" {
|
|||||||
* INCLUDES
|
* INCLUDES
|
||||||
*********************/
|
*********************/
|
||||||
#include "../lv_conf_internal.h"
|
#include "../lv_conf_internal.h"
|
||||||
|
|
||||||
#if LV_USE_ASSERT
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
@ -29,13 +27,6 @@ extern "C" {
|
|||||||
/**********************
|
/**********************
|
||||||
* GLOBAL PROTOTYPES
|
* GLOBAL PROTOTYPES
|
||||||
**********************/
|
**********************/
|
||||||
bool lv_debug_check_null(const void * p);
|
|
||||||
|
|
||||||
bool lv_debug_check_mem_integrity(void);
|
|
||||||
|
|
||||||
bool lv_debug_check_str(const void * str);
|
|
||||||
|
|
||||||
void lv_debug_log_error(const char * msg, uint64_t value);
|
|
||||||
|
|
||||||
/**********************
|
/**********************
|
||||||
* MACROS
|
* MACROS
|
||||||
@ -82,17 +73,6 @@ void lv_debug_log_error(const char * msg, uint64_t value);
|
|||||||
# define LV_ASSERT_MALLOC_INTEGRIT()
|
# define LV_ASSERT_MALLOC_INTEGRIT()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else /* LV_USE_ASSERT == 0 */
|
|
||||||
|
|
||||||
#define LV_ASSERT(expr) do{}while(0)
|
|
||||||
#define LV_ASSERT_MSG(expr, msg) do{}while(0)
|
|
||||||
|
|
||||||
#define LV_ASSERT_NULL(p)
|
|
||||||
#define LV_ASSERT_MALLOC(p)
|
|
||||||
#define LV_ASSERT_MALLOC_INTEGRITY()
|
|
||||||
|
|
||||||
#endif /* LV_USE_ASSERT */
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* extern "C" */
|
} /* extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
@ -153,8 +153,6 @@ void lv_mem_deinit(void)
|
|||||||
*/
|
*/
|
||||||
void * lv_mem_alloc(size_t size)
|
void * lv_mem_alloc(size_t size)
|
||||||
{
|
{
|
||||||
// printf("alloc: %d\n", size);
|
|
||||||
|
|
||||||
if(size == 0) return &zero_mem;
|
if(size == 0) return &zero_mem;
|
||||||
|
|
||||||
/*Round the size up to ALIGN_MASK*/
|
/*Round the size up to ALIGN_MASK*/
|
||||||
@ -229,7 +227,6 @@ void lv_mem_free(const void * data)
|
|||||||
lv_memset((void *)data, 0xbb, lv_mem_get_size(data));
|
lv_memset((void *)data, 0xbb, lv_mem_get_size(data));
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
// printf("free: %d\n", lv_mem_get_size(data));
|
|
||||||
|
|
||||||
#if LV_MEM_CUSTOM == 0
|
#if LV_MEM_CUSTOM == 0
|
||||||
e->header.s.used = 0;
|
e->header.s.used = 0;
|
||||||
|
@ -14,7 +14,6 @@ CSRCS += lv_utils.c
|
|||||||
CSRCS += lv_async.c
|
CSRCS += lv_async.c
|
||||||
CSRCS += lv_printf.c
|
CSRCS += lv_printf.c
|
||||||
CSRCS += lv_bidi.c
|
CSRCS += lv_bidi.c
|
||||||
CSRCS += lv_debug.c
|
|
||||||
|
|
||||||
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc
|
DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc
|
||||||
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc
|
VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc
|
||||||
|
@ -51,10 +51,8 @@ LV_EXPORT_CONST_INT(LV_IMG_ZOOM_NONE);
|
|||||||
*/
|
*/
|
||||||
enum {
|
enum {
|
||||||
LV_BLEND_MODE_NORMAL, /**< Simply mix according to the opacity value*/
|
LV_BLEND_MODE_NORMAL, /**< Simply mix according to the opacity value*/
|
||||||
#if LV_DRAW_COMPLEX
|
|
||||||
LV_BLEND_MODE_ADDITIVE, /**< Add the respective color channels*/
|
LV_BLEND_MODE_ADDITIVE, /**< Add the respective color channels*/
|
||||||
LV_BLEND_MODE_SUBTRACTIVE,/**< Subtract the foreground from the background*/
|
LV_BLEND_MODE_SUBTRACTIVE,/**< Subtract the foreground from the background*/
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint8_t lv_blend_mode_t;
|
typedef uint8_t lv_blend_mode_t;
|
||||||
@ -657,7 +655,7 @@ static inline void lv_style_set_pad_all(lv_style_t * style, lv_coord_t value)
|
|||||||
* MACROS
|
* MACROS
|
||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
#if LV_USE_ASSERT && LV_USE_ASSERT_STYLE
|
#if LV_USE_ASSERT_STYLE
|
||||||
# define LV_ASSERT_STYLE(style_p) LV_ASSERT_MSG(style_p != NULL, "The style is NULL"); \
|
# define LV_ASSERT_STYLE(style_p) LV_ASSERT_MSG(style_p != NULL, "The style is NULL"); \
|
||||||
LV_ASSERT_MSG(style_p->sentinel == LV_STYLE_SENTINEL_VALUE, "Style is not initialized or corrupted");
|
LV_ASSERT_MSG(style_p->sentinel == LV_STYLE_SENTINEL_VALUE, "Style is not initialized or corrupted");
|
||||||
#else
|
#else
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
**********************/
|
**********************/
|
||||||
|
|
||||||
static void lv_arc_constructor(lv_obj_t * obj, lv_obj_t * parent, const lv_obj_t * copy);
|
static void lv_arc_constructor(lv_obj_t * obj, lv_obj_t * parent, const lv_obj_t * copy);
|
||||||
static void lv_arc_destructor(lv_obj_t * obj);
|
|
||||||
static lv_draw_res_t lv_arc_draw(lv_obj_t * arc, const lv_area_t * clip_area, lv_draw_mode_t mode);
|
static lv_draw_res_t lv_arc_draw(lv_obj_t * arc, const lv_area_t * clip_area, lv_draw_mode_t mode);
|
||||||
static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param);
|
static lv_res_t lv_arc_signal(lv_obj_t * arc, lv_signal_t sign, void * param);
|
||||||
static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle, uint8_t part);
|
static void inv_arc_area(lv_obj_t * arc, uint16_t start_angle, uint16_t end_angle, uint8_t part);
|
||||||
@ -44,7 +43,6 @@ static void value_update(lv_obj_t * arc);
|
|||||||
**********************/
|
**********************/
|
||||||
const lv_obj_class_t lv_arc_class = {
|
const lv_obj_class_t lv_arc_class = {
|
||||||
.constructor_cb = lv_arc_constructor,
|
.constructor_cb = lv_arc_constructor,
|
||||||
.destructor_cb = lv_arc_destructor,
|
|
||||||
.signal_cb = lv_arc_signal,
|
.signal_cb = lv_arc_signal,
|
||||||
.draw_cb = lv_arc_draw,
|
.draw_cb = lv_arc_draw,
|
||||||
.instance_size = sizeof(lv_arc_t),
|
.instance_size = sizeof(lv_arc_t),
|
||||||
@ -489,8 +487,6 @@ static void lv_arc_constructor(lv_obj_t * obj, lv_obj_t * parent, const lv_obj_t
|
|||||||
lv_arc_t * arc = (lv_arc_t *)obj;
|
lv_arc_t * arc = (lv_arc_t *)obj;
|
||||||
LV_LOG_TRACE("arc create started");
|
LV_LOG_TRACE("arc create started");
|
||||||
|
|
||||||
/*Create the ancestor of arc*/
|
|
||||||
|
|
||||||
/*Initialize the allocated 'ext' */
|
/*Initialize the allocated 'ext' */
|
||||||
arc->rotation = 0;
|
arc->rotation = 0;
|
||||||
arc->bg_angle_start = 135;
|
arc->bg_angle_start = 135;
|
||||||
@ -533,20 +529,6 @@ static void lv_arc_constructor(lv_obj_t * obj, lv_obj_t * parent, const lv_obj_t
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lv_arc_destructor(lv_obj_t * obj)
|
|
||||||
{
|
|
||||||
// lv_arc_t * arc = obj;
|
|
||||||
//
|
|
||||||
// _lv_obj_reset_style_list_no_refr(obj, LV_BAR_PART_INDIC);
|
|
||||||
//#if LV_USE_ANIMATION
|
|
||||||
// lv_anim_del(&arc->cur_value_anim, NULL);
|
|
||||||
// lv_anim_del(&arc->start_value_anim, NULL);
|
|
||||||
//#endif
|
|
||||||
//
|
|
||||||
// arc->class_p->base_p->destructor(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static lv_draw_res_t lv_arc_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode)
|
static lv_draw_res_t lv_arc_draw(lv_obj_t * obj, const lv_area_t * clip_area, lv_draw_mode_t mode)
|
||||||
{
|
{
|
||||||
/*Return false if the object is not covers the mask_p area*/
|
/*Return false if the object is not covers the mask_p area*/
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user