+ int flags=gPainter::RT_VALIGN_CENTER,
+ yoffs = 0,
+ xoffs = xoffset;
+ eRect &area = m_element_position[e];
+ std::string text = "<n/a>";
+ xoffset=0;
+
+ switch (e)
+ {
+ case celServiceNumber:
+ {
+ if (m_cursor->flags & eServiceReference::isMarker)
+ continue;
+ char bla[10];
+ /* how we can do this better? :) */
+ int markers_before=0;
+ {
+ list::iterator tmp=m_cursor;
+ while(tmp != m_list.begin())
+ {
+ --tmp;
+ if (tmp->flags & eServiceReference::isMarker)
+ ++markers_before;
+ }
+ }
+ sprintf(bla, "%d", m_numberoffset + m_cursor_number + 1 - markers_before);
+ text = bla;
+ flags|=gPainter::RT_HALIGN_RIGHT;
+ break;
+ }
+ case celServiceName:
+ {
+ if (service_info)
+ service_info->getName(*m_cursor, text);
+ break;
+ }
+ case celServiceInfo:
+ {
+ if ( isPlayable && !service_info->getEvent(*m_cursor, evt) )
+ {
+ std::string name = evt->getEventName();
+ if (!name.length())
+ continue;
+ text = '(' + evt->getEventName() + ')';
+ if (serviceAvail)
+ {
+ if (!selected && m_color_set[serviceDescriptionColor])
+ painter.setForegroundColor(m_color[serviceDescriptionColor]);
+ else if (selected && m_color_set[serviceDescriptionColorSelected])
+ painter.setForegroundColor(m_color[serviceDescriptionColorSelected]);
+ }
+ }
+ else
+ continue;
+ break;
+ }
+ }
+
+ eRect tmp = area;
+ tmp.setWidth(tmp.width()-xoffs);
+
+ eTextPara *para = new eTextPara(tmp);
+ para->setFont(m_element_font[e]);
+ para->renderString(text.c_str());
+
+ if (e == celServiceName)
+ {
+ eRect bbox = para->getBoundBox();
+ int name_width = bbox.width()+8;
+ m_element_position[celServiceInfo].setLeft(area.left()+name_width+xoffs);
+ m_element_position[celServiceInfo].setTop(area.top());
+ m_element_position[celServiceInfo].setWidth(area.width()-(name_width+xoffs));
+ m_element_position[celServiceInfo].setHeight(area.height());
+ }
+
+ if (flags & gPainter::RT_HALIGN_RIGHT)
+ para->realign(eTextPara::dirRight);
+ else if (flags & gPainter::RT_HALIGN_CENTER)
+ para->realign(eTextPara::dirCenter);
+ else if (flags & gPainter::RT_HALIGN_BLOCK)
+ para->realign(eTextPara::dirBlock);
+
+ if (flags & gPainter::RT_VALIGN_CENTER)
+ {
+ eRect bbox = para->getBoundBox();
+ int vcentered_top = (area.height() - bbox.height()) / 2;
+ yoffs = vcentered_top - bbox.top();
+ }
+
+ painter.renderPara(para, offset+ePoint(xoffs, yoffs));
+ }
+ else if (e == celServiceTypePixmap || e == celFolderPixmap || e == celMarkerPixmap)