1 /**
2  * @file lv_dropdown_private.h
3  *
4  */
5 
6 #ifndef LV_DROPDOWN_PRIVATE_H
7 #define LV_DROPDOWN_PRIVATE_H
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /*********************
14  *      INCLUDES
15  *********************/
16 
17 #include "../../core/lv_obj_private.h"
18 #include "lv_dropdown.h"
19 
20 #if LV_USE_DROPDOWN != 0
21 
22 /*********************
23  *      DEFINES
24  *********************/
25 
26 /**********************
27  *      TYPEDEFS
28  **********************/
29 
30 /**********************
31  *      TYPEDEFS
32  **********************/
33 
34 struct _lv_dropdown_t {
35     lv_obj_t obj;
36     lv_obj_t * list;                /**< The dropped down list*/
37     const char * text;              /**< Text to display on the dropdown's button*/
38     const void * symbol;            /**< Arrow or other icon when the drop-down list is closed*/
39     char * options;                 /**< Options in a '\n' separated list*/
40     uint32_t option_cnt;            /**< Number of options*/
41     uint32_t sel_opt_id;            /**< Index of the currently selected option*/
42     uint32_t sel_opt_id_orig;       /**< Store the original index on focus*/
43     uint32_t pr_opt_id;             /**< Index of the currently pressed option*/
44     uint8_t dir               : 4;  /**< Direction in which the list should open*/
45     uint8_t static_txt        : 1;  /**< 1: Only a pointer is saved in `options`*/
46     uint8_t selected_highlight: 1;  /**< 1: Make the selected option highlighted in the list*/
47 };
48 
49 struct _lv_dropdown_list_t {
50     lv_obj_t obj;
51     lv_obj_t * dropdown;
52 };
53 
54 
55 /**********************
56  * GLOBAL PROTOTYPES
57  **********************/
58 
59 /**********************
60  *      MACROS
61  **********************/
62 
63 #endif /* LV_USE_DROPDOWN != 0 */
64 
65 #ifdef __cplusplus
66 } /*extern "C"*/
67 #endif
68 
69 #endif /*LV_DROPDOWN_PRIVATE_H*/
70