From patchwork Mon Sep 15 12:28:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 332 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=1757939422; bh=ZNk9OwUIM9AbNY+xMnbTOJECOxoiRYyCqwZ750Jr9/w=; 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=ibVHlQRE25pgRUUgr5V+of2m9mUCz6/opk7UnNZ70lTIzfer8pGmG6MKvt0Z0xCBt GX9vbi8xpUSkmBvcPtrCJfORuOHk2L94Hl97yqnzGYvF+zcU4yBp8Dqh4yEU5VL6Hu 2qUkKmC3rLDNQpbTi3LE3mUd8u8PrD9cD0KZSZWgWpPy3zm0blgSwYmp9WwBml+rWs HoVhW8Xkn5SeztsnUGpxj6E7HCiJvdbEcNDycmLbhaOBMPWigyzkbVwYXx1J92DmeE /ye8Sfev0QL3Z9zDiCXewq9gHwLGMzEoeSLM/86EwClH+PBVgGcG7xqS8ZwUVFCGp9 MbeoiMt8jbqUg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7C49D67BE1 for ; Mon, 15 Sep 2025 06:30:22 -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 YRoYlO9q347q for ; Mon, 15 Sep 2025 06:30:22 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939422; bh=ZNk9OwUIM9AbNY+xMnbTOJECOxoiRYyCqwZ750Jr9/w=; 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=ibVHlQRE25pgRUUgr5V+of2m9mUCz6/opk7UnNZ70lTIzfer8pGmG6MKvt0Z0xCBt GX9vbi8xpUSkmBvcPtrCJfORuOHk2L94Hl97yqnzGYvF+zcU4yBp8Dqh4yEU5VL6Hu 2qUkKmC3rLDNQpbTi3LE3mUd8u8PrD9cD0KZSZWgWpPy3zm0blgSwYmp9WwBml+rWs HoVhW8Xkn5SeztsnUGpxj6E7HCiJvdbEcNDycmLbhaOBMPWigyzkbVwYXx1J92DmeE /ye8Sfev0QL3Z9zDiCXewq9gHwLGMzEoeSLM/86EwClH+PBVgGcG7xqS8ZwUVFCGp9 MbeoiMt8jbqUg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 662A267B3C for ; Mon, 15 Sep 2025 06:30:22 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939420; bh=cJEDmOeAyCdG6uyejtC1rBcFFWWvEbqABnsMc1jLmrg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tMUILTs2YWYn/2jleGkPF9Kvo+cmm8ipidGEawGM67TMbOxr1ndjz8MOu0791LqeU RvsnXMOoqykvIu5Y8MBXUog9JxnbzjSuIrtUWKtn9Pw1sWqiZNGRcEaiEZZRNvwIz4 aPponCPi2zezwHxUarjXwGuBuMMnnfTNjOHdOdKmhvlgpxnVNwCID8+7fq8HMkyOfD 8qC7vp1P6IYJ4eHeWME0/NsGUozyc2uNv8JCuRMlfHMQsw4WZaIgRwoYjpzTS3qg6R kCVPGhvzDlGNJWbk4Z6qT+9Xe3i2KzT01c9CPFN0wdOZ8RCjyNxViFJIhlcmiwssZ+ TOmSoM32J8MHw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 33E6567BAC; Mon, 15 Sep 2025 06:30:20 -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 Wt2hPbKMs2rJ; Mon, 15 Sep 2025 06:30:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939419; bh=74uFzuJAuAwbUHxmGOGsgdNUxGD0F/lbmzlNyglKH6Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hA1pP/p0kGKXHHLngGYl2zU6wgDt7RD1fPH9hPPVCnBAcqSFb3f73CcIFOAZHhta1 EjBbF+bKtBeZ+j+E2l7iUEOG3x5TzN0FCVBPFy60HJxQfxn0lJK4VBuroiDL/csItQ NesEnn9sT1VsIHc3yMJAMiCJsr2ocp+/X3Y9pRicyk1bWSdrrHjYDuetnPV4d97q1I +6bSxfp+ATTgwtqO1Pok4X6aDpLtyESif8IU8SATUC2BHMK3YOcMQHoIoAjbKuqh1G lnDt3xt6j1KgAMbQN0NWhrJYrKmnTeAUwBnXYGWbggKWd14ELk4m7yo851oYwXIho4 M00npymRFS0RA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AA0AF67B34; Mon, 15 Sep 2025 06:30:19 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 15 Sep 2025 06:28:50 -0600 Message-ID: <20250915122905.1217249-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250915122905.1217249-1-sjg@u-boot.org> References: <20250915122905.1217249-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 27J2HPXKVYTC3LEZYWR4XERTHXUY7BNF X-Message-ID-Hash: 27J2HPXKVYTC3LEZYWR4XERTHXUY7BNF 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 17/23] expo: Support sending a click to an expo 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 Implement clicking on an expo, which simply passes it onto the scene. For now, there are no callers for this function. Signed-off-by: Simon Glass --- boot/expo.c | 24 ++++++++++++++++++++++++ include/expo.h | 13 +++++++++++++ 2 files changed, 37 insertions(+) diff --git a/boot/expo.c b/boot/expo.c index e18f149a22f..b4fa4fdd488 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -292,6 +292,30 @@ int expo_send_key(struct expo *exp, int key) return scn ? 0 : -ECHILD; } +int expo_send_click(struct expo *exp, int x, int y) +{ + struct scene *scn = NULL; + + if (exp->scene_id) { + int ret; + + scn = expo_lookup_scene_id(exp, exp->scene_id); + if (!scn) + return log_msg_ret("scn", -ENOENT); + + ret = scene_send_click(scn, x, y, &exp->action); + if (ret) + return log_msg_ret("click", ret); + + /* arrange it to get any changes */ + ret = scene_arrange(scn); + if (ret) + return log_msg_ret("arr", ret); + } + + return scn ? 0 : -ECHILD; +} + int expo_action_get(struct expo *exp, struct expo_action *act) { *act = exp->action; diff --git a/include/expo.h b/include/expo.h index a860ba901e4..d6983ee77d4 100644 --- a/include/expo.h +++ b/include/expo.h @@ -1064,12 +1064,25 @@ int scene_arrange(struct scene *scn); /** * expo_send_key() - set a keypress to the expo * + * This processes the key, taking any action that is needed, such as moving + * between menu items or editing the text in a textline + * * @exp: Expo to receive the key * @key: Key to send (ASCII or enum bootmenu_key) * Returns: 0 if OK, -ECHILD if there is no current scene */ int expo_send_key(struct expo *exp, int key); +/** + * expo_send_click() - send a mouse click to the expo + * + * @exp: Expo to receive the click + * @x: X coordinate of click + * @y: Y coordinate of click + * Returns: 0 if OK, -ECHILD if there is no current scene + */ +int expo_send_click(struct expo *exp, int x, int y); + /** * expo_action_get() - read user input from the expo *