diff options
author | Simon Glass | 2023-06-01 10:22:53 -0600 |
---|---|---|
committer | Tom Rini | 2023-07-14 12:54:51 -0400 |
commit | 2e59389704cd1e46101f7ffda2dac3f44f2fa332 (patch) | |
tree | 2ec4afe667eb58b3eca7be70ec4522af44ca068c /include/expo.h | |
parent | 699b0acb522fd808b67b745b541bacf18c275d15 (diff) |
expo: Support simple themes
It is a pain to manually set the fonts of all objects to be consistent.
Some spacing settings are also better set globally than by manually
positioning each object.
Add a 'theme' to the expo, to hold this information. For now it includes
only the font size.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/expo.h')
-rw-r--r-- | include/expo.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/expo.h b/include/expo.h index 6c45c403cf7..ea8f38913d8 100644 --- a/include/expo.h +++ b/include/expo.h @@ -7,6 +7,7 @@ #ifndef __SCENE_H #define __SCENE_H +#include <dm/ofnode_decl.h> #include <linux/list.h> struct udevice; @@ -43,6 +44,19 @@ struct expo_action { }; /** + * struct expo_theme - theme for the expo + * + * @font_size: Default font size for all text + * @menu_inset: Inset width (on each side and top/bottom) for menu items + * @menuitem_gap_y: Gap between menu items in pixels + */ +struct expo_theme { + u32 font_size; + u32 menu_inset; + u32 menuitem_gap_y; +}; + +/** * struct expo - information about an expo * * A group of scenes which can be presented to the user, typically to obtain @@ -57,6 +71,7 @@ struct expo_action { * type set to EXPOACT_NONE if there is no action * @text_mode: true to use text mode for the menu (no vidconsole) * @priv: Private data for the controller + * @theme: Information about fonts styles, etc. * @scene_head: List of scenes * @str_head: list of strings */ @@ -69,6 +84,7 @@ struct expo { struct expo_action action; bool text_mode; void *priv; + struct expo_theme theme; struct list_head scene_head; struct list_head str_head; }; @@ -583,4 +599,12 @@ int expo_send_key(struct expo *exp, int key); */ int expo_action_get(struct expo *exp, struct expo_action *act); +/** + * expo_apply_theme() - Apply a theme to an expo + * + * @exp: Expo to update + * @node: Node containing the theme + */ +int expo_apply_theme(struct expo *exp, ofnode node); + #endif /*__SCENE_H */ |