lv_xml_component.h

Functions

lv_obj_t *lv_xml_component_process(lv_xml_parser_state_t *state, const char *name, const char **attrs)

Process a component during parsing an XML. It create a widget and apply all the attributes

Parameters:
  • state – the current parsing state

  • name – name of the component

  • attrs – attributes of the widget

Returns:

lv_result_t lv_xml_register_component_from_data(const char *name, const char *xml_def)

Load the styles, constants, and other data of the Component. It needs to be called only once for each Component.

Parameters:
  • name – The name as the component will be referenced later in other components

  • xml_def – The XML definition of the component as a NULL terminated string

Returns:

LV_RESULT_OK: loaded successfully, LV_RES_INVALID: otherwise

lv_result_t lv_xml_register_component_from_file(const char *path)

Load the styles, constants, and other data of the Component. It needs to be called only once for each Component.

Parameters:

path – Path to an XML file

Returns:

LV_RESULT_OK: loaded successfully, LV_RES_INVALID: otherwise

lv_xml_component_scope_t *lv_xml_component_get_scope(const char *component_name)

Get the scope of a Component which was registered by lv_xml_register_component_from_data() or lv_xml_register_component_from_file()

Parameters:

component_name – Name of the Component

Returns:

Pointer to the scope or NULL if not found

lv_result_t lv_xml_component_unregister(const char *name)

Remove a component from from the list.

Parameters:

name – the name of the component (used during registration)

Returns:

LV_RESULT_OK on successful unregistration, LV_RESULT_INVALID otherwise.