diff options
author | louis <louis.braun@gmx.de> | 2013-05-24 16:23:23 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-05-24 16:23:23 +0200 |
commit | 9f47ab764efc83d8bf94f25c4badeb6e4c91c649 (patch) | |
tree | d919adf7613949f0107b968c2bf13736075c17fc /dummygrid.c | |
parent | c611e004582067640111ef2f023410025201157d (diff) | |
download | vdr-plugin-tvguide-9f47ab764efc83d8bf94f25c4badeb6e4c91c649.tar.gz vdr-plugin-tvguide-9f47ab764efc83d8bf94f25c4badeb6e4c91c649.tar.bz2 |
Version 0.0.4
Diffstat (limited to 'dummygrid.c')
-rw-r--r-- | dummygrid.c | 69 |
1 files changed, 47 insertions, 22 deletions
diff --git a/dummygrid.c b/dummygrid.c index 123bce1..928b0b5 100644 --- a/dummygrid.c +++ b/dummygrid.c @@ -12,39 +12,64 @@ cDummyGrid::~cDummyGrid(void) { void cDummyGrid::SetViewportHeight() { int viewportHeightOld = viewportHeight; - viewportHeight = Duration() / 60 * tvguideConfig.minuteHeight; + viewportHeight = Duration() / 60 * tvguideConfig.minutePixel; if (viewportHeight != viewportHeightOld) dirty = true; } void cDummyGrid::PositionPixmap() { - int x0 = column->getX(); - int y0 = tvguideConfig.statusHeaderHeight + tvguideConfig.headerHeight; - if ( column->Start() < StartTime() ) { - y0 += (StartTime() - column->Start())/60*tvguideConfig.minuteHeight; - } - if (!pixmap) { - pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight), cRect::Null); - } else if (dirty) { - osdManager.releasePixmap(pixmap); - pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight), cRect::Null); - } else { - pixmap->SetViewPort(cRect(x0, y0, tvguideConfig.colWidth, viewportHeight)); - } + int x0, y0; + if (tvguideConfig.displayMode == eVertical) { + x0 = column->getX(); + y0 = tvguideConfig.statusHeaderHeight + tvguideConfig.channelHeaderHeight; + if ( column->Start() < StartTime() ) { + y0 += (StartTime() - column->Start())/60*tvguideConfig.minutePixel; + } + if (!pixmap) { + pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight)); + } else if (dirty) { + osdManager.releasePixmap(pixmap); + pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, tvguideConfig.colWidth, viewportHeight)); + } else { + pixmap->SetViewPort(cRect(x0, y0, tvguideConfig.colWidth, viewportHeight)); + } + } else if (tvguideConfig.displayMode == eHorizontal) { + x0 = tvguideConfig.channelHeaderWidth; + y0 = column->getY(); + if ( column->Start() < StartTime() ) { + x0 += (StartTime() - column->Start())/60*tvguideConfig.minutePixel; + } + if (!pixmap) { + pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, tvguideConfig.rowHeight)); + } else if (dirty) { + osdManager.releasePixmap(pixmap); + pixmap = osdManager.requestPixmap(-1, cRect(x0, y0, viewportHeight, tvguideConfig.rowHeight)); + } else { + pixmap->SetViewPort(cRect(x0, y0, viewportHeight, tvguideConfig.rowHeight)); + } + } } void cDummyGrid::setText() { - text->Set(*(strText), tvguideConfig.FontGrid, tvguideConfig.colWidth-2*borderWidth); + if (tvguideConfig.displayMode == eVertical) { + text->Set(*strText, tvguideConfig.FontGrid, tvguideConfig.colWidth-2*borderWidth); + } } void cDummyGrid::drawText() { - if (Height()/tvguideConfig.minuteHeight < 6) - return; - int textHeight = tvguideConfig.FontGrid->Height(); - int textLines = text->Lines(); - for (int i=0; i<textLines; i++) { - pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontGrid); - } + if (tvguideConfig.displayMode == eVertical) { + if (Height()/tvguideConfig.minutePixel < 6) + return; + int textHeight = tvguideConfig.FontGrid->Height(); + int textLines = text->Lines(); + for (int i=0; i<textLines; i++) { + pixmap->DrawText(cPoint(borderWidth, borderWidth + i*textHeight), text->GetLine(i), theme.Color(clrFont), clrTransparent, tvguideConfig.FontGrid); + + } + } else if (tvguideConfig.displayMode == eHorizontal) { + int titleY = (tvguideConfig.rowHeight - tvguideConfig.FontGridHorizontal->Height())/2; + pixmap->DrawText(cPoint(borderWidth, titleY), *strText, theme.Color(clrFont), clrTransparent, tvguideConfig.FontGridHorizontal); + } } cString cDummyGrid::getText(void) { return strText; |