Skip to content

Commit 03fd88e

Browse files
committed
Inital commit
0 parents  commit 03fd88e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+14719
-0
lines changed

.gitignore

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Object files
5+
*.o
6+
*.ko
7+
*.obj
8+
*.elf
9+
10+
# Linker output
11+
*.ilk
12+
*.map
13+
*.exp
14+
15+
# Precompiled Headers
16+
*.gch
17+
*.pch
18+
19+
# Libraries
20+
*.lib
21+
*.a
22+
*.la
23+
*.lo
24+
25+
# Shared objects (inc. Windows DLLs)
26+
*.dll
27+
*.so
28+
*.so.*
29+
*.dylib
30+
31+
# Executables
32+
*.exe
33+
*.out
34+
*.app
35+
*.i*86
36+
*.x86_64
37+
*.hex
38+
39+
# Debug files
40+
*.dSYM/
41+
*.su
42+
*.idb
43+
*.pdb
44+
45+
# Kernel Module Compile Results
46+
*.mod*
47+
*.cmd
48+
.tmp_versions/
49+
modules.order
50+
Module.symvers
51+
Mkfile.old
52+
dkms.conf
53+
54+
lvgl.html
55+
lvgl.js
56+
lvgl.wasm
57+
58+
# CMake output
59+
build/*
60+
.vscode
61+
62+
*.eez-project-ui-state

.gitmodules

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[submodule "eez"]
2+
path = eez-framework
3+
url = https://github.com/eez-open/eez-framework
4+
[submodule "lvgl"]
5+
path = lvgl
6+
url = https://github.com/littlevgl/lvgl.git
7+
branch = release/v8.3
8+
[submodule "lv_drivers"]
9+
path = lv_drivers
10+
url = https://github.com/littlevgl/lv_drivers.git
11+
branch = release/v8.3
12+
[submodule "eez-framework"]
13+
path = eez-framework
14+
url = https://github.com/eez-open/eez-framework

CMakeLists.txt

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
cmake_minimum_required(VERSION 3.12)
2+
project (native-interface-lvgl-no-flow)
3+
4+
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -O2")
5+
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s INITIAL_MEMORY=83886080 -sLLD_REPORT_UNDEFINED -s USE_SDL=2")
6+
7+
include_directories(${PROJECT_SOURCE_DIR})
8+
9+
add_subdirectory(lvgl)
10+
add_subdirectory(lv_drivers)
11+
file(GLOB MY_SOURCES "./*.c")
12+
set(SOURCES ${MY_SOURCES})
13+
14+
# Comment out following statements to build project without eez flow support.
15+
# Also, build lvgl-demo-no-flow.eez-project with EEZ Studio.
16+
add_definitions(-DHAS_FLOW_SUPPORT=1)
17+
set (HAS_FLOW_SUPPORT 1)
18+
19+
file(GLOB_RECURSE my_src
20+
./src/*.cpp
21+
./src/*.c
22+
)
23+
list(APPEND SOURCES ${my_src})
24+
25+
if (${HAS_FLOW_SUPPORT})
26+
################################################################################
27+
# EEZ Framework
28+
add_definitions(-DEEZ_FOR_LVGL)
29+
30+
include_directories(
31+
./eez-framework/src
32+
./eez-framework/src/eez/libs/agg
33+
./eez-framework/src/eez/platform/simulator
34+
)
35+
36+
file(GLOB_RECURSE src_eez
37+
./eez-framework/src/eez/*.cpp
38+
./eez-framework/src/eez/*.c
39+
)
40+
41+
list(APPEND SOURCES ${src_eez})
42+
43+
################################################################################
44+
endif(${HAS_FLOW_SUPPORT})
45+
46+
add_executable(index ${SOURCES} ${INCLUDES})
47+
48+
if(NOT LVGL_CHOSEN_DEMO)
49+
set(LVGL_CHOSEN_DEMO lv_demo_widgets)
50+
endif()
51+
set_source_files_properties(main.c PROPERTIES COMPILE_FLAGS -DCHOSEN_DEMO=${LVGL_CHOSEN_DEMO})
52+
53+
set(CMAKE_EXECUTABLE_SUFFIX ".html")
54+
target_link_libraries(index
55+
lvgl
56+
lv_drivers
57+
)
58+
set_target_properties(index PROPERTIES LINK_FLAGS "--shell-file ${PROJECT_SOURCE_DIR}/lvgl_shell.html -s SINGLE_FILE=1")

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Littlev Graphics Library
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.

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# LVGL web simulator project with EEZ Studio
2+
3+
## How to get started
4+
5+
### Install SDL
6+
7+
Downlad [SDL](https://www.libsdl.org/) (a graphics library to open a window and handle the mouse). On Linux:
8+
1. Find the current version of SDL2: `apt-cache search libsdl2 (e.g. libsdl2-2.0-0)`
9+
2. Install SDL2: `sudo apt-get install libsdl2-2.0-0` (replace with the found version)
10+
3. Install SDL2 development package: `sudo apt-get install libsdl2-dev`
11+
4. If build essentials are not installed yet: `sudo apt-get install build-essential`
12+
13+
### Install Emscripten SDK
14+
Download the [Emscripten SDK](https://kripken.github.io/emscripten-site/) and make sure it is in your PATH.
15+
16+
1. `git clone https://github.com/emscripten-core/emsdk.git`
17+
2. `cd <path-to-emsdk>`
18+
3. `git pull`
19+
4. `./emsdk install latest`
20+
5. `./emsdk activate latest`
21+
6. `source ./emsdk_env.sh`
22+
23+
More info here: https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html
24+
25+
### Build the project
26+
1. `cd C:\work\eez\native-interface-lvgl-no-flow`
27+
2. `mkdir build`
28+
3. `cd build`
29+
4. `emcmake cmake ..`
30+
5. `emmake make -j4`
31+
6. A file called `index.html` will be generated. Run this in your browser.
32+
33+
#### Known issue with Google Chrome browser
34+
Chrome can't open the generated html file offline. It works if you copy the files to a server. Use Firefox or other browser for offline testing.
35+
36+
#### Known issue with Firefox
37+
Firefox can't open the generated html file offline unless you go to `about:config` and change `privacy.file_unique_origin` to `false`.

assets/fonts/Montserrat-SemiBold.ttf

238 KB
Binary file not shown.

assets/fonts/ui_font_small_font.bin

26.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)