History log of /u-boot/boot/scene.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# d678a59d 18-May-2024 Tom Rini <trini@konsulko.com>

Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""

When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay
Ethernet"' I failed to notice that b4 noticed it was based on next and
so took that as the base commit and merged that part of next to master.

This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing
changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35.

Reported-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Tom Rini <trini@konsulko.com>

# c4b646d4 27-Apr-2024 Tom Rini <trini@konsulko.com>

boot: Remove <common.h> and add needed includes

Remove <common.h> from all "boot/" files and when needed add
missing include files directly.

Signed-off-by: Tom Rini <trini@konsulko.com>

# c4fea34f 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Plumb in textlines to a scene

Provide an implementation for textlines in the scene code, so that they
are displayed correctly. Provide a way to have a border around the
textline, with the internal part being the same colour as the
background. This looks more natural.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 93c901bc 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Support opening a textline

This object needs special handling when it is opened, to set up the CLI
and the vidconsole context. Add special support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 93f99b35 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Add some scene fields needed for text entry

Add the CLI state, a buffer to hold the old value of the text being
edited and a place to save vidconsole entry context. These will be use
by the textline object.

Set an upper limit on the maximum number of characters in a textline
object supported by expo, at least for now.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 94598d5b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Allow rendering the background of any object

So far only menus have a background. When other object types are
rendered, they may have a background too. Make this code more generic
so it will be usable by new object types.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8bc69b4b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Make calculation of an object bounding box generic

We want to support this for any object, not just menus. Move the code
around to allow this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# d88edd2b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Allow highlighting other scene-object types

So far only menus can be highlighted. With the coming addition of
text lines we need to be able to highlight other objects. Add a function
to determine whether an object can be highlighted.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 408011c2 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Correct the logic for duplicate-ID detection

Update scene_txt_str() to account for the possibility that the passed-in
str_id may be 0

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9767de7b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Correct some swallowed errors in scene

Return the reported error, rather than assuming it is -ENOMEM

Signed-off-by: Simon Glass <sjg@chromium.org>

# fd6073ac 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Use switch statements more for object types

In a lot of cases menus are the only objects which are have their own
behaviour in the cedit, e.g. to move between menus. With expo expanding
to support text, this is no-longer true.

Use a switch() statement so that we can simply insert a new 'case' for
the new object types.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2eb6ad5 14-Aug-2023 Simon Glass <sjg@chromium.org>

expo: Provide a way to iterate through all scene objects

For some operations it is necessary to process all objects in an expo.
Provide an iterator to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 633b3dc7 14-Aug-2023 Simon Glass <sjg@chromium.org>

expo: Make scene_obj_find() take a const scene

This does not change the scene, so mark the pointer const.

Signed-off-by: Simon Glass <sjg@chromium.org>

# a0874dc4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add a configuration editor

Add a new 'cedit' command which allows editing configuration using an
expo. The configuration items appear as menus on the display.

This is extremely basic, only supporting menus and not providing any way
to load or save the configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7230fdb3 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add spacing around menus and items

It looks better if menus have a bit of an inset, rather than be drawn hard
up against the background. Also, menu items look better if they have a bit
of spacing between them.

Add theme options for these and implement the required changes.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4e64beeb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Implement the keypress logic for popup menus

In 'popup' mode, the expo allows moving around the objects in a scene.
When 'enter' is pressed on a menu, it opens and the user can move around
the items in the menu.

Implement this using keypress handles and actions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4c87e073 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw the current opened menu on top

When a menu is opened, it must be displayed over all other objects in
the scene, so that all its items are visible.

Handle this by drawing the menu object a second time, after all other
objects have been drawn. Draw all of the objects which are dependent
on the menu object.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 756c9559 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw popup menus in both opened and closed states

When a popup menu is closed it shows only the selected item. When it is
open it shows a background and all items, with a highlight that can be
moved between the items.

Add the drawing logic for this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2e593897 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 699b0acb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Set up the width and height of objects

Provide a way to set the full dimensions of objects, i.e. including the
width and height.

For menus, calculate the bounding box of all objects in the menu. Set all
labels to be the same size, so that highlighting works correct, once
implemented.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 50f02037 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Calculate text bounding-box correctly

Rather than estimating, measure the text accurately, using the new
vidconsole feature. This allows accurate placement of objects.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ce72c9ec 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Use flags for objects

We currently have just a 'hide' property for each object. In preparation
for adding more properties, convert the struct to use a flags value,
instead of individual booleans. This is more extensible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ae45d6cf 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 9af34150 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Allow setting the start of the dynamic-ID range

Provide a way to set this value so that it is easy to separate the
statically allocated IDs (generated by the caller) from those
generated dynamically by expo itself.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c98cb512 01-Jun-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a separate log category for expo

This feature is different enough from bootstd that it probably deserves
its own log category. It cannot use a uclass since it is not a device.

Add a new category.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 14a86a51 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Avoid automatically arranging the scene

This should ideally be done once after all scene changes have been made.
Require an explicit call when everything is ready.

Always arrange after a key it sent, just for convenience.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 42b18494 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Store the console in the expo

Rather than finding this each time, keep a pointer to it. This simplifies
the code a little.

Signed-off-by: Simon Glass <sjg@chromium.org>

# def898c4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Convert to using a string ID for the scene title

This is easier to deal with if it uses the existing string handling,
since we will be able to use translations, etc. in the future.

Update it to use an ID instead of a string.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5e2607ae 06-Jan-2023 Simon Glass <sjg@chromium.org>

expo: Add support for scenes

A scene is a single screen within an expo. It is possible to move between
scenes but only one can be displayed at once.

Add a basic implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c4b646d4 27-Apr-2024 Tom Rini <trini@konsulko.com>

boot: Remove <common.h> and add needed includes

Remove <common.h> from all "boot/" files and when needed add
missing include files directly.

Signed-off-by: Tom Rini <trini@konsulko.com>

# c4fea34f 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Plumb in textlines to a scene

Provide an implementation for textlines in the scene code, so that they
are displayed correctly. Provide a way to have a border around the
textline, with the internal part being the same colour as the
background. This looks more natural.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 93c901bc 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Support opening a textline

This object needs special handling when it is opened, to set up the CLI
and the vidconsole context. Add special support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 93f99b35 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Add some scene fields needed for text entry

Add the CLI state, a buffer to hold the old value of the text being
edited and a place to save vidconsole entry context. These will be use
by the textline object.

Set an upper limit on the maximum number of characters in a textline
object supported by expo, at least for now.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 94598d5b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Allow rendering the background of any object

So far only menus have a background. When other object types are
rendered, they may have a background too. Make this code more generic
so it will be usable by new object types.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8bc69b4b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Make calculation of an object bounding box generic

We want to support this for any object, not just menus. Move the code
around to allow this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# d88edd2b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Allow highlighting other scene-object types

So far only menus can be highlighted. With the coming addition of
text lines we need to be able to highlight other objects. Add a function
to determine whether an object can be highlighted.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 408011c2 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Correct the logic for duplicate-ID detection

Update scene_txt_str() to account for the possibility that the passed-in
str_id may be 0

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9767de7b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Correct some swallowed errors in scene

Return the reported error, rather than assuming it is -ENOMEM

Signed-off-by: Simon Glass <sjg@chromium.org>

# fd6073ac 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Use switch statements more for object types

In a lot of cases menus are the only objects which are have their own
behaviour in the cedit, e.g. to move between menus. With expo expanding
to support text, this is no-longer true.

Use a switch() statement so that we can simply insert a new 'case' for
the new object types.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2eb6ad5 14-Aug-2023 Simon Glass <sjg@chromium.org>

expo: Provide a way to iterate through all scene objects

For some operations it is necessary to process all objects in an expo.
Provide an iterator to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 633b3dc7 14-Aug-2023 Simon Glass <sjg@chromium.org>

expo: Make scene_obj_find() take a const scene

This does not change the scene, so mark the pointer const.

Signed-off-by: Simon Glass <sjg@chromium.org>

# a0874dc4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add a configuration editor

Add a new 'cedit' command which allows editing configuration using an
expo. The configuration items appear as menus on the display.

This is extremely basic, only supporting menus and not providing any way
to load or save the configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7230fdb3 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add spacing around menus and items

It looks better if menus have a bit of an inset, rather than be drawn hard
up against the background. Also, menu items look better if they have a bit
of spacing between them.

Add theme options for these and implement the required changes.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4e64beeb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Implement the keypress logic for popup menus

In 'popup' mode, the expo allows moving around the objects in a scene.
When 'enter' is pressed on a menu, it opens and the user can move around
the items in the menu.

Implement this using keypress handles and actions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4c87e073 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw the current opened menu on top

When a menu is opened, it must be displayed over all other objects in
the scene, so that all its items are visible.

Handle this by drawing the menu object a second time, after all other
objects have been drawn. Draw all of the objects which are dependent
on the menu object.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 756c9559 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw popup menus in both opened and closed states

When a popup menu is closed it shows only the selected item. When it is
open it shows a background and all items, with a highlight that can be
moved between the items.

Add the drawing logic for this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2e593897 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 699b0acb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Set up the width and height of objects

Provide a way to set the full dimensions of objects, i.e. including the
width and height.

For menus, calculate the bounding box of all objects in the menu. Set all
labels to be the same size, so that highlighting works correct, once
implemented.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 50f02037 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Calculate text bounding-box correctly

Rather than estimating, measure the text accurately, using the new
vidconsole feature. This allows accurate placement of objects.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ce72c9ec 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Use flags for objects

We currently have just a 'hide' property for each object. In preparation
for adding more properties, convert the struct to use a flags value,
instead of individual booleans. This is more extensible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ae45d6cf 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 9af34150 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Allow setting the start of the dynamic-ID range

Provide a way to set this value so that it is easy to separate the
statically allocated IDs (generated by the caller) from those
generated dynamically by expo itself.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c98cb512 01-Jun-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a separate log category for expo

This feature is different enough from bootstd that it probably deserves
its own log category. It cannot use a uclass since it is not a device.

Add a new category.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 14a86a51 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Avoid automatically arranging the scene

This should ideally be done once after all scene changes have been made.
Require an explicit call when everything is ready.

Always arrange after a key it sent, just for convenience.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 42b18494 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Store the console in the expo

Rather than finding this each time, keep a pointer to it. This simplifies
the code a little.

Signed-off-by: Simon Glass <sjg@chromium.org>

# def898c4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Convert to using a string ID for the scene title

This is easier to deal with if it uses the existing string handling,
since we will be able to use translations, etc. in the future.

Update it to use an ID instead of a string.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5e2607ae 06-Jan-2023 Simon Glass <sjg@chromium.org>

expo: Add support for scenes

A scene is a single screen within an expo. It is possible to move between
scenes but only one can be displayed at once.

Add a basic implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c4fea34f 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Plumb in textlines to a scene

Provide an implementation for textlines in the scene code, so that they
are displayed correctly. Provide a way to have a border around the
textline, with the internal part being the same colour as the
background. This looks more natural.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 93c901bc 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Support opening a textline

This object needs special handling when it is opened, to set up the CLI
and the vidconsole context. Add special support for this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 93f99b35 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Add some scene fields needed for text entry

Add the CLI state, a buffer to hold the old value of the text being
edited and a place to save vidconsole entry context. These will be use
by the textline object.

Set an upper limit on the maximum number of characters in a textline
object supported by expo, at least for now.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 94598d5b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Allow rendering the background of any object

So far only menus have a background. When other object types are
rendered, they may have a background too. Make this code more generic
so it will be usable by new object types.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 8bc69b4b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Make calculation of an object bounding box generic

We want to support this for any object, not just menus. Move the code
around to allow this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# d88edd2b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Allow highlighting other scene-object types

So far only menus can be highlighted. With the coming addition of
text lines we need to be able to highlight other objects. Add a function
to determine whether an object can be highlighted.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 408011c2 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Correct the logic for duplicate-ID detection

Update scene_txt_str() to account for the possibility that the passed-in
str_id may be 0

Signed-off-by: Simon Glass <sjg@chromium.org>

# 9767de7b 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Correct some swallowed errors in scene

Return the reported error, rather than assuming it is -ENOMEM

Signed-off-by: Simon Glass <sjg@chromium.org>

# fd6073ac 01-Oct-2023 Simon Glass <sjg@chromium.org>

expo: Use switch statements more for object types

In a lot of cases menus are the only objects which are have their own
behaviour in the cedit, e.g. to move between menus. With expo expanding
to support text, this is no-longer true.

Use a switch() statement so that we can simply insert a new 'case' for
the new object types.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2eb6ad5 14-Aug-2023 Simon Glass <sjg@chromium.org>

expo: Provide a way to iterate through all scene objects

For some operations it is necessary to process all objects in an expo.
Provide an iterator to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 633b3dc7 14-Aug-2023 Simon Glass <sjg@chromium.org>

expo: Make scene_obj_find() take a const scene

This does not change the scene, so mark the pointer const.

Signed-off-by: Simon Glass <sjg@chromium.org>

# a0874dc4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add a configuration editor

Add a new 'cedit' command which allows editing configuration using an
expo. The configuration items appear as menus on the display.

This is extremely basic, only supporting menus and not providing any way
to load or save the configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7230fdb3 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add spacing around menus and items

It looks better if menus have a bit of an inset, rather than be drawn hard
up against the background. Also, menu items look better if they have a bit
of spacing between them.

Add theme options for these and implement the required changes.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4e64beeb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Implement the keypress logic for popup menus

In 'popup' mode, the expo allows moving around the objects in a scene.
When 'enter' is pressed on a menu, it opens and the user can move around
the items in the menu.

Implement this using keypress handles and actions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4c87e073 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw the current opened menu on top

When a menu is opened, it must be displayed over all other objects in
the scene, so that all its items are visible.

Handle this by drawing the menu object a second time, after all other
objects have been drawn. Draw all of the objects which are dependent
on the menu object.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 756c9559 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw popup menus in both opened and closed states

When a popup menu is closed it shows only the selected item. When it is
open it shows a background and all items, with a highlight that can be
moved between the items.

Add the drawing logic for this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2e593897 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 699b0acb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Set up the width and height of objects

Provide a way to set the full dimensions of objects, i.e. including the
width and height.

For menus, calculate the bounding box of all objects in the menu. Set all
labels to be the same size, so that highlighting works correct, once
implemented.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 50f02037 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Calculate text bounding-box correctly

Rather than estimating, measure the text accurately, using the new
vidconsole feature. This allows accurate placement of objects.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ce72c9ec 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Use flags for objects

We currently have just a 'hide' property for each object. In preparation
for adding more properties, convert the struct to use a flags value,
instead of individual booleans. This is more extensible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ae45d6cf 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 9af34150 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Allow setting the start of the dynamic-ID range

Provide a way to set this value so that it is easy to separate the
statically allocated IDs (generated by the caller) from those
generated dynamically by expo itself.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c98cb512 01-Jun-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a separate log category for expo

This feature is different enough from bootstd that it probably deserves
its own log category. It cannot use a uclass since it is not a device.

Add a new category.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 14a86a51 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Avoid automatically arranging the scene

This should ideally be done once after all scene changes have been made.
Require an explicit call when everything is ready.

Always arrange after a key it sent, just for convenience.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 42b18494 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Store the console in the expo

Rather than finding this each time, keep a pointer to it. This simplifies
the code a little.

Signed-off-by: Simon Glass <sjg@chromium.org>

# def898c4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Convert to using a string ID for the scene title

This is easier to deal with if it uses the existing string handling,
since we will be able to use translations, etc. in the future.

Update it to use an ID instead of a string.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5e2607ae 06-Jan-2023 Simon Glass <sjg@chromium.org>

expo: Add support for scenes

A scene is a single screen within an expo. It is possible to move between
scenes but only one can be displayed at once.

Add a basic implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>

# f2eb6ad5 14-Aug-2023 Simon Glass <sjg@chromium.org>

expo: Provide a way to iterate through all scene objects

For some operations it is necessary to process all objects in an expo.
Provide an iterator to handle this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 633b3dc7 14-Aug-2023 Simon Glass <sjg@chromium.org>

expo: Make scene_obj_find() take a const scene

This does not change the scene, so mark the pointer const.

Signed-off-by: Simon Glass <sjg@chromium.org>

# a0874dc4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add a configuration editor

Add a new 'cedit' command which allows editing configuration using an
expo. The configuration items appear as menus on the display.

This is extremely basic, only supporting menus and not providing any way
to load or save the configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7230fdb3 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add spacing around menus and items

It looks better if menus have a bit of an inset, rather than be drawn hard
up against the background. Also, menu items look better if they have a bit
of spacing between them.

Add theme options for these and implement the required changes.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4e64beeb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Implement the keypress logic for popup menus

In 'popup' mode, the expo allows moving around the objects in a scene.
When 'enter' is pressed on a menu, it opens and the user can move around
the items in the menu.

Implement this using keypress handles and actions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4c87e073 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw the current opened menu on top

When a menu is opened, it must be displayed over all other objects in
the scene, so that all its items are visible.

Handle this by drawing the menu object a second time, after all other
objects have been drawn. Draw all of the objects which are dependent
on the menu object.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 756c9559 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw popup menus in both opened and closed states

When a popup menu is closed it shows only the selected item. When it is
open it shows a background and all items, with a highlight that can be
moved between the items.

Add the drawing logic for this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2e593897 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 699b0acb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Set up the width and height of objects

Provide a way to set the full dimensions of objects, i.e. including the
width and height.

For menus, calculate the bounding box of all objects in the menu. Set all
labels to be the same size, so that highlighting works correct, once
implemented.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 50f02037 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Calculate text bounding-box correctly

Rather than estimating, measure the text accurately, using the new
vidconsole feature. This allows accurate placement of objects.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ce72c9ec 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Use flags for objects

We currently have just a 'hide' property for each object. In preparation
for adding more properties, convert the struct to use a flags value,
instead of individual booleans. This is more extensible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ae45d6cf 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 9af34150 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Allow setting the start of the dynamic-ID range

Provide a way to set this value so that it is easy to separate the
statically allocated IDs (generated by the caller) from those
generated dynamically by expo itself.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c98cb512 01-Jun-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a separate log category for expo

This feature is different enough from bootstd that it probably deserves
its own log category. It cannot use a uclass since it is not a device.

Add a new category.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 14a86a51 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Avoid automatically arranging the scene

This should ideally be done once after all scene changes have been made.
Require an explicit call when everything is ready.

Always arrange after a key it sent, just for convenience.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 42b18494 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Store the console in the expo

Rather than finding this each time, keep a pointer to it. This simplifies
the code a little.

Signed-off-by: Simon Glass <sjg@chromium.org>

# def898c4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Convert to using a string ID for the scene title

This is easier to deal with if it uses the existing string handling,
since we will be able to use translations, etc. in the future.

Update it to use an ID instead of a string.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5e2607ae 06-Jan-2023 Simon Glass <sjg@chromium.org>

expo: Add support for scenes

A scene is a single screen within an expo. It is possible to move between
scenes but only one can be displayed at once.

Add a basic implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>

# a0874dc4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add a configuration editor

Add a new 'cedit' command which allows editing configuration using an
expo. The configuration items appear as menus on the display.

This is extremely basic, only supporting menus and not providing any way
to load or save the configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 7230fdb3 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Add spacing around menus and items

It looks better if menus have a bit of an inset, rather than be drawn hard
up against the background. Also, menu items look better if they have a bit
of spacing between them.

Add theme options for these and implement the required changes.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4e64beeb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Implement the keypress logic for popup menus

In 'popup' mode, the expo allows moving around the objects in a scene.
When 'enter' is pressed on a menu, it opens and the user can move around
the items in the menu.

Implement this using keypress handles and actions.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 4c87e073 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw the current opened menu on top

When a menu is opened, it must be displayed over all other objects in
the scene, so that all its items are visible.

Handle this by drawing the menu object a second time, after all other
objects have been drawn. Draw all of the objects which are dependent
on the menu object.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 756c9559 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Draw popup menus in both opened and closed states

When a popup menu is closed it shows only the selected item. When it is
open it shows a background and all items, with a highlight that can be
moved between the items.

Add the drawing logic for this.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 2e593897 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 699b0acb 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Set up the width and height of objects

Provide a way to set the full dimensions of objects, i.e. including the
width and height.

For menus, calculate the bounding box of all objects in the menu. Set all
labels to be the same size, so that highlighting works correct, once
implemented.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 50f02037 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Calculate text bounding-box correctly

Rather than estimating, measure the text accurately, using the new
vidconsole feature. This allows accurate placement of objects.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ce72c9ec 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Use flags for objects

We currently have just a 'hide' property for each object. In preparation
for adding more properties, convert the struct to use a flags value,
instead of individual booleans. This is more extensible.

Signed-off-by: Simon Glass <sjg@chromium.org>

# ae45d6cf 01-Jun-2023 Simon Glass <sjg@chromium.org>

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>

# 9af34150 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Allow setting the start of the dynamic-ID range

Provide a way to set this value so that it is easy to separate the
statically allocated IDs (generated by the caller) from those
generated dynamically by expo itself.

Signed-off-by: Simon Glass <sjg@chromium.org>

# c98cb512 01-Jun-2023 Simon Glass <sjg@chromium.org>

bootstd: Add a separate log category for expo

This feature is different enough from bootstd that it probably deserves
its own log category. It cannot use a uclass since it is not a device.

Add a new category.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 14a86a51 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Avoid automatically arranging the scene

This should ideally be done once after all scene changes have been made.
Require an explicit call when everything is ready.

Always arrange after a key it sent, just for convenience.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 42b18494 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Store the console in the expo

Rather than finding this each time, keep a pointer to it. This simplifies
the code a little.

Signed-off-by: Simon Glass <sjg@chromium.org>

# def898c4 01-Jun-2023 Simon Glass <sjg@chromium.org>

expo: Convert to using a string ID for the scene title

This is easier to deal with if it uses the existing string handling,
since we will be able to use translations, etc. in the future.

Update it to use an ID instead of a string.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5e2607ae 06-Jan-2023 Simon Glass <sjg@chromium.org>

expo: Add support for scenes

A scene is a single screen within an expo. It is possible to move between
scenes but only one can be displayed at once.

Add a basic implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>

# 5e2607ae 06-Jan-2023 Simon Glass <sjg@chromium.org>

expo: Add support for scenes

A scene is a single screen within an expo. It is possible to move between
scenes but only one can be displayed at once.

Add a basic implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>