├── Preview.gif ├── .gitmodules ├── LVGL.Windows.Desktop ├── LVGL.ico ├── LVGL.Windows.Desktop.rc ├── Mile.Project.Properties.h ├── resource.h ├── LVGL.Windows.Desktop.vcxproj.filters ├── LVGL.Windows.Desktop.manifest ├── LVGL.Windows.Desktop.vcxproj └── LVGL.Windows.Desktop.cpp ├── LVGL.Windows ├── LVGL.Resource.FontAwesome5Free.ttf ├── LVGL.Resource.FontAwesome5FreeLVGL.ttf ├── LVGL.Windows.props ├── LVGL.Resource.FontAwesome5Free.h ├── LVGL.Resource.FontAwesome5FreeLVGL.h ├── LVGL.Windows.Font.h ├── LVGL.Windows.vcxproj.filters ├── LVGL.Windows.vcxproj ├── LVGL.Windows.Font.cpp ├── lv_conf.h └── LVGL.Portable.vcxitems ├── Mile.Project.Windows.Legacy ├── Mile.Project.Version.rc ├── Mile.Project.Manifest.rc ├── Mile.Project.Platform.ARM.props ├── Mile.Project.Platform.x64.props ├── Mile.Project.Platform.ARM64.props ├── Mile.Project.Platform.Win32.props ├── Mile.Project.Cpp.targets ├── Mile.Project.Version.h └── Mile.Project.Cpp.props ├── .github ├── stale.yml ├── auto-comment.yml └── workflows │ └── CI.yml ├── BuildAllTargets.cmd ├── LICENSE ├── .editorconfig ├── BuildAllTargets.proj ├── Directory.Build.props ├── LVGL.Windows.sln ├── README.md └── .gitignore /Preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvgl/lv_port_windows/HEAD/Preview.gif -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "LVGL.Windows/lvgl"] 2 | path = LVGL.Windows/lvgl 3 | url = https://github.com/lvgl/lvgl 4 | -------------------------------------------------------------------------------- /LVGL.Windows.Desktop/LVGL.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvgl/lv_port_windows/HEAD/LVGL.Windows.Desktop/LVGL.ico -------------------------------------------------------------------------------- /LVGL.Windows.Desktop/LVGL.Windows.Desktop.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvgl/lv_port_windows/HEAD/LVGL.Windows.Desktop/LVGL.Windows.Desktop.rc -------------------------------------------------------------------------------- /LVGL.Windows.Desktop/Mile.Project.Properties.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvgl/lv_port_windows/HEAD/LVGL.Windows.Desktop/Mile.Project.Properties.h -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Resource.FontAwesome5Free.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvgl/lv_port_windows/HEAD/LVGL.Windows/LVGL.Resource.FontAwesome5Free.ttf -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Resource.FontAwesome5FreeLVGL.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvgl/lv_port_windows/HEAD/LVGL.Windows/LVGL.Resource.FontAwesome5FreeLVGL.ttf -------------------------------------------------------------------------------- /Mile.Project.Windows.Legacy/Mile.Project.Version.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvgl/lv_port_windows/HEAD/Mile.Project.Windows.Legacy/Mile.Project.Version.rc -------------------------------------------------------------------------------- /Mile.Project.Windows.Legacy/Mile.Project.Manifest.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvgl/lv_port_windows/HEAD/Mile.Project.Windows.Legacy/Mile.Project.Manifest.rc -------------------------------------------------------------------------------- /LVGL.Windows.Desktop/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ 生成的包含文件。 3 | // 供 LVGL.Windows.Desktop.rc 使用 4 | // 5 | #define IDI_LVGL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Windows.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | $(MSBuildThisFileDirectory);$(MSBuildThisFileDirectory)lvgl\;$(IncludePath) 5 | 6 | 7 | 8 | LV_LVGL_H_INCLUDE_SIMPLE;%(PreprocessorDefinitions) 9 | 10 | 11 | $(OutDir)LVGL.Windows.lib;%(AdditionalDependencies) 12 | 13 | 14 | -------------------------------------------------------------------------------- /LVGL.Windows.Desktop/LVGL.Windows.Desktop.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 21 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - architecture 8 | - pinned 9 | # Label to use when marking an issue as stale 10 | staleLabel: stale 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue or pull request has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /.github/auto-comment.yml: -------------------------------------------------------------------------------- 1 | # Comment to a new issue. 2 | pullRequestOpened: | 3 | Thank you for raising your pull request. 4 | 5 | To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). 6 | 7 | The text of DCO can be read here: https://developercertificate.org/ 8 | For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site. 9 | 10 | By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. 11 | 12 | No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. 13 | -------------------------------------------------------------------------------- /Mile.Project.Windows.Legacy/Mile.Project.Platform.ARM.props: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | Debug 15 | ARM 16 | 17 | 18 | Release 19 | ARM 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Mile.Project.Windows.Legacy/Mile.Project.Platform.x64.props: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | Debug 15 | x64 16 | 17 | 18 | Release 19 | x64 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Mile.Project.Windows.Legacy/Mile.Project.Platform.ARM64.props: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | Debug 15 | ARM64 16 | 17 | 18 | Release 19 | ARM64 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Mile.Project.Windows.Legacy/Mile.Project.Platform.Win32.props: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | Debug 15 | Win32 16 | 17 | 18 | Release 19 | Win32 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /.github/workflows/CI.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | paths-ignore: 6 | - '.github/*' 7 | - '*.md' 8 | pull_request: 9 | paths-ignore: 10 | - '.github/*' 11 | - '*.md' 12 | 13 | jobs: 14 | build: 15 | runs-on: windows-latest 16 | env: 17 | POWERSHELL_TELEMETRY_OPTOUT: 1 18 | steps: 19 | - uses: actions/checkout@v2 20 | with: 21 | submodules: 'recursive' 22 | - uses: microsoft/setup-msbuild@v1 23 | - name: Clear local NuGet cache (workaround for failed restores on windows-latest) 24 | run: dotnet nuget locals all --clear 25 | - name: Build 26 | run: msbuild /m BuildAllTargets.proj 27 | - name: Prepare artifacts 28 | run: rm Output\* -vb -Recurse -Force -Include *.exp, *.idb, *.ilk, *.iobj, *.ipdb, *.lastbuildstate, *.lib, *.obj, *.res, *.tlog 29 | - uses: actions/upload-artifact@v2 30 | with: 31 | name: LVGL_CI_Build 32 | path: Output 33 | -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Resource.FontAwesome5Free.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PROJECT: LVGL ported to Windows 3 | * FILE: LVGL.Resource.FontAwesome5Free.h 4 | * PURPOSE: Definition for embedded resource - Font Awesome 5 Free 5 | * 6 | * LICENSE: The MIT License 7 | * 8 | * DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | */ 10 | 11 | #ifndef LVGL_RESOURCE_FONT_AWESOME_5_FREE 12 | #define LVGL_RESOURCE_FONT_AWESOME_5_FREE 13 | 14 | #include 15 | #include 16 | 17 | #ifndef EXTERN_C 18 | #ifdef __cplusplus 19 | #define EXTERN_C extern "C" 20 | #else 21 | #define EXTERN_C extern 22 | #endif 23 | #endif // !EXTERN_C 24 | 25 | /** 26 | * @brief The resource of Font Awesome 5 Free font. 27 | */ 28 | EXTERN_C const uint8_t* LvglFontAwesome5FreeFontResource; 29 | 30 | /** 31 | * @brief The resource size of Font Awesome 5 Free font. 32 | */ 33 | EXTERN_C const size_t LvglFontAwesome5FreeFontResourceSize; 34 | 35 | /** 36 | * @brief The name of Font Awesome 5 Free font. 37 | */ 38 | EXTERN_C const wchar_t* LvglFontAwesome5FreeFontName; 39 | 40 | #endif // !LVGL_RESOURCE_FONT_AWESOME_5_FREE 41 | -------------------------------------------------------------------------------- /BuildAllTargets.cmd: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem PROJECT: Mouri Internal Library Essentials 3 | @rem FILE: BuildAllTargets.cmd 4 | @rem PURPOSE: Build all targets script for Visual Studio C++ Project 5 | @rem 6 | @rem LICENSE: The MIT License 7 | @rem 8 | @rem DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | @rem 10 | 11 | @setlocal 12 | @echo off 13 | 14 | rem Change to the current folder. 15 | cd "%~dp0" 16 | 17 | rem Remove the output folder for a fresh compile. 18 | rd /s /q Output 19 | 20 | set VisualStudioInstallerFolder="%ProgramFiles(x86)%\Microsoft Visual Studio\Installer" 21 | if %PROCESSOR_ARCHITECTURE%==x86 set VisualStudioInstallerFolder="%ProgramFiles%\Microsoft Visual Studio\Installer" 22 | 23 | pushd %VisualStudioInstallerFolder% 24 | for /f "usebackq tokens=*" %%i in (`vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath`) do ( 25 | set VisualStudioInstallDir=%%i 26 | ) 27 | popd 28 | 29 | call "%VisualStudioInstallDir%\VC\Auxiliary\Build\vcvarsall.bat" x86 30 | 31 | rem Build all targets 32 | MSBuild -m BuildAllTargets.proj 33 | 34 | @endlocal -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 LVGL 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | ## 2 | ## PROJECT: Mouri Internal Library Essentials 3 | ## FILE: .editorconfig 4 | ## PURPOSE: The root .editorconfig file for C++ Project 5 | ## 6 | ## LICENSE: The MIT License 7 | ## 8 | ## DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | ## 10 | 11 | root = true 12 | 13 | [*] 14 | charset = utf-8-bom 15 | end_of_line = crlf 16 | 17 | [*.md] 18 | insert_final_newline = true 19 | 20 | [*.{c,c++,cc,cpp,cxx,h,h++,hh,hpp,hxx,idl,inl,ipp,tlh,tli}] 21 | indent_style = space 22 | indent_size = 4 23 | insert_final_newline = true 24 | trim_trailing_whitespace = true 25 | vc_generate_documentation_comments = doxygen_slash_star 26 | 27 | [*.{js,json,xml,toml,xaml}] 28 | indent_style = space 29 | indent_size = 2 30 | insert_final_newline = true 31 | trim_trailing_whitespace = true 32 | 33 | [*.rc] 34 | charset = utf-16le 35 | 36 | [Mile.Project.Properties.Template.h] 37 | charset = utf-16le 38 | 39 | [Mile.Project.Properties.h] 40 | charset = utf-16le 41 | 42 | [*.bat] 43 | charset = utf-8 44 | insert_final_newline = true 45 | 46 | [*.sh] 47 | charset = utf-8 48 | end_of_line = lf 49 | insert_final_newline = true 50 | -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Resource.FontAwesome5FreeLVGL.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PROJECT: LVGL ported to Windows 3 | * FILE: LVGL.Resource.FontAwesome5FreeLVGL.h 4 | * PURPOSE: Definition for embedded resource - Font Awesome 5 Free LVGL 5 | * 6 | * LICENSE: The MIT License 7 | * 8 | * DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | */ 10 | 11 | #ifndef LVGL_RESOURCE_FONT_AWESOME_5_FREE_LVGL 12 | #define LVGL_RESOURCE_FONT_AWESOME_5_FREE_LVGL 13 | 14 | #include 15 | #include 16 | 17 | #ifndef EXTERN_C 18 | #ifdef __cplusplus 19 | #define EXTERN_C extern "C" 20 | #else 21 | #define EXTERN_C extern 22 | #endif 23 | #endif // !EXTERN_C 24 | 25 | /** 26 | * @brief The resource of Font Awesome 5 Free LVGL font. 27 | */ 28 | EXTERN_C const uint8_t* LvglFontAwesome5FreeLvglFontResource; 29 | 30 | /** 31 | * @brief The resource size of Font Awesome 5 Free LVGL font. 32 | */ 33 | EXTERN_C const size_t LvglFontAwesome5FreeLvglFontResourceSize; 34 | 35 | /** 36 | * @brief The name of Font Awesome 5 Free LVGL font. 37 | */ 38 | EXTERN_C const wchar_t* LvglFontAwesome5FreeLvglFontName; 39 | 40 | #endif // !LVGL_RESOURCE_FONT_AWESOME_5_FREE_LVGL 41 | -------------------------------------------------------------------------------- /LVGL.Windows.Desktop/LVGL.Windows.Desktop.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 12 | 13 | 14 | 15 | 16 | True/PM 17 | PerMonitorV2, PerMonitor 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /Mile.Project.Windows.Legacy/Mile.Project.Cpp.targets: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 17 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Windows.Font.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PROJECT: LVGL ported to Windows 3 | * FILE: LVGL.Windows.Font.h 4 | * PURPOSE: Definition for Windows LVGL font utility functions 5 | * 6 | * LICENSE: The MIT License 7 | * 8 | * DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | */ 10 | 11 | #ifndef LVGL_WINDOWS_FONT 12 | #define LVGL_WINDOWS_FONT 13 | 14 | #include 15 | 16 | #if _MSC_VER >= 1200 17 | // Disable compilation warnings. 18 | #pragma warning(push) 19 | // nonstandard extension used : bit field types other than int 20 | #pragma warning(disable:4214) 21 | // 'conversion' conversion from 'type1' to 'type2', possible loss of data 22 | #pragma warning(disable:4244) 23 | #endif 24 | 25 | #include "lvgl/lvgl.h" 26 | 27 | #if _MSC_VER >= 1200 28 | // Restore compilation warnings. 29 | #pragma warning(pop) 30 | #endif 31 | 32 | #ifndef EXTERN_C 33 | #ifdef __cplusplus 34 | #define EXTERN_C extern "C" 35 | #else 36 | #define EXTERN_C extern 37 | #endif 38 | #endif // !EXTERN_C 39 | 40 | /** 41 | * @brief Default font for LVGL default theme. 42 | */ 43 | 44 | extern lv_font_t LvglDefaultFont; 45 | 46 | /** 47 | * @brief Initialize the Windows GDI font engine. 48 | * @param FontName The default font name. 49 | */ 50 | EXTERN_C void WINAPI LvglWindowsGdiFontInitialize( 51 | _In_opt_ LPCWSTR FontName); 52 | 53 | /** 54 | * @brief Creates a LVGL font object. 55 | * @param FontObject The LVGL font object. 56 | * @param FontSize The font size. 57 | * @param FontName The font name. 58 | * @return If succeed, return TRUE, otherwise return FALSE. 59 | */ 60 | EXTERN_C BOOL WINAPI LvglWindowsGdiFontCreateFont( 61 | _Out_ lv_font_t* FontObject, 62 | _In_ int FontSize, 63 | _In_opt_ LPCWSTR FontName); 64 | 65 | #endif // !LVGL_WINDOWS_SYMBOL_FONT 66 | -------------------------------------------------------------------------------- /LVGL.Windows.Desktop/LVGL.Windows.Desktop.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF} 8 | LVGL 9 | WindowsApplication 10 | LVGL.Windows.Desktop.manifest 11 | true 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | /utf-8 %(AdditionalOptions) 20 | _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 21 | MinSpace 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Windows.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | LVGL.Resource.FontAwesome5Free 8 | 9 | 10 | LVGL.Resource.FontAwesome5FreeLVGL 11 | 12 | 13 | LVGL.Windows.Font 14 | 15 | 16 | 17 | 18 | LVGL.Resource.FontAwesome5Free 19 | 20 | 21 | LVGL.Resource.FontAwesome5FreeLVGL 22 | 23 | 24 | LVGL.Windows.Font 25 | 26 | 27 | 28 | 29 | {4fe19ff6-75e3-4093-9d85-9fc02a92a9fe} 30 | 31 | 32 | {81011523-6013-4c65-b43e-6b3dac1ef893} 33 | 34 | 35 | {20a6a3c2-16d9-4766-8d6b-246666ef17b9} 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | LVGL.Resource.FontAwesome5Free 44 | 45 | 46 | LVGL.Resource.FontAwesome5FreeLVGL 47 | 48 | 49 | -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Windows.vcxproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA} 8 | LVGL.Windows 9 | StaticLibrary 10 | true 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | Level3 19 | false 20 | /utf-8 %(AdditionalOptions) 21 | _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) 22 | MinSpace 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /BuildAllTargets.proj: -------------------------------------------------------------------------------- 1 | 2 | 11 | 14 | 15 | $(MSBuildThisFileDirectory)*.sln 16 | 17 | 18 | 19 | Configuration=Debug;Platform=x86 20 | 21 | 22 | Configuration=Release;Platform=x86 23 | 24 | 25 | Configuration=Debug;Platform=x64 26 | 27 | 28 | Configuration=Release;Platform=x64 29 | 30 | 31 | Configuration=Debug;Platform=ARM64 32 | 33 | 34 | Configuration=Release;Platform=ARM64 35 | 36 | 37 | 38 | 43 | 44 | 45 | 51 | 52 | 53 | 59 | 60 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | $(MSBuildThisFileDirectory)Output\ 14 | $(MileProjectOutputPath)Binaries\ 15 | $(MileProjectOutputPath)Objects\ 16 | False 17 | $(MileProjectObjectsPath)$(Configuration)\$(MSBuildProjectName)\obj\ 18 | $(MileProjectBinariesPath)AppPackages\$(ProjectName)\ 19 | 20 | 21 | $(MileProjectBinariesPath)$(Configuration)\$(Platform)\ 22 | $(MileProjectObjectsPath)$(Configuration)\$(MSBuildProjectName)\$(Platform)\ 23 | $(IntDir)Generated Files\ 24 | 25 | 26 | $(MileProjectBinariesPath)$(Configuration)\$(MSBuildProjectName)\$(Platform)\ 27 | $(MileProjectObjectsPath)$(Configuration)\$(MSBuildProjectName)\ 28 | $(IntermediateOutputPath) 29 | 30 | 31 | 32 | 33 | 34 | 35 | $(AssetTargetFallback);native;uap$(TargetPlatformVersion); 36 | 37 | native,Version=v0.0 38 | native,Version=v0.0 39 | .NETCore,Version=v5.0 40 | .NETCore,Version=v5.0 41 | win;win-x86;win-x64;win-arm;win-arm64;win10-x86;win10-x64;win10-arm;win10-arm64 42 | 43 | -------------------------------------------------------------------------------- /LVGL.Windows.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32505.173 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LVGL.Windows", "LVGL.Windows\LVGL.Windows.vcxproj", "{AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LVGL.Windows.Desktop", "LVGL.Windows.Desktop\LVGL.Windows.Desktop.vcxproj", "{3CA6E070-4AC1-475E-BB17-CF29AE4806DF}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA} = {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA} 11 | EndProjectSection 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|ARM64 = Debug|ARM64 16 | Debug|x64 = Debug|x64 17 | Debug|x86 = Debug|x86 18 | Release|ARM64 = Release|ARM64 19 | Release|x64 = Release|x64 20 | Release|x86 = Release|x86 21 | EndGlobalSection 22 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 23 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Debug|ARM64.ActiveCfg = Debug|ARM64 24 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Debug|ARM64.Build.0 = Debug|ARM64 25 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Debug|x64.ActiveCfg = Debug|x64 26 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Debug|x64.Build.0 = Debug|x64 27 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Debug|x86.ActiveCfg = Debug|Win32 28 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Debug|x86.Build.0 = Debug|Win32 29 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Release|ARM64.ActiveCfg = Release|ARM64 30 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Release|ARM64.Build.0 = Release|ARM64 31 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Release|x64.ActiveCfg = Release|x64 32 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Release|x64.Build.0 = Release|x64 33 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Release|x86.ActiveCfg = Release|Win32 34 | {AAE3B2DC-AEFC-49B0-89F9-9675CE3A0EAA}.Release|x86.Build.0 = Release|Win32 35 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Debug|ARM64.ActiveCfg = Debug|ARM64 36 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Debug|ARM64.Build.0 = Debug|ARM64 37 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Debug|x64.ActiveCfg = Debug|x64 38 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Debug|x64.Build.0 = Debug|x64 39 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Debug|x86.ActiveCfg = Debug|Win32 40 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Debug|x86.Build.0 = Debug|Win32 41 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Release|ARM64.ActiveCfg = Release|ARM64 42 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Release|ARM64.Build.0 = Release|ARM64 43 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Release|x64.ActiveCfg = Release|x64 44 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Release|x64.Build.0 = Release|x64 45 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Release|x86.ActiveCfg = Release|Win32 46 | {3CA6E070-4AC1-475E-BB17-CF29AE4806DF}.Release|x86.Build.0 = Release|Win32 47 | EndGlobalSection 48 | GlobalSection(SolutionProperties) = preSolution 49 | HideSolutionNode = FALSE 50 | EndGlobalSection 51 | GlobalSection(ExtensibilityGlobals) = postSolution 52 | SolutionGuid = {70FFD65D-3759-4E50-A636-9CDF84DAD626} 53 | EndGlobalSection 54 | EndGlobal 55 | -------------------------------------------------------------------------------- /Mile.Project.Windows.Legacy/Mile.Project.Version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * PROJECT: Mouri Internal Library Essentials 3 | * FILE: Mile.Project.Version.h 4 | * PURPOSE: Version Definition for Mile.Project 5 | * 6 | * LICENSE: The MIT License 7 | * 8 | * DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | */ 10 | 11 | #ifndef MILE_PROJECT_VERSION 12 | #define MILE_PROJECT_VERSION 13 | 14 | #ifndef MILE_PROJECT_MACRO_TO_STRING 15 | #define _MILE_PROJECT_MACRO_TO_STRING(arg) L#arg 16 | #define MILE_PROJECT_MACRO_TO_STRING(arg) _MILE_PROJECT_MACRO_TO_STRING(arg) 17 | #endif 18 | 19 | #ifndef MILE_PROJECT_MACRO_TO_UTF8_STRING 20 | #define _MILE_PROJECT_MACRO_TO_UTF8_STRING(arg) #arg 21 | #define MILE_PROJECT_MACRO_TO_UTF8_STRING(arg) \ 22 | _MILE_PROJECT_MACRO_TO_UTF8_STRING(arg) 23 | #endif 24 | 25 | #ifndef MILE_PROJECT_DEFINE_COMMA_VERSION 26 | #define MILE_PROJECT_DEFINE_COMMA_VERSION(MAJOR,MINOR,BUILD,REVISION) \ 27 | MAJOR,MINOR,BUILD,REVISION 28 | #endif 29 | 30 | #ifndef MILE_PROJECT_DEFINE_DOT_VERSION 31 | #define MILE_PROJECT_DEFINE_DOT_VERSION(MAJOR,MINOR,BUILD,REVISION) \ 32 | MAJOR.MINOR.BUILD.REVISION 33 | #endif 34 | 35 | #ifndef MILE_PROJECT_COMMA_VERSION 36 | #define MILE_PROJECT_COMMA_VERSION \ 37 | MILE_PROJECT_DEFINE_COMMA_VERSION( \ 38 | MILE_PROJECT_VERSION_MAJOR, \ 39 | MILE_PROJECT_VERSION_MINOR, \ 40 | MILE_PROJECT_VERSION_BUILD, \ 41 | MILE_PROJECT_VERSION_REVISION) 42 | #endif 43 | 44 | #ifndef MILE_PROJECT_DOT_VERSION 45 | #define MILE_PROJECT_DOT_VERSION \ 46 | MILE_PROJECT_DEFINE_DOT_VERSION( \ 47 | MILE_PROJECT_VERSION_MAJOR, \ 48 | MILE_PROJECT_VERSION_MINOR, \ 49 | MILE_PROJECT_VERSION_BUILD, \ 50 | MILE_PROJECT_VERSION_REVISION) 51 | #endif 52 | 53 | #ifndef MILE_PROJECT_COMMA_VERSION_STRING 54 | #define MILE_PROJECT_COMMA_VERSION_STRING \ 55 | MILE_PROJECT_MACRO_TO_STRING(MILE_PROJECT_COMMA_VERSION) 56 | #endif 57 | 58 | #ifndef MILE_PROJECT_DOT_VERSION_STRING 59 | #define MILE_PROJECT_DOT_VERSION_STRING \ 60 | MILE_PROJECT_MACRO_TO_STRING(MILE_PROJECT_DOT_VERSION) 61 | #endif 62 | 63 | #ifndef MILE_PROJECT_COMMA_VERSION_UTF8_STRING 64 | #define MILE_PROJECT_COMMA_VERSION_UTF8_STRING \ 65 | MILE_PROJECT_MACRO_TO_UTF8_STRING(MILE_PROJECT_COMMA_VERSION) 66 | #endif 67 | 68 | #ifndef MILE_PROJECT_DOT_VERSION_UTF8_STRING 69 | #define MILE_PROJECT_DOT_VERSION_UTF8_STRING \ 70 | MILE_PROJECT_MACRO_TO_UTF8_STRING(MILE_PROJECT_DOT_VERSION) 71 | #endif 72 | 73 | #ifndef MILE_PROJECT_DEFINE_SIMPLE_VERSION 74 | #define MILE_PROJECT_DEFINE_SIMPLE_VERSION(MAJOR,MINOR) \ 75 | MAJOR.MINOR 76 | #endif 77 | 78 | #ifndef MILE_PROJECT_SIMPLE_VERSION 79 | #define MILE_PROJECT_SIMPLE_VERSION \ 80 | MILE_PROJECT_DEFINE_SIMPLE_VERSION( \ 81 | MILE_PROJECT_VERSION_MAJOR, \ 82 | MILE_PROJECT_VERSION_MINOR) 83 | #endif 84 | 85 | #ifndef MILE_PROJECT_SIMPLE_VERSION_STRING 86 | #define MILE_PROJECT_SIMPLE_VERSION_STRING \ 87 | MILE_PROJECT_MACRO_TO_STRING(MILE_PROJECT_SIMPLE_VERSION) 88 | #endif 89 | 90 | #ifdef MILE_PROJECT_VERSION_TAG 91 | #define MILE_PROJECT_VERSION_TAG_STRING L" " MILE_PROJECT_VERSION_TAG 92 | #else 93 | #define MILE_PROJECT_VERSION_TAG_STRING 94 | #endif 95 | 96 | #ifndef MILE_PROJECT_VERSION_STRING 97 | #define MILE_PROJECT_VERSION_STRING \ 98 | MILE_PROJECT_SIMPLE_VERSION_STRING \ 99 | MILE_PROJECT_VERSION_TAG_STRING 100 | #endif 101 | 102 | #ifndef MILE_PROJECT_SIMPLE_VERSION_UTF8_STRING 103 | #define MILE_PROJECT_SIMPLE_VERSION_UTF8_STRING \ 104 | MILE_PROJECT_MACRO_TO_UTF8_STRING(MILE_PROJECT_SIMPLE_VERSION) 105 | #endif 106 | 107 | #ifdef MILE_PROJECT_VERSION_TAG 108 | #define MILE_PROJECT_VERSION_TAG_UTF8_STRING " " MILE_PROJECT_VERSION_TAG 109 | #else 110 | #define MILE_PROJECT_VERSION_TAG_UTF8_STRING 111 | #endif 112 | 113 | #ifndef MILE_PROJECT_VERSION_UTF8_STRING 114 | #define MILE_PROJECT_VERSION_UTF8_STRING \ 115 | MILE_PROJECT_SIMPLE_VERSION_UTF8_STRING \ 116 | MILE_PROJECT_VERSION_TAG_UTF8_STRING 117 | #endif 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LVGL ported to Windows 2 | 3 | **Warning** 4 | 5 | **This repository is deprecated due to all implementations had been migrated.** 6 | 7 | **Please go to https://github.com/lvgl/lv_port_pc_visual_studio.** 8 | 9 | ![Preview](Preview.gif) 10 | 11 | ## Introduction 12 | 13 | This is a pre-configured Visual Studio project to try LVGL on a Windows PC. The 14 | project only depend on Win32 API, C Runtime and C++ STL, so you can compile it 15 | without any extra dependencies. 16 | 17 | The project is currently maintained using Visual Studio 2019. It may well work 18 | without modification in Visual Studio 2017 but it is not actively supported 19 | with that version, so please install and test with Visual Studio 2019 before 20 | reporting any bugs. 21 | 22 | **This project is not for Visual Studio Code, it is for Visual Studio 2019.** 23 | 24 | Instructions for cloning, building and running the application are found below. 25 | 26 | ## Roadmap 27 | 28 | - [ ] Accessibility support for grouped LVGL widgets. 29 | - [ ] Improve the input experience. 30 | - [x] IME Support. 31 | - [x] Touch input support. 32 | - [ ] The desktop style mouse wheel user experience. 33 | - [ ] Improve the UI performance. 34 | - [x] Split LVGL task schedule loop to the separate thread. 35 | - [ ] Use Windows GDI and Direct2D to implement the custom drawing interface. 36 | - [ ] Implement the DirectWrite as extended font support backend. 37 | - [ ] Make a specialized UI demo. 38 | - [ ] Implement the LVGL file system interface. 39 | - [ ] Implement the Windows resource support for LVGL. 40 | 41 | ## Supported Features 42 | 43 | This repo is designed for developing a Windows desktop application. If you 44 | wonder to use the LVGL simulator for Windows, please visit 45 | [lvgl/lv_sim_visual_studio](https://github.com/lvgl/lv_sim_visual_studio). 46 | 47 | - [x] Only depends on Win32 API, C Runtime and C++ STL. 48 | - [x] Native support for x86, x64 and ARM64 Windows. 49 | - [x] Support compiling with [VC-LTL](https://github.com/Chuyu-Team/VC-LTL) 50 | toolchain to make the binary size as smaller as using MinGW. 51 | - [x] Support resizing the Window in the HAL level. 52 | - [x] Support Per-monitor DPI Aware in the HAL level. 53 | - [x] Support Windows keyboard and mouse wheel event in the HAL level. 54 | - [x] Provide the easy way to reference lvgl, lv_examples project for Visual 55 | Studio. 56 | - [x] Provide Windows GDI font engine support. 57 | - [x] Support Windows touch input in the HAL level. 58 | - [x] Support Windows IME input in the HAL level. 59 | 60 | ## Drop the ARM32 Windows support 61 | 62 | For my deliberate consideration, The lv_port_windows project will drop the ARM32 63 | support on the Windows platform. Here are the reasons: 64 | 65 | - The latest version of ARM32 version for Windows desktop is Redstone 2 Insider 66 | Build 15035. I know Windows RT 8.1 and Windows 10 IoT Core aren't in the 67 | stage of end of support, but most of daily users are drop their devices 68 | (Windows RT 8.x tablets) or have a better solution (Windows 10 IoT Core users 69 | on Raspberry Pi devices should migrate to Linux or ARM64 version for Windows 70 | 10 desktop). 71 | - Future ARM processors are deprecating ARM32 ISA support, and Apple Silicon M1 72 | had dropped the ARM32 support at all. So we can't run ARM32 version of Windows 73 | desktop applications on these devices. 74 | - Reduce the size of release package and make the continuous integration faster. 75 | 76 | ## How to Clone 77 | 78 | This repository contains other, necessary LVGL software repositories as 79 | [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules). Those 80 | submodules are not pulled in with the normal git clone command and they will 81 | be needed. There are a couple of techniques to pull in the submodules. 82 | 83 | ### Everything at Once 84 | 85 | This command will clone the lv_port_windows repository and all submodules in a 86 | single step. 87 | 88 | ``` 89 | git clone --recurse-submodules https://github.com/lvgl/lv_port_windows.git 90 | ``` 91 | 92 | ### Main Repository First, Submodules Second 93 | 94 | If you've already cloned the main repository you can pull in the submodules 95 | with a second command. Both commands are shown below. 96 | 97 | ``` 98 | git clone https://github.com/lvgl/lv_port_windows.git 99 | cd lv_port_windows 100 | git submodule update --init --recursive 101 | ``` 102 | 103 | ### Keeping Your Clone Up-To-Date 104 | 105 | If you have cloned this repository and would like to pull in the latest 106 | changes,you will have to do this in two steps. The first step will pull in 107 | updates to the main repo, including updated _references_ to the submodules. The 108 | second step will update the code in the submodules to match those references. 109 | The two commands needed to accomplish this are shown below, run these commands 110 | from inside the main repository's directory (top level lv_port_windows 111 | directory works fine). 112 | 113 | ``` 114 | git pull 115 | git submodule update --init --recursive 116 | ``` 117 | 118 | If you have chosen to fork this repository then updating the fork from upstream 119 | will require a different, more involved procedure. 120 | 121 | ## How To Build & Run 122 | 123 | Open the `LVGL.Windows.sln` solution file in Visual Studio. Set the 124 | `LVGL.Windows.Desktop` project as the startup project. Click on the _Local 125 | windows Debugger_ button in the top toolbar. The included project will be 126 | built and run, launching from a cmd window. 127 | 128 | ## Trying Things Out 129 | 130 | There are a list of possible test applications in the 131 | [LVGL.Windows.Desktop.cpp](LVGL.Windows.Desktop/LVGL.Windows.Desktop.cpp) file. 132 | Each test or demo is launched via a single function call. By default the 133 | `lv_demo_widgets` function is the one that runs, but you can comment that one 134 | out and choose any of the others to compile and run. 135 | 136 | Use these examples to start building your own application test code. 137 | 138 | ## A Note About Versions 139 | 140 | This repository has its submodule references updated shortly afk with minor 141 | version updates. When submodule updates take place a matching version tag is 142 | added tter the release of new, major releases of LittlevGL's core 143 | [lvgl](https://github.com/lvgl/lvgl) project. Occasionally it is updated to 144 | woro this repository. 145 | 146 | If you need to pull in bug fixes in more recent changes to the submodules you 147 | will have to update the references on your own. If source files are added or 148 | removed in the submodules then the visual studio project will likely need 149 | adjusting. See the commit log for examples of submodule updates and associated 150 | visual studio file changes to guide you. 151 | -------------------------------------------------------------------------------- /Mile.Project.Windows.Legacy/Mile.Project.Cpp.props: -------------------------------------------------------------------------------- 1 | 2 | 11 | 34 | 35 | 36 | 40 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 41 | 42 | 43 | Win32Proj 44 | 10.0 45 | true 46 | 47 | 48 | 49 | Application 50 | DynamicLibrary 51 | StaticLibrary 52 | v143 53 | v142 54 | v141 55 | v140 56 | x64 57 | Unicode 58 | true 59 | false 60 | true 61 | 62 | 63 | 64 | true 65 | false 66 | false 67 | $(MSBuildThisFileDirectory);$(IncludePath) 68 | 69 | 70 | 71 | true 72 | NotUsing 73 | Level4 74 | true 75 | true 76 | NoExtensions 77 | WIN32;%(PreprocessorDefinitions) 78 | _CONSOLE;%(PreprocessorDefinitions) 79 | _WINDOWS;%(PreprocessorDefinitions) 80 | _WINDOWS;_USRDLL;%(PreprocessorDefinitions) 81 | _LIB;%(PreprocessorDefinitions) 82 | true 83 | 84 | 85 | true 86 | Console 87 | Windows 88 | Windows 89 | 90 | 91 | 92 | _MILE_PROJECT_MANIFEST_ID=1;%(PreprocessorDefinitions) 93 | _MILE_PROJECT_MANIFEST_ID=2;%(PreprocessorDefinitions) 94 | _MILE_PROJECT_MANIFEST_FILE=$([System.String]::Copy('$(MileProjectManifestFile)').Replace('\','\\'));%(PreprocessorDefinitions) 95 | $(ProjectDir);$(MSBuildThisFileDirectory);%(AdditionalIncludeDirectories) 96 | 97 | 98 | 99 | 100 | _DEBUG;%(PreprocessorDefinitions) 101 | Disabled 102 | MultiThreadedDebug 103 | 104 | 105 | 106 | 107 | NDEBUG;%(PreprocessorDefinitions) 108 | MaxSpeed 109 | true 110 | true 111 | MultiThreaded 112 | 113 | 114 | true 115 | true 116 | 117 | 118 | 119 | 120 | 5.0.5 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## 2 | ## PROJECT: Mouri Internal Library Essentials 3 | ## FILE: .gitignore 4 | ## PURPOSE: The root .gitignore file for Visual Studio C++ Project 5 | ## 6 | ## LICENSE: The MIT License 7 | ## 8 | ## DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | ## 10 | 11 | ## 12 | ## Ignore Mile.Project specific temporary files, build results, 13 | ## and files generated by popular Visual Studio add-ons. 14 | ## 15 | Output/ 16 | 17 | ## 18 | ## Ignore Visual Studio temporary files, build results, and 19 | ## files generated by popular Visual Studio add-ons. 20 | ## 21 | 22 | # User-specific files 23 | *.rsuser 24 | *.suo 25 | *.user 26 | *.userosscache 27 | *.sln.docstates 28 | 29 | # User-specific files (MonoDevelop/Xamarin Studio) 30 | *.userprefs 31 | 32 | # Mono auto generated files 33 | mono_crash.* 34 | 35 | # Build results 36 | [Dd]ebug/ 37 | [Dd]ebugPublic/ 38 | [Rr]elease/ 39 | [Rr]eleases/ 40 | x64/ 41 | x86/ 42 | [Ww][Ii][Nn]32/ 43 | [Aa][Rr][Mm]/ 44 | [Aa][Rr][Mm]64/ 45 | bld/ 46 | [Bb]in/ 47 | [Oo]bj/ 48 | [Ll]og/ 49 | [Ll]ogs/ 50 | 51 | # Visual Studio 2015/2017 cache/options directory 52 | .vs/ 53 | # Uncomment if you have tasks that create the project's static files in wwwroot 54 | #wwwroot/ 55 | 56 | # Visual Studio 2017 auto generated files 57 | Generated\ Files/ 58 | 59 | # MSTest test Results 60 | [Tt]est[Rr]esult*/ 61 | [Bb]uild[Ll]og.* 62 | 63 | # NUnit 64 | *.VisualState.xml 65 | TestResult.xml 66 | nunit-*.xml 67 | 68 | # Build Results of an ATL Project 69 | [Dd]ebugPS/ 70 | [Rr]eleasePS/ 71 | dlldata.c 72 | 73 | # Benchmark Results 74 | BenchmarkDotNet.Artifacts/ 75 | 76 | # .NET Core 77 | project.lock.json 78 | project.fragment.lock.json 79 | artifacts/ 80 | 81 | # ASP.NET Scaffolding 82 | ScaffoldingReadMe.txt 83 | 84 | # StyleCop 85 | StyleCopReport.xml 86 | 87 | # Files built by Visual Studio 88 | *_i.c 89 | *_p.c 90 | *_h.h 91 | *.ilk 92 | *.meta 93 | *.obj 94 | *.iobj 95 | *.pch 96 | *.pdb 97 | *.ipdb 98 | *.pgc 99 | *.pgd 100 | *.rsp 101 | *.sbr 102 | *.tlb 103 | *.tli 104 | *.tlh 105 | *.tmp 106 | *.tmp_proj 107 | *_wpftmp.csproj 108 | *.log 109 | *.tlog 110 | *.vspscc 111 | *.vssscc 112 | .builds 113 | *.pidb 114 | *.svclog 115 | *.scc 116 | 117 | # Chutzpah Test files 118 | _Chutzpah* 119 | 120 | # Visual C++ cache files 121 | ipch/ 122 | *.aps 123 | *.ncb 124 | *.opendb 125 | *.opensdf 126 | *.sdf 127 | *.cachefile 128 | *.VC.db 129 | *.VC.VC.opendb 130 | 131 | # Visual Studio profiler 132 | *.psess 133 | *.vsp 134 | *.vspx 135 | *.sap 136 | 137 | # Visual Studio Trace Files 138 | *.e2e 139 | 140 | # TFS 2012 Local Workspace 141 | $tf/ 142 | 143 | # Guidance Automation Toolkit 144 | *.gpState 145 | 146 | # ReSharper is a .NET coding add-in 147 | _ReSharper*/ 148 | *.[Rr]e[Ss]harper 149 | *.DotSettings.user 150 | 151 | # TeamCity is a build add-in 152 | _TeamCity* 153 | 154 | # DotCover is a Code Coverage Tool 155 | *.dotCover 156 | 157 | # AxoCover is a Code Coverage Tool 158 | .axoCover/* 159 | !.axoCover/settings.json 160 | 161 | # Coverlet is a free, cross platform Code Coverage Tool 162 | coverage*.json 163 | coverage*.xml 164 | coverage*.info 165 | 166 | # Visual Studio code coverage results 167 | *.coverage 168 | *.coveragexml 169 | 170 | # NCrunch 171 | _NCrunch_* 172 | .*crunch*.local.xml 173 | nCrunchTemp_* 174 | 175 | # MightyMoose 176 | *.mm.* 177 | AutoTest.Net/ 178 | 179 | # Web workbench (sass) 180 | .sass-cache/ 181 | 182 | # Installshield output folder 183 | [Ee]xpress/ 184 | 185 | # DocProject is a documentation generator add-in 186 | DocProject/buildhelp/ 187 | DocProject/Help/*.HxT 188 | DocProject/Help/*.HxC 189 | DocProject/Help/*.hhc 190 | DocProject/Help/*.hhk 191 | DocProject/Help/*.hhp 192 | DocProject/Help/Html2 193 | DocProject/Help/html 194 | 195 | # Click-Once directory 196 | publish/ 197 | 198 | # Publish Web Output 199 | *.[Pp]ublish.xml 200 | *.azurePubxml 201 | # Note: Comment the next line if you want to checkin your web deploy settings, 202 | # but database connection strings (with potential passwords) will be unencrypted 203 | *.pubxml 204 | *.publishproj 205 | 206 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 207 | # checkin your Azure Web App publish settings, but sensitive information contained 208 | # in these scripts will be unencrypted 209 | PublishScripts/ 210 | 211 | # NuGet Packages 212 | *.nupkg 213 | # NuGet Symbol Packages 214 | *.snupkg 215 | # The packages folder can be ignored because of Package Restore 216 | **/[Pp]ackages/* 217 | # except build/, which is used as an MSBuild target. 218 | !**/[Pp]ackages/build/ 219 | # Uncomment if necessary however generally it will be regenerated when needed 220 | #!**/[Pp]ackages/repositories.config 221 | # NuGet v3's project.json files produces more ignorable files 222 | *.nuget.props 223 | *.nuget.targets 224 | 225 | # Microsoft Azure Build Output 226 | csx/ 227 | *.build.csdef 228 | 229 | # Microsoft Azure Emulator 230 | ecf/ 231 | rcf/ 232 | 233 | # Windows Store app package directories and files 234 | AppPackages/ 235 | BundleArtifacts/ 236 | Package.StoreAssociation.xml 237 | _pkginfo.txt 238 | *.appx 239 | *.appxbundle 240 | *.appxupload 241 | 242 | # Visual Studio cache files 243 | # files ending in .cache can be ignored 244 | *.[Cc]ache 245 | # but keep track of directories ending in .cache 246 | !?*.[Cc]ache/ 247 | 248 | # Others 249 | ClientBin/ 250 | ~$* 251 | *~ 252 | *.dbmdl 253 | *.dbproj.schemaview 254 | *.jfm 255 | *.pfx 256 | *.publishsettings 257 | orleans.codegen.cs 258 | 259 | # Including strong name files can present a security risk 260 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 261 | #*.snk 262 | 263 | # Since there are multiple workflows, uncomment next line to ignore bower_components 264 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 265 | #bower_components/ 266 | 267 | # RIA/Silverlight projects 268 | Generated_Code/ 269 | 270 | # Backup & report files from converting an old project file 271 | # to a newer Visual Studio version. Backup files are not needed, 272 | # because we have git ;-) 273 | _UpgradeReport_Files/ 274 | Backup*/ 275 | UpgradeLog*.XML 276 | UpgradeLog*.htm 277 | ServiceFabricBackup/ 278 | *.rptproj.bak 279 | 280 | # SQL Server files 281 | *.mdf 282 | *.ldf 283 | *.ndf 284 | 285 | # Business Intelligence projects 286 | *.rdl.data 287 | *.bim.layout 288 | *.bim_*.settings 289 | *.rptproj.rsuser 290 | *- [Bb]ackup.rdl 291 | *- [Bb]ackup ([0-9]).rdl 292 | *- [Bb]ackup ([0-9][0-9]).rdl 293 | 294 | # Microsoft Fakes 295 | FakesAssemblies/ 296 | 297 | # GhostDoc plugin setting file 298 | *.GhostDoc.xml 299 | 300 | # Node.js Tools for Visual Studio 301 | .ntvs_analysis.dat 302 | node_modules/ 303 | 304 | # Visual Studio 6 build log 305 | *.plg 306 | 307 | # Visual Studio 6 workspace options file 308 | *.opt 309 | 310 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 311 | *.vbw 312 | 313 | # Visual Studio 6 auto-generated project file (contains which files were open etc.) 314 | *.vbp 315 | 316 | # Visual Studio 6 workspace and project file (working project files containing files to include in project) 317 | *.dsw 318 | *.dsp 319 | 320 | # Visual Studio 6 technical files 321 | *.ncb 322 | *.aps 323 | 324 | # Visual Studio LightSwitch build output 325 | **/*.HTMLClient/GeneratedArtifacts 326 | **/*.DesktopClient/GeneratedArtifacts 327 | **/*.DesktopClient/ModelManifest.xml 328 | **/*.Server/GeneratedArtifacts 329 | **/*.Server/ModelManifest.xml 330 | _Pvt_Extensions 331 | 332 | # Paket dependency manager 333 | .paket/paket.exe 334 | paket-files/ 335 | 336 | # FAKE - F# Make 337 | .fake/ 338 | 339 | # CodeRush personal settings 340 | .cr/personal 341 | 342 | # Python Tools for Visual Studio (PTVS) 343 | __pycache__/ 344 | *.pyc 345 | 346 | # Cake - Uncomment if you are using it 347 | # tools/** 348 | # !tools/packages.config 349 | 350 | # Tabs Studio 351 | *.tss 352 | 353 | # Telerik's JustMock configuration file 354 | *.jmconfig 355 | 356 | # BizTalk build output 357 | *.btp.cs 358 | *.btm.cs 359 | *.odx.cs 360 | *.xsd.cs 361 | 362 | # OpenCover UI analysis results 363 | OpenCover/ 364 | 365 | # Azure Stream Analytics local run output 366 | ASALocalRun/ 367 | 368 | # MSBuild Binary and Structured Log 369 | *.binlog 370 | 371 | # NVidia Nsight GPU debugger configuration file 372 | *.nvuser 373 | 374 | # MFractors (Xamarin productivity tool) working folder 375 | .mfractor/ 376 | 377 | # Local History for Visual Studio 378 | .localhistory/ 379 | 380 | # Visual Studio History (VSHistory) files 381 | .vshistory/ 382 | 383 | # BeatPulse healthcheck temp database 384 | healthchecksdb 385 | 386 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 387 | MigrationBackup/ 388 | 389 | # Ionide (cross platform F# VS Code tools) working folder 390 | .ionide/ 391 | 392 | # Fody - auto-generated XML schema 393 | FodyWeavers.xsd 394 | 395 | # VS Code files for those working on multiple tools 396 | .vscode/* 397 | !.vscode/settings.json 398 | !.vscode/tasks.json 399 | !.vscode/launch.json 400 | !.vscode/extensions.json 401 | *.code-workspace 402 | 403 | # Local History for Visual Studio Code 404 | .history/ 405 | 406 | # Windows Installer files from build outputs 407 | *.cab 408 | *.msi 409 | *.msix 410 | *.msm 411 | *.msp 412 | 413 | # JetBrains Rider 414 | *.sln.iml 415 | -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Windows.Font.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * PROJECT: LVGL ported to Windows 3 | * FILE: LVGL.Windows.Font.cpp 4 | * PURPOSE: Implementation for Windows LVGL font utility functions 5 | * 6 | * LICENSE: The MIT License 7 | * 8 | * DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | */ 10 | 11 | #include "LVGL.Windows.Font.h" 12 | 13 | #include "LVGL.Resource.FontAwesome5Free.h" 14 | #include "LVGL.Resource.FontAwesome5FreeLVGL.h" 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | static FIXED ConvertDoubleToFixed(double value) 21 | { 22 | std::uint32_t result = static_cast(value * (1 << 16)); 23 | return *reinterpret_cast(&result); 24 | } 25 | 26 | lv_font_t LvglDefaultFont; 27 | 28 | typedef struct _LVGL_WINDOWS_GDI_FONT_CONTEXT 29 | { 30 | HFONT FontHandle; 31 | HFONT SymbolFontHandle; 32 | using GlyphValueType = std::pair; 33 | std::map GlyphSet; 34 | std::uint32_t DpiValue; 35 | std::vector GlyphBitmapPool; 36 | } LVGL_WINDOWS_GDI_FONT_CONTEXT, *PLVGL_WINDOWS_GDI_FONT_CONTEXT; 37 | 38 | static void LvglWindowsGdiFontAddGlyph( 39 | PLVGL_WINDOWS_GDI_FONT_CONTEXT Context, 40 | std::uint32_t UnicodeLetter) 41 | { 42 | MAT2 TransformationMatrix; 43 | TransformationMatrix.eM11 = ::ConvertDoubleToFixed( 44 | static_cast(Context->DpiValue) / USER_DEFAULT_SCREEN_DPI); 45 | TransformationMatrix.eM12= ::ConvertDoubleToFixed( 46 | 0.0); 47 | TransformationMatrix.eM21= ::ConvertDoubleToFixed( 48 | 0.0); 49 | TransformationMatrix.eM22 = ::ConvertDoubleToFixed( 50 | static_cast(Context->DpiValue) / USER_DEFAULT_SCREEN_DPI); 51 | 52 | HDC ContextDCHandle = nullptr; 53 | 54 | do 55 | { 56 | ContextDCHandle = ::GetDC(nullptr); 57 | if (!ContextDCHandle) 58 | { 59 | break; 60 | } 61 | 62 | wchar_t InBuffer[2]; 63 | InBuffer[0] = static_cast(UnicodeLetter); 64 | InBuffer[1] = L'\0'; 65 | 66 | WORD OutBuffer[2]; 67 | OutBuffer[0] = 0; 68 | OutBuffer[1] = 0; 69 | 70 | ::SelectObject(ContextDCHandle, Context->FontHandle); 71 | if (::GetGlyphIndicesW( 72 | ContextDCHandle, 73 | InBuffer, 74 | 1, 75 | OutBuffer, 76 | GGI_MARK_NONEXISTING_GLYPHS) == GDI_ERROR 77 | || OutBuffer[0] == 0xffff) 78 | { 79 | ::SelectObject(ContextDCHandle, Context->SymbolFontHandle); 80 | if (::GetGlyphIndicesW( 81 | ContextDCHandle, 82 | InBuffer, 83 | 1, 84 | OutBuffer, 85 | GGI_MARK_NONEXISTING_GLYPHS) == GDI_ERROR 86 | || OutBuffer[0] == 0xffff) 87 | { 88 | break; 89 | } 90 | } 91 | 92 | GLYPHMETRICS GlyphMetrics; 93 | std::size_t GlyphBitmapOffset = static_cast(-1); 94 | DWORD Length = ::GetGlyphOutlineW( 95 | ContextDCHandle, 96 | OutBuffer[0], 97 | GGO_GRAY8_BITMAP | GGO_GLYPH_INDEX, 98 | &GlyphMetrics, 99 | 0, 100 | nullptr, 101 | &TransformationMatrix); 102 | if (Length != GDI_ERROR) 103 | { 104 | if (Length > 0) 105 | { 106 | GlyphBitmapOffset = Context->GlyphBitmapPool.size(); 107 | Context->GlyphBitmapPool.resize(GlyphBitmapOffset + Length); 108 | uint8_t* GlyphBitmap = &Context->GlyphBitmapPool[GlyphBitmapOffset]; 109 | 110 | if (::GetGlyphOutlineW( 111 | ContextDCHandle, 112 | OutBuffer[0], 113 | GGO_GRAY8_BITMAP | GGO_GLYPH_INDEX, 114 | &GlyphMetrics, 115 | Length, 116 | GlyphBitmap, 117 | &TransformationMatrix) != GDI_ERROR) 118 | { 119 | for (size_t i = 0; i < Length; ++i) 120 | { 121 | GlyphBitmap[i] = 122 | GlyphBitmap[i] == 0x40 123 | ? 0xFF 124 | : GlyphBitmap[i] << 2; 125 | } 126 | } 127 | } 128 | 129 | lv_font_glyph_dsc_t GlyphDescription; 130 | GlyphDescription.adv_w = GlyphMetrics.gmCellIncX; 131 | GlyphDescription.box_w = static_cast( 132 | (GlyphMetrics.gmBlackBoxX + 0x0003) & 0xFFFC); 133 | GlyphDescription.box_h = static_cast( 134 | GlyphMetrics.gmBlackBoxY); 135 | GlyphDescription.ofs_x = static_cast( 136 | GlyphMetrics.gmptGlyphOrigin.x); 137 | GlyphDescription.ofs_y = static_cast( 138 | GlyphMetrics.gmptGlyphOrigin.y - GlyphMetrics.gmBlackBoxY); 139 | GlyphDescription.bpp = 8; 140 | 141 | Context->GlyphSet.emplace(std::make_pair( 142 | UnicodeLetter, 143 | std::make_pair(GlyphDescription, GlyphBitmapOffset))); 144 | } 145 | 146 | } while (false); 147 | 148 | if (ContextDCHandle) 149 | { 150 | ::ReleaseDC(nullptr, ContextDCHandle); 151 | } 152 | } 153 | 154 | static void LvglWindowsGdiFontCheckDpiValue( 155 | PLVGL_WINDOWS_GDI_FONT_CONTEXT Context) 156 | { 157 | std::uint32_t DpiValue = LV_DPI_DEF; 158 | lv_disp_t* CurrentDisplay = ::lv_disp_get_default(); 159 | if (CurrentDisplay) 160 | { 161 | DpiValue = CurrentDisplay->driver->dpi; 162 | } 163 | 164 | if (DpiValue != Context->DpiValue) 165 | { 166 | Context->GlyphSet.clear(); 167 | Context->GlyphBitmapPool.clear(); 168 | Context->DpiValue = DpiValue; 169 | } 170 | } 171 | 172 | static bool LvglWindowsGdiFontGetGlyphCallback( 173 | const lv_font_t* font, 174 | lv_font_glyph_dsc_t* dsc_out, 175 | uint32_t unicode_letter, 176 | uint32_t unicode_letter_next) 177 | { 178 | unicode_letter_next; 179 | 180 | PLVGL_WINDOWS_GDI_FONT_CONTEXT Context = 181 | reinterpret_cast( 182 | const_cast(font->dsc)); 183 | 184 | ::LvglWindowsGdiFontCheckDpiValue(Context); 185 | 186 | auto iterator = Context->GlyphSet.find(unicode_letter); 187 | if (iterator == Context->GlyphSet.end()) 188 | { 189 | ::LvglWindowsGdiFontAddGlyph( 190 | Context, 191 | unicode_letter); 192 | 193 | iterator = Context->GlyphSet.find(unicode_letter); 194 | if (iterator == Context->GlyphSet.end()) 195 | { 196 | return false; 197 | } 198 | } 199 | 200 | std::memcpy( 201 | dsc_out, 202 | &iterator->second.first, 203 | sizeof(lv_font_glyph_dsc_t)); 204 | 205 | return true; 206 | } 207 | 208 | static const uint8_t* LvglWindowsGdiFontGetGlyphBitmapCallback( 209 | const lv_font_t* font, 210 | uint32_t unicode_letter) 211 | { 212 | PLVGL_WINDOWS_GDI_FONT_CONTEXT Context = 213 | reinterpret_cast( 214 | const_cast(font->dsc)); 215 | 216 | ::LvglWindowsGdiFontCheckDpiValue(Context); 217 | 218 | auto iterator = Context->GlyphSet.find(unicode_letter); 219 | if (iterator == Context->GlyphSet.end()) 220 | { 221 | ::LvglWindowsGdiFontAddGlyph( 222 | Context, 223 | unicode_letter); 224 | 225 | iterator = Context->GlyphSet.find(unicode_letter); 226 | if (iterator == Context->GlyphSet.end()) 227 | { 228 | return nullptr; 229 | } 230 | } 231 | 232 | std::size_t& GlyphBitmapOffset = iterator->second.second; 233 | return 234 | (GlyphBitmapOffset != static_cast(-1)) 235 | ? &Context->GlyphBitmapPool[GlyphBitmapOffset] 236 | : nullptr; 237 | } 238 | 239 | EXTERN_C void WINAPI LvglWindowsGdiFontInitialize( 240 | _In_opt_ LPCWSTR FontName) 241 | { 242 | DWORD NumFonts = 0; 243 | ::AddFontMemResourceEx( 244 | const_cast(LvglFontAwesome5FreeLvglFontResource), 245 | static_cast(LvglFontAwesome5FreeLvglFontResourceSize), 246 | nullptr, 247 | &NumFonts); 248 | 249 | ::LvglWindowsGdiFontCreateFont( 250 | &LvglDefaultFont, 251 | 16, 252 | FontName); 253 | } 254 | 255 | EXTERN_C BOOL WINAPI LvglWindowsGdiFontCreateFont( 256 | _Out_ lv_font_t* FontObject, 257 | _In_ int FontSize, 258 | _In_opt_ LPCWSTR FontName) 259 | { 260 | HFONT FontHandle = nullptr; 261 | HFONT SymbolFontHandle = nullptr; 262 | 263 | PLVGL_WINDOWS_GDI_FONT_CONTEXT Context = nullptr; 264 | 265 | do 266 | { 267 | FontHandle = ::CreateFontW( 268 | -FontSize, // nHeight 269 | 0, // nWidth 270 | 0, // nEscapement 271 | 0, // nOrientation 272 | FW_NORMAL, // nWeight 273 | FALSE, // bItalic 274 | FALSE, // bUnderline 275 | 0, // cStrikeOut 276 | DEFAULT_CHARSET, // nCharSet 277 | OUT_DEFAULT_PRECIS, // nOutPrecision 278 | CLIP_DEFAULT_PRECIS, // nClipPrecision 279 | CLEARTYPE_NATURAL_QUALITY, // nQuality 280 | FF_DONTCARE, // nPitchAndFamily 281 | FontName); 282 | if (!FontHandle) 283 | { 284 | break; 285 | } 286 | 287 | SymbolFontHandle = ::CreateFontW( 288 | -FontSize, // nHeight 289 | 0, // nWidth 290 | 0, // nEscapement 291 | 0, // nOrientation 292 | FW_NORMAL, // nWeight 293 | FALSE, // bItalic 294 | FALSE, // bUnderline 295 | 0, // cStrikeOut 296 | DEFAULT_CHARSET, // nCharSet 297 | OUT_DEFAULT_PRECIS, // nOutPrecision 298 | CLIP_DEFAULT_PRECIS, // nClipPrecision 299 | CLEARTYPE_NATURAL_QUALITY, // nQuality 300 | FF_DONTCARE, // nPitchAndFamily 301 | LvglFontAwesome5FreeLvglFontName); 302 | if (!FontHandle) 303 | { 304 | break; 305 | } 306 | 307 | std::uint32_t DpiValue = LV_DPI_DEF; 308 | lv_disp_t* CurrentDisplay = ::lv_disp_get_default(); 309 | if (CurrentDisplay) 310 | { 311 | DpiValue = CurrentDisplay->driver->dpi; 312 | } 313 | 314 | Context = new LVGL_WINDOWS_GDI_FONT_CONTEXT(); 315 | if (!Context) 316 | { 317 | break; 318 | } 319 | 320 | FontObject->dsc = Context; 321 | 322 | Context->FontHandle = FontHandle; 323 | Context->SymbolFontHandle = SymbolFontHandle; 324 | 325 | Context->DpiValue = DpiValue; 326 | 327 | bool IsSucceed = false; 328 | HDC ContextDCHandle = ::GetDC(nullptr); 329 | if (ContextDCHandle) 330 | { 331 | ::SelectObject(ContextDCHandle, Context->FontHandle); 332 | 333 | OUTLINETEXTMETRICW OutlineTextMetrics; 334 | if (::GetOutlineTextMetricsW( 335 | ContextDCHandle, 336 | sizeof(OUTLINETEXTMETRICW), 337 | &OutlineTextMetrics)) 338 | { 339 | FontObject->get_glyph_dsc = 340 | ::LvglWindowsGdiFontGetGlyphCallback; 341 | FontObject->get_glyph_bitmap = 342 | ::LvglWindowsGdiFontGetGlyphBitmapCallback; 343 | FontObject->line_height = static_cast( 344 | OutlineTextMetrics.otmLineGap 345 | - OutlineTextMetrics.otmDescent 346 | + OutlineTextMetrics.otmAscent); 347 | FontObject->base_line = static_cast( 348 | 0 - OutlineTextMetrics.otmDescent); 349 | FontObject->subpx = LV_FONT_SUBPX_NONE; 350 | FontObject->underline_position = static_cast( 351 | OutlineTextMetrics.otmsUnderscorePosition); 352 | FontObject->underline_thickness = static_cast( 353 | OutlineTextMetrics.otmsUnderscoreSize); 354 | 355 | IsSucceed = true; 356 | } 357 | 358 | ::ReleaseDC(nullptr, ContextDCHandle); 359 | } 360 | 361 | if (!IsSucceed) 362 | { 363 | break; 364 | } 365 | 366 | return TRUE; 367 | 368 | } while (false); 369 | 370 | if (Context) 371 | { 372 | delete Context; 373 | } 374 | 375 | if (SymbolFontHandle) 376 | { 377 | ::DeleteObject(SymbolFontHandle); 378 | } 379 | 380 | if (FontHandle) 381 | { 382 | ::DeleteObject(FontHandle); 383 | } 384 | 385 | return FALSE; 386 | } 387 | -------------------------------------------------------------------------------- /LVGL.Windows/lv_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_conf.h 3 | * Configuration file for v8.1.1-dev 4 | */ 5 | 6 | /* 7 | * Copy this file as `lv_conf.h` 8 | * 1. simply next to the `lvgl` folder 9 | * 2. or any other places and 10 | * - define `LV_CONF_INCLUDE_SIMPLE` 11 | * - add the path as include path 12 | */ 13 | 14 | /* clang-format off */ 15 | #if 1 /*Set it to "1" to enable content*/ 16 | 17 | #ifndef LV_CONF_H 18 | #define LV_CONF_H 19 | 20 | #include 21 | 22 | /*==================== 23 | COLOR SETTINGS 24 | *====================*/ 25 | 26 | /*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ 27 | #define LV_COLOR_DEPTH 32 28 | 29 | /*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/ 30 | #define LV_COLOR_16_SWAP 0 31 | 32 | /*Enable more complex drawing routines to manage screens transparency. 33 | *Can be used if the UI is above another layer, e.g. an OSD menu or video player. 34 | *Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value*/ 35 | #define LV_COLOR_SCREEN_TRANSP 0 36 | 37 | /* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. 38 | * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ 39 | #define LV_COLOR_MIX_ROUND_OFS (LV_COLOR_DEPTH == 32 ? 0: 128) 40 | 41 | /*Images pixels with this color will not be drawn if they are chroma keyed)*/ 42 | #define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ 43 | 44 | /*========================= 45 | MEMORY SETTINGS 46 | *=========================*/ 47 | 48 | /*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ 49 | #define LV_MEM_CUSTOM 0 50 | #if LV_MEM_CUSTOM == 0 51 | /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ 52 | #define LV_MEM_SIZE (1024U * 1024U) /*[bytes]*/ 53 | 54 | /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ 55 | #define LV_MEM_ADR 0 /*0: unused*/ 56 | /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ 57 | #if LV_MEM_ADR == 0 58 | //#define LV_MEM_POOL_INCLUDE your_alloc_library /* Uncomment if using an external allocator*/ 59 | //#define LV_MEM_POOL_ALLOC your_alloc /* Uncomment if using an external allocator*/ 60 | #endif 61 | 62 | #else /*LV_MEM_CUSTOM*/ 63 | #define LV_MEM_CUSTOM_INCLUDE /*Header for the dynamic memory function*/ 64 | #define LV_MEM_CUSTOM_ALLOC malloc 65 | #define LV_MEM_CUSTOM_FREE free 66 | #define LV_MEM_CUSTOM_REALLOC realloc 67 | #endif /*LV_MEM_CUSTOM*/ 68 | 69 | /*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms. 70 | *You will see an error log message if there wasn't enough buffers. */ 71 | #define LV_MEM_BUF_MAX_NUM 16 72 | 73 | /*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ 74 | #define LV_MEMCPY_MEMSET_STD 0 75 | 76 | /*==================== 77 | HAL SETTINGS 78 | *====================*/ 79 | 80 | /*Default display refresh period. LVG will redraw changed areas with this period time*/ 81 | #define LV_DISP_DEF_REFR_PERIOD 10 /*[ms]*/ 82 | 83 | /*Input device read period in milliseconds*/ 84 | #define LV_INDEV_DEF_READ_PERIOD 10 /*[ms]*/ 85 | 86 | /*Use a custom tick source that tells the elapsed time in milliseconds. 87 | *It removes the need to manually update the tick with `lv_tick_inc()`)*/ 88 | #define LV_TICK_CUSTOM 1 89 | #if LV_TICK_CUSTOM 90 | #define LV_TICK_CUSTOM_INCLUDE /*Header for the system time function*/ 91 | #define LV_TICK_CUSTOM_SYS_TIME_EXPR (GetTickCount()) /*Expression evaluating to current system time in ms*/ 92 | #endif /*LV_TICK_CUSTOM*/ 93 | 94 | /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. 95 | *(Not so important, you can adjust it to modify default sizes and spaces)*/ 96 | #define LV_DPI_DEF 130 /*[px/inch]*/ 97 | 98 | /*======================= 99 | * FEATURE CONFIGURATION 100 | *=======================*/ 101 | 102 | /*------------- 103 | * Drawing 104 | *-----------*/ 105 | 106 | /*Enable complex draw engine. 107 | *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ 108 | #define LV_DRAW_COMPLEX 1 109 | #if LV_DRAW_COMPLEX != 0 110 | 111 | /*Allow buffering some shadow calculation. 112 | *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` 113 | *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ 114 | #define LV_SHADOW_CACHE_SIZE 0 115 | 116 | /* Set number of maximally cached circle data. 117 | * The circumference of 1/4 circle are saved for anti-aliasing 118 | * radius * 4 bytes are used per circle (the most often used radiuses are saved) 119 | * 0: to disable caching */ 120 | #define LV_CIRCLE_CACHE_SIZE 4 121 | 122 | #endif /*LV_DRAW_COMPLEX*/ 123 | 124 | /*Default image cache size. Image caching keeps the images opened. 125 | *If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) 126 | *With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. 127 | *However the opened images might consume additional RAM. 128 | *0: to disable caching*/ 129 | #define LV_IMG_CACHE_DEF_SIZE 0 130 | 131 | /*Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver.*/ 132 | #define LV_DISP_ROT_MAX_BUF (10*1024) 133 | 134 | /*------------- 135 | * GPU 136 | *-----------*/ 137 | 138 | /*Use STM32's DMA2D (aka Chrom Art) GPU*/ 139 | #define LV_USE_GPU_STM32_DMA2D 0 140 | #if LV_USE_GPU_STM32_DMA2D 141 | /*Must be defined to include path of CMSIS header of target processor 142 | e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ 143 | #define LV_GPU_DMA2D_CMSIS_INCLUDE 144 | #endif 145 | 146 | /*Use NXP's PXP GPU iMX RTxxx platforms*/ 147 | #define LV_USE_GPU_NXP_PXP 0 148 | #if LV_USE_GPU_NXP_PXP 149 | /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) 150 | * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS 151 | * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. 152 | *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() 153 | */ 154 | #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 155 | #endif 156 | 157 | /*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ 158 | #define LV_USE_GPU_NXP_VG_LITE 0 159 | 160 | /*Use exnternal renderer*/ 161 | #define LV_USE_EXTERNAL_RENDERER 0 162 | 163 | /*Use SDL renderer API. Requires LV_USE_EXTERNAL_RENDERER*/ 164 | #define LV_USE_GPU_SDL 0 165 | #if LV_USE_GPU_SDL 166 | #define LV_GPU_SDL_INCLUDE_PATH 167 | #endif 168 | 169 | /*------------- 170 | * Logging 171 | *-----------*/ 172 | 173 | /*Enable the log module*/ 174 | #define LV_USE_LOG 1 175 | #if LV_USE_LOG 176 | 177 | /*How important log should be added: 178 | *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information 179 | *LV_LOG_LEVEL_INFO Log important events 180 | *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem 181 | *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail 182 | *LV_LOG_LEVEL_USER Only logs added by the user 183 | *LV_LOG_LEVEL_NONE Do not log anything*/ 184 | #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN 185 | 186 | /*1: Print the log with 'printf'; 187 | *0: User need to register a callback with `lv_log_register_print_cb()`*/ 188 | #define LV_LOG_PRINTF 1 189 | 190 | /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ 191 | #define LV_LOG_TRACE_MEM 1 192 | #define LV_LOG_TRACE_TIMER 1 193 | #define LV_LOG_TRACE_INDEV 1 194 | #define LV_LOG_TRACE_DISP_REFR 1 195 | #define LV_LOG_TRACE_EVENT 1 196 | #define LV_LOG_TRACE_OBJ_CREATE 1 197 | #define LV_LOG_TRACE_LAYOUT 1 198 | #define LV_LOG_TRACE_ANIM 1 199 | 200 | #endif /*LV_USE_LOG*/ 201 | 202 | /*------------- 203 | * Asserts 204 | *-----------*/ 205 | 206 | /*Enable asserts if an operation is failed or an invalid data is found. 207 | *If LV_USE_LOG is enabled an error message will be printed on failure*/ 208 | #define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ 209 | #define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ 210 | #define LV_USE_ASSERT_STYLE 1 /*Check if the styles are properly initialized. (Very fast, recommended)*/ 211 | #define LV_USE_ASSERT_MEM_INTEGRITY 1 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ 212 | #define LV_USE_ASSERT_OBJ 1 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ 213 | 214 | /*Add a custom handler when assert happens e.g. to restart the MCU*/ 215 | #define LV_ASSERT_HANDLER_INCLUDE 216 | #define LV_ASSERT_HANDLER while(1); /*Halt by default*/ 217 | 218 | /*------------- 219 | * Others 220 | *-----------*/ 221 | 222 | /*1: Show CPU usage and FPS count*/ 223 | #define LV_USE_PERF_MONITOR 1 224 | #if LV_USE_PERF_MONITOR 225 | #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT 226 | #endif 227 | 228 | /*1: Show the used memory and the memory fragmentation 229 | * Requires LV_MEM_CUSTOM = 0*/ 230 | #define LV_USE_MEM_MONITOR 1 231 | #if LV_USE_MEM_MONITOR 232 | #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT 233 | #endif 234 | 235 | /*1: Draw random colored rectangles over the redrawn areas*/ 236 | #define LV_USE_REFR_DEBUG 0 237 | 238 | /*Change the built in (v)snprintf functions*/ 239 | #define LV_SPRINTF_CUSTOM 0 240 | #if LV_SPRINTF_CUSTOM 241 | #define LV_SPRINTF_INCLUDE 242 | #define lv_snprintf snprintf 243 | #define lv_vsnprintf vsnprintf 244 | #else /*LV_SPRINTF_CUSTOM*/ 245 | #define LV_SPRINTF_USE_FLOAT 0 246 | #endif /*LV_SPRINTF_CUSTOM*/ 247 | 248 | #define LV_USE_USER_DATA 1 249 | 250 | /*Garbage Collector settings 251 | *Used if lvgl is bound to higher level language and the memory is managed by that language*/ 252 | #define LV_ENABLE_GC 0 253 | #if LV_ENABLE_GC != 0 254 | #define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ 255 | #endif /*LV_ENABLE_GC*/ 256 | 257 | /*===================== 258 | * COMPILER SETTINGS 259 | *====================*/ 260 | 261 | /*For big endian systems set to 1*/ 262 | #define LV_BIG_ENDIAN_SYSTEM 0 263 | 264 | /*Define a custom attribute to `lv_tick_inc` function*/ 265 | #define LV_ATTRIBUTE_TICK_INC 266 | 267 | /*Define a custom attribute to `lv_timer_handler` function*/ 268 | #define LV_ATTRIBUTE_TIMER_HANDLER 269 | 270 | /*Define a custom attribute to `lv_disp_flush_ready` function*/ 271 | #define LV_ATTRIBUTE_FLUSH_READY 272 | 273 | /*Required alignment size for buffers*/ 274 | #define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 275 | 276 | /*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). 277 | * E.g. __attribute__((aligned(4)))*/ 278 | #define LV_ATTRIBUTE_MEM_ALIGN 279 | 280 | /*Attribute to mark large constant arrays for example font's bitmaps*/ 281 | #define LV_ATTRIBUTE_LARGE_CONST 282 | 283 | /*Complier prefix for a big array declaration in RAM*/ 284 | #define LV_ATTRIBUTE_LARGE_RAM_ARRAY 285 | 286 | /*Place performance critical functions into a faster memory (e.g RAM)*/ 287 | #define LV_ATTRIBUTE_FAST_MEM 288 | 289 | /*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/ 290 | #define LV_ATTRIBUTE_DMA 291 | 292 | /*Export integer constant to binding. This macro is used with constants in the form of LV_ that 293 | *should also appear on LVGL binding API such as Micropython.*/ 294 | #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ 295 | 296 | /*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ 297 | #define LV_USE_LARGE_COORD 0 298 | 299 | /*================== 300 | * FONT USAGE 301 | *===================*/ 302 | 303 | /*Montserrat fonts with ASCII range and some symbols using bpp = 4 304 | *https://fonts.google.com/specimen/Montserrat*/ 305 | #define LV_FONT_MONTSERRAT_8 1 306 | #define LV_FONT_MONTSERRAT_10 1 307 | #define LV_FONT_MONTSERRAT_12 1 308 | #define LV_FONT_MONTSERRAT_14 1 309 | #define LV_FONT_MONTSERRAT_16 1 310 | #define LV_FONT_MONTSERRAT_18 1 311 | #define LV_FONT_MONTSERRAT_20 1 312 | #define LV_FONT_MONTSERRAT_22 1 313 | #define LV_FONT_MONTSERRAT_24 1 314 | #define LV_FONT_MONTSERRAT_26 1 315 | #define LV_FONT_MONTSERRAT_28 1 316 | #define LV_FONT_MONTSERRAT_30 1 317 | #define LV_FONT_MONTSERRAT_32 1 318 | #define LV_FONT_MONTSERRAT_34 1 319 | #define LV_FONT_MONTSERRAT_36 1 320 | #define LV_FONT_MONTSERRAT_38 1 321 | #define LV_FONT_MONTSERRAT_40 1 322 | #define LV_FONT_MONTSERRAT_42 1 323 | #define LV_FONT_MONTSERRAT_44 1 324 | #define LV_FONT_MONTSERRAT_46 1 325 | #define LV_FONT_MONTSERRAT_48 1 326 | 327 | /*Demonstrate special features*/ 328 | #define LV_FONT_MONTSERRAT_12_SUBPX 1 329 | #define LV_FONT_MONTSERRAT_28_COMPRESSED 1 /*bpp = 3*/ 330 | #define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 1 /*Hebrew, Arabic, Perisan letters and all their forms*/ 331 | #define LV_FONT_SIMSUN_16_CJK 1 /*1000 most common CJK radicals*/ 332 | 333 | /*Pixel perfect monospace fonts*/ 334 | #define LV_FONT_UNSCII_8 1 335 | #define LV_FONT_UNSCII_16 0 336 | 337 | /*Optionally declare custom fonts here. 338 | *You can use these fonts as default font too and they will be available globally. 339 | *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ 340 | #define LV_FONT_CUSTOM_DECLARE 341 | 342 | /*Always set a default font*/ 343 | #define LV_FONT_DEFAULT &lv_font_montserrat_14 344 | 345 | /*Enable handling large font and/or fonts with a lot of characters. 346 | *The limit depends on the font size, font face and bpp. 347 | *Compiler error will be triggered if a font needs it.*/ 348 | #define LV_FONT_FMT_TXT_LARGE 0 349 | 350 | /*Enables/disables support for compressed fonts.*/ 351 | #define LV_USE_FONT_COMPRESSED 1 352 | 353 | /*Enable subpixel rendering*/ 354 | #define LV_USE_FONT_SUBPX 1 355 | #if LV_USE_FONT_SUBPX 356 | /*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ 357 | #define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ 358 | #endif 359 | 360 | /*================= 361 | * TEXT SETTINGS 362 | *=================*/ 363 | 364 | /** 365 | * Select a character encoding for strings. 366 | * Your IDE or editor should have the same character encoding 367 | * - LV_TXT_ENC_UTF8 368 | * - LV_TXT_ENC_ASCII 369 | */ 370 | #define LV_TXT_ENC LV_TXT_ENC_UTF8 371 | 372 | /*Can break (wrap) texts on these chars*/ 373 | #define LV_TXT_BREAK_CHARS " ,.;:-_" 374 | 375 | /*If a word is at least this long, will break wherever "prettiest" 376 | *To disable, set to a value <= 0*/ 377 | #define LV_TXT_LINE_BREAK_LONG_LEN 0 378 | 379 | /*Minimum number of characters in a long word to put on a line before a break. 380 | *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ 381 | #define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 382 | 383 | /*Minimum number of characters in a long word to put on a line after a break. 384 | *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ 385 | #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 386 | 387 | /*The control character to use for signalling text recoloring.*/ 388 | #define LV_TXT_COLOR_CMD "#" 389 | 390 | /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. 391 | *The direction will be processed according to the Unicode Bidirectional Algorithm: 392 | *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ 393 | #define LV_USE_BIDI 1 394 | #if LV_USE_BIDI 395 | /*Set the default direction. Supported values: 396 | *`LV_BASE_DIR_LTR` Left-to-Right 397 | *`LV_BASE_DIR_RTL` Right-to-Left 398 | *`LV_BASE_DIR_AUTO` detect texts base direction*/ 399 | #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO 400 | #endif 401 | 402 | /*Enable Arabic/Persian processing 403 | *In these languages characters should be replaced with an other form based on their position in the text*/ 404 | #define LV_USE_ARABIC_PERSIAN_CHARS 1 405 | 406 | /*================== 407 | * WIDGET USAGE 408 | *================*/ 409 | 410 | /*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ 411 | 412 | #define LV_USE_ARC 1 413 | 414 | #define LV_USE_ANIMIMG 1 415 | 416 | #define LV_USE_BAR 1 417 | 418 | #define LV_USE_BTN 1 419 | 420 | #define LV_USE_BTNMATRIX 1 421 | 422 | #define LV_USE_CANVAS 1 423 | 424 | #define LV_USE_CHECKBOX 1 425 | 426 | #define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ 427 | 428 | #define LV_USE_IMG 1 /*Requires: lv_label*/ 429 | 430 | #define LV_USE_LABEL 1 431 | #if LV_USE_LABEL 432 | #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ 433 | #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ 434 | #endif 435 | 436 | #define LV_USE_LINE 1 437 | 438 | #define LV_USE_ROLLER 1 /*Requires: lv_label*/ 439 | #if LV_USE_ROLLER 440 | #define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ 441 | #endif 442 | 443 | #define LV_USE_SLIDER 1 /*Requires: lv_bar*/ 444 | 445 | #define LV_USE_SWITCH 1 446 | 447 | #define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ 448 | #if LV_USE_TEXTAREA != 0 449 | #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ 450 | #endif 451 | 452 | #define LV_USE_TABLE 1 453 | 454 | /*================== 455 | * EXTRA COMPONENTS 456 | *==================*/ 457 | 458 | /*----------- 459 | * Widgets 460 | *----------*/ 461 | #define LV_USE_CALENDAR 1 462 | #if LV_USE_CALENDAR 463 | #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 464 | #if LV_CALENDAR_WEEK_STARTS_MONDAY 465 | #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} 466 | #else 467 | #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} 468 | #endif 469 | 470 | #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} 471 | #define LV_USE_CALENDAR_HEADER_ARROW 1 472 | #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 473 | #endif /*LV_USE_CALENDAR*/ 474 | 475 | #define LV_USE_CHART 1 476 | 477 | #define LV_USE_COLORWHEEL 1 478 | 479 | #define LV_USE_IMGBTN 1 480 | 481 | #define LV_USE_KEYBOARD 1 482 | 483 | #define LV_USE_LED 1 484 | 485 | #define LV_USE_LIST 1 486 | 487 | #define LV_USE_MENU 1 488 | 489 | #define LV_USE_METER 1 490 | 491 | #define LV_USE_MSGBOX 1 492 | 493 | #define LV_USE_SPINBOX 1 494 | 495 | #define LV_USE_SPINNER 1 496 | 497 | #define LV_USE_TABVIEW 1 498 | 499 | #define LV_USE_TILEVIEW 1 500 | 501 | #define LV_USE_WIN 1 502 | 503 | #define LV_USE_SPAN 1 504 | #if LV_USE_SPAN 505 | /*A line text can contain maximum num of span descriptor */ 506 | #define LV_SPAN_SNIPPET_STACK_SIZE 64 507 | #endif 508 | 509 | /*----------- 510 | * Themes 511 | *----------*/ 512 | 513 | /*A simple, impressive and very complete theme*/ 514 | #define LV_USE_THEME_DEFAULT 1 515 | #if LV_USE_THEME_DEFAULT 516 | 517 | /*0: Light mode; 1: Dark mode*/ 518 | #define LV_THEME_DEFAULT_DARK 0 519 | 520 | /*1: Enable grow on press*/ 521 | #define LV_THEME_DEFAULT_GROW 1 522 | 523 | /*Default transition time in [ms]*/ 524 | #define LV_THEME_DEFAULT_TRANSITION_TIME 80 525 | #endif /*LV_USE_THEME_DEFAULT*/ 526 | 527 | /*A very simple theme that is a good starting point for a custom theme*/ 528 | #define LV_USE_THEME_BASIC 1 529 | 530 | /*A theme designed for monochrome displays*/ 531 | #define LV_USE_THEME_MONO 1 532 | 533 | /*----------- 534 | * Layouts 535 | *----------*/ 536 | 537 | /*A layout similar to Flexbox in CSS.*/ 538 | #define LV_USE_FLEX 1 539 | 540 | /*A layout similar to Grid in CSS.*/ 541 | #define LV_USE_GRID 1 542 | 543 | /*--------------------- 544 | * 3rd party libraries 545 | *--------------------*/ 546 | 547 | /*File system interfaces for common APIs 548 | *To enable set a driver letter for that API*/ 549 | #define LV_USE_FS_STDIO '\0' /*Uses fopen, fread, etc*/ 550 | //#define LV_FS_STDIO_PATH "/home/john/" /*Set the working directory. If commented it will be "./" */ 551 | 552 | #define LV_USE_FS_POSIX '\0' /*Uses open, read, etc*/ 553 | //#define LV_FS_POSIX_PATH "/home/john/" /*Set the working directory. If commented it will be "./" */ 554 | 555 | #define LV_USE_FS_WIN32 '/' /*Uses CreateFile, ReadFile, etc*/ 556 | //#define LV_FS_WIN32_PATH "C:\\Users\\john\\" /*Set the working directory. If commented it will be ".\\" */ 557 | 558 | #define LV_USE_FS_FATFS '\0' /*Uses f_open, f_read, etc*/ 559 | 560 | /*PNG decoder library*/ 561 | #define LV_USE_PNG 0 562 | 563 | /*BMP decoder library*/ 564 | #define LV_USE_BMP 0 565 | 566 | /* JPG + split JPG decoder library. 567 | * Split JPG is a custom format optimized for embedded systems. */ 568 | #define LV_USE_SJPG 0 569 | 570 | /*GIF decoder library*/ 571 | #define LV_USE_GIF 0 572 | 573 | /*QR code library*/ 574 | #define LV_USE_QRCODE 0 575 | 576 | /*FreeType library*/ 577 | #define LV_USE_FREETYPE 0 578 | #if LV_USE_FREETYPE 579 | /*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/ 580 | #define LV_FREETYPE_CACHE_SIZE (16 * 1024) 581 | #if LV_FREETYPE_CACHE_SIZE >= 0 582 | /* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */ 583 | /* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */ 584 | /* if font size >= 256, must be configured as image cache */ 585 | #define LV_FREETYPE_SBIT_CACHE 0 586 | /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ 587 | /* (0:use system defaults) */ 588 | #define LV_FREETYPE_CACHE_FT_FACES 0 589 | #define LV_FREETYPE_CACHE_FT_SIZES 0 590 | #endif 591 | #endif 592 | 593 | /*Rlottie library*/ 594 | #define LV_USE_RLOTTIE 0 595 | 596 | /*FFmpeg library for image decoding and playing videos 597 | *Supports all major image formats so do not enable other image decoder with it*/ 598 | #define LV_USE_FFMPEG 0 599 | #if LV_USE_FFMPEG 600 | /*Dump input information to stderr*/ 601 | #define LV_FFMPEG_AV_DUMP_FORMAT 0 602 | #endif 603 | 604 | /*----------- 605 | * Others 606 | *----------*/ 607 | 608 | /*1: Enable API to take snapshot for object*/ 609 | #define LV_USE_SNAPSHOT 1 610 | 611 | /*1: Enable Monkey test*/ 612 | #define LV_USE_MONKEY 0 613 | 614 | /*================== 615 | * EXAMPLES 616 | *==================*/ 617 | 618 | /*Enable the examples to be built with the library*/ 619 | #define LV_BUILD_EXAMPLES 1 620 | 621 | /*=================== 622 | * DEMO USAGE 623 | ====================*/ 624 | 625 | /*Show some widget*/ 626 | #define LV_USE_DEMO_WIDGETS 1 627 | #if LV_USE_DEMO_WIDGETS 628 | #define LV_DEMO_WIDGETS_SLIDESHOW 1 629 | #endif 630 | 631 | /*Demonstrate the usage of encoder and keyboard*/ 632 | #define LV_USE_DEMO_KEYPAD_AND_ENCODER 1 633 | 634 | /*Benchmark your system*/ 635 | #define LV_USE_DEMO_BENCHMARK 1 636 | 637 | /*Stress test for LVGL*/ 638 | #define LV_USE_DEMO_STRESS 1 639 | 640 | /*Music player demo*/ 641 | #define LV_USE_DEMO_MUSIC 1 642 | #if LV_USE_DEMO_MUSIC 643 | # define LV_DEMO_MUSIC_SQUARE 1 644 | # define LV_DEMO_MUSIC_LANDSCAPE 1 645 | # define LV_DEMO_MUSIC_ROUND 1 646 | # define LV_DEMO_MUSIC_LARGE 1 647 | # define LV_DEMO_MUSIC_AUTO_PLAY 1 648 | #endif 649 | 650 | /*--END OF LV_CONF_H--*/ 651 | 652 | #endif /*LV_CONF_H*/ 653 | 654 | #endif /*End of "Content enable"*/ 655 | -------------------------------------------------------------------------------- /LVGL.Windows.Desktop/LVGL.Windows.Desktop.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * PROJECT: LVGL ported to Windows Desktop 3 | * FILE: LVGL.Windows.Desktop.cpp 4 | * PURPOSE: Implementation for LVGL ported to Windows Desktop 5 | * 6 | * LICENSE: The MIT License 7 | * 8 | * DEVELOPER: Mouri_Naruto (Mouri_Naruto AT Outlook.com) 9 | */ 10 | 11 | #include 12 | #include 13 | 14 | #pragma comment(lib, "Imm32.lib") 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #if _MSC_VER >= 1200 25 | // Disable compilation warnings. 26 | #pragma warning(push) 27 | // nonstandard extension used : bit field types other than int 28 | #pragma warning(disable:4214) 29 | // 'conversion' conversion from 'type1' to 'type2', possible loss of data 30 | #pragma warning(disable:4244) 31 | // operator 'operator-name': deprecated between enumerations of different types 32 | #pragma warning(disable:5054) 33 | #endif 34 | 35 | #include "lvgl/lvgl.h" 36 | #include "lvgl/demos/lv_demos.h" 37 | 38 | #if _MSC_VER >= 1200 39 | // Restore compilation warnings. 40 | #pragma warning(pop) 41 | #endif 42 | 43 | #include 44 | 45 | /** 46 | * @brief Creates a B8G8R8A8 frame buffer. 47 | * @param WindowHandle A handle to the window for the creation of the frame 48 | * buffer. If this value is nullptr, the entire screen will 49 | * be referenced. 50 | * @param Width The width of the frame buffer. 51 | * @param Height The height of the frame buffer. 52 | * @param PixelBuffer The raw pixel buffer of the frame buffer you created. 53 | * @param PixelBufferSize The size of the frame buffer you created. 54 | * @return If the function succeeds, the return value is a handle to the device 55 | * context (DC) for the frame buffer. If the function fails, the return 56 | * value is nullptr, and PixelBuffer parameter is nullptr. 57 | */ 58 | EXTERN_C HDC WINAPI LvglCreateFrameBuffer( 59 | _In_opt_ HWND WindowHandle, 60 | _In_ LONG Width, 61 | _In_ LONG Height, 62 | _Out_ UINT32** PixelBuffer, 63 | _Out_ SIZE_T* PixelBufferSize) 64 | { 65 | HDC hFrameBufferDC = nullptr; 66 | 67 | if (PixelBuffer && PixelBufferSize) 68 | { 69 | HDC hWindowDC = ::GetDC(WindowHandle); 70 | if (hWindowDC) 71 | { 72 | hFrameBufferDC = ::CreateCompatibleDC(hWindowDC); 73 | ::ReleaseDC(WindowHandle, hWindowDC); 74 | } 75 | 76 | if (hFrameBufferDC) 77 | { 78 | BITMAPINFO BitmapInfo = { 0 }; 79 | BitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); 80 | BitmapInfo.bmiHeader.biWidth = Width; 81 | BitmapInfo.bmiHeader.biHeight = -Height; 82 | BitmapInfo.bmiHeader.biPlanes = 1; 83 | BitmapInfo.bmiHeader.biBitCount = 32; 84 | BitmapInfo.bmiHeader.biCompression = BI_RGB; 85 | 86 | HBITMAP hBitmap = ::CreateDIBSection( 87 | hFrameBufferDC, 88 | &BitmapInfo, 89 | DIB_RGB_COLORS, 90 | reinterpret_cast(PixelBuffer), 91 | nullptr, 92 | 0); 93 | if (hBitmap) 94 | { 95 | *PixelBufferSize = Width * Height * sizeof(UINT32); 96 | ::DeleteObject(::SelectObject(hFrameBufferDC, hBitmap)); 97 | ::DeleteObject(hBitmap); 98 | } 99 | else 100 | { 101 | ::DeleteDC(hFrameBufferDC); 102 | hFrameBufferDC = nullptr; 103 | } 104 | } 105 | } 106 | 107 | return hFrameBufferDC; 108 | } 109 | 110 | /** 111 | * @brief Returns the dots per inch (dpi) value for the associated window. 112 | * @param WindowHandle The window you want to get information about. 113 | * @return The DPI for the window. 114 | */ 115 | EXTERN_C UINT WINAPI LvglGetDpiForWindow( 116 | _In_ HWND WindowHandle) 117 | { 118 | UINT Result = static_cast(-1); 119 | 120 | HMODULE ModuleHandle = ::LoadLibraryW(L"SHCore.dll"); 121 | if (ModuleHandle) 122 | { 123 | typedef enum MONITOR_DPI_TYPE_PRIVATE { 124 | MDT_EFFECTIVE_DPI = 0, 125 | MDT_ANGULAR_DPI = 1, 126 | MDT_RAW_DPI = 2, 127 | MDT_DEFAULT = MDT_EFFECTIVE_DPI 128 | } MONITOR_DPI_TYPE_PRIVATE; 129 | 130 | typedef HRESULT(WINAPI* FunctionType)( 131 | HMONITOR, MONITOR_DPI_TYPE_PRIVATE, UINT*, UINT*); 132 | 133 | FunctionType pFunction = reinterpret_cast( 134 | ::GetProcAddress(ModuleHandle, "GetDpiForMonitor")); 135 | if (pFunction) 136 | { 137 | HMONITOR MonitorHandle = ::MonitorFromWindow( 138 | WindowHandle, 139 | MONITOR_DEFAULTTONEAREST); 140 | 141 | UINT dpiX = 0; 142 | UINT dpiY = 0; 143 | if (SUCCEEDED(pFunction( 144 | MonitorHandle, 145 | MDT_EFFECTIVE_DPI, 146 | &dpiX, 147 | &dpiY))) 148 | { 149 | Result = dpiX; 150 | } 151 | } 152 | 153 | ::FreeLibrary(ModuleHandle); 154 | } 155 | 156 | if (Result == static_cast(-1)) 157 | { 158 | HDC hWindowDC = ::GetDC(WindowHandle); 159 | if (hWindowDC) 160 | { 161 | Result = ::GetDeviceCaps(hWindowDC, LOGPIXELSX); 162 | ::ReleaseDC(WindowHandle, hWindowDC); 163 | } 164 | } 165 | 166 | if (Result == static_cast(-1)) 167 | { 168 | Result = USER_DEFAULT_SCREEN_DPI; 169 | } 170 | 171 | return Result; 172 | } 173 | 174 | EXTERN_C BOOL WINAPI LvglEnableChildWindowDpiMessage( 175 | HWND WindowHandle) 176 | { 177 | // This hack is only for Windows 10 TH1/TH2 only. 178 | // We don't need this hack if the Per Monitor Aware V2 is existed. 179 | OSVERSIONINFOEXW OSVersionInfoEx = { 0 }; 180 | OSVersionInfoEx.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW); 181 | OSVersionInfoEx.dwMajorVersion = 10; 182 | OSVersionInfoEx.dwMinorVersion = 0; 183 | OSVersionInfoEx.dwBuildNumber = 14393; 184 | if (!::VerifyVersionInfoW( 185 | &OSVersionInfoEx, 186 | VER_MAJORVERSION | VER_MINORVERSION | VER_BUILDNUMBER, 187 | ::VerSetConditionMask( 188 | ::VerSetConditionMask( 189 | ::VerSetConditionMask( 190 | 0, 191 | VER_MAJORVERSION, 192 | VER_GREATER_EQUAL), 193 | VER_MINORVERSION, 194 | VER_GREATER_EQUAL), 195 | VER_BUILDNUMBER, 196 | VER_LESS))) 197 | { 198 | return FALSE; 199 | } 200 | 201 | HMODULE ModuleHandle = ::GetModuleHandleW(L"user32.dll"); 202 | if (!ModuleHandle) 203 | { 204 | return FALSE; 205 | } 206 | 207 | typedef BOOL(WINAPI* FunctionType)(HWND, BOOL); 208 | 209 | FunctionType pFunction = reinterpret_cast( 210 | ::GetProcAddress(ModuleHandle, "EnableChildWindowDpiMessage")); 211 | if (!pFunction) 212 | { 213 | return FALSE; 214 | } 215 | 216 | return pFunction(WindowHandle, TRUE); 217 | } 218 | 219 | /** 220 | * @brief Registers a window as being touch-capable. 221 | * @param hWnd The handle of the window being registered. 222 | * @param ulFlags A set of bit flags that specify optional modifications. 223 | * @return If the function succeeds, the return value is nonzero. If the 224 | * function fails, the return value is zero. 225 | * @remark For more information, see RegisterTouchWindow. 226 | */ 227 | EXTERN_C BOOL WINAPI LvglRegisterTouchWindow( 228 | _In_ HWND hWnd, 229 | _In_ ULONG ulFlags) 230 | { 231 | HMODULE ModuleHandle = ::GetModuleHandleW(L"user32.dll"); 232 | if (!ModuleHandle) 233 | { 234 | return FALSE; 235 | } 236 | 237 | decltype(::RegisterTouchWindow)* pFunction = 238 | reinterpret_cast( 239 | ::GetProcAddress(ModuleHandle, "RegisterTouchWindow")); 240 | if (!pFunction) 241 | { 242 | return FALSE; 243 | } 244 | 245 | return pFunction(hWnd, ulFlags); 246 | } 247 | 248 | /** 249 | * @brief Retrieves detailed information about touch inputs associated with a 250 | * particular touch input handle. 251 | * @param hTouchInput The touch input handle received in the LPARAM of a touch 252 | * message. 253 | * @param cInputs The number of structures in the pInputs array. 254 | * @param pInputs A pointer to an array of TOUCHINPUT structures to receive 255 | * information about the touch points associated with the 256 | * specified touch input handle. 257 | * @param cbSize The size, in bytes, of a single TOUCHINPUT structure. 258 | * @return If the function succeeds, the return value is nonzero. If the 259 | * function fails, the return value is zero. 260 | * @remark For more information, see GetTouchInputInfo. 261 | */ 262 | EXTERN_C BOOL WINAPI LvglGetTouchInputInfo( 263 | _In_ HTOUCHINPUT hTouchInput, 264 | _In_ UINT cInputs, 265 | _Out_ PTOUCHINPUT pInputs, 266 | _In_ int cbSize) 267 | { 268 | HMODULE ModuleHandle = ::GetModuleHandleW(L"user32.dll"); 269 | if (!ModuleHandle) 270 | { 271 | return FALSE; 272 | } 273 | 274 | decltype(::GetTouchInputInfo)* pFunction = 275 | reinterpret_cast( 276 | ::GetProcAddress(ModuleHandle, "GetTouchInputInfo")); 277 | if (!pFunction) 278 | { 279 | return FALSE; 280 | } 281 | 282 | return pFunction(hTouchInput, cInputs, pInputs, cbSize); 283 | } 284 | 285 | /** 286 | * @brief Closes a touch input handle, frees process memory associated with it, 287 | and invalidates the handle. 288 | * @param hTouchInput The touch input handle received in the LPARAM of a touch 289 | * message. 290 | * @return If the function succeeds, the return value is nonzero. If the 291 | * function fails, the return value is zero. 292 | * @remark For more information, see CloseTouchInputHandle. 293 | */ 294 | EXTERN_C BOOL WINAPI LvglCloseTouchInputHandle( 295 | _In_ HTOUCHINPUT hTouchInput) 296 | { 297 | HMODULE ModuleHandle = ::GetModuleHandleW(L"user32.dll"); 298 | if (!ModuleHandle) 299 | { 300 | return FALSE; 301 | } 302 | 303 | decltype(::CloseTouchInputHandle)* pFunction = 304 | reinterpret_cast( 305 | ::GetProcAddress(ModuleHandle, "CloseTouchInputHandle")); 306 | if (!pFunction) 307 | { 308 | return FALSE; 309 | } 310 | 311 | return pFunction(hTouchInput); 312 | } 313 | 314 | 315 | 316 | 317 | static HINSTANCE g_InstanceHandle = nullptr; 318 | static int volatile g_WindowWidth = 0; 319 | static int volatile g_WindowHeight = 0; 320 | static HWND g_WindowHandle = nullptr; 321 | static int volatile g_WindowDPI = USER_DEFAULT_SCREEN_DPI; 322 | static HDC g_WindowDCHandle = nullptr; 323 | 324 | static HDC g_BufferDCHandle = nullptr; 325 | static UINT32* g_PixelBuffer = nullptr; 326 | static SIZE_T g_PixelBufferSize = 0; 327 | 328 | static bool volatile g_MousePressed; 329 | static LPARAM volatile g_MouseValue = 0; 330 | 331 | static bool volatile g_MouseWheelPressed = false; 332 | static int16_t volatile g_MouseWheelValue = 0; 333 | 334 | static bool volatile g_WindowQuitSignal = false; 335 | static bool volatile g_WindowResizingSignal = false; 336 | 337 | std::mutex g_KeyboardMutex; 338 | std::queue> g_KeyQueue; 339 | static uint16_t volatile g_Utf16HighSurrogate = 0; 340 | static uint16_t volatile g_Utf16LowSurrogate = 0; 341 | static lv_group_t* volatile g_DefaultGroup = nullptr; 342 | 343 | void LvglDisplayDriverFlushCallback( 344 | lv_disp_drv_t* disp_drv, 345 | const lv_area_t* area, 346 | lv_color_t* color_p) 347 | { 348 | UNREFERENCED_PARAMETER(color_p); 349 | 350 | if (::lv_disp_flush_is_last(disp_drv)) 351 | { 352 | lv_coord_t Width = ::lv_area_get_width(area); 353 | lv_coord_t Height = ::lv_area_get_height(area); 354 | 355 | ::BitBlt( 356 | g_WindowDCHandle, 357 | area->x1, 358 | area->y1, 359 | Width, 360 | Height, 361 | g_BufferDCHandle, 362 | area->x1, 363 | area->y1, 364 | SRCCOPY); 365 | } 366 | 367 | ::lv_disp_flush_ready(disp_drv); 368 | } 369 | 370 | #include 371 | 372 | typedef lv_draw_sw_ctx_t LvglWindowsGdiRendererContext; 373 | 374 | std::map g_SolidBrushCache; 375 | 376 | void LvglWindowsGdiRendererBlendCallback( 377 | lv_draw_ctx_t* draw_ctx, 378 | const lv_draw_sw_blend_dsc_t* dsc) 379 | { 380 | // Let's get the blend area which is the intersection of the area to fill 381 | // and the clip area. 382 | lv_area_t blend_area; 383 | if (!_lv_area_intersect(&blend_area, dsc->blend_area, draw_ctx->clip_area)) 384 | { 385 | return; 386 | } 387 | 388 | // Fallback: The GPU doesn't support these settings. Call the Software 389 | // Renderer. 390 | if (!( 391 | dsc->mask_buf == nullptr && 392 | dsc->opa >= LV_OPA_MAX && 393 | dsc->blend_mode == LV_BLEND_MODE_NORMAL)) 394 | { 395 | ::lv_draw_sw_blend_basic(draw_ctx, dsc); 396 | return; 397 | } 398 | 399 | if (dsc->src_buf) 400 | { 401 | lv_coord_t Width = ::lv_area_get_width(&blend_area); 402 | lv_coord_t Height = ::lv_area_get_height(&blend_area); 403 | 404 | BITMAPINFO BitmapInfo = { 0 }; 405 | BitmapInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); 406 | BitmapInfo.bmiHeader.biWidth = Width; 407 | BitmapInfo.bmiHeader.biHeight = -Height; 408 | BitmapInfo.bmiHeader.biPlanes = 1; 409 | BitmapInfo.bmiHeader.biBitCount = 32; 410 | BitmapInfo.bmiHeader.biCompression = BI_RGB; 411 | 412 | ::StretchDIBits( 413 | g_BufferDCHandle, 414 | blend_area.x1, 415 | blend_area.y1, 416 | Width, 417 | Height, 418 | 0, 419 | 0, 420 | Width, 421 | Height, 422 | dsc->src_buf, 423 | &BitmapInfo, 424 | DIB_RGB_COLORS, 425 | SRCCOPY); 426 | } 427 | else 428 | { 429 | // Fill only non masked, fully opaque, normal blended and not too small 430 | // areas. 431 | 432 | HBRUSH Brush = nullptr; 433 | { 434 | std::uint32_t Index = ::lv_color_to32(dsc->color); 435 | auto Iterator = g_SolidBrushCache.find(Index); 436 | if (Iterator != g_SolidBrushCache.end()) 437 | { 438 | Brush = Iterator->second; 439 | } 440 | else 441 | { 442 | Brush = ::CreateSolidBrush(RGB( 443 | LV_COLOR_GET_R(dsc->color), 444 | LV_COLOR_GET_G(dsc->color), 445 | LV_COLOR_GET_B(dsc->color))); 446 | if (Brush) 447 | { 448 | g_SolidBrushCache.emplace(std::make_pair(Index, Brush)); 449 | } 450 | } 451 | } 452 | 453 | if (Brush) 454 | { 455 | RECT RenderArea; 456 | RenderArea.left = blend_area.x1; 457 | RenderArea.top = blend_area.y1; 458 | RenderArea.right = blend_area.x2 + 1; 459 | RenderArea.bottom = blend_area.y2 + 1; 460 | ::FillRect(g_BufferDCHandle, &RenderArea, Brush); 461 | } 462 | } 463 | } 464 | 465 | void LvglWindowsGdiRendererBaseDrawWaitForFinishCallback( 466 | lv_draw_ctx_t* draw_ctx) 467 | { 468 | ::lv_draw_sw_wait_for_finish(draw_ctx); 469 | } 470 | 471 | void LvglWindowsGdiRendererInitialize( 472 | lv_disp_drv_t* drv, 473 | lv_draw_ctx_t* draw_ctx) 474 | { 475 | // Initialize the LVGL Software Renderer 476 | ::lv_draw_sw_init_ctx(drv, draw_ctx); 477 | 478 | LvglWindowsGdiRendererContext* RendererContext = 479 | reinterpret_cast(draw_ctx); 480 | 481 | RendererContext->blend = 482 | LvglWindowsGdiRendererBlendCallback; 483 | RendererContext->base_draw.wait_for_finish = 484 | LvglWindowsGdiRendererBaseDrawWaitForFinishCallback; 485 | } 486 | 487 | void LvglCreateDisplayDriver( 488 | lv_disp_drv_t* disp_drv, 489 | int hor_res, 490 | int ver_res) 491 | { 492 | HDC hNewBufferDC = ::LvglCreateFrameBuffer( 493 | g_WindowHandle, 494 | hor_res, 495 | ver_res, 496 | &g_PixelBuffer, 497 | &g_PixelBufferSize); 498 | 499 | ::DeleteDC(g_BufferDCHandle); 500 | g_BufferDCHandle = hNewBufferDC; 501 | 502 | lv_disp_draw_buf_t* disp_buf = new lv_disp_draw_buf_t(); 503 | ::lv_disp_draw_buf_init( 504 | disp_buf, 505 | g_PixelBuffer, 506 | nullptr, 507 | hor_res * ver_res); 508 | 509 | disp_drv->hor_res = static_cast(hor_res); 510 | disp_drv->ver_res = static_cast(ver_res); 511 | disp_drv->flush_cb = ::LvglDisplayDriverFlushCallback; 512 | if (disp_drv->draw_buf != NULL) 513 | delete disp_drv->draw_buf; 514 | disp_drv->draw_buf = disp_buf; 515 | disp_drv->dpi = g_WindowDPI; 516 | disp_drv->direct_mode = 1; 517 | disp_drv->draw_ctx_init = LvglWindowsGdiRendererInitialize; 518 | disp_drv->draw_ctx_size = sizeof(LvglWindowsGdiRendererContext); 519 | } 520 | 521 | void LvglMouseDriverReadCallback( 522 | lv_indev_drv_t* indev_drv, 523 | lv_indev_data_t* data) 524 | { 525 | UNREFERENCED_PARAMETER(indev_drv); 526 | 527 | data->state = static_cast( 528 | g_MousePressed ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL); 529 | data->point.x = GET_X_LPARAM(g_MouseValue); 530 | data->point.y = GET_Y_LPARAM(g_MouseValue); 531 | } 532 | 533 | void LvglKeyboardDriverReadCallback( 534 | lv_indev_drv_t* indev_drv, 535 | lv_indev_data_t* data) 536 | { 537 | UNREFERENCED_PARAMETER(indev_drv); 538 | 539 | std::lock_guard KeyboardMutexGuard(g_KeyboardMutex); 540 | 541 | if (!g_KeyQueue.empty()) 542 | { 543 | auto Current = g_KeyQueue.front(); 544 | 545 | data->key = Current.first; 546 | data->state = Current.second; 547 | 548 | g_KeyQueue.pop(); 549 | } 550 | 551 | if (!g_KeyQueue.empty()) 552 | { 553 | data->continue_reading = true; 554 | } 555 | } 556 | 557 | void LvglMousewheelDriverReadCallback( 558 | lv_indev_drv_t* indev_drv, 559 | lv_indev_data_t* data) 560 | { 561 | UNREFERENCED_PARAMETER(indev_drv); 562 | 563 | data->state = static_cast( 564 | g_MouseWheelPressed ? LV_INDEV_STATE_PR : LV_INDEV_STATE_REL); 565 | data->enc_diff = g_MouseWheelValue; 566 | g_MouseWheelValue = 0; 567 | } 568 | 569 | LRESULT CALLBACK WndProc( 570 | _In_ HWND hWnd, 571 | _In_ UINT uMsg, 572 | _In_ WPARAM wParam, 573 | _In_ LPARAM lParam) 574 | { 575 | switch (uMsg) 576 | { 577 | case WM_CREATE: 578 | { 579 | RECT WindowRect; 580 | ::GetClientRect(hWnd, &WindowRect); 581 | 582 | g_WindowWidth = WindowRect.right - WindowRect.left; 583 | g_WindowHeight = WindowRect.bottom - WindowRect.top; 584 | 585 | g_WindowDCHandle = ::GetDC(hWnd); 586 | 587 | return 0; 588 | } 589 | case WM_MOUSEMOVE: 590 | case WM_LBUTTONDOWN: 591 | case WM_LBUTTONUP: 592 | case WM_MBUTTONDOWN: 593 | case WM_MBUTTONUP: 594 | { 595 | g_MouseValue = lParam; 596 | if (uMsg == WM_LBUTTONDOWN || uMsg == WM_LBUTTONUP) 597 | { 598 | g_MousePressed = (uMsg == WM_LBUTTONDOWN); 599 | } 600 | else if (uMsg == WM_MBUTTONDOWN || uMsg == WM_MBUTTONUP) 601 | { 602 | g_MouseWheelPressed = (uMsg == WM_MBUTTONDOWN); 603 | } 604 | return 0; 605 | } 606 | case WM_KEYDOWN: 607 | case WM_KEYUP: 608 | { 609 | std::lock_guard KeyboardMutexGuard(g_KeyboardMutex); 610 | 611 | bool SkipTranslation = false; 612 | std::uint32_t TranslatedKey = 0; 613 | 614 | switch (wParam) 615 | { 616 | case VK_UP: 617 | TranslatedKey = LV_KEY_UP; 618 | break; 619 | case VK_DOWN: 620 | TranslatedKey = LV_KEY_DOWN; 621 | break; 622 | case VK_LEFT: 623 | TranslatedKey = LV_KEY_LEFT; 624 | break; 625 | case VK_RIGHT: 626 | TranslatedKey = LV_KEY_RIGHT; 627 | break; 628 | case VK_ESCAPE: 629 | TranslatedKey = LV_KEY_ESC; 630 | break; 631 | case VK_DELETE: 632 | TranslatedKey = LV_KEY_DEL; 633 | break; 634 | case VK_BACK: 635 | TranslatedKey = LV_KEY_BACKSPACE; 636 | break; 637 | case VK_RETURN: 638 | TranslatedKey = LV_KEY_ENTER; 639 | break; 640 | case VK_NEXT: 641 | TranslatedKey = LV_KEY_NEXT; 642 | break; 643 | case VK_PRIOR: 644 | TranslatedKey = LV_KEY_PREV; 645 | break; 646 | case VK_HOME: 647 | TranslatedKey = LV_KEY_HOME; 648 | break; 649 | case VK_END: 650 | TranslatedKey = LV_KEY_END; 651 | break; 652 | default: 653 | SkipTranslation = true; 654 | break; 655 | } 656 | 657 | if (!SkipTranslation) 658 | { 659 | g_KeyQueue.push(std::make_pair( 660 | TranslatedKey, 661 | static_cast( 662 | (uMsg == WM_KEYUP) 663 | ? LV_INDEV_STATE_REL 664 | : LV_INDEV_STATE_PR))); 665 | } 666 | 667 | break; 668 | } 669 | case WM_CHAR: 670 | { 671 | std::lock_guard KeyboardMutexGuard(g_KeyboardMutex); 672 | 673 | uint16_t RawCodePoint = static_cast(wParam); 674 | 675 | if (RawCodePoint >= 0x20 && RawCodePoint != 0x7F) 676 | { 677 | if (IS_HIGH_SURROGATE(RawCodePoint)) 678 | { 679 | g_Utf16HighSurrogate = RawCodePoint; 680 | } 681 | else if (IS_LOW_SURROGATE(RawCodePoint)) 682 | { 683 | g_Utf16LowSurrogate = RawCodePoint; 684 | } 685 | 686 | uint32_t CodePoint = RawCodePoint; 687 | 688 | if (g_Utf16HighSurrogate && g_Utf16LowSurrogate) 689 | { 690 | CodePoint = (g_Utf16LowSurrogate & 0x03FF); 691 | CodePoint += (((g_Utf16HighSurrogate & 0x03FF) + 0x40) << 10); 692 | 693 | g_Utf16HighSurrogate = 0; 694 | g_Utf16LowSurrogate = 0; 695 | } 696 | 697 | uint32_t LvglCodePoint = ::_lv_txt_unicode_to_encoded(CodePoint); 698 | 699 | g_KeyQueue.push(std::make_pair( 700 | LvglCodePoint, 701 | static_cast(LV_INDEV_STATE_PR))); 702 | 703 | g_KeyQueue.push(std::make_pair( 704 | LvglCodePoint, 705 | static_cast(LV_INDEV_STATE_REL))); 706 | } 707 | 708 | break; 709 | } 710 | case WM_IME_SETCONTEXT: 711 | { 712 | if (wParam == TRUE) 713 | { 714 | HIMC hInputMethodContext = ::ImmGetContext(hWnd); 715 | if (hInputMethodContext) 716 | { 717 | ::ImmAssociateContext(hWnd, hInputMethodContext); 718 | ::ImmReleaseContext(hWnd, hInputMethodContext); 719 | } 720 | } 721 | 722 | return ::DefWindowProcW(hWnd, uMsg, wParam, wParam); 723 | } 724 | case WM_IME_STARTCOMPOSITION: 725 | { 726 | HIMC hInputMethodContext = ::ImmGetContext(hWnd); 727 | if (hInputMethodContext) 728 | { 729 | lv_obj_t* TextareaObject = nullptr; 730 | lv_obj_t* FocusedObject = ::lv_group_get_focused(g_DefaultGroup); 731 | if (FocusedObject) 732 | { 733 | const lv_obj_class_t* ObjectClass = ::lv_obj_get_class( 734 | FocusedObject); 735 | 736 | if (ObjectClass == &lv_textarea_class) 737 | { 738 | TextareaObject = FocusedObject; 739 | } 740 | else if (ObjectClass == &lv_keyboard_class) 741 | { 742 | TextareaObject = ::lv_keyboard_get_textarea(FocusedObject); 743 | } 744 | } 745 | 746 | COMPOSITIONFORM CompositionForm; 747 | CompositionForm.dwStyle = CFS_POINT; 748 | CompositionForm.ptCurrentPos.x = 0; 749 | CompositionForm.ptCurrentPos.y = 0; 750 | 751 | if (TextareaObject) 752 | { 753 | lv_textarea_t* Textarea = reinterpret_cast( 754 | TextareaObject); 755 | lv_obj_t* Label = ::lv_textarea_get_label(TextareaObject); 756 | 757 | CompositionForm.ptCurrentPos.x = 758 | Label->coords.x1 + Textarea->cursor.area.x1; 759 | CompositionForm.ptCurrentPos.y = 760 | Label->coords.y1 + Textarea->cursor.area.y1; 761 | } 762 | 763 | ::ImmSetCompositionWindow(hInputMethodContext, &CompositionForm); 764 | ::ImmReleaseContext(hWnd, hInputMethodContext); 765 | } 766 | 767 | return ::DefWindowProcW(hWnd, uMsg, wParam, wParam); 768 | } 769 | case WM_MOUSEWHEEL: 770 | { 771 | g_MouseWheelValue = -(GET_WHEEL_DELTA_WPARAM(wParam) / WHEEL_DELTA); 772 | break; 773 | } 774 | case WM_TOUCH: 775 | { 776 | UINT cInputs = LOWORD(wParam); 777 | HTOUCHINPUT hTouchInput = reinterpret_cast(lParam); 778 | 779 | PTOUCHINPUT pInputs = new TOUCHINPUT[cInputs]; 780 | if (pInputs) 781 | { 782 | if (::LvglGetTouchInputInfo( 783 | hTouchInput, 784 | cInputs, 785 | pInputs, 786 | sizeof(TOUCHINPUT))) 787 | { 788 | for (UINT i = 0; i < cInputs; ++i) 789 | { 790 | POINT Point; 791 | Point.x = TOUCH_COORD_TO_PIXEL(pInputs[i].x); 792 | Point.y = TOUCH_COORD_TO_PIXEL(pInputs[i].y); 793 | if (!::ScreenToClient(hWnd, &Point)) 794 | { 795 | continue; 796 | } 797 | 798 | std::uint16_t x = static_cast( 799 | Point.x & 0xffff); 800 | std::uint16_t y = static_cast( 801 | Point.y & 0xffff); 802 | 803 | DWORD MousePressedMask = 804 | TOUCHEVENTF_MOVE | TOUCHEVENTF_DOWN; 805 | 806 | g_MouseValue = (y << 16) | x; 807 | g_MousePressed = (pInputs[i].dwFlags & MousePressedMask); 808 | } 809 | } 810 | 811 | delete[] pInputs; 812 | } 813 | 814 | ::LvglCloseTouchInputHandle(hTouchInput); 815 | 816 | break; 817 | } 818 | case WM_SIZE: 819 | { 820 | if (wParam != SIZE_MINIMIZED) 821 | { 822 | int CurrentWindowWidth = LOWORD(lParam); 823 | int CurrentWindowHeight = HIWORD(lParam); 824 | if (CurrentWindowWidth != g_WindowWidth || 825 | CurrentWindowHeight != g_WindowHeight) 826 | { 827 | g_WindowWidth = CurrentWindowWidth; 828 | g_WindowHeight = CurrentWindowHeight; 829 | 830 | g_WindowResizingSignal = true; 831 | } 832 | } 833 | break; 834 | } 835 | case WM_DPICHANGED: 836 | { 837 | g_WindowDPI = HIWORD(wParam); 838 | 839 | // Resize the window 840 | auto lprcNewScale = reinterpret_cast(lParam); 841 | 842 | ::SetWindowPos( 843 | hWnd, 844 | nullptr, 845 | lprcNewScale->left, 846 | lprcNewScale->top, 847 | lprcNewScale->right - lprcNewScale->left, 848 | lprcNewScale->bottom - lprcNewScale->top, 849 | SWP_NOZORDER | SWP_NOACTIVATE); 850 | 851 | break; 852 | } 853 | case WM_DESTROY: 854 | ::PostQuitMessage(0); 855 | break; 856 | default: 857 | return ::DefWindowProcW(hWnd, uMsg, wParam, lParam); 858 | } 859 | 860 | return 0; 861 | } 862 | 863 | #include "resource.h" 864 | 865 | bool LvglWindowsInitialize( 866 | _In_ HINSTANCE hInstance, 867 | _In_ int nShowCmd, 868 | _In_opt_ LPCWSTR DefaultFontName) 869 | { 870 | ::LvglWindowsGdiFontInitialize(DefaultFontName); 871 | 872 | HICON IconHandle = ::LoadIconW( 873 | ::GetModuleHandleW(nullptr), 874 | MAKEINTRESOURCE(IDI_LVGL)); 875 | 876 | WNDCLASSEXW WindowClass; 877 | 878 | WindowClass.cbSize = sizeof(WNDCLASSEXW); 879 | 880 | WindowClass.style = 0; 881 | WindowClass.lpfnWndProc = ::WndProc; 882 | WindowClass.cbClsExtra = 0; 883 | WindowClass.cbWndExtra = 0; 884 | WindowClass.hInstance = hInstance; 885 | WindowClass.hIcon = IconHandle; 886 | WindowClass.hCursor = ::LoadCursorW(nullptr, IDC_ARROW); 887 | WindowClass.hbrBackground = reinterpret_cast(COLOR_WINDOW + 1); 888 | WindowClass.lpszMenuName = nullptr; 889 | WindowClass.lpszClassName = L"lv_port_windows"; 890 | WindowClass.hIconSm = IconHandle; 891 | 892 | if (!::RegisterClassExW(&WindowClass)) 893 | { 894 | return false; 895 | } 896 | 897 | g_InstanceHandle = hInstance; 898 | 899 | g_WindowHandle = ::CreateWindowExW( 900 | WS_EX_CLIENTEDGE, 901 | WindowClass.lpszClassName, 902 | L"LVGL ported to Windows Desktop", 903 | WS_OVERLAPPEDWINDOW, 904 | CW_USEDEFAULT, 905 | 0, 906 | CW_USEDEFAULT, 907 | 0, 908 | nullptr, 909 | nullptr, 910 | hInstance, 911 | nullptr); 912 | 913 | if (!g_WindowHandle) 914 | { 915 | return false; 916 | } 917 | 918 | ::LvglRegisterTouchWindow(g_WindowHandle, 0); 919 | 920 | ::LvglEnableChildWindowDpiMessage(g_WindowHandle); 921 | g_WindowDPI = ::LvglGetDpiForWindow(g_WindowHandle); 922 | 923 | static lv_disp_drv_t disp_drv; 924 | ::lv_disp_drv_init(&disp_drv); 925 | ::LvglCreateDisplayDriver(&disp_drv, g_WindowWidth, g_WindowHeight); 926 | ::lv_disp_drv_register(&disp_drv); 927 | 928 | g_DefaultGroup = ::lv_group_create(); 929 | ::lv_group_set_default(g_DefaultGroup); 930 | 931 | static lv_indev_drv_t indev_drv; 932 | ::lv_indev_drv_init(&indev_drv); 933 | indev_drv.type = LV_INDEV_TYPE_POINTER; 934 | indev_drv.read_cb = ::LvglMouseDriverReadCallback; 935 | ::lv_indev_set_group( 936 | ::lv_indev_drv_register(&indev_drv), 937 | g_DefaultGroup); 938 | 939 | static lv_indev_drv_t kb_drv; 940 | lv_indev_drv_init(&kb_drv); 941 | kb_drv.type = LV_INDEV_TYPE_KEYPAD; 942 | kb_drv.read_cb = ::LvglKeyboardDriverReadCallback; 943 | ::lv_indev_set_group( 944 | ::lv_indev_drv_register(&kb_drv), 945 | g_DefaultGroup); 946 | 947 | static lv_indev_drv_t enc_drv; 948 | lv_indev_drv_init(&enc_drv); 949 | enc_drv.type = LV_INDEV_TYPE_ENCODER; 950 | enc_drv.read_cb = ::LvglMousewheelDriverReadCallback; 951 | ::lv_indev_set_group( 952 | ::lv_indev_drv_register(&enc_drv), 953 | g_DefaultGroup); 954 | 955 | ::ShowWindow(g_WindowHandle, nShowCmd); 956 | ::UpdateWindow(g_WindowHandle); 957 | 958 | return true; 959 | } 960 | 961 | void LvglTaskSchedulerLoop() 962 | { 963 | while (!g_WindowQuitSignal) 964 | { 965 | if (g_WindowResizingSignal) 966 | { 967 | lv_disp_t* CurrentDisplay = ::lv_disp_get_default(); 968 | if (CurrentDisplay) 969 | { 970 | ::LvglCreateDisplayDriver( 971 | CurrentDisplay->driver, 972 | g_WindowWidth, 973 | g_WindowHeight); 974 | ::lv_disp_drv_update( 975 | CurrentDisplay, 976 | CurrentDisplay->driver); 977 | 978 | ::lv_refr_now(CurrentDisplay); 979 | } 980 | 981 | g_WindowResizingSignal = false; 982 | } 983 | 984 | ::lv_timer_handler(); 985 | ::Sleep(1); 986 | } 987 | } 988 | 989 | int LvglWindowsLoop() 990 | { 991 | MSG Message; 992 | while (::GetMessageW(&Message, nullptr, 0, 0)) 993 | { 994 | ::TranslateMessage(&Message); 995 | ::DispatchMessageW(&Message); 996 | 997 | if (Message.message == WM_QUIT) 998 | { 999 | g_WindowQuitSignal = true; 1000 | } 1001 | } 1002 | 1003 | return static_cast(Message.wParam); 1004 | } 1005 | 1006 | #include 1007 | 1008 | int WINAPI wWinMain( 1009 | _In_ HINSTANCE hInstance, 1010 | _In_opt_ HINSTANCE hPrevInstance, 1011 | _In_ LPWSTR lpCmdLine, 1012 | _In_ int nShowCmd) 1013 | { 1014 | UNREFERENCED_PARAMETER(hPrevInstance); 1015 | UNREFERENCED_PARAMETER(lpCmdLine); 1016 | 1017 | ::lv_init(); 1018 | 1019 | if (!LvglWindowsInitialize( 1020 | hInstance, 1021 | nShowCmd, 1022 | nullptr)) 1023 | { 1024 | return -1; 1025 | } 1026 | 1027 | //::lv_demo_widgets(); 1028 | //::lv_demo_keypad_encoder(); 1029 | ::lv_demo_benchmark(); 1030 | 1031 | std::thread(::LvglTaskSchedulerLoop).detach(); 1032 | 1033 | return ::LvglWindowsLoop(); 1034 | } 1035 | -------------------------------------------------------------------------------- /LVGL.Windows/LVGL.Portable.vcxitems: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | 996 | 997 | 998 | 999 | 1000 | 1001 | 1002 | 1003 | 1004 | 1005 | 1006 | 1007 | 1008 | 1009 | 1010 | 1011 | 1012 | 1013 | 1014 | 1015 | 1016 | 1017 | 1018 | 1019 | 1020 | 1021 | 1022 | 1023 | 1024 | 1025 | 1026 | 1027 | 1028 | 1029 | 1030 | 1031 | 1032 | 1033 | 1034 | 1035 | 1036 | 1037 | 1038 | 1039 | 1040 | 1041 | 1042 | 1043 | 1044 | 1045 | 1046 | 1047 | 1048 | 1049 | 1050 | 1051 | 1052 | 1053 | 1054 | 1055 | 1056 | 1057 | 1058 | 1059 | 1060 | 1061 | 1062 | 1063 | 1064 | 1065 | 1066 | 1067 | 1068 | 1069 | 1070 | 1071 | 1072 | 1073 | 1074 | 1075 | 1076 | 1077 | 1078 | 1079 | 1080 | 1081 | 1082 | 1083 | 1084 | 1085 | 1086 | 1087 | 1088 | 1089 | 1090 | 1091 | 1092 | 1093 | 1094 | 1095 | 1096 | 1097 | 1098 | 1099 | 1100 | 1101 | 1102 | 1103 | 1104 | 1105 | 1106 | 1107 | 1108 | 1109 | 1110 | 1111 | 1112 | 1113 | 1114 | 1115 | 1116 | 1117 | 1118 | 1119 | 1120 | 1121 | 1122 | 1123 | 1124 | 1125 | 1126 | 1127 | 1128 | 1129 | 1130 | 1131 | 1132 | 1133 | 1134 | 1135 | 1136 | 1137 | 1138 | 1139 | 1140 | 1141 | 1142 | 1143 | 1144 | 1145 | 1146 | 1147 | 1148 | 1149 | 1150 | 1151 | 1152 | 1153 | 1154 | 1155 | 1156 | 1157 | 1158 | 1159 | 1160 | 1161 | 1162 | 1163 | 1164 | 1165 | 1166 | 1167 | 1168 | 1169 | 1170 | 1171 | 1172 | 1173 | 1174 | 1175 | 1176 | 1177 | 1178 | --------------------------------------------------------------------------------