From patchwork Fri Oct 10 03:42:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 578 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=1760067841; bh=7pvwGgb6GrKEM+lVy34ENc3BWnnR5jx+NSvBRZBZsCk=; 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=d7OJBBmisRyJVRcpEkix4i3djmeQWZr0VcxlU2E6xqhWSUcSR5IWQWfWHZz32WtBY pOco1KLwq2qCi5SCuGy2+oh0rCbrPhyZjYJ2c10BLxFz/2VnqiVnu8n08xjxshJkMY /71ptrQbdxyIYVYPgexcXxTjbLtFRT0Px1+XP25+EkNP8C8Z3j6XYIoTYJVOLocurg sLZmsI1gfuxrfVusmJdmRpTlhPfI3VE3FK8To+2FNWjKrEXr3FYv1YmnScVJyj4YU0 jq0l85EZ/nK/kQ9nIikwp43Pe0C+bh/uuMx5prJ7iXzXFa09Ht+vlOmk0CJjb0vosZ oa3cIismoDFww== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2B06468080 for ; Thu, 9 Oct 2025 21:44:01 -0600 (MDT) 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 IybQ_L1WrvDW for ; Thu, 9 Oct 2025 21:44:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067841; bh=7pvwGgb6GrKEM+lVy34ENc3BWnnR5jx+NSvBRZBZsCk=; 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=d7OJBBmisRyJVRcpEkix4i3djmeQWZr0VcxlU2E6xqhWSUcSR5IWQWfWHZz32WtBY pOco1KLwq2qCi5SCuGy2+oh0rCbrPhyZjYJ2c10BLxFz/2VnqiVnu8n08xjxshJkMY /71ptrQbdxyIYVYPgexcXxTjbLtFRT0Px1+XP25+EkNP8C8Z3j6XYIoTYJVOLocurg sLZmsI1gfuxrfVusmJdmRpTlhPfI3VE3FK8To+2FNWjKrEXr3FYv1YmnScVJyj4YU0 jq0l85EZ/nK/kQ9nIikwp43Pe0C+bh/uuMx5prJ7iXzXFa09Ht+vlOmk0CJjb0vosZ oa3cIismoDFww== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1652A67FC1 for ; Thu, 9 Oct 2025 21:44:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067838; bh=+D8r9iu1cMvB9SAMHWDm3NJCqh9rAY7Fy66+OPefIRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S+m50dS0jpG2vMum9MhcQgKW2zgnGu2hNZyDq7OaahuW1pIdcCCLSkoNd6VrnI7gg Y1qUwG+9YpacXIpCQm96Vk0JsPg07wuGnXvbrcbPBkrVNt20MzZ72/r5r2MIwXkwKb dNOnJpzTXd8fRba8tyhbJxR8DCdUPJ7wDUkwfvmc87N6g4aedwK7SGpzlwbCuwdXW8 Ph6pwH+51OJ1wGRM++hE7ndd1uI+rsL1D/hVGMu1rPhS+klKyCZFOIiYKuNkjfJ5rp ngauxyJlsqk0mtPF7IlCuTI/2monDqCz2sv7uyYmwV0m1+29xekBfXi0QZlQmEhEus wzKBCuk7ufUQw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7CE4F68044; Thu, 9 Oct 2025 21:43:58 -0600 (MDT) 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 70ZgW-o2uVAh; Thu, 9 Oct 2025 21:43:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067835; bh=OWaFVbY+agnTgXYDa88QqpbL2RemK5IebNd2JbEPyPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qM/SkUgHm6PCE2l6niq0AI5RhmkFA44ZPcjHsh+XjKOXZESvqX/byn6U95j/vOcic 33+gwM3JRjSBYkluvNtOVy82hYVIMAWu2hWigmjA5ipDxmgsrqxGHKqcHLDAy2ugCY 93uQ5FGbBV9GPH9fjSO9GX47DJWE1rR1sgmw6NW8ecOwt0282nJyRzITC75bh4zSvw bCQindDoIoJrsnSUM0AFfdH5y5ugPE9wwtZBU4UiDfYMKz4g1BnNdjfat1eXY38y88 iThflbeJ856CFmU3pGBLJ3zQcxZx5B7omSOAwHGCJFGKUyYxhcKOYL7blw3lBhywEx vQqit7Qfn6fpQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E153E67FC1; Thu, 9 Oct 2025 21:43:54 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:40 -0600 Message-ID: <20251010034255.1099728-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VF3CRQ3YNUY6TVUENTZV3KOXXRBZWJ26 X-Message-ID-Hash: VF3CRQ3YNUY6TVUENTZV3KOXXRBZWJ26 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/18] expo: Support clicking on any type of object 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 It is sometimes useful to be able to click on an image (sometimes called an icon). Allow this within expo and return new click action. Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 1 + boot/cedit.c | 3 +++ boot/scene.c | 14 +++++++++++--- include/expo.h | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index 3365b5c3b06..bbc9a189c98 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -313,6 +313,7 @@ int bootflow_menu_poll(struct expo *exp, int *seqp) } case EXPOACT_QUIT: return -EPIPE; + case EXPOACT_CLICK: default: return -EAGAIN; } diff --git a/boot/cedit.c b/boot/cedit.c index 691780512ca..70a0c22fe68 100644 --- a/boot/cedit.c +++ b/boot/cedit.c @@ -220,6 +220,9 @@ int cedit_do_action(struct expo *exp, struct scene *scn, log_debug("quitting\n"); exp->done = true; break; + case EXPOACT_CLICK: + /* not supported by cedit */ + break; } return 0; diff --git a/boot/scene.c b/boot/scene.c index 4cf1b6d5852..dd13b74b4d7 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1167,9 +1167,11 @@ bool scene_obj_within(const struct scene *scn, struct scene_obj *obj, int x, switch (obj->type) { case SCENEOBJT_NONE: + break; case SCENEOBJT_IMAGE: case SCENEOBJT_TEXT: case SCENEOBJT_BOX: + within = is_within(obj, x, y); break; case SCENEOBJT_MENU: { struct scene_obj_menu *menu; @@ -1344,15 +1346,21 @@ int scene_send_click(struct scene *scn, int x, int y, struct expo_action *event) obj = scene_find_obj_within(scn, x, y, false, false); log_debug("non-popup obj %d '%s'\n", obj ? obj->id : -1, obj ? obj->name : "(none)"); - if (!obj) - return 0; + if (!obj) { + obj = scene_find_obj_within(scn, x, y, true, true); + log_debug("non-popup any obj %d '%s'\n", obj ? obj->id : -1, + obj ? obj->name : "(none)"); + if (!obj) + return 0; + } switch (obj->type) { case SCENEOBJT_NONE: case SCENEOBJT_IMAGE: case SCENEOBJT_TEXT: case SCENEOBJT_BOX: - /* These objects don't handle clicks directly */ + event->type = EXPOACT_CLICK; + event->select.id = obj->id; break; case SCENEOBJT_MENU: { struct scene_obj_menu *menu; diff --git a/include/expo.h b/include/expo.h index 619af627840..05f61cc9bd9 100644 --- a/include/expo.h +++ b/include/expo.h @@ -56,6 +56,7 @@ enum expo_id_t { * @EXPOACT_REPOINT_OPEN: menu closed, another menu opened (@prev_id indicates * the menu closed, @id indicates menu opened) * @EXPOACT_QUIT: request to exit the menu + * @EXPOACT_CLICK: click on an object */ enum expoact_type { EXPOACT_NONE, @@ -68,6 +69,7 @@ enum expoact_type { EXPOACT_POINT_CLOSE, EXPOACT_REPOINT_OPEN, EXPOACT_QUIT, + EXPOACT_CLICK, }; /**