+ } else if (!strcmp(atype, "mtext"))
+ {
+ PyObject *pvalue = PyTuple_GET_ITEM(value, 1);
+ const char *text = (pvalue && PyString_Check(pvalue)) ? PyString_AsString(pvalue) : "<not-a-string>";
+ int xoffs = value_alignment_left ? 0 : m_seperation;
+ ePtr<eTextPara> para = new eTextPara(eRect(offset + eSize(xoffs, 0), item_right));
+ para->setFont(fnt2);
+ para->renderString(text, 0);
+ para->realign(value_alignment_left ? eTextPara::dirLeft : eTextPara::dirRight);
+ int glyphs = para->size();
+
+ PyObject *plist = 0;
+
+ if (PyTuple_Size(value) >= 3)
+ plist = PyTuple_GET_ITEM(value, 2);
+
+ int entries = 0;
+
+ if (plist && PyList_Check(plist))
+ entries = PyList_Size(plist);
+
+ for (int i = 0; i < entries; ++i)
+ {
+ PyObject *entry = PyList_GET_ITEM(plist, i);
+ int num = PyInt_Check(entry) ? PyInt_AsLong(entry) : -1;
+
+ if ((num < 0) || (num >= glyphs))
+ eWarning("glyph index %d in PythonConfigList out of bounds!");
+ else
+ {
+ para->setGlyphFlag(num, GS_INVERT);
+ eRect bbox;
+ bbox = para->getGlyphBBox(num);
+ bbox = eRect(bbox.left(), offset.y(), bbox.width(), m_itemsize.height());
+ painter.fill(bbox);
+ }
+ /* entry is borrowed */
+ }
+
+ painter.renderPara(para, ePoint(0, 0));
+ /* pvalue is borrowed */
+ /* plist is 0 or borrowed */