- if(!color)
- return NULL;
-
- tag->tag = swf_InsertTag(0, ST_SETBACKGROUNDCOLOR);
- RGBA rgba = color_getRGBA(color);
- swf_SetU8(tag->tag, rgba.r);
- swf_SetU8(tag->tag, rgba.g);
- swf_SetU8(tag->tag, rgba.b);
- 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);
- return (PyObject*)tag;
-}
-//----------------------------------------------------------------------------
-static PyObject* f_DefineFont(PyObject* self, PyObject* args, PyObject* kwargs)
-{
- static char *kwlist[] = {"filename", NULL};
- char*filename = 0;
- TagObject*tag;
- SWFFONT* font;
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|s", kwlist, &filename))
- return NULL;
-
- font = swf_LoadFont(filename);
- if(!font) {
- PyErr_SetString(PyExc_Exception, setError("Could not load %s", filename));
- return NULL;
- }
-
- tag = (TagObject*)tag_new();
- tag->font = font;
- tag->tag = swf_InsertTag(0, ST_DEFINEFONT2);
- tag->font->id = 0;
- swf_FontSetDefine2(tag->tag, tag->font);
- mylog("+%08x(%d) DefineFont\n", (int)tag, tag->ob_refcnt);
- return (PyObject*)tag;
-}
-static SWFFONT* fonttag_getSWFFONT(PyObject*self)
-{
- PY_ASSERT_TYPE(self, &TagClass);
- TagObject*font = (TagObject*)self;
- return font->font;
-}
-//----------------------------------------------------------------------------
-static PyObject* f_Protect(PyObject* self, PyObject* args, PyObject* kwargs)
-{
- static char *kwlist[] = {"password", NULL};
- char*password = 0;
- TagObject*tag;
-
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|s", kwlist, &password))
- return NULL;
-
- tag = (TagObject*)tag_new();
- tag->tag = swf_InsertTag(0, ST_PROTECT);
- if(password) {
- swf_SetPassword(tag->tag, password);