- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O!i|O!O!isiO!", kwlist,
- &TagClass, &character,
- &depth,
- &MatrixClass, &matrix,
- &CXFormClass, &cxform,
- &ratio,
- &name,
- &clipdepth,
- &ActionClass, &action
- ))
- return NULL;
- po->depth = depth;
- po->id = /*ID*/ 0;
- po->clipdepth = clipdepth;
- po->ratio = ratio;
- po->name = name;
- if(clipdepth) po->clipdepth = clipdepth;
- if(matrix) po->matrix = matrix_getMatrix(matrix);
- if(cxform) po->cxform = colortransform_getCXForm(cxform);
- if(action) po->actions = action_getAction(action);
+struct tag_parser {
+ int id;
+ tag_internals_t*spec;
+} tag_parsers[] = {
+ {ST_PLACEOBJECT,&placeobject_tag},
+ {ST_PLACEOBJECT2,&placeobject_tag},
+ {ST_SETBACKGROUNDCOLOR,&bgcolor_tag},
+ {ST_DEFINEFONT,&font_tag},
+ {ST_PROTECT,&protect_tag},
+ {ST_DEFINETEXT,&text_tag},
+ {-1,0}
+};
+//----------------------------------------------------------------------------
+static void tag_dealloc(PyObject * self)
+{
+ TagObject*tag = (TagObject*)self;
+ if(tag->tag)
+ mylog("-%08x(%d) tag_dealoc [%s]\n", (int)self, self->ob_refcnt, swf_TagGetName(tag->tag));
+ else
+ mylog("-%08x(%d) tag_dealoc [?]\n", (int)self, self->ob_refcnt);
+ if(tag->internals.dealloc) {
+ if(!tag->internals.data)
+ mylog("-%08x(%d) tag_dealoc: Warning: calling dealloc without any data(?)\n", (int)self, self->ob_refcnt);
+ tag->internals.dealloc(tag);
+ }
+ if(tag->internals.data) {
+ free(tag->internals.data);
+ tag->internals.data = 0;
+ }
+ if(tag->tag) {
+ swf_DeleteTag(tag->tag);
+ tag->tag = 0;
+ }
+ Py_DECREF(tag->tagmap);
+ tag->tagmap = 0;
+ PyObject_Del(self);
+}
+//----------------------------------------------------------------------------
+static PyObject* tag_setU8(PyObject * self, PyObject*other)
+{
+ return NULL;
+}
+//----------------------------------------------------------------------------
+static PyMethodDef common_tagfunctions[] =
+{{"setU8", tag_setU8, METH_VARARGS, "sets a byte to the tag data"},
+ {NULL, NULL, 0, NULL}
+};