Initial commit, getting all the stuff from PlatformIO

This commit is contained in:
2025-11-02 17:55:41 +00:00
commit 4b4b816a8c
3003 changed files with 1213319 additions and 0 deletions

View File

@@ -0,0 +1 @@
preview-build/

View File

@@ -0,0 +1,34 @@
# This basic file is used to compile the runtime for the Editor preview.
# It is also intended for you to customize it for your own target/project.
# Only set project if this is the top-level CMakeLists.txt
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
cmake_minimum_required(VERSION 3.10)
# can be customized
project(LVGLProject)
set(IS_TOP_LEVEL TRUE)
else()
set(IS_TOP_LEVEL FALSE)
endif()
# This includes the generated list of .c files
include(${CMAKE_CURRENT_LIST_DIR}/file_list_gen.cmake)
# Create the UI sources as a library
add_library(lib-ui ${PROJECT_SOURCES})
# You may use this check to add configuration when compiling for the Editor preview,
# or for your target.
if (LV_EDITOR_PREVIEW)
# things for the Preview
else ()
# things for your target
# set your include directories here, don't forget LVGL!
endif ()
if (IS_TOP_LEVEL)
# Do something when this is your top level cmakelists.txt
else()
# Do something else if it's not your top level cmakelists.txt
endif()

View File

@@ -0,0 +1 @@
Create XML files here that start with a `<component>` tag

View File

@@ -0,0 +1,7 @@
list(
APPEND
PROJECT_SOURCES
${CMAKE_CURRENT_LIST_DIR}/screens/screen_hello_world_gen.c
${CMAKE_CURRENT_LIST_DIR}/ui_hello_world_gen.c
${CMAKE_CURRENT_LIST_DIR}/ui_hello_world.c
${CMAKE_CURRENT_LIST_DIR}/fonts/font_medium_data.c)

View File

@@ -0,0 +1 @@
Place ttf or woff files here

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,26 @@
<globals>
<api>
<!-- Add <enumdefs> here -->
</api>
<consts>
<!-- Add <px>, <int>, <color> etc here -->
</consts>
<styles>
<!-- Add <style> tags here -->
</styles>
<subjects>
<!-- Add <int>, <string>, or <float> subjects here -->
</subjects>
<images>
<!-- Add <file> or <data> tags here -->
</images>
<fonts>
<!-- Add <bin> , <tiny_ttf>, <freetype> tags here -->
<bin name="font_medium" as_file="false" src_path="fonts/Montserrat_Medium.ttf" size="20" bpp="4" />
</fonts>
</globals>

View File

@@ -0,0 +1 @@
Place PNG images here

View File

@@ -0,0 +1 @@
7fcd9322b8f376e6ce4d650855b195cbbcbbc365

View File

@@ -0,0 +1,8 @@
Exported functions:
No additional exported functions provided
All exported functions: ['_malloc', '_free', '_lvrt_initialize', '_lvrt_initialize_headless', '_ui_hello_world_init', '_lvrt_cleanup_runtime', '_lvrt_process_data', '_lvrt_xml_load_component_data', '_lvrt_component_create', '_lvrt_refresh', '_lvrt_resize_canvas', '_lvrt_get_obj_area', '_lvrt_apply_style', '_lvrt_xml_load_translations', '_lvrt_translation_set_language', '_lvrt_xml_test_register_from_data', '_lvrt_xml_test_run_init', '_lvrt_xml_test_run_next', '_lvrt_xml_test_run_stop', '_lvrt_set_subject', '_lvrt_set_subject_int', '_lvrt_set_subject_string', '_lvrt_set_subject_float', '_lvrt_subscribe_subject', '_lvrt_play_timeline', '_lvrt_get_view_type']
Exported functions:
No additional exported functions provided
All exported functions: ['_malloc', '_free', '_lvrt_initialize', '_lvrt_initialize_headless', '_ui_hello_world_init', '_lvrt_cleanup_runtime', '_lvrt_process_data', '_lvrt_xml_load_component_data', '_lvrt_component_create', '_lvrt_refresh', '_lvrt_resize_canvas', '_lvrt_get_obj_area', '_lvrt_apply_style', '_lvrt_xml_load_translations', '_lvrt_translation_set_language', '_lvrt_xml_test_register_from_data', '_lvrt_xml_test_run_init', '_lvrt_xml_test_run_next', '_lvrt_xml_test_run_stop', '_lvrt_set_subject', '_lvrt_set_subject_int', '_lvrt_set_subject_string', '_lvrt_set_subject_float', '_lvrt_subscribe_subject', '_lvrt_play_timeline', '_lvrt_get_view_type']

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
<project name="ui_hello_world">
<targets>
<target name="target1">
<display width="320" height="240" />
</target>
</targets>
</project>

View File

@@ -0,0 +1 @@
Create XML files here that start with a `<screen>` tag

View File

@@ -0,0 +1,13 @@
<screen>
<styles>
<style name="style_main" bg_color="0x008a04" />
</styles>
<view>
<style name="style_main" />
<lv_button align="center" style_bg_color="0x3620be" width="250" height="50">
<lv_label text="Greentings Humans" style_text_font="font_medium" width="205" height="26" x="8" y="4" />
</lv_button>
</view>
</screen>

View File

@@ -0,0 +1,73 @@
/**
* @file screen_hello_world_gen.c
* @brief Template source file for LVGL objects
*/
/*********************
* INCLUDES
*********************/
#include "screen_hello_world_gen.h"
#include "ui_hello_world.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/***********************
* STATIC VARIABLES
**********************/
/***********************
* STATIC PROTOTYPES
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
lv_obj_t * screen_hello_world_create(void)
{
LV_TRACE_OBJ_CREATE("begin");
static lv_style_t style_main;
static bool style_inited = false;
if (!style_inited) {
lv_style_init(&style_main);
lv_style_set_bg_color(&style_main, lv_color_hex(0x008a04));
style_inited = true;
}
lv_obj_t * lv_obj_0 = lv_obj_create(NULL);
lv_obj_set_name_static(lv_obj_0, "screen_hello_world_#");
lv_obj_add_style(lv_obj_0, &style_main, 0);
lv_obj_t * lv_button_0 = lv_button_create(lv_obj_0);
lv_obj_set_align(lv_button_0, LV_ALIGN_CENTER);
lv_obj_set_style_bg_color(lv_button_0, lv_color_hex(0x3620be), 0);
lv_obj_set_width(lv_button_0, 250);
lv_obj_set_height(lv_button_0, 50);
lv_obj_t * lv_label_0 = lv_label_create(lv_button_0);
lv_label_set_text(lv_label_0, "Greentings Humans");
lv_obj_set_style_text_font(lv_label_0, font_medium, 0);
lv_obj_set_width(lv_label_0, 205);
lv_obj_set_height(lv_label_0, 26);
lv_obj_set_x(lv_label_0, 8);
lv_obj_set_y(lv_label_0, 4);
LV_TRACE_OBJ_CREATE("finished");
return lv_obj_0;
}
/**********************
* STATIC FUNCTIONS
**********************/

View File

@@ -0,0 +1,46 @@
/**
* @file screen_hello_world_gen.h
*/
#ifndef SCREEN_HELLO_WORLD_H
#define SCREEN_HELLO_WORLD_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "../../lvgl/lvgl.h"
#endif
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
lv_obj_t * screen_hello_world_create(void);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*SCREEN_HELLO_WORLD_H*/

View File

@@ -0,0 +1,44 @@
/**
* @file ui_hello_world.c
*/
/*********************
* INCLUDES
*********************/
#include "ui_hello_world.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void ui_hello_world_init(const char * asset_path)
{
ui_hello_world_init_gen(asset_path);
/* Add your own custom code here if needed */
}
/**********************
* STATIC FUNCTIONS
**********************/

View File

@@ -0,0 +1,47 @@
/**
* @file ui_hello_world.h
*/
#ifndef UI_HELLO_WORLD_H
#define UI_HELLO_WORLD_H
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#include "ui_hello_world_gen.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL VARIABLES
**********************/
/**********************
* GLOBAL PROTOTYPES
**********************/
/**
* Initialize the component library
*/
void ui_hello_world_init(const char * asset_path);
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*UI_HELLO_WORLD_H*/

View File

@@ -0,0 +1,125 @@
/**
* @file ui_hello_world_gen.c
*/
/*********************
* INCLUDES
*********************/
#include "ui_hello_world_gen.h"
#if LV_USE_XML
#endif /* LV_USE_XML */
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
/**********************
* STATIC VARIABLES
**********************/
/*----------------
* Translations
*----------------*/
/**********************
* GLOBAL VARIABLES
**********************/
/*--------------------
* Permanent screens
*-------------------*/
/*----------------
* Global styles
*----------------*/
/*----------------
* Fonts
*----------------*/
lv_font_t * font_medium;
extern lv_font_t font_medium_data;
/*----------------
* Images
*----------------*/
/*----------------
* Subjects
*----------------*/
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void ui_hello_world_init_gen(const char * asset_path)
{
char buf[256];
/*----------------
* Global styles
*----------------*/
/*----------------
* Fonts
*----------------*/
/* get font 'font_medium' from a C array */
font_medium = &font_medium_data;
/*----------------
* Images
*----------------*/
/*----------------
* Subjects
*----------------*/
/*----------------
* Translations
*----------------*/
#if LV_USE_XML
/* Register widgets */
/* Register fonts */
lv_xml_register_font(NULL, "font_medium", font_medium);
/* Register subjects */
/* Register callbacks */
#endif
/* Register all the global assets so that they won't be created again when globals.xml is parsed.
* While running in the editor skip this step to update the preview when the XML changes */
#if LV_USE_XML && !defined(LV_EDITOR_PREVIEW)
/* Register images */
#endif
#if LV_USE_XML == 0
/*--------------------
* Permanent screens
*-------------------*/
/* If XML is enabled it's assumed that the permanent screens are created
* manaully from XML using lv_xml_create() */
#endif
}
/* Callbacks */
/**********************
* STATIC FUNCTIONS
**********************/

View File

@@ -0,0 +1,89 @@
/**
* @file ui_hello_world_gen.h
*/
#ifndef UI_HELLO_WORLD_GEN_H
#define UI_HELLO_WORLD_GEN_H
#ifndef UI_SUBJECT_STRING_LENGTH
#define UI_SUBJECT_STRING_LENGTH 256
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*********************
* INCLUDES
*********************/
#ifdef LV_LVGL_H_INCLUDE_SIMPLE
#include "lvgl.h"
#else
#include "../lvgl/lvgl.h"
#endif
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* GLOBAL VARIABLES
**********************/
/*-------------------
* Permanent screens
*------------------*/
/*----------------
* Global styles
*----------------*/
/*----------------
* Fonts
*----------------*/
extern lv_font_t * font_medium;
/*----------------
* Images
*----------------*/
/*----------------
* Subjects
*----------------*/
/**********************
* GLOBAL PROTOTYPES
**********************/
/*----------------
* Event Callbacks
*----------------*/
/**
* Initialize the component library
*/
void ui_hello_world_init_gen(const char * asset_path);
/**********************
* MACROS
**********************/
/**********************
* POST INCLUDES
**********************/
/*Include all the widget and components of this library*/
#include "screens/screen_hello_world_gen.h"
#ifdef __cplusplus
} /*extern "C"*/
#endif
#endif /*UI_HELLO_WORLD_GEN_H*/

View File

@@ -0,0 +1 @@
Create folders here for each widget and place an XML in each with a `<widget>` tag