From 4b51ca5ce60a874276579d9b4657de1edc36f31d Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Thu, 10 Mar 2022 14:16:39 +0000 Subject: x1000: bootloader: add GUI list widget Change-Id: Ic5bf4747ed99b713b7c035153865ed9bdebd89b0 --- bootloader/x1000/x1000bootloader.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'bootloader/x1000/x1000bootloader.h') diff --git a/bootloader/x1000/x1000bootloader.h b/bootloader/x1000/x1000bootloader.h index c5984c9a91..9090523c14 100644 --- a/bootloader/x1000/x1000bootloader.h +++ b/bootloader/x1000/x1000bootloader.h @@ -23,6 +23,7 @@ #define __X1000BOOTLOADER_H__ #include "config.h" +#include "lcd.h" #include #include #include @@ -70,6 +71,24 @@ struct uimage_header; * GUI stuff */ +struct bl_listitem { + struct bl_list* list; + + int index; + int x, y, width, height; +}; + +struct bl_list { + struct viewport* vp; + + int num_items; + int selected_item; + int top_item; + int item_height; + + void(*draw_item)(const struct bl_listitem* item); +}; + void clearscreen(void); void putversion(void); void putcenter_y(int y, const char* msg); @@ -81,6 +100,11 @@ void init_lcd(void); void gui_shutdown(void); +void gui_list_init(struct bl_list* list, struct viewport* vp); +void gui_list_draw(struct bl_list* list); +void gui_list_select(struct bl_list* list, int item_index); +void gui_list_scroll(struct bl_list* list, int delta); + /* * Installer */ -- cgit v1.2.3