summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Glass <[email protected]>2025-05-02 08:46:44 -0600
committerSimon Glass <[email protected]>2025-05-30 09:49:32 +0100
commit0635004e2228dea0aab023d7c56b0b74633e8a3c (patch)
treee0a97abca641a51f48f40eede6ad48c6ec6451e7 /include
parentd25c62fd58fa664314db3bdbbbb0707757666297 (diff)
expo: Implement a box
It is useful to be able to draw a box around elements in the menu. Add support for an unfilled box with a selectable thickness. Note that there is no support for selecting the colour for any expo objects yet. Signed-off-by: Simon Glass <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/expo.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/expo.h b/include/expo.h
index a79aa1da74f..8833dcceb7e 100644
--- a/include/expo.h
+++ b/include/expo.h
@@ -179,6 +179,7 @@ struct scene {
*
* @SCENEOBJT_NONE: Used to indicate that the type does not matter
* @SCENEOBJT_IMAGE: Image data to render
+ * @SCENEOBJT_BOX: Rectangular box
* @SCENEOBJT_TEXT: Text line to render
* @SCENEOBJT_MENU: Menu containing items the user can select
* @SCENEOBJT_TEXTLINE: Line of text the user can edit
@@ -187,6 +188,7 @@ enum scene_obj_t {
SCENEOBJT_NONE = 0,
SCENEOBJT_IMAGE,
SCENEOBJT_TEXT,
+ SCENEOBJT_BOX,
/* types from here on can be highlighted */
SCENEOBJT_MENU,
@@ -407,6 +409,19 @@ struct scene_obj_textline {
};
/**
+ * struct scene_obj_box - information about a box in a scene
+ *
+ * A box surrounds a part of the screen with a border
+ *
+ * @obj: Basic object information
+ * @width: Line-width in pixels
+ */
+struct scene_obj_box {
+ struct scene_obj obj;
+ uint width;
+};
+
+/**
* struct expo_arrange_info - Information used when arranging a scene
*
* @label_width: Maximum width of labels in scene
@@ -671,6 +686,19 @@ int scene_textline(struct scene *scn, const char *name, uint id, uint max_chars,
struct scene_obj_textline **tlinep);
/**
+ * scene_box() - create a box
+ *
+ * @scn: Scene to update
+ * @name: Name to use (this is allocated by this call)
+ * @id: ID to use for the new object (0 to allocate one)
+ * @width: Line-width in pixels
+ * @boxp: If non-NULL, returns the new object
+ * Returns: ID number for the object (typically @id), or -ve on error
+ */
+int scene_box(struct scene *scn, const char *name, uint id, uint width,
+ struct scene_obj_box **boxp);
+
+/**
* scene_txt_set_font() - Set the font for an object
*
* @scn: Scene to update