its a bad idea to open a screen at every place..
[enigma2.git] / lib / gui / esubtitle.cpp
index 6e8d48e9f5cb46fccd1d9d3a084a0b49f7e48676..80211b4d33dbb43536f0b224db50310ae1817ee8 100644 (file)
@@ -52,13 +52,13 @@ void eSubtitleWidget::setPage(const eDVBTeletextSubtitlePage &p)
 
 void eSubtitleWidget::setPage(const eDVBSubtitlePage &p)
 {
-//     eDebug("setPage");
+       eDebug("setPage");
        m_dvb_page = p;
        invalidate(m_visible_region);  // invalidate old visible regions
        m_visible_region.rects.clear();
        for (std::list<eDVBSubtitleRegion>::iterator it(m_dvb_page.m_regions.begin()); it != m_dvb_page.m_regions.end(); ++it)
        {
-//             eDebug("add %d %d %d %d", it->m_position.x(), it->m_position.y(), it->m_pixmap->size().width(), it->m_pixmap->size().height());
+               eDebug("add %d %d %d %d", it->m_position.x(), it->m_position.y(), it->m_pixmap->size().width(), it->m_pixmap->size().height());
                m_visible_region.rects.push_back(eRect(it->m_position, it->m_pixmap->size()));
        }
        m_dvb_page_ok = 1;
@@ -75,6 +75,12 @@ void eSubtitleWidget::clearPage()
        m_visible_region.rects.clear();
 }
 
+void eSubtitleWidget::setPixmap(ePtr<gPixmap> &pixmap, gRegion changed)
+{
+       m_pixmap = pixmap;
+       invalidate(changed);
+}
+
 int eSubtitleWidget::event(int event, void *data, void *data2)
 {
        switch (event)
@@ -85,14 +91,15 @@ int eSubtitleWidget::event(int event, void *data, void *data2)
                gPainter &painter = *(gPainter*)data2;
 
                getStyle(style);
-               
                eWidget::event(event, data, data2);
-               ePtr<gFont> font = new gFont("Regular", 38);
-               painter.setFont(font);
-               
-               if (m_page_ok)
+
+               if (m_pixmap)
+                       painter.blit(m_pixmap, ePoint(0,0));
+               else if (m_page_ok)
                {
                        int elements = m_page.m_elements.size();
+                       ePtr<gFont> font = new gFont("Regular", 38);
+                       painter.setFont(font);
                        for (int i=0; i<elements; ++i)
                        {
                                eDVBTeletextSubtitlePageElement &element = m_page.m_elements[i];