From patchwork Mon Jan 19 20:41:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1651 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=1768855410; bh=/LXvrpmSNSRenfeLvGoAdjEH2dgPdcZB53u2r6+roFU=; 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=pxv/32JDVUd6808rq7NQsNC3alsCeIwA17j0+SQN/N//PL0NN2tUi7EIhYk/i4+Ip U5QMWcVhV8XqwBdxaLNfcu9XmEZJ4wn9QioAHxuVHbU0p/5tfRgZUhdpLm4oCE12h6 H6qKUnP9K6BsKFEV90IZO6Ycd6PlI5YneEFndeKpafTy3mO5L4mF5D9suI7Iexw2Pt vWG9fLBa/PgL7E2PCo8dQ86A5PMt0OEx/ikOHwwhiIw16llAHfQC37o1wrTMgaipfD UDHteeYFg3lkMEoouUJS678sXYnW6mIDO1T8PoTB0w+aMpQltX2UtEMcf8yU46TCE7 QxTvBMJEK0bhQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 28C53693BA for ; Mon, 19 Jan 2026 13:43:30 -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 0igH-sADqO14 for ; Mon, 19 Jan 2026 13:43:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855410; bh=/LXvrpmSNSRenfeLvGoAdjEH2dgPdcZB53u2r6+roFU=; 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=pxv/32JDVUd6808rq7NQsNC3alsCeIwA17j0+SQN/N//PL0NN2tUi7EIhYk/i4+Ip U5QMWcVhV8XqwBdxaLNfcu9XmEZJ4wn9QioAHxuVHbU0p/5tfRgZUhdpLm4oCE12h6 H6qKUnP9K6BsKFEV90IZO6Ycd6PlI5YneEFndeKpafTy3mO5L4mF5D9suI7Iexw2Pt vWG9fLBa/PgL7E2PCo8dQ86A5PMt0OEx/ikOHwwhiIw16llAHfQC37o1wrTMgaipfD UDHteeYFg3lkMEoouUJS678sXYnW6mIDO1T8PoTB0w+aMpQltX2UtEMcf8yU46TCE7 QxTvBMJEK0bhQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 187F9693E3 for ; Mon, 19 Jan 2026 13:43:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855408; bh=7z7jwbvd7CacpkJDVm9xDYP2fMcHFhVKCYJ5yQeyQ2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BSpotjL1sil+VUhQtT3sw5nEMoLI2adlTSD5QvWsS6uInOfrF7zCIKBaO5vSm4jAd qLa7a+mnUjxl9XUlGoqbhfnnyyJ8f3K681UmX3WqoF9pWzCgZ1dbvuSTVdsTvJWq5o xI2A8c76kvn08zG1GcbZhYHDkwIyBXsRXKHyfd3u4NANI6I8DYJwrxy5ADWv72vuuw S8r8HEYAofJbwwUbYmVYN+BX/O7ITcptAplHAucgqgWvSadYQAQHwA+c75YVLL9dJx 0TuqqR7OXBF1XVgQvedHTCtT1XvLMatAZEFiEqhEbTxaX/mm8KKPIzbsP0IB+KXqTx mbeVt/6Ahq8sA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 18802693BA; Mon, 19 Jan 2026 13:43:28 -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 LTkgEaGku7Vf; Mon, 19 Jan 2026 13:43:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855403; bh=1nYtjd/UtiC+EbWsQhXSjvbwPzWVu7kXlYW6NM12cBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cy9odT0BzBMjq6JssY5/mcO6nSscl4v1OHMxjNqfakZvTlqRBkDZOETlyaTI37erE N+9yWkRHLGtS3BlC91XjMmEhw+55JNeP91GDmaQ/R5FGHqdjcZUUItLlU9XRqbcDHw vk9bfMTKb2Kg2xZkbPu8AvPXzgmrAxQJP2nDuvFJAHjHfeBMTDUGCt564elHHqPWaq Be6bf+E2ttDg9xWTAJ1waLVz4slhEVYKbFIyS8kCov5egT7x4OC7cscz44OewBla9d PAxAyp7JIG3XCiwMMI7nTK/1S+PuH9ip5XiC3Nkawis0Q61BBoO7dOaon6R6rc77rg dtG70TzbdGfiA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 70BD4693E3; Mon, 19 Jan 2026 13:43:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:14 -0700 Message-ID: <20260119204130.3972647-22-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: X5NTTIUET2K77WEZDUHUCV4UBI7OAS5D X-Message-ID-Hash: X5NTTIUET2K77WEZDUHUCV4UBI7OAS5D 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 21/27] expo: Add a txtin function to render dependencies 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 Factor out the render_deps code from scene_textline_render_deps() into a shared helper scene_txtin_render_deps(). This handles cursor display when a text-input object is open, including entry restore/save and cursor positioning. For now, only textlines are supported. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene.c | 3 +-- boot/scene_internal.h | 25 +++++++++++++------------ boot/scene_textline.c | 29 ----------------------------- boot/scene_txtin.c | 29 +++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index b64ddf51630..ae3851cc82c 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -993,8 +993,7 @@ int scene_render_deps(struct scene *scn, uint id) (struct scene_obj_menu *)obj); break; case SCENEOBJT_TEXTLINE: - scene_textline_render_deps(scn, - (struct scene_obj_textline *)obj); + scene_txtin_render_deps(scn, obj, scene_obj_txtin(obj)); break; } } diff --git a/boot/scene_internal.h b/boot/scene_internal.h index d3c67777cb1..96bc4e06ad6 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -372,18 +372,6 @@ int scene_render_deps(struct scene *scn, uint id); */ int scene_menu_render_deps(struct scene *scn, struct scene_obj_menu *menu); -/** - * scene_textline_render_deps() - Render a textline and its dependencies - * - * Renders the textline and all of its attached objects - * - * @scn: Scene to render - * @tline: textline to render - * Returns: 0 if OK, -ve on error - */ -int scene_textline_render_deps(struct scene *scn, - struct scene_obj_textline *tline); - /** * scene_iter_objs() - Iterate through all scene objects * @@ -558,6 +546,19 @@ void scene_txtin_calc_bbox(struct scene_obj *obj, struct scene_txtin *tin, struct vidconsole_bbox *bbox, struct vidconsole_bbox *edit_bbox); +/** + * scene_txtin_render_deps() - Render dependencies for a text-input object + * + * Renders the edit text on top of the background if open + * + * @scn: Scene containing the object + * @obj: Object to render + * @tin: Text-input info + * Return: 0 if OK, -ve on error + */ +int scene_txtin_render_deps(struct scene *scn, struct scene_obj *obj, + struct scene_txtin *tin); + /** * scene_obj_calc_bbox() - Calculate bounding boxes for an object * diff --git a/boot/scene_textline.c b/boot/scene_textline.c index f940be3ed28..46ab53e30c9 100644 --- a/boot/scene_textline.c +++ b/boot/scene_textline.c @@ -152,35 +152,6 @@ bool scene_textline_within(const struct scene *scn, return scene_within(scn, tline->tin.edit_id, x, y); } -int scene_textline_render_deps(struct scene *scn, - struct scene_obj_textline *tline) -{ - const bool open = tline->obj.flags & SCENEOF_OPEN; - struct udevice *cons = scn->expo->cons; - uint i; - - /* if open, render the edit text on top of the background */ - if (open) { - int ret; - - ret = vidconsole_entry_restore(cons, &scn->entry_save); - if (ret) - return log_msg_ret("sav", ret); - scene_render_obj(scn, tline->tin.edit_id); - - /* move cursor back to the correct position */ - for (i = scn->cls.num; i < scn->cls.eol_num; i++) - vidconsole_put_char(cons, '\b'); - ret = vidconsole_entry_save(cons, &scn->entry_save); - if (ret) - return log_msg_ret("sav", ret); - - vidconsole_show_cursor(cons); - } - - return 0; -} - /** * scene_textline_putch() - Output a character to the vidconsole * diff --git a/boot/scene_txtin.c b/boot/scene_txtin.c index 99fad16c11f..2e7c496310d 100644 --- a/boot/scene_txtin.c +++ b/boot/scene_txtin.c @@ -57,6 +57,35 @@ int scene_txtin_arrange(struct scene *scn, struct expo_arrange_info *arr, return x; } +int scene_txtin_render_deps(struct scene *scn, struct scene_obj *obj, + struct scene_txtin *tin) +{ + const bool open = obj->flags & SCENEOF_OPEN; + struct udevice *cons = scn->expo->cons; + uint i; + + /* if open, render the edit text on top of the background */ + if (open) { + int ret; + + ret = vidconsole_entry_restore(cons, &scn->entry_save); + if (ret) + return log_msg_ret("sav", ret); + scene_render_obj(scn, tin->edit_id); + + /* move cursor back to the correct position */ + for (i = scn->cls.num; i < scn->cls.eol_num; i++) + vidconsole_put_char(cons, '\b'); + ret = vidconsole_entry_save(cons, &scn->entry_save); + if (ret) + return log_msg_ret("sav", ret); + + vidconsole_show_cursor(cons); + } + + return 0; +} + void scene_txtin_calc_bbox(struct scene_obj *obj, struct scene_txtin *tin, struct vidconsole_bbox *bbox, struct vidconsole_bbox *edit_bbox)