+static void clearRegionHelper(gPainter &painter, eListboxStyle *local_style, const ePoint &offset, ePyObject &pbackColor, bool cursorValid)
+{
+ if (pbackColor)
+ {
+ unsigned int color = PyInt_AsUnsignedLongMask(pbackColor);
+ painter.setBackgroundColor(gRGB(color));
+ }
+ else if (local_style)
+ {
+ if (local_style && local_style->m_background_color_set)
+ painter.setBackgroundColor(local_style->m_background_color);
+ if (local_style->m_background && cursorValid)
+ {
+ if (local_style->m_transparent_background)
+ painter.blit(local_style->m_background, offset, eRect(), gPainter::BT_ALPHATEST);
+ else
+ painter.blit(local_style->m_background, offset, eRect(), 0);
+ return;
+ }
+ else if (local_style->m_transparent_background)
+ return;
+ }
+ painter.clear();
+}
+
+static void clearRegionSelectedHelper(gPainter &painter, eListboxStyle *local_style, const ePoint &offset, ePyObject &pbackColorSelected, bool cursorValid)
+{
+ if (pbackColorSelected)
+ {
+ unsigned int color = PyInt_AsUnsignedLongMask(pbackColorSelected);
+ painter.setBackgroundColor(gRGB(color));
+ }
+ else if (local_style)
+ {
+ if (local_style && local_style->m_background_color_selected_set)
+ painter.setBackgroundColor(local_style->m_background_color_selected);
+ if (local_style->m_background && cursorValid)
+ {
+ if (local_style->m_transparent_background)
+ painter.blit(local_style->m_background, offset, eRect(), gPainter::BT_ALPHATEST);
+ else
+ painter.blit(local_style->m_background, offset, eRect(), 0);
+ return;
+ }
+ }
+ painter.clear();
+}
+
+static void clearRegion(gPainter &painter, eWindowStyle &style, eListboxStyle *local_style, ePyObject pforeColor, ePyObject pforeColorSelected, ePyObject pbackColor, ePyObject pbackColorSelected, int selected, gRegion &rc, eRect &sel_clip, const ePoint &offset, bool cursorValid)