diff options
Diffstat (limited to 'xps/xpspath.c')
-rw-r--r-- | xps/xpspath.c | 166 |
1 files changed, 83 insertions, 83 deletions
diff --git a/xps/xpspath.c b/xps/xpspath.c index ded566ca..00e57bee 100644 --- a/xps/xpspath.c +++ b/xps/xpspath.c @@ -36,7 +36,7 @@ fz_currentpoint(fz_path *path) } void -xps_clip(xps_context *ctx, fz_matrix ctm, xps_resource *dict, char *clip_att, xps_item *clip_tag) +xps_clip(xps_context *ctx, fz_matrix ctm, xps_resource *dict, char *clip_att, xml_element *clip_tag) { fz_path *path; int fill_rule = 0; @@ -462,7 +462,7 @@ xps_parse_abbreviated_geometry(xps_context *ctx, char *geom, int *fill_rule) } static void -xps_parse_arc_segment(fz_path *path, xps_item *root, int stroking, int *skipped_stroke) +xps_parse_arc_segment(fz_path *path, xml_element *root, int stroking, int *skipped_stroke) { /* ArcSegment pretty much follows the SVG algorithm for converting an * arc in endpoint representation to an arc in centerpoint @@ -475,12 +475,12 @@ xps_parse_arc_segment(fz_path *path, xps_item *root, int stroking, int *skipped_ float size_x, size_y; int is_stroked; - char *point_att = xps_att(root, "Point"); - char *size_att = xps_att(root, "Size"); - char *rotation_angle_att = xps_att(root, "RotationAngle"); - char *is_large_arc_att = xps_att(root, "IsLargeArc"); - char *sweep_direction_att = xps_att(root, "SweepDirection"); - char *is_stroked_att = xps_att(root, "IsStroked"); + char *point_att = xml_att(root, "Point"); + char *size_att = xml_att(root, "Size"); + char *rotation_angle_att = xml_att(root, "RotationAngle"); + char *is_large_arc_att = xml_att(root, "IsLargeArc"); + char *sweep_direction_att = xml_att(root, "SweepDirection"); + char *is_stroked_att = xml_att(root, "IsStroked"); if (!point_att || !size_att || !rotation_angle_att || !is_large_arc_att || !sweep_direction_att) { @@ -510,10 +510,10 @@ xps_parse_arc_segment(fz_path *path, xps_item *root, int stroking, int *skipped_ } static void -xps_parse_poly_quadratic_bezier_segment(fz_path *path, xps_item *root, int stroking, int *skipped_stroke) +xps_parse_poly_quadratic_bezier_segment(fz_path *path, xml_element *root, int stroking, int *skipped_stroke) { - char *points_att = xps_att(root, "Points"); - char *is_stroked_att = xps_att(root, "IsStroked"); + char *points_att = xml_att(root, "Points"); + char *is_stroked_att = xml_att(root, "IsStroked"); float x[2], y[2]; int is_stroked; fz_point pt; @@ -560,10 +560,10 @@ xps_parse_poly_quadratic_bezier_segment(fz_path *path, xps_item *root, int strok } static void -xps_parse_poly_bezier_segment(fz_path *path, xps_item *root, int stroking, int *skipped_stroke) +xps_parse_poly_bezier_segment(fz_path *path, xml_element *root, int stroking, int *skipped_stroke) { - char *points_att = xps_att(root, "Points"); - char *is_stroked_att = xps_att(root, "IsStroked"); + char *points_att = xml_att(root, "Points"); + char *is_stroked_att = xml_att(root, "IsStroked"); float x[3], y[3]; int is_stroked; char *s; @@ -601,10 +601,10 @@ xps_parse_poly_bezier_segment(fz_path *path, xps_item *root, int stroking, int * } static void -xps_parse_poly_line_segment(fz_path *path, xps_item *root, int stroking, int *skipped_stroke) +xps_parse_poly_line_segment(fz_path *path, xml_element *root, int stroking, int *skipped_stroke) { - char *points_att = xps_att(root, "Points"); - char *is_stroked_att = xps_att(root, "IsStroked"); + char *points_att = xml_att(root, "Points"); + char *is_stroked_att = xml_att(root, "IsStroked"); int is_stroked; float x, y; char *s; @@ -635,9 +635,9 @@ xps_parse_poly_line_segment(fz_path *path, xps_item *root, int stroking, int *sk } static void -xps_parse_path_figure(fz_path *path, xps_item *root, int stroking) +xps_parse_path_figure(fz_path *path, xml_element *root, int stroking) { - xps_item *node; + xml_element *node; char *is_closed_att; char *start_point_att; @@ -650,9 +650,9 @@ xps_parse_path_figure(fz_path *path, xps_item *root, int stroking) int skipped_stroke = 0; - is_closed_att = xps_att(root, "IsClosed"); - start_point_att = xps_att(root, "StartPoint"); - is_filled_att = xps_att(root, "IsFilled"); + is_closed_att = xml_att(root, "IsClosed"); + start_point_att = xml_att(root, "StartPoint"); + is_filled_att = xml_att(root, "IsFilled"); if (is_closed_att) is_closed = !strcmp(is_closed_att, "true"); @@ -666,15 +666,15 @@ xps_parse_path_figure(fz_path *path, xps_item *root, int stroking) fz_moveto(path, start_x, start_y); - for (node = xps_down(root); node; node = xps_next(node)) + for (node = xml_down(root); node; node = xml_next(node)) { - if (!strcmp(xps_tag(node), "ArcSegment")) + if (!strcmp(xml_tag(node), "ArcSegment")) xps_parse_arc_segment(path, node, stroking, &skipped_stroke); - if (!strcmp(xps_tag(node), "PolyBezierSegment")) + if (!strcmp(xml_tag(node), "PolyBezierSegment")) xps_parse_poly_bezier_segment(path, node, stroking, &skipped_stroke); - if (!strcmp(xps_tag(node), "PolyLineSegment")) + if (!strcmp(xml_tag(node), "PolyLineSegment")) xps_parse_poly_line_segment(path, node, stroking, &skipped_stroke); - if (!strcmp(xps_tag(node), "PolyQuadraticBezierSegment")) + if (!strcmp(xml_tag(node), "PolyQuadraticBezierSegment")) xps_parse_poly_quadratic_bezier_segment(path, node, stroking, &skipped_stroke); } @@ -688,28 +688,28 @@ xps_parse_path_figure(fz_path *path, xps_item *root, int stroking) } fz_path * -xps_parse_path_geometry(xps_context *ctx, xps_resource *dict, xps_item *root, int stroking, int *fill_rule) +xps_parse_path_geometry(xps_context *ctx, xps_resource *dict, xml_element *root, int stroking, int *fill_rule) { - xps_item *node; + xml_element *node; char *figures_att; char *fill_rule_att; char *transform_att; - xps_item *transform_tag = NULL; - xps_item *figures_tag = NULL; /* only used by resource */ + xml_element *transform_tag = NULL; + xml_element *figures_tag = NULL; /* only used by resource */ fz_matrix transform; fz_path *path; - figures_att = xps_att(root, "Figures"); - fill_rule_att = xps_att(root, "FillRule"); - transform_att = xps_att(root, "Transform"); + figures_att = xml_att(root, "Figures"); + fill_rule_att = xml_att(root, "FillRule"); + transform_att = xml_att(root, "Transform"); - for (node = xps_down(root); node; node = xps_next(node)) + for (node = xml_down(root); node; node = xml_next(node)) { - if (!strcmp(xps_tag(node), "PathGeometry.Transform")) - transform_tag = xps_down(node); + if (!strcmp(xml_tag(node), "PathGeometry.Transform")) + transform_tag = xml_down(node); } xps_resolve_resource_reference(ctx, dict, &transform_att, &transform_tag, NULL); @@ -737,9 +737,9 @@ xps_parse_path_geometry(xps_context *ctx, xps_resource *dict, xps_item *root, in if (figures_tag) xps_parse_path_figure(path, figures_tag, stroking); - for (node = xps_down(root); node; node = xps_next(node)) + for (node = xml_down(root); node; node = xml_next(node)) { - if (!strcmp(xps_tag(node), "PathFigure")) + if (!strcmp(xml_tag(node), "PathFigure")) xps_parse_path_figure(path, node, stroking); } @@ -768,9 +768,9 @@ xps_parse_line_cap(char *attr) */ void -xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *dict, xps_item *root) +xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *dict, xml_element *root) { - xps_item *node; + xml_element *node; char *fill_uri; char *stroke_uri; @@ -784,12 +784,12 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di char *opacity_att; char *opacity_mask_att; - xps_item *transform_tag = NULL; - xps_item *clip_tag = NULL; - xps_item *data_tag = NULL; - xps_item *fill_tag = NULL; - xps_item *stroke_tag = NULL; - xps_item *opacity_mask_tag = NULL; + xml_element *transform_tag = NULL; + xml_element *clip_tag = NULL; + xml_element *data_tag = NULL; + xml_element *fill_tag = NULL; + xml_element *stroke_tag = NULL; + xml_element *opacity_mask_tag = NULL; char *fill_opacity_att = NULL; char *stroke_opacity_att = NULL; @@ -815,37 +815,37 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di * Extract attributes and extended attributes. */ - transform_att = xps_att(root, "RenderTransform"); - clip_att = xps_att(root, "Clip"); - data_att = xps_att(root, "Data"); - fill_att = xps_att(root, "Fill"); - stroke_att = xps_att(root, "Stroke"); - opacity_att = xps_att(root, "Opacity"); - opacity_mask_att = xps_att(root, "OpacityMask"); - - stroke_dash_array_att = xps_att(root, "StrokeDashArray"); - stroke_dash_cap_att = xps_att(root, "StrokeDashCap"); - stroke_dash_offset_att = xps_att(root, "StrokeDashOffset"); - stroke_end_line_cap_att = xps_att(root, "StrokeEndLineCap"); - stroke_start_line_cap_att = xps_att(root, "StrokeStartLineCap"); - stroke_line_join_att = xps_att(root, "StrokeLineJoin"); - stroke_miter_limit_att = xps_att(root, "StrokeMiterLimit"); - stroke_thickness_att = xps_att(root, "StrokeThickness"); - - for (node = xps_down(root); node; node = xps_next(node)) + transform_att = xml_att(root, "RenderTransform"); + clip_att = xml_att(root, "Clip"); + data_att = xml_att(root, "Data"); + fill_att = xml_att(root, "Fill"); + stroke_att = xml_att(root, "Stroke"); + opacity_att = xml_att(root, "Opacity"); + opacity_mask_att = xml_att(root, "OpacityMask"); + + stroke_dash_array_att = xml_att(root, "StrokeDashArray"); + stroke_dash_cap_att = xml_att(root, "StrokeDashCap"); + stroke_dash_offset_att = xml_att(root, "StrokeDashOffset"); + stroke_end_line_cap_att = xml_att(root, "StrokeEndLineCap"); + stroke_start_line_cap_att = xml_att(root, "StrokeStartLineCap"); + stroke_line_join_att = xml_att(root, "StrokeLineJoin"); + stroke_miter_limit_att = xml_att(root, "StrokeMiterLimit"); + stroke_thickness_att = xml_att(root, "StrokeThickness"); + + for (node = xml_down(root); node; node = xml_next(node)) { - if (!strcmp(xps_tag(node), "Path.RenderTransform")) - transform_tag = xps_down(node); - if (!strcmp(xps_tag(node), "Path.OpacityMask")) - opacity_mask_tag = xps_down(node); - if (!strcmp(xps_tag(node), "Path.Clip")) - clip_tag = xps_down(node); - if (!strcmp(xps_tag(node), "Path.Fill")) - fill_tag = xps_down(node); - if (!strcmp(xps_tag(node), "Path.Stroke")) - stroke_tag = xps_down(node); - if (!strcmp(xps_tag(node), "Path.Data")) - data_tag = xps_down(node); + if (!strcmp(xml_tag(node), "Path.RenderTransform")) + transform_tag = xml_down(node); + if (!strcmp(xml_tag(node), "Path.OpacityMask")) + opacity_mask_tag = xml_down(node); + if (!strcmp(xml_tag(node), "Path.Clip")) + clip_tag = xml_down(node); + if (!strcmp(xml_tag(node), "Path.Fill")) + fill_tag = xml_down(node); + if (!strcmp(xml_tag(node), "Path.Stroke")) + stroke_tag = xml_down(node); + if (!strcmp(xml_tag(node), "Path.Data")) + data_tag = xml_down(node); } fill_uri = base_uri; @@ -866,17 +866,17 @@ xps_parse_path(xps_context *ctx, fz_matrix ctm, char *base_uri, xps_resource *di if (!data_att && !data_tag) return; - if (fill_tag && !strcmp(xps_tag(fill_tag), "SolidColorBrush")) + if (fill_tag && !strcmp(xml_tag(fill_tag), "SolidColorBrush")) { - fill_opacity_att = xps_att(fill_tag, "Opacity"); - fill_att = xps_att(fill_tag, "Color"); + fill_opacity_att = xml_att(fill_tag, "Opacity"); + fill_att = xml_att(fill_tag, "Color"); fill_tag = NULL; } - if (stroke_tag && !strcmp(xps_tag(stroke_tag), "SolidColorBrush")) + if (stroke_tag && !strcmp(xml_tag(stroke_tag), "SolidColorBrush")) { - stroke_opacity_att = xps_att(stroke_tag, "Opacity"); - stroke_att = xps_att(stroke_tag, "Color"); + stroke_opacity_att = xml_att(stroke_tag, "Opacity"); + stroke_att = xml_att(stroke_tag, "Color"); stroke_tag = NULL; } |