diff options
author | Simon Glass <sjg@chromium.org> | 2023-10-01 19:13:29 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-10-11 15:43:55 -0400 |
commit | 8bc69b4b247f45cdfca18e942bf5a5995265479a (patch) | |
tree | 5167d311ea46c5d7eb5edcc4bf48d0b7e39c5086 /boot/scene_internal.h | |
parent | 117617c7c1d8f82304e019e5a2c7f1c23f78da8f (diff) |
expo: Make calculation of an object bounding box generic
We want to support this for any object, not just menus. Move the code
around to allow this.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/scene_internal.h')
-rw-r--r-- | boot/scene_internal.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 42efcee092f..326508874e6 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -9,6 +9,8 @@ #ifndef __SCENE_INTERNAL_H #define __SCENE_INTERNAL_H +struct vidconsole_bbox; + typedef int (*expo_scene_obj_iterator)(struct scene_obj *obj, void *priv); /** @@ -246,4 +248,41 @@ struct scene_menitem *scene_menuitem_find(const struct scene_obj_menu *menu, struct scene_menitem *scene_menuitem_find_seq(const struct scene_obj_menu *menu, uint seq); +/** + * scene_bbox_union() - update bouding box with the demensions of an object + * + * Updates @bbox so that it encompasses the bounding box of object @id + * + * @snd: Scene containing object + * @id: Object id + * @inset: Amount of inset to use for width + * @bbox: Bounding box to update + * Return: 0 if OK, -ve on error + */ +int scene_bbox_union(struct scene *scn, uint id, int inset, + struct vidconsole_bbox *bbox); + +/** + * scene_menu_calc_bbox() - Calculate bounding boxes for the menu + * + * @menu: Menu to process + * @bbox: Returns bounding box of menu including prompts + * @label_bbox: Returns bounding box of labels + * Return: 0 if OK, -ve on error + */ +void scene_menu_calc_bbox(struct scene_obj_menu *menu, + struct vidconsole_bbox *bbox, + struct vidconsole_bbox *label_bbox); + +/** + * scene_obj_calc_bbox() - Calculate bounding boxes for an object + * + * @obj: Object to process + * @bbox: Returns bounding box of object including prompts + * @label_bbox: Returns bounding box of labels (active area) + * Return: 0 if OK, -ve on error + */ +int scene_obj_calc_bbox(struct scene_obj *obj, struct vidconsole_bbox *bbox, + struct vidconsole_bbox *label_bbox); + #endif /* __SCENE_INTERNAL_H */ |