diff options
author | louis <louis.braun@gmx.de> | 2013-05-20 11:37:37 +0200 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-05-20 11:37:37 +0200 |
commit | c611e004582067640111ef2f023410025201157d (patch) | |
tree | 3a71e9893bffa4bf9d38c49389dad5f43d046ec3 /dummygrid.c | |
parent | 063094f442c0ac3c592d2e5bb5c416d6820d2602 (diff) | |
download | vdr-plugin-tvguide-c611e004582067640111ef2f023410025201157d.tar.gz vdr-plugin-tvguide-c611e004582067640111ef2f023410025201157d.tar.bz2 |
rewrote epg grid handling and scrolling, added status header
Diffstat (limited to 'dummygrid.c')
-rw-r--r-- | dummygrid.c | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/dummygrid.c b/dummygrid.c new file mode 100644 index 0000000..123bce1 --- /dev/null +++ b/dummygrid.c @@ -0,0 +1,65 @@ +#include "dummygrid.h" + +cDummyGrid::cDummyGrid(cChannelColumn *c, time_t start, time_t end) : cGrid(c) { + this->start = start; + this->end = end; + strText = tr("No EPG Information available"); + dummy = true; +} + +cDummyGrid::~cDummyGrid(void) { +} + +void cDummyGrid::SetViewportHeight() { + int viewportHeightOld = viewportHeight; + viewportHeight = Duration() / 60 * tvguideConfig.minuteHeight; + 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)); + } +} + +void cDummyGrid::setText() { + 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); + } +} +cString cDummyGrid::getText(void) { + return strText; +} + +cString cDummyGrid::getTimeString(void) { + return cString::sprintf("%s - %s", *TimeString(start), *TimeString(end)); +} + +void cDummyGrid::debug() { + esyslog("tvguide dummygrid: %s: %s, %s, viewportHeight: %d px, Duration: %ld min, active: %d", + column->Name(), + *cMyTime::printTime(start), + *cMyTime::printTime(end), + viewportHeight, + Duration()/60, + active); +}
\ No newline at end of file |