expo: Support sending a click to an expo

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 <sjg@chromium.org>
This commit is contained in:
Simon Glass
2025-09-15 03:29:17 -06:00
parent f5ec16dbea
commit a6fd275924
2 changed files with 37 additions and 0 deletions

View File

@@ -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;

View File

@@ -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
*