Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4680 right-hear 1
#include "fitz.h"
2
 
3
fz_device *
4
fz_new_device(void *user)
5
{
6
	fz_device *dev = fz_malloc(sizeof(fz_device));
7
	memset(dev, 0, sizeof(fz_device));
8
	dev->hints = 0;
9
	dev->flags = 0;
10
	dev->user = user;
11
	return dev;
12
}
13
 
14
void
15
fz_free_device(fz_device *dev)
16
{
17
	if (dev->free_user)
18
		dev->free_user(dev->user);
19
	fz_free(dev);
20
}
21
 
22
void
23
fz_fill_path(fz_device *dev, fz_path *path, int even_odd, fz_matrix ctm,
24
	fz_colorspace *colorspace, float *color, float alpha)
25
{
26
	if (dev->fill_path)
27
		dev->fill_path(dev->user, path, even_odd, ctm, colorspace, color, alpha);
28
}
29
 
30
void
31
fz_stroke_path(fz_device *dev, fz_path *path, fz_stroke_state *stroke, fz_matrix ctm,
32
	fz_colorspace *colorspace, float *color, float alpha)
33
{
34
	if (dev->stroke_path)
35
		dev->stroke_path(dev->user, path, stroke, ctm, colorspace, color, alpha);
36
}
37
 
38
void
39
fz_clip_path(fz_device *dev, fz_path *path, fz_rect *rect, int even_odd, fz_matrix ctm)
40
{
41
	if (dev->clip_path)
42
		dev->clip_path(dev->user, path, rect, even_odd, ctm);
43
}
44
 
45
void
46
fz_clip_stroke_path(fz_device *dev, fz_path *path, fz_rect *rect, fz_stroke_state *stroke, fz_matrix ctm)
47
{
48
	if (dev->clip_stroke_path)
49
		dev->clip_stroke_path(dev->user, path, rect, stroke, ctm);
50
}
51
 
52
void
53
fz_fill_text(fz_device *dev, fz_text *text, fz_matrix ctm,
54
	fz_colorspace *colorspace, float *color, float alpha)
55
{
56
	if (dev->fill_text)
57
		dev->fill_text(dev->user, text, ctm, colorspace, color, alpha);
58
}
59
 
60
void
61
fz_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, fz_matrix ctm,
62
	fz_colorspace *colorspace, float *color, float alpha)
63
{
64
	if (dev->stroke_text)
65
		dev->stroke_text(dev->user, text, stroke, ctm, colorspace, color, alpha);
66
}
67
 
68
void
69
fz_clip_text(fz_device *dev, fz_text *text, fz_matrix ctm, int accumulate)
70
{
71
	if (dev->clip_text)
72
		dev->clip_text(dev->user, text, ctm, accumulate);
73
}
74
 
75
void
76
fz_clip_stroke_text(fz_device *dev, fz_text *text, fz_stroke_state *stroke, fz_matrix ctm)
77
{
78
	if (dev->clip_stroke_text)
79
		dev->clip_stroke_text(dev->user, text, stroke, ctm);
80
}
81
 
82
void
83
fz_ignore_text(fz_device *dev, fz_text *text, fz_matrix ctm)
84
{
85
	if (dev->ignore_text)
86
		dev->ignore_text(dev->user, text, ctm);
87
}
88
 
89
void
90
fz_pop_clip(fz_device *dev)
91
{
92
	if (dev->pop_clip)
93
		dev->pop_clip(dev->user);
94
}
95
 
96
void
97
fz_fill_shade(fz_device *dev, fz_shade *shade, fz_matrix ctm, float alpha)
98
{
99
	if (dev->fill_shade)
100
		dev->fill_shade(dev->user, shade, ctm, alpha);
101
}
102
 
103
void
104
fz_fill_image(fz_device *dev, fz_pixmap *image, fz_matrix ctm, float alpha)
105
{
106
	if (dev->fill_image)
107
		dev->fill_image(dev->user, image, ctm, alpha);
108
}
109
 
110
void
111
fz_fill_image_mask(fz_device *dev, fz_pixmap *image, fz_matrix ctm,
112
	fz_colorspace *colorspace, float *color, float alpha)
113
{
114
	if (dev->fill_image_mask)
115
		dev->fill_image_mask(dev->user, image, ctm, colorspace, color, alpha);
116
}
117
 
118
void
119
fz_clip_image_mask(fz_device *dev, fz_pixmap *image, fz_rect *rect, fz_matrix ctm)
120
{
121
	if (dev->clip_image_mask)
122
		dev->clip_image_mask(dev->user, image, rect, ctm);
123
}
124
 
125
void
126
fz_begin_mask(fz_device *dev, fz_rect area, int luminosity, fz_colorspace *colorspace, float *bc)
127
{
128
	if (dev->begin_mask)
129
		dev->begin_mask(dev->user, area, luminosity, colorspace, bc);
130
}
131
 
132
void
133
fz_end_mask(fz_device *dev)
134
{
135
	if (dev->end_mask)
136
		dev->end_mask(dev->user);
137
}
138
 
139
void
140
fz_begin_group(fz_device *dev, fz_rect area, int isolated, int knockout, int blendmode, float alpha)
141
{
142
	if (dev->begin_group)
143
		dev->begin_group(dev->user, area, isolated, knockout, blendmode, alpha);
144
}
145
 
146
void
147
fz_end_group(fz_device *dev)
148
{
149
	if (dev->end_group)
150
		dev->end_group(dev->user);
151
}
152
 
153
void
154
fz_begin_tile(fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm)
155
{
156
	if (dev->begin_tile)
157
		dev->begin_tile(dev->user, area, view, xstep, ystep, ctm);
158
}
159
 
160
void
161
fz_end_tile(fz_device *dev)
162
{
163
	if (dev->end_tile)
164
		dev->end_tile(dev->user);
165
}