From patchwork Mon Jan 19 20:41:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1654 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=1768855424; bh=jiqZAKMEl6UXUiLrloLVNeli33KAbFBWrjYKkiw0JOY=; 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=QumO4JckN6WJ9BHRAtIiTu2uZv68LLdss91VmUoR/x8KWnmwNBnZsz0jhR7hLU23C 5Jwoc/LLKQKQKBBEkhMKrxJ93TzUFxBMrhn2vveIIYNlB7oSq3vPOwHKPic6Tqi8F1 jnuCPhS3REZKhu9SVQp8ZHz03kh90LcW/FfiYWY3e8ZZr6Zc+rmUSWOFFvdtznLBnW 2qOGzRF90VAYV389sKWDZUUxtduwsQiT597FEYlgoviXo+hILo4mDLw8gqakB5IvLt U/dJEfpVIPq+Eeaqf1mdgF7BJAKPzmcL2G1qNGeiIyS/6/fEtFQWDLHUnQFJw0LP+w CJl1ZrSFxCTvg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 96F5C6951C for ; Mon, 19 Jan 2026 13:43:44 -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 5N64HRsR_0OV for ; Mon, 19 Jan 2026 13:43:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855424; bh=jiqZAKMEl6UXUiLrloLVNeli33KAbFBWrjYKkiw0JOY=; 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=QumO4JckN6WJ9BHRAtIiTu2uZv68LLdss91VmUoR/x8KWnmwNBnZsz0jhR7hLU23C 5Jwoc/LLKQKQKBBEkhMKrxJ93TzUFxBMrhn2vveIIYNlB7oSq3vPOwHKPic6Tqi8F1 jnuCPhS3REZKhu9SVQp8ZHz03kh90LcW/FfiYWY3e8ZZr6Zc+rmUSWOFFvdtznLBnW 2qOGzRF90VAYV389sKWDZUUxtduwsQiT597FEYlgoviXo+hILo4mDLw8gqakB5IvLt U/dJEfpVIPq+Eeaqf1mdgF7BJAKPzmcL2G1qNGeiIyS/6/fEtFQWDLHUnQFJw0LP+w CJl1ZrSFxCTvg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 86973693E3 for ; Mon, 19 Jan 2026 13:43:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855422; bh=b4Sl+J3V9wacvz6OcQQ4u2ThMtv/lkOtj5F1Q8qmLCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwR7gpFJz7Znt1WRP7la8sr0q7sJ9oe0rxrM+thQrUyQ0URCsJ3oYlDj5JK7+YdO/ GeK0oOzfcl8igP/mAPdzH/I8oPZSvD3G7uPYMfk+Dl9XcYZlyH/1EtLVvGSXW8np8B lr7CcTWVusELyqkxorP8ESXm/O+dKyjuMitSJQpKvzVwMrjxKdgUA59Jlmj0nCQLnU CCwLdzs311MEV+NncyZ14L11YG084gTjaelyLswUp2QMtUIvH6ZiLB9ex1ywXNg3XA PvCjj8geQMTlORXcdt7n1htyQUMXuWLFmvTKHo5FFLJlMwdB2GWZN+VNzvJfZJM7uK JJf/MTq6af9Tg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 64EB269504; Mon, 19 Jan 2026 13:43:42 -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 39HNhT3j-Rbp; Mon, 19 Jan 2026 13:43:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855417; bh=R/s+WwHEi7U/uR/FTjqmfP991f1R66AyqwdqoRhwyqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VjQ7hM2+kqUv6EODYkv3dj7cgosSvygIaxti+UYD4X6CgGcUtUgHzKYnmjyMiKTje NdEYYKmU/gAUM26vWn96+J4vaDUtTTdfdNe3OGk4DOB+ZRh5MBm9/1wR9TD8FXJOxr WM8ETI1THnTzdC41sFkTaXS4i1u6gyE7NH1DHOzbdptAHNr+qSnP3bGnGz9R3Odek5 VMtHXIoNJSHQlIDgfri8X3ds5h3L2gTFbd/hF1KZ6vA2Taim+WjaFT3Luy+6uIYL6W M8f24QE67XOpsBZw/kY+TVYgev87Eer5mwiFCwkEnoRFM1U8rNYKup8amj6s2CjKgS rVVEEDF5WIA4g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 43FCE693E3; Mon, 19 Jan 2026 13:43:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:17 -0700 Message-ID: <20260119204130.3972647-25-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MGBB2L2S6TSDD7V5QP4VJWRSYNBRBON2 X-Message-ID-Hash: MGBB2L2S6TSDD7V5QP4VJWRSYNBRBON2 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 24/27] expo: Add scene_txtin_close() for common text-input close code 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 scene_txtin_close() to handle closing a text-input object. This hides the cursor by calling vidconsole_readline_end(). Update scene_textline_send_key() to use the new helper when closing on BKEY_QUIT. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene_internal.h | 15 +++++++++++---- boot/scene_textline.c | 3 +-- boot/scene_txtin.c | 6 ++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 8899ba538ae..e732650b99f 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -582,15 +582,22 @@ int scene_txtin_open(struct scene *scn, struct scene_obj *obj, struct scene_txtin *tin); /** - * scene_textline_close() - Close a textline object + * scene_txtin_close() - Close a text-input object * * Close out the text editor after use * - * @scn: Scene containing the textline - * @tline: textline object + * @scn: Scene containing the object + */ +void scene_txtin_close(struct scene *scn); + +/** + * scene_obj_calc_bbox() - Calculate bounding boxes for an object + * + * @obj: Object to process + * @bbox: Returns bounding boxes for object * Return: 0 if OK, -ve on error */ -int scene_textline_close(struct scene *scn, struct scene_obj_textline *tline); +int scene_obj_calc_bbox(struct scene_obj *obj, struct vidconsole_bbox *bbox); /** * scene_calc_arrange() - Calculate sizes needed to arrange a scene diff --git a/boot/scene_textline.c b/boot/scene_textline.c index 2199b3d0641..9b5c40462fd 100644 --- a/boot/scene_textline.c +++ b/boot/scene_textline.c @@ -114,8 +114,7 @@ int scene_textline_send_key(struct scene *scn, struct scene_obj_textline *tline, memcpy(abuf_data(&tline->tin.buf), abuf_data(&scn->buf), abuf_size(&scn->buf)); - /* cursor is not needed now */ - vidconsole_readline_end(); + scene_txtin_close(scn); } else { event->type = EXPOACT_QUIT; log_debug("menu quit\n"); diff --git a/boot/scene_txtin.c b/boot/scene_txtin.c index a4c373c14fa..d1aa24dac9f 100644 --- a/boot/scene_txtin.c +++ b/boot/scene_txtin.c @@ -104,6 +104,12 @@ static void scene_txtin_putch(struct cli_line_state *cls, int ch) vidconsole_put_char(scn->expo->cons, ch); } +void scene_txtin_close(struct scene *scn) +{ + /* cursor is not needed now */ + vidconsole_readline_end(); +} + int scene_txtin_open(struct scene *scn, struct scene_obj *obj, struct scene_txtin *tin) {