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