4141 */
4242#define EFI_FAT_IMAGE "/efi.fat"
4343
44+ /* Print format for “one glyph” */
45+ #define GLYPH_FMT "%s"
46+
47+ /* Double box line-drawing: UTF-8 (U+2550..U+255D) */
48+ #define CP437_DBL_H "\xE2\x95\x90" /* U+2550 ═ */
49+ #define CP437_DBL_V "\xE2\x95\x91" /* U+2551 ║ */
50+ #define CP437_DBL_TL "\xE2\x95\x94" /* U+2554 ╔ */
51+ #define CP437_DBL_TR "\xE2\x95\x97" /* U+2557 ╗ */
52+ #define CP437_DBL_BL "\xE2\x95\x9A" /* U+255A ╚ */
53+ #define CP437_DBL_BR "\xE2\x95\x9D" /* U+255D ╝ */
54+
55+ /* Block fills: UTF-8 (U+2588, U+258C, U+2590) */
56+ #define CP437_BLOCK_FULL "\xE2\x96\x88" /* U+2588 █ */
57+ #define CP437_BLOCK_HALF_LEFT "\xE2\x96\x8C" /* U+258C ▌ */
58+ #define CP437_BLOCK_HALF_RIGHT "\xE2\x96\x90" /* U+2590 ▐ */
59+
4460/**
4561 * @brief Mapping of a GPT GUID to user-facing labels
4662 */
@@ -182,7 +198,7 @@ void centre_text(const char* format, ...) PRINTF_LIKE(1,2);
182198 *
183199 * @param warning_message Message to display
184200 */
185- void warning (const char * warning_message );
201+ void warning (const char * warning_message , const char * subtitle );
186202
187203/**
188204 * @brief Align a 64-bit value up to the nearest multiple
@@ -261,3 +277,83 @@ bool prepare_rfs_partition(storage_device_t* dev);
261277 * @return true if a summary was produced, false on low-level failure
262278 */
263279bool probe_device_summary (const storage_device_t * dev , char * out , size_t out_len , bool * usable );
280+
281+ /**
282+ * @brief Draw a double-line CP437 box at a given position.
283+ *
284+ * Draws a rectangular box using DOS CP437 double line drawing characters.
285+ * The box is clipped to the current text grid. The interior is left untouched.
286+ * On completion, the cursor is restored to its original position.
287+ *
288+ * @param x Left column (0-based).
289+ * @param y Top row (0-based).
290+ * @param width Box width in character cells (must be >= 2 after clipping).
291+ * @param height Box height in character cells (must be >= 2 after clipping).
292+ */
293+ void draw_box_cp437_double (uint64_t x , uint64_t y , uint64_t width , uint64_t height );
294+
295+ /**
296+ * @brief Draw a centred double-line CP437 box.
297+ *
298+ * Computes coordinates to centre a box of the requested dimensions
299+ * in the current text area. The actual box position and clipped size
300+ * are written back to the provided pointers.
301+ *
302+ * @param req_w Requested width in character cells.
303+ * @param req_h Requested height in character cells.
304+ * @param out_x Pointer to store the top-left x position.
305+ * @param out_y Pointer to store the top-left y position.
306+ * @param out_w Pointer to store the actual width drawn.
307+ * @param out_h Pointer to store the actual height drawn.
308+ */
309+ void draw_box_cp437_double_center (uint64_t req_w , uint64_t req_h , uint64_t * out_x , uint64_t * out_y , uint64_t * out_w , uint64_t * out_h );
310+
311+ /**
312+ * @brief Draw a bordered CP437 progress bar at (x, y).
313+ *
314+ * Renders a 3-row widget:
315+ * row 0: top border
316+ * row 1: fill area (blocks)
317+ * row 2: bottom border
318+ *
319+ * Width includes the border; the interior fill width is (width - 2).
320+ * Percent is clamped to [0, 100]. The bar uses half-cell resolution.
321+ *
322+ * @param x Left column (0-based).
323+ * @param y Top row (0-based).
324+ * @param width Total width in character cells (must be >= 3 after clipping).
325+ * @param percent Completion percent (0..100).
326+ */
327+ void draw_progress_bar_cp437 (uint64_t x , uint64_t y , uint64_t width , uint64_t percent );
328+
329+ /**
330+ * @brief Draw a bordered single-line CP437 text box.
331+ *
332+ * Draws a 3-row box (top border, text row, bottom border) at (x, y) with the
333+ * given total width. The interior row is filled with the provided text. If the
334+ * text does not fit, it is truncated and an ellipsis "..." is appended when
335+ * there is room (inner width >= 3). The cursor position is restored on exit.
336+ *
337+ * @param x Left column (0-based).
338+ * @param y Top row (0-based).
339+ * @param width Total box width in cells (must be >= 3 after clipping).
340+ * @param text NUL-terminated string to render inside the box (may be NULL).
341+ */
342+ void draw_text_box_cp437 (uint64_t x , uint64_t y , uint64_t width , const char * text );
343+
344+
345+ /**
346+ * @brief Draw a centred single-line CP437 text box.
347+ *
348+ * Thin wrapper around draw_text_box_cp437(). When the text fits, it is padded
349+ * with leading spaces so that it appears centred within the box. When it does
350+ * not fit, the truncation/ellipsis logic of draw_text_box_cp437() applies.
351+ *
352+ * @param x Left column (0-based).
353+ * @param y Top row (0-based).
354+ * @param width Total box width in cells (must be >= 3 after clipping).
355+ * @param text NUL-terminated string to render inside the box (may be NULL).
356+ */
357+ void draw_text_box_cp437_center (uint64_t x , uint64_t y , uint64_t width , const char * text );
358+
359+ void new_page (const char * title );
0 commit comments