|
Embedded SDK
Embedded SDK
|
#include <string.h>#include <stdlib.h>#include "nbgl_debug.h"#include "nbgl_front.h"#include "nbgl_layout_internal_nanos.h"#include "nbgl_obj.h"#include "nbgl_draw.h"#include "nbgl_screen.h"#include "nbgl_touch.h"#include "glyphs.h"#include "os_pic.h"#include "os_helpers.h"#include "lcx_rng.h"
Go to the source code of this file.
Macros | |
| #define | NB_MAX_LAYOUTS 3 |
| #define | NB_MAX_SCREEN_CHILDREN 7 |
| #define | BUTTON_MARGIN_Y 12 |
| #define | NB_MAX_CHAR_IN_LINE 20 |
| #define | ELLIPSIS "..." |
| #define | ELLIPSIS_SIZE sizeof(ELLIPSIS) |
Functions | |
| void | layoutAddObject (nbgl_layoutInternal_t *layout, nbgl_obj_t *obj) |
| adds the given obj to the layout | |
| nbgl_layout_t * | nbgl_layoutGet (const nbgl_layoutDescription_t *description) |
| returns a layout of the given type. The layout is reset | |
| int | nbgl_layoutAddNavigation (nbgl_layout_t *layout, nbgl_layoutNavigation_t *info) |
| Creates navigation arrows on side(s) of the screen. | |
| int | nbgl_layoutAddText (nbgl_layout_t *layout, const char *text, const char *subText, nbgl_contentCenteredInfoStyle_t style) |
| Creates an area with given text and sub text, using the given style. | |
| int | nbgl_layoutAddMenuList (nbgl_layout_t *layout, nbgl_layoutMenuList_t *list) |
| Creates a menu list (only for nanos) with the given parameters. The navigation (and selection) must be handled by the caller. | |
| int | nbgl_layoutAddCenteredInfo (nbgl_layout_t *layout, const nbgl_layoutCenteredInfo_t *info) |
| Creates an area on the center of the main panel, with a possible icon/image, a possible text in black under it, and a possible text in gray under it. | |
| int | nbgl_layoutAddProgressBar (nbgl_layout_t *layout, const nbgl_layoutProgressBar_t *barLayout) |
| Creates an area in main panel to display a progress bar, with a title text and a description under the progress. | |
| int | nbgl_layoutAddButton (nbgl_layout_t *layout, const nbgl_layoutButton_t *buttonInfo) |
| Creates an area in main panel to display a button, with the given style. | |
| int | nbgl_layoutAddSwitch (nbgl_layout_t *layout, const nbgl_layoutSwitch_t *switchLayout) |
| Creates an area in main panel to display a switch. | |
| int | nbgl_layoutDraw (nbgl_layout_t *layoutParam) |
| Applies given layout. The screen will be redrawn. | |
| int | nbgl_layoutRelease (nbgl_layout_t *layoutParam) |
| Release the layout obtained with nbgl_layoutGet() | |
| #define BUTTON_MARGIN_Y 12 |
Definition at line 33 of file nbgl_layout_nanos.c.
| #define ELLIPSIS "..." |
Definition at line 38 of file nbgl_layout_nanos.c.
| #define ELLIPSIS_SIZE sizeof(ELLIPSIS) |
Definition at line 39 of file nbgl_layout_nanos.c.
| #define NB_MAX_CHAR_IN_LINE 20 |
Definition at line 36 of file nbgl_layout_nanos.c.
| #define NB_MAX_LAYOUTS 3 |
Definition at line 28 of file nbgl_layout_nanos.c.
| #define NB_MAX_SCREEN_CHILDREN 7 |
Definition at line 31 of file nbgl_layout_nanos.c.
| void layoutAddObject | ( | nbgl_layoutInternal_t * | layout, |
| nbgl_obj_t * | obj | ||
| ) |
adds the given obj to the layout
| layout | |
| obj |
Definition at line 119 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddButton | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutButton_t * | buttonInfo | ||
| ) |
Creates an area in main panel to display a button, with the given style.
| layout | the current layout |
| buttonInfo | structure giving the description of button |
Definition at line 652 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddCenteredInfo | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutCenteredInfo_t * | info | ||
| ) |
Creates an area on the center of the main panel, with a possible icon/image, a possible text in black under it, and a possible text in gray under it.
| layout | the current layout |
| info | structure giving the description of buttons (texts, icons, layout) |
Definition at line 457 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddMenuList | ( | nbgl_layout_t * | layout, |
| nbgl_layoutMenuList_t * | list | ||
| ) |
Creates a menu list (only for nanos) with the given parameters. The navigation (and selection) must be handled by the caller.
| layout | the current layout |
| list | structure giving the list of choices and the current selected one |
Definition at line 403 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddNavigation | ( | nbgl_layout_t * | layout, |
| nbgl_layoutNavigation_t * | info | ||
| ) |
Creates navigation arrows on side(s) of the screen.
| layout | the current layout |
| info | structure giving the description of the navigation |
Definition at line 186 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddProgressBar | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutProgressBar_t * | barLayout | ||
| ) |
Creates an area in main panel to display a progress bar, with a title text and a description under the progress.
| layout | the current layout |
| barLayout | structure giving the description of progress bar |
Definition at line 587 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddSwitch | ( | nbgl_layout_t * | layout, |
| const nbgl_layoutSwitch_t * | switchLayout | ||
| ) |
Creates an area in main panel to display a switch.
| layout | the current layout |
| switchLayout | structure giving the description of switch |
Definition at line 683 of file nbgl_layout_nanos.c.
| int nbgl_layoutAddText | ( | nbgl_layout_t * | layout, |
| const char * | text, | ||
| const char * | subText, | ||
| nbgl_contentCenteredInfoStyle_t | style | ||
| ) |
Creates an area with given text and sub text, using the given style.
| layout | the current layout |
| text | main text, must be single line if subText |
| subText | description under main text (NULL terminated, in regular, 3 lines max, may be null) |
| style | if REGULAR_INFO, use regular font for text, otherwise use bold font for text |
Definition at line 225 of file nbgl_layout_nanos.c.
| int nbgl_layoutDraw | ( | nbgl_layout_t * | layoutParam | ) |
Applies given layout. The screen will be redrawn.
| layoutParam | layout to redraw |
Definition at line 760 of file nbgl_layout_nanos.c.
| nbgl_layout_t * nbgl_layoutGet | ( | const nbgl_layoutDescription_t * | description | ) |
returns a layout of the given type. The layout is reset
| description | description of layout |
Definition at line 134 of file nbgl_layout_nanos.c.
| int nbgl_layoutRelease | ( | nbgl_layout_t * | layoutParam | ) |
Release the layout obtained with nbgl_layoutGet()
| layoutParam | layout to release |
Definition at line 779 of file nbgl_layout_nanos.c.