From 357b4098faaa5cf537c1e2292521305d95f681b1 Mon Sep 17 00:00:00 2001 From: kramm Date: Fri, 21 Jan 2005 18:52:22 +0000 Subject: [PATCH] applied patch from Daichi Shinozaki. --- lib/python/SWF.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/python/SWF.c b/lib/python/SWF.c index 3bb744a..0c8fd6f 100644 --- a/lib/python/SWF.c +++ b/lib/python/SWF.c @@ -49,7 +49,7 @@ staticforward PyTypeObject SWFClass; typedef struct { PyObject_HEAD - SWF swf; //swf.firstTag ist not used + SWF swf; //swf.firstTag is not used PyObject*taglist; char*filename; } SWFObject; @@ -304,6 +304,18 @@ static PyObject* swf_getattr(PyObject * self, char* a) Py_INCREF(ret); mylog(" %08x(%d) swf_getattr %s = %08x(%d)\n", (int)self, self->ob_refcnt, a, ret, ret->ob_refcnt); return ret; + } else if(!strcmp(a, "filesize")) { + int s = swf->swf.fileSize; + return Py_BuildValue("i", s); + } else if(!strcmp(a, "width")) { + int w = (swf->swf.movieSize.xmax - swf->swf.movieSize.xmin) / 20; + return Py_BuildValue("i", w); + } else if(!strcmp(a, "height")) { + int h = (swf->swf.movieSize.ymax - swf->swf.movieSize.ymin) / 20; + return Py_BuildValue("i", h); + } else if(!strcmp(a, "framecount")) { + int f = swf->swf.frameCount; + return Py_BuildValue("i", f); } ret = Py_FindMethod(swf_functions, self, a); @@ -441,4 +453,3 @@ void initSWF(void) to keep it around */ // free(all_methods) } - -- 1.7.10.4