From patchwork Mon Sep 15 12:28:47 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 329 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=1757939413; bh=eVa17nhq1fA3QJxI+Jfu/McrvlVSg+AkTjiOWthqwto=; 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=gbCxB8N6wFhCeEPKlQxLVl2fb0GnRe4jVwqXw9zHG0FOPunDK3g1NOPXdWudqtP/e /hGvqYUGlStHnTeRpCzXZM8+E1DBW+2A+wAgoF1c2Sq7c8d9cJrEZ7l/uvG2Dzbp6S P09ghEZtzcpiF08rcwqL3m2E/WrlAzdBwmAFmjJmcRTFBcEiElCpfXl1spiWiMUaSe Hyrzi3RqmWK8THNPgZqsBoHgejEXKMBwxnQjojM+bBakupQIRWmSkgp8QZcX0Lglxh KVn8JoynRRAlrAQl30qsVFH22Ce8bCMuj/piPQpvmxiix3+YCyJo+3Lu3ul8QAqLGb RSm2kCa8e/ejw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0392967BD4 for ; Mon, 15 Sep 2025 06:30:13 -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 3sMOj1lcHwfp for ; Mon, 15 Sep 2025 06:30:12 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939412; bh=eVa17nhq1fA3QJxI+Jfu/McrvlVSg+AkTjiOWthqwto=; 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=N4O2atlDJs6ildaOOOGjBKyUECC3EzF3cVpqAoCiX4jnOo9l8q7KyR54ZfNWeamHU NwbSK5yzHFiTQ7+9Ea69X3OkQGmzZAaFba9AaP8RxwTvkYoPkvN7OQJJJmHIx9CmTx 1m1WxfRdEPqDX9S81DaU+r+OezEQW8QzUSu1ki69F487Kw4mRoFVega0BZ+kegsqou qibQqsXmrYQMOXec8j5bZuUfJS0jxfgOrmZFf0lGnIYBRSESPkD328vmk4cYL5rjlh xSw0l+IZ5/YPNdy/mURUm1mooSm0Wi18lFE0l3SkLmISFdZ29X/iWjmTVXnHcrtq+f oLwtNXnX1mcEw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E459F67BAC for ; Mon, 15 Sep 2025 06:30:12 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939410; bh=MJ5Ei6EyshjA2J0+7gvk/8NMissgXtWJbOa3xnLlh84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R36YQ2V5MAgYwuzujkYiQk1nPwKLGTPiqaay7KcRZ8YgWwNrCaZAVG9K0gR3GKYtL +iZ68JE/iVFH1cNi3hdKivXm0QSMjKG58Ii1g1IbjaNlZM2dNpXrhDfrFzUCHq+BWY 4TmjrDPx4ETcU2Yl5+HsuPcJNVM0bPqzDoiN5zZNulCMLw8rKs7VZIUQ6SkbZLOSkL 5zXRv0Z9meh+rGLUPbXHtICFELHJDvnrsOtn70tNIIJgfBXqUNr9Hl6nnN92TaKwHn 6MKXj3hDF4huGKNBwah/FbzwtjyAK8hSl7iMw8nBWi8UDbz9m2WqCeRJLi9b8hArlw 42Ix15XTQWszA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B7B1467A04; Mon, 15 Sep 2025 06:30:10 -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 hRekZyub6MyI; Mon, 15 Sep 2025 06:30:10 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939406; bh=1pXVGFDNQx5VWKrXfqyMMNFPl8wSZhk7XcIQsGGe6ms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PCzwWxzZJIity7btYk4oHFnecIcJ4nXjjPEl03NXzrXHidNr+Iy0bTk9WWcrrZ1Pd SbhCLCoWBFuFQK6ZvAOGCrLgY5JMQoW3sec//IWv4/8ASzUPP0GgAqJW5cjki3cxl9 FIdhjpcGuWLrzyhqn2vrLcg6iZ15DX3q8ckgmXXkBFuo5T9bzE9uqd0PiWobPiQfP5 YkXWbvgBsq0UZIUdrUWq+0o7QwnmoKptDyTLCyeXGpIFLmkseu65w8dIF9dgNnsotY AaWHcPJRZYW1sh0MlwRwrRSiSgHxbIp2A1l39pA47TJkDGYkg2uX5A0II9nLk4ZlYy YWFb45huG/2+w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5659767B3C; Mon, 15 Sep 2025 06:30:06 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 15 Sep 2025 06:28:47 -0600 Message-ID: <20250915122905.1217249-15-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: 3ASNX3QEXU2C4P4FRYFKSGMK4QPWOKIM X-Message-ID-Hash: 3ASNX3QEXU2C4P4FRYFKSGMK4QPWOKIM 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 14/23] expo: Add three new actions for mouse events 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 Popup menus have particular behaviour which needs to be modelled in the expoact_type enum: - clicking on a menu item should select it and close the menu - clicking on a menu should highlight it and open the menu - clicking on a menu while another menu is open should select the item, close the menu, then open the other menu Add actions associated with each of these. These are modelled as combined actions for simplicity. Implement the actions in cedit. The general expo support will come later. Signed-off-by: Simon Glass --- boot/cedit.c | 21 +++++++++++++++++++++ include/expo.h | 11 +++++++++++ 2 files changed, 32 insertions(+) diff --git a/boot/cedit.c b/boot/cedit.c index cc60e757649..ab1a79c1412 100644 --- a/boot/cedit.c +++ b/boot/cedit.c @@ -191,6 +191,27 @@ int cedit_do_action(struct expo *exp, struct scene *scn, scene_set_open(scn, act->select.id, false); cedit_arange(exp, vid_priv, scn->id); break; + case EXPOACT_POINT_OPEN: + scene_set_highlight_id(scn, act->select.id); + scene_set_open(scn, act->select.id, true); + cedit_arange(exp, vid_priv, scn->id); + break; + case EXPOACT_POINT_CLOSE: + /* Point to the item (select it in the menu) */ + ret = scene_menu_select_item(scn, scn->highlight_id, + act->select.id); + if (ret) + return log_msg_ret("pco", ret); + /* Close the menu */ + scene_set_open(scn, scn->highlight_id, false); + cedit_arange(exp, vid_priv, scn->id); + break; + case EXPOACT_REPOINT_OPEN: + scene_set_open(scn, act->select.prev_id, false); + scene_set_highlight_id(scn, act->select.id); + scene_set_open(scn, act->select.id, true); + cedit_arange(exp, vid_priv, scn->id); + break; case EXPOACT_SELECT: scene_set_open(scn, scn->highlight_id, false); cedit_arange(exp, vid_priv, scn->id); diff --git a/include/expo.h b/include/expo.h index 571ba513fa6..a860ba901e4 100644 --- a/include/expo.h +++ b/include/expo.h @@ -47,6 +47,12 @@ enum expo_id_t { * @EXPOACT_OPEN: menu was opened, so an item can be selected (@id indicates * which menu object) * @EXPOACT_CLOSE: menu was closed (@id indicates which menu object) + * @EXPOACT_POINT_OPEN: menu item was pointed to and menu opened (@id indicates + * which menu object) + * @EXPOACT_POINT_CLOSE: menu item was pointed to and menu closed @id indicates + * which menu item) + * @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 */ enum expoact_type { @@ -56,6 +62,9 @@ enum expoact_type { EXPOACT_SELECT, EXPOACT_OPEN, EXPOACT_CLOSE, + EXPOACT_POINT_OPEN, + EXPOACT_POINT_CLOSE, + EXPOACT_REPOINT_OPEN, EXPOACT_QUIT, }; @@ -65,6 +74,7 @@ enum expoact_type { * @type: Action type (EXPOACT_NONE if there is no action) * @select: Used for all actions except EXPOACT_NONE and EXPOACT_QUIT * @select.id: ID number of the object affected + * @select.prev_id: ID number of the old object that was highlighted * @select.changed: true if the selection has changed since last time (only * valid for EXPOACT_POINT_ITEM) */ @@ -73,6 +83,7 @@ struct expo_action { union { struct { int id; + int prev_id; bool changed; } select; };