summaryrefslogtreecommitdiff
path: root/geometrymanager.c
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-07-11 11:07:13 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2019-07-11 11:07:13 +0200
commit7a79059414ea2f10cba1710de0e37dcbbdfbfa42 (patch)
tree3300a2389ae07acbe21561e6f1fe78ea28674054 /geometrymanager.c
parentceadc0bbfe5a82ebdb961a15e2bb3669197551ad (diff)
downloadvdr-plugin-tvguide-7a79059414ea2f10cba1710de0e37dcbbdfbfa42.tar.gz
vdr-plugin-tvguide-7a79059414ea2f10cba1710de0e37dcbbdfbfa42.tar.bz2
Change files to unix
Diffstat (limited to 'geometrymanager.c')
-rw-r--r--geometrymanager.c152
1 files changed, 76 insertions, 76 deletions
diff --git a/geometrymanager.c b/geometrymanager.c
index b8779a1..35da932 100644
--- a/geometrymanager.c
+++ b/geometrymanager.c
@@ -1,76 +1,76 @@
-#include <vdr/osd.h>
-
-#include "config.h"
-#include "geometrymanager.h"
-
-cGeometryManager::cGeometryManager() {
- osdWidth = 0;
- osdHeight = 0;
-}
-
-cGeometryManager::~cGeometryManager() {
-}
-
-bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
- if (!force && (this->osdWidth == osdWidth) && (this->osdHeight == osdHeight)) {
- esyslog("tvgudie: GeoManager SetGeometry nothing to change");
- return false;
- }
- this->osdWidth = osdWidth;
- this->osdHeight = osdHeight;
- esyslog("tvguide: Set OSD to %d x %d px", osdWidth, osdHeight);
-
- statusHeaderHeight = (tvguideConfig.displayStatusHeader)?(tvguideConfig.headerHeightPercent * osdHeight / 100):0;
- tvFrameWidth = statusHeaderHeight * 16 / 9;
- headerContentWidth = (tvguideConfig.scaleVideo)?(osdWidth - tvFrameWidth):osdWidth;
- channelGroupsWidth = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdWidth / 100):0;
- channelGroupsHeight = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdHeight / 100):0;
- channelHeaderWidth = tvguideConfig.channelHeaderWidthPercent * osdWidth / 100;
- channelHeaderHeight = tvguideConfig.channelHeaderHeightPercent * osdHeight / 100;
- timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100;
- timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100;
- footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100;
- footerY = osdHeight - footerHeight;
-
- if (tvguideConfig.displayMode == eVertical) {
- colWidth = (osdWidth - timeLineWidth) / tvguideConfig.channelCols;
- rowHeight = 0;
- minutePixel = (osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / tvguideConfig.displayTime;
- channelLogoWidth = colWidth;
- channelLogoHeight = channelHeaderHeight;
- logoWidth = channelLogoWidth/2 - 15;
- logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio;
- timeLineGridWidth = timeLineWidth;
- timeLineGridHeight = minutePixel * 30;
- dateVieverWidth = timeLineWidth;
- dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3;
- clockWidth = dateVieverWidth;
- clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight;
- } else if (tvguideConfig.displayMode == eHorizontal) {
- colWidth = 0;
- rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows;
- minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / tvguideConfig.displayHorizontalTime;
- channelLogoWidth = channelHeaderWidth;
- channelLogoHeight = rowHeight;
- logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
- logoHeight = channelLogoHeight;
- timeLineGridWidth = geoManager.minutePixel * 30;
- timeLineGridHeight = geoManager.timeLineHeight;
- dateVieverWidth = (channelHeaderWidth + channelGroupsWidth) * 3 / 5;
- dateVieverHeight = timeLineHeight;
- clockWidth = (channelHeaderWidth + channelGroupsWidth) - dateVieverWidth;
- clockHeight = timeLineHeight;
- }
- buttonBorder = footerHeight / 6;
- buttonWidth = osdWidth / 4 - 2 * buttonBorder;
- buttonHeight = footerHeight - 3 * buttonBorder;
-
- epgViewHeaderHeight = tvguideConfig.headerHeightPercent * osdHeight / 100;
-
- borderRecMenus = 10;
-
- channelJumpWidth = osdWidth * 30 / 100;
- channelJumpHeight = osdHeight * 20 / 100;
-
- return true;
-}
+#include <vdr/osd.h>
+
+#include "config.h"
+#include "geometrymanager.h"
+
+cGeometryManager::cGeometryManager() {
+ osdWidth = 0;
+ osdHeight = 0;
+}
+
+cGeometryManager::~cGeometryManager() {
+}
+
+bool cGeometryManager::SetGeometry(int osdWidth, int osdHeight, bool force) {
+ if (!force && (this->osdWidth == osdWidth) && (this->osdHeight == osdHeight)) {
+ esyslog("tvgudie: GeoManager SetGeometry nothing to change");
+ return false;
+ }
+ this->osdWidth = osdWidth;
+ this->osdHeight = osdHeight;
+ esyslog("tvguide: Set OSD to %d x %d px", osdWidth, osdHeight);
+
+ statusHeaderHeight = (tvguideConfig.displayStatusHeader)?(tvguideConfig.headerHeightPercent * osdHeight / 100):0;
+ tvFrameWidth = statusHeaderHeight * 16 / 9;
+ headerContentWidth = (tvguideConfig.scaleVideo)?(osdWidth - tvFrameWidth):osdWidth;
+ channelGroupsWidth = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdWidth / 100):0;
+ channelGroupsHeight = (tvguideConfig.displayChannelGroups)?(tvguideConfig.channelGroupsPercent * osdHeight / 100):0;
+ channelHeaderWidth = tvguideConfig.channelHeaderWidthPercent * osdWidth / 100;
+ channelHeaderHeight = tvguideConfig.channelHeaderHeightPercent * osdHeight / 100;
+ timeLineWidth = tvguideConfig.timeLineWidthPercent * osdWidth / 100;
+ timeLineHeight = tvguideConfig.timeLineHeightPercent * osdHeight / 100;
+ footerHeight = tvguideConfig.footerHeightPercent * osdHeight / 100;
+ footerY = osdHeight - footerHeight;
+
+ if (tvguideConfig.displayMode == eVertical) {
+ colWidth = (osdWidth - timeLineWidth) / tvguideConfig.channelCols;
+ rowHeight = 0;
+ minutePixel = (osdHeight - statusHeaderHeight - channelGroupsHeight - channelHeaderHeight - footerHeight) / tvguideConfig.displayTime;
+ channelLogoWidth = colWidth;
+ channelLogoHeight = channelHeaderHeight;
+ logoWidth = channelLogoWidth/2 - 15;
+ logoHeight = logoWidth * tvguideConfig.logoHeightRatio / tvguideConfig.logoWidthRatio;
+ timeLineGridWidth = timeLineWidth;
+ timeLineGridHeight = minutePixel * 30;
+ dateVieverWidth = timeLineWidth;
+ dateVieverHeight = (channelHeaderHeight + channelGroupsHeight) * 2 / 3;
+ clockWidth = dateVieverWidth;
+ clockHeight = (channelHeaderHeight + channelGroupsHeight) - dateVieverHeight;
+ } else if (tvguideConfig.displayMode == eHorizontal) {
+ colWidth = 0;
+ rowHeight = (osdHeight - statusHeaderHeight - timeLineHeight - footerHeight) / tvguideConfig.channelRows;
+ minutePixel = (osdWidth - channelHeaderWidth - channelGroupsWidth) / tvguideConfig.displayHorizontalTime;
+ channelLogoWidth = channelHeaderWidth;
+ channelLogoHeight = rowHeight;
+ logoWidth = channelLogoHeight * tvguideConfig.logoWidthRatio / tvguideConfig.logoHeightRatio;
+ logoHeight = channelLogoHeight;
+ timeLineGridWidth = geoManager.minutePixel * 30;
+ timeLineGridHeight = geoManager.timeLineHeight;
+ dateVieverWidth = (channelHeaderWidth + channelGroupsWidth) * 3 / 5;
+ dateVieverHeight = timeLineHeight;
+ clockWidth = (channelHeaderWidth + channelGroupsWidth) - dateVieverWidth;
+ clockHeight = timeLineHeight;
+ }
+ buttonBorder = footerHeight / 6;
+ buttonWidth = osdWidth / 4 - 2 * buttonBorder;
+ buttonHeight = footerHeight - 3 * buttonBorder;
+
+ epgViewHeaderHeight = tvguideConfig.headerHeightPercent * osdHeight / 100;
+
+ borderRecMenus = 10;
+
+ channelJumpWidth = osdWidth * 30 / 100;
+ channelJumpHeight = osdHeight * 20 / 100;
+
+ return true;
+}