No compile issues.
No black screen
No crash
The application simply exits without any GUI launch. In v6.1, it was working fine. Ported v8.3, changed the hal_dev.dis_drv.buffer to hal_dev.dis_drv_draw_buf still no effect
Code
#include <lvgl.h>
#include <stdio.h>
#include <lwguilibpkg_hardware_abstraction_layer.h>
#include “lwguilibpkg_system_tick_implementation.h”
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <Library/ShellCEntryLib.h>
#include <Library/TimerLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/TimerLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <time.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/EfiShellInterface.h>
#include <Protocol/Shell.h>
#include <stdlib.h>
#include <Library/ShellLib.h>
#include <wchar.h>
EFI_SHELL_PROTOCOL *EfiShellProtocol;
EFI_STATUS Status;
BOOLEAN ExitApplication =0;
EFI_HANDLE ImageHandle_dummy;
lv_obj_t *scr = NULL;
lv_disp_t *obj_display;
lv_indev_t *obj_keyboard;
lv_indev_t *obj_mouse;
lv_indev_t *obj_scroll;
lv_obj_t *screen;
lv_obj_t * win;
lv_theme_t *th;
static lv_style_t win_header_style;
//static lv_style_t win_header_button_style;
static lv_style_t win_background_style;
EFI_STATUS
EFIAPI
UefiMain(
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable )
{
EFI_STATUS Status;
ImageHandle_dummy = ImageHandle;
Print(L"hello world\n");
lv_init();
Print(L"After init\n");
lwguilibpkg_hal_activate(&obj_display,&obj_keyboard,&obj_mouse,&obj_scroll);
Print(L"After init\n");
#if 0
screen = lv_obj_create(lv_scr_act());
Print(L"lv_obj_create\n");
lv_scr_load(screen);
Print(L"lv_scr_load\n");
win = lv_win_create(screen, 100);
Print(L"lv_win_create\n");
lv_win_add_title(win, "Window");
Print(L"lv_win_add_title\n");
th = lv_theme_default_init(obj_display, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), false, LV_FONT_MONTSERRAT_12);
Print(L"lv_theme_default_init\n");
lv_disp_set_theme(obj_display, th);
Print(L"lv_disp_set_theme\n");
//Initialize();
Print(L"Initialize\n");
lv_style_init(&win_header_style);
lv_style_set_bg_color(&win_header_style, lv_palette_main(LV_PALETTE_RED));
lv_style_set_border_color(&win_header_style,lv_palette_main(LV_PALETTE_BLACK));
lv_style_set_border_width(&win_header_style, 1);
lv_style_set_text_color(&win_header_style,lv_palette_main(LV_PALETTE_GREY));
Print(L"Win_header\n");
lv_style_init(&win_background_style);
lv_style_set_bg_color(&win_background_style, lv_palette_main(LV_PALETTE_BLUE_GREY));
lv_style_set_border_color(&win_background_style,lv_palette_main(LV_PALETTE_BLACK));
lv_style_set_border_width(&win_background_style, 1);
lv_style_set_text_color(&win_background_style, lv_palette_main(LV_PALETTE_BLACK));
Print(L"Win_background\n");
lv_obj_add_style(win, &win_background_style, 0);
Print(L"style\n");
#endif
lv_obj_t * win = lv_win_create(lv_scr_act(), 40);
lv_obj_t * btn;
btn = lv_win_add_btn(win, LV_SYMBOL_LEFT, 40);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
lv_win_add_title(win, "A title");
btn = lv_win_add_btn(win, LV_SYMBOL_RIGHT, 40);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
btn = lv_win_add_btn(win, LV_SYMBOL_CLOSE, 60);
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
lv_obj_t * cont = lv_win_get_content(win); /*Content can be added here*/
lv_obj_t * label = lv_label_create(cont);
lv_label_set_text(label, "This is\n"
"a pretty\n"
"long text\n"
"to see how\n"
"the window\n"
"becomes\n"
"scrollable.\n"
"\n"
"\n"
"Some more\n"
"text to be\n"
"sure it\n"
"overflows. :)");
#if 1
ExitApplication = FALSE;
while (!ExitApplication) {
/* Periodically call the lv_task handler.*/
//lv_task_handler();
}
#endif
lwguilibpkg_hal_deactivate();
lwguilibpkg_clear_display();
return Status;
}
I have tried with #if 0 and also the other code which is example 2 as specified. It doesnt give any output.I get prints on EDK2 terminal and it exits