// SPDX-License-Identifier: MPL-2.0
#ifndef BP_LIB_UI_H
#define BP_LIB_UI_H
#include <Uefi.h>
#include <Protocol/SerialIo.h>
#include "font.h"
#include "disk.h"
typedef struct {
  UINTN x;
  UINTN y;
  UINTN width;
  UINTN height;
} bp_ui_TEXT_BOX;
typedef struct {
  UINT32 *pixels;
  UINTN pixels_count;
} bp_ui_BOOT_ANIMATION_FRAME;
typedef struct {
  bp_ui_BOOT_ANIMATION_FRAME *frames;
  UINTN frames_count;
} bp_ui_BOOT_ANIMATION;
EFI_STATUS bp_ui_draw_text_ascii(UINT32 *fb_base,bp_font_FBM_FONT_RENDER *font,INTN x,INTN y,UINTN width,UINTN heigth,CHAR8 *text,bp_ui_TEXT_BOX **handle);
EFI_STATUS bp_ui_render_boot_animation_4frames(bp_disk_FILE *boot_animation_file,UINTN screen_width,UINTN screen_heigth,UINTN frame_index,bp_ui_BOOT_ANIMATION **rendered_boot_animation);
EFI_STATUS bp_ui_render_boot_animation_last_frame(bp_disk_FILE *boot_animation_file,UINTN screen_width,UINTN screen_height,bp_ui_BOOT_ANIMATION_FRAME **rendered_frame);
EFI_STATUS bp_ui_render_boot_animation_last_frame_color(bp_disk_FILE *boot_animation_file,UINTN screen_width,UINTN screen_height,UINT32 color,bp_ui_BOOT_ANIMATION_FRAME **rendered_frame);
EFI_STATUS bp_ui_show_error_screen(EFI_SERIAL_IO_PROTOCOL *serial,CHAR8 *error_code,UINT32* fb_base,bp_font_FBM_FONT_RENDER *font,UINTN horizontal_resolution,UINTN vertical_resolution,bp_ui_BOOT_ANIMATION_FRAME *background_logo,BOOLEAN allow_erroring);
EFI_STATUS bp_ui_erase_text(UINT32 *fb_base,UINTN screen_width,UINTN screen_heigth,bp_ui_TEXT_BOX *text_box);
#endif
