From 9f44b544e1d8b23dec51567c657e81488a289d6d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 2 May 2025 08:46:24 -0600 Subject: expo: Provide access to the current menu item Add functions to allow a caller to find out the current menu item and to select a different one. Update the event handling so that an attempt to change the current item (e.g. by pressing the up-arrow key) is reported to the caller, since this may be used to cancel an autoboot timeout. Signed-off-by: Simon Glass --- include/expo.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include') diff --git a/include/expo.h b/include/expo.h index f8d44c0ea20..a2b093c521d 100644 --- a/include/expo.h +++ b/include/expo.h @@ -689,6 +689,26 @@ int scene_menu_set_title(struct scene *scn, uint id, uint title_id); */ int scene_menu_set_pointer(struct scene *scn, uint id, uint cur_item_id); +/** + * scene_menu_select_item() - move the pointer/highlight to an item + * + * @scn: Scene to update + * @id: ID of menu object to update + * @sel_id: ID of the menuitem to select + * Return 0 on success, -ENOENT if there was no such item + */ +int scene_menu_select_item(struct scene *scn, uint id, uint sel_id); + +/** + * scene_menu_get_cur_item() - get the currently pointed-to item + * + * @scn: Scene to update + * @id: ID of menu object to update + * Return ID of the current item the menu is pointing to, -ENOENT if @id is not + * valid, 0 if no item is pointed to + */ +int scene_menu_get_cur_item(struct scene *scn, uint id); + /** * scene_obj_get_hw() - Get width and height of an object in a scene * -- cgit v1.3.1