From patchwork Sun Jan 18 20:42:48 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1600 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768769040; bh=ZVoEfcPZJDug1eCXb3//GnnmtrB22REm4aiFTKY7Uew=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XB1MmLyE65uzMj0v+y0LxnB7o2+0aiesMvSmFJG6kRXxqTaT2VQ9iYHZBxK8csBTN 7o5x2KKPQLdzNRsyRKGUQkn23GvChZmnNpddUtnpXzXSQbdjDoIk+8nkZAhiADVKEc FI3+mDeHyZoSmq5OtbvX2p+9gpUeisypdnCYRJq1NEQkjtkm0glE1nO8UBx43b+sKZ wKGHvnbEUusKZnTWTqX9Pb5cgMjq/SpotKO+NXyQZQfJ4tPXYICBkskuEwrZrrr0Zu PpSEAmaUF2mNQz+KRTqfKpPo85hXDKqP29iUjYufLHy5eNAvKVNn8QC+m6a5Yv8oXF Wh+3R8XltpT5w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1BD746949B for ; Sun, 18 Jan 2026 13:44:00 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id K0NkXn3xAEhE for ; Sun, 18 Jan 2026 13:44:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768769040; bh=ZVoEfcPZJDug1eCXb3//GnnmtrB22REm4aiFTKY7Uew=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=XB1MmLyE65uzMj0v+y0LxnB7o2+0aiesMvSmFJG6kRXxqTaT2VQ9iYHZBxK8csBTN 7o5x2KKPQLdzNRsyRKGUQkn23GvChZmnNpddUtnpXzXSQbdjDoIk+8nkZAhiADVKEc FI3+mDeHyZoSmq5OtbvX2p+9gpUeisypdnCYRJq1NEQkjtkm0glE1nO8UBx43b+sKZ wKGHvnbEUusKZnTWTqX9Pb5cgMjq/SpotKO+NXyQZQfJ4tPXYICBkskuEwrZrrr0Zu PpSEAmaUF2mNQz+KRTqfKpPo85hXDKqP29iUjYufLHy5eNAvKVNn8QC+m6a5Yv8oXF Wh+3R8XltpT5w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 06CA869491 for ; Sun, 18 Jan 2026 13:44:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768769037; bh=2QkqNhxT8QvqcbeLjKQ5YDpoOy8iiZ16gvDx+NWXAsw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PBkdiayiGDC4vyIsXMi9s6GsKRMeTLJkjYLYosVkYrn+wW9SIe8Jt2Y4WOaeOFMb5 hBTnhpWq30RVe/qrJlf7mbJ1GxR7r309ucbI7aEkgWRwTDKouGClt/lKWPLge2unkb 3ldEJY341raE9nZ61W/qY/nXzzUvaQGEXQsHdI+FqFoCJ6Tl9+Y4sqRvL2zWg0AYm2 KPTK9p/p+tmP3dBCsnrjAAecD1ZdebCuAqTkTPozjzY8vkNK2GeC6T2WwbDTiK5q6Z bJrIlL6wSRIQ9c+bOBv4ykjqiuAbh/ZX8AHNYL6RzZ6iXlWTMPLa15KkAT1WxW0jhH oy1QgeQ/xdQKg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A7DA16948C; Sun, 18 Jan 2026 13:43:57 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id arfj5fr67Rgl; Sun, 18 Jan 2026 13:43:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768769033; bh=LAN19vRYnoNBju39TQPpaiUQ/ULqEHvKps9PlZeD4V0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ikLnBEUZUXUP3h24VWKy3Mi9/CLaeLOsFNKv3A+Y6yg/r7crKp1JSZZY0TRf6HOnB WyfB9rpiPdACl+7NNLVUy9ZVFKkex0ZjMfR/rynEbMxxdgjnJHQtnQM5JcgvJsp1Oy 7QJ9xmTOkTeo7xUre9GMdZyy43xvoDDCPpOyRdxasBZy3wiedVlSJ+G/obNGzkTqS1 mHYjTv9grRtNo30zUm3jPTxGCQsN4qybjcDPR9vXOY+brfWDqzwVly+R2ZXEZIW2Gt CEJrCYvXVQfP4IP4xVI/t5ZyxWE2R9+vRIBUqjFN/KGYQ9FxZiW47Z0s6SapO9ZHfi 83BAqODtLhdPQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5899A6946A; Sun, 18 Jan 2026 13:43:53 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 13:42:48 -0700 Message-ID: <20260118204303.1982533-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260118204303.1982533-1-sjg@u-boot.org> References: <20260118204303.1982533-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 3BOVX7AFOQ3OXHAWQO3PI3TYEMKP4BAW X-Message-ID-Hash: 3BOVX7AFOQ3OXHAWQO3PI3TYEMKP4BAW X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/16] expo: Add line_chars to scene_obj_txtedit List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a line_chars field to scene_obj_txtedit to specify the nominal number of characters in a line. This is consistent with the line_chars field in scene_obj_textline. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene_textedit.c | 3 ++- include/expo.h | 5 ++++- test/boot/expo.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/boot/scene_textedit.c b/boot/scene_textedit.c index 3c1edf38592..a55285f00cd 100644 --- a/boot/scene_textedit.c +++ b/boot/scene_textedit.c @@ -19,7 +19,7 @@ enum { }; int scene_texted(struct scene *scn, const char *name, uint id, - struct scene_obj_txtedit **teditp) + uint line_chars, struct scene_obj_txtedit **teditp) { struct scene_obj_txtedit *ted; char *buf; @@ -36,6 +36,7 @@ int scene_texted(struct scene *scn, const char *name, uint id, return log_msg_ret("buf", -ENOMEM); buf = abuf_data(&ted->buf); *buf = '\0'; + ted->line_chars = line_chars; if (teditp) *teditp = ted; diff --git a/include/expo.h b/include/expo.h index 39245228574..2d57e67d51c 100644 --- a/include/expo.h +++ b/include/expo.h @@ -546,12 +546,14 @@ struct scene_obj_box { * @obj: Basic object information * @label_id: ID of the label text object (not string ID), or 0 if none * @edit_id: ID of the editable text object (not string ID) + * @line_chars: Nominal number of characters in a line * @buf: Text buffer containing current text */ struct scene_obj_txtedit { struct scene_obj obj; uint label_id; uint edit_id; + uint line_chars; struct abuf buf; }; @@ -892,11 +894,12 @@ int scene_box_set_fill(struct scene *scn, uint id, bool fill); * @scn: Scene to update * @name: Name to use (this is allocated by this call) * @id: ID to use for the new object (0 to allocate one) + * @line_chars: Nominal number of characters in a line * @teditp: If non-NULL, returns the new object * Returns: ID number for the object (typically @id), or -ve on error */ int scene_texted(struct scene *scn, const char *name, uint id, - struct scene_obj_txtedit **teditp); + uint line_chars, struct scene_obj_txtedit **teditp); /** * scene_txt_set_font() - Set the font for an object diff --git a/test/boot/expo.c b/test/boot/expo.c index 7d76431208a..dc9ebe702b8 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1511,7 +1511,7 @@ static int expo_render_textedit(struct unit_test_state *uts) ut_assertok(create_test_expo(uts, &exp, &scn, &menu, &buf, &logo_copy)); dev = exp->display; - id = scene_texted(scn, "texted", OBJ_TEXTED, &ted); + id = scene_texted(scn, "texted", OBJ_TEXTED, 40, &ted); ut_assert(id > 0); ut_assertok(scene_obj_set_bbox(scn, OBJ_TEXTED, 100, 200, 400, 300));