summaryrefslogtreecommitdiff
path: root/xps/xpsanalyze.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2010-04-20 20:15:30 +0000
committerTor Andersson <tor.andersson@artifex.com>2010-04-20 20:15:30 +0000
commit0ffe17b83c05efe7066e7bf4bd0ca1fa00389899 (patch)
tree3bead3a27105a41967cb1545ce17bbaf63c4d002 /xps/xpsanalyze.c
parentaedcf47a54f382c1d510d0c07d644b450bf01ee5 (diff)
downloadghostpdl-0ffe17b83c05efe7066e7bf4bd0ca1fa00389899.tar.gz
Reformat GhostXPS source to use 4 spaces for indentation rather than a mix of tabs and spaces.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11090 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'xps/xpsanalyze.c')
-rw-r--r--xps/xpsanalyze.c282
1 files changed, 141 insertions, 141 deletions
diff --git a/xps/xpsanalyze.c b/xps/xpsanalyze.c
index 7f0d3f0a9..4050ebf1e 100644
--- a/xps/xpsanalyze.c
+++ b/xps/xpsanalyze.c
@@ -33,11 +33,11 @@ xps_resource_dictionary_has_transparency(xps_context_t *ctx, char *base_uri, xps
source = xps_att(root, "Source");
if (source)
- return xps_remote_resource_dictionary_has_transparency(ctx, base_uri, source);
+ return xps_remote_resource_dictionary_has_transparency(ctx, base_uri, source);
for (node = xps_down(root); node; node = xps_next(node))
{
- // TODO: ... all kinds of stuff can be here, brushes, elements, whatnot
+ // TODO: ... all kinds of stuff can be here, brushes, elements, whatnot
}
return 1;
@@ -53,19 +53,19 @@ xps_gradient_stops_have_transparency(xps_context_t *ctx, char *base_uri, xps_ite
for (node = xps_down(root); node; node = xps_next(node))
{
- if (!strcmp(xps_tag(node), "GradientStop"))
- {
- color_att = xps_att(node, "Color");
- if (color_att)
- {
- xps_parse_color(ctx, base_uri, color_att, &colorspace, samples);
- if (samples[0] < 1.0)
- {
- //dputs("page has transparency: GradientStop has alpha\n");
- return 1;
- }
- }
- }
+ if (!strcmp(xps_tag(node), "GradientStop"))
+ {
+ color_att = xps_att(node, "Color");
+ if (color_att)
+ {
+ xps_parse_color(ctx, base_uri, color_att, &colorspace, samples);
+ if (samples[0] < 1.0)
+ {
+ //dputs("page has transparency: GradientStop has alpha\n");
+ return 1;
+ }
+ }
+ }
}
return 0;
@@ -80,25 +80,25 @@ xps_gradient_brush_has_transparency(xps_context_t *ctx, char *base_uri, xps_item
opacity_att = xps_att(root, "Opacity");
if (opacity_att)
{
- if (atof(opacity_att) < 1.0)
- {
- //dputs("page has transparency: GradientBrush Opacity\n");
- return 1;
- }
+ if (atof(opacity_att) < 1.0)
+ {
+ //dputs("page has transparency: GradientBrush Opacity\n");
+ return 1;
+ }
}
for (node = xps_down(root); node; node = xps_next(node))
{
- if (!strcmp(xps_tag(node), "RadialGradientBrush.GradientStops"))
- {
- if (xps_gradient_stops_have_transparency(ctx, base_uri, node))
- return 1;
- }
- if (!strcmp(xps_tag(node), "LinearGradientBrush.GradientStops"))
- {
- if (xps_gradient_stops_have_transparency(ctx, base_uri, node))
- return 1;
- }
+ if (!strcmp(xps_tag(node), "RadialGradientBrush.GradientStops"))
+ {
+ if (xps_gradient_stops_have_transparency(ctx, base_uri, node))
+ return 1;
+ }
+ if (!strcmp(xps_tag(node), "LinearGradientBrush.GradientStops"))
+ {
+ if (xps_gradient_stops_have_transparency(ctx, base_uri, node))
+ return 1;
+ }
}
return 0;
@@ -116,67 +116,67 @@ xps_brush_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root)
if (!strcmp(xps_tag(root), "SolidColorBrush"))
{
- opacity_att = xps_att(root, "Opacity");
- if (opacity_att)
- {
- if (atof(opacity_att) < 1.0)
- {
- //dputs("page has transparency: SolidColorBrush Opacity\n");
- return 1;
- }
- }
-
- color_att = xps_att(root, "Color");
- if (color_att)
- {
- xps_parse_color(ctx, base_uri, color_att, &colorspace, samples);
- if (samples[0] < 1.0)
- {
- //dputs("page has transparency: SolidColorBrush Color has alpha\n");
- return 1;
- }
- }
+ opacity_att = xps_att(root, "Opacity");
+ if (opacity_att)
+ {
+ if (atof(opacity_att) < 1.0)
+ {
+ //dputs("page has transparency: SolidColorBrush Opacity\n");
+ return 1;
+ }
+ }
+
+ color_att = xps_att(root, "Color");
+ if (color_att)
+ {
+ xps_parse_color(ctx, base_uri, color_att, &colorspace, samples);
+ if (samples[0] < 1.0)
+ {
+ //dputs("page has transparency: SolidColorBrush Color has alpha\n");
+ return 1;
+ }
+ }
}
if (!strcmp(xps_tag(root), "VisualBrush"))
{
- char *opacity_att = xps_att(root, "Opacity");
- if (opacity_att)
- {
- if (atof(opacity_att) < 1.0)
- {
- //dputs("page has transparency: VisualBrush Opacity\n");
- return 1;
- }
- }
-
- for (node = xps_down(root); node; node = xps_next(node))
- {
- if (!strcmp(xps_tag(node), "VisualBrush.Visual"))
- {
- if (xps_element_has_transparency(ctx, base_uri, xps_down(node)))
- return 1;
- }
- }
+ char *opacity_att = xps_att(root, "Opacity");
+ if (opacity_att)
+ {
+ if (atof(opacity_att) < 1.0)
+ {
+ //dputs("page has transparency: VisualBrush Opacity\n");
+ return 1;
+ }
+ }
+
+ for (node = xps_down(root); node; node = xps_next(node))
+ {
+ if (!strcmp(xps_tag(node), "VisualBrush.Visual"))
+ {
+ if (xps_element_has_transparency(ctx, base_uri, xps_down(node)))
+ return 1;
+ }
+ }
}
if (!strcmp(xps_tag(root), "ImageBrush"))
{
- if (xps_image_brush_has_transparency(ctx, base_uri, root))
- return 1;
+ if (xps_image_brush_has_transparency(ctx, base_uri, root))
+ return 1;
}
if (!strcmp(xps_tag(root), "LinearGradientBrush"))
{
- if (xps_gradient_brush_has_transparency(ctx, base_uri, root))
- return 1;
+ if (xps_gradient_brush_has_transparency(ctx, base_uri, root))
+ return 1;
}
if (!strcmp(xps_tag(root), "RadialGradientBrush"))
{
- if (xps_gradient_brush_has_transparency(ctx, base_uri, root))
- return 1;
+ if (xps_gradient_brush_has_transparency(ctx, base_uri, root))
+ return 1;
}
return 0;
@@ -189,23 +189,23 @@ xps_path_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root)
for (node = xps_down(root); node; node = xps_next(node))
{
- if (!strcmp(xps_tag(node), "Path.OpacityMask"))
- {
- //dputs("page has transparency: Path.OpacityMask\n");
- return 1;
- }
-
- if (!strcmp(xps_tag(node), "Path.Stroke"))
- {
- if (xps_brush_has_transparency(ctx, base_uri, xps_down(node)))
- return 1;
- }
-
- if (!strcmp(xps_tag(node), "Path.Fill"))
- {
- if (xps_brush_has_transparency(ctx, base_uri, xps_down(node)))
- return 1;
- }
+ if (!strcmp(xps_tag(node), "Path.OpacityMask"))
+ {
+ //dputs("page has transparency: Path.OpacityMask\n");
+ return 1;
+ }
+
+ if (!strcmp(xps_tag(node), "Path.Stroke"))
+ {
+ if (xps_brush_has_transparency(ctx, base_uri, xps_down(node)))
+ return 1;
+ }
+
+ if (!strcmp(xps_tag(node), "Path.Fill"))
+ {
+ if (xps_brush_has_transparency(ctx, base_uri, xps_down(node)))
+ return 1;
+ }
}
return 0;
@@ -218,17 +218,17 @@ xps_glyphs_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root
for (node = xps_down(root); node; node = xps_next(node))
{
- if (!strcmp(xps_tag(node), "Glyphs.OpacityMask"))
- {
- //dputs("page has transparency: Glyphs.OpacityMask\n");
- return 1;
- }
-
- if (!strcmp(xps_tag(node), "Glyphs.Fill"))
- {
- if (xps_brush_has_transparency(ctx, base_uri, xps_down(node)))
- return 1;
- }
+ if (!strcmp(xps_tag(node), "Glyphs.OpacityMask"))
+ {
+ //dputs("page has transparency: Glyphs.OpacityMask\n");
+ return 1;
+ }
+
+ if (!strcmp(xps_tag(node), "Glyphs.Fill"))
+ {
+ if (xps_brush_has_transparency(ctx, base_uri, xps_down(node)))
+ return 1;
+ }
}
return 0;
@@ -241,20 +241,20 @@ xps_canvas_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *root
for (node = xps_down(root); node; node = xps_next(node))
{
- if (!strcmp(xps_tag(node), "Canvas.Resources"))
- {
- if (xps_resource_dictionary_has_transparency(ctx, base_uri, xps_down(node)))
- return 1;
- }
-
- if (!strcmp(xps_tag(node), "Canvas.OpacityMask"))
- {
- //dputs("page has transparency: Canvas.OpacityMask\n");
- return 1;
- }
-
- if (xps_element_has_transparency(ctx, base_uri, node))
- return 1;
+ if (!strcmp(xps_tag(node), "Canvas.Resources"))
+ {
+ if (xps_resource_dictionary_has_transparency(ctx, base_uri, xps_down(node)))
+ return 1;
+ }
+
+ if (!strcmp(xps_tag(node), "Canvas.OpacityMask"))
+ {
+ //dputs("page has transparency: Canvas.OpacityMask\n");
+ return 1;
+ }
+
+ if (xps_element_has_transparency(ctx, base_uri, node))
+ return 1;
}
return 0;
@@ -273,50 +273,50 @@ xps_element_has_transparency(xps_context_t *ctx, char *base_uri, xps_item_t *nod
stroke_att = xps_att(node, "Stroke");
if (stroke_att)
{
- xps_parse_color(ctx, base_uri, stroke_att, &colorspace, samples);
- if (samples[0] < 1.0)
- {
- //dprintf1("page has transparency: Stroke alpha=%g\n", samples[0]);
- return 1;
- }
+ xps_parse_color(ctx, base_uri, stroke_att, &colorspace, samples);
+ if (samples[0] < 1.0)
+ {
+ //dprintf1("page has transparency: Stroke alpha=%g\n", samples[0]);
+ return 1;
+ }
}
fill_att = xps_att(node, "Fill");
if (fill_att)
{
- xps_parse_color(ctx, base_uri, fill_att, &colorspace, samples);
- if (samples[0] < 1.0)
- {
- //dprintf1("page has transparency: Fill alpha=%g\n", samples[0]);
- return 1;
- }
+ xps_parse_color(ctx, base_uri, fill_att, &colorspace, samples);
+ if (samples[0] < 1.0)
+ {
+ //dprintf1("page has transparency: Fill alpha=%g\n", samples[0]);
+ return 1;
+ }
}
opacity_att = xps_att(node, "Opacity");
if (opacity_att)
{
- if (atof(opacity_att) < 1.0)
- {
- //dprintf1("page has transparency: Opacity=%g\n", atof(opacity_att));
- return 1;
- }
+ if (atof(opacity_att) < 1.0)
+ {
+ //dprintf1("page has transparency: Opacity=%g\n", atof(opacity_att));
+ return 1;
+ }
}
if (xps_att(node, "OpacityMask"))
{
- //dputs("page has transparency: OpacityMask\n");
- return 1;
+ //dputs("page has transparency: OpacityMask\n");
+ return 1;
}
if (!strcmp(xps_tag(node), "Path"))
- if (xps_path_has_transparency(ctx, base_uri, node))
- return 1;
+ if (xps_path_has_transparency(ctx, base_uri, node))
+ return 1;
if (!strcmp(xps_tag(node), "Glyphs"))
- if (xps_glyphs_has_transparency(ctx, base_uri, node))
- return 1;
+ if (xps_glyphs_has_transparency(ctx, base_uri, node))
+ return 1;
if (!strcmp(xps_tag(node), "Canvas"))
- if (xps_canvas_has_transparency(ctx, base_uri, node))
- return 1;
+ if (xps_canvas_has_transparency(ctx, base_uri, node))
+ return 1;
return 0;
}