Embedded SDK
Embedded SDK
ux_layout_paging_compute.h
Go to the documentation of this file.
1 #ifndef UX_LAYOUT_PAGING_COMPUTE_H
2 #define UX_LAYOUT_PAGING_COMPUTE_H
3 
4 #include "ux_layouts.h"
5 
6 #ifdef HAVE_UX_FLOW
7 
8 #define PIXEL_PER_LINE 114
9 
10 #define PAGING_FORMAT_NN 0x00
11 #define PAGING_FORMAT_BN 0xF0
12 #define PAGING_FORMAT_NB 0x0F
13 #define PAGING_FORMAT_BB (PAGING_FORMAT_BN | PAGING_FORMAT_NB)
14 
15 #if defined(HAVE_INDEXED_STRINGS)
16 #define LINE_BUFFER_SIZE (32 - 1)
17 
18 #define MAX_PAGING_LINE_COUNT (UX_LAYOUT_PAGING_LINE_COUNT + 1)
19 #else // defined(HAVE_INDEXED_STRINGS)
20 #define MAX_PAGING_LINE_COUNT UX_LAYOUT_PAGING_LINE_COUNT
21 #endif // defined(HAVE_INDEXED_STRINGS)
22 
23 typedef struct {
24  unsigned int current;
25  unsigned int count;
26 #if defined(HAVE_INDEXED_STRINGS)
27  unsigned int paging_title;
28 #endif // defined(HAVE_INDEXED_STRINGS)
29  unsigned char format;
30 #if defined(HAVE_INDEXED_STRINGS)
31  unsigned char string_buffer_id;
32 #endif // defined(HAVE_INDEXED_STRINGS)
33  unsigned short offsets[MAX_PAGING_LINE_COUNT];
34  unsigned short lengths[MAX_PAGING_LINE_COUNT];
35 #if defined(HAVE_INDEXED_STRINGS)
36  unsigned char fond_ids[MAX_PAGING_LINE_COUNT];
37  char line_buffer[LINE_BUFFER_SIZE + 1];
38 #endif // defined(HAVE_INDEXED_STRINGS)
39 } ux_layout_paging_state_t;
40 
41 #if !defined(HAVE_SE_SCREEN)
42 uint8_t se_get_cropped_length(const char *text,
43  uint8_t text_length,
44  uint32_t width_limit_in_pixels,
45  uint8_t text_format);
46 
47 #if defined(HAVE_INDEXED_STRINGS)
48 unsigned int se_compute_line_width_light(const char *text,
49  uint8_t text_length,
50  uint8_t text_format);
51 #endif
52 #endif // !defined(HAVE_SE_SCREEN)
53 unsigned int ux_layout_paging_compute(const char *text_to_split,
54  unsigned int page_to_display,
55  ux_layout_paging_state_t *paging_state,
56  bagl_font_id_e font);
57 
58 #endif // HAVE_UX_FLOW
59 
60 #endif // UX_LAYOUT_PAGING_COMPUTE_H
unsigned char uint8_t
Definition: usbd_conf.h:53