From f2c56dbf4989bbea416e252c55507d739299fcd4 Mon Sep 17 00:00:00 2001 From: ShallowGreen123 <2608653986@qq.com> Date: Fri, 19 Aug 2022 01:15:28 +0800 Subject: [PATCH] feat: add Data Model --- LVGL.Simulator/LVGL.Simulator.cpp | 63 +++++++++---------- LVGL.Simulator/LVGL.Simulator.vcxproj | 11 +++- LVGL.Simulator/LVGL.Simulator.vcxproj.filters | 33 +++++++++- LVGL.Simulator/lvgl_mydemo | 2 +- 4 files changed, 70 insertions(+), 39 deletions(-) diff --git a/LVGL.Simulator/LVGL.Simulator.cpp b/LVGL.Simulator/LVGL.Simulator.cpp index e22bf17..77605d5 100644 --- a/LVGL.Simulator/LVGL.Simulator.cpp +++ b/LVGL.Simulator/LVGL.Simulator.cpp @@ -13,19 +13,19 @@ #include "resource.h" #if _MSC_VER >= 1200 - // Disable compilation warnings. +// Disable compilation warnings. #pragma warning(push) // nonstandard extension used : bit field types other than int -#pragma warning(disable:4214) +#pragma warning(disable : 4214) // 'conversion' conversion from 'type1' to 'type2', possible loss of data -#pragma warning(disable:4244) +#pragma warning(disable : 4244) #endif #include "lvgl/lvgl.h" #include "lvgl/examples/lv_examples.h" #include "lvgl/demos/lv_demos.h" #include "lv_drivers/win32drv/win32drv.h" -#include "lvgl_mydemo/demo_init.h" +#include "lvgl_mydemo/lvgl_app.h" #if _MSC_VER >= 1200 // Restore compilation warnings. @@ -34,17 +34,15 @@ #include -int main() -{ +int main() { lv_init(); if (!lv_win32_init( - GetModuleHandleW(NULL), - SW_SHOW, - 800, - 480, - LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_LVGL)))) - { + GetModuleHandleW(NULL), + SW_SHOW, + 800, + 480, + LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_LVGL)))) { return -1; } @@ -63,24 +61,24 @@ int main() ///*Init freetype library // *Cache max 64 faces and 1 size*/ - //lv_freetype_init(64, 1, 0); + // lv_freetype_init(64, 1, 0); ///*Create a font*/ - //static lv_ft_info_t info; - //info.name = "./lvgl/src/extra/libs/freetype/arial.ttf"; - //info.weight = 36; - //info.style = FT_FONT_STYLE_NORMAL; - //lv_ft_font_init(&info); + // static lv_ft_info_t info; + // info.name = "./lvgl/src/extra/libs/freetype/arial.ttf"; + // info.weight = 36; + // info.style = FT_FONT_STYLE_NORMAL; + // lv_ft_font_init(&info); ///*Create style with the new font*/ - //static lv_style_t style; - //lv_style_init(&style); - //lv_style_set_text_font(&style, info.font); + // static lv_style_t style; + // lv_style_init(&style); + // lv_style_set_text_font(&style, info.font); ///*Create a label with the new style*/ - //lv_obj_t* label = lv_label_create(lv_scr_act()); - //lv_obj_add_style(label, &style, 0); - //lv_label_set_text(label, "FreeType Arial Test"); + // lv_obj_t* label = lv_label_create(lv_scr_act()); + // lv_obj_add_style(label, &style, 0); + // lv_label_set_text(label, "FreeType Arial Test"); // ---------------------------------- // my Win32 filesystem driver application @@ -105,13 +103,13 @@ int main() // Demos from lv_examples // ---------------------------------- - //demo_init(); - lv_demo_widgets(); // ok - // lv_demo_benchmark(); - // lv_demo_keypad_encoder(); // ok - // lv_demo_music(); // removed from repository - // lv_demo_printer(); // removed from repository - // lv_demo_stress(); // ok + lvgl_app_init(); + // lv_demo_widgets(); // ok + // lv_demo_benchmark(); + // lv_demo_keypad_encoder(); // ok + // lv_demo_music(); // removed from repository + // lv_demo_printer(); // removed from repository + // lv_demo_stress(); // ok // ---------------------------------- // LVGL examples @@ -259,8 +257,7 @@ int main() // Task handler loop // ---------------------------------- - while (!lv_win32_quit_signal) - { + while (!lv_win32_quit_signal) { lv_task_handler(); Sleep(1); } diff --git a/LVGL.Simulator/LVGL.Simulator.vcxproj b/LVGL.Simulator/LVGL.Simulator.vcxproj index e0ec1ec..8dc2ae1 100644 --- a/LVGL.Simulator/LVGL.Simulator.vcxproj +++ b/LVGL.Simulator/LVGL.Simulator.vcxproj @@ -25,12 +25,17 @@ /utf-8 %(AdditionalOptions) _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) MinSpace + stdcpplatest + stdc17 + stdc11 + stdcpplatest - + + @@ -45,7 +50,9 @@ - + + + diff --git a/LVGL.Simulator/LVGL.Simulator.vcxproj.filters b/LVGL.Simulator/LVGL.Simulator.vcxproj.filters index 545b0ec..1d5bbcb 100644 --- a/LVGL.Simulator/LVGL.Simulator.vcxproj.filters +++ b/LVGL.Simulator/LVGL.Simulator.vcxproj.filters @@ -5,8 +5,11 @@ - - lvgl_mydemo + + lvgl_mydemo\data + + + lvgl_mydemo\data @@ -18,9 +21,15 @@ - + lvgl_mydemo + + lvgl_mydemo\data + + + lvgl_mydemo\data + @@ -35,5 +44,23 @@ {8c2243de-0fed-467c-aebe-9ceb4d4cae3e} + + {253c6444-7e69-4837-a228-93424f9d3129} + + + {ff621371-a878-40b4-91ab-cd7be0dc2d4b} + + + {c5934b62-3853-4f42-9324-6ffd65bd3527} + + + {f2c004d7-0d9c-41e8-abc9-72caf2c7be27} + + + {7097f629-8b0d-4ec3-93c8-d8860a89b3e1} + + + {5aec906d-b671-4778-9999-6dcadc840600} + \ No newline at end of file diff --git a/LVGL.Simulator/lvgl_mydemo b/LVGL.Simulator/lvgl_mydemo index f6e0034..6b1cace 160000 --- a/LVGL.Simulator/lvgl_mydemo +++ b/LVGL.Simulator/lvgl_mydemo @@ -1 +1 @@ -Subproject commit f6e00345b950262727c893c3a5de90b443da4a4d +Subproject commit 6b1cacea04f8e5c3f685777120d7dfbfc19d583b