1 /*
2 Copyright (C) 2017-2021, Dirk Krause
3 SPDX-License-Identifier: BSD-3-Clause
4 */
5 
6 /*
7 	WARNING: This file was generated by the dkct program (see
8 	http://dktools.sourceforge.net/ for details).
9 	Changes you make here will be lost if dkct is run again!
10 	You should modify the original source and run dkct on it.
11 	Original source: dk4pppt.ctr
12 */
13 
14 #ifndef DK4PPPT_H_INCLUDED
15 /** Avoid multiple inclusions. */
16 #define DK4PPPT_H_INCLUDED 1
17 
18 
19 /**	@file dk4pppt.h	PGF/PDF+TeX/(E)PS+TeX output.
20 */
21 
22 #ifndef	DK4CONF_H_INCLUDED
23 #if DK4_BUILDING_DKTOOLS4
24 #include "dk4conf.h"
25 #else
26 #include <dktools-4/dk4conf.h>
27 #endif
28 #endif
29 
30 #ifndef	DK4FONT_H_INCLUDED
31 #if DK4_BUILDING_DKTOOLS4
32 #include <libdk4gra/dk4font.h>
33 #else
34 #include <dktools-4/dk4font.h>
35 #endif
36 #endif
37 
38 #ifndef	DK4ALIGN_H_INCLUDED
39 #if DK4_BUILDING_DKTOOLS4
40 #include <libdk4gra/dk4align.h>
41 #else
42 #include <dktools-4/dk4align.h>
43 #endif
44 #endif
45 
46 #ifndef	DK4ERROR_H_INCLUDED
47 #if DK4_BUILDING_DKTOOLS4
48 #include <libdk4base/dk4error.h>
49 #else
50 #include <dktools-4/dk4error.h>
51 #endif
52 #endif
53 
54 #ifndef	DK4MEMBF_H_INCLUDED
55 #if DK4_BUILDING_DKTOOLS4
56 #include <libdk4c/dk4membuf.h>
57 #else
58 #include <dktools-4/dk4membuf.h>
59 #endif
60 #endif
61 
62 #ifndef	DK4MBSTRM_H_INCLUDED
63 #if DK4_BUILDING_DKTOOLS4
64 #include <libdk4c/dk4mbstrm.h>
65 #else
66 #include <dktools-4/dk4mbstrm.h>
67 #endif
68 #endif
69 
70 #ifndef	DK4GRA_H_INCLUDED
71 #if DK4_BUILDING_DKTOOLS4
72 #include <libdk4gra/dk4gra.h>
73 #else
74 #include <dktools-4/dk4gra.h>
75 #endif
76 #endif
77 
78 #ifndef	DK4ENC_H_INCLUDED
79 #if DK4_BUILDING_DKTOOLS4
80 #include <libdk4c/dk4enc.h>
81 #else
82 #include <dktools-4/dk4enc.h>
83 #endif
84 #endif
85 
86 #ifndef	DK4REC25_H_INCLUDED
87 #if DK4_BUILDING_DKTOOLS4
88 #include <libdk4c/dk4rec25.h>
89 #else
90 #include <dktools-4/dk4rec25.h>
91 #endif
92 #endif
93 
94 /**	Output drivers.
95 */
96 typedef enum {
97 	DK4_PPPT_DR_PDF_TEX	= 0,	/**< Produce PDF+TeX file pair. */
98 	DK4_PPPT_DR_EPS_TEX ,		/**< Produce EPS+TeX file pair. */
99 	DK4_PPPT_DR_PGF				/**< Produce PGF file. */
100 } dk4_pppt_driver_t;
101 
102 
103 /**	Output structure for combined PDF+TeX/EPS+TeX output.
104 */
105 typedef struct {
106 	dkChar					*tfn;	/**< TeX file name. */
107 	dk4_gra_t				*gra;	/**< Graphics structure. */
108 	dk4_font_collector_t	*fc;	/**< Font collector. */
109 	dk4_membuf_t			*tmb;	/**< TeX memory buffer. */
110 	dk4_stream_t			*tms;	/**< TeX memory stream. */
111 	dk4_sto_t				*s_f;	/**< Storage for font setup lines. */
112 	dk4_sto_it_t			*i_f;	/**< Iterator for font setup lines. */
113 	dk4_sto_t				*s_p;	/**< Storage for package setup lines. */
114 	dk4_sto_it_t			*i_p;	/**< Iterator for package setup lines. */
115 	dk4_sto_t				*s_o;	/**< Storage for other preamble lines. */
116 	dk4_sto_it_t			*i_o;	/**< Iterator for other preamble lines. */
117 	double					 dfs;	/**< Document font size. */
118 	size_t					 n_f;	/**< Number of font setup lines. */
119 	size_t					 n_p;	/**< Number of package setup lines. */
120 	size_t					 n_o;	/**< Number of other setup lines. */
121 } dk4_pppt_pdf_ps_t;
122 
123 
124 
125 /**	Details structure.
126 */
127 typedef union {
128 	dk4_gra_t			*pgf;		/**< PGF output structure. */
129 	dk4_pppt_pdf_ps_t	 ppt;		/**< Output structure PDF+TeX/EPS+TeX. */
130 } dk4_pppt_out_t;
131 
132 
133 
134 /**	Output structure.
135 */
136 typedef struct {
137 	dk4_pppt_out_t		 out;			/**< Output union. */
138 	dk4_pppt_driver_t	 dr;			/**< Driver, dk4_pppt_driver_t value. */
139 	int					 isdoc;			/**< Flag: Produce entire document. */
140 	int					 flags;			/**< Document and page flags. */
141 } dk4_pppt_t;
142 
143 
144 #ifdef	__cplusplus
145 extern "C" {
146 #endif
147 
148 /**	Open an output structure.
149 	@param	texname	Name of TeX output file.
150 					The name ends on ".tex".
151 					The name of the included *.eps or *.pdf file
152 					is derived from this name.
153 	@param	dr		Output driver.
154 	@param	isdoc	Flag: Produce LaTeX document, not just image.
155 	@param	flags	Additional flags for graphics.
156 	@param	width	Image width in bp (PS point).
157 	@param	height	Image height in bp.
158 	@param	erp		Error report, may be NULL.
159 	@return	Valid pointer to new output structure on success, NULL on error.
160 */
161 dk4_pppt_t *
162 dk4pppt_open(
163 	const dkChar		*texname,
164 	dk4_pppt_driver_t	 dr,
165 	int					 isdoc,
166 	int					 flags,
167 	size_t				 width,
168 	size_t				 height,
169 	dk4_er_t			*erp
170 );
171 
172 /**	Write output file(s) and close output structure.
173 	@param	pppt	Output structure to write and close.
174 	@param	erp		Error report, may be NULL.
175 	@return	1 on success, 0 on error.
176 */
177 int
178 dk4pppt_write_and_close(
179 	dk4_pppt_t			*pppt,
180 	dk4_er_t			*erp
181 );
182 
183 /**	Close output structure without writing.
184 	This function can be used after errors to close the structure
185 	without any attempt to overwrite existing files.
186 	@param	pppt	Output structure to close.
187 */
188 void
189 dk4pppt_close(
190 	dk4_pppt_t			*pppt
191 );
192 
193 /**	Set flag for simplified gsave/grestore handling.
194 	Set this flag, if you use gsave and grestore only to save and restore
195 	the clip path for pattern filling.
196 	@param	pppt	Output structure.
197 	@param	val		Flag: Simplified gsave and grestore handling.
198 	@param	erp		Error report, may be NULL.
199 
200 	Error codes:
201 	- DK4_E_INVALID_ARGUMENTS<br>
202 	  if gra is NULL.
203 */
204 void
205 dk4pppt_set_gs_for_pattern_only(
206 	dk4_pppt_t		*pppt,
207 	int				 val,
208 	dk4_er_t		*erp
209 );
210 
211 /**	Save current graphics state (especially clip path).
212 	@param	pppt	Output structure.
213 	@param	backptr	Address of success variable to reset on errors.
214 	@param	erp		Error report, may be NULL.
215 
216 	Error codes:
217 	- DK4_E_INVALID_ARGUMENTS<br>
218 	  if gra is NULL,
219 	- DK4_E_INVALID_ARGUMENTS<br>
220 	  if gra is not in a state allowing this operation,
221 	- DK4_E_MATH_OVERFLOW<br>
222 	  on numeric overflow in memory size calculation,
223 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
224 	  if there is not enough memory available,
225 	- DK4_E_WRITE_FAILED<br>
226 	  if writing one ore multiple bytes to the stream failed,
227 	- DK4_E_FLUSH_FAILED<br>
228 	  if flushing data downwards failed.
229 */
230 void
231 dk4pppt_gsave(
232 	dk4_pppt_t			*pppt,
233 	int					*backptr,
234 	dk4_er_t			*erp
235 );
236 
237 /**	Restore graphics state (especially clip path).
238 	@param	pppt	Output structure.
239 	@param	backptr	Address of success variable to reset on errors.
240 	@param	erp		Error report, may be NULL.
241 
242 	Error codes:
243 	- DK4_E_INVALID_ARGUMENTS<br>
244 	  if gra is NULL,
245 	- DK4_E_INVALID_ARGUMENTS<br>
246 	  if gra is not in a state allowing this operation,
247 	- DK4_E_MATH_OVERFLOW<br>
248 	  on numeric overflow in memory size calculation,
249 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
250 	  if there is not enough memory available,
251 	- DK4_E_WRITE_FAILED<br>
252 	  if writing one ore multiple bytes to the stream failed,
253 	- DK4_E_FLUSH_FAILED<br>
254 	  if flushing data downwards failed.
255 */
256 void
257 dk4pppt_grestore(
258 	dk4_pppt_t			*pppt,
259 	int					*backptr,
260 	dk4_er_t			*erp
261 );
262 
263 /**	Set line width.
264 	@param	pppt	Output structure.
265 	@param	lw		Line width in bp.
266 	@param	backptr	Address of success variable to reset on errors.
267 	@param	erp		Error report, may be NULL.
268 
269 	Error codes:
270 	- DK4_E_INVALID_ARGUMENTS<br>
271 	  if gra is NULL,
272 	- DK4_E_INVALID_ARGUMENTS<br>
273 	  if gra is not in a state allowing this operation.
274 */
275 void
276 dk4pppt_set_line_width(
277 	dk4_pppt_t		*pppt,
278 	double			 lw,
279 	int				*backptr,
280 	dk4_er_t		*erp
281 );
282 
283 /**	Set line style.
284 	@param	pppt	Output structure.
285 	@param	ls		Line style.
286 	@param	sv		Style value (dash length in bp).
287 	@param	backptr	Address of success variable to reset on errors.
288 	@param	erp		Error report, may be NULL.
289 
290 	Error codes:
291 	- DK4_E_INVALID_ARGUMENTS<br>
292 	  if gra is NULL,
293 	- DK4_E_INVALID_ARGUMENTS<br>
294 	  if gra is not in a state allowing this operation.
295 */
296 void
297 dk4pppt_set_line_style(
298 	dk4_pppt_t		*pppt,
299 	dk4_gra_ls_t	 ls,
300 	double			 sv,
301 	int				*backptr,
302 	dk4_er_t		*erp
303 );
304 
305 /**	Set line cap.
306 	@param	pppt	Output structure.
307 	@param	lc		Line cap type.
308 	@param	backptr	Address of success variable to reset on errors.
309 	@param	erp		Error report, may be NULL.
310 
311 	Error codes:
312 	- DK4_E_INVALID_ARGUMENTS<br>
313 	  if gra is NULL,
314 	- DK4_E_INVALID_ARGUMENTS<br>
315 	  if gra is not in a state allowing this operation.
316 */
317 void
318 dk4pppt_set_line_cap(
319 	dk4_pppt_t		*pppt,
320 	dk4_gra_lc_t	 lc,
321 	int				*backptr,
322 	dk4_er_t		*erp
323 );
324 
325 /**	Set line join.
326 	@param	pppt	Output structure.
327 	@param	lj		Line join type.
328 	@param	ml		Miter limit, only used if lj is DK4_GRA_LJ_MITERED.
329 	@param	backptr	Address of success variable to reset on errors.
330 	@param	erp		Error report, may be NULL.
331 
332 	Error codes:
333 	- DK4_E_INVALID_ARGUMENTS<br>
334 	  if gra is NULL,
335 	- DK4_E_INVALID_ARGUMENTS<br>
336 	  if gra is not in a state allowing this operation.
337 */
338 void
339 dk4pppt_set_line_join(
340 	dk4_pppt_t		*pppt,
341 	dk4_gra_lj_t	 lj,
342 	double			 ml,
343 	int				*backptr,
344 	dk4_er_t		*erp
345 );
346 
347 /**	Set fill color to gray.
348 	@param	pppt	Output structure.
349 	@param	g		Gray value in interval 0 to 1.
350 	@param	backptr	Address of success variable to reset on errors.
351 	@param	erp		Error report, may be NULL.
352 
353 	Error codes:
354 	- DK4_E_INVALID_ARGUMENTS<br>
355 	  if gra is NULL,
356 	- DK4_E_INVALID_ARGUMENTS<br>
357 	  if gra is not in a state allowing this operation.
358 */
359 void
360 dk4pppt_set_fill_gray(
361 	dk4_pppt_t		*pppt,
362 	double			 g,
363 	int				*backptr,
364 	dk4_er_t		*erp
365 );
366 
367 /**	Set fill color to RGB.
368 	@param	pppt	Output structure.
369 	@param	r		Red value in interval 0 to 1.
370 	@param	g		Green value in interval 0 to 1.
371 	@param	b		Blue value in interval 0 to 1.
372 	@param	backptr	Address of success variable to reset on errors.
373 	@param	erp		Error report, may be NULL.
374 
375 	Error codes:
376 	- DK4_E_INVALID_ARGUMENTS<br>
377 	  if gra is NULL,
378 	- DK4_E_INVALID_ARGUMENTS<br>
379 	  if gra is not in a state allowing this operation.
380 */
381 void
382 dk4pppt_set_fill_rgb(
383 	dk4_pppt_t		*pppt,
384 	double			 r,
385 	double			 g,
386 	double			 b,
387 	int				*backptr,
388 	dk4_er_t		*erp
389 );
390 
391 /**	Set fill color to CMYK.
392 	@param	pppt	Output structure.
393 	@param	c		Cyan value in interval 0 to 1.
394 	@param	m		Magenta value in interval 0 to 1.
395 	@param	y		Yellow value in interval 0 to 1.
396 	@param	k		Black value in interval 0 to 1.
397 	@param	backptr	Address of success variable to reset on errors.
398 	@param	erp		Error report, may be NULL.
399 
400 	Error codes:
401 	- DK4_E_INVALID_ARGUMENTS<br>
402 	  if gra is NULL,
403 	- DK4_E_INVALID_ARGUMENTS<br>
404 	  if gra is not in a state allowing this operation.
405 */
406 void
407 dk4pppt_set_fill_cmyk(
408 	dk4_pppt_t		*pppt,
409 	double			 c,
410 	double			 m,
411 	double			 y,
412 	double			 k,
413 	int				*backptr,
414 	dk4_er_t		*erp
415 );
416 
417 /**	Set stroke color to gray.
418 	@param	pppt	Output structure.
419 	@param	g		Gray value in interval 0 to 1.
420 	@param	backptr	Address of success variable to reset on errors.
421 	@param	erp		Error report, may be NULL.
422 
423 	Error codes:
424 	- DK4_E_INVALID_ARGUMENTS<br>
425 	  if gra is NULL,
426 	- DK4_E_INVALID_ARGUMENTS<br>
427 	  if gra is not in a state allowing this operation.
428 */
429 void
430 dk4pppt_set_stroke_gray(
431 	dk4_pppt_t		*pppt,
432 	double			 g,
433 	int				*backptr,
434 	dk4_er_t		*erp
435 );
436 
437 /**	Set stroke color to RGB.
438 	@param	pppt	Output structure.
439 	@param	r		Red value in interval 0 to 1.
440 	@param	g		Green value in interval 0 to 1.
441 	@param	b		Blue value in interval 0 to 1.
442 	@param	backptr	Address of success variable to reset on errors.
443 	@param	erp		Error report, may be NULL.
444 
445 	Error codes:
446 	- DK4_E_INVALID_ARGUMENTS<br>
447 	  if gra is NULL,
448 	- DK4_E_INVALID_ARGUMENTS<br>
449 	  if gra is not in a state allowing this operation.
450 */
451 void
452 dk4pppt_set_stroke_rgb(
453 	dk4_pppt_t		*pppt,
454 	double			 r,
455 	double			 g,
456 	double			 b,
457 	int				*backptr,
458 	dk4_er_t		*erp
459 );
460 
461 /**	Set stroke color to CMYK.
462 	@param	pppt	Output structure.
463 	@param	c		Cyan value in interval 0 to 1.
464 	@param	m		Magenta value in interval 0 to 1.
465 	@param	y		Yellow value in interval 0 to 1.
466 	@param	k		Black value in interval 0 to 1.
467 	@param	backptr	Address of success variable to reset on errors.
468 	@param	erp		Error report, may be NULL.
469 
470 	Error codes:
471 	- DK4_E_INVALID_ARGUMENTS<br>
472 	  if gra is NULL,
473 	- DK4_E_INVALID_ARGUMENTS<br>
474 	  if gra is not in a state allowing this operation.
475 */
476 void
477 dk4pppt_set_stroke_cmyk(
478 	dk4_pppt_t		*pppt,
479 	double			 c,
480 	double			 m,
481 	double			 y,
482 	double			 k,
483 	int				*backptr,
484 	dk4_er_t		*erp
485 );
486 
487 /**	Prepare output structure for a fill operation.
488 	Use this function before you start to construct a path you plan to fill.
489 	@param	pppt	Output structure.
490 	@param	backptr	Address of success variable to reset on errors.
491 	@param	erp		Error report, may be NULL.
492 
493 	Error codes:
494 	- DK4_E_INVALID_ARGUMENTS<br>
495 	  if gra is NULL,
496 	- DK4_E_INVALID_ARGUMENTS<br>
497 	  if gra is not in a state allowing this operation,
498 	- DK4_E_MATH_OVERFLOW<br>
499 	  on numeric overflow in memory size calculation,
500 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
501 	  if there is not enough memory available,
502 	- DK4_E_WRITE_FAILED<br>
503 	  if writing one ore multiple bytes to the stream failed,
504 	- DK4_E_FLUSH_FAILED<br>
505 	  if flushing data downwards failed.
506 */
507 void
508 dk4pppt_prepare_fill(
509 	dk4_pppt_t	*pppt,
510 	int			*backptr,
511 	dk4_er_t	*erp
512 );
513 
514 /**	Prepare output structure for a stroke operation.
515 	Use this function before you start to construct a path you plan to stroke.
516 	@param	pppt	Output structure.
517 	@param	backptr	Address of success variable to reset on errors.
518 	@param	erp		Error report, may be NULL.
519 
520 	Error codes:
521 	- DK4_E_INVALID_ARGUMENTS<br>
522 	  if gra is NULL,
523 	- DK4_E_INVALID_ARGUMENTS<br>
524 	  if gra is not in a state allowing this operation,
525 	- DK4_E_MATH_OVERFLOW<br>
526 	  on numeric overflow in memory size calculation,
527 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
528 	  if there is not enough memory available,
529 	- DK4_E_WRITE_FAILED<br>
530 	  if writing one ore multiple bytes to the stream failed,
531 	- DK4_E_FLUSH_FAILED<br>
532 	  if flushing data downwards failed.
533 */
534 void
535 dk4pppt_prepare_stroke(
536 	dk4_pppt_t	*pppt,
537 	int			*backptr,
538 	dk4_er_t	*erp
539 );
540 
541 /**	Prepare output structure for a combined fill and stroke operation.
542 	Use this function before you start to construct a path you plan to
543 	fill and stroke.
544 	@param	pppt	Output structure.
545 	@param	backptr	Address of success variable to reset on errors.
546 	@param	erp		Error report, may be NULL.
547 
548 	Error codes:
549 	- DK4_E_INVALID_ARGUMENTS<br>
550 	  if gra is NULL,
551 	- DK4_E_INVALID_ARGUMENTS<br>
552 	  if gra is not in a state allowing this operation,
553 	- DK4_E_MATH_OVERFLOW<br>
554 	  on numeric overflow in memory size calculation,
555 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
556 	  if there is not enough memory available,
557 	- DK4_E_WRITE_FAILED<br>
558 	  if writing one ore multiple bytes to the stream failed,
559 	- DK4_E_FLUSH_FAILED<br>
560 	  if flushing data downwards failed.
561 */
562 void
563 dk4pppt_prepare_fill_and_stroke(
564 	dk4_pppt_t	*pppt,
565 	int			*backptr,
566 	dk4_er_t	*erp
567 );
568 
569 /**	Check whether a combined fill and close operation is available
570 	for an output structure.
571 	@param	pppt	Output structure to test.
572 	@return	1 if a fill-and-close operation is available, 0 otherwise.
573 */
574 int
575 dk4pppt_can_fill_and_stroke(
576 	const dk4_pppt_t	*pppt
577 );
578 
579 /**	Fill current path.
580 	Note: Use dk4gra_prepare_fill() before you start to construct a path
581 	you plan to fill.
582 	@param	pppt	Output structure.
583 	@param	backptr	Address of success variable to reset on errors.
584 	@param	erp		Error report, may be NULL.
585 
586 	Error codes:
587 	- DK4_E_INVALID_ARGUMENTS<br>
588 	  if gra is NULL,
589 	- DK4_E_INVALID_ARGUMENTS<br>
590 	  if gra is not in a state allowing this operation,
591 	- DK4_E_MATH_OVERFLOW<br>
592 	  on numeric overflow in memory size calculation,
593 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
594 	  if there is not enough memory available,
595 	- DK4_E_WRITE_FAILED<br>
596 	  if writing one ore multiple bytes to the stream failed,
597 	- DK4_E_FLUSH_FAILED<br>
598 	  if flushing data downwards failed.
599 */
600 void
601 dk4pppt_fill(
602 	dk4_pppt_t	*pppt,
603 	int			*backptr,
604 	dk4_er_t	*erp
605 );
606 
607 /**	Stroke current path.
608 	Note: Use dk4gra_prepare_stroke() before you start to construct a path
609 	you plan to stroke.
610 	@param	pppt	Output structure.
611 	@param	backptr	Address of success variable to reset on errors.
612 	@param	erp		Error report, may be NULL.
613 
614 	Error codes:
615 	- DK4_E_INVALID_ARGUMENTS<br>
616 	  if gra is NULL,
617 	- DK4_E_INVALID_ARGUMENTS<br>
618 	  if gra is not in a state allowing this operation,
619 	- DK4_E_MATH_OVERFLOW<br>
620 	  on numeric overflow in memory size calculation,
621 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
622 	  if there is not enough memory available,
623 	- DK4_E_WRITE_FAILED<br>
624 	  if writing one ore multiple bytes to the stream failed,
625 	- DK4_E_FLUSH_FAILED<br>
626 	  if flushing data downwards failed.
627 */
628 void
629 dk4pppt_stroke(
630 	dk4_pppt_t	*pppt,
631 	int			*backptr,
632 	dk4_er_t	*erp
633 );
634 
635 /**	Fill and stroke current path.
636 	Note: Use dk4gra_prepare_fill_and_stroke() before you start to construct
637 	a path you plan to fill and stroke.
638 	@param	pppt	Output structure.
639 	@param	backptr	Address of success variable to reset on errors.
640 	@param	erp		Error report, may be NULL.
641 
642 	Error codes:
643 	- DK4_E_INVALID_ARGUMENTS<br>
644 	  if gra is NULL,
645 	- DK4_E_INVALID_ARGUMENTS<br>
646 	  if gra is not in a state allowing this operation,
647 	- DK4_E_MATH_OVERFLOW<br>
648 	  on numeric overflow in memory size calculation,
649 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
650 	  if there is not enough memory available,
651 	- DK4_E_WRITE_FAILED<br>
652 	  if writing one ore multiple bytes to the stream failed,
653 	- DK4_E_FLUSH_FAILED<br>
654 	  if flushing data downwards failed.
655 */
656 void
657 dk4pppt_fill_and_stroke(
658 	dk4_pppt_t	*pppt,
659 	int			*backptr,
660 	dk4_er_t	*erp
661 );
662 
663 /**	Use current path for clipping.
664 	@param	pppt	Output structure.
665 	@param	backptr	Address of success variable to reset on errors.
666 	@param	erp		Error report, may be NULL.
667 
668 	Error codes:
669 	- DK4_E_INVALID_ARGUMENTS<br>
670 	  if gra is NULL,
671 	- DK4_E_INVALID_ARGUMENTS<br>
672 	  if gra is not in a state allowing this operation,
673 	- DK4_E_MATH_OVERFLOW<br>
674 	  on numeric overflow in memory size calculation,
675 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
676 	  if there is not enough memory available,
677 	- DK4_E_WRITE_FAILED<br>
678 	  if writing one ore multiple bytes to the stream failed,
679 	- DK4_E_FLUSH_FAILED<br>
680 	  if flushing data downwards failed.
681 */
682 void
683 dk4pppt_clip(
684 	dk4_pppt_t	*pppt,
685 	int			*backptr,
686 	dk4_er_t	*erp
687 );
688 
689 /**	Set line width to draw fill patterns.
690 	The pattern line width should be in range 0 to 2bp,
691 	default is 0.9bp.
692 	@param	pppt	Output structure.
693 	@param	plw		New pattern line width in bp.
694 */
695 void
696 dk4pppt_set_pattern_line_width(
697 	dk4_pppt_t	*pppt,
698 	double		 plw
699 );
700 
701 /**	Pattern a region (clipping should be set to the path).
702 	@param	pppt	Output structure.
703 	@param	xl		Left y coordinate.
704 	@param	xr		Right x coordinate.
705 	@param	yb		Bottom y coordinate.
706 	@param	yt		Top y coordinate.
707 	@param	pn		Pattern number.
708 	@param	backptr	Address of success variable to reset on errors.
709 	@param	erp		Error report, may be NULL.
710 
711 	Error codes:
712 	- DK4_E_INVALID_ARGUMENTS<br>
713 	  if gra is NULL,
714 	- DK4_E_INVALID_ARGUMENTS<br>
715 	  if gra is not in a state allowing this operation,
716 	- DK4_E_MATH_OVERFLOW<br>
717 	  on numeric overflow in memory size calculation,
718 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
719 	  if there is not enough memory available,
720 	- DK4_E_WRITE_FAILED<br>
721 	  if writing one ore multiple bytes to the stream failed,
722 	- DK4_E_FLUSH_FAILED<br>
723 	  if flushing data downwards failed.
724 */
725 void
726 dk4pppt_pattern(
727 	dk4_pppt_t			*pppt,
728 	double				 xl,
729 	double				 xr,
730 	double				 yb,
731 	double				 yt,
732 	dk4_gra_pattern_t	 pn,
733 	int					*backptr,
734 	dk4_er_t			*erp
735 );
736 
737 /**	Start a new path and move to first point.
738 	@param	pppt	Output structure.
739 	@param	x		X coordinate of start point.
740 	@param	y		Y coordinate of start point.
741 	@param	bbptr	Bounding box, may be NULL.
742 	@param	backptr	Address of success variable to reset on errors.
743 	@param	erp		Error report, may be NULL.
744 
745 	Error codes:
746 	- DK4_E_INVALID_ARGUMENTS<br>
747 	  if gra is NULL,
748 	- DK4_E_INVALID_ARGUMENTS<br>
749 	  if gra is not in a state allowing this operation,
750 	- DK4_E_MATH_OVERFLOW<br>
751 	  on numeric overflow in memory size calculation,
752 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
753 	  if there is not enough memory available,
754 	- DK4_E_WRITE_FAILED<br>
755 	  if writing one ore multiple bytes to the stream failed,
756 	- DK4_E_FLUSH_FAILED<br>
757 	  if flushing data downwards failed.
758 */
759 void
760 dk4pppt_newpath_moveto(
761 	dk4_pppt_t	*pppt,
762 	double		 x,
763 	double		 y,
764 	dk4_bb_t	*bbptr,
765 	int			*backptr,
766 	dk4_er_t	*erp
767 );
768 
769 /**	Add line from current point to new point to path.
770 	@param	pppt	Output structure.
771 	@param	x		X coordinate of new point.
772 	@param	y		Y coordinate of new point.
773 	@param	bbptr	Bounding box, may be NULL.
774 	@param	backptr	Address of success variable to reset on errors.
775 	@param	erp		Error report, may be NULL.
776 
777 	Error codes:
778 	- DK4_E_INVALID_ARGUMENTS<br>
779 	  if gra is NULL,
780 	- DK4_E_INVALID_ARGUMENTS<br>
781 	  if gra is not in a state allowing this operation,
782 	- DK4_E_MATH_OVERFLOW<br>
783 	  on numeric overflow in memory size calculation,
784 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
785 	  if there is not enough memory available,
786 	- DK4_E_WRITE_FAILED<br>
787 	  if writing one ore multiple bytes to the stream failed,
788 	- DK4_E_FLUSH_FAILED<br>
789 	  if flushing data downwards failed.
790 */
791 void
792 dk4pppt_lineto(
793 	dk4_pppt_t	*pppt,
794 	double		 x,
795 	double		 y,
796 	dk4_bb_t	*bbptr,
797 	int			*backptr,
798 	dk4_er_t	*erp
799 );
800 
801 /**	Add Bezier curve segment from current point to new point in path.
802 	@param	pppt	Output structure.
803 	@param	xc1		X coordinate of first control point.
804 	@param	yc1		Y coordinate of first control point.
805 	@param	xc2		X coordinate of second control point.
806 	@param	yc2		Y coordinate of second control point.
807 	@param	x		X coordinate of new point.
808 	@param	y		Y coordinate of new point.
809 	@param	bbptr	Bounding box, may be NULL.
810 	@param	backptr	Address of success variable to reset on errors.
811 	@param	erp		Error report, may be NULL.
812 
813 	Error codes:
814 	- DK4_E_INVALID_ARGUMENTS<br>
815 	  if gra is NULL,
816 	- DK4_E_INVALID_ARGUMENTS<br>
817 	  if gra is not in a state allowing this operation,
818 	- DK4_E_MATH_OVERFLOW<br>
819 	  on numeric overflow in memory size calculation,
820 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
821 	  if there is not enough memory available,
822 	- DK4_E_WRITE_FAILED<br>
823 	  if writing one ore multiple bytes to the stream failed,
824 	- DK4_E_FLUSH_FAILED<br>
825 	  if flushing data downwards failed.
826 */
827 void
828 dk4pppt_curveto(
829 	dk4_pppt_t	*pppt,
830 	double		 xc1,
831 	double		 yc1,
832 	double		 xc2,
833 	double		 yc2,
834 	double		 x,
835 	double		 y,
836 	dk4_bb_t	*bbptr,
837 	int			*backptr,
838 	dk4_er_t	*erp
839 );
840 
841 /**	Close current path.
842 	@param	pppt	Output structure.
843 	@param	backptr	Address of success variable to reset on errors.
844 	@param	erp		Error report, may be NULL.
845 
846 	Error codes:
847 	- DK4_E_INVALID_ARGUMENTS<br>
848 	  if gra is NULL,
849 	- DK4_E_INVALID_ARGUMENTS<br>
850 	  if gra is not in a state allowing this operation,
851 	- DK4_E_MATH_OVERFLOW<br>
852 	  on numeric overflow in memory size calculation,
853 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
854 	  if there is not enough memory available,
855 	- DK4_E_WRITE_FAILED<br>
856 	  if writing one ore multiple bytes to the stream failed,
857 	- DK4_E_FLUSH_FAILED<br>
858 	  if flushing data downwards failed.
859 */
860 void
861 dk4pppt_closepath(
862 	dk4_pppt_t	*pppt,
863 	int			*backptr,
864 	dk4_er_t	*erp
865 );
866 
867 /**	Add bitmap image XFig style.
868 	@param	pppt	Output structure.
869 	@param	xl		Left x coordinate.
870 	@param	xr		Right x coordinate.
871 	@param	yb		Bottom y coordinate.
872 	@param	yt		Top y coordinate.
873 	@param	bif		Bitmap image file.
874 	@param	fn		Image file name.
875 	@param	fno		Frame number (0 for first frame).
876 	@param	pos		Image positioning:
877 	- 0 not rotated, not flipped,
878 	- 1 rotated 90 degree counterclockwise, not flipped,
879 	- 2 rotated 180 degree counterclockwise, not flipped,
880 	- 3 rotated 270 degree counterclockwise, not flipped,
881 	- 4 not rotated, flipped,
882 	- 5 rotated 90 degree counterclockwise, flipped,
883 	- 6 rotated 180 degree counterclockwise, flipped,
884 	- 7 rotated 270 degree counterclockwise, flipped.
885 	@param	ifl		Image flags.
886 	@param	bbptr	Bounding box, may be NULL.
887 	@param	backptr	Address of success variable to reset on errors.
888 	@param	erp		Error report, may be NULL.
889 
890 	Error codes:
891 	- DK4_E_INVALID_ARGUMENTS<br>
892 	  if gra is NULL or bif is NULL or a frame number other than 0
893 	  was specified for PGF output,
894 	- DK4_E_INVALID_ARGUMENTS<br>
895 	  if gra is not in a state allowing this operation,
896 	- DK4_E_MATH_OVERFLOW<br>
897 	  on numeric overflow in memory size calculation,
898 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
899 	  if there is not enough memory available,
900 	- DK4_E_WRITE_FAILED<br>
901 	  if writing one ore multiple bytes to the stream failed,
902 	- DK4_E_FLUSH_FAILED<br>
903 	  if flushing data downwards failed.
904 */
905 void
906 dk4pppt_bif_fig_image(
907 	dk4_pppt_t		*pppt,
908 	double			 xl,
909 	double			 xr,
910 	double			 yb,
911 	double			 yt,
912 	dk4_bif_t		*bif,
913 	const dkChar	*fn,
914 	size_t			 fno,
915 	int				 pos,
916 	int				 ifl,
917 	dk4_bb_t		*bbptr,
918 	int				*backptr,
919 	dk4_er_t		*erp
920 );
921 
922 /**	Add bitmap image.
923 	@param	pppt	Output structure.
924 	@param	xl		Left x coordinate.
925 	@param	xr		Right x coordinate.
926 	@param	yb		Bottom y coordinate.
927 	@param	yt		Top y coordinate.
928 	@param	bif		Bitmap image file data.
929 	@param	fn		Image file name.
930 	@param	fno		Frame number (0 for first frame).
931 	@param	ifl		Image flags.
932 	@param	bbptr	Bounding box, may be NULL.
933 	@param	backptr	Address of success variable to reset on errors.
934 	@param	erp		Error report, may be NULL.
935 
936 	Error codes:
937 	- DK4_E_INVALID_ARGUMENTS<br>
938 	  if gra is NULL or bif is NULL,
939 	- DK4_E_INVALID_ARGUMENTS<br>
940 	  if gra is not in a state allowing this operation,
941 	- DK4_E_MATH_OVERFLOW<br>
942 	  on numeric overflow in memory size calculation,
943 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
944 	  if there is not enough memory available,
945 	- DK4_E_WRITE_FAILED<br>
946 	  if writing one ore multiple bytes to the stream failed,
947 	- DK4_E_FLUSH_FAILED<br>
948 	  if flushing data downwards failed.
949 */
950 void
951 dk4pppt_bif_image(
952 	dk4_pppt_t		*pppt,
953 	double			 xl,
954 	double			 xr,
955 	double			 yb,
956 	double			 yt,
957 	dk4_bif_t		*bif,
958 	const dkChar	*fn,
959 	size_t			 fno,
960 	int				 ifl,
961 	dk4_bb_t		*bbptr,
962 	int				*backptr,
963 	dk4_er_t		*erp
964 );
965 
966 /**	Add bitmap image.
967 	@param	pppt	Output structure.
968 	@param	xl		Left x coordinate.
969 	@param	xr		Right x coordinate.
970 	@param	yb		Bottom y coordinate.
971 	@param	yt		Top y coordinate.
972 	@param	fn		Image file name.
973 	@param	fno		Frame number (0 for first frame).
974 	@param	ctx		Bitmap image conversion context, may be NULL.
975 	@param	ifl		Image flags.
976 	@param	bbptr	Bounding box, may be NULL.
977 	@param	backptr	Address of success variable to reset on errors.
978 	@param	erp		Error report, may be NULL.
979 
980 	Error codes:
981 	- DK4_E_INVALID_ARGUMENTS<br>
982 	  if gra is NULL or bif is NULL,
983 	- DK4_E_INVALID_ARGUMENTS<br>
984 	  if gra is not in a state allowing this operation,
985 	- DK4_E_MATH_OVERFLOW<br>
986 	  on numeric overflow in memory size calculation,
987 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
988 	  if there is not enough memory available,
989 	- DK4_E_WRITE_FAILED<br>
990 	  if writing one ore multiple bytes to the stream failed,
991 	- DK4_E_FLUSH_FAILED<br>
992 	  if flushing data downwards failed.
993 */
994 void
995 dk4pppt_image(
996 	dk4_pppt_t			*pppt,
997 	double				 xl,
998 	double				 xr,
999 	double				 yb,
1000 	double				 yt,
1001 	const dkChar		*fn,
1002 	size_t				 fno,
1003 	dk4_cs_conv_ctx_t	*ctx,
1004 	int					 ifl,
1005 	dk4_bb_t			*bbptr,
1006 	int					*backptr,
1007 	dk4_er_t			*erp
1008 );
1009 
1010 /**	Add bitmap image XFig style.
1011 	@param	pppt	Output structure.
1012 	@param	xl		Left x coordinate.
1013 	@param	xr		Right x coordinate.
1014 	@param	yb		Bottom y coordinate.
1015 	@param	yt		Top y coordinate.
1016 	@param	fn		Image file name.
1017 	@param	fno		Frame number (0 for first frame).
1018 	@param	ctx		Bitmap image conversion context, may be NULL.
1019 	@param	pos		Image positioning:
1020 	- 0 not rotated, not flipped,
1021 	- 1 rotated 90 degree counterclockwise, not flipped,
1022 	- 2 rotated 180 degree counterclockwise, not flipped,
1023 	- 3 rotated 270 degree counterclockwise, not flipped,
1024 	- 4 not rotated, flipped,
1025 	- 5 rotated 90 degree counterclockwise, flipped,
1026 	- 6 rotated 180 degree counterclockwise, flipped,
1027 	- 7 rotated 270 degree counterclockwise, flipped.
1028 	@param	ifl		Image flags.
1029 	@param	bbptr	Bounding box, may be NULL.
1030 	@param	backptr	Address of success variable to reset on errors.
1031 	@param	erp		Error report, may be NULL.
1032 
1033 	Error codes:
1034 	- DK4_E_INVALID_ARGUMENTS<br>
1035 	  if gra is NULL or bif is NULL,
1036 	- DK4_E_INVALID_ARGUMENTS<br>
1037 	  if gra is not in a state allowing this operation,
1038 	- DK4_E_MATH_OVERFLOW<br>
1039 	  on numeric overflow in memory size calculation,
1040 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
1041 	  if there is not enough memory available,
1042 	- DK4_E_WRITE_FAILED<br>
1043 	  if writing one ore multiple bytes to the stream failed,
1044 	- DK4_E_FLUSH_FAILED<br>
1045 	  if flushing data downwards failed.
1046 */
1047 void
1048 dk4pppt_fig_image(
1049 	dk4_pppt_t			*pppt,
1050 	double				 xl,
1051 	double				 xr,
1052 	double				 yb,
1053 	double				 yt,
1054 	const dkChar		*fn,
1055 	size_t				 fno,
1056 	dk4_cs_conv_ctx_t	*ctx,
1057 	int					 pos,
1058 	int					 ifl,
1059 	dk4_bb_t			*bbptr,
1060 	int					*backptr,
1061 	dk4_er_t			*erp
1062 );
1063 
1064 /**	Create path for a circle.
1065 	@param	pppt	Output structure.
1066 	@param	xc		Center point x coordinate.
1067 	@param	yc		Center point y coordinate.
1068 	@param	r		Radius.
1069 	@param	bbptr	Bounding box, may be NULL.
1070 	@param	backptr	Address of success variable to reset on errors.
1071 	@param	erp		Error report, may be NULL.
1072 
1073 	Error codes:
1074 	- DK4_E_INVALID_ARGUMENTS<br>
1075 	  if gra is NULL,
1076 	- DK4_E_INVALID_ARGUMENTS<br>
1077 	  if gra is not in a state allowing this operation,
1078 	- DK4_E_MATH_OVERFLOW<br>
1079 	  on numeric overflow in memory size calculation,
1080 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
1081 	  if there is not enough memory available,
1082 	- DK4_E_WRITE_FAILED<br>
1083 	  if writing one ore multiple bytes to the stream failed,
1084 	- DK4_E_FLUSH_FAILED<br>
1085 	  if flushing data downwards failed.
1086 */
1087 void
1088 dk4pppt_circle(
1089 	dk4_pppt_t	*pppt,
1090 	double		 xc,
1091 	double		 yc,
1092 	double		 r,
1093 	dk4_bb_t	*bbptr,
1094 	int			*backptr,
1095 	dk4_er_t	*erp
1096 );
1097 
1098 /**	Create path for rectangle parallel to axes, optionally with
1099 	rounded corners.
1100 	@param	pppt	Output structure.
1101 	@param	xl		Left x coordinate.
1102 	@param	xr		Right x coordinate.
1103 	@param	yb		Bottom y coordinate.
1104 	@param	yt		Top y coordinate.
1105 	@param	r		Corner radius, maximum is a half of the smaller side length.
1106 					Use negative values to avoid rounded corners.
1107 	@param	bbptr	Bounding box, may be NULL.
1108 	@param	backptr	Address of success variable to reset on errors.
1109 	@param	erp		Error report, may be NULL.
1110 
1111 	Error codes:
1112 	- DK4_E_INVALID_ARGUMENTS<br>
1113 	  if gra is NULL,
1114 	- DK4_E_INVALID_ARGUMENTS<br>
1115 	  if gra is not in a state allowing this operation,
1116 	- DK4_E_MATH_OVERFLOW<br>
1117 	  on numeric overflow in memory size calculation,
1118 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
1119 	  if there is not enough memory available,
1120 	- DK4_E_WRITE_FAILED<br>
1121 	  if writing one ore multiple bytes to the stream failed,
1122 	- DK4_E_FLUSH_FAILED<br>
1123 	  if flushing data downwards failed.
1124 */
1125 void
1126 dk4pppt_rectangle(
1127 	dk4_pppt_t	*pppt,
1128 	double		 xl,
1129 	double		 xr,
1130 	double		 yb,
1131 	double		 yt,
1132 	double		 r,
1133 	dk4_bb_t	*bbptr,
1134 	int			*backptr,
1135 	dk4_er_t	*erp
1136 );
1137 
1138 /**	Add path for an arc.
1139 	@param	pppt	Output structure.
1140 	@param	xc		Center point x coordinate.
1141 	@param	yc		Center point y coordinate.
1142 	@param	ra		Radius.
1143 	@param	start	Start angle in degree.
1144 	@param	end		End angle in degree.
1145 	@param	cl		Flag: Draw closed arc (piece of cake) instead of simple arc.
1146 	@param	bbptr	Bounding box, may be NULL.
1147 	@param	backptr	Address of success variable to reset on errors.
1148 	@param	erp		Error report, may be NULL.
1149 
1150 	Error codes:
1151 	- DK4_E_INVALID_ARGUMENTS<br>
1152 	  if gra is NULL,
1153 	- DK4_E_INVALID_ARGUMENTS<br>
1154 	  if gra is not in a state allowing this operation,
1155 	- DK4_E_MATH_OVERFLOW<br>
1156 	  on numeric overflow in memory size calculation,
1157 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
1158 	  if there is not enough memory available,
1159 	- DK4_E_WRITE_FAILED<br>
1160 	  if writing one ore multiple bytes to the stream failed,
1161 	- DK4_E_FLUSH_FAILED<br>
1162 	  if flushing data downwards failed.
1163 */
1164 void
1165 dk4pppt_arc(
1166 	dk4_pppt_t	*pppt,
1167 	double		 xc,
1168 	double		 yc,
1169 	double		 ra,
1170 	double		 start,
1171 	double		 end,
1172 	int			 cl,
1173 	dk4_bb_t	*bbptr,
1174 	int			*backptr,
1175 	dk4_er_t	*erp
1176 );
1177 
1178 /**	Create path for an ellipse.
1179 	@param	pppt	Output structure.
1180 	@param	xc		Center point x coordinate.
1181 	@param	yc		Center point y coordinate.
1182 	@param	rx		Radius in x direction.
1183 	@param	ry		Radius in y direction.
1184 	@param	rot		Rotation counterclockwise in degree.
1185 	@param	bbptr	Bounding box, may be NULL.
1186 	@param	backptr	Address of success variable to reset on errors.
1187 	@param	erp		Error report, may be NULL.
1188 
1189 	Error codes:
1190 	- DK4_E_INVALID_ARGUMENTS<br>
1191 	  if gra is NULL,
1192 	- DK4_E_INVALID_ARGUMENTS<br>
1193 	  if gra is not in a state allowing this operation,
1194 	- DK4_E_MATH_OVERFLOW<br>
1195 	  on numeric overflow in memory size calculation,
1196 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
1197 	  if there is not enough memory available,
1198 	- DK4_E_WRITE_FAILED<br>
1199 	  if writing one ore multiple bytes to the stream failed,
1200 	- DK4_E_FLUSH_FAILED<br>
1201 	  if flushing data downwards failed.
1202 */
1203 void
1204 dk4pppt_ellipse(
1205 	dk4_pppt_t	*pppt,
1206 	double		 xc,
1207 	double		 yc,
1208 	double		 rx,
1209 	double		 ry,
1210 	double		 rot,
1211 	dk4_bb_t	*bbptr,
1212 	int			*backptr,
1213 	dk4_er_t	*erp
1214 );
1215 
1216 /**	Add simple (non-special) text to PGF graphics.
1217 	The text is shown in the current fill color (non-stroking color)
1218 	unless colspec is used to specify a color.
1219 	@param	pppt	Output structure, must be initialized for PGF.
1220 	@param	x		X coordinate.
1221 	@param	y		Y coordinate.
1222 	@param	rot		Rotation counterclockwise in degree.
1223 	@param	txt		Text to show.
1224 	@param	colspec	Color specification, may be NULL to use fill color.
1225 	@param	ie		Text encoding, only used for char text.
1226 	@param	ha		Horizontal alignment.
1227 	@param	va		Vertical alignment.
1228 	@param	fno		Font number.
1229 	@param	fsz		Font size in pt.
1230 	@param	fex		Flag: Use exact font (1) or similar font (0).
1231 	@param	uc2l	UC to LaTeX conversion structure.
1232 	@param	flags	Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
1233 	@param	backptr	Address of success variable to reset on errors.
1234 	@param	erp		Error report, may be NULL.
1235 
1236 	Error codes:
1237 	- DK4_E_INVALID_ARGUMENTS<br>
1238 	  if gra is NULL,
1239 	- DK4_E_INVALID_ARGUMENTS<br>
1240 	  if gra is not in a state allowing this operation,
1241 	- DK4_E_MATH_OVERFLOW<br>
1242 	  on numeric overflow in memory size calculation,
1243 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
1244 	  if there is not enough memory available,
1245 	- DK4_E_WRITE_FAILED<br>
1246 	  if writing one ore multiple bytes to the stream failed,
1247 	- DK4_E_FLUSH_FAILED<br>
1248 	  if flushing data downwards failed.
1249 */
1250 void
1251 dk4pppt_simple_text(
1252 	dk4_pppt_t			*pppt,
1253 	double				 x,
1254 	double				 y,
1255 	double				 rot,
1256 	const dkChar		*txt,
1257 	const char			*colspec,
1258 	int					 ie,
1259 	dk4_text_align_h_t	 ha,
1260 	dk4_text_align_v_t	 va,
1261 	int					 fno,
1262 	double				 fsz,
1263 	dk4_gra_tf_t		 fex,
1264 	dk4_uc2l_t			*uc2l,
1265 	int					 flags,
1266 	int					*backptr,
1267 	dk4_er_t			*erp
1268 );
1269 
1270 
1271 /**	Add simple (non-special) text to PGF graphics.
1272 	The text is shown in the current fill color (non-stroking color)
1273 	unless colspec is used to specify a color.
1274 	@param	pppt	Output structure, must be initialized for PGF.
1275 	@param	x		X coordinate.
1276 	@param	y		Y coordinate.
1277 	@param	rot		Rotation counterclockwise in degree.
1278 	@param	txt		Text to show.
1279 	@param	colspec	Color specification, may be NULL to use fill color.
1280 	@param	ha		Horizontal alignment.
1281 	@param	va		Vertical alignment.
1282 	@param	fno		Font number.
1283 	@param	fsz		Font size in pt.
1284 	@param	fex		Flag: Use exact font (1) or similar font (0).
1285 	@param	uc2l	UC to LaTeX conversion structure.
1286 	@param	flags	Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
1287 	@param	backptr	Address of success variable to reset on errors.
1288 	@param	erp		Error report, may be NULL.
1289 
1290 	Error codes:
1291 	- DK4_E_INVALID_ARGUMENTS<br>
1292 	  if gra is NULL,
1293 	- DK4_E_INVALID_ARGUMENTS<br>
1294 	  if gra is not in a state allowing this operation,
1295 	- DK4_E_MATH_OVERFLOW<br>
1296 	  on numeric overflow in memory size calculation,
1297 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
1298 	  if there is not enough memory available,
1299 	- DK4_E_WRITE_FAILED<br>
1300 	  if writing one ore multiple bytes to the stream failed,
1301 	- DK4_E_FLUSH_FAILED<br>
1302 	  if flushing data downwards failed.
1303 */
1304 void
1305 dk4pppt_simple_utf8_text(
1306 	dk4_pppt_t			*pppt,
1307 	double				 x,
1308 	double				 y,
1309 	double				 rot,
1310 	const char			*txt,
1311 	const char			*colspec,
1312 	dk4_text_align_h_t	 ha,
1313 	dk4_text_align_v_t	 va,
1314 	int					 fno,
1315 	double				 fsz,
1316 	dk4_gra_tf_t		 fex,
1317 	dk4_uc2l_t			*uc2l,
1318 	int					 flags,
1319 	int					*backptr,
1320 	dk4_er_t			*erp
1321 );
1322 
1323 
1324 /**	Add special text to PGF graphics.
1325 	The text is shown in the current fill color (non-stroking color)
1326 	unless colspec is used to specify a color.
1327 	@param	pppt	Output structure, must be initialized for PGF.
1328 	@param	x		X coordinate.
1329 	@param	y		Y coordinate.
1330 	@param	rot		Rotation counterclockwise in degree.
1331 	@param	txt		Text to show.
1332 	@param	colspec	Color specification, may be NULL to use fill color.
1333 	@param	ha		Horizontal alignment.
1334 	@param	va		Vertical alignment.
1335 	@param	fno		Font number.
1336 	@param	fsz		Font size in pt.
1337 	@param	fex		Flag: Use exact font.
1338 	@param	flags	Text flags DK4_GRA_TEXT_FLAG_xxx, can be or-combined.
1339 	@param	backptr	Address of success variable to reset on errors.
1340 	@param	erp		Error report, may be NULL.
1341 
1342 	Error codes:
1343 	- DK4_E_INVALID_ARGUMENTS<br>
1344 	  if gra is NULL,
1345 	- DK4_E_INVALID_ARGUMENTS<br>
1346 	  if gra is not in a state allowing this operation,
1347 	- DK4_E_MATH_OVERFLOW<br>
1348 	  on numeric overflow in memory size calculation,
1349 	- DK4_E_MEMORY_ALLOCATION_FAILED<br>
1350 	  if there is not enough memory available,
1351 	- DK4_E_WRITE_FAILED<br>
1352 	  if writing one ore multiple bytes to the stream failed,
1353 	- DK4_E_FLUSH_FAILED<br>
1354 	  if flushing data downwards failed.
1355 */
1356 void
1357 dk4pppt_special_text(
1358 	dk4_pppt_t			*pppt,
1359 	double				 x,
1360 	double				 y,
1361 	double				 rot,
1362 	const char			*txt,
1363 	const char			*colspec,
1364 	dk4_text_align_h_t	 ha,
1365 	dk4_text_align_v_t	 va,
1366 	int					 fno,
1367 	double				 fsz,
1368 	dk4_gra_tf_t		 fex,
1369 	int					 flags,
1370 	int					*backptr,
1371 	dk4_er_t			*erp
1372 );
1373 
1374 
1375 /**	Set flag for even-odd-rule.
1376 	If this flag is on, the even-odd-rule is used for filling and
1377 	clipping. Otherwise the nonzero-winding rule is used.
1378 	By default this flag is turned on when creating a dk4_gra_t structure.
1379 	@param	pppt	Output structure.
1380 	@param	val		New flag value.
1381 */
1382 void
1383 dk4pppt_set_eorule(
1384 	dk4_pppt_t	*pppt,
1385 	int			 val
1386 );
1387 
1388 
1389 /**	Set document font size.
1390 	@param	pppt	Output structure.
1391 	@param	fs		New font size.
1392 	@param	backptr	Address of success variable to reset on error.
1393 	@param	erp		Error report, may be NULL.
1394 */
1395 
1396 void
1397 dk4pppt_doc_font_size(
1398 	dk4_pppt_t	*pppt,
1399 	double		 fs,
1400 	int			*backptr,
1401 	dk4_er_t	*erp
1402 );
1403 
1404 
1405 /**	Add one preamble line.
1406 	@param	pppt	Output structure.
1407 	@param	line	Line to add without trailing newline.
1408 	@param	tp		Preamble line type.
1409 	@param	backptr	Address of success variable to reset on error.
1410 	@param	erp		Error report, may be NULL.
1411 */
1412 
1413 void
1414 dk4pppt_doc_preamble_line(
1415 	dk4_pppt_t	*pppt,
1416 	const char	*line,
1417 	int			 tp,
1418 	int			*backptr,
1419 	dk4_er_t	*erp
1420 );
1421 
1422 
1423 
1424 #ifdef	__cplusplus
1425 }
1426 #endif
1427 
1428 
1429 /* vim: set ai sw=4 ts=4 : */
1430 
1431 
1432 #endif
1433