1 /*
2     Ming, an SWF output library
3     Copyright (C) 2002  Opaque Industries - http://www.opaque.net/
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 #include "fill.h"
21 #include "position.h"
22 #include "libming.h"
23 
24 struct SWFFill_s
25 {
26 	SWFFillStyle fillstyle;
27 	SWFPosition position;
28 #if TRACK_ALLOCS
29 	/* memory node for garbage collection */
30 	mem_node *gcnode;
31 #endif
32 };
33 
34 
35 SWFFill
newSWFFill(SWFFillStyle fillstyle)36 newSWFFill(SWFFillStyle fillstyle)
37 {
38 	SWFFill fill;
39 	if(fillstyle == NULL)
40 		return NULL;
41 
42 	fill = (SWFFill)malloc(sizeof(struct SWFFill_s));
43 
44 	fill->fillstyle = fillstyle;
45 	fill->position = newSWFPosition(SWFFillStyle_getMatrix(fill->fillstyle));
46 
47 #if TRACK_ALLOCS
48 	fill->gcnode = ming_gc_add_node(fill, (dtorfunctype) destroySWFFill);
49 #endif
50 
51 	return fill;
52 }
53 
54 
55 SWFFillStyle
SWFFill_getFillStyle(SWFFill fill)56 SWFFill_getFillStyle(SWFFill fill)
57 {
58 	return fill->fillstyle;
59 }
60 
61 
62 void
destroySWFFill(SWFFill fill)63 destroySWFFill(SWFFill fill)
64 {
65 	destroySWFPosition(fill->position);
66 #if TRACK_ALLOCS
67 	ming_gc_remove_node(fill->gcnode);
68 #endif
69 	free(fill);
70 }
71 
72 
73 void
SWFFill_skewX(SWFFill fill,float x)74 SWFFill_skewX(SWFFill fill, float x)
75 {
76 	SWFPosition_skewX(fill->position, x);
77 }
78 
79 
80 void
SWFFill_skewXTo(SWFFill fill,float x)81 SWFFill_skewXTo(SWFFill fill, float x)
82 {
83 	SWFPosition_skewXTo(fill->position, x);
84 }
85 
86 
87 void
SWFFill_skewY(SWFFill fill,float y)88 SWFFill_skewY(SWFFill fill, float y)
89 {
90 	SWFPosition_skewY(fill->position, y);
91 }
92 
93 
94 void
SWFFill_skewYTo(SWFFill fill,float y)95 SWFFill_skewYTo(SWFFill fill, float y)
96 {
97 	SWFPosition_skewYTo(fill->position, y);
98 }
99 
100 
101 void
SWFFill_scaleX(SWFFill fill,float x)102 SWFFill_scaleX(SWFFill fill, float x)
103 {
104 	SWFPosition_scaleX(fill->position, x);
105 }
106 
107 
108 void
SWFFill_scaleXTo(SWFFill fill,float x)109 SWFFill_scaleXTo(SWFFill fill, float x)
110 {
111 	SWFPosition_scaleXTo(fill->position, x);
112 }
113 
114 
115 void
SWFFill_scaleY(SWFFill fill,float y)116 SWFFill_scaleY(SWFFill fill, float y)
117 {
118 	SWFPosition_scaleY(fill->position, y);
119 }
120 
121 
122 void
SWFFill_scaleYTo(SWFFill fill,float y)123 SWFFill_scaleYTo(SWFFill fill, float y)
124 {
125 	SWFPosition_scaleYTo(fill->position, y);
126 }
127 
128 
129 void
SWFFill_scaleXY(SWFFill fill,float x,float y)130 SWFFill_scaleXY(SWFFill fill, float x, float y)
131 {
132 	SWFPosition_scaleXY(fill->position, x, y);
133 }
134 
135 
136 void
SWFFill_scaleXYTo(SWFFill fill,float x,float y)137 SWFFill_scaleXYTo(SWFFill fill, float x, float y)
138 {
139 	SWFPosition_scaleXYTo(fill->position, x, y);
140 }
141 
142 
143 void
SWFFill_rotate(SWFFill fill,float degrees)144 SWFFill_rotate(SWFFill fill, float degrees)
145 {
146 	SWFPosition_rotate(fill->position, degrees);
147 }
148 
149 
150 void
SWFFill_rotateTo(SWFFill fill,float degrees)151 SWFFill_rotateTo(SWFFill fill, float degrees)
152 {
153 	SWFPosition_rotateTo(fill->position, degrees);
154 }
155 
156 
157 void
SWFFill_move(SWFFill fill,float x,float y)158 SWFFill_move(SWFFill fill, float x, float y)
159 {
160 	SWFPosition_move(fill->position, x, y);
161 }
162 
163 
164 void
SWFFill_moveTo(SWFFill fill,float x,float y)165 SWFFill_moveTo(SWFFill fill, float x, float y)
166 {
167 	SWFPosition_moveTo(fill->position, x, y);
168 }
169 
170 
171 void
SWFFill_setMatrix(SWFFill fill,float a,float b,float c,float d,float x,float y)172 SWFFill_setMatrix(SWFFill fill, float a, float b,
173 									float c, float d, float x, float y)
174 {
175 	SWFPosition_setMatrix(fill->position, a, b, c, d, x, y);
176 }
177 
178 
179 /*
180  * Local variables:
181  * tab-width: 2
182  * c-basic-offset: 2
183  * End:
184  */
185