3.Software/LvglSimulator/vs2019_proj/lv_drivers/gtkdrv/README.md
sudo apt-get install libgtk-3-dev
sudo apt-get install libglib2.0-dev
In "Project properties > C/C++ Build > Settings" set the followings:
"Cross GCC Compiler > Command line pattern"
${gtk+-cflags} to the end (add a space between the last command and this)"Cross GCC Compiler > Includes"
"Cross GCC Linker > Command line pattern"
${gtk+-libs} to the end (add a space between the last command and this)"Cross GCC Linker > Libraries"
pthreadIn "C/C++ Build > Build variables"
Configuration: [All Configuration]
Add
gtk+-cflags
Stringpkg-config --cflags gtk+-3.0gtk+-libs
Stringpkg-config --libs gtk+-3.0main.c #incude "lv_drivers/gdkdrv/gdkdrv.h"lv_drv_conf.h with USE_GTK 1lv_init() call gdkdrv_init(); static lv_disp_buf_t disp_buf1;
static lv_color_t buf1_1[LV_HOR_RES_MAX * LV_VER_RES_MAX];
lv_disp_buf_init(&disp_buf1, buf1_1, NULL, LV_HOR_RES_MAX * LV_VER_RES_MAX);
/*Create a display*/
lv_disp_drv_t disp_drv;
lv_disp_drv_init(&disp_drv);
disp_drv.buffer = &disp_buf1;
disp_drv.flush_cb = gtkdrv_flush_cb;
lv_indev_drv_t indev_drv_mouse;
lv_indev_drv_init(&indev_drv_mouse);
indev_drv_mouse.type = LV_INDEV_TYPE_POINTER;
lv_indev_drv_t indev_drv_kb;
lv_indev_drv_init(&indev_drv_kb);
indev_drv_kb.type = LV_INDEV_TYPE_KEYPAD;
indev_drv_kb.read_cb = lv_keyboard_read_cb;
lv_indev_drv_register(&indev_drv_kb);
lv_conf.h#define LV_TICK_CUSTOM 1
#if LV_TICK_CUSTOM == 1
#define LV_TICK_CUSTOM_INCLUDE "lv_drivers/gtkdrv/gtkdrv.h" /*Header for the sys time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (gtkdrv_tick_get()) /*Expression evaluating to current systime in ms*/
#endif /*LV_TICK_CUSTOM*/
LV_COLOR_DEPTH is 32 in lv_conf.hBuild and Run to "normally" run the UI in a window
With the help of Broadway the UI can be easily shown via a browser.
broadwayd :5. Leave the terminal running.GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 ./my_executable (replace my_executable wih name of your executable)http://localhost:8085/