1 /*
2 Copyright (C) 2012-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: fig2lat.ctr
12 */
13 
14 /**	@file fig2lat.h Header file for the fig2lat module.
15 */
16 
17 #ifndef FIG2LAT_H_INCLUDED
18 /** Avoid multiple inclusions. */
19 #define FIG2LAT_H_INCLUDED 1
20 
21 
22 #include <libdk3fig/dk3fig.h>
23 #include <libdk3fig/dk3figrd.h>
24 #include <libdk3fig/dk3figpr.h>
25 
26 
27 /**	To draw a quadrant of a circle we do not use 1/3 of the
28 	derivative, we use another factor instead.
29 */
30 #define	FIG2LAT_CIRCLE_QUADRANT_BEZIER	0.5522847498307932
31 
32 
33 
34 /**	Conversion configuration.
35 */
36 typedef struct {
37   double	nts;	/**< Normal text size (scale factor or -1.0). */
38   int		ntf;	/**< Normal text font (0=similar, 1=fig). */
39 } fig2lat_config_t;
40 
41 
42 
43 /**	How to handle a text.
44 */
45 typedef struct {
46   double	fontSize;	/**< Font size in pt. */
47   unsigned long	fontNumber;	/**< Unique font number for LaTeX output. */
48   int		psFontNo;	/**< PS font number. */
49 } f2l_text_handling_t;
50 
51 
52 
53 /**	Image structure.
54 */
55 typedef struct {
56   dk3_ufi_t	 	 ufi;		/**< Unique file identifier image. */
57   char const		*filename;	/**< Image file name. */
58   dk3_pdf_xobject_t	*xo;		/**< PDF X object. */
59   dk3_bif_coord_t	 width;		/**< Image width. */
60   dk3_bif_coord_t	 height;	/**< Image height. */
61   double		 xres;		/**< X resolution. */
62   double		 yres;		/**< Y resolution. */
63   unsigned long		 imageNumber;	/**< Unique number of image. */
64   unsigned long		 lineno;	/**< Line number of object. */
65 } f2l_image_t;
66 
67 
68 
69 /**	Fig2lat job structure.
70 */
71 typedef struct {
72   /*	@DRIVER@
73   	You can add driver-specific configuration compomenents here.
74 	For alignment reasons the order of elements is in decreasing
75 	type size.
76 	Remember to re-compile all modules after changing data types.
77 	Initialize the new components in fig2lat_job_init(),
78 	release allocated resources in fig2lat_job_end().
79   */
80   dk3_graphics_state_t	 gs;		/**< Graphics state. */
81   dk3_ct_2d_t		 ct2d;		/**< Coordinates transformation data. */
82   dk3_fig_drawing_t	*drw;		/**< Fig drawing to convert. */
83   dk3_app_t		*app;		/**< Application structure. */
84   dk3_option_set_t	*opt;		/**< Options and cmd arguments. */
85   FILE			*of1;		/**< Output file 1. */
86   FILE			*of2;		/**< Output file 2. */
87   dkChar const		*on1;		/**< Output file name 1. */
88   dkChar const		*on2;		/**< Output file name 2. */
89   dkChar const * const	*msg;		/**< Localized text messages. */
90   dkChar const * const	*figmsg;	/**< Localized messages dk3fig mod. */
91   double		 width;		/**< Width (typically in bp). */
92   double		 height;	/**< Height (typically in bp). */
93   double		 w2;		/**< Secondary width information. */
94   double		 h2;		/**< Secondary height information. */
95   double		 nts;		/**< Normal text size. */
96   double		 tts;		/**< TeX text size. */
97   double		 arcspp;	/**< Spline points per arc. */
98   double		 splspp;	/**< Spline points per interval. */
99   double		 xsprec;	/**< Iteration precision. */
100   double		 lwbp;		/**< Line width in bp. */
101   long			 lwidth;	/**< Width in bp. */
102   long			 lheight;	/**< Height in bp. */
103   size_t		 xssbs;		/**< X-spline segement Bezier segs. */
104   size_t		 minspp;	/**< Minimum spline points. */
105   size_t		 qbs;		/**< Quadrant Bezier segments. */
106   size_t		 codi;		/**< Color digits. */
107   int			 ntf;		/**< Text font (0=similar, 1=fig). */
108   int			 dr;		/**< Driver, see @ref fig2latdrivers. */
109   int			 exval;		/**< Exit, see @ref fig2latexitcodes. */
110   int			 mm;		/**< Flag: Make mode. */
111   int			 cmd;		/**< Command to execute. */
112   int			 cosp;		/**< Flag: Spline compatibility. */
113   int			 coah;		/**< Flag: Arrowhead compatibility. */
114   int			 xsah;		/**< Flag: X-spline arrowhead. */
115   int			 debug;		/**< Flag: Write debug information. */
116   int			 showpage;	/**< Flag: Write showpage operator. */
117   int			 pslevel;	/**< PS language level. */
118   int			 dsc;		/**< Flag: Write PS DSC. */
119   int			 srctype;	/**< Source file type. */
120   int			 smash;		/**< Flag: Use smash instruction. */
121   int			 mbox;		/**< Flag: Use mbox instruction. */
122   int			 resfont;	/**< Flag: Use reset@font. */
123   int			 css;		/**< Flag: CSS-styled SVG. */
124   int			 fragment;	/**< Flag: Write SVG fragment only. */
125   int			 svgfontbase;	/**< SVG font base: 0=none, 1=local, 2=web. */
126   int			 group;		/**< Flag: Group SVG object with ahs. */
127   int			 miterlim;	/**< Flag: Write miterlimit. */
128   int			 cols;		/**< Flag: Compatible line styles. */
129   int			 otherfonts;	/**< Flag: Use additional fonts SVG. */
130   int			 bbts;		/**< Flag: Use text size for bb. */
131   int			 stu8;		/**< Flag: Special text uses UTF-8. */
132   int			 cofop;		/**< Flag: Compat fill open paths. */
133   int			 lwauto;	/**< Flag: Automatic line width. */
134   int			 ahbs;		/**< Flag: Bisection for arrowheads. */
135 } f2l_job_t;
136 
137 
138 
139 /**	@defgroup	fig2latexitcodes	Exit codes for fig2lat.
140 */
141 /**@{*/
142 
143 /**	Program succeeded.
144 */
145 #define	FIG2LAT_EXIT_SUCCESS		0
146 
147 /**	Error occured, no detailed description.
148 */
149 #define	FIG2LAT_EXIT_ERROR_UNKNOWN	1
150 
151 /**	Error, no file found to convert.
152 */
153 #define FIG2LAT_EXIT_ERROR_NO_SUCH_FILE	2
154 
155 /**	File name is too long for processing.
156 */
157 #define	FIG2LAT_EXIT_FILENAME_TOO_LONG	3
158 
159 /**	Resources problem or system error.
160 */
161 #define	FIG2LAT_EXIT_ERROR_SYSTEM	4
162 
163 /**	Mathematical error.
164 */
165 #define	FIG2LAT_EXIT_ERROR_MATH		5
166 
167 /**	Syntax error in input file.
168 */
169 #define	FIG2LAT_EXIT_ERROR_SYNTAX	6
170 /**@}*/
171 
172 
173 
174 /**	@defgroup	fig2latdrivers		Fig2lat output drivers.
175 */
176 
177 /**@{*/
178 
179 /**	Produce PGF output file (default driver).
180 */
181 #define	FIG2LAT_DRIVER_PGF		0
182 
183 /**	Produce full *.tex file, image as embedded PGF.
184 */
185 #define	FIG2LAT_DRIVER_TEX_FULL_PGF	1
186 
187 /**	Produce full *.tex file, image as included external PDF.
188 */
189 #define	FIG2LAT_DRIVER_TEX_FULL_PDF	2
190 
191 /**	Produce *.tex file including an external EPS.
192 */
193 #define	FIG2LAT_DRIVER_EPS_WITH_TEX	3
194 
195 /**	Produce *.tex file including an external PDF.
196 */
197 #define	FIG2LAT_DRIVER_PDF_WITH_TEX	4
198 
199 /**	Produce standalone EPS file.
200 */
201 #define	FIG2LAT_DRIVER_EPS_STANDALONE	5
202 
203 /**	Produce standalone SVG file.
204 */
205 #define	FIG2LAT_DRIVER_SVG_STANDALONE	6
206 
207 /*	@DRIVER@
208 	Add new driver numbers above this comment.
209 	The driver numbers must correspond to the order of
210 	driver names in f2lopt.ctr in the f2lopt_language_names array.
211 */
212 
213 /**@}*/
214 
215 
216 
217 #include <fig2lat/f2lopt.h>
218 #include <fig2lat/f2lto.h>
219 
220 
221 #endif
222