2 #include "primitives.h"
9 //----------------------------------------------------------------------------
11 typedef struct _font_internal
15 staticforward tag_internals_t font_tag;
17 static int font_parse(tag_internals_t*self)
19 font_internal_t*font = (font_internal_t*)self->data;
21 PyErr_SetString(PyExc_Exception, setError("Font parsing not implemented yet"));
24 static void font_dealloc(tag_internals_t*self)
26 font_internal_t*font = (font_internal_t*)self->data;
28 swf_FontFree(font->font);
32 static int font_fillTAG(tag_internals_t*self)
34 font_internal_t*fi = (font_internal_t*)self->data;
37 self->tag = swf_InsertTag(0, ST_DEFINEFONT2);
38 swf_FontSetDefine2(self->tag, fi->font);
41 static PyObject* f_DefineFont(PyObject* self, PyObject* args, PyObject* kwargs)
43 static char *kwlist[] = {"filename", NULL};
48 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|s", kwlist, &filename))
51 font = swf_LoadFont(filename);
53 PyErr_SetString(PyExc_Exception, setError("Could not load %s", filename));
57 tag = tag_new(&font_tag);
58 tag_internals_t*itag = tag_getinternals(tag);
59 font_internal_t*fi = (font_internal_t*)itag->data;
62 return (PyObject*)tag;
64 static SWFFONT* font_getSWFFONT(PyObject*self)
66 PY_ASSERT_TYPE(self, &TagClass);
67 tag_internals_t*itag = tag_getinternals(self);
68 font_internal_t*fi = (font_internal_t*)itag->data;
71 static tag_internals_t font_tag =
74 fillTAG: font_fillTAG,
75 dealloc: font_dealloc,
79 datasize: sizeof(font_internal_t),
81 //----------------------------------------------------------------------------
83 typedef struct _placeobject_internal
86 } placeobject_internal_t;
87 staticforward tag_internals_t placeobject_tag;
89 static void po_dealloc(tag_internals_t*self)
91 placeobject_internal_t*pi = (placeobject_internal_t*)self->data;
93 swf_PlaceObjectFree(pi->po);
97 static int po_parse(tag_internals_t*self)
99 placeobject_internal_t*pi = (placeobject_internal_t*)self->data;
101 PyErr_SetString(PyExc_Exception, setError("Font parsing not implemented yet"));
104 static int po_fillTAG(tag_internals_t*self)
106 placeobject_internal_t*pi = (placeobject_internal_t*)self->data;
107 self->tag = swf_InsertTag(0, ST_PLACEOBJECT2);
108 swf_SetPlaceObject(self->tag, pi->po);
111 static PyObject* po_create(PyObject* self, PyObject* args, PyObject* kwargs,char move)
113 static char *kwlist[] = {"character", "depth", "matrix", "colortransform", "ratio", "name", "clipdepth", "action", NULL};
115 PyObject*character = 0;
124 po = malloc(sizeof(SWFPLACEOBJECT));
125 memset(po, 0, sizeof(SWFPLACEOBJECT));
127 swf_GetPlaceObject(0, po);
129 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Oi|O!O!isiO!", kwlist,
132 &MatrixClass, &matrix,
133 &CXFormClass, &cxform,
137 &ActionClass, &action
141 po->clipdepth = clipdepth;
145 if(clipdepth) po->clipdepth = clipdepth;
146 if(matrix) po->matrix = matrix_getMatrix(matrix);
147 if(cxform) po->cxform = colortransform_getCXForm(cxform);
148 if(action) po->actions = action_getAction(action);
151 tag = tag_new(&placeobject_tag);
152 tag_internals_t*itag = tag_getinternals(tag);
153 placeobject_internal_t*pi = (placeobject_internal_t*)itag->data;
156 pi->po->id = tagmap_add(itag->tagmap,(PyObject*)character);
161 mylog("+%08x(%d) PlaceObject %08x(%d)\n", (int)tag, tag->ob_refcnt, character, character->ob_refcnt);
163 return (PyObject*)tag;
165 static PyObject* f_PlaceObject(PyObject* self, PyObject* args, PyObject* kwargs)
167 return po_create(self, args, kwargs, 0);
169 static PyObject* f_MoveObject(PyObject* self, PyObject* args, PyObject* kwargs)
171 return po_create(self, args, kwargs, 1);
173 static tag_internals_t placeobject_tag =
181 datasize: sizeof(placeobject_internal_t),
183 //----------------------------------------------------------------------------
184 staticforward tag_internals_t bgcolor_tag;
185 static PyObject* tag_setbackgroundcolor_getrgb(PyObject * self, PyObject*other)
187 tag_internals_t*itag = tag_getinternals(self);
189 r = itag->tag->data[0];
190 g = itag->tag->data[1];
191 b = itag->tag->data[2];
192 return Py_BuildValue("(iii)", r,g,b);
194 static PyMethodDef setbgcolor_methods[] =
195 {{"getRGB", tag_setbackgroundcolor_getrgb, METH_VARARGS, "get's the color set by this tag"},
196 {NULL, NULL, 0, NULL}
198 static PyObject* f_SetBackgroundColor(PyObject* self, PyObject* args, PyObject* kwargs)
200 static char *kwlist[] = {"color", NULL};
205 tag = tag_new(&bgcolor_tag);
206 tag_internals_t*itag = tag_getinternals(tag);
208 /* 1st try- copy constructor */
209 if(!PyArg_ParseTupleAndKeywords(args, kwargs, "O!", kwlist, &ColorClass, &color)) {
211 /* 2nd try- color's contructor */
212 color = f_Color(NULL, args, kwargs);
217 itag->tag = swf_InsertTag(0, ST_SETBACKGROUNDCOLOR);
218 RGBA rgba = color_getRGBA(color);
219 swf_SetU8(itag->tag, rgba.r);
220 swf_SetU8(itag->tag, rgba.g);
221 swf_SetU8(itag->tag, rgba.b);
222 mylog(" %08x(%d) SetBackgroundColor(%02x,%02x,%02x) (colorobj=%08x(%d))\n", (int)tag, tag->ob_refcnt, rgba.r, rgba.g, rgba.b, color, color->ob_refcnt);
224 return (PyObject*)tag;
226 static tag_internals_t bgcolor_tag =
233 tagfunctions: setbgcolor_methods,
236 //----------------------------------------------------------------------------
237 staticforward tag_internals_t protect_tag;
238 static PyObject* f_Protect(PyObject* self, PyObject* args, PyObject* kwargs)
240 static char *kwlist[] = {"password", NULL};
243 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|s", kwlist, &password))
246 PyObject*tag = tag_new(&protect_tag);
247 tag_internals_t*itag = tag_getinternals(tag);
248 itag->tag = swf_InsertTag(0, ST_PROTECT);
250 swf_SetPassword(itag->tag, password);
252 mylog("+%08x(%d) f_Protect", (int)tag, tag->ob_refcnt);
253 return (PyObject*)tag;
255 static tag_internals_t protect_tag =
265 //----------------------------------------------------------------------------
266 staticforward tag_internals_t showframe_tag;
267 static PyObject* f_ShowFrame(PyObject* self, PyObject* args, PyObject* kwargs)
269 static char *kwlist[] = {"name", NULL};
271 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|s", kwlist, &name))
274 PyObject*tag = tag_new(&showframe_tag);
275 tag_internals_t*itag = tag_getinternals(tag);
276 itag->tag = swf_InsertTag(0, ST_SHOWFRAME);
277 mylog("+%08x(%d) f_ShowFrame", (int)tag, tag->ob_refcnt);
278 return (PyObject*)tag;
280 static tag_internals_t showframe_tag =
290 //----------------------------------------------------------------------------
291 staticforward tag_internals_t removeobject_tag;
292 static PyObject* f_RemoveObject(PyObject* self, PyObject* args, PyObject* kwargs)
294 static char *kwlist[] = {"depth", NULL};
296 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "i", kwlist, &depth))
299 PyObject*tag = tag_new(&removeobject_tag);
300 tag_internals_t*itag = tag_getinternals(tag);
301 itag->tag = swf_InsertTag(0, ST_REMOVEOBJECT);
302 swf_SetU16(itag->tag, depth);
303 mylog("+%08x(%d) f_RemoveObject", (int)tag, tag->ob_refcnt);
304 return (PyObject*)tag;
306 static tag_internals_t removeobject_tag =
316 //----------------------------------------------------------------------------
317 staticforward tag_internals_t sprite_tag;
318 typedef struct _sprite_internal
323 static int sprite_fillTAG(tag_internals_t*self)
325 mylog("+%08x(?) sprite_fillTAG", (int)self);
327 sprite_internal_t*si = (sprite_internal_t*)self->data;
329 TAG*sprite = swf_InsertTag(0, ST_DEFINESPRITE);
330 swf_SetU16(sprite, 0); //id
331 swf_SetU16(sprite, 0); //frames
333 TAG*tag = taglist_getTAGs2(si->taglist, self->tagmap, 0);
335 /* pass through exception */
339 while(tag2->next) tag2 = tag2->next;
340 swf_InsertTag(tag2, ST_END);
345 swf_FoldSprite(sprite);
350 static PyObject* f_Sprite(PyObject* self, PyObject* args, PyObject* kwargs)
352 static char *kwlist[] = {"name", NULL};
354 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|s", kwlist, &name))
357 PyObject*tag = tag_new(&sprite_tag);
358 tag_internals_t*itag = tag_getinternals(tag);
359 sprite_internal_t*si = (sprite_internal_t*)itag->data;
360 si->taglist = taglist_new();
361 mylog("+%08x(%d) f_DefineSprite", (int)tag, tag->ob_refcnt);
362 return (PyObject*)tag;
364 static PyObject* sprite_getattr(tag_internals_t*self,char*a)
366 sprite_internal_t*si = (sprite_internal_t*)self->data;
367 if(!strcmp(a, "tags")) {
368 Py_INCREF(si->taglist);
373 static int sprite_setattr(tag_internals_t*self,char*a, PyObject*obj)
375 sprite_internal_t*si = (sprite_internal_t*)self->data;
377 swf_DeleteTag(self->tag);
380 if(!strcmp(a, "tags")) {
381 PY_ASSERT_TYPE(obj,&TagListClass);
382 Py_DECREF(si->taglist);
384 Py_INCREF(si->taglist);
389 static tag_internals_t sprite_tag =
392 fillTAG: sprite_fillTAG,
394 getattr: sprite_getattr,
395 setattr: sprite_setattr,
397 datasize: sizeof(sprite_internal_t),
399 //----------------------------------------------------------------------------
400 staticforward tag_internals_t end_tag;
401 static tag_internals_t end_tag =
411 //----------------------------------------------------------------------------
412 staticforward tag_internals_t text_tag;
414 typedef struct _text_internal
421 staticforward tag_internals_t placeobject_tag;
423 static int text_fillTAG(tag_internals_t*self)
425 text_internal_t*ti = (text_internal_t*)self->data;
426 self->tag= swf_InsertTag(0, ST_DEFINETEXT2);
427 swf_SetU16(self->tag, /*ID*/0);
428 SRECT r = swf_SetDefineText(self->tag, ti->swffont, &ti->rgba, ti->text, ti->size);
431 static PyObject* f_DefineText(PyObject* self, PyObject* args, PyObject* kwargs)
433 static char *kwlist[] = {"font", "text", "size", "color", NULL};
438 RGBA rgba = {255,0,0,0};
442 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!Oi|O!", kwlist, &TagClass, &font, &otext, &size, &ColorClass, &color))
444 text = PyString_AS_STRING(PyUnicode_AsUTF8String(otext));
447 rgba = color_getRGBA(color);
449 mylog("DefineText: text = %s", text);
451 tag = tag_new(&text_tag);
452 tag_internals_t* itag = tag_getinternals(tag);
453 text_internal_t*ti = (text_internal_t*)itag->data;
455 ti->swffont = font_getSWFFONT(font);
456 int font_id = tagmap_add(itag->tagmap, font); // add dependency on font
457 ti->swffont->id = font_id; // for swf_SetDefineTexts
458 ti->text = strdup(text);
462 return (PyObject*)tag;
464 static tag_internals_t text_tag =
467 fillTAG: text_fillTAG,
472 datasize: sizeof(text_internal_t),
474 //----------------------------------------------------------------------------
475 staticforward tag_internals_t image_tag;
477 typedef struct _image_internal
487 staticforward tag_internals_t image_tag;
489 static int image_fillTAG(tag_internals_t*self)
491 image_internal_t*ti = (image_internal_t*)self->data;
492 self->tag= swf_InsertTag(0, ST_DEFINEBITSLOSSLESS2);
493 swf_SetU16(self->tag, /*ID*/0);
494 swf_SetLosslessBits(self->tag, ti->width, ti->height, ti->rgba, BMF_32BIT);
497 static void image_dealloc(tag_internals_t*self)
499 image_internal_t*pi = (image_internal_t*)self->data;
501 free(pi->rgba);pi->rgba = 0;
504 static int imagetag_getWidth(PyObject* self)
506 tag_internals_t*itag = tag_getinternals(self);
507 image_internal_t*pi = (image_internal_t*)itag->data;
510 static int imagetag_getHeight(PyObject* self)
512 tag_internals_t*itag = tag_getinternals(self);
513 image_internal_t*pi = (image_internal_t*)itag->data;
516 static PyObject* f_DefineImage(PyObject* self, PyObject* args, PyObject* kwargs)
518 static char *kwlist[] = {"image"};
520 PyObject*tag = tag_new(&image_tag);
522 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O", kwlist, &image))
525 tag = tag_new(&image_tag);
526 tag_internals_t* itag = tag_getinternals(tag);
527 image_internal_t*ti = (image_internal_t*)itag->data;
529 ti->rgba = image_toRGBA(image);
530 if(!ti->rgba) // pass through exception
532 ti->width = image_getWidth(image);
533 ti->height = image_getHeight(image);
537 ti->size = ti->width*ti->height;
539 return (PyObject*)tag;
541 static tag_internals_t image_tag =
544 fillTAG: image_fillTAG,
545 dealloc: image_dealloc,
549 datasize: sizeof(image_internal_t),
551 //----------------------------------------------------------------------------
552 staticforward tag_internals_t shape_tag;
554 typedef struct _shape_internal
558 staticforward tag_internals_t shape_tag;
560 static int shape_fillTAG(tag_internals_t*self)
562 shape_internal_t*ti = (shape_internal_t*)self->data;
563 self->tag= swf_InsertTag(0, ST_DEFINESHAPE3);
564 swf_SetU16(self->tag, /*ID*/0);
565 swf_SetShape2(self->tag, ti->shape);
568 static void shape_dealloc(tag_internals_t*self)
570 shape_internal_t*pi = (shape_internal_t*)self->data;
572 swf_Shape2Free(pi->shape);
576 static PyObject* f_DefineImageShape(PyObject* self, PyObject* args, PyObject* kwargs)
578 static char *kwlist[] = {"image"};
580 PyObject*tag = tag_new(&shape_tag);
583 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!", kwlist, &TagClass, &image))
586 tag = tag_new(&shape_tag);
587 tag_internals_t* itag = tag_getinternals(tag);
588 shape_internal_t*ti = (shape_internal_t*)itag->data;
589 ti->shape = 0; /*HACK*/
591 int width = imagetag_getWidth(image);
592 int height = imagetag_getHeight(image);
593 int id = tagmap_add(itag->tagmap, image);
594 itag->tag= swf_InsertTag(0, ST_DEFINESHAPE3);
595 swf_SetU16(itag->tag, 0);
596 swf_ShapeSetBitmapRect(itag->tag, id, width, height);
597 return (PyObject*)tag;
599 static tag_internals_t shape_tag =
602 fillTAG: shape_fillTAG,
603 dealloc: shape_dealloc,
607 datasize: sizeof(shape_internal_t),
609 //----------------------------------------------------------------------------
611 typedef struct _videostream_internal
615 } videostream_internal_t;
616 staticforward tag_internals_t videostream_tag;
617 staticforward tag_internals_t videoframe_tag;
619 static int videostream_parse(tag_internals_t*self)
621 videostream_internal_t*videostream = (videostream_internal_t*)self->data;
623 PyErr_SetString(PyExc_Exception, setError("videostream parsing not implemented yet"));
626 static void videostream_dealloc(tag_internals_t*self)
628 videostream_internal_t*videostream = (videostream_internal_t*)self->data;
629 if(videostream->stream) {
630 swf_VideoStreamClear(videostream->stream);
631 free(videostream->stream);
632 videostream->stream = 0;
635 static int videostream_fillTAG(tag_internals_t*self)
637 videostream_internal_t*fi = (videostream_internal_t*)self->data;
640 PyErr_SetString(PyExc_Exception, setError("videostream filling not implemented"));
643 static PyObject* f_DefineVideoStream(PyObject* self, PyObject* args, PyObject* kwargs)
645 PyObject*tag = tag_new(&videostream_tag);
647 int width=0,height=0,frames=65535;
648 static char *kwlist[] = {"width", "height", "frames", NULL};
649 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "ii|i", kwlist, &width, &height, &frames))
652 printf(": %d %d\n", width, height);
654 tag_internals_t*itag = tag_getinternals(tag);
655 videostream_internal_t*fi = (videostream_internal_t*)itag->data;
656 fi->stream = malloc(sizeof(VIDEOSTREAM));
657 memset(fi->stream, 0, sizeof(VIDEOSTREAM));
659 TAG*t = swf_InsertTag(0, ST_DEFINEVIDEOSTREAM);
660 swf_SetU16(t, 0); /* id */
661 swf_SetVideoStreamDefine(t, fi->stream, frames, width, height);
663 fi->lastiframe = -65536;
664 return (PyObject*)tag;
666 static VIDEOSTREAM* videostream_getVIDEOSTREAM(PyObject*self)
668 PY_ASSERT_TYPE(self, &TagClass);
669 tag_internals_t*itag = tag_getinternals(self);
670 videostream_internal_t*fi = (videostream_internal_t*)itag->data;
673 static PyObject* videostream_getbwidth(PyObject*self, PyObject*args)
675 tag_internals_t*itag = tag_getinternals(self);
676 videostream_internal_t*fi = (videostream_internal_t*)itag->data;
677 int width = fi->stream->bbx;
678 return Py_BuildValue("i", width);
680 static PyObject* videostream_getbheight(PyObject*self, PyObject*args)
682 tag_internals_t*itag = tag_getinternals(self);
683 videostream_internal_t*fi = (videostream_internal_t*)itag->data;
684 int height = fi->stream->bby;
685 return Py_BuildValue("i", height);
687 static PyObject* videostream_addFrame(PyObject*self, PyObject*args, PyObject*kwargs)
689 tag_internals_t*_itag = tag_getinternals(self);
690 videostream_internal_t*fi = (videostream_internal_t*)_itag->data;
693 char*type=0; // none, "i", "p"
695 static char *kwlist[] = {"image", "quant", "type", NULL};
696 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|is", kwlist, &image, &quant, &type))
698 if(fi->stream->width != image_getWidth(image)) {
699 PyErr_SetString(PyExc_Exception, setError("bad image width %d!=%d", image_getWidth(image), fi->stream->width));return 0;
701 if(fi->stream->height != image_getHeight(image)) {
702 PyErr_SetString(PyExc_Exception, setError("bad image width %d!=%d", image_getHeight(image), fi->stream->height));return 0;
704 PyObject*tag = tag_new(&videoframe_tag);
705 tag_internals_t*itag = tag_getinternals(tag);
707 RGBA*pic = image_toRGBA(image);
712 { int f,j=0,i=0,rr,gg,bb;
715 char*filename="test.ppm";
716 printf("Creating %s %dx%d\n",filename, 512,512);
717 o=fopen(filename, "wb");
718 fprintf(o,"P6\n%d %d\n255\n",512, 512);
724 fprintf(o,"%c%c%c",rr,gg,bb);
731 TAG* t = swf_InsertTag(0, ST_VIDEOFRAME);
732 if((type && (type[0]=='I' || type[0]=='i')) || (type==0 && fi->lastiframe+64 < fi->stream->frame)) {
733 swf_SetU16(t,0); /* id */
734 swf_SetVideoStreamIFrame(t, fi->stream, pic, quant);
735 fi->lastiframe = fi->stream->frame;
738 swf_SetVideoStreamPFrame(t, fi->stream, pic, quant);
741 tagmap_addMapping(itag->tagmap, 0, self);
745 static PyObject* videostream_addDistortionFrame(PyObject*self, PyObject*args, PyObject*kwargs)
747 tag_internals_t*_itag = tag_getinternals(self);
748 videostream_internal_t*fi = (videostream_internal_t*)_itag->data;
750 static char *kwlist[] = {"image", "quant", NULL};
753 if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i", kwlist, &array, &quant))
756 signed char* movex = malloc(fi->stream->bbx * fi->stream->bby);
757 signed char* movey = malloc(fi->stream->bbx * fi->stream->bby);
758 signed char* itx=movex;
759 signed char* ity=movey;
761 if(!array || !PySequence_Check(array))
762 return PY_ERROR("Not an array");
763 if(PySequence_Length(array) < fi->stream->bby)
764 return PY_ERROR("Array (y) has to have at least %d elements, but has only %d ", fi->stream->bby, PySequence_Length(array));
765 for(y=0;y<fi->stream->bby;y++) {
766 PyObject*line = PySequence_GetItem(array, y);
767 if(!line || !PySequence_Check(line))
768 return PY_ERROR("Not an array of arrays");
769 if(PySequence_Length(line) < fi->stream->bbx)
770 return PY_ERROR("Inner arrays (x) have to be at least %d long- %dth is only %d", fi->stream->bbx, y, PySequence_Length(line));
772 for(x=0;x<fi->stream->bbx;x++) {
773 PyObject*pixel = PySequence_GetItem(line, x);
778 if(!PyComplex_Check(pixel)) {
779 return PY_ERROR("Not an array of arrays of complex numbers");
781 *itx = (signed char)PyComplex_RealAsDouble(pixel);
782 *ity = (signed char)PyComplex_ImagAsDouble(pixel);
789 PyObject*tag = tag_new(&videoframe_tag);
790 tag_internals_t*itag = tag_getinternals(tag);
792 TAG* t = swf_InsertTag(0, ST_VIDEOFRAME);
793 swf_SetU16(t,0); /* id */
794 swf_SetVideoStreamMover(t, fi->stream, movex, movey, quant);
797 tagmap_addMapping(itag->tagmap, 0, self);
804 static PyMethodDef videostream_methods[] =
805 {{"xblocks", videostream_getbwidth, METH_VARARGS, "get's the number of horizontal blocks"},
806 {"yblocks", videostream_getbheight, METH_VARARGS, "get's the number of vertical blocks"},
807 {"addFrame", (PyCFunction)videostream_addFrame, METH_KEYWORDS, "add a Video Frame"},
808 {"addDistortionFrame", (PyCFunction)videostream_addDistortionFrame, METH_KEYWORDS, "add a MVD frame"},
809 {NULL, NULL, 0, NULL}
812 static tag_internals_t videostream_tag =
814 parse: videostream_parse,
815 fillTAG: videostream_fillTAG,
816 dealloc: videostream_dealloc,
819 tagfunctions: videostream_methods,
820 datasize: sizeof(videostream_internal_t),
823 //============================================================================
825 static tag_internals_t videoframe_tag =
836 //============================================================================
838 static PyMethodDef TagMethods[] =
841 {"BackgroundColor", (PyCFunction)f_SetBackgroundColor, METH_KEYWORDS, "Create a SetBackGroundColor Tag."},
842 {"Protect", (PyCFunction)f_Protect, METH_KEYWORDS, "Create a Protect Tag."},
843 {"Font", (PyCFunction)f_DefineFont, METH_KEYWORDS, "Create a DefineFont Tag."},
844 {"Text", (PyCFunction)f_DefineText, METH_KEYWORDS, "Create a DefineText Tag."},
845 {"PlaceObject", (PyCFunction)f_PlaceObject, METH_KEYWORDS, "Create a PlaceObject Tag."},
846 {"RemoveObject", (PyCFunction)f_RemoveObject, METH_KEYWORDS, "Create a RemoveObject Tag."},
847 {"MoveObject", (PyCFunction)f_MoveObject, METH_KEYWORDS, "Create a PlaceObject Move Tag."},
848 {"VideoStream", (PyCFunction)f_DefineVideoStream, METH_KEYWORDS, "Create a Videostream."},
849 {"Image", (PyCFunction)f_DefineImage, METH_KEYWORDS, "Create an SWF Image Tag."},
850 {"ImageShape", (PyCFunction)f_DefineImageShape, METH_KEYWORDS, "Create an SWF Image Shape Tag."},
851 {"ShowFrame", (PyCFunction)f_ShowFrame, METH_KEYWORDS, "Create an SWF Show Frame Tag."},
852 {"Sprite", (PyCFunction)f_Sprite, METH_KEYWORDS, "Create an SWF Sprite Tag."},
853 {NULL, NULL, 0, NULL}
855 PyMethodDef* tags_getMethods()
857 TagClass.ob_type = &PyType_Type;
859 register_tag(ST_PLACEOBJECT,&placeobject_tag);
860 register_tag(ST_PLACEOBJECT2,&placeobject_tag);
861 register_tag(ST_REMOVEOBJECT,&removeobject_tag);
862 register_tag(ST_REMOVEOBJECT2,&removeobject_tag);
863 register_tag(ST_SETBACKGROUNDCOLOR,&bgcolor_tag);
864 register_tag(ST_DEFINEFONT,&font_tag);
865 register_tag(ST_PROTECT,&protect_tag);
866 register_tag(ST_DEFINETEXT,&text_tag);
867 register_tag(ST_DEFINEBITSJPEG,&image_tag);
868 register_tag(ST_DEFINEBITSJPEG2,&image_tag);
869 register_tag(ST_DEFINEBITSJPEG3,&image_tag);
870 register_tag(ST_DEFINEBITSLOSSLESS,&image_tag);
871 register_tag(ST_DEFINEBITSLOSSLESS2,&image_tag);
872 register_tag(ST_SHOWFRAME,&showframe_tag);
873 register_tag(ST_DEFINEVIDEOSTREAM,&videostream_tag);
874 register_tag(ST_VIDEOFRAME,&videoframe_tag);
875 register_tag(ST_DEFINESPRITE,&sprite_tag);
876 register_tag(ST_END,&end_tag);