lv_xml.h¶
Defines
-
LV_XML_MAX_PATH_LENGTH¶
Functions
-
void lv_xml_init(void)¶
-
void lv_xml_deinit(void)¶
-
void *lv_xml_create(lv_obj_t *parent, const char *name, const char **attrs)¶
-
void *lv_xml_create_in_scope(lv_obj_t *parent, lv_xml_component_scope_t *parent_ctx, lv_xml_component_scope_t *scope, const char **attrs)¶
-
void lv_xml_set_default_asset_path(const char *path_prefix)¶
Set a path to prefix the image and font file source paths.
In globals.xml usually the source path is like "images/logo.png". But on the actual device it can be located at e.g. "A:ui/assets/images/logo.png". By setting "A:ui/assets/" the path set in the XML files will be prefixed accordingly.
- Parameters:
path_prefix – the path to be used as prefix
-
lv_result_t lv_xml_register_font(lv_xml_component_scope_t *scope, const char *name, const lv_font_t *font)¶
-
const lv_font_t *lv_xml_get_font(lv_xml_component_scope_t *scope, const char *name)¶
-
lv_result_t lv_xml_register_image(lv_xml_component_scope_t *scope, const char *name, const void *src)¶
-
const void *lv_xml_get_image(lv_xml_component_scope_t *scope, const char *name)¶
-
lv_result_t lv_xml_register_subject(lv_xml_component_scope_t *scope, const char *name, lv_subject_t *subject)¶
Map globally available subject name to an actual subject variable
- Parameters:
name – name of the subject
subject – pointer to a subject
- Returns:
LV_RESULT_OK
: success
-
lv_subject_t *lv_xml_get_subject(lv_xml_component_scope_t *scope, const char *name)¶
Get a subject by name.
- Parameters:
scope – If specified start searching in that component's subject list, and if not found search in the global space. If
NULL
search in global space immediately.name – Name of the subject to find.
- Returns:
Pointer to the subject or NULL if not found.
-
lv_result_t lv_xml_register_const(lv_xml_component_scope_t *scope, const char *name, const char *value)¶
-
const char *lv_xml_get_const(lv_xml_component_scope_t *scope, const char *name)¶
-
lv_result_t lv_xml_register_event_cb(lv_xml_component_scope_t *scope, const char *name, lv_event_cb_t cb)¶
-
lv_event_cb_t lv_xml_get_event_cb(lv_xml_component_scope_t *scope, const char *name)¶