aboutsummaryrefslogtreecommitdiffstats
path: root/boot/scene.c
Commit message (Collapse)AuthorAgeFilesLines
* list: use list_count_nodes() to count list entriesSughosh Ganu2024-08-301-7/+1
| | | | | | | | Use the API function list_count_nodes() to count the number of list entries. Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"WIP/20May2024-nextTom Rini2024-05-201-1/+0
| | | | | | | | As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Tom Rini <trini@konsulko.com>
* Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini2024-05-191-0/+1
| | | | | | | | | | | | 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>
* boot: Remove <common.h> and add needed includesTom Rini2024-05-061-1/+0
| | | | | | | Remove <common.h> from all "boot/" files and when needed add missing include files directly. Signed-off-by: Tom Rini <trini@konsulko.com>
* expo: Plumb in textlines to a sceneSimon Glass2023-10-111-2/+54
| | | | | | | | | 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>
* expo: Support opening a textlineSimon Glass2023-10-111-0/+32
| | | | | | | 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>
* expo: Add some scene fields needed for text entrySimon Glass2023-10-111-0/+10
| | | | | | | | | | | 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>
* expo: Allow rendering the background of any objectSimon Glass2023-10-111-1/+39
| | | | | | | | 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>
* expo: Make calculation of an object bounding box genericSimon Glass2023-10-111-0/+45
| | | | | | | 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>
* expo: Allow highlighting other scene-object typesSimon Glass2023-10-111-7/+4
| | | | | | | | 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>
* expo: Correct the logic for duplicate-ID detectionSimon Glass2023-10-111-1/+2
| | | | | | | 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>
* expo: Correct some swallowed errors in sceneSimon Glass2023-10-111-3/+3
| | | | | | Return the reported error, rather than assuming it is -ENOMEM Signed-off-by: Simon Glass <sjg@chromium.org>
* expo: Use switch statements more for object typesSimon Glass2023-10-111-7/+31
| | | | | | | | | | | 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>
* expo: Provide a way to iterate through all scene objectsSimon Glass2023-08-251-0/+16
| | | | | | | 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>
* expo: Make scene_obj_find() take a const sceneSimon Glass2023-08-251-1/+1
| | | | | | This does not change the scene, so mark the pointer const. Signed-off-by: Simon Glass <sjg@chromium.org>
* expo: Add a configuration editorSimon Glass2023-07-141-0/+12
| | | | | | | | | | 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>
* expo: Add spacing around menus and itemsSimon Glass2023-07-141-2/+4
| | | | | | | | | | 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>
* expo: Implement the keypress logic for popup menusSimon Glass2023-07-141-0/+80
| | | | | | | | | | 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>
* expo: Draw the current opened menu on topSimon Glass2023-07-141-0/+31
| | | | | | | | | | | 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>
* expo: Draw popup menus in both opened and closed statesSimon Glass2023-07-141-2/+64
| | | | | | | | | | 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>
* expo: Support simple themesSimon Glass2023-07-141-0/+28
| | | | | | | | | | | 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>
* expo: Set up the width and height of objectsSimon Glass2023-07-141-0/+52
| | | | | | | | | | | 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>
* expo: Calculate text bounding-box correctlySimon Glass2023-07-141-8/+22
| | | | | | | 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>
* expo: Use flags for objectsSimon Glass2023-07-141-2/+15
| | | | | | | | 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>
* expo: Add width and height to objectsSimon Glass2023-07-141-4/+4
| | | | | | | | | | | | 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>
* expo: Allow setting the start of the dynamic-ID rangeSimon Glass2023-07-141-10/+0
| | | | | | | | 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>
* bootstd: Add a separate log category for expoSimon Glass2023-07-141-0/+2
| | | | | | | | | 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>
* expo: Avoid automatically arranging the sceneSimon Glass2023-07-141-7/+0
| | | | | | | | | 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>
* expo: Store the console in the expoSimon Glass2023-07-141-8/+2
| | | | | | | 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>
* expo: Convert to using a string ID for the scene titleSimon Glass2023-07-141-6/+2
| | | | | | | | | 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>
* expo: Add support for scenesSimon Glass2023-01-161-0/+414
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>