From: Simon Glass <simon.glass@canonical.com> At present vidconsole uses a save/restore model for its state. The textline object saves the state, does its drawing, then restores it. This is fairly clumsy and makes textedit harder to implement. This series continues the changes to adjust this, adding a putch() callback to the CLI line-editing code, so that output can (later) be directed to the correct context. It also adds word-wrapping support to the textedit scene object. The remaining patches refactor the textline and textedit code to share common functionality through a new scene_txtin structure and helper functions. This allows textedit to properly calculate its bounding box and dimensions, enabling word-wrapping within the edit area. It also includes an attempted fix for the flaky FPDT test. Overall code-size is neutral, e.g. for Thumb2 with EXPO: 03: cli: Add putch callback to struct cli_line_state arm: (for 1/1 boards) all +92.0 text +92.0 04: cli: Convert ERASE_TO_EOL macro to a function arm: (for 1/1 boards) all -104.0 text -104.0 05: cli: Add cls_putnstr() for string output with callback arm: (for 1/1 boards) all -20.0 text -20.0 Without EXPO, code size reduces by about 56 bytes (e.g. xilinx_versal_virt) Simon Glass (16): test: acpi: Fix flaky dm_test_acpi_fpdt checksum test cli: Add putch callback to struct cli_line_state cli: Convert ERASE_TO_EOL macro to a function cli: Add cls_putnstr() for string output with callback expo: Wire up putch callback for textline editing test: expo: Add a separate test for textedit expo: Refactor textedit to use label_id and edit_id expo: Rename textline max_chars to line_chars expo: Add line_chars to scene_obj_txtedit expo: Add arrangement support for textedit expo: Introduce scene_txtin for common text-input fields expo: Factor out common calc_bbox code into scene_txtin.c expo: Add scene_obj_txtin() helper for text-input objects expo: Add scene_txtin_init() for common text-input init expo: Add scene_txtin_arrange() for common arrangement code expo: Enable textedit dimension calculation for word-wrap boot/Kconfig | 1 + boot/Makefile | 2 +- boot/bootctl/multi_ui.c | 4 +- boot/bootflow_menu.c | 6 +- boot/cedit.c | 12 ++-- boot/expo_build.c | 12 ++-- boot/expo_dump.c | 10 ++- boot/scene.c | 64 ++++++++++--------- boot/scene_internal.h | 78 ++++++++++++++++++++--- boot/scene_textedit.c | 65 +++++++++++++++---- boot/scene_textline.c | 105 ++++++++++++++----------------- boot/scene_txtin.c | 70 +++++++++++++++++++++ cmd/Kconfig | 8 +++ common/cli_readline.c | 121 ++++++++++++++++++++++-------------- doc/usage/cmd/cedit.rst | 2 +- include/cli.h | 2 + include/expo.h | 45 ++++++++------ test/boot/bootctl/bootctl.c | 12 ++-- test/boot/cedit.c | 8 +-- test/boot/expo.c | 105 ++++++++++++++++++++----------- test/dm/acpi.c | 13 ++-- 21 files changed, 495 insertions(+), 250 deletions(-) create mode 100644 boot/scene_txtin.c -- 2.43.0 base-commit: 3e4570227c362cc009a7f308c824c50da750bf1c branch: expd