X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/0e7fc97cfaaecf1b7fc93a73157a6a380e9058f4..5e214d181d1590e0002eabdc6f8395cd6ddde2a7:/lib/gui/esubtitle.h diff --git a/lib/gui/esubtitle.h b/lib/gui/esubtitle.h index b81faf79..d22ea0b8 100644 --- a/lib/gui/esubtitle.h +++ b/lib/gui/esubtitle.h @@ -8,18 +8,22 @@ struct ePangoSubtitlePageElement { gRGB m_color; + bool m_have_color; std::string m_pango_line; eRect m_area; ePangoSubtitlePageElement(const gRGB &color, const std::string &text) - : m_color(color), m_pango_line(text) + : m_color(color), m_have_color(true), m_pango_line(text) + { + } + ePangoSubtitlePageElement(const std::string &text) + : m_have_color(false), m_pango_line(text) { } }; struct ePangoSubtitlePage { - pts_t m_pts; - int m_have_pts; + pts_t show_pts; int m_timeout; /* in milliseconds */ std::vector m_elements; void clear() { m_elements.clear(); } @@ -38,11 +42,22 @@ public: void setPage(const eDVBSubtitlePage &p); void setPage(const ePangoSubtitlePage &p); void clearPage(); - void setPixmap(ePtr &pixmap, gRegion changed); + + typedef enum { Subtitle_TTX, Subtitle_Regular, Subtitle_Bold, Subtitle_Italic, Subtitle_MAX } subfont_t; + struct eSubtitleStyle + { + subfont_t face; + int have_foreground_color, have_shadow_color; + gRGB foreground_color, shadow_color; + ePoint shadow_offset; + ePtr font; + }; + + static void setFontStyle(subfont_t face, gFont *font, int autoColor, const gRGB &col, const gRGB &shadowCol, const ePoint &shadowOffset); + protected: int event(int event, void *data=0, void *data2=0); - private: int m_page_ok; eDVBTeletextSubtitlePage m_page; @@ -53,12 +68,13 @@ private: int m_pango_page_ok; ePangoSubtitlePage m_pango_page; - eTimer m_hide_subtitles_timer; + ePtr m_hide_subtitles_timer; gRegion m_visible_region; + static eSubtitleStyle subtitleStyles[Subtitle_MAX]; + ePtr m_pixmap; // pixmap to paint on next evtPaint - std::string eSubtitleWidget::replace_all(const std::string &in, const std::string &entity, const std::string &symbol); }; #endif