summaryrefslogtreecommitdiff
path: root/boot/expo.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-06-01 10:22:52 -0600
committerTom Rini <trini@konsulko.com>2023-07-14 12:54:51 -0400
commit699b0acb522fd808b67b745b541bacf18c275d15 (patch)
treeadaa46800aadebb241d88974aaebde13512a5885 /boot/expo.c
parent50f02037594563dbc8da67f65959499bc1f5a46a (diff)
expo: Set up the width and height of objects
Provide a way to set the full dimensions of objects, i.e. including the width and height. For menus, calculate the bounding box of all objects in the menu. Set all labels to be the same size, so that highlighting works correct, once implemented. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/expo.c')
-rw-r--r--boot/expo.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/boot/expo.c b/boot/expo.c
index be11cfd4e94..67cae3c7e28 100644
--- a/boot/expo.c
+++ b/boot/expo.c
@@ -114,6 +114,30 @@ int expo_set_display(struct expo *exp, struct udevice *dev)
return 0;
}
+int expo_calc_dims(struct expo *exp)
+{
+ struct scene *scn;
+ int ret;
+
+ if (!exp->cons)
+ return log_msg_ret("dim", -ENOTSUPP);
+
+ list_for_each_entry(scn, &exp->scene_head, sibling) {
+ /*
+ * Do the menus last so that all the menus' text objects
+ * are dimensioned
+ */
+ ret = scene_calc_dims(scn, false);
+ if (ret)
+ return log_msg_ret("scn", ret);
+ ret = scene_calc_dims(scn, true);
+ if (ret)
+ return log_msg_ret("scn", ret);
+ }
+
+ return 0;
+}
+
void expo_set_text_mode(struct expo *exp, bool text_mode)
{
exp->text_mode = text_mode;