From 5a80996cb6a285d09c03d687dc9ad793f12e7bf1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 2 May 2025 08:46:37 -0600 Subject: expo: Create a struct for generic text attributes In preparation for adding more text types, refactor the common fields into a new structure. This will allow common code to be used. Signed-off-by: Simon Glass --- include/expo.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/expo.h b/include/expo.h index 990cb3094ee..32d69f269a7 100644 --- a/include/expo.h +++ b/include/expo.h @@ -291,22 +291,31 @@ struct scene_obj_img { }; /** - * struct scene_obj_txt - information about a text object in a scene - * - * This is a single-line text object + * struct scene_txt_generic - Generic information common to text objects * - * @obj: Basic object information * @str_id: ID of the text string to display * @font_name: Name of font (allocated by caller) * @font_size: Nominal size of font in pixels */ -struct scene_obj_txt { - struct scene_obj obj; +struct scene_txt_generic { uint str_id; const char *font_name; uint font_size; }; +/** + * struct scene_obj_txt - information about a text object in a scene + * + * This is a single-line text object + * + * @obj: Basic object information + * @gen: Generic information common to all objects which show text + */ +struct scene_obj_txt { + struct scene_obj obj; + struct scene_txt_generic gen; +}; + /** * struct scene_obj_menu - information about a menu object in a scene * -- cgit v1.2.3