gcc on Mac OS X claims -fno-rtti shouldn't be used when compiling C
[swftools.git] / pdf2swf / swfoutput.h
1 /* swfoutput.h
2    Header file for swfoutput.cc (and swfoutput_x11.cc).
3
4    Part of the swftools package.
5
6    Copyright (c) 2001,2002,2003 Matthias Kramm <kramm@quiss.org> 
7  
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
21
22 #ifndef __swfoutput_h__
23 #define __swfoutput_h__
24
25 #include "../lib/rfxswf.h"
26 #include "../lib/gfxdevice.h"
27
28 typedef long int twip;
29
30 struct swfmatrix {
31     double m11,m12,m21,m22,m31,m32;
32 };
33
34 struct swfcoord {
35     twip x;
36     twip y;
37 };
38
39 struct swfoutput 
40 {
41     MATRIX fontmatrix;
42     double fontm11,fontm12,fontm21,fontm22;
43     SWFFONT *swffont;
44     RGBA strokergb;
45     RGBA fillrgb;
46     int drawmode;
47     int x1,y1,x2,y2;
48     void*internal;
49 };
50
51 #define DRAWMODE_STROKE 1
52 #define DRAWMODE_FILL 2
53 #define DRAWMODE_EOFILL 3
54 #define DRAWMODE_CLIP 4
55 #define DRAWMODE_EOCLIP 5
56
57 void swfoutput_setparameter(char*name, char*value);
58
59 void swfoutput_init(struct swfoutput*);
60 int swfoutput_save(struct swfoutput*, char*filename);
61 SWF* swfoutput_get(struct swfoutput*);
62 void swfoutput_getdimensions(struct swfoutput*, int*x1, int*y1, int*x2, int*y2);
63     
64 void swfoutput_pagefeed(struct swfoutput*obj);
65 void swfoutput_newpage(struct swfoutput*, int pageNum, int movex, int movey, int x1, int y1, int x2, int y2);
66
67 void swfoutput_setfont(struct swfoutput*, char*fontid, char*filename);
68 int swfoutput_queryfont(struct swfoutput*, char*fontid);
69
70 void swfoutput_setfont(struct swfoutput*, char*fontid, char*filename);
71
72 void swfoutput_gfxaddfont(struct swfoutput*, char*fontid, gfxfont_t*font);
73 void swfoutput_gfxdrawchar(struct swfoutput*, char*fontid, int glyph, gfxcolor_t*c, gfxmatrix_t*m);
74
75 void swfoutput_setfontmatrix(struct swfoutput*,double,double,double,double);
76 int swfoutput_drawchar(struct swfoutput*,double x,double y,char*a, int charnr, int u, gfxcolor_t* col);
77
78 void swfoutput_drawgfxline(struct swfoutput*, gfxline_t*line, gfxcoord_t width, gfxcolor_t*col, gfx_capType cap_style, gfx_joinType joint_style, gfxcoord_t miterLimit);
79 void swfoutput_fillgfxline(struct swfoutput*, gfxline_t*line, gfxcolor_t*col);
80 void swfoutput_startclip(struct swfoutput*, gfxline_t*line);
81 void swfoutput_endclip(struct swfoutput*);
82
83 void swfoutput_drawimagejpeg(struct swfoutput*, RGBA*pic, int sizex,int sizey, 
84         double x1,double y1,
85         double x2,double y2,
86         double x3,double y3,
87         double x4,double y4);
88 void swfoutput_drawimagelossless(struct swfoutput*, RGBA*pic, int sizex, int sizey,
89         double x1,double y1,
90         double x2,double y2,
91         double x3,double y3,
92         double x4,double y4);
93
94 void swfoutput_linktopage(struct swfoutput*, int page, swfcoord*points);
95 void swfoutput_linktourl(struct swfoutput*, char*url, swfcoord*points);
96 void swfoutput_namedlink(struct swfoutput*obj, char*name, swfcoord*points);
97
98 void swfoutput_destroy(struct swfoutput*);
99
100 #endif //__swfoutput_h__