+ if (pforeColor)
+ {
+ unsigned int color = PyInt_AsUnsignedLongMask(pforeColor);
+ painter.setForegroundColor(gRGB(color));
+ }
+ /* if we have a local foreground color set, use that. */
+ else if (local_style && local_style->m_foreground_color_set)
+ painter.setForegroundColor(local_style->m_foreground_color);
+ }
+}
+
+static ePyObject lookupColor(ePyObject color, ePyObject data)
+{
+ if (color == Py_None)
+ return ePyObject();
+
+ if ((!color) && (!data))
+ return color;
+
+ unsigned int icolor = PyInt_AsUnsignedLongMask(color);
+
+ /* check if we have the "magic" template color */
+ if ((icolor & 0xFF000000) == 0xFF000000)
+ {
+ int index = icolor & 0xFFFFFF;
+ eDebug("[eListboxPythonMultiContent] template color index: %d", index);
+ return PyTuple_GetItem(data, index);
+ }
+
+ if (color == Py_None)
+ return ePyObject();
+
+ return color;
+}
+
+void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
+{
+ gRegion itemregion(eRect(offset, m_itemsize));
+ eListboxStyle *local_style = 0;
+ eRect sel_clip(m_selection_clip);
+ bool cursorValid = this->cursorValid();
+ if (sel_clip.valid())
+ sel_clip.moveBy(offset);
+
+ /* get local listbox style, if present */
+ if (m_listbox)
+ local_style = m_listbox->getLocalStyle();
+
+ painter.clip(itemregion);
+ clearRegion(painter, style, local_style, ePyObject(), ePyObject(), ePyObject(), ePyObject(), selected, itemregion, sel_clip, offset, cursorValid);
+
+ ePyObject items, buildfunc_ret;
+
+ if (m_list && cursorValid)
+ {
+ /* a multicontent list can be used in two ways:
+ either each item is a list of (TYPE,...)-tuples,
+ or there is a template defined, which is a list of (TYPE,...)-tuples,
+ and the list is an unformatted tuple. The template then references items from the list.
+ */