#pragma once

#include <stdbool.h>
#include <stdint.h>

enum display_view_t {
  DISPLAY_VIEW_VOLUME = 0,
  DISPLAY_VIEW_SIGNER = 1,
};

// Initialize the SSD1327 OLED on KB2040 STEMMA QT (Wire = Wire0, GPIO12/13).
void display_init();

// Returns true when the display was detected and initialized successfully.
bool display_is_present();

// Select top-level display view.
void display_set_view(display_view_t view);

// Set current mode text for volume view header.
void display_set_mode(bool signer_mode);

// Set local volume value shown on-screen. Input is clamped to 0..100.
void display_set_volume(uint8_t volume);

// Signer UI rendering helpers.
void display_show_signer_menu(uint8_t selected_index);
void display_show_enter_mnemonic(const char *const slots[12], uint8_t active_slot, uint8_t stage,
                                 const char *building_text, uint8_t cursor_pos);
void display_show_mnemonic_page(const char *mnemonic, uint8_t page_index);
void display_show_message(const char *title, const char *line1, const char *line2);
void display_show_signer_ready();

// Set short status text line (truncated to fit).
void display_set_status(const char *status);

// Non-blocking tick; renders only when state changed.
void display_tick();
