+ int filled = PyInt_AsLong(pfilled_perc);
+ int bwidth = pborderWidth ? PyInt_AsLong(pborderWidth) : 2;
+
+ eRect rect(x, y, width, height);
+ painter.clip(rect);
+ if (pbackColor || pbackColorSelected || pforeColor)
+ {
+ gRegion rc(rect);
+ clearRegion(painter, style, local_style, pforeColor, pbackColor, pbackColorSelected, selected, rc, sel_clip);
+ reset_colors=true;
+ }
+
+ // border
+ rect.setRect(x, y, width, bwidth);
+ painter.fill(rect);
+
+ rect.setRect(x, y+bwidth, bwidth, height-bwidth);
+ painter.fill(rect);
+
+ rect.setRect(x+bwidth, y+height-bwidth, width-bwidth, bwidth);
+ painter.fill(rect);
+
+ rect.setRect(x+width-bwidth, y+bwidth, bwidth, height-bwidth);
+ painter.fill(rect);
+
+ // progress
+ rect.setRect(x+bwidth, y+bwidth, (width-bwidth*2) * filled / 100, height-bwidth*2);
+ painter.fill(rect);
+
+ painter.clippop();
+
+ break;
+ }
+ case TYPE_PIXMAP_ALPHATEST:
+ case TYPE_PIXMAP: // pixmap
+ {
+ /*
+ (2, x, y, width, height, pixmap [, backColor, backColorSelected] )
+ */
+
+ ePyObject px = PyTuple_GET_ITEM(item, 1),
+ py = PyTuple_GET_ITEM(item, 2),
+ pwidth = PyTuple_GET_ITEM(item, 3),
+ pheight = PyTuple_GET_ITEM(item, 4),
+ ppixmap = PyTuple_GET_ITEM(item, 5),
+ pbackColor, pbackColorSelected;
+
+ if (!(px && py && pwidth && pheight && ppixmap))
+ {
+ eDebug("eListboxPythonMultiContent received too small tuple (must be (TYPE_PIXMAP, x, y, width, height, pixmap [, backColor, backColorSelected] ))");
+ goto error_out;
+ }
+
+ int x = PyInt_AsLong(px) + offset.x();
+ int y = PyInt_AsLong(py) + offset.y();
+ int width = PyInt_AsLong(pwidth);
+ int height = PyInt_AsLong(pheight);
+ ePtr<gPixmap> pixmap;
+ if (SwigFromPython(pixmap, ppixmap))
+ {
+ eDebug("eListboxPythonMultiContent (Pixmap) get pixmap failed");
+ goto error_out;
+ }
+
+ if (size > 6)
+ {
+ pbackColor = PyTuple_GET_ITEM(item, 6);
+ if (pbackColor == Py_None)
+ pbackColor=ePyObject();
+ }
+ if (size > 7)
+ {
+ pbackColorSelected = PyTuple_GET_ITEM(item, 7);
+ if (pbackColorSelected == Py_None)
+ pbackColorSelected=ePyObject();
+ }
+
+ eRect rect(x, y, width, height);
+ painter.clip(rect);
+ if (pbackColor || pbackColorSelected)
+ {
+ gRegion rc(rect);
+ clearRegion(painter, style, local_style, ePyObject(), pbackColor, pbackColorSelected, selected, rc, sel_clip);
+ reset_colors=true;
+ }