From: kramm Date: Wed, 9 May 2007 12:08:08 +0000 (+0000) Subject: gfxsource now has a getinfo function X-Git-Tag: buttons-working~640 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=042eafdfeac139b966275672972385f6469e2dff gfxsource now has a getinfo function --- diff --git a/lib/python/gfx.c b/lib/python/gfx.c index 4a4c506..7e5c400 100644 --- a/lib/python/gfx.c +++ b/lib/python/gfx.c @@ -312,11 +312,13 @@ static int page_print(PyObject * _self, FILE *fi, int flags) //--------------------------------------------------------------------- staticforward PyObject* doc_getPage(PyObject* parent, PyObject* args, PyObject* kwargs); +staticforward PyObject* doc_getInfo(PyObject* parent, PyObject* args, PyObject* kwargs); static PyMethodDef doc_methods[] = { /* PDF functions */ {"getPage", (PyCFunction)doc_getPage, METH_KEYWORDS, ""}, + {"getInfo", (PyCFunction)doc_getInfo, METH_KEYWORDS, ""}, {0,0,0,0} }; @@ -341,6 +343,19 @@ static PyObject* doc_getPage(PyObject* _self, PyObject* args, PyObject* kwargs) return (PyObject*)page; } +static PyObject* doc_getInfo(PyObject* _self, PyObject* args, PyObject* kwargs) +{ + DocObject* self = (DocObject*)_self; + + static char *kwlist[] = {"key", NULL}; + char*key = 0; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s", kwlist, &key)) + return NULL; + + char*s = self->doc->getinfo(self->doc, key); + return PyString_FromString(s); +} + static PyObject* f_open(PyObject* parent, PyObject* args, PyObject* kwargs) { static char *kwlist[] = {"type", "filename", NULL};