1 /* ====================================================================
2  * Copyright (c) 2008 by Klaus Rechert. All rights reserved.
3  * This program is free software; you can redistribute it and/or modify
4  * it under the same terms as Perl itself.
5  * ====================================================================
6  *
7  * $Author$
8  * $Id$
9  */
10 
11 
12 #include "EXTERN.h"
13 #include "perl.h"
14 #include "XSUB.h"
15 
16 #include "SWF.h"
17 #include "perl_swf.h"
18 
19 MODULE = SWF::CXform	PACKAGE = SWF::CXform		PREFIX = SWFCXform_
20 PROTOTYPES: ENABLE
21 
22 SWF::CXform
23 SWFCXform_new(package="SWF::CXform", rAdd=0, gAdd=0, bAdd=0, aAdd=0, rMult=1.0, gMult=1.0, bMult=1.0, aMult=1.0)
24 	char *package
25 	float rAdd
26 	float gAdd
27 	float bAdd
28 	float aAdd
29 	float rMult
30 	float gMult
31 	float bMult
32 	float aMult
33 	CODE:
34 	RETVAL = newSWFCXform(rAdd, gAdd, bAdd, aAdd, rMult, gMult, bMult, aMult);
35 	ST(0) = sv_newmortal();
36 	sv_setref_pv(ST(0), package, (void*)RETVAL);
37 
38 void
39 SWFCXform_setColorAdd(cx, rAdd, gAdd, bAdd, aAdd)
40 	SWF::CXform cx
41 	float rAdd
42 	float gAdd
43 	float bAdd
44 	float aAdd
45 
46 void
47 SWFCXform_setColorMult(cx, rMult, gMult, bMult, aMult)
48 	SWF::CXform cx
49 	float rMult
50 	float gMult
51 	float bMult
52 	float aMult
53 
54 void
55 SWFCXform_DESTROY(cx)
56 	SWF::CXform cx
57 	CODE:
58 /*	destroySWFCXform(cx);					*/
59 /*	removed March 07th, 2009				*/
60 /*	because could be destroyed twice (and segfaults later)  */
61 /*	see destroySWFPlaceObject2Block() in placeobject.c 	*/
62 	S_DEBUG(2, fprintf(stderr, "CXform DESTROY CALLED\n"));
63 	swf_stash_refcnt_dec((SV*)SvRV(ST(0)));
64