diff options
| author | Fraxinas <andreas.frisch@multimedia-labs.de> | 2009-05-27 23:45:01 +0200 |
|---|---|---|
| committer | Fraxinas <andreas.frisch@multimedia-labs.de> | 2009-05-27 23:45:01 +0200 |
| commit | 3f71f581949b23c013b07a266e9aae0edd102a53 (patch) | |
| tree | f00f579f20f3e473589bba09b4c42b51b48ba962 /lib/gui/esubtitle.h | |
| parent | 51e789a04f758941668b095fd8b051db2ce58281 (diff) | |
| download | enigma2-3f71f581949b23c013b07a266e9aae0edd102a53.tar.gz enigma2-3f71f581949b23c013b07a266e9aae0edd102a53.zip | |
make subtitle font styles skinnable
Diffstat (limited to 'lib/gui/esubtitle.h')
| -rw-r--r-- | lib/gui/esubtitle.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/lib/gui/esubtitle.h b/lib/gui/esubtitle.h index 0a780ca1..d7287776 100644 --- a/lib/gui/esubtitle.h +++ b/lib/gui/esubtitle.h @@ -8,10 +8,15 @@ 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_pango_line(text), m_have_color(true) + { + } + ePangoSubtitlePageElement(const std::string &text) + : m_pango_line(text), m_have_color(false) { } }; @@ -37,11 +42,22 @@ public: void setPage(const eDVBSubtitlePage &p); void setPage(const ePangoSubtitlePage &p); void clearPage(); - void setPixmap(ePtr<gPixmap> &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<gFont> 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; @@ -56,6 +72,8 @@ private: gRegion m_visible_region; + static eSubtitleStyle subtitleStyles[Subtitle_MAX]; + ePtr<gPixmap> m_pixmap; // pixmap to paint on next evtPaint }; |
