1 /*
2     Ming, an SWF output library
3     Copyright (C) 2007 Klaus Rechert
4 
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Lesser General Public
7     License as published by the Free Software Foundation; either
8     version 2.1 of the License, or (at your option) any later version.
9 
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13     Lesser General Public License for more details.
14 
15     You should have received a copy of the GNU Lesser General Public
16     License along with this library; if not, write to the Free Software
17     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19 
20 /*
21  * This file contains compat wraper for deprecated functions.
22  * These functions will be REMOVED in future releases!
23  */
24 
25 
26 #include "ming.h"
27 
28 #include "blocks/shape.h"
SWFShape_setLineStyle(SWFShape shape,unsigned short width,byte r,byte g,byte b,byte a)29 void SWFShape_setLineStyle(SWFShape shape, unsigned short width,
30                            byte r, byte g, byte b, byte a)
31 {
32 	SWFShape_setLineStyle_internal(shape, width, r, g, b, a);
33 }
34 
35 void
SWFShape_setLineStyle2(SWFShape shape,unsigned short width,byte r,byte g,byte b,byte a,int flags,float miterLimit)36 SWFShape_setLineStyle2(SWFShape shape, unsigned short width,
37                        byte r, byte g, byte b, byte a,
38                        int flags, float miterLimit)
39 {
40 	SWFShape_setLineStyle2_internal(shape, width, r, g, b, a,
41 		flags, miterLimit);
42 }
43 
44 void
SWFShape_setLineStyle2filled(SWFShape shape,unsigned short width,SWFFillStyle fill,int flags,float miterLimit)45 SWFShape_setLineStyle2filled(SWFShape shape, unsigned short width,
46                        SWFFillStyle fill,
47                        int flags, float miterLimit)
48 {
49 	SWFShape_setLineStyle2filled_internal(shape, width, fill,
50 		flags, miterLimit);
51 }
52 
53 
54 #include "blocks/fdbfont.h"
55 
loadSWFFontFromFile(FILE * file)56 SWFFont loadSWFFontFromFile(FILE *file)
57 {
58 	return loadSWFFont_fromFdbFile(file);
59 }
60 
61 
62 /*
63  * provide ming-0.3.x ABI compatibility
64  */
65 #ifdef SWFMovie_add
66 #undef SWFMovie_add
SWFMovie_add(SWFMovie movie,SWFBlock block)67 SWFDisplayItem SWFMovie_add(SWFMovie movie, SWFBlock block)
68 {
69 	SWFMovieBlockType ublock;
70 	ublock.block = block;
71 	return SWFMovie_add_internal(movie, ublock);
72 }
73 
74 #endif
75 
76 #ifdef SWFMovie_replace
77 #undef SWFMovie_replace
SWFMovie_replace(SWFMovie movie,SWFDisplayItem item,SWFBlock block)78 static inline int SWFMovie_replace(SWFMovie movie, SWFDisplayItem item, SWFBlock block)
79 {
80 	SWFMovieBlockType ublock;
81 	ublock.block = block;
82 	return SWFMovie_replace_internal(movie, item, ublock);
83 }
84 #endif
85 
SWFFont_getShape(SWFFont font,unsigned short c)86 char *SWFFont_getShape(SWFFont font, unsigned short c)
87 {
88 	char *out = NULL;
89 	SWFShape s = newSWFShape();
90 	SWFShape_drawScaledGlyph(s, font, c, 1024.0);
91 	out = SWFShape_dumpOutline(s);
92 	destroySWFShape(s);
93 	return out;
94 }
95