diff options
author | Simon Glass <sjg@chromium.org> | 2023-10-01 19:13:33 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-10-11 15:43:55 -0400 |
commit | 93c901bc7d90f25a6447ae9e17136c83e8b99052 (patch) | |
tree | ca9bdd91a79eda0b90598ccb386e7080ca0323f7 /boot/scene.c | |
parent | 4db7519032f94bc769a7a32421b26b2ec58cbbe5 (diff) |
expo: Support opening a textline
This object needs special handling when it is opened, to set up the CLI
and the vidconsole context. Add special support for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/scene.c')
-rw-r--r-- | boot/scene.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/boot/scene.c b/boot/scene.c index 0b44a13748a..6c7c926f7c9 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -759,10 +759,42 @@ void scene_highlight_first(struct scene *scn) } } +static int scene_obj_open(struct scene *scn, struct scene_obj *obj) +{ + int ret; + + switch (obj->type) { + case SCENEOBJT_NONE: + case SCENEOBJT_IMAGE: + case SCENEOBJT_MENU: + case SCENEOBJT_TEXT: + break; + case SCENEOBJT_TEXTLINE: + ret = scene_textline_open(scn, + (struct scene_obj_textline *)obj); + if (ret) + return log_msg_ret("op", ret); + break; + } + + return 0; +} + int scene_set_open(struct scene *scn, uint id, bool open) { + struct scene_obj *obj; int ret; + obj = scene_obj_find(scn, id, SCENEOBJT_NONE); + if (!obj) + return log_msg_ret("find", -ENOENT); + + if (open) { + ret = scene_obj_open(scn, obj); + if (ret) + return log_msg_ret("op", ret); + } + ret = scene_obj_flag_clrset(scn, id, SCENEOF_OPEN, open ? SCENEOF_OPEN : 0); if (ret) |