1 /** 2 * @file lv_xml_parser.h 3 * 4 */ 5 6 #ifndef LV_XML_PARSER_H 7 #define LV_XML_PARSER_H 8 9 #ifdef __cplusplus 10 extern "C" { 11 #endif 12 13 /********************* 14 * INCLUDES 15 *********************/ 16 #include "../../misc/lv_types.h" 17 #if LV_USE_XML 18 19 #include "lv_xml_component.h" 20 #include "lv_xml_component_private.h" 21 22 /********************* 23 * DEFINES 24 *********************/ 25 26 /********************** 27 * TYPEDEFS 28 **********************/ 29 30 typedef enum { 31 LV_XML_PARSER_SECTION_NONE, 32 LV_XML_PARSER_SECTION_API, 33 LV_XML_PARSER_SECTION_CONSTS, 34 LV_XML_PARSER_SECTION_STYLES, 35 LV_XML_PARSER_SECTION_VIEW 36 } lv_xml_parser_section_t; 37 38 struct _lv_xml_parser_state_t { 39 lv_xml_component_ctx_t ctx; 40 lv_ll_t parent_ll; 41 lv_obj_t * parent; 42 lv_obj_t * item; 43 lv_obj_t * view; /*Pointer to the created view during component creation*/ 44 const char ** parent_attrs; 45 lv_xml_component_ctx_t * parent_ctx; 46 lv_xml_parser_section_t section; 47 }; 48 49 typedef struct { 50 const char * name; 51 const char * value; 52 } lv_xml_const_t; 53 54 typedef struct { 55 const char * name; 56 const char * def; 57 const char * type; 58 } lv_xml_param_t; 59 60 /********************** 61 * GLOBAL PROTOTYPES 62 **********************/ 63 64 void lv_xml_parser_state_init(lv_xml_parser_state_t * state); 65 66 void lv_xml_parser_start_section(lv_xml_parser_state_t * state, const char * name); 67 68 void lv_xml_parser_end_section(lv_xml_parser_state_t * state, const char * name); 69 70 void * lv_xml_state_get_parent(lv_xml_parser_state_t * state); 71 72 void * lv_xml_state_get_item(lv_xml_parser_state_t * state); 73 74 /********************** 75 * MACROS 76 **********************/ 77 78 #endif /* LV_USE_XML */ 79 80 #ifdef __cplusplus 81 } /*extern "C"*/ 82 #endif 83 84 #endif /*LV_XML_PARSER_H*/ 85