From 699b0acb522fd808b67b745b541bacf18c275d15 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 1 Jun 2023 10:22:52 -0600 Subject: 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 --- include/expo.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include') diff --git a/include/expo.h b/include/expo.h index b6777cebcbe..6c45c403cf7 100644 --- a/include/expo.h +++ b/include/expo.h @@ -327,6 +327,16 @@ const char *expo_get_str(struct expo *exp, uint id); */ int expo_set_display(struct expo *exp, struct udevice *dev); +/** + * expo_calc_dims() - Calculate the dimensions of the objects + * + * Updates the width and height of all objects based on their contents + * + * @exp: Expo to update + * Returns 0 if OK, -ENOTSUPP if there is no graphical console + */ +int expo_calc_dims(struct expo *exp); + /** * expo_set_scene_id() - Set the current scene ID * @@ -468,6 +478,17 @@ int scene_txt_set_font(struct scene *scn, uint id, const char *font_name, */ int scene_obj_set_pos(struct scene *scn, uint id, int x, int y); +/** + * scene_obj_set_size() - Set the size of an object + * + * @scn: Scene to update + * @id: ID of object to update + * @w: width in pixels + * @h: height in pixels + * Returns: 0 if OK, -ENOENT if @id is invalid + */ +int scene_obj_set_size(struct scene *scn, uint id, int w, int h); + /** * scene_obj_set_hide() - Set whether an object is hidden * -- cgit v1.3.1