From: Simon Glass <sjg@chromium.org>
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>
---
boot/expo.c | 24 ++++++++++++++++++++++++
include/expo.h | 13 +++++++++++++
2 files changed, 37 insertions(+)
@@ -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;
@@ -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
*