View | Details | Raw Unified | Return to bug 14496
Collapse All | Expand All

(-)transfig.3.2.3d.orig/doc/fig2dev.1 (-2 / +2 lines)
Lines 42-48 Link Here
42
.LP
42
.LP
43
Xfig version 3.2.3 and later saves and allows the user to edit comments
43
Xfig version 3.2.3 and later saves and allows the user to edit comments
44
for each Fig object.  These comments are output with several of the output languages,
44
for each Fig object.  These comments are output with several of the output languages,
45
such as PostScript, CGM, LaTeX, MetaFont, PicTeX, (as % comments),
45
such as PostScript, CGM, SML, LaTeX, MetaFont, PicTeX, (as % comments),
46
tk (as # comments), and pic (as .\\" comments).
46
tk (as # comments), and pic (as .\\" comments).
47
47
48
.SH GENERAL OPTIONS
48
.SH GENERAL OPTIONS
Lines 52-58 Link Here
52
Valid languages are
52
Valid languages are
53
\fBbox, cgm, epic, eepic, eepicemu, eps, gif, ibmgl, jpeg,
53
\fBbox, cgm, epic, eepic, eepicemu, eps, gif, ibmgl, jpeg,
54
latex, map (HTML image map), mf (MetaFont), mp (MetaPost), mmp (MultiMetaPost), 
54
latex, map (HTML image map), mf (MetaFont), mp (MetaPost), mmp (MultiMetaPost), 
55
pcx, pdf, pic, pictex, png, ppm, ps,
55
pcx, pdf, pic, pictex, png, ppm, ps, sml, sxd,
56
pstex, pstex_t, sld (AutoCad slide format), textyl, \fR
56
pstex, pstex_t, sld (AutoCad slide format), textyl, \fR
57
tiff, tk (tcl/tk), tpic, xbm and
57
tiff, tk (tcl/tk), tpic, xbm and
58
.B xpm.
58
.B xpm.
(-)transfig.3.2.3d.orig/fig2dev/Imakefile (+1 lines)
Lines 290-295 Link Here
290
InstallScript(fig2ps2tex,$(BINDIR))
290
InstallScript(fig2ps2tex,$(BINDIR))
291
InstallScript(fig2ps2tex.sh,$(BINDIR))
291
InstallScript(fig2ps2tex.sh,$(BINDIR))
292
InstallScript(pic2tpic,$(BINDIR))
292
InstallScript(pic2tpic,$(BINDIR))
293
InstallScript(fig2sxd,$(BINDIR))
293
294
294
InstallManPage(fig2ps2tex,$(MANDIR))
295
InstallManPage(fig2ps2tex,$(MANDIR))
295
InstallManPage(pic2tpic,$(MANDIR))
296
InstallManPage(pic2tpic,$(MANDIR))
(-)transfig.3.2.3d.orig/fig2dev/Makefile.noimake (+5 lines)
Lines 720-725 Link Here
720
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
720
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
721
	$(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) pic2tpic.script $(DESTDIR)$(BINDIR)/pic2tpic
721
	$(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) pic2tpic.script $(DESTDIR)$(BINDIR)/pic2tpic
722
722
723
install:: fig2sxd.sh
724
	@if [ -d $(DESTDIR)$(BINDIR) ]; then set +x; \
725
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(BINDIR)); fi
726
	$(INSTALL) $(INSTALLFLAGS) $(INSTBINFLAGS) fig2sxd.sh $(DESTDIR)$(BINDIR)/fig2sxd.sh
727
723
install.man:: fig2ps2tex.man
728
install.man:: fig2ps2tex.man
724
	@if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
729
	@if [ -d $(DESTDIR)$(MANDIR) ]; then set +x; \
725
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
730
	else (set -x; $(MKDIRHIER) $(DESTDIR)$(MANDIR)); fi
(-)transfig.3.2.3d.orig/fig2dev/dev/Imakefile (-2 / +2 lines)
Lines 38-49 Link Here
38
READJPGO=readjpg.o
38
READJPGO=readjpg.o
39
#endif
39
#endif
40
40
41
SRCS =  genbox.c gencgm.c genepic.c genibmgl.c genlatex.c genmap.c genmf.c genpic.c \
41
SRCS =  genbox.c gencgm.c genepic.c genibmgl.c genlatex.c gensml.c gensxd.c genmap.c genmf.c genpic.c \
42
	genpictex.c genps.c genpdf.c genpstex.c gentextyl.c gentk.c gentpic.c \
42
	genpictex.c genps.c genpdf.c genpstex.c gentextyl.c gentk.c gentpic.c \
43
	genbitmaps.c genge.c genmp.c setfigfont.c psencode.c \
43
	genbitmaps.c genge.c genmp.c setfigfont.c psencode.c \
44
	readpics.c readeps.c readgif.c readpcx.c readppm.c \
44
	readpics.c readeps.c readgif.c readpcx.c readppm.c \
45
	readxbm.c readtif.c $(READPNGS) $(READJPGS) $(READXPMS)
45
	readxbm.c readtif.c $(READPNGS) $(READJPGS) $(READXPMS)
46
LIBOBJS = genbox.o gencgm.o genepic.o genibmgl.o genlatex.o genmap.o genmf.o genpic.o \
46
LIBOBJS = genbox.o gencgm.o genepic.o genibmgl.o genlatex.o gensml.o gensxd.o genmap.o genmf.o genpic.o \
47
	genpictex.o genps.o genpdf.o genpstex.o gentextyl.o gentk.o gentpic.o \
47
	genpictex.o genps.o genpdf.o genpstex.o gentextyl.o gentk.o gentpic.o \
48
	genbitmaps.o genge.o genmp.o setfigfont.o psencode.o \
48
	genbitmaps.o genge.o genmp.o setfigfont.o psencode.o \
49
	readpics.o readeps.o readgif.o readpcx.o readppm.o \
49
	readpics.o readeps.o readgif.o readpcx.o readppm.o \
(-)transfig.3.2.3d.orig/fig2dev/dev/genps.c (-2 / +2 lines)
Lines 225-234 Link Here
225
			{"TIFF", "MM\000*",	    4, read_tif,	False},
225
			{"TIFF", "MM\000*",	    4, read_tif,	False},
226
			{"XBM", "#define",	    7, read_xbm,	True},
226
			{"XBM", "#define",	    7, read_xbm,	True},
227
#ifdef USE_PNG
227
#ifdef USE_PNG
228
			{"PNG", "\211\120\116\107\015\012\032\012", 8, read_png, True},
228
//			{"PNG", "\211\120\116\107\015\012\032\012", 8, read_png, True},
229
#endif
229
#endif
230
#ifdef USE_JPEG
230
#ifdef USE_JPEG
231
			{"JPEG", "\377\330\377\340", 4, read_jpg,	True},
231
//			{"JPEG", "\377\330\377\340", 4, read_jpg,	True},
232
#endif
232
#endif
233
#ifdef USE_XPM
233
#ifdef USE_XPM
234
			{"XPM", "/* XPM */",	    9, read_xpm,	False},
234
			{"XPM", "/* XPM */",	    9, read_xpm,	False},
(-)transfig.3.2.3d.orig/fig2dev/dev/gensml.c (+864 lines)
Line 0 Link Here
1
2
3
/*
4
 * TransFig: Facility for Translating Fig code
5
 * Copyright (c) 1991 by Micah Beck
6
 * Parts Copyright (c) 1985-1988 by Supoj Sutanthavibul
7
 * Parts Copyright (c) 1989-1999 by Brian V. Smith
8
 *
9
 * Any party obtaining a copy of these files is granted, free of charge, a
10
 * full and unrestricted irrevocable, world-wide, paid up, royalty-free,
11
 * nonexclusive right and license to deal in this software and
12
 * documentation files (the "Software"), including without limitation the
13
 * rights to use, copy, modify, merge, publish, distribute, sublicense,
14
 * and/or sell copies of the Software, and to permit persons who receive
15
 * copies from any such party to do so, with the only requirement being
16
 * that this copyright notice remain intact.
17
 *
18
 */
19
20
/*
21
 *	gensml.c : Kivio Stencil driver for fig2dev
22
 *
23
 *	Author: Peter Korf
24
 *      Code stolen from genlatex.c
25
 *
26
 */
27
#if defined(hpux) || defined(SYSV) || defined(SVR4)
28
#include <sys/types.h>
29
#endif
30
#include <sys/file.h>
31
#include "fig2dev.h"
32
#include "object.h"
33
#include "texfonts.h"
34
35
extern double rad2deg;
36
extern void unpsfont();
37
38
//static put_box();
39
//static put_arc_box();
40
//static single_line();
41
//static start_line();
42
void end_line();
43
void setcolor(int,int);
44
45
46
//static put_solidline();
47
//static put_dashline();
48
//static put_dotline();
49
//static put_quarter();
50
51
#define rint(a) floor((a)+0.5)     /* close enough? */
52
53
#define DESC_NAME	"unknown"
54
extern char            *from;
55
56
#define	SWAP(x,y)	{tmp=x; x=y; y=tmp;}
57
//#define TRANS(x,y)		(*translate_coordinates)(&x,&y)
58
//#define TRANS2(x1,y1,x2,y2)	(*translate_coordinates)(&x1,&y1); \
59
//				(*translate_coordinates)(&x2,&y2)
60
//#define TRANSD(x,y)		(*translate_coordinates_d)(&x,&y)
61
#define TRANS(x,y)		translate1(&x,&y)
62
#define TRANS2(x1,y1,x2,y2)	translate1(&x1,&y1);translate1(&x2,&y2);
63
64
#ifndef MIN
65
#define	MIN(x,y)	(((x) <= (y))? (x): (y))
66
#endif
67
#ifndef MAX
68
#define	MAX(x,y)	(((x) >= (y))? (x): (y))
69
#endif
70
#define	ABS(x)		(((x) >= 0)? (x): -(x))
71
#define round4(x)	((round(10000.0*(x))/10000.0))
72
#define round6(x)	((round(1000000.0*(x))/1000000.0))
73
#define MAXCIRCLEDIA	80
74
#define MAXCIRCLERAD	((MAXCIRCLEDIA-0.5)/(2*72.27))
75
76
77
#define SCALEFAKTOR	300
78
79
static char			desc_name[]  = DESC_NAME;
80
static float			offsetx,offsety,scale=1;
81
static int			counter=0;
82
83
static unsigned int rgbColorVal(int colorIndex);
84
// static unsigned int setStyle(F_compound	*objects;);
85
86
87
static	int	verbose;//  = 0;
88
extern double		dash_mag;//  = 1.0;
89
extern int		thick_width;//  = 2;
90
extern double		tolerance;//  = 2.0;
91
extern double		arc_tolerance;//  = 1.0;
92
extern int		(*translate_coordinates)();//  = NULL;
93
extern int		(*translate_coordinates_d)();//  = NULL;
94
extern double		unitlength;
95
static int	cur_thickness;// 1;
96
extern double		ldot_diameter;// .0/72.0;
97
extern char		*dot_cmd;// =tindot;
98
extern char		*ldot_cmd;// =hin_ldot;
99
extern double		dot_xoffset;
100
extern double		dot_yoffset;
101
extern double		ldot_xoffset;
102
extern double		ldot_yoffset;
103
104
105
static
106
translate1(xp, yp)
107
float	*xp, *yp;
108
{
109
if (verbose) fprintf(tfp, "<!-- translate1 %.3f %.3f %.3f-->\n",*xp,offsetx,scale);
110
	*xp = (float)(*xp-offsetx)/scale;
111
	*yp = (float)(*yp-offsety)/scale;
112
113
//*xp = *xp + 1;
114
//*yp = *yp + 1;
115
	}
116
117
static
118
translate2(xp, yp)
119
float	*xp, *yp;
120
{
121
if (verbose) fprintf(tfp, "<!-- translate2 -->\n");
122
123
//	*xp /= (double)120;
124
//	*yp /= (double)120;
125
	*xp = (*xp-offsetx)/scale;
126
	*yp = (*yp-offsety)/scale;
127
//	*xp = *xp + 1;
128
//	*yp = (double)(TOP - *yp -1);
129
	}
130
131
static translate1_d(xp, yp)
132
float	*xp, *yp;
133
{
134
if (verbose) fprintf(tfp, "<!-- translate1_d -->\n");
135
//	*xp /= (double)120;
136
//	*yp /= (double)120;
137
	*xp = (*xp-offsetx)/scale;
138
	*yp = (*yp-offsety)/scale;
139
//	*xp = *xp + 1.0;
140
//	*yp = *yp + 1.0;
141
	}
142
static
143
translate2_d(xp, yp)
144
float	*xp, *yp;
145
{
146
if (verbose) fprintf(tfp, "<!-- translate2_d -->\n");
147
//	*xp /= (double)120;
148
//	*yp /= (double)120;
149
	*xp = (*xp-offsetx)/scale;
150
	*yp = (*yp-offsety)/scale;
151
//	*xp = *xp + 1.0;
152
//	*yp = (double)TOP - *yp -1.0;
153
	}
154
155
void
156
gensml_option(opt, optarg)
157
  char opt, *optarg;
158
{
159
    int i;
160
161
    switch (opt) {
162
	case 'a':
163
	    fprintf(stderr, "warning: latex option -a obsolete");
164
	    break;
165
166
	case 'd':
167
	    dash_mag = atof(optarg);	/* set dash magnification */
168
	    break;
169
170
	    dash_mag = atof(optarg);	/* set dash magnification */
171
	    break;
172
173
174
	case 'f':		/* set default text font */
175
	    for ( i = 1; i <= MAX_FONT; i++ )
176
		if ( !strcmp(optarg, texfontnames[i]) ) break;
177
178
	    if ( i > MAX_FONT)
179
			{
180
			  fprintf(stderr,
181
						 "warning: non-standard font name %s ignored\n", optarg);
182
			}
183
		 else
184
			{
185
			  texfontnames[0] = texfontnames[i];
186
#ifdef NFSS
187
			  texfontfamily[0] = texfontfamily[i];
188
			  texfontseries[0] = texfontseries[i];
189
			  texfontshape[0] = texfontshape[i];
190
#endif
191
			}
192
	    break;
193
194
	case 'l':		/* set thin/thick line threshold */
195
	    thick_width = atoi(optarg);
196
	    break;
197
198
	case 'v':
199
	    verbose = 1;		/* verbose mode */
200
	    break;
201
202
	case 'n':
203
	    sprintf(desc_name,"%s",optarg);		/* description name (library) */
204
	    break;
205
206
	case 's':
207
	case 'm':
208
	case 'L':
209
	    break;
210
211
	    break;
212
213
	default:
214
	    put_msg(Err_badarg, opt, "latex");
215
	    exit(1);
216
	}
217
}
218
219
void
220
gensml_start(objects)
221
  F_compound	*objects;
222
{
223
	int tmp;
224
	char name1[40]="  ";
225
	float x1,y1,x2,y2;
226
	strncpy((char *)name1,from,strlen(from)-4);
227
228
//	strncpy((char *)name1,(char *)name1,strlen(name1)-4);
229
//	memcpy(rindex((const char*)from,'.'),'\0',1);
230
//	name[strlen((const char*)from)]='\0';
231
	/* print any whole-figure comments prefixed with "%" */
232
    fprintf(tfp, "<?xml version=\"1.0\"?>\n");
233
234
//	if (objects->comments) {
235
//	    print_comments("<!-- ",objects->comments, "-->");
236
//	}
237
238
//    fprintf(tfp, "<!-- do not edit ! generated with: fig2dev -L sml %s --->\n",from);
239
    fprintf(tfp, "<KivioShapeStencil creator=\"fig2dev\">\n" );
240
    fprintf(tfp, "<KivioSMLStencilSpawnerInfo>\n" );
241
    fprintf(tfp, "<Author data=\"see README files\"/>\n" );
242
243
//    print_comments("<Title data=\"  ",objects->comments, "\"/>");
244
    fprintf(tfp, "<Id data=\"%s\"/>\n",name1);
245
 if (objects->comments) {
246
	    print_comments("<Description data=\"  ",objects->comments, "\"/>");
247
	    print_comments("<Title data=\"  ",objects->comments, "\"/>");
248
  } else
249
  {
250
    fprintf(tfp, "<Description data=\"%s\"/>\n",name1);
251
    fprintf(tfp, "<Title data=\"%s\"/>\n",name1);
252
  }
253
    fprintf(tfp, "<Version data=\"0.1\"/>\n" );
254
    fprintf(tfp, "<Web data=\"www.xfig.org\"/>\n" );
255
    fprintf(tfp, "<Email data=\"peter@niendo.de\"/>\n" );
256
    fprintf(tfp, "<Copyright data=\"see README files \"/>\n" );
257
    fprintf(tfp, "<AutoUpdate data=\"off\"/>\n" );
258
    fprintf(tfp, "</KivioSMLStencilSpawnerInfo>\n" );
259
260
	texfontsizes[0] = texfontsizes[1] =
261
		TEXFONTSIZE(font_size?font_size:DEFAULT_FONT_SIZE);
262
        mag=1;
263
        ppi=1;
264
 	unitlength = mag/ppi;
265
	dash_mag /= unitlength;
266
267
//    fprintf(tfp, "mag: %f,ppi: %f,dashmag; %f\n",mag,ppi,dash_mag);
268
269
//    fprintf(tfp, "x1: %d,y1: %d,x2; %d,y2 %d\n",
270
//      objects->nwcorner.x,
271
//       objects->nwcorner.y,objects->secorner.x,objects->secorner.y);
272
	//translate_coordinates = translate2;
273
	//translate_coordinates_d = translate2_d;
274
        offsetx=(float)llx;
275
	offsety=(float)lly;
276
277
	x1=(float)llx;
278
	y1=(float)lly;
279
	x2=(float)urx;
280
	y2=(float)ury;
281
	TRANS2(x1, y1, x2, y2);
282
	//if (llx > urx) SWAP(llx, urx)
283
	//if (lly > ury) SWAP(lly, ury)
284
285
//	if((urx>300) || (ury>300)) {
286
287
	  scale=urx/SCALEFAKTOR;
288
289
//	  if (scale<1) scale=1;
290
291
//	   urx=(double)urx/6;
292
//	   ury=(double)ury/6;
293
      fprintf(tfp, "<Dimensions w=\"%.3f\" h=\"%.3f\" defaultAspect=\"0.75\"/>\n",x2/scale,y2/scale);
294
      fprintf(tfp, "<KivioShape type=\"TextBox\" name=\"TextBox%d\"  x=\"0.0\" y=\"0.0\" w=\"%.3f\" h=\"%.3f\" />\n",counter++,x2/scale,y2/scale);
295
296
//	  TRANS2(llx, lly, urx, ury);
297
//	} else
298
//	fprintf(tfp, "<Dimensions w=\"%d\" h=\"%d\" defaultAspect=\"0.75\"/>\n",urx,ury);
299
300
301
302
303
304
	/* LaTeX start */
305
306
	/* print any whole-figure comments prefixed with "%" */
307
//	if (objects->comments) {
308
//	    fprintf(tfp,"%%\n");
309
//	    print_comments("% ",objects->comments, "");
310
//	    fprintf(tfp,"%%\n");
311
//	}
312
313
//	fprintf(tfp, "\\setlength{\\unitlength}{%lisp}%%\n",
314
//				(long) (round(4736286.72*unitlength)));
315
	/* define the SetFigFont macro */
316
//	define_setfigfont(tfp);
317
//	fprintf(tfp, "\\begin{picture}(%d,%d)(%d,%d)\n",
318
//	 				 urx-llx, ury-lly, llx, lly);
319
320
}
321
322
int
323
gensml_end()
324
{
325
	fprintf(tfp, "</KivioShapeStencil>\n");
326
	/* all ok */
327
	return 0;
328
}
329
330
331
void
332
gensml_line(l)
333
  F_line	*l;
334
{
335
	F_point		*p, *q;
336
	float		x, y,x1,y1, llx, lly, urx, ury, arrow;
337
        float           r1,r2;
338
	int type=0;
339
	if (verbose)
340
	fprintf(tfp, "<!--depth: %d, Type: %d, Style: %d, Farbe_fill: %d, Farbe_pen: %d -->\n",l->depth,l->type,l->fill_style,l->fill_color,l->pen_color);
341
342
	/* print any comments prefixed with "%" */
343
	//print_comments("% ",l->comments, "");
344
345
//	set_linewidth(l->thickness);
346
//	setcolor(l->pen_color);
347
	p = l->points;
348
	q = p->next;
349
350
351
352
	if (q == NULL) { /* A single point line */
353
354
	    x = p->x; y = p->y;
355
	    TRANS(x, y);
356
357
//	    fprintf(tfp, "\\put(%3d,%3d){\\makebox(%.4f,%.4f){%s}}\n",
358
//	      x, y, dot_xoffset, dot_yoffset, dot_cmd);
359
              fprintf(tfp, "<KivioShape type=\"LineArray\" name=\"Point%d\">\n",counter++);
360
361
	       fprintf(tfp, "\t<Line x1=\"%.3f\" y1=\"%.3f\" x2=\"%.3f\" y2=\"%.3f\"/>\n",
362
	          x, y, x+0.001, y+0.001);
363
	}
364
365
	/* a box, perhaps with rounded corners */
366
	else
367
	 switch (l->type) {
368
               case T_BOX:
369
               case T_ARC_BOX: {
370
	    x = p->x; y = p->y;
371
	    TRANS(x, y);
372
	    llx = urx = x;
373
	    lly = ury = y;
374
	    while (q != NULL) {
375
		x = q->x; y = q->y;
376
		TRANS(x, y);
377
		if (x < llx) llx = x;
378
		if (y < lly) lly = y;
379
		if (x > urx) urx = x;
380
		if (y > ury) ury = y;
381
		q = q->next;
382
		}
383
384
            //if ((l->fill_style != -1) && (l->fill_color !=-1 )) {
385
	    if (l->type == T_ARC_BOX) {
386
	      // put_arc_box (llx, lly, urx, ury, l->radius, l->style, l->style_val);
387
	      r1=l->radius/scale/ppi;
388
              r2=l->radius/scale/ppi;
389
//	      //TRANS(r1,r2);
390
	      	        fprintf(tfp, "<KivioShape type=\"RoundRectangle\" name=\"RoundRectangle%d\" x=\"%.3f\" y=\"%.3f\" w=\"%.3f\" h=\"%.3f\" r1=\"%0.2f\" r2=\"%0.2f\">\n",
391
			counter++, llx, lly, urx-llx, ury-lly,r1,r2);
392
		  }
393
	    else {
394
              fprintf(tfp, "<KivioShape type=\"Rectangle\" name=\"Rectangle%d\" x=\"%.3f\" y=\"%.3f\" w=\"%.3f\" h=\"%.3f\">\n",
395
	  counter++, llx, lly, urx-llx, ury-lly);
396
397
398
                }
399
            /*} else
400
	    {
401
	           fprintf(tfp, "<KivioShape type=\"LineArray\" name=\"Rectangle%d\">\n",counter++);
402
                   fprintf(tfp, "\t<Line x1=\"%.3f\" y1=\"%.3f\" x2=\"%.3f\" y2=\"%.3f\"/>\n",
403
                                    llx, lly, urx,lly);
404
                   fprintf(tfp, "\t<Line x1=\"%.3f\" y1=\"%.3f\" x2=\"%.3f\" y2=\"%.3f\"/>\n",
405
                                    urx,lly, urx,ury);
406
		fprintf(tfp, "\t<Line x1=\"%.3f\" y1=\"%.3f\" x2=\"%.3f\" y2=\"%.3f\"/>\n",
407
                                    urx,ury,llx,ury);
408
		fprintf(tfp, "\t<Line x1=\"%.3f\" y1=\"%.3f\" x2=\"%.3f\" y2=\"%.3f\"/>\n",
409
                                    llx,ury, llx,lly);
410
	    }
411
*/
412
            break;
413
	    }
414
            case T_POLYLINE:
415
	    case T_POLYGON: {
416
417
	      if ( (l->fill_style == -1) && (l->fill_color ==-1 ))
418
	         {
419
		    fprintf(tfp, "<KivioShape type=\"Polyline\" name=\"Polyline%d\">\n",counter++);
420
             type=0;
421
		 }
422
             else
423
	        {
424
		     fprintf(tfp, "<KivioShape type=\"Polygon\" name=\"Polygon%d\">\n",counter++);
425
426
427
		 type=0;
428
429
         	 // fprintf(tfp, "<KivioShape type=\"LineArray\" name=\"LineArray%d\">\n",counter++);
430
		  //type=1;
431
              }
432
433
434
//	    if (l->type == T_BOUNDINGBOX)
435
//        	fprintf(tfp, "<KivioShape type=\"Polygon\" name=\"Lines\">\n");
436
437
438
439
	while (q != NULL) {
440
	    //arrow = 0;
441
	    //if (l->for_arrow  &&  q->next == NULL)
442
		//arrow = 1;
443
	    //if (l->back_arrow  &&  p == l->points)
444
		//arrow = (arrow)? 2: -1;
445
		  if (type==0) {
446
	   // if ((l->type == T_POLYGON) && (l->fill_style != UNFILLED)) {
447
		    	        x = p->x; y = p->y;
448
		        TRANS(x, y);
449
		    fprintf(tfp, "\t<KivioPoint x=\"%.3f\" y=\"%.3f\"/>\n",x,y);
450
                     }
451
                      else {
452
		       x=p->x;
453
		       y=p->y;
454
		       x1=q->x;
455
                       y1=q->y;
456
                       TRANS2(x, y, x1, y1);
457
                       fprintf(tfp, "\t<Line x1=\"%.3f\" y1=\"%.3f\" x2=\"%.3f\" y2=\"%.3f\"/>\n",
458
                                    x, y, x1,y1);
459
460
        	      // single_line(p->x, p->y, q->x, q->y, arrow, l->style, l->style_val);
461
		      }
462
463
	    p = q;
464
	    q = q->next;
465
	    }
466
467
	    if (type==0) {
468
469
	    	    x = p->x; y = p->y;
470
		    TRANS(x, y);
471
		    fprintf(tfp, "\t<KivioPoint x=\"%.3f\" y=\"%.3f\"/>\n",x,y);
472
            }
473
		break;
474
          }
475
          default: { fprintf(stderr, "Objekt nicht unterstützt\n");
476
	   }
477
478
	  }
479
	set_linewidth(l->thickness,l->pen_color);
480
	//if (type==0)
481
	set_arrow(&(l->for_arrow),&(l->back_arrow));
482
483
	setcolor(l->fill_style,l->fill_color);
484
        end_line();
485
}
486
487
void
488
gensml_spline(s)
489
  F_spline	*s;
490
{
491
	fprintf(stderr, "Can't generate spline; omitting object\n");
492
	}
493
494
void
495
gensml_ellipse(e)
496
  F_ellipse	*e;
497
{
498
	float  x, y, d, dx, dy;
499
500
	if (verbose)
501
	if (verbose)
502
	fprintf(tfp, "<!--depth: %d, Type: %d, Style: %d, Farbe_fill: %d, Farbe_pen: %d -->\n",e->depth,e->type,e->fill_style,e->fill_color,e->pen_color);
503
504
	/* print any comments prefixed with "%" */
505
	print_comments("<!-- ",e->comments, "-->");
506
507
	switch (e->style) {
508
	    case SOLID_LINE:
509
		break;
510
	    case DASH_LINE:
511
		fprintf(stderr, "Dashed circles and elipses not supported\n");
512
		break;
513
	    case DOTTED_LINE:
514
		fprintf(stderr, "Dotted circles and elipses not supported\n");
515
		break;
516
	    }
517
518
	x = e->center.x;
519
	y = e->center.y;
520
	TRANS(x, y);
521
522
TRANS(x, y);
523
 	if ((e->type == T_CIRCLE_BY_RAD || e->type == T_CIRCLE_BY_DIA)
524
			&& e->radiuses.x*unitlength <= MAXCIRCLERAD) {
525
	    d = 2 * e->radiuses.x;
526
527
528
529
	    if (e->fill_style == BLACK_FILL)
530
//	    	fprintf(tfp, "\\put(%3d,%3d){\\circle*{%d}}\n", x, y, d)
531
          ;
532
	    else {
533
//	      	fprintf(tfp, "\\put(%3d,%3d){\\circle{%d}}\n", x, y, d);
534
		if (e->fill_style != UNFILLED)
535
			fprintf(stderr, "Circle area fill not implemented\n");
536
	    }
537
             fprintf(tfp, "<!-- -->\n");
538
539
540
	    fprintf(tfp, "<KivioShape type=\"Ellipse\" name=\"Circle%d\" x=\"%.3f\" y=\"%.3f\" w=\"%.3f\"  h=\"%.3f\">\n",
541
	        counter++,x, y, d, d);
542
543
	} else {
544
	    dx = 2*e->radiuses.x/scale;
545
	    dy = 2*e->radiuses.y /scale;
546
            x = e->center.x-e->radiuses.x;
547
   	    y = e->center.y-e->radiuses.y;
548
549
            TRANS(x,y);
550
            fprintf(tfp, "<KivioShape type=\"Ellipse\" name=\"Ellipse%d\" x=\"%.3f\" y=\"%.3f\" w=\"%.3f\" h=\"%.3f\">\n",
551
	     counter++,x, y, dx, dy);
552
	}
553
	setcolor(e->fill_style,e->fill_color);
554
	set_linewidth(e->thickness,e->pen_color);
555
	end_line();
556
      }
557
558
void
559
gensml_text(t)
560
  F_text	*t;
561
{
562
	float   	x, y;
563
	char	*tpos;
564
	unsigned char	*cp;
565
566
	if (verbose)
567
	    fprintf(tfp, "<!-- Fig TEXT object-->\n");
568
569
	/* print any comments prefixed with "%" */
570
	print_comments("<!-- ",t->comments, "-->");
571
572
	x = t->base_x;
573
	y = t->base_y;
574
	TRANS(x, y);
575
576
	switch (t->type) {
577
578
	    case T_LEFT_JUSTIFIED:
579
	    case DEFAULT:
580
	    	tpos = "0";
581
		break;
582
583
	    case T_CENTER_JUSTIFIED:
584
	    	tpos = "1";
585
		break;
586
587
	    case T_RIGHT_JUSTIFIED:
588
	    	tpos = "[rb]";
589
		break;
590
591
	    default:
592
		fprintf(stderr, "Text incorrectly positioned\n");
593
	    	tpos = "[lb]";	/* make left in this case */
594
	    }
595
596
	/* smash is used to position text at baseline */
597
//	unpsfont(t);
598
599
fprintf(tfp, "<KivioShape type=\"TextBox\" name=\"TextBox%d\" x=\"%.3f\" y=\"%.3f\" w=\"100\" h=\"100\">\n",counter++,x,y);
600
fprintf(tfp, " <Position x=\"0\" y=\"0\" />\n");
601
fprintf(tfp, " <Dimension w=\"100\" h=\"100\" />\n");
602
setcolor(1,t->color);
603
fprintf(tfp, " <KivioTextStyle vTextAlign=\"32\" isHtml=\"0\" hTextAlign=\"%d\" text=\"%s\" />\n",t->type,t->cstring);
604
fprintf(tfp, " <Font fixedPitch=\"0\" size=\"%d\" strikeOut=\"0\" family=\"\" bold=\"0\" underline=\"0\" color=\"#0\"/>\n",t->size);
605
fprintf(tfp, "</KivioShape>\n");
606
607
        { int texsize;
608
          double baselineskip;
609
610
	  texsize = TEXFONTMAG(t);
611
	  baselineskip = (texsize * 1.2);
612
613
	}
614
615
616
}
617
618
void
619
gensml_arc(a)
620
  F_arc	*a;
621
{
622
	F_pos		p1, p2, pq[4];
623
	double		cx, cy;
624
	double		v1x, v1y, v2x, v2y;
625
	double		r, angle1, angle2;
626
	float		q1, q2 ;
627
	float		y,x;
628
	int		p1_arrow, p2_arrow,i;
629
	static char	*ad1[4] = { " 0,-1", " 1, 0", " 0, 1", "-1, 0" };
630
	static char	*ad2[4] = { "-1, 0", " 0,-1", " 1, 0", " 0, 1" };
631
632
	if (verbose)
633
	    fprintf(tfp, "<!-- Fig ARC object -->\n");
634
635
	/* print any comments prefixed with "%" */
636
	// print_comments("% ",a->comments, "");
637
638
//	set_linewidth(a->thickness);
639
//		if (a->fill_style != UNFILLED) setcolor(a->pen_color);
640
//	switch (a->style) {
641
//	    case SOLID_LINE:
642
//		break;
643
//	    case DASH_LINE:
644
//		fprintf(stderr, "Dashed arcs not supported\n");
645
//		break;
646
//	    case DOTTED_LINE:
647
//		fprintf(stderr, "Dotted arcs not supported\n");
648
//		break;
649
//	}
650
//	if (a->direction == 1) {
651
//	    p1 = a->point[0];
652
//	    p2 = a->point[2];
653
//	    p1_arrow = (a->back_arrow != NULL);
654
//	    p2_arrow = (a->for_arrow != NULL);
655
//	} else {
656
//	    p1 = a->point[2];
657
//	    p2 = a->point[0];
658
//	    p1_arrow = (a->for_arrow != NULL);
659
//	    p2_arrow = (a->back_arrow != NULL);
660
//	}
661
662
663
       fprintf(tfp, "<KivioShape type=\"Bezier\" name=\"Bezier%d\">\n",counter++);
664
665
666
/*	cx = a->center.x;
667
	cy = a->center.y;
668
	TRANS2(p1.x, p1.y, p2.x, p2.y);
669
	TRANSD(cx, cy);
670
	/*** compute vectors and angles from arc center to p1, p2 ***/
671
/*	v1x = (double)p1.x - cx;
672
	v1y = (double)p1.y - cy;
673
	v2x = (double)p2.x - cx;
674
	v2y = (double)p2.y - cy;
675
	angle1 = atan2(v1y, v1x) * rad2deg;
676
	angle2 = atan2(v2y, v2x) * rad2deg;
677
	if (angle1 < 0.0)
678
	    angle1 += 360.0;
679
	if (angle2 < 0.0)
680
	    angle2 += 360.0;
681
	/* compute arc radius */
682
//	r = sqrt(v1x*v1x+v1y*v1y);
683
	/*** compute intersection of arc with x and y axis (origin at cx, cy) */
684
//	pq[0].x = round(cx);
685
//	pq[0].y = round(cy + r);
686
//	pq[1].x = round(cx - r);
687
//	pq[1].y = round(cy);
688
//	pq[2].x = round(cx);
689
//	pq[2].y = round(cy - r);
690
//	pq[3].x = round(cx + r);
691
//	pq[3].y = round(cy);
692
693
694
	for(i=0;i<=2;i++) {
695
          x=a->point[i].x;
696
          y=a->point[i].y;
697
          TRANS(x,y);
698
          fprintf(tfp, "\t<KivioPoint x=\"%.3f\" y=\"%.3f\" type=\"bezier\" />\n",x,y);
699
	  if (i==1) fprintf(tfp, "\t<KivioPoint x=\"%.3f\" y=\"%.3f\" type=\"bezier\" />\n",x,y);
700
	   }
701
702
	/*** compute in which quadrants p1 and p2 are located ***/
703
	/*q1 = (int)(angle1/90.0);
704
	q2 = (int)(angle2/90.0);
705
	if (fabs(angle1 - 90.0*q1) > arc_tolerance
706
	 || fabs(angle2 - 90.0*q2) > arc_tolerance)
707
	    // fprintf(stderr, "Approximating arc by ovals\n");
708
709
	/*** Draw arc **
710
	if (a->type == T_OPEN_ARC && a->thickness != 0 && p1_arrow)
711
	    // fprintf(tfp, "\\put(%3d,%3d){\\vector(%s){0}}\n", p1.x, p1.y, ad1[q1]);
712
713
714
	while (q1 != q2) {
715
	    put_quarter(p1, pq[q1], q1);
716
	    p1 = pq[q1];
717
	    q1 = (q1 + 1) % 4;
718
	    }
719
	put_quarter(p1, p2, q1);
720
	if (a->type == T_OPEN_ARC && a->thickness != 0 && p2_arrow)
721
	    // fprintf(tfp, "\\put(%3d,%3d){\\vector(%s){0}}\n", p2.x, p2.y, ad2[q2]);
722
723
	if (a->fill_style != UNFILLED)
724
		fprintf(stderr, "Arc area fill not implemented\n");
725
//	resetcolor(a->pen_color);
726
        */
727
	setcolor(a->fill_style,a->fill_color);
728
	set_linewidth(a->thickness,a->pen_color);
729
        end_line();
730
731
	}
732
733
734
#define  MAXCOLORS 32
735
736
/* need this for communication between color routines. Sorry */
737
static int lastcolor=-1;
738
739
void setcolor(sty,col)
740
int sty,col;
741
{
742
int color,style;
743
744
color=rgbColorVal(col);
745
746
if(col==7) {
747
 if(sty==20)
748
   color=255;
749
  else
750
 color=(255/20)*sty;
751
 color=256*256*color+256*color+color;
752
 }
753
754
if((col==0) || (col==-1)) {
755
if(sty==20)
756
   color=0;
757
  else
758
  color=255-(255/20)*sty;
759
  color=256*256*color+256*color+color;
760
 }
761
762
if(sty==-1)
763
  style=0;
764
 else
765
  style=1;
766
767
 fprintf(tfp, "\t<KivioFillStyle colorStyle=\"%d\" color=\"#%6.6x\" />\n", style ,color);
768
return;
769
}
770
771
int
772
set_linewidth(w,col)
773
  int	w,col;
774
{
775
 float i,x;
776
 x=1;
777
 i=w/20;
778
 fprintf(tfp, "\t<KivioLineStyle width=\"%.3f\" capStyle=\"32\" pattern=\"1\" joinStyle=\"128\" color=\"#%6.6x\" />\n",
779
  i,rgbColorVal(col) );
780
}
781
782
783
void end_line()
784
{
785
    fprintf(tfp, "</KivioShape>\n");
786
}
787
788
int
789
set_arrow(F_arrow *for_arrow,F_arrow *back_arrow)
790
{
791
int f, f_t, f_ht, f_wid, b, b_t, b_ht, b_wid;
792
793
if (verbose) fprintf(tfp, "<!--%d %d -->\n",(for_arrow==NULL),(back_arrow==NULL));
794
795
if(((for_arrow==NULL)==0) && ((back_arrow==NULL)==0)) {
796
 return;
797
}
798
799
  if((for_arrow!=NULL)==0) {
800
  f_t=for_arrow->type==0 ? 1 : 2;
801
  f_wid=for_arrow->wid;
802
  f_ht=for_arrow->ht;
803
  }
804
  else
805
  {
806
  f_t==0;
807
  f_wid=0;
808
  f_ht=0;
809
  }
810
  if((back_arrow!=NULL)==0) {
811
  b_t=back_arrow->type==0 ? 1 : 2;
812
  b_wid=back_arrow->wid;
813
  b_ht=back_arrow->ht;
814
  }
815
  else
816
  {
817
  b_t=0;
818
  b_wid=0;
819
  b_ht=0;
820
  }
821
   fprintf(tfp, "<KivioArrowHeads>\n");
822
   fprintf(tfp, "\t<KivioArrowHead w=\"%d\" l=\"%d\" type=\"%d\" cut=\"0\" />\n",f_wid,f_ht,f_t);
823
   fprintf(tfp, "\t<KivioArrowHead w=\"%d\" l=\"%d\" type=\"%d\" cut=\"0\" />\n",b_wid,b_ht,b_t);
824
   fprintf(tfp, "</KivioArrowHeads>\n");
825
   return;
826
}
827
828
static unsigned int
829
rgbColorVal(int colorIndex)
830
{
831
	extern User_color	user_colors[];
832
	unsigned int	rgb;
833
	static unsigned int	rgbColors[NUM_STD_COLS] = {
834
		0x000000, 0x0000ff, 0x00ff00, 0x00ffff, 0xff0000, 0xff00ff,
835
		0xffff00, 0xffffff, 0x00008f, 0x0000b0, 0x0000d1, 0x87cfff,
836
		0x008f00, 0x00b000, 0x00d100, 0x008f8f, 0x00b0b0, 0x00d1d1,
837
		0x8f0000, 0xb00000, 0xd10000, 0x8f008f, 0xb000b0, 0xd100d1,
838
		0x803000, 0xa14000, 0xb46100, 0xff8080, 0xffa1a1, 0xffbfbf,
839
		0xffe0e0, 0xffd600
840
	};
841
842
	if (colorIndex == DEFAULT)
843
		rgb = rgbColors[0];
844
	else if (colorIndex < NUM_STD_COLS)
845
		rgb = rgbColors[colorIndex];
846
	else
847
		rgb = ((user_colors[colorIndex-NUM_STD_COLS].r & 0xff) << 16)
848
			| ((user_colors[colorIndex-NUM_STD_COLS].g & 0xff) << 8)
849
			| (user_colors[colorIndex-NUM_STD_COLS].b & 0xff);
850
	return rgb;
851
}
852
853
854
struct driver dev_sml = {
855
     	gensml_option,
856
	gensml_start,
857
	gensml_arc,
858
	gensml_ellipse,
859
	gensml_line,
860
	gensml_spline,
861
	gensml_text,
862
	gensml_end,
863
	EXCLUDE_TEXT
864
};
(-)transfig.3.2.3d.orig/fig2dev/dev/gensxd.c (+764 lines)
Line 0 Link Here
1
/*
2
 * TransFig: Facility for Translating Fig code
3
 * Copyright (c) 1991 by Micah Beck
4
 * Parts Copyright (c) 1985-1988 by Supoj Sutanthavibul
5
 * Parts Copyright (c) 1989-1999 by Brian V. Smith
6
 *
7
 * Any party obtaining a copy of these files is granted, free of charge, a
8
 * full and unrestricted irrevocable, world-wide, paid up, royalty-free,
9
 * nonexclusive right and license to deal in this software and
10
 * documentation files (the "Software"), including without limitation the
11
 * rights to use, copy, modify, merge, publish, distribute, sublicense,
12
 * and/or sell copies of the Software, and to permit persons who receive
13
 * copies from any such party to do so, with the only requirement being
14
 * that this copyright notice remain intact.
15
 *
16
 */
17
18
/*
19
 *	gensxd.c : ooOffice xml driver for fig2dev
20
 *
21
 *	Author: Peter Korf
22
 *      Code stolen from gensxd.c
23
 *
24
 */
25
#if defined(hpux) || defined(SYSV) || defined(SVR4)
26
#include <sys/types.h>
27
#endif
28
#include <sys/file.h>
29
#include "fig2dev.h"
30
#include "object.h"
31
#include "texfonts.h"
32
33
extern double rad2deg;
34
extern void unpsfont();
35
36
#define rint(a) floor((a)+0.5)     /* close enough? */
37
38
#define DESC_NAME	"unknown"
39
40
#define HEAD_TAG	"\nHEAD"
41
#define MIDDLE_TAG	"\nMIDDLE"
42
#define END_TAG		"\nEND"
43
#define STYLE_TAG	"\nSTYLE"
44
#define BODY_TAG	"\nBODY"
45
#define COMMENT_TAG 	"\nCOMMENT"
46
extern char            *from;
47
48
#ifndef MIN
49
#define	MIN(x,y)	(((x) <= (y))? (x): (y))
50
#endif
51
#ifndef MAX
52
#define	MAX(x,y)	(((x) >= (y))? (x): (y))
53
#endif
54
#define	ABS(x)		(((x) >= 0)? (x): -(x))
55
#define round4(x)	((round(10000.0*(x))/10000.0))
56
#define round6(x)	((round(1000000.0*(x))/1000000.0))
57
#define MAXCIRCLEDIA	80
58
#define MAXCIRCLERAD	((MAXCIRCLEDIA-0.5)/(2*72.27))
59
60
#define DISTANCE(x,y)	sqrt(x*x+y*y)
61
62
#define SCALEFAKTOR	300
63
64
static char			desc_name[]  = DESC_NAME;
65
static float			offsetx,offsety,scale=1;
66
static int			counter=0,counter_text=0;
67
68
69
static unsigned int rgbColorVal(int colorIndex);
70
// static unsigned int setStyle(F_compound	*objects;);
71
72
73
static	int	verbose;//  = 0;
74
extern double		dash_mag;//  = 1.0;
75
extern int		thick_width;//  = 2;
76
extern double		tolerance;//  = 2.0;
77
extern double		arc_tolerance;//  = 1.0;
78
extern int		(*translate_coordinates)();//  = NULL;
79
extern int		(*translate_coordinates_d)();//  = NULL;
80
extern double		unitlength;
81
static int	cur_thickness;// 1;
82
extern double		ldot_diameter;// .0/72.0;
83
extern char		*dot_cmd;// =tindot;
84
extern char		*ldot_cmd;// =hin_ldot;
85
extern double		dot_xoffset;
86
extern double		dot_yoffset;
87
extern double		ldot_xoffset;
88
extern double		ldot_yoffset;
89
90
91
void gensxd_option(opt, optarg)
92
  char opt, *optarg;
93
{
94
    int i;
95
96
    switch (opt) {
97
	case 'a':
98
	    fprintf(stderr, "warning: latex option -a obsolete");
99
	    break;
100
101
	case 'd':
102
	    dash_mag = atof(optarg);	/* set dash magnification */
103
	    break;
104
105
	    dash_mag = atof(optarg);	/* set dash magnification */
106
	    break;
107
108
109
	case 'f':		/* set default text font */
110
	    for ( i = 1; i <= MAX_FONT; i++ )
111
		if ( !strcmp(optarg, texfontnames[i]) ) break;
112
113
	    if ( i > MAX_FONT)
114
			{
115
			  fprintf(stderr,
116
						 "warning: non-standard font name %s ignored\n", optarg);
117
			}
118
		 else
119
			{
120
			  texfontnames[0] = texfontnames[i];
121
#ifdef NFSS
122
			  texfontfamily[0] = texfontfamily[i];
123
			  texfontseries[0] = texfontseries[i];
124
			  texfontshape[0] = texfontshape[i];
125
#endif
126
			}
127
	    break;
128
129
	case 'l':		/* set thin/thick line threshold */
130
	    thick_width = atoi(optarg);
131
	    break;
132
133
	case 'v':
134
	    verbose = 1;		/* verbose mode */
135
	    break;
136
137
	case 'n':
138
	    sprintf(desc_name,"%s",optarg);		/* description name (library) */
139
	    break;
140
141
	case 's':
142
	case 'm':
143
	case 'L':
144
	    break;
145
146
	    break;
147
148
	default:
149
	    put_msg(Err_badarg, opt, "latex");
150
	    exit(1);
151
	}
152
}
153
154
void
155
gensxd_start(objects)
156
  F_compound	*objects;
157
{
158
	int tmp;
159
	char name1[40]="  ";
160
	float x1,y1,x2,y2;
161
//	strncpy((char *)name1,from,strlen(from)-4);
162
    fprintf(tfp,COMMENT_TAG "<!-- please use the script fig2sxd to create the sxd file -->");
163
    fprintf(tfp,HEAD_TAG "<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
164
    fprintf(tfp,HEAD_TAG "<!DOCTYPE office:document-content PUBLIC \"-//OpenOffice.org//DTD OfficeDocument 1.0//EN\" \"office.dtd\">");
165
    fprintf(tfp,HEAD_TAG "<office:document-content xmlns:office=\"http://openoffice.org/2000/office\" xmlns:style=\"http://openoffice.org/2000/style\" xmlns:text=\"http://openoffice.org/2000/text\" xmlns:table=\"http://openoffice.org/2000/table\" xmlns:draw=\"http://openoffice.org/2000/drawing\" xmlns:fo=\"http://www.w3.org/1999/XSL/Format\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:number=\"http://openoffice.org/2000/datastyle\" xmlns:presentation=\"http://openoffice.org/2000/presentation\" xmlns:svg=\"http://www.w3.org/2000/svg\" xmlns:chart=\"http://openoffice.org/2000/chart\" xmlns:dr3d=\"http://openoffice.org/2000/dr3d\" xmlns:math=\"http://www.w3.org/1998/Math/MathML\" xmlns:form=\"http://openoffice.org/2000/form\" xmlns:script=\"http://openoffice.org/2000/script\" office:class=\"drawing\" office:version=\"1.0\">");
166
    fprintf(tfp,HEAD_TAG "<office:script/>");
167
    fprintf(tfp,HEAD_TAG "<office:automatic-styles>");
168
    fprintf(tfp,HEAD_TAG "<style:style style:name=\"dp1\" style:family=\"drawing-page\"/>");
169
170
fprintf(tfp,MIDDLE_TAG "</office:automatic-styles>");
171
fprintf(tfp,MIDDLE_TAG "<office:body>");
172
fprintf(tfp,MIDDLE_TAG "<draw:page draw:name=\"page1\" draw:style-name=\"dp1\" draw:master-page-name=\"Standard\">");
173
174
}
175
176
int gensxd_end()
177
{
178
	fprintf(tfp, END_TAG "</draw:page></office:body></office:document-content>");
179
	fprintf(tfp,COMMENT_TAG "<!-- please use the script fig2sxd to create the sxd file -->");
180
	/* all ok */
181
	return 0;
182
}
183
184
185
void gensxd_line(F_line	*l)
186
{
187
188
        F_point		*p, *q, *r;
189
	float		x, y,x1,y1, llx, lly, urx, ury, arrow;
190
        float           r1,r2;
191
	int type=0;
192
193
	p = l->points;
194
	
195
fprintf(tfp, COMMENT_TAG " -  Linie %d\n",l->type);
196
   print_style(l->style,
197
            l->thickness,
198
	    l->pen_color,
199
	    l->fill_color,
200
	    l->pen,
201
	    l->fill_style,
202
	    l->join_style,
203
	    l->for_arrow,
204
	    l->back_arrow,
205
	    	    l->cap_style);
206
207
    switch (l->type) {
208
	case T_POLYLINE:
209
	    if (p->next == NULL) { 
210
	    fprintf (tfp, COMMENT_TAG "POINT %d %d", p->x, p->y);
211
	    }
212
	     	      /* A single point line */
213
	      /* Dot ? */
214
	      if (l->fill_style == -1) {
215
                  draw_poly(l,"polyline");
216
	      } else {
217
	          draw_poly(l,"polygon");
218
	      }
219
	    break;
220
	case T_ARC_BOX:
221
	case T_BOX:
222
	    draw_box(l);
223
	    break;
224
	case T_POLYGON:
225
	    draw_poly(l,"polygon");
226
            break;
227
	case T_PIC_BOX:
228
//	    put_pic(l);
229
            break;
230
	default:
231
	     counter++;
232
      	     fprintf(tfp, COMMENT_TAG "unkown\n");
233
    }	     
234
235
}
236
237
void gensxd_spline(F_spline *s)
238
{
239
   fprintf(tfp, COMMENT_TAG "Spline\n");
240
241
//	fprintf(stderr, "Can't generate spline; omitting object\n");
242
}
243
244
void gensxd_ellipse(F_ellipse *e)
245
{
246
fprintf(tfp, COMMENT_TAG "ellipse\n");
247
248
  print_style(e->style,
249
            e->thickness,
250
	    e->pen_color,
251
	    e->fill_color,
252
	    e->pen,
253
	    e->fill_style,
254
	    -1,
255
	    NULL,
256
	    NULL,
257
	    -1);
258
259
    switch (e->type) {
260
	case T_CIRCLE_BY_RAD:    
261
	case T_CIRCLE_BY_DIA:
262
             draw_round(e,"circle");
263
	     break;
264
	case T_ELLIPSE_BY_RAD:    
265
	case T_ELLIPSE_BY_DIA:
266
             draw_round(e,"ellipse");
267
	     break;
268
	default:     
269
    };
270
}    
271
272
void gensxd_text(F_text	*t)
273
{
274
275
	float   	x, y;
276
	char	*tpos;
277
	unsigned char	*cp;
278
fprintf(tfp, COMMENT_TAG "Text\n");
279
	
280
	  print_style_text(t->type,
281
	    t->color,
282
	    t->font,
283
	    t->size);
284
285
	
286
	start_tag("text-box",t->depth);
287
	
288
	if (t->angle != 0) {
289
           fprintf(tfp, " draw:transform=\"rotate (%G)\" ",t->angle);
290
	}
291
292
	 fprintf(tfp, "draw:auto-grow-width=\"true\" ");
293
	 fprintf(tfp, "draw:auto-grow-height=\"true\" ");
294
	
295
	 fprintf(tfp, "svg:width=\"%G\" ",t->length);
296
        fprintf(tfp, "svg:height=\"%G\" ",t->height);
297
 fprintf(tfp, "svg:x=\"%d\" ",t->base_x);
298
 fprintf(tfp, "svg:y=\"%G\" ",t->base_y-t->height);
299
300
        fprintf(tfp, "><text:p text:style-name=\"P1\"><text:span text:style-name=\"T%d\">%s</text:span></text:p></draw:text-box>",counter_text++,t->cstring); 
301
302
	if (verbose)
303
	    fprintf(tfp, "<!-- Fig TEXT object-->\n");
304
305
}
306
307
void gensxd_arc(F_arc *a)
308
{
309
fprintf(tfp, COMMENT_TAG "arc\n");
310
311
if (a->direction == 1) {
312
  print_style(a->style,
313
            a->thickness,
314
	    a->pen_color,
315
	    a->fill_color,
316
	    a->pen,
317
	    a->fill_style,
318
	    -1,
319
	    a->for_arrow,
320
	    a->back_arrow,
321
	    a->cap_style);
322
323
} else {
324
325
  print_style(a->style,
326
            a->thickness,
327
	    a->pen_color,
328
	    a->fill_color,
329
	    a->pen,
330
	    a->fill_style,
331
	    -1,
332
	    a->back_arrow,
333
	    a->for_arrow,
334
	    a->cap_style);
335
}	    
336
	switch (a->type) {
337
338
	    case T_OPEN_ARC:
339
		    draw_arc(a,"arc");
340
		    break;
341
           case T_PIE_WEDGE_ARC:   
342
		    draw_arc(a,"section");
343
                    break; 		    
344
	    default:    
345
        }    	    
346
347
}
348
349
350
print_style_text(int type,
351
                 int color,
352
		 int font,
353
                 double size) { 
354
char *align_names[] = 
355
{
356
  "left",
357
  "center",
358
  "right",
359
};
360
361
fprintf(tfp,STYLE_TAG "<style:style style:parent-style-name=\"standard\" style:name=\"xfig%d\" style:family=\"graphics\">",counter);
362
fprintf(tfp,STYLE_TAG "<style:properties draw:textarea-vertical-align=\"middle\" ");
363
364
fprintf(tfp, "draw:textarea-horizontal-align=\"%s\" ",align_names[type]); 
365
//fprintf(tfp, "draw:textarea-horizontal-align=\"%s\" ",align_names[type]); 
366
   fprintf(tfp, "draw:stroke=\"none\" ");
367
368
    fprintf(tfp, "svg:stroke-color=\"#%6.6x\" ",rgbColorVal(color));
369
370
      fprintf(tfp, "draw:fill=\"none\" ");
371
    fprintf(tfp, "draw:fill-color=\"#%6.6x\" ",rgbColorVal(color));
372
373
    fprintf(tfp, "/></style:style>");
374
375
    fprintf(tfp,STYLE_TAG "<style:style style:parent-style-name=\"standard\" style:name=\"P%d\" style:family=\"paragraph\">",counter_text);
376
     fprintf(tfp,STYLE_TAG "<style:properties ");
377
//             fprintf(tfp, " draw:fit-to-size=\"true\" ");
378
379
380
     switch (font) {
381
	    case ITALIC_FONT:
382
                 fprintf(tfp, " fo:font-style=\"italic\" ");
383
	    case BOLD_FONT:
384
                 fprintf(tfp, " fo:font-weight=\"bold\" ");
385
      }	    	 
386
387
    fprintf(tfp, "fo:color=\"#%6.6x\" ",rgbColorVal(color));
388
    fprintf(tfp, "fo:font-size=\"%Gpt\" ",size);
389
390
    fprintf(tfp, "/></style:style>");
391
392
393
}
394
395
396
print_style(int style,
397
            int thickness,
398
	    int pen_color,
399
	    int fill_color,
400
	    int pen,
401
	    int fill_style,
402
	    int join_style,
403
	    F_arrow *for_arrow,
404
	    F_arrow *back_arrow,
405
	    int cap_style)
406
407
{
408
	int 		color;
409
410
411
char *joinstyle_names[] = {
412
  "miter",
413
  "bevel",
414
  "round"
415
};
416
417
char *dash_names[] = 
418
{
419
  "unkown",
420
  "Fine Dashed",
421
  "Fine Dotted",
422
  "Line with Fine Dots"
423
  "2 Dots 1 Dash",
424
  "Ultrafine 2 Dots 3 Dashes",
425
  "unkown",
426
};
427
428
char *hatch_names[] = 
429
{
430
  "BLACK 45 Degrees",
431
};
432
433
434
fprintf(tfp, COMMENT_TAG "<!-- fill_color %d, fill_style %d -->\n",fill_color,fill_style);
435
436
fprintf(tfp,STYLE_TAG "<style:style style:parent-style-name=\"standard\" style:name=\"xfig%d\" style:family=\"graphics\">",counter);
437
fprintf(tfp,STYLE_TAG "<style:properties draw:textarea-vertical-align=\"middle\" ");
438
439
if (thickness > 0) {
440
    switch (style) {
441
        case SOLID_LINE:
442
	   fprintf(tfp, "draw:stroke=\"solid\" ");
443
	    break;
444
      default:       
445
        fprintf(tfp, "draw:stroke=\"dash\" ");
446
        fprintf(tfp, "draw:stroke-dash=\"%s\" ",dash_names[style]);
447
        break;
448
    };
449
450
    fprintf(tfp, "svg:stroke-width=\"%d\" ",thickness);
451
    fprintf(tfp, "svg:stroke-color=\"#%6.6x\" ",rgbColorVal(pen_color));
452
} else {
453
   fprintf(tfp, "draw:stroke=\"none\" ");
454
}
455
456
print_arrow(for_arrow,"start");
457
print_arrow(back_arrow,"end");
458
459
if (join_style != -1) {
460
    fprintf(tfp, "svg:stroke-linejoin=\"%s\" ",joinstyle_names[join_style]);
461
}
462
463
464
switch (fill_color) {
465
    case -1:
466
    case 0:
467
    case 7:
468
      if (fill_style == -1 ) {
469
	    fprintf(tfp, "draw:fill=\"none\" ");
470
      }
471
      if ((0<=fill_style) && (fill_style<=20)) {
472
	    fprintf(tfp, "draw:fill=\"solid\" ");      
473
	    if (fill_color==7) {
474
                  color=(255/20)*(fill_style);
475
            } else {
476
		  color=255-(255/20)*(fill_style);
477
	    }	    
478
	    color=256*256*color+256*color+color;
479
	    fprintf(tfp, "draw:fill-color=\"#%6.6x\" ",color);      
480
       }
481
      if ((fill_style>=21) && (fill_style<=40)) {
482
            fprintf(tfp, "draw:fill=\"not used\" ");   
483
      }
484
      if ((fill_style>=41) && (fill_style<=56)) {
485
            fprintf(tfp, "draw:fill=\"hatch\" ");   
486
      }
487
      break;
488
    default:
489
      if (fill_style == -1) {
490
	    fprintf(tfp, "draw:fill=\"none\" ");
491
492
      } 
493
      if (fill_style == 0) {
494
	    fprintf(tfp, "draw:fill=\"solid\" ");
495
	    fprintf(tfp, "draw:fill-color=\"#000000\" ");      
496
497
	    
498
      } 
499
      if (fill_style == 40) {
500
	    fprintf(tfp, "draw:fill=\"solid\" ");
501
	    fprintf(tfp, "draw:fill-color=\"#ffffff\" ");      
502
503
      } 
504
      if ((fill_style>0) && (fill_style<40)) {
505
	    fprintf(tfp, "draw:fill=\"solid\" ");
506
	    fprintf(tfp, "draw:fill-color=\"#%6.6x\" ",rgbColorVal(fill_color));
507
      } 
508
      if ((fill_style>=41) && (fill_style<=56)) {
509
            fprintf(tfp, "draw:fill=\"hatch\" ");   
510
	    fprintf(tfp, "draw:fill-hatch-name=\"#%s\" ",hatch_names[0]);
511
512
      }
513
}
514
//draw:transparency
515
516
    fprintf(tfp, "/></style:style>");
517
518
}
519
520
521
#define  MAXCOLORS 32
522
523
/* need this for communication between color routines. Sorry */
524
static int lastcolor=-1;
525
526
527
static unsigned int
528
rgbColorVal(int colorIndex)
529
{
530
	extern User_color	user_colors[];
531
	unsigned int	rgb;
532
	static unsigned int	rgbColors[NUM_STD_COLS] = {
533
		0x000000, 0x0000ff, 0x00ff00, 0x00ffff, 0xff0000, 0xff00ff,
534
		0xffff00, 0xffffff, 0x00008f, 0x0000b0, 0x0000d1, 0x87cfff,
535
		0x008f00, 0x00b000, 0x00d100, 0x008f8f, 0x00b0b0, 0x00d1d1,
536
		0x8f0000, 0xb00000, 0xd10000, 0x8f008f, 0xb000b0, 0xd100d1,
537
		0x803000, 0xa14000, 0xb46100, 0xff8080, 0xffa1a1, 0xffbfbf,
538
		0xffe0e0, 0xffd600
539
	};
540
541
	if (colorIndex == DEFAULT)
542
		rgb = rgbColors[0];
543
	else if (colorIndex < NUM_STD_COLS)
544
		rgb = rgbColors[colorIndex];
545
	else
546
		rgb = ((user_colors[colorIndex-NUM_STD_COLS].r & 0xff) << 16)
547
			| ((user_colors[colorIndex-NUM_STD_COLS].g & 0xff) << 8)
548
			| (user_colors[colorIndex-NUM_STD_COLS].b & 0xff);
549
	return rgb;
550
}
551
552
553
start_tag(char *name,int depth) {
554
 fprintf(tfp, BODY_TAG "<draw:%s draw:style-name=\"xfig%d\" draw:text-style-name=\"P0\" draw:layer=\"layout\" ",name,counter++);
555
 fprintf(tfp, "draw:zindex=\"%d\" ",depth);
556
};
557
558
draw_round(F_ellipse *e,char *name) {
559
 F_point	*q;
560
 int		max_x,max_y;
561
 start_tag(name,e->depth);
562
563
// draw:kind (full|section|cut|arc)
564
565
 fprintf(tfp, "draw:kind=\"full\" ");
566
 fprintf(tfp, "svg:width=\"%d\" ",e->radiuses.x*2);
567
 fprintf(tfp, "svg:height=\"%d\" ",e->radiuses.y*2);
568
 fprintf(tfp, "svg:x=\"%d\" ",e->center.x - e->radiuses.x);
569
 fprintf(tfp, "svg:y=\"%d\" ",e->center.y - e->radiuses.y);
570
 if (e->angle != 0) {
571
     fprintf(tfp, "draw:transform=\"rotate (%f)\" ",e->angle);
572
 }
573
 fprintf(tfp, "/>");
574
}
575
576
draw_arc(F_arc *a,char *name) {
577
 F_point	*q;
578
 int		arc,max_x,max_y;
579
 F_pos           p1, p2, p3, pq[4];
580
 double		 x1,y1,x2,y2,x3,y3,A,B,C;
581
 double		 dx,dy,sx,sy,ex,ey;
582
 double          cx, cy;
583
 double          v1x, v1y, v2x, v2y;
584
 double          r, angle1, angle2;
585
			       
586
 start_tag("ellipse",a->depth);
587
588
// draw:kind (full|section|cut|arc)
589
// FIXME: math problems
590
 
591
if (a->direction == 1) {
592
return;
593
          p1 = a->point[2];
594
          p3 = a->point[0];
595
//	sx = a->point[0].x; sy = a->point[0].y;
596
//	ex = a->point[2].x; ey = a->point[2].y;
597
598
//          p1_arrow = (a->back_arrow != NULL);
599
//          p2_arrow = (a->for_arrow != NULL);
600
      } else {
601
          p1 = a->point[0];
602
          p3 = a->point[2];
603
//	sx = a->point[2].x; sy = a->point[2].y;
604
//	ex = a->point[0].x; ey = a->point[0].y;
605
606
//          p1_arrow = (a->for_arrow != NULL);
607
//          p2_arrow = (a->back_arrow != NULL);
608
      }
609
610
	sx = a->point[0].x; sy = a->point[0].y;
611
	ex = a->point[2].x; ey = a->point[2].y;
612
613
	cx = a->center.x; cy = a->center.y;
614
615
//	direction = a->direction;
616
	dx = cx - sx;
617
	dy = cy - sy;
618
	r = sqrt(dx*dx+dy*dy);
619
	if (cx==sx)
620
	    angle1 = (sy-cy > 0? 90.0: -90.0);
621
	else
622
	    angle1 = atan2((sy-cy),(sx-cx)) * 180 / M_PI;
623
	if (cx==ex)
624
	    angle2 = (ey-cy > 0 ? 90.0: -90.0);
625
	else
626
	    angle2 = atan2((ey-cy),(ex-cx)) * 180 /M_PI;
627
628
629
630
	    angle1 = (angle1 < 0 ? angle1+360: angle1);
631
	    angle2 = (angle2 < 0 ? angle2+360: angle2);
632
633
       if (abs(angle1)>90)
634
          angle1=180-180-angle1;
635
         else
636
          angle1=-angle1;
637
638
       if (abs(angle2)>90)
639
          angle2=180-180-angle2;
640
         else
641
          angle2=-angle2;
642
643
          
644
645
// fprintf(tfp, COMMENT_TAG " %G %G",v1x,v1y);
646
// fprintf(tfp, COMMENT_TAG " %G %G",v2x,v2y);
647
// fprintf(tfp, COMMENT_TAG " %d %d",p1.x,p1.y);
648
// fprintf(tfp, COMMENT_TAG " %d %d",p2.x,p2.y);
649
// fprintf(tfp, COMMENT_TAG " %d %d",p3.x,p3.y);
650
// fprintf(tfp, COMMENT_TAG " %G %G\n",a->center.x,a->center.y);
651
 
652
 fprintf(tfp, "draw:kind=\"%s\" ",name);
653
 fprintf(tfp, "svg:x=\"%G\" ",cx-r);
654
 fprintf(tfp, "svg:y=\"%G\" ",cy-r);
655
 fprintf(tfp, "svg:width=\"%G\" ",2*r);
656
 fprintf(tfp, "svg:height=\"%G\" ",2*r);
657
 fprintf(tfp, "draw:start-angle=\"%.2f\" ",angle2);
658
 fprintf(tfp, "draw:end-angle=\"%.2f\" "  ,angle1);
659
660
 
661
// if (a->angle != 0) {
662
//     fprintf(tfp, "draw:transform=\"rotate (%f)\" ",a->angle);
663
// }
664
 fprintf(tfp, "/>");
665
}
666
667
draw_poly(F_line *l,char *name) {
668
 F_point	*q;
669
 int		max_x,max_y,min_x,min_y;
670
671
 fprintf(tfp, COMMENT_TAG " Linie %d\n",l->type);
672
673
 start_tag(name,l->depth);
674
 
675
 fprintf(tfp, "draw:points=\"");
676
677
 q=l->points;
678
 max_x=q->x;
679
 max_y=q->y; 
680
 min_x=q->x;
681
 min_y=q->y; 
682
 
683
 while (q != NULL) {
684
    max_x=MAX(max_x,q->x);
685
    max_y=MAX(max_y,q->y);
686
    min_x=MIN(min_x,q->x);
687
    min_y=MIN(min_y,q->y);
688
689
    fprintf(tfp, "%d,%d ",q->x,q->y);
690
    q=q->next;
691
 }
692
693
 fprintf(tfp, "\" ");
694
 fprintf(tfp, "svg:viewBox=\"%d %d %d %d\" ",min_x-1,min_y-1,max_x+1,max_y+1);
695
 fprintf(tfp, "svg:x=\"%d\" svg:y=\"%d\" svg:width=\"%d\" svg:heigth=\"%d\" ",min_x-1,min_y-1,max_x+1,max_y+1);
696
 
697
 fprintf(tfp, "/>");
698
}
699
700
draw_line(F_line *l) {
701
 start_tag("line",l->depth);
702
 
703
 fprintf(tfp, "svg:x1=\"%d\" ",l->points->x);
704
 fprintf(tfp, "svg:y1=\"%d\" ",l->points->y);
705
 fprintf(tfp, "svg:x2=\"%d\" ",l->points->next->x);
706
 fprintf(tfp, "svg:y2=\"%d\" ",l->points->next->y);
707
 
708
 fprintf(tfp, "/>");
709
}
710
711
draw_box(F_line *l) {
712
 F_point         *p, *q;
713
 int x1,x2,y1,y2;
714
 p = l->points;
715
 q = p->next->next;
716
	
717
 x1=MIN(p->x,q->x);
718
 x2=MAX(p->x,q->x);
719
 y1=MIN(p->y,q->y);
720
 y2=MAX(p->y,q->y);
721
 
722
  
723
 	 
724
 start_tag("rect",l->depth);
725
  fprintf(tfp, "svg:x=\"%d\" ",x1);
726
  fprintf(tfp, "svg:y=\"%d\" ",y1);
727
  
728
  fprintf(tfp, "svg:width =\"%d\" ",x2-x1);
729
  fprintf(tfp, "svg:height=\"%d\" ",y2-y1);
730
731
  if (l->type==T_ARC_BOX) {
732
    fprintf(tfp, "draw:corner-radius=\"%d\" ",l->radius);
733
  }
734
  fprintf(tfp, "/>");
735
736
}
737
738
print_arrow(F_arrow *arrow,char *name) {
739
char *arrow_names[] = {
740
  "Line Arrow",
741
  "Arrow",
742
  "Arrow concave",
743
  "Arrow convex" 
744
};
745
746
if (arrow != NULL) {
747
  fprintf(tfp, " draw:marker-%s=\"%s\" ",name,arrow_names[arrow->type]);
748
  fprintf(tfp, " draw:marker-%s-width=\"%G\" ",name,arrow->wid*3);
749
  fprintf(tfp, " draw:marker-%s-height=\"%G\" ",name,arrow->ht*3);
750
  fprintf(tfp, " draw:marker-%s-center=\"true\" ",name);
751
}
752
}
753
754
struct driver dev_sxd = {
755
     	gensxd_option,
756
	gensxd_start,
757
	gensxd_arc,
758
	gensxd_ellipse,
759
	gensxd_line,
760
	gensxd_spline,
761
	gensxd_text,
762
	gensxd_end,
763
	INCLUDE_TEXT
764
};
(-)transfig.3.2.3d.orig/fig2dev/drivers.h (+4 lines)
Lines 35-40 Link Here
35
extern struct driver dev_ge;
35
extern struct driver dev_ge;
36
extern struct driver dev_bitmaps;
36
extern struct driver dev_bitmaps;
37
extern struct driver dev_map;
37
extern struct driver dev_map;
38
extern struct driver dev_sml;
39
extern struct driver dev_sxd;
38
40
39
/* all the bitmap formats use the dev_bitmaps driver */
41
/* all the bitmap formats use the dev_bitmaps driver */
40
42
Lines 65-70 Link Here
65
		{"pstex",	&dev_pstex},
67
		{"pstex",	&dev_pstex},
66
		{"pstex_t",	&dev_pstex_t},
68
		{"pstex_t",	&dev_pstex_t},
67
		{"sld",		&dev_bitmaps},
69
		{"sld",		&dev_bitmaps},
70
		{"sml",		&dev_sml},	
71
		{"sxd",		&dev_sxd},	
68
		{"textyl",	&dev_textyl},
72
		{"textyl",	&dev_textyl},
69
		{"tiff",	&dev_bitmaps},
73
		{"tiff",	&dev_bitmaps},
70
		{"tk",		&dev_tk},
74
		{"tk",		&dev_tk},
(-)transfig.3.2.3d.orig/fig2dev/fig2sxd.script (+36 lines)
Line 0 Link Here
1
#!/bin/sh
2
# script to convert fig to sxd
3
# email: peter@niendo.de
4
5
tempdir=./standard;
6
7
if test "$1" != ""; then
8
9
mkdir $tempdir
10
11
name=`echo $1 | sed s/.fig//`
12
13
#cp -R ./standard $name
14
15
echo exporting $name.fig to $name.sxd
16
17
fig2dev -Lsxd $name.fig >dummy || echo Fehler bei: $name
18
19
cat dummy | grep "^HEAD" | sed -e 's/HEAD//' >$tempdir/content.xml
20
cat dummy | grep "^STYLE" | sed -e 's/STYLE//' >>$tempdir/content.xml
21
cat dummy | grep "^MIDDLE" | sed -e 's/MIDDLE//' >>$tempdir/content.xml
22
cat dummy | grep "^BODY" | sed -e 's/BODY//' >>$tempdir/content.xml
23
cat dummy | grep "^END" | sed -e 's/END//' >>$tempdir/content.xml
24
25
cd ./standard
26
zip -r ../$name.sxd * >/dev/null
27
cd ..
28
else
29
30
echo "use ./pack <filename.fig>"
31
echo export filename.fig to filename.sxd
32
echo
33
echo you need a directory called $tempdir, which should be 
34
echo empty or an uncompressed sxd file.
35
echo
36
fi
(-)transfig.3.2.3d.orig/patchlevel.h (-1 / +1 lines)
Lines 16-19 Link Here
16
 */
16
 */
17
17
18
#define VERSION		"3.2"
18
#define VERSION		"3.2"
19
#define PATCHLEVEL	"3d"
19
#define PATCHLEVEL	"3d-sml-sxd_0.2"

Return to bug 14496