summaryrefslogtreecommitdiff
path: root/screen.c
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2004-07-14 16:49:10 +0000
committerlordjaxom <lordjaxom>2004-07-14 16:49:10 +0000
commit5071a1754f3db0adcf477ecf8e5b2a818d1935bd (patch)
tree210c39c7871d0192ec5aad51096ea39fa47ccd9e /screen.c
parentf2a4ea2dc8c0d915e0f2af6f4ec1a228e1e94453 (diff)
downloadvdr-plugin-text2skin-5071a1754f3db0adcf477ecf8e5b2a818d1935bd.tar.gz
vdr-plugin-text2skin-5071a1754f3db0adcf477ecf8e5b2a818d1935bd.tar.bz2
- fixed display of scrollbar if there is no text presentv0.0.8
- fixed animation delay if update takes longer than the delay - using backgrounds also in 8-bit fullscreen mode to improve performance - implemented screen layer to improve performance - corrected offsets and tab widths in main menu - implemented parameters "current", "mark" and "selected" to choose mark colors in replay display (defaults to the old values) - implemented color value "None" to be able to unset a color
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/screen.c b/screen.c
new file mode 100644
index 0000000..16f5418
--- /dev/null
+++ b/screen.c
@@ -0,0 +1,65 @@
+/*
+ * $Id: screen.c,v 1.2 2004/07/13 13:52:51 lordjaxom Exp $
+ */
+
+#include "screen.h"
+
+cText2SkinScreen::cText2SkinScreen(int x, int y) {
+ mOsd = cOsdProvider::NewOsd(x, y);
+}
+
+cText2SkinScreen::~cText2SkinScreen() {
+ delete mOsd;
+}
+
+eOsdError cText2SkinScreen::SetAreas(const tArea *Areas, int NumAreas) {
+ eOsdError result = mOsd->CanHandleAreas(Areas, NumAreas);
+ if (result == oeOk) {
+ mOsd->SetAreas(Areas, NumAreas);
+ mNumRegions = NumAreas;
+ for (int i = 0; i < mNumRegions; ++i)
+ mRegions[i] = new cBitmap(Areas[i].Width(), Areas[i].Height(), Areas[i].bpp, Areas[i].x1, Areas[i].y1);
+ Clear();
+ }
+ return result;
+}
+
+void cText2SkinScreen::Clear(void) {
+ for (int i = 0; i < mNumRegions; ++i) {
+ mRegions[i]->Reset();
+ mRegions[i]->Clean();
+ mRegions[i]->DrawRectangle(mRegions[i]->X0(), mRegions[i]->Y0(), mRegions[i]->X0() + mRegions[i]->Width() - 1, mRegions[i]->Y0() + mRegions[i]->Height() - 1, clrTransparent);
+ }
+}
+
+void cText2SkinScreen::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, tColor ColorBg) {
+ for (int i = 0; i < mNumRegions; ++i)
+ mRegions[i]->DrawBitmap(x, y, Bitmap, ColorFg, ColorBg);
+}
+
+void cText2SkinScreen::DrawRectangle(int x1, int y1, int x2, int y2, tColor Color) {
+ for (int i = 0; i < mNumRegions; ++i)
+ mRegions[i]->DrawRectangle(x1, y1, x2, y2, Color);
+}
+
+void cText2SkinScreen::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment) {
+ for (int i = 0; i < mNumRegions; ++i)
+ mRegions[i]->DrawText(x, y, s, ColorFg, ColorBg, Font, Width, Height, Alignment);
+}
+
+void cText2SkinScreen::DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants) {
+ for (int i = 0; i < mNumRegions; ++i)
+ mRegions[i]->DrawEllipse(x1, y1, x2, y2, Color, Quadrants);
+}
+
+void cText2SkinScreen::DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type) {
+ for (int i = 0; i < mNumRegions; ++i)
+ mRegions[i]->DrawSlope(x1, y1, x2, y2, Color, Type);
+}
+
+void cText2SkinScreen::Flush(void) {
+ for (int i = 0; i < mNumRegions; ++i)
+ mOsd->DrawBitmap(mRegions[i]->X0(), mRegions[i]->Y0(), *mRegions[i]);
+ mOsd->Flush();
+}
+