summaryrefslogtreecommitdiff
path: root/xps/xpsvisual.c
blob: d9aa534016b2506a213c33b27beb57f4fc949a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "fitz.h"
#include "muxps.h"

enum { TILE_NONE, TILE_TILE, TILE_FLIP_X, TILE_FLIP_Y, TILE_FLIP_X_Y };

static void
xps_paint_visual_brush(xps_context_t *ctx, fz_matrix ctm,
	char *base_uri, xps_resource_t *dict, xps_item_t *root, void *visual_tag)
{
	xps_parse_element(ctx, ctm, base_uri, dict, (xps_item_t *)visual_tag);
}

void
xps_parse_visual_brush(xps_context_t *ctx, fz_matrix ctm, char *base_uri, xps_resource_t *dict, xps_item_t *root)
{
	xps_item_t *node;

	char *visual_uri;
	char *visual_att;
	xps_item_t *visual_tag = NULL;

	visual_att = xps_att(root, "Visual");

	for (node = xps_down(root); node; node = xps_next(node))
	{
		if (!strcmp(xps_tag(node), "VisualBrush.Visual"))
			visual_tag = xps_down(node);
	}

	visual_uri = base_uri;
	xps_resolve_resource_reference(ctx, dict, &visual_att, &visual_tag, &visual_uri);

	if (visual_tag)
	{
		xps_parse_tiling_brush(ctx, ctm, visual_uri, dict, root, xps_paint_visual_brush, visual_tag);
	}
}