diff options
author | Simon Glass | 2023-10-01 19:13:31 -0600 |
---|---|---|
committer | Tom Rini | 2023-10-11 15:43:55 -0400 |
commit | 93f99b35ec7d32b86a00cd066d2f8107cc9c23ed (patch) | |
tree | ecf58c43e0c23256b0ad1849fb9fbb2c2540b681 /boot/scene.c | |
parent | 94598d5b0ab1739279a1f864dc88a8ed3140d7c9 (diff) |
expo: Add some scene fields needed for text entry
Add the CLI state, a buffer to hold the old value of the text being
edited and a place to save vidconsole entry context. These will be use
by the textline object.
Set an upper limit on the maximum number of characters in a textline
object supported by expo, at least for now.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/scene.c')
-rw-r--r-- | boot/scene.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/boot/scene.c b/boot/scene.c index 314dd7c6e84..0b44a13748a 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -32,6 +32,14 @@ int scene_new(struct expo *exp, const char *name, uint id, struct scene **scnp) return log_msg_ret("name", -ENOMEM); } + abuf_init(&scn->buf); + if (!abuf_realloc(&scn->buf, EXPO_MAX_CHARS + 1)) { + free(scn->name); + free(scn); + return log_msg_ret("buf", -ENOMEM); + } + abuf_init(&scn->entry_save); + INIT_LIST_HEAD(&scn->obj_head); scn->id = resolve_id(exp, id); scn->expo = exp; @@ -57,6 +65,8 @@ void scene_destroy(struct scene *scn) list_for_each_entry_safe(obj, next, &scn->obj_head, sibling) scene_obj_destroy(obj); + abuf_uninit(&scn->entry_save); + abuf_uninit(&scn->buf); free(scn->name); free(scn); } |