From ae45d6cf5a564851a9b9d58e05425e4cf1dfe8aa Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 1 Jun 2023 10:22:49 -0600 Subject: expo: Add width and height to objects At present objects only have a position so it is not possible to determine the amount of space they take up on the display. Add width and height properties, using a struct to keep all the dimensions together. For now this is not used. Future work will set up these new properties. Signed-off-by: Simon Glass --- include/expo.h | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/expo.h b/include/expo.h index b8f5327f266..5135954ba13 100644 --- a/include/expo.h +++ b/include/expo.h @@ -122,6 +122,21 @@ enum scene_obj_t { SCENEOBJT_MENU, }; +/** + * struct scene_dim - Dimensions of an object + * + * @x: x position, in pixels from left side + * @y: y position, in pixels from top + * @w: width, in pixels + * @h: height, in pixels + */ +struct scene_dim { + int x; + int y; + int w; + int h; +}; + /** * struct scene_obj - information about an object in a scene * @@ -129,8 +144,7 @@ enum scene_obj_t { * @name: Name of the object (allocated) * @id: ID number of the object * @type: Type of this object - * @x: x position, in pixels from left side - * @y: y position, in pixels from top + * @dim: Dimensions for this object * @hide: true if the object should be hidden * @sibling: Node to link this object to its siblings */ @@ -139,8 +153,7 @@ struct scene_obj { char *name; uint id; enum scene_obj_t type; - int x; - int y; + struct scene_dim dim; bool hide; struct list_head sibling; }; -- cgit v1.2.3