Lines Matching +full:- +full:m

25 #define MAP_LEN(m) sizeof((m)) / sizeof((m[0]))  argument
82 {"viewport-fill", 13, LV_SVG_ATTR_VIEWPORT_FILL},
83 {"viewport-fill-opacity", 21, LV_SVG_ATTR_VIEWPORT_FILL_OPACITY},
104 {"fill-rule", 9, LV_SVG_ATTR_FILL_RULE},
105 {"fill-opacity", 12, LV_SVG_ATTR_FILL_OPACITY},
107 {"stroke-width", 12, LV_SVG_ATTR_STROKE_WIDTH},
108 {"stroke-linecap", 14, LV_SVG_ATTR_STROKE_LINECAP},
109 {"stroke-linejoin", 15, LV_SVG_ATTR_STROKE_LINEJOIN},
110 {"stroke-miterlimit", 17, LV_SVG_ATTR_STROKE_MITER_LIMIT},
111 {"stroke-dasharray", 16, LV_SVG_ATTR_STROKE_DASH_ARRAY},
112 {"stroke-dashoffset", 17, LV_SVG_ATTR_STROKE_DASH_OFFSET},
113 {"stroke-opacity", 14, LV_SVG_ATTR_STROKE_OPACITY},
115 {"solid-color", 11, LV_SVG_ATTR_SOLID_COLOR},
116 {"solid-opacity", 13, LV_SVG_ATTR_SOLID_OPACITY},
119 {"stop-color", 10, LV_SVG_ATTR_GRADIENT_STOP_COLOR},
120 {"stop-opacity", 12, LV_SVG_ATTR_GRADIENT_STOP_OPACITY},
121 {"font-family", 11, LV_SVG_ATTR_FONT_FAMILY},
122 {"font-style", 10, LV_SVG_ATTR_FONT_STYLE},
123 {"font-variant", 12, LV_SVG_ATTR_FONT_VARIANT},
124 {"font-weight", 11, LV_SVG_ATTR_FONT_WEIGHT},
125 {"font-size", 9, LV_SVG_ATTR_FONT_SIZE},
127 {"text-anchor", 11, LV_SVG_ATTR_TEXT_ANCHOR},
334 …if(token_len == _svg_tag_map[i].name_len && strncmp(_svg_tag_map[i].name, token->start, token_len)… in _get_svg_tag_type()
343 if(parser->state == LV_SVG_PARSER_IGNORE) { in _process_end_tag()
345 if((parser->ignore_len == len) && strncmp(parser->ignore_name, token->start, len) == 0) { in _process_end_tag()
346 parser->state = LV_SVG_PARSER_PROCESS; in _process_end_tag()
347 lv_free(parser->ignore_name); in _process_end_tag()
348 parser->ignore_name = NULL; in _process_end_tag()
349 parser->ignore_len = 0; in _process_end_tag()
354 if(parser->cur_node->type != tag) { in _process_end_tag()
359 if(parser->cur_node != parser->doc_root) { in _process_end_tag()
360 parser->cur_node = (lv_svg_node_t *)LV_TREE_NODE(parser->cur_node)->parent; in _process_end_tag()
368 uint32_t attr_len = attr_end - attr_start; in _get_svg_attr_type()
380 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_string()
382 node->attrs.size++; in _process_string()
383 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_string()
384 attr->id = type; in _process_string()
385 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_string()
386 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_string()
388 uint32_t len = val_end - val_start; in _process_string()
393 attr->value.sval = str; in _process_string()
398 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_xlink()
400 node->attrs.size++; in _process_xlink()
401 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_xlink()
402 attr->id = type; in _process_xlink()
403 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_xlink()
404 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_xlink()
410 uint32_t len = val_end - val_start; in _process_xlink()
415 attr->value.sval = str; in _process_xlink()
420 return ch != 0 && strchr("0123456789+-.", ch) != NULL; in _is_number_begin()
467 uint32_t len = str_end - str; in _parse_length()
483 else if(str[0] == 'm' && str[1] == 'm') { // mm in _parse_length()
486 else if(str[0] == 'c' && str[1] == 'm') { // cm in _parse_length()
489 else if(str[0] == 'e' && str[1] == 'm') { // em in _parse_length()
513 uint32_t len = ptr - str; in _parse_color()
586 tmp.m[y][x] = (matrix->m[y][0] * mul->m[0][x]) in _multiply_matrix()
587 + (matrix->m[y][1] * mul->m[1][x]) in _multiply_matrix()
588 + (matrix->m[y][2] * mul->m[2][x]); in _multiply_matrix()
672 {cos_r, -sin_r, 0.0f}, in _parse_matrix()
692 tlm.m[0][2] = -cx; in _parse_matrix()
693 tlm.m[1][2] = -cy; in _parse_matrix()
767 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_view_box()
769 node->attrs.size++; in _process_view_box()
770 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_view_box()
771 attr->id = type; in _process_view_box()
772 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_view_box()
773 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_view_box()
775 uint32_t len = val_end - val_start; in _process_view_box()
777 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_view_box()
778 attr->class_type = LV_SVG_ATTR_VALUE_NONE; in _process_view_box()
788 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_view_box()
789 attr->class_type = LV_SVG_ATTR_VALUE_NONE; in _process_view_box()
794 attr->value.val = vals; in _process_view_box()
800 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_points_value()
802 node->attrs.size++; in _process_points_value()
803 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_points_value()
804 attr->id = type; in _process_points_value()
805 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_points_value()
806 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_points_value()
822 lv_svg_point_t * pt = (lv_svg_point_t *)(&list->data) + point_cnt; in _process_points_value()
825 pt->x = val_number; in _process_points_value()
828 pt->y = val_number; in _process_points_value()
833 list->length = point_cnt; in _process_points_value()
834 attr->value.val = list; in _process_points_value()
840 case 'M': in _get_path_point_count()
841 case 'm': in _get_path_point_count()
869 case 'm': in _is_relative_cmd()
879 case 'M': in _is_relative_cmd()
901 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_path_value()
903 node->attrs.size++; in _process_path_value()
904 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_path_value()
905 attr->id = type; in _process_path_value()
906 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_path_value()
907 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_path_value()
922 uint8_t * data_ptr = (uint8_t *)(&list->data); in _process_path_value()
931 if(cur_cmd == 'M') { in _process_path_value()
934 else if(cur_cmd == 'm') { in _process_path_value()
955 if((cur_size + mem_inc) > (list_size - sizeof(uint32_t))) { in _process_path_value()
962 data_ptr = (uint8_t *)(&list->data) + cur_size; in _process_path_value()
968 case 'm': in _process_path_value()
969 case 'M': { in _process_path_value()
970 lv_svg_point_t * point = (lv_svg_point_t *)(&path_seg->data); in _process_path_value()
979 path_seg->cmd = LV_SVG_PATH_CMD_MOVE_TO; in _process_path_value()
980 point->x = xval; in _process_path_value()
981 point->y = yval; in _process_path_value()
990 lv_svg_point_t * point = (lv_svg_point_t *)(&path_seg->data); in _process_path_value()
999 path_seg->cmd = LV_SVG_PATH_CMD_LINE_TO; in _process_path_value()
1000 point->x = xval; in _process_path_value()
1001 point->y = yval; in _process_path_value()
1008 lv_svg_point_t * point = (lv_svg_point_t *)(&path_seg->data); in _process_path_value()
1014 path_seg->cmd = LV_SVG_PATH_CMD_LINE_TO; in _process_path_value()
1015 point->x = xval; in _process_path_value()
1016 point->y = cur_point.y; in _process_path_value()
1022 lv_svg_point_t * point = (lv_svg_point_t *)(&path_seg->data); in _process_path_value()
1028 path_seg->cmd = LV_SVG_PATH_CMD_LINE_TO; in _process_path_value()
1029 point->x = cur_point.x; in _process_path_value()
1030 point->y = yval; in _process_path_value()
1036 lv_svg_point_t * point = (lv_svg_point_t *)(&path_seg->data); in _process_path_value()
1046 path_seg->cmd = LV_SVG_PATH_CMD_CURVE_TO; in _process_path_value()
1059 lv_svg_point_t * point = (lv_svg_point_t *)(&path_seg->data); in _process_path_value()
1062 point[0].x = cur_point.x * 2 - cur_ctrlPoint.x; in _process_path_value()
1063 point[0].y = cur_point.y * 2 - cur_ctrlPoint.y; in _process_path_value()
1079 path_seg->cmd = LV_SVG_PATH_CMD_CURVE_TO; in _process_path_value()
1092 lv_svg_point_t * point = (lv_svg_point_t *)(&path_seg->data); in _process_path_value()
1102 path_seg->cmd = LV_SVG_PATH_CMD_QUAD_TO; in _process_path_value()
1115 lv_svg_point_t * point = (lv_svg_point_t *)(&path_seg->data); in _process_path_value()
1117 point[0].x = cur_point.x * 2 - cur_ctrlPoint.x; in _process_path_value()
1118 point[0].y = cur_point.y * 2 - cur_ctrlPoint.y; in _process_path_value()
1134 path_seg->cmd = LV_SVG_PATH_CMD_QUAD_TO; in _process_path_value()
1147 path_seg->cmd = LV_SVG_PATH_CMD_CLOSE; in _process_path_value()
1160 list->length = cmd_cnt; in _process_path_value()
1161 attr->value.val = list; in _process_path_value()
1167 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_gradient_units()
1169 node->attrs.size++; in _process_gradient_units()
1170 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_gradient_units()
1171 attr->id = type; in _process_gradient_units()
1172 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_gradient_units()
1173 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_gradient_units()
1175 uint32_t len = val_end - val_start; in _process_gradient_units()
1184 attr->value.ival = val; in _process_gradient_units()
1190 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_paint_dasharray()
1192 node->attrs.size++; in _process_paint_dasharray()
1193 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_paint_dasharray()
1194 attr->id = type; in _process_paint_dasharray()
1195 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_paint_dasharray()
1196 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_paint_dasharray()
1198 uint32_t len = val_end - val_start; in _process_paint_dasharray()
1201 attr->class_type = LV_SVG_ATTR_VALUE_NONE; in _process_paint_dasharray()
1205 attr->class_type = LV_SVG_ATTR_VALUE_INHERIT; in _process_paint_dasharray()
1209 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_paint_dasharray()
1224 float * val = (float *)(&list->data) + count; in _process_paint_dasharray()
1230 list->length = count; in _process_paint_dasharray()
1231 attr->value.val = list; in _process_paint_dasharray()
1238 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_font_attrs()
1240 node->attrs.size++; in _process_font_attrs()
1241 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_font_attrs()
1242 attr->id = type; in _process_font_attrs()
1243 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_font_attrs()
1244 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_font_attrs()
1246 uint32_t len = val_end - val_start; in _process_font_attrs()
1249 attr->class_type = LV_SVG_ATTR_VALUE_INHERIT; in _process_font_attrs()
1256 attr->value.fval = val_number; in _process_font_attrs()
1259 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_font_attrs()
1265 attr->value.sval = str; in _process_font_attrs()
1272 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_paint_attrs()
1274 node->attrs.size++; in _process_paint_attrs()
1275 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_paint_attrs()
1276 attr->id = type; in _process_paint_attrs()
1277 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_paint_attrs()
1278 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_paint_attrs()
1280 uint32_t len = val_end - val_start; in _process_paint_attrs()
1283 attr->class_type = LV_SVG_ATTR_VALUE_INHERIT; in _process_paint_attrs()
1295 attr->value.ival = val; in _process_paint_attrs()
1308 attr->value.ival = val; in _process_paint_attrs()
1321 attr->value.ival = val; in _process_paint_attrs()
1329 attr->value.fval = val; in _process_paint_attrs()
1337 attr->value.ival = (int32_t)val; in _process_paint_attrs()
1342 attr->value.fval = val; in _process_paint_attrs()
1347 attr->value.fval = val; in _process_paint_attrs()
1354 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_paint()
1356 node->attrs.size++; in _process_paint()
1357 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_paint()
1358 attr->id = type; in _process_paint()
1359 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_paint()
1360 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_paint()
1362 uint32_t len = val_end - val_start; in _process_paint()
1364 attr->class_type = LV_SVG_ATTR_VALUE_NONE; in _process_paint()
1368 attr->class_type = LV_SVG_ATTR_VALUE_INHERIT; in _process_paint()
1379 attr->class_type = LV_SVG_ATTR_VALUE_NONE; in _process_paint()
1393 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_paint()
1394 len = url_end - url_start; in _process_paint()
1399 attr->value.sval = node_id; in _process_paint()
1407 attr->value.ival = LV_SVG_ANIM_FREEZE; in _process_paint()
1411 attr->value.ival = LV_SVG_ANIM_REMOVE; in _process_paint()
1419 attr->value.uval = color; in _process_paint()
1427 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_opacity_value()
1429 node->attrs.size++; in _process_opacity_value()
1430 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_opacity_value()
1431 attr->id = type; in _process_opacity_value()
1432 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_opacity_value()
1433 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_opacity_value()
1435 uint32_t len = val_end - val_start; in _process_opacity_value()
1438 attr->class_type = LV_SVG_ATTR_VALUE_INHERIT; in _process_opacity_value()
1448 attr->value.fval = val_number; in _process_opacity_value()
1454 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_length_value()
1456 node->attrs.size++; in _process_length_value()
1457 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_length_value()
1458 attr->id = type; in _process_length_value()
1459 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_length_value()
1460 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_length_value()
1464 attr->value.fval = val_number; in _process_length_value()
1470 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_transform()
1472 node->attrs.size++; in _process_transform()
1473 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_transform()
1474 attr->id = type; in _process_transform()
1475 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_transform()
1476 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_transform()
1478 uint32_t len = val_end - val_start; in _process_transform()
1480 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_transform()
1481 attr->class_type = LV_SVG_ATTR_VALUE_NONE; in _process_transform()
1487 matrix->m[0][0] = matrix->m[1][1] = matrix->m[2][2] = 1.0f; // identity in _process_transform()
1494 len = val_end - ptr; in _process_transform()
1517 attr->value.val = matrix; in _process_transform()
1523 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_preserve_aspect_ratio()
1525 node->attrs.size++; in _process_preserve_aspect_ratio()
1526 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_preserve_aspect_ratio()
1527 attr->id = type; in _process_preserve_aspect_ratio()
1528 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_preserve_aspect_ratio()
1529 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_preserve_aspect_ratio()
1548 len = val_end - val_start; in _process_preserve_aspect_ratio()
1559 attr->value.uval = ratio; in _process_preserve_aspect_ratio()
1595 uint32_t len = str_end - str; in _parse_clock_time()
1597 if(len >= 2 && str[0] == 'm' && str[1] == 's') { in _parse_clock_time()
1617 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_clock_time()
1619 node->attrs.size++; in _process_clock_time()
1620 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_clock_time()
1621 attr->id = type; in _process_clock_time()
1622 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_clock_time()
1623 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_clock_time()
1625 uint32_t len = val_end - val_start; in _process_clock_time()
1627 attr->value.fval = 0.0f; in _process_clock_time()
1633 attr->value.fval = val_number; // ms in _process_clock_time()
1639 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_anim_attr_number()
1641 node->attrs.size++; in _process_anim_attr_number()
1642 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_anim_attr_number()
1643 attr->id = type; in _process_anim_attr_number()
1644 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_anim_attr_number()
1645 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_anim_attr_number()
1648 uint32_t len = val_end - val_start; in _process_anim_attr_number()
1650 attr->value.uval = 0; in _process_anim_attr_number()
1656 attr->value.uval = (uint32_t)val_number; in _process_anim_attr_number()
1659 uint32_t len = val_end - val_start; in _process_anim_attr_number()
1661 attr->class_type = in _process_anim_attr_number()
1663 attr->value.fval = 0.0f; in _process_anim_attr_number()
1666 else if(len == 12 && strncmp(val_start, "auto-reverse", 12) == 0) { in _process_anim_attr_number()
1667 attr->class_type = in _process_anim_attr_number()
1669 attr->value.fval = 180.0f; in _process_anim_attr_number()
1675 attr->value.fval = val_number; in _process_anim_attr_number()
1682 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_anim_attr_names()
1684 node->attrs.size++; in _process_anim_attr_names()
1685 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_anim_attr_names()
1686 attr->id = type; in _process_anim_attr_names()
1687 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_anim_attr_names()
1688 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_anim_attr_names()
1689 attr->value.ival = _get_svg_attr_type(val_start, val_end); in _process_anim_attr_names()
1695 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_anim_attr_options()
1697 node->attrs.size++; in _process_anim_attr_options()
1698 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_anim_attr_options()
1699 attr->id = type; in _process_anim_attr_options()
1700 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_anim_attr_options()
1701 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_anim_attr_options()
1703 uint32_t len = val_end - val_start; in _process_anim_attr_options()
1707 attr->value.ival = LV_SVG_ANIM_RESTART_ALWAYS; in _process_anim_attr_options()
1711 attr->value.ival = LV_SVG_ANIM_RESTART_WHEN_NOT_ACTIVE; in _process_anim_attr_options()
1715 attr->value.ival = LV_SVG_ANIM_RESTART_NEVER; in _process_anim_attr_options()
1722 attr->value.ival = LV_SVG_ANIM_CALC_MODE_LINEAR; in _process_anim_attr_options()
1726 attr->value.ival = LV_SVG_ANIM_CALC_MODE_PACED; in _process_anim_attr_options()
1730 attr->value.ival = LV_SVG_ANIM_CALC_MODE_SPLINE; in _process_anim_attr_options()
1734 attr->value.ival = LV_SVG_ANIM_CALC_MODE_DISCRETE; in _process_anim_attr_options()
1741 attr->value.ival = LV_SVG_ANIM_ADDITIVE_REPLACE; in _process_anim_attr_options()
1745 attr->value.ival = LV_SVG_ANIM_ADDITIVE_SUM; in _process_anim_attr_options()
1752 attr->value.ival = LV_SVG_ANIM_ACCUMULATE_NONE; in _process_anim_attr_options()
1756 attr->value.ival = LV_SVG_ANIM_ACCUMULATE_SUM; in _process_anim_attr_options()
1763 attr->value.ival = LV_SVG_TRANSFORM_TYPE_TRANSLATE; in _process_anim_attr_options()
1767 attr->value.ival = LV_SVG_TRANSFORM_TYPE_SCALE; in _process_anim_attr_options()
1771 attr->value.ival = LV_SVG_TRANSFORM_TYPE_ROTATE; in _process_anim_attr_options()
1775 attr->value.ival = LV_SVG_TRANSFORM_TYPE_SKEW_X; in _process_anim_attr_options()
1779 attr->value.ival = LV_SVG_TRANSFORM_TYPE_SKEW_Y; in _process_anim_attr_options()
1785 attr->value.ival = 0; in _process_anim_attr_options()
1791 if(node->type == LV_SVG_TAG_ANIMATE || node->type == LV_SVG_TAG_SET) { in _parse_anim_value()
1794 attr->value.fval = val_number; in _parse_anim_value()
1796 else if(node->type == LV_SVG_TAG_ANIMATE_COLOR) { in _parse_anim_value()
1799 attr->value.uval = color; in _parse_anim_value()
1801 else if(node->type == LV_SVG_TAG_ANIMATE_TRANSFORM) { in _parse_anim_value()
1802 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _parse_anim_value()
1811 float * val = (float *)(&list->data) + cnt; in _parse_anim_value()
1821 list->length = cnt; in _parse_anim_value()
1822 attr->value.val = list; in _parse_anim_value()
1824 else if(node->type == LV_SVG_TAG_ANIMATE_MOTION) { in _parse_anim_value()
1825 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _parse_anim_value()
1829 lv_svg_point_t * pt = (lv_svg_point_t *)(&list->data); in _parse_anim_value()
1833 pt->x = val_number; in _parse_anim_value()
1836 pt->y = val_number; in _parse_anim_value()
1838 list->length = 1; in _parse_anim_value()
1839 attr->value.val = list; in _parse_anim_value()
1856 lv_svg_attr_values_list_t * list = ctx->list; \
1858 ctx->mem_size = sizeof(type) * 4 + sizeof(uint32_t);\
1859 ctx->list = lv_malloc_zeroed(ctx->mem_size); \
1860 LV_ASSERT_MALLOC(ctx->list); \
1861 ptr = (type *)(&(ctx->list->data)); \
1862 ctx->list_count = 1; \
1864 uint32_t mem = sizeof(type) * (ctx->list_count + 1) + sizeof(uint32_t); \
1865 if(ctx->mem_size < mem) { \
1866 ctx->mem_size = (ctx->list_count << 1) * sizeof(type) + sizeof(uint32_t); \
1867 ctx->list = (lv_svg_attr_values_list_t *)lv_realloc(ctx->list, ctx->mem_size); \
1868 LV_ASSERT_MALLOC(ctx->list); \
1870 ptr = (type *)(&(ctx->list->data)) + ctx->list_count; \
1871 ctx->list_count++; \
1881 if(node->type == LV_SVG_TAG_ANIMATE || node->type == LV_SVG_TAG_SET) { in _anim_values_cb()
1886 else if(node->type == LV_SVG_TAG_ANIMATE_COLOR) { in _anim_values_cb()
1891 else if(node->type == LV_SVG_TAG_ANIMATE_TRANSFORM) { in _anim_values_cb()
1899 float * val = &(trans_vals->data[cnt]); in _anim_values_cb()
1905 trans_vals->length = cnt; in _anim_values_cb()
1907 else if(node->type == LV_SVG_TAG_ANIMATE_MOTION) { in _anim_values_cb()
1910 val_start = _parse_number(val_start, val_end, &point->x); in _anim_values_cb()
1911 val_start = _parse_number(val_start, val_end, &point->y); in _anim_values_cb()
1913 ctx->list->length = ctx->list_count; in _anim_values_cb()
1928 ctx->list->length = ctx->list_count; in _anim_keys_cb()
1941 val_start = _parse_number(val_start, val_end, &point->x); in _anim_key_splines_cb()
1942 val_start = _parse_number(val_start, val_end, &point->y); in _anim_key_splines_cb()
1945 val_start = _parse_number(val_start, val_end, &point->x); in _anim_key_splines_cb()
1946 val_start = _parse_number(val_start, val_end, &point->y); in _anim_key_splines_cb()
1948 ctx->list->length = ctx->list_count; in _anim_key_splines_cb()
1959 // offset-value in _anim_begin_end_cb()
1964 //FIXME: not support begin-end type in _anim_begin_end_cb()
1965 // syncbase-value in _anim_begin_end_cb()
1966 // event-value in _anim_begin_end_cb()
1967 // repeat-value in _anim_begin_end_cb()
1968 // accessKey-value in _anim_begin_end_cb()
1971 ctx->list->length = ctx->list_count; in _anim_begin_end_cb()
1977 CHECK_AND_RESIZE_ATTRS(node->attrs); in _process_anim_attr_values()
1979 node->attrs.size++; in _process_anim_attr_values()
1980 lv_svg_attr_t * attr = lv_array_at(&node->attrs, node->attrs.size - 1); in _process_anim_attr_values()
1981 attr->id = type; in _process_anim_attr_values()
1982 attr->val_type = LV_SVG_ATTR_VALUE_DATA; in _process_anim_attr_values()
1983 attr->class_type = LV_SVG_ATTR_VALUE_INITIAL; in _process_anim_attr_values()
1986 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_anim_attr_values()
1989 attr->value.val = ctx.list; in _process_anim_attr_values()
1992 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_anim_attr_values()
1995 attr->value.val = ctx.list; in _process_anim_attr_values()
1998 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_anim_attr_values()
2001 attr->value.val = ctx.list; in _process_anim_attr_values()
2004 attr->val_type = LV_SVG_ATTR_VALUE_PTR; in _process_anim_attr_values()
2007 attr->value.val = ctx.list; in _process_anim_attr_values()
2018 uint32_t len = lv_array_size(&token->attrs); in _process_attrs_tag()
2020 _lv_svg_token_attr_t * tok_attr = lv_array_at(&token->attrs, i); in _process_attrs_tag()
2021 lv_svg_attr_type_t type = _get_svg_attr_type(tok_attr->name_start, tok_attr->name_end); in _process_attrs_tag()
2023 tok_attr->value_start = _skip_space(tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2024 uint32_t value_len = tok_attr->value_end - tok_attr->value_start; in _process_attrs_tag()
2032 lv_memcpy(str, tok_attr->value_start, value_len); in _process_attrs_tag()
2034 node->xml_id = str; in _process_attrs_tag()
2041 _process_string(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2044 _process_view_box(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2047 … _process_preserve_aspect_ratio(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2063 … _process_length_value(node, type, tok_attr->value_start, tok_attr->value_end, parser->dpi); in _process_attrs_tag()
2071 _process_opacity_value(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2074 _process_points_value(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2080 _process_path_value(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2083 _process_transform(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2090 _process_paint(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2099 _process_paint_attrs(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2102 _process_paint_dasharray(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2105 _process_gradient_units(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2112 … _process_font_attrs(node, type, tok_attr->value_start, tok_attr->value_end, parser->dpi); in _process_attrs_tag()
2115 _process_xlink(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2122 _process_clock_time(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2125 _process_anim_attr_names(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2136 … _process_anim_attr_values(node, type, tok_attr->value_start, tok_attr->value_end, parser->dpi); in _process_attrs_tag()
2140 _process_anim_attr_number(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2147 _process_anim_attr_options(node, type, tok_attr->value_start, tok_attr->value_end); in _process_attrs_tag()
2162 if(parser->state == LV_SVG_PARSER_IGNORE) { in _process_begin_tag()
2167 if(token->type == LV_SVG_TOKEN_CONTENT) { in _process_begin_tag()
2171 lv_memcpy(content, token->start, len); in _process_begin_tag()
2173 lv_svg_node_t * node = lv_svg_node_create(parser->cur_node); in _process_begin_tag()
2174 node->xml_id = content; in _process_begin_tag()
2175 node->type = LV_SVG_TAG_CONTENT; in _process_begin_tag()
2181 if(!token->flat) { in _process_begin_tag()
2182 parser->state = LV_SVG_PARSER_IGNORE; in _process_begin_tag()
2184 parser->ignore_name = lv_malloc(len + 1); in _process_begin_tag()
2185 LV_ASSERT_MALLOC(parser->ignore_name); in _process_begin_tag()
2186 parser->ignore_len = len; in _process_begin_tag()
2187 lv_memcpy(parser->ignore_name, token->start, len); in _process_begin_tag()
2188 parser->ignore_name[len] = '\0'; in _process_begin_tag()
2194 lv_svg_node_t * node = lv_svg_node_create(parser->cur_node); in _process_begin_tag()
2195 node->type = tag; in _process_begin_tag()
2198 if(!parser->doc_root) { // root node in _process_begin_tag()
2199 parser->doc_root = node; in _process_begin_tag()
2201 if(!token->flat) { // FIXME: not leaf node in _process_begin_tag()
2202 parser->cur_node = node; in _process_begin_tag()
2214 parser->state = LV_SVG_PARSER_PROCESS; in _lv_svg_parser_init()
2215 parser->ignore_name = NULL; in _lv_svg_parser_init()
2216 parser->ignore_len = 0; in _lv_svg_parser_init()
2217 parser->dpi = 96; // FIXME: Is it right ? in _lv_svg_parser_init()
2218 parser->doc_root = NULL; in _lv_svg_parser_init()
2219 parser->cur_node = NULL; in _lv_svg_parser_init()
2225 if(parser->ignore_name) { in _lv_svg_parser_deinit()
2226 lv_free(parser->ignore_name); in _lv_svg_parser_deinit()
2227 parser->ignore_name = NULL; in _lv_svg_parser_deinit()
2228 parser->ignore_len = 0; in _lv_svg_parser_deinit()
2231 if(parser->doc_root) { in _lv_svg_parser_deinit()
2232 lv_svg_node_delete(parser->doc_root); in _lv_svg_parser_deinit()
2234 parser->doc_root = parser->cur_node = NULL; in _lv_svg_parser_deinit()
2240 return (parser->doc_root != NULL) in _lv_svg_parser_is_finish()
2241 && (parser->cur_node == parser->doc_root) in _lv_svg_parser_is_finish()
2242 && (parser->state != LV_SVG_PARSER_IGNORE); in _lv_svg_parser_is_finish()
2251 if(parser->doc_root == NULL) { in _lv_svg_parser_token()
2252 if(!(tag == LV_SVG_TAG_SVG && token->type == LV_SVG_TOKEN_BEGIN)) { in _lv_svg_parser_token()
2258 if(token->type == LV_SVG_TOKEN_END) { in _lv_svg_parser_token()
2276 if(root->type == LV_SVG_TAG_CONTENT) { in _lv_svg_dump_tree()
2277 printf("content: [%s]\n", root->xml_id); in _lv_svg_dump_tree()
2280 printf("tag <%s>", _svg_tag_map[root->type - 1].name); in _lv_svg_dump_tree()
2281 if(root->xml_id) { in _lv_svg_dump_tree()
2282 printf(" - id [%s]", root->xml_id); in _lv_svg_dump_tree()
2287 uint32_t len = lv_array_size(&root->attrs); in _lv_svg_dump_tree()
2292 lv_svg_attr_t * attr = lv_array_at(&root->attrs, i); in _lv_svg_dump_tree()
2293 printf(" attr <%s>\n", _svg_attr_map[attr->id - 1].name); in _lv_svg_dump_tree()
2298 for(uint32_t i = 0; i < tree_root->child_cnt; i++) { in _lv_svg_dump_tree()
2300 _lv_svg_dump_tree((lv_svg_node_t *)tree_root->children[i], depth); in _lv_svg_dump_tree()
2301 --depth; in _lv_svg_dump_tree()