xs/canvas.xs

filter: Statementstmt 70.4% 176 / 250 Branchbran 52.4% 87 / 166 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 63.2% 263 / 416 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« src/pdfmake_outline.c ↑ Summary xs/layer.xs »
1 MODULE = PDF::Make PACKAGE = PDF::Make::Canvas
2 PROTOTYPES: ENABLE
3  
4 pdfmake_content_t *
5 new(class)
6 char *class
7 PREINIT:
8 pdfmake_arena_t *arena;
9 CODE:
10 PERL_UNUSED_VAR(class);
11 755 arena = pdfmake_arena_new();
12 755 ▶ if (!arena) {
Branch: 1 branch
BranchTrueFalseTotal
if (!arena) { 0 755 755
13 0 croak("PDF::Make::Canvas::new: failed to create arena");
14 }
15 755 RETVAL = pdfmake_content_new(arena);
16 755 ▶ if (!RETVAL) {
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) { 0 755 755
17 0 pdfmake_arena_free(arena);
18 0 croak("PDF::Make::Canvas::new: failed to create content");
19 }
20 OUTPUT:
21 RETVAL
22  
23 SV *
24 to_bytes(self)
25 pdfmake_content_t *self
26 CODE:
27 706 const uint8_t *data = pdfmake_content_data(self);
28 706 size_t len = pdfmake_content_len(self);
29 706 RETVAL = newSVpvn((char *)data, len);
30 OUTPUT:
31 RETVAL
32  
33 UV
34 len(self)
35 pdfmake_content_t *self
36 CODE:
37 5 RETVAL = pdfmake_content_len(self);
38 OUTPUT:
39 RETVAL
40  
41 SV *
42 clear(self)
43 pdfmake_content_t *self
44 CODE:
45 41 pdfmake_content_clear(self);
46 41 RETVAL = SvREFCNT_inc(ST(0));
47 OUTPUT:
48 RETVAL
49  
50 void
51 DESTROY(self)
52 pdfmake_content_t *self
53 CODE:
54 755 ▶ if (self) {
Branch: 1 branch
BranchTrueFalseTotal
if (self) { 755 0 755
55 755 pdfmake_arena_t *arena = self->arena;
56 755 pdfmake_content_free(self);
57 755 pdfmake_arena_free(arena);
58 }
59  
60 #
61 # Graphics State Operators
62 #
63  
64 SV *
65 q(self)
66 pdfmake_content_t *self
67 CODE:
68 112 ▶ if (pdfmake_gs_q(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_q(self) != PDFMAKE_OK) 0 112 112
69 0 croak("PDF::Make::Canvas::q: failed");
70 112 RETVAL = SvREFCNT_inc(ST(0));
71 OUTPUT:
72 RETVAL
73  
74 SV *
75 Q(self)
76 pdfmake_content_t *self
77 CODE:
78 112 ▶ if (pdfmake_gs_Q(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_Q(self) != PDFMAKE_OK) 0 112 112
79 0 croak("PDF::Make::Canvas::Q: failed");
80 112 RETVAL = SvREFCNT_inc(ST(0));
81 OUTPUT:
82 RETVAL
83  
84 SV *
85 cm(self, a, b, c, d, e, f)
86 pdfmake_content_t *self
87 double a
88 double b
89 double c
90 double d
91 double e
92 double f
93 CODE:
94 5 ▶ if (pdfmake_gs_cm(self, a, b, c, d, e, f) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_cm(self, a, b, c, d, e, f) != PDFMAKE_OK) 0 5 5
95 0 croak("PDF::Make::Canvas::cm: failed");
96 5 RETVAL = SvREFCNT_inc(ST(0));
97 OUTPUT:
98 RETVAL
99  
100 SV *
101 w(self, width)
102 pdfmake_content_t *self
103 double width
104 CODE:
105 65 ▶ if (pdfmake_gs_w(self, width) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_w(self, width) != PDFMAKE_OK) 0 65 65
106 0 croak("PDF::Make::Canvas::w: failed");
107 65 RETVAL = SvREFCNT_inc(ST(0));
108 OUTPUT:
109 RETVAL
110  
111 SV *
112 J(self, cap)
113 pdfmake_content_t *self
114 int cap
115 CODE:
116 18 ▶ if (pdfmake_gs_J(self, cap) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_J(self, cap) != PDFMAKE_OK) 0 18 18
117 0 croak("PDF::Make::Canvas::J: failed");
118 18 RETVAL = SvREFCNT_inc(ST(0));
119 OUTPUT:
120 RETVAL
121  
122 SV *
123 j(self, join)
124 pdfmake_content_t *self
125 int join
126 CODE:
127 3 ▶ if (pdfmake_gs_j(self, join) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_j(self, join) != PDFMAKE_OK) 0 3 3
128 0 croak("PDF::Make::Canvas::j: failed");
129 3 RETVAL = SvREFCNT_inc(ST(0));
130 OUTPUT:
131 RETVAL
132  
133 SV *
134 M(self, miter)
135 pdfmake_content_t *self
136 double miter
137 CODE:
138 3 ▶ if (pdfmake_gs_M(self, miter) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_M(self, miter) != PDFMAKE_OK) 0 3 3
139 0 croak("PDF::Make::Canvas::M: failed");
140 3 RETVAL = SvREFCNT_inc(ST(0));
141 OUTPUT:
142 RETVAL
143  
144 SV *
145 d(self, dash_array, dash_phase)
146 pdfmake_content_t *self
147 AV *dash_array
148 double dash_phase
149 PREINIT:
150 SSize_t array_len;
151 double *pattern;
152 SSize_t i;
153 CODE:
154 8 array_len = av_len(dash_array) + 1;
155 8 ▶ Newx(pattern, array_len, double);
Branch: 1 branch
BranchTrueFalseTotal
Newx(pattern, array_len, double); 0 8 8
156 24 ▶ for (i = 0; i < array_len; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < array_len; i++) { 16 8 24
157 16 SV **elem = av_fetch(dash_array, i, 0);
158 16 ▶ pattern[i] = elem ? SvNV(*elem) : 0.0;
Branch: 1 branch
BranchTrueFalseTotal
pattern[i] = elem ? SvNV(*elem) : 0.0; 16 0 16
159 }
160 8 pdfmake_err_t err = pdfmake_gs_d(self, pattern, (size_t)array_len, dash_phase);
161 8 Safefree(pattern);
162 8 ▶ if (err != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (err != PDFMAKE_OK) 0 8 8
163 0 croak("PDF::Make::Canvas::d: failed");
164 8 RETVAL = SvREFCNT_inc(ST(0));
165 OUTPUT:
166 RETVAL
167  
168 SV *
169 ri(self, intent)
170 pdfmake_content_t *self
171 const char *intent
172 CODE:
173 1 ▶ if (pdfmake_gs_ri(self, intent) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_ri(self, intent) != PDFMAKE_OK) 0 1 1
174 0 croak("PDF::Make::Canvas::ri: failed");
175 1 RETVAL = SvREFCNT_inc(ST(0));
176 OUTPUT:
177 RETVAL
178  
179 SV *
180 i(self, flatness)
181 pdfmake_content_t *self
182 double flatness
183 CODE:
184 1 ▶ if (pdfmake_gs_i(self, flatness) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_i(self, flatness) != PDFMAKE_OK) 0 1 1
185 0 croak("PDF::Make::Canvas::i: failed");
186 1 RETVAL = SvREFCNT_inc(ST(0));
187 OUTPUT:
188 RETVAL
189  
190 SV *
191 gs(self, name)
192 pdfmake_content_t *self
193 const char *name
194 CODE:
195 1 ▶ if (pdfmake_gs_gs(self, name) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_gs(self, name) != PDFMAKE_OK) 0 1 1
196 0 croak("PDF::Make::Canvas::gs: failed");
197 1 RETVAL = SvREFCNT_inc(ST(0));
198 OUTPUT:
199 RETVAL
200  
201 #
202 # Path Construction Operators
203 #
204  
205 SV *
206 m(self, x, y)
207 pdfmake_content_t *self
208 double x
209 double y
210 CODE:
211 1841 ▶ if (pdfmake_path_m(self, x, y) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_path_m(self, x, y) != PDFMAKE_OK) 0 1841 1841
212 0 croak("PDF::Make::Canvas::m: failed");
213 1841 RETVAL = SvREFCNT_inc(ST(0));
214 OUTPUT:
215 RETVAL
216  
217 SV *
218 l(self, x, y)
219 pdfmake_content_t *self
220 double x
221 double y
222 CODE:
223 1839 ▶ if (pdfmake_path_l(self, x, y) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_path_l(self, x, y) != PDFMAKE_OK) 0 1839 1839
224 0 croak("PDF::Make::Canvas::l: failed");
225 1839 RETVAL = SvREFCNT_inc(ST(0));
226 OUTPUT:
227 RETVAL
228  
229 SV *
230 c(self, x1, y1, x2, y2, x3, y3)
231 pdfmake_content_t *self
232 double x1
233 double y1
234 double x2
235 double y2
236 double x3
237 double y3
238 CODE:
239 13 ▶ if (pdfmake_path_c(self, x1, y1, x2, y2, x3, y3) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_path_c(self, x1, y1, x2, y2, x3, y3) != PDFMAKE_OK) 0 13 13
240 0 croak("PDF::Make::Canvas::c: failed");
241 13 RETVAL = SvREFCNT_inc(ST(0));
242 OUTPUT:
243 RETVAL
244  
245 SV *
246 v(self, x2, y2, x3, y3)
247 pdfmake_content_t *self
248 double x2
249 double y2
250 double x3
251 double y3
252 CODE:
253 1 ▶ if (pdfmake_path_v(self, x2, y2, x3, y3) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_path_v(self, x2, y2, x3, y3) != PDFMAKE_OK) 0 1 1
254 0 croak("PDF::Make::Canvas::v: failed");
255 1 RETVAL = SvREFCNT_inc(ST(0));
256 OUTPUT:
257 RETVAL
258  
259 SV *
260 y(self, x1, y1, x3, y3)
261 pdfmake_content_t *self
262 double x1
263 double y1
264 double x3
265 double y3
266 CODE:
267 1 ▶ if (pdfmake_path_y(self, x1, y1, x3, y3) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_path_y(self, x1, y1, x3, y3) != PDFMAKE_OK) 0 1 1
268 0 croak("PDF::Make::Canvas::y: failed");
269 1 RETVAL = SvREFCNT_inc(ST(0));
270 OUTPUT:
271 RETVAL
272  
273 SV *
274 re(self, x, y, width, height)
275 pdfmake_content_t *self
276 double x
277 double y
278 double width
279 double height
280 CODE:
281 85 ▶ if (pdfmake_path_re(self, x, y, width, height) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_path_re(self, x, y, width, height) != PDFMAKE_OK) 0 85 85
282 0 croak("PDF::Make::Canvas::re: failed");
283 85 RETVAL = SvREFCNT_inc(ST(0));
284 OUTPUT:
285 RETVAL
286  
287 SV *
288 h(self)
289 pdfmake_content_t *self
290 CODE:
291 2 ▶ if (pdfmake_path_h(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_path_h(self) != PDFMAKE_OK) 0 2 2
292 0 croak("PDF::Make::Canvas::h: failed");
293 2 RETVAL = SvREFCNT_inc(ST(0));
294 OUTPUT:
295 RETVAL
296  
297 #
298 # Path Painting Operators
299 #
300  
301 SV *
302 S(self)
303 pdfmake_content_t *self
304 CODE:
305 1873 ▶ if (pdfmake_paint_S(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_paint_S(self) != PDFMAKE_OK) 0 1873 1873
306 0 croak("PDF::Make::Canvas::S: failed");
307 1873 RETVAL = SvREFCNT_inc(ST(0));
308 OUTPUT:
309 RETVAL
310  
311 SV *
312 s(self)
313 pdfmake_content_t *self
314 CODE:
315 2 ▶ if (pdfmake_paint_s(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_paint_s(self) != PDFMAKE_OK) 0 2 2
316 0 croak("PDF::Make::Canvas::s: failed");
317 2 RETVAL = SvREFCNT_inc(ST(0));
318 OUTPUT:
319 RETVAL
320  
321 SV *
322 f(self)
323 pdfmake_content_t *self
324 CODE:
325 53 ▶ if (pdfmake_paint_f(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_paint_f(self) != PDFMAKE_OK) 0 53 53
326 0 croak("PDF::Make::Canvas::f: failed");
327 53 RETVAL = SvREFCNT_inc(ST(0));
328 OUTPUT:
329 RETVAL
330  
331 SV *
332 f_star(self)
333 pdfmake_content_t *self
334 CODE:
335 1 ▶ if (pdfmake_paint_f_star(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_paint_f_star(self) != PDFMAKE_OK) 0 1 1
336 0 croak("PDF::Make::Canvas::f_star: failed");
337 1 RETVAL = SvREFCNT_inc(ST(0));
338 OUTPUT:
339 RETVAL
340  
341 SV *
342 B(self)
343 pdfmake_content_t *self
344 CODE:
345 4 ▶ if (pdfmake_paint_B(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_paint_B(self) != PDFMAKE_OK) 0 4 4
346 0 croak("PDF::Make::Canvas::B: failed");
347 4 RETVAL = SvREFCNT_inc(ST(0));
348 OUTPUT:
349 RETVAL
350  
351 SV *
352 B_star(self)
353 pdfmake_content_t *self
354 CODE:
355 1 ▶ if (pdfmake_paint_B_star(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_paint_B_star(self) != PDFMAKE_OK) 0 1 1
356 0 croak("PDF::Make::Canvas::B_star: failed");
357 1 RETVAL = SvREFCNT_inc(ST(0));
358 OUTPUT:
359 RETVAL
360  
361 SV *
362 b(self)
363 pdfmake_content_t *self
364 CODE:
365 1 ▶ if (pdfmake_paint_b(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_paint_b(self) != PDFMAKE_OK) 0 1 1
366 0 croak("PDF::Make::Canvas::b: failed");
367 1 RETVAL = SvREFCNT_inc(ST(0));
368 OUTPUT:
369 RETVAL
370  
371 SV *
372 b_star(self)
373 pdfmake_content_t *self
374 CODE:
375 1 ▶ if (pdfmake_paint_b_star(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_paint_b_star(self) != PDFMAKE_OK) 0 1 1
376 0 croak("PDF::Make::Canvas::b_star: failed");
377 1 RETVAL = SvREFCNT_inc(ST(0));
378 OUTPUT:
379 RETVAL
380  
381 SV *
382 n(self)
383 pdfmake_content_t *self
384 CODE:
385 2 ▶ if (pdfmake_paint_n(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_paint_n(self) != PDFMAKE_OK) 0 2 2
386 0 croak("PDF::Make::Canvas::n: failed");
387 2 RETVAL = SvREFCNT_inc(ST(0));
388 OUTPUT:
389 RETVAL
390  
391 #
392 # Clipping Path Operators
393 #
394  
395 SV *
396 W(self)
397 pdfmake_content_t *self
398 CODE:
399 1 ▶ if (pdfmake_clip_W(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_clip_W(self) != PDFMAKE_OK) 0 1 1
400 0 croak("PDF::Make::Canvas::W: failed");
401 1 RETVAL = SvREFCNT_inc(ST(0));
402 OUTPUT:
403 RETVAL
404  
405 SV *
406 W_star(self)
407 pdfmake_content_t *self
408 CODE:
409 1 ▶ if (pdfmake_clip_W_star(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_clip_W_star(self) != PDFMAKE_OK) 0 1 1
410 0 croak("PDF::Make::Canvas::W_star: failed");
411 1 RETVAL = SvREFCNT_inc(ST(0));
412 OUTPUT:
413 RETVAL
414  
415 #
416 # Color Operators
417 #
418  
419 SV *
420 CS(self, name)
421 pdfmake_content_t *self
422 const char *name
423 CODE:
424 1 ▶ if (pdfmake_color_CS(self, name) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_color_CS(self, name) != PDFMAKE_OK) 0 1 1
425 0 croak("PDF::Make::Canvas::CS: failed");
426 1 RETVAL = SvREFCNT_inc(ST(0));
427 OUTPUT:
428 RETVAL
429  
430 SV *
431 cs(self, name)
432 pdfmake_content_t *self
433 const char *name
434 CODE:
435 1 ▶ if (pdfmake_color_cs(self, name) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_color_cs(self, name) != PDFMAKE_OK) 0 1 1
436 0 croak("PDF::Make::Canvas::cs: failed");
437 1 RETVAL = SvREFCNT_inc(ST(0));
438 OUTPUT:
439 RETVAL
440  
441 SV *
442 G(self, gray)
443 pdfmake_content_t *self
444 double gray
445 CODE:
446 4 ▶ if (pdfmake_color_G(self, gray) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_color_G(self, gray) != PDFMAKE_OK) 0 4 4
447 0 croak("PDF::Make::Canvas::G: failed");
448 4 RETVAL = SvREFCNT_inc(ST(0));
449 OUTPUT:
450 RETVAL
451  
452 SV *
453 g(self, gray)
454 pdfmake_content_t *self
455 double gray
456 CODE:
457 3 ▶ if (pdfmake_color_g(self, gray) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_color_g(self, gray) != PDFMAKE_OK) 0 3 3
458 0 croak("PDF::Make::Canvas::g: failed");
459 3 RETVAL = SvREFCNT_inc(ST(0));
460 OUTPUT:
461 RETVAL
462  
463 SV *
464 RG(self, r, g, b)
465 pdfmake_content_t *self
466 double r
467 double g
468 double b
469 CODE:
470 63 ▶ if (pdfmake_color_RG(self, r, g, b) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_color_RG(self, r, g, b) != PDFMAKE_OK) 0 63 63
471 0 croak("PDF::Make::Canvas::RG: failed");
472 63 RETVAL = SvREFCNT_inc(ST(0));
473 OUTPUT:
474 RETVAL
475  
476 SV *
477 rg(self, r, g, b)
478 pdfmake_content_t *self
479 double r
480 double g
481 double b
482 CODE:
483 9263 ▶ if (pdfmake_color_rg(self, r, g, b) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_color_rg(self, r, g, b) != PDFMAKE_OK) 0 9263 9263
484 0 croak("PDF::Make::Canvas::rg: failed");
485 9263 RETVAL = SvREFCNT_inc(ST(0));
486 OUTPUT:
487 RETVAL
488  
489 SV *
490 K(self, c, m, y, k)
491 pdfmake_content_t *self
492 double c
493 double m
494 double y
495 double k
496 CODE:
497 3 ▶ if (pdfmake_color_K(self, c, m, y, k) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_color_K(self, c, m, y, k) != PDFMAKE_OK) 0 3 3
498 0 croak("PDF::Make::Canvas::K: failed");
499 3 RETVAL = SvREFCNT_inc(ST(0));
500 OUTPUT:
501 RETVAL
502  
503 SV *
504 k(self, c, m, y, k)
505 pdfmake_content_t *self
506 double c
507 double m
508 double y
509 double k
510 CODE:
511 3 ▶ if (pdfmake_color_k(self, c, m, y, k) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_color_k(self, c, m, y, k) != PDFMAKE_OK) 0 3 3
512 0 croak("PDF::Make::Canvas::k: failed");
513 3 RETVAL = SvREFCNT_inc(ST(0));
514 OUTPUT:
515 RETVAL
516  
517 #
518 # Text Operators
519 #
520  
521 SV *
522 BT(self)
523 pdfmake_content_t *self
524 CODE:
525 9320 ▶ if (pdfmake_text_BT(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_BT(self) != PDFMAKE_OK) 0 9320 9320
526 0 croak("PDF::Make::Canvas::BT: failed");
527 9320 RETVAL = SvREFCNT_inc(ST(0));
528 OUTPUT:
529 RETVAL
530  
531 SV *
532 ET(self)
533 pdfmake_content_t *self
534 CODE:
535 9320 ▶ if (pdfmake_text_ET(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_ET(self) != PDFMAKE_OK) 0 9320 9320
536 0 croak("PDF::Make::Canvas::ET: failed");
537 9320 RETVAL = SvREFCNT_inc(ST(0));
538 OUTPUT:
539 RETVAL
540  
541 SV *
542 Tc(self, charSpace)
543 pdfmake_content_t *self
544 double charSpace
545 CODE:
546 1 ▶ if (pdfmake_text_Tc(self, charSpace) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Tc(self, charSpace) != PDFMAKE_OK) 0 1 1
547 0 croak("PDF::Make::Canvas::Tc: failed");
548 1 RETVAL = SvREFCNT_inc(ST(0));
549 OUTPUT:
550 RETVAL
551  
552 SV *
553 Tw(self, wordSpace)
554 pdfmake_content_t *self
555 double wordSpace
556 CODE:
557 1 ▶ if (pdfmake_text_Tw(self, wordSpace) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Tw(self, wordSpace) != PDFMAKE_OK) 0 1 1
558 0 croak("PDF::Make::Canvas::Tw: failed");
559 1 RETVAL = SvREFCNT_inc(ST(0));
560 OUTPUT:
561 RETVAL
562  
563 SV *
564 Tz(self, scale)
565 pdfmake_content_t *self
566 double scale
567 CODE:
568 1 ▶ if (pdfmake_text_Tz(self, scale) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Tz(self, scale) != PDFMAKE_OK) 0 1 1
569 0 croak("PDF::Make::Canvas::Tz: failed");
570 1 RETVAL = SvREFCNT_inc(ST(0));
571 OUTPUT:
572 RETVAL
573  
574 SV *
575 TL(self, leading)
576 pdfmake_content_t *self
577 double leading
578 CODE:
579 4 ▶ if (pdfmake_text_TL(self, leading) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_TL(self, leading) != PDFMAKE_OK) 0 4 4
580 0 croak("PDF::Make::Canvas::TL: failed");
581 4 RETVAL = SvREFCNT_inc(ST(0));
582 OUTPUT:
583 RETVAL
584  
585 SV *
586 Tf(self, font, size)
587 pdfmake_content_t *self
588 const char *font
589 double size
590 CODE:
591 9324 ▶ if (pdfmake_text_Tf(self, font, size) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Tf(self, font, size) != PDFMAKE_OK) 0 9324 9324
592 0 croak("PDF::Make::Canvas::Tf: failed");
593 9324 RETVAL = SvREFCNT_inc(ST(0));
594 OUTPUT:
595 RETVAL
596  
597 SV *
598 Tr(self, render)
599 pdfmake_content_t *self
600 int render
601 CODE:
602 3 ▶ if (pdfmake_text_Tr(self, render) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Tr(self, render) != PDFMAKE_OK) 0 3 3
603 0 croak("PDF::Make::Canvas::Tr: failed");
604 3 RETVAL = SvREFCNT_inc(ST(0));
605 OUTPUT:
606 RETVAL
607  
608 SV *
609 Ts(self, rise)
610 pdfmake_content_t *self
611 double rise
612 CODE:
613 3 ▶ if (pdfmake_text_Ts(self, rise) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Ts(self, rise) != PDFMAKE_OK) 0 3 3
614 0 croak("PDF::Make::Canvas::Ts: failed");
615 3 RETVAL = SvREFCNT_inc(ST(0));
616 OUTPUT:
617 RETVAL
618  
619 SV *
620 Td(self, tx, ty)
621 pdfmake_content_t *self
622 double tx
623 double ty
624 CODE:
625 8131 ▶ if (pdfmake_text_Td(self, tx, ty) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Td(self, tx, ty) != PDFMAKE_OK) 0 8131 8131
626 0 croak("PDF::Make::Canvas::Td: failed");
627 8131 RETVAL = SvREFCNT_inc(ST(0));
628 OUTPUT:
629 RETVAL
630  
631 SV *
632 TD(self, tx, ty)
633 pdfmake_content_t *self
634 double tx
635 double ty
636 CODE:
637 1 ▶ if (pdfmake_text_TD(self, tx, ty) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_TD(self, tx, ty) != PDFMAKE_OK) 0 1 1
638 0 croak("PDF::Make::Canvas::TD: failed");
639 1 RETVAL = SvREFCNT_inc(ST(0));
640 OUTPUT:
641 RETVAL
642  
643 SV *
644 Tm(self, a, b, c, d, e, f)
645 pdfmake_content_t *self
646 double a
647 double b
648 double c
649 double d
650 double e
651 double f
652 CODE:
653 1209 ▶ if (pdfmake_text_Tm(self, a, b, c, d, e, f) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Tm(self, a, b, c, d, e, f) != PDFMAKE_OK) 0 1209 1209
654 0 croak("PDF::Make::Canvas::Tm: failed");
655 1209 RETVAL = SvREFCNT_inc(ST(0));
656 OUTPUT:
657 RETVAL
658  
659 SV *
660 T_star(self)
661 pdfmake_content_t *self
662 CODE:
663 2 ▶ if (pdfmake_text_Tstar(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Tstar(self) != PDFMAKE_OK) 0 2 2
664 0 croak("PDF::Make::Canvas::T_star: failed");
665 2 RETVAL = SvREFCNT_inc(ST(0));
666 OUTPUT:
667 RETVAL
668  
669 SV *
670 Tj(self, text)
671 pdfmake_content_t *self
672 SV *text
673 PREINIT:
674 STRLEN len;
675 const char *str;
676 CODE:
677 9338 str = SvPV(text, len);
678 9338 ▶ if (pdfmake_text_Tj(self, (const uint8_t *)str, len) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Tj(self, (const uint8_t *)str, len) != PDFMAKE_OK) 0 9338 9338
679 0 croak("PDF::Make::Canvas::Tj: failed");
680 9338 RETVAL = SvREFCNT_inc(ST(0));
681 OUTPUT:
682 RETVAL
683  
684 SV *
685 Tj_hex(self, text)
686 pdfmake_content_t *self
687 SV *text
688 PREINIT:
689 STRLEN len;
690 const char *str;
691 CODE:
692 3 str = SvPV(text, len);
693 3 ▶ if (pdfmake_text_Tj_hex(self, (const uint8_t *)str, len) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_Tj_hex(self, (const uint8_t *)str, len) != PDFMAKE_OK) 0 3 3
694 0 croak("PDF::Make::Canvas::Tj_hex: failed");
695 3 RETVAL = SvREFCNT_inc(ST(0));
696 OUTPUT:
697 RETVAL
698  
699 SV *
700 TJ(self, array)
701 pdfmake_content_t *self
702 AV *array
703 PREINIT:
704 pdfmake_arena_t *arena;
705 SSize_t array_len;
706 pdfmake_obj_t arr_obj;
707 SSize_t i;
708 CODE:
709 2 arena = self->arena;
710 2 array_len = av_len(array) + 1;
711  
712 /* Create a PDF array object */
713 2 arr_obj = pdfmake_array_new(arena);
714 2 ▶ if (arr_obj.kind != PDFMAKE_ARRAY)
Branch: 1 branch
BranchTrueFalseTotal
if (arr_obj.kind != PDFMAKE_ARRAY) 0 2 2
715 0 croak("PDF::Make::Canvas::TJ: failed to create array");
716  
717 10 ▶ for (i = 0; i < array_len; i++) {
Branch: 1 branch
BranchTrueFalseTotal
for (i = 0; i < array_len; i++) { 8 2 10
718 8 SV **elem = av_fetch(array, i, 0);
719 pdfmake_obj_t item;
720 8 ▶ if (!elem) {
Branch: 1 branch
BranchTrueFalseTotal
if (!elem) { 0 8 8
721 0 item = pdfmake_null();
722 8 ▶ } else if (SvIOK(*elem) || SvNOK(*elem)) {
Branch: 2 branches
BranchTrueFalseTotal
} else if (SvIOK(*elem) || SvNOK(*elem)) { 5 3 8
} else if (SvIOK(*elem) || SvNOK(*elem)) { 0 5 5
723 3 item = pdfmake_real(SvNV(*elem));
724 5 ▶ } else if (SvPOK(*elem)) {
Branch: 1 branch
BranchTrueFalseTotal
} else if (SvPOK(*elem)) { 5 0 5
725 STRLEN len;
726 5 const char *str = SvPV(*elem, len);
727 5 item = pdfmake_str(arena, str, len);
728 } else {
729 0 croak("PDF::Make::Canvas::TJ: unsupported element type");
730 }
731 8 ▶ if (!pdfmake_array_push(arena, &arr_obj, item))
Branch: 1 branch
BranchTrueFalseTotal
if (!pdfmake_array_push(arena, &arr_obj, item)) 0 8 8
732 0 croak("PDF::Make::Canvas::TJ: failed to push element");
733 }
734  
735 2 pdfmake_err_t err = pdfmake_text_TJ(self, &arr_obj);
736 2 ▶ if (err != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (err != PDFMAKE_OK) 0 2 2
737 0 croak("PDF::Make::Canvas::TJ: failed");
738 2 RETVAL = SvREFCNT_inc(ST(0));
739 OUTPUT:
740 RETVAL
741  
742 SV *
743 apostrophe(self, text)
744 pdfmake_content_t *self
745 SV *text
746 PREINIT:
747 STRLEN len;
748 const char *str;
749 CODE:
750 1 str = SvPV(text, len);
751 1 ▶ if (pdfmake_text_apostrophe(self, (const uint8_t *)str, len) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_apostrophe(self, (const uint8_t *)str, len) != PDFMAKE_OK) 0 1 1
752 0 croak("PDF::Make::Canvas::apostrophe: failed");
753 1 RETVAL = SvREFCNT_inc(ST(0));
754 OUTPUT:
755 RETVAL
756  
757 SV *
758 double_quote(self, aw, ac, text)
759 pdfmake_content_t *self
760 double aw
761 double ac
762 SV *text
763 PREINIT:
764 STRLEN len;
765 const char *str;
766 CODE:
767 1 str = SvPV(text, len);
768 1 ▶ if (pdfmake_text_quote(self, aw, ac, (const uint8_t *)str, len) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_text_quote(self, aw, ac, (const uint8_t *)str, len) != PDFMAKE_OK) 0 1 1
769 0 croak("PDF::Make::Canvas::double_quote: failed");
770 1 RETVAL = SvREFCNT_inc(ST(0));
771 OUTPUT:
772 RETVAL
773  
774 #
775 # XObject Operators
776 #
777  
778 SV *
779 Do(self, name)
780 pdfmake_content_t *self
781 const char *name
782 CODE:
783 1 ▶ if (pdfmake_xobj_Do(self, name) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_xobj_Do(self, name) != PDFMAKE_OK) 0 1 1
784 0 croak("PDF::Make::Canvas::Do: failed");
785 1 RETVAL = SvREFCNT_inc(ST(0));
786 OUTPUT:
787 RETVAL
788  
789 #
790 # Shading Operators
791 #
792  
793 SV *
794 sh(self, name)
795 pdfmake_content_t *self
796 const char *name
797 CODE:
798 1 ▶ if (pdfmake_sh(self, name) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_sh(self, name) != PDFMAKE_OK) 0 1 1
799 0 croak("PDF::Make::Canvas::sh: failed");
800 1 RETVAL = SvREFCNT_inc(ST(0));
801 OUTPUT:
802 RETVAL
803  
804 #
805 # Marked Content Operators
806 #
807  
808 SV *
809 BMC(self, tag)
810 pdfmake_content_t *self
811 const char *tag
812 CODE:
813 1 ▶ if (pdfmake_mc_BMC(self, tag) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_mc_BMC(self, tag) != PDFMAKE_OK) 0 1 1
814 0 croak("PDF::Make::Canvas::BMC: failed");
815 1 RETVAL = SvREFCNT_inc(ST(0));
816 OUTPUT:
817 RETVAL
818  
819 SV *
820 EMC(self)
821 pdfmake_content_t *self
822 CODE:
823 1 ▶ if (pdfmake_mc_EMC(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_mc_EMC(self) != PDFMAKE_OK) 0 1 1
824 0 croak("PDF::Make::Canvas::EMC: failed");
825 1 RETVAL = SvREFCNT_inc(ST(0));
826 OUTPUT:
827 RETVAL
828  
829 #
830 # Compatibility Operators
831 #
832  
833 SV *
834 BX(self)
835 pdfmake_content_t *self
836 CODE:
837 1 ▶ if (pdfmake_compat_BX(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_compat_BX(self) != PDFMAKE_OK) 0 1 1
838 0 croak("PDF::Make::Canvas::BX: failed");
839 1 RETVAL = SvREFCNT_inc(ST(0));
840 OUTPUT:
841 RETVAL
842  
843 SV *
844 EX(self)
845 pdfmake_content_t *self
846 CODE:
847 1 ▶ if (pdfmake_compat_EX(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_compat_EX(self) != PDFMAKE_OK) 0 1 1
848 0 croak("PDF::Make::Canvas::EX: failed");
849 1 RETVAL = SvREFCNT_inc(ST(0));
850 OUTPUT:
851 RETVAL
852  
853 #
854 # Image placement: q cm /Name Do Q
855 #
856  
857 SV *
858 image(self, name, x, y, width, height)
859 pdfmake_content_t *self
860 const char *name
861 double x
862 double y
863 double width
864 double height
865 CODE:
866 18 ▶ if (pdfmake_gs_q(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_q(self) != PDFMAKE_OK) 0 18 18
867 0 croak("PDF::Make::Canvas::image: q failed");
868 18 ▶ if (pdfmake_gs_cm(self, width, 0, 0, height, x, y) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_cm(self, width, 0, 0, height, x, y) != PDFMAKE_OK) 0 18 18
869 0 croak("PDF::Make::Canvas::image: cm failed");
870 18 ▶ if (pdfmake_xobj_Do(self, name) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_xobj_Do(self, name) != PDFMAKE_OK) 0 18 18
871 0 croak("PDF::Make::Canvas::image: Do failed");
872 18 ▶ if (pdfmake_gs_Q(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_gs_Q(self) != PDFMAKE_OK) 0 18 18
873 0 croak("PDF::Make::Canvas::image: Q failed");
874 18 RETVAL = SvREFCNT_inc(ST(0));
875 OUTPUT:
876 RETVAL
877  
878 #
879 # Layer (OCG) operators
880 #
881  
882 SV *
883 begin_layer(self, res_name)
884 pdfmake_content_t *self
885 const char *res_name
886 CODE:
887 7 ▶ if (pdfmake_content_begin_ocg(self, res_name) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_content_begin_ocg(self, res_name) != PDFMAKE_OK) 0 7 7
888 0 croak("PDF::Make::Canvas::begin_layer: failed");
889 7 RETVAL = SvREFCNT_inc(ST(0));
890 OUTPUT:
891 RETVAL
892  
893 SV *
894 end_layer(self)
895 pdfmake_content_t *self
896 CODE:
897 7 ▶ if (pdfmake_content_end_ocg(self) != PDFMAKE_OK)
Branch: 1 branch
BranchTrueFalseTotal
if (pdfmake_content_end_ocg(self) != PDFMAKE_OK) 0 7 7
898 0 croak("PDF::Make::Canvas::end_layer: failed");
899 7 RETVAL = SvREFCNT_inc(ST(0));
900 OUTPUT:
901 RETVAL
902  
903 BOOT:
904 {
905 /* Canvas dispatch table IDs */
906 enum {
907 COP_q, COP_Q, COP_BT, COP_ET,
908 COP_S, COP_s, COP_f, COP_f_star, COP_B, COP_B_star,
909 COP_b, COP_b_star, COP_n, COP_h,
910 COP_W, COP_W_star, COP_BX, COP_EX, COP_EMC, COP_T_star,
911 COP_w, COP_J, COP_j, COP_M, COP_i,
912 COP_G, COP_g, COP_TL, COP_Tr, COP_Ts, COP_Tc, COP_Tw, COP_Tz,
913 COP_Tj, COP_ri, COP_gs, COP_CS, COP_cs, COP_sh, COP_Do, COP_BMC,
914 COP_m, COP_l, COP_Td, COP_TD, COP_Tf,
915 COP_RG, COP_rg, COP_v, COP_y,
916 COP_re, COP_K, COP_k,
917 COP_c, COP_cm, COP_Tm,
918 COP_end_layer, COP_begin_layer, COP_apostrophe,
919 COP_COUNT
920 };
921  
922 static pdfmake_chain_entry_t canvas_dispatch[COP_COUNT] = {
923 [COP_q] = { (void*)pdfmake_gs_q, 0, {} },
924 [COP_Q] = { (void*)pdfmake_gs_Q, 0, {} },
925 [COP_BT] = { (void*)pdfmake_text_BT, 0, {} },
926 [COP_ET] = { (void*)pdfmake_text_ET, 0, {} },
927 [COP_S] = { (void*)pdfmake_paint_S, 0, {} },
928 [COP_s] = { (void*)pdfmake_paint_s, 0, {} },
929 [COP_f] = { (void*)pdfmake_paint_f, 0, {} },
930 [COP_f_star] = { (void*)pdfmake_paint_f_star, 0, {} },
931 [COP_B] = { (void*)pdfmake_paint_B, 0, {} },
932 [COP_B_star] = { (void*)pdfmake_paint_B_star, 0, {} },
933 [COP_b] = { (void*)pdfmake_paint_b, 0, {} },
934 [COP_b_star] = { (void*)pdfmake_paint_b_star, 0, {} },
935 [COP_n] = { (void*)pdfmake_paint_n, 0, {} },
936 [COP_h] = { (void*)pdfmake_path_h, 0, {} },
937 [COP_W] = { (void*)pdfmake_clip_W, 0, {} },
938 [COP_W_star] = { (void*)pdfmake_clip_W_star, 0, {} },
939 [COP_BX] = { (void*)pdfmake_compat_BX, 0, {} },
940 [COP_EX] = { (void*)pdfmake_compat_EX, 0, {} },
941 [COP_EMC] = { (void*)pdfmake_mc_EMC, 0, {} },
942 [COP_T_star] = { (void*)pdfmake_text_Tstar, 0, {} },
943 [COP_w] = { (void*)pdfmake_gs_w, 1, {PDFMAKE_ARG_DOUBLE} },
944 [COP_J] = { (void*)pdfmake_gs_J, 1, {PDFMAKE_ARG_INT} },
945 [COP_j] = { (void*)pdfmake_gs_j, 1, {PDFMAKE_ARG_INT} },
946 [COP_M] = { (void*)pdfmake_gs_M, 1, {PDFMAKE_ARG_DOUBLE} },
947 [COP_i] = { (void*)pdfmake_gs_i, 1, {PDFMAKE_ARG_DOUBLE} },
948 [COP_G] = { (void*)pdfmake_color_G, 1, {PDFMAKE_ARG_DOUBLE} },
949 [COP_g] = { (void*)pdfmake_color_g, 1, {PDFMAKE_ARG_DOUBLE} },
950 [COP_TL] = { (void*)pdfmake_text_TL, 1, {PDFMAKE_ARG_DOUBLE} },
951 [COP_Tr] = { (void*)pdfmake_text_Tr, 1, {PDFMAKE_ARG_INT} },
952 [COP_Ts] = { (void*)pdfmake_text_Ts, 1, {PDFMAKE_ARG_DOUBLE} },
953 [COP_Tc] = { (void*)pdfmake_text_Tc, 1, {PDFMAKE_ARG_DOUBLE} },
954 [COP_Tw] = { (void*)pdfmake_text_Tw, 1, {PDFMAKE_ARG_DOUBLE} },
955 [COP_Tz] = { (void*)pdfmake_text_Tz, 1, {PDFMAKE_ARG_DOUBLE} },
956 [COP_Tj] = { (void*)pdfmake_text_Tj_cstr, 1, {PDFMAKE_ARG_STRING} },
957 [COP_ri] = { (void*)pdfmake_gs_ri, 1, {PDFMAKE_ARG_STRING} },
958 [COP_gs] = { (void*)pdfmake_gs_gs, 1, {PDFMAKE_ARG_STRING} },
959 [COP_CS] = { (void*)pdfmake_color_CS, 1, {PDFMAKE_ARG_STRING} },
960 [COP_cs] = { (void*)pdfmake_color_cs, 1, {PDFMAKE_ARG_STRING} },
961 [COP_sh] = { (void*)pdfmake_sh, 1, {PDFMAKE_ARG_STRING} },
962 [COP_Do] = { (void*)pdfmake_xobj_Do, 1, {PDFMAKE_ARG_STRING} },
963 [COP_BMC] = { (void*)pdfmake_mc_BMC, 1, {PDFMAKE_ARG_STRING} },
964 [COP_m] = { (void*)pdfmake_path_m, 2, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
965 [COP_l] = { (void*)pdfmake_path_l, 2, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
966 [COP_Td] = { (void*)pdfmake_text_Td, 2, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
967 [COP_TD] = { (void*)pdfmake_text_TD, 2, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
968 [COP_Tf] = { (void*)pdfmake_text_Tf, 2, {PDFMAKE_ARG_STRING, PDFMAKE_ARG_DOUBLE} },
969 [COP_RG] = { (void*)pdfmake_color_RG, 3, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
970 [COP_rg] = { (void*)pdfmake_color_rg, 3, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
971 [COP_v] = { (void*)pdfmake_path_v, 3, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
972 [COP_y] = { (void*)pdfmake_path_y, 3, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
973 [COP_re] = { (void*)pdfmake_path_re, 4, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
974 [COP_K] = { (void*)pdfmake_color_K, 4, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
975 [COP_k] = { (void*)pdfmake_color_k, 4, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
976 [COP_c] = { (void*)pdfmake_path_c, 6, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
977 [COP_cm] = { (void*)pdfmake_gs_cm, 6, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
978 [COP_Tm] = { (void*)pdfmake_text_Tm, 6, {PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE, PDFMAKE_ARG_DOUBLE} },
979 [COP_end_layer] = { (void*)pdfmake_content_end_ocg, 0, {} },
980 [COP_begin_layer] = { (void*)pdfmake_content_begin_ocg, 1, {PDFMAKE_ARG_STRING} },
981 [COP_apostrophe] = { (void*)pdfmake_text_Tj_cstr, 1, {PDFMAKE_ARG_STRING} },
982 };
983  
984 /* Register dispatch table */
985 104 int canvas_table_id = pdfmake_chain_table_count++;
986 104 pdfmake_chain_tables[canvas_table_id] = canvas_dispatch;
987  
988 104 HV *stash = gv_stashpv("PDF::Make::Canvas", GV_ADD);
989 104 struct { const char *name; int idx; } methods[] = {
990 /* Nullary */
991 {"q", COP_q}, {"Q", COP_Q}, {"BT", COP_BT}, {"ET", COP_ET},
992 {"S", COP_S}, {"s", COP_s}, {"f", COP_f}, {"f_star", COP_f_star},
993 {"B", COP_B}, {"B_star", COP_B_star}, {"b", COP_b}, {"b_star", COP_b_star},
994 {"n", COP_n}, {"h", COP_h}, {"W", COP_W}, {"W_star", COP_W_star},
995 {"BX", COP_BX}, {"EX", COP_EX}, {"EMC", COP_EMC}, {"T_star", COP_T_star},
996 /* 1-arg double */
997 {"w", COP_w}, {"J", COP_J}, {"j", COP_j}, {"M", COP_M}, {"i", COP_i},
998 {"G", COP_G}, {"g", COP_g}, {"TL", COP_TL}, {"Tr", COP_Tr},
999 {"Ts", COP_Ts}, {"Tc", COP_Tc}, {"Tw", COP_Tw}, {"Tz", COP_Tz},
1000 /* 1-arg string */
1001 {"Tj", COP_Tj}, {"ri", COP_ri}, {"gs", COP_gs},
1002 {"CS", COP_CS}, {"cs", COP_cs}, {"sh", COP_sh}, {"Do", COP_Do},
1003 {"BMC", COP_BMC},
1004 /* 2-arg double */
1005 {"m", COP_m}, {"l", COP_l}, {"Td", COP_Td}, {"TD", COP_TD},
1006 /* string + double */
1007 {"Tf", COP_Tf},
1008 /* 3-arg double */
1009 {"RG", COP_RG}, {"rg", COP_rg}, {"v", COP_v}, {"y", COP_y},
1010 /* 4-arg double */
1011 {"re", COP_re}, {"K", COP_K}, {"k", COP_k},
1012 /* 6-arg double */
1013 {"c", COP_c}, {"cm", COP_cm}, {"Tm", COP_Tm},
1014 /* Additional */
1015 {"end_layer", COP_end_layer}, {"begin_layer", COP_begin_layer},
1016 {"apostrophe", COP_apostrophe},
1017 {NULL, 0}
1018 };
1019 int ci;
1020 6240 ▶ for (ci = 0; methods[ci].name; ci++) {
Branch: 1 branch
BranchTrueFalseTotal
for (ci = 0; methods[ci].name; ci++) { 6136 104 6240
1021 6136 ▶ PDFMAKE_REGISTER_CHAIN(stash, methods[ci].name, canvas_table_id, methods[ci].idx);
Branch: 2 branches
BranchTrueFalseTotal
PDFMAKE_REGISTER_CHAIN(stash, methods[ci].name, canvas_table_id, methods[ci].idx); 6136 0 6136
PDFMAKE_REGISTER_CHAIN(stash, methods[ci].name, canvas_table_id, methods[ci].idx); 6136 0 6136
1022 }
1023 }
« src/pdfmake_outline.c ↑ Summary xs/layer.xs »