|
Embedded SDK
Embedded SDK
|
This chapter describes briefly the high-level API of Advanced BOLOS Graphic Library.
This layer offers a simplified view of a screen page (or multi-pages), using predefined models, like a centered info, or a menu list, managing the internal navigation between the internal pages of a step.
A full description of each type of steps can be found in this document
This layer uses the complex-objects API described in Complex objects layout API, but all objects are hidden, in favor to fields to configure, for example texts, icons and callbacks.
Moreover, positions of objects in the page are hidden and automatic.
And finally, if a step requires using multiple pages (for example for a long text to display, or a long menu list), the step engine manages the navigation between these pages.
The configuration of a step is provided in a single function call, and all predefined pages APIs will do the following operations:
For every types of steps, the navigation inside the step is managed by the step engine, but even for navigation outside it (between steps of a flow), the navigation arrows are drawned by the engine.
A few APIs are available to draw typical pages, like:
This type is intended to draw one or two centered (vertically and horizontally) text(s) in the screen.
If there is no sub-text and the main-text doesn't fit in a single page (taking wrapping into account), the text is automatically split into several pages, and the navigation is set accordingly, and manage automatically between these internal pages. See first example.

If there is a sub-text, the main-text must fit in a single line. The sub-text can be multi-pages, and in this case the main-text is considered as title, and an indication is automatically added to this "title" to show the current "page" and number of pages. See second example.

The API to insert such an object is nbgl_stepDrawText() with:
This type is intended to draw a centered info, with an icon, a main text and a sub-text in the screen. The texts are optional.

The API to insert such an object is nbgl_stepDrawCenteredInfo() with:
This type is intended to draw a menu list, and manage the navigation between the items of the list

The API to insert such an object is nbgl_stepDrawMenuList() with:
Before leaving a screen built with a layout, it must be released with a call to nbgl_stepRelease(). It will free the allocated objects.
Releasing a step has no effect on the display, even if a modal step is released.
Usually, a step is part of a flow (list of steps, to be parsed in forward or backward direction). To indicate to the end-user that navigation between steps is possible, navigation arrows need to be displayed on left and right sides of the screen (as < and > 'arrows').
The navigation can also loop in some cases (only for Applications), which means that at the end of the last step, when pressing right button the engine will display the beginning of first step (and vice versa).
To indicate to step engine which 'flow navigation' to draw, an argument (position) is provided to all API used to create steps. This argument (of type nbgl_stepPosition_t) can take the following values: