X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=lib%2Fpython%2FSWF.c;h=9afe7de3e51aeb3c9d2b848327e8330b5d31c1c0;hb=a893580230f258ff41f1f5eab2f2d257ce90359d;hp=5f03825951e85ff445776f9d4c3996d30e6ec9d5;hpb=263d494bd93334ec04c81dcbe47b69675fa23007;p=swftools.git diff --git a/lib/python/SWF.c b/lib/python/SWF.c index 5f03825..9afe7de 100644 --- a/lib/python/SWF.c +++ b/lib/python/SWF.c @@ -25,8 +25,9 @@ #include "../rfxswf.h" #include "../log.h" #include "./pyutils.h" -#include "./tag.h" +#include "./tags.h" #include "./taglist.h" +#include "./primitives.h" /* TODO: @@ -72,8 +73,12 @@ static PyObject* f_create(PyObject* self, PyObject* args, PyObject* kwargs) &obbox, filename)) return NULL; - if (!PyArg_Parse(obbox, "(iiii)", &bbox.xmin, &bbox.ymin, &bbox.xmax, &bbox.ymax)) - return NULL; + if (!PY_CHECK_TYPE(obbox, &BBoxClass)) { + obbox = f_BBox(0, obbox, 0); + if(!obbox) + return NULL; + } + bbox = bbox_getSRECT(obbox); memset(&swf->swf, 0, sizeof(SWF)); if(filename) @@ -123,6 +128,7 @@ static PyObject* f_load(PyObject* self, PyObject* args) return 0; } close(fi); + swf_FoldAll(&swf->swf); swf->taglist = taglist_new2(swf->swf.firstTag); if(swf->taglist == NULL) { @@ -198,7 +204,7 @@ static PyObject * swf_save(PyObject* self, PyObject* args, PyObject* kwargs) } close(fi); - //swf_FreeTags(swf); + swf_FreeTags(swf); /*{ TAG * t = swf->firstTag; while (t) { @@ -216,6 +222,8 @@ static PyObject * swf_save(PyObject* self, PyObject* args, PyObject* kwargs) }*/ swf->firstTag = 0; + mylog(" %08x(%d) f_save filename=%s done\n", (int)self, self->ob_refcnt, filename); + return PY_NONE; } //---------------------------------------------------------------------------- @@ -416,7 +424,7 @@ void initSWF(void) { PyObject*module; PyMethodDef* primitive_methods = primitive_getMethods(); - PyMethodDef* tag_methods = tag_getMethods(); + PyMethodDef* tag_methods = tags_getMethods(); PyMethodDef* action_methods = action_getMethods(); PyMethodDef* swf_methods = swf_getMethods();