summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-06-01 10:22:49 -0600
committerTom Rini <trini@konsulko.com>2023-07-14 12:54:51 -0400
commitae45d6cf5a564851a9b9d58e05425e4cf1dfe8aa (patch)
treea77c33ad3ee30774bb303dc653fba5c2b899f707 /boot
parent2d6ee92c6af06eeb7f7410180d5faa8f5e840bbb (diff)
downloadu-boot-ae45d6cf5a564851a9b9d58e05425e4cf1dfe8aa.tar.gz
u-boot-ae45d6cf5a564851a9b9d58e05425e4cf1dfe8aa.tar.bz2
u-boot-ae45d6cf5a564851a9b9d58e05425e4cf1dfe8aa.zip
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 <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r--boot/scene.c8
-rw-r--r--boot/scene_menu.c12
2 files changed, 10 insertions, 10 deletions
diff --git a/boot/scene.c b/boot/scene.c
index 2ac9bfcdbd..8033d77fb2 100644
--- a/boot/scene.c
+++ b/boot/scene.c
@@ -201,8 +201,8 @@ int scene_obj_set_pos(struct scene *scn, uint id, int x, int y)
obj = scene_obj_find(scn, id, SCENEOBJT_NONE);
if (!obj)
return log_msg_ret("find", -ENOENT);
- obj->x = x;
- obj->y = y;
+ obj->dim.x = x;
+ obj->dim.y = y;
return 0;
}
@@ -272,8 +272,8 @@ static int scene_obj_render(struct scene_obj *obj, bool text_mode)
struct udevice *cons = text_mode ? NULL : exp->cons;
int x, y, ret;
- x = obj->x;
- y = obj->y;
+ x = obj->dim.x;
+ y = obj->dim.y;
switch (obj->type) {
case SCENEOBJT_NONE:
diff --git a/boot/scene_menu.c b/boot/scene_menu.c
index 8b04d44031..eed7565f6a 100644
--- a/boot/scene_menu.c
+++ b/boot/scene_menu.c
@@ -49,9 +49,9 @@ int scene_menu_arrange(struct scene *scn, struct scene_obj_menu *menu)
int y, cur_y;
int ret;
- y = menu->obj.y;
+ y = menu->obj.dim.y;
if (menu->title_id) {
- ret = scene_obj_set_pos(scn, menu->title_id, menu->obj.x, y);
+ ret = scene_obj_set_pos(scn, menu->title_id, menu->obj.dim.x, y);
if (ret < 0)
return log_msg_ret("tit", ret);
@@ -89,18 +89,18 @@ int scene_menu_arrange(struct scene *scn, struct scene_obj_menu *menu)
* pointer, then the key and the description
*/
if (item->label_id) {
- ret = scene_obj_set_pos(scn, item->label_id, menu->obj.x,
+ ret = scene_obj_set_pos(scn, item->label_id, menu->obj.dim.x,
y);
if (ret < 0)
return log_msg_ret("nam", ret);
}
- ret = scene_obj_set_pos(scn, item->key_id, menu->obj.x + 230,
+ ret = scene_obj_set_pos(scn, item->key_id, menu->obj.dim.x + 230,
y);
if (ret < 0)
return log_msg_ret("key", ret);
- ret = scene_obj_set_pos(scn, item->desc_id, menu->obj.x + 280,
+ ret = scene_obj_set_pos(scn, item->desc_id, menu->obj.dim.x + 280,
y);
if (ret < 0)
return log_msg_ret("des", ret);
@@ -134,7 +134,7 @@ int scene_menu_arrange(struct scene *scn, struct scene_obj_menu *menu)
* points to
*/
ret = scene_obj_set_pos(scn, menu->pointer_id,
- menu->obj.x + 200, cur_y);
+ menu->obj.dim.x + 200, cur_y);
if (ret < 0)
return log_msg_ret("ptr", ret);
}