summaryrefslogtreecommitdiff
path: root/geometrymanager.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-10-25 20:50:08 +0200
committerlouis <louis.braun@gmx.de>2013-10-25 20:50:08 +0200
commit1aa2f6ace2419406b305f9fe238d9d341f761c73 (patch)
treeb58da850e207efd038ac0b88cbdf9fa444667dfd /geometrymanager.c
parent086588958f25fcf065a947bd908e65c4a4c345bd (diff)
downloadskin-nopacity-1aa2f6ace2419406b305f9fe238d9d341f761c73.tar.gz
skin-nopacity-1aa2f6ace2419406b305f9fe238d9d341f761c73.tar.bz2
Version 0.9.0
Diffstat (limited to 'geometrymanager.c')
-rw-r--r--geometrymanager.c150
1 files changed, 88 insertions, 62 deletions
diff --git a/geometrymanager.c b/geometrymanager.c
index 9f2e9fb..17e55f1 100644
--- a/geometrymanager.c
+++ b/geometrymanager.c
@@ -38,23 +38,22 @@ bool cGeometryManager::GeometryChanged(void) {
}
void cGeometryManager::SetDisplayMenuSizes() {
- menuSpace = config.spaceMenu;
+ menuSpace = config.GetValue("spaceMenu");
- menuWidthScrollbar = config.widthScrollbar;
+ menuWidthScrollbar = config.GetValue("widthScrollbar");
menuDateWidth = osdWidth * 0.3;
- menuHeaderHeight = osdHeight * config.headerHeight / 100;
- menuFooterHeight = osdHeight * config.footerHeight / 100;
- menuRssFeedHeight = (config.displayRSSFeed)?(osdHeight * config.rssFeedHeight / 100):0;
- menuContentHeight = osdHeight - menuHeaderHeight - menuFooterHeight - menuRssFeedHeight;
-
- menuContentWidthMain = osdWidth * config.menuWidthMain / 100;
- menuContentWidthSchedules = osdWidth * config.menuWidthSchedules / 100;
- menuContentWidthChannels = osdWidth * config.menuWidthChannels / 100;
- menuContentWidthTimers = osdWidth * config.menuWidthTimers / 100;
- menuContentWidthRecordings = osdWidth * config.menuWidthRecordings / 100;
- menuContentWidthSetup = osdWidth * config.menuWidthSetup / 100;
- menuContentWidthFull = osdWidth - config.widthScrollbar - config.spaceMenu;
+ menuHeaderHeight = osdHeight * config.GetValue("headerHeight") / 100;
+ menuFooterHeight = osdHeight * config.GetValue("footerHeight") / 100;
+ menuContentHeight = osdHeight - menuHeaderHeight - menuFooterHeight;
+
+ menuContentWidthMain = osdWidth * config.GetValue("menuWidthMain") / 100;
+ menuContentWidthSchedules = osdWidth * config.GetValue("menuWidthSchedules") / 100;
+ menuContentWidthChannels = osdWidth * config.GetValue("menuWidthChannels") / 100;
+ menuContentWidthTimers = osdWidth * config.GetValue("menuWidthChannels") / 100;
+ menuContentWidthRecordings = osdWidth * config.GetValue("menuWidthRecordings") / 100;
+ menuContentWidthSetup = osdWidth * config.GetValue("menuWidthSetup") / 100;
+ menuContentWidthFull = osdWidth - config.GetValue("widthScrollbar") - config.GetValue("spaceMenu");
menuContentWidthMinimum = Minimum(menuContentWidthMain,
menuContentWidthSchedules,
menuContentWidthChannels,
@@ -62,81 +61,108 @@ void cGeometryManager::SetDisplayMenuSizes() {
menuContentWidthRecordings,
menuContentWidthSetup);
- menuItemWidthDefault = menuContentWidthFull - 4 * config.spaceMenu;
- menuItemWidthMain = menuContentWidthMain - 4 * config.spaceMenu;
- menuItemWidthSchedule = menuContentWidthSchedules - 4 * config.spaceMenu;
- menuItemWidthChannel = menuContentWidthChannels - 4 * config.spaceMenu;
- menuItemWidthTimer = menuContentWidthTimers - 4 * config.spaceMenu;
- menuItemWidthRecording = menuContentWidthRecordings - 4 * config.spaceMenu;
- menuItemWidthSetup = menuContentWidthSetup - 4 * config.spaceMenu;
- menuItemWidthTracks = osdWidth * config.tracksWidth / 100 - 4;
- menuItemHeightMain = config.iconHeight + 2;
- menuItemHeightSchedule = config.menuItemLogoHeight + 2;
- menuItemHeightDefault = menuContentHeight / config.numDefaultMenuItems - config.spaceMenu;
- menuItemHeightRecordings = config.menuRecFolderSize + 2;
- menuItemHeightTracks = config.tracksItemHeight;
+ menuItemWidthDefault = menuContentWidthFull - 4 * config.GetValue("spaceMenu");
+ menuItemWidthMain = menuContentWidthMain - 4 * config.GetValue("spaceMenu");
+ menuItemWidthSchedule = menuContentWidthSchedules - 4 * config.GetValue("spaceMenu");
+ menuItemWidthChannel = menuContentWidthChannels - 4 * config.GetValue("spaceMenu");
+ menuItemWidthTimer = menuContentWidthTimers - 4 * config.GetValue("spaceMenu");
+ menuItemWidthRecording = menuContentWidthRecordings - 4 * config.GetValue("spaceMenu");
+ menuItemWidthSetup = menuContentWidthSetup - 4 * config.GetValue("spaceMenu");
+ menuItemWidthTracks = osdWidth * config.GetValue("tracksWidth") / 100 - 4;
+ menuItemHeightMain = config.GetValue("iconHeight") + 2;
+ menuItemHeightSchedule = config.GetValue("menuItemLogoHeight") + 2;
+ menuItemHeightDefault = menuContentHeight / config.GetValue("numDefaultMenuItems") - config.GetValue("spaceMenu");
+ menuItemHeightRecordings = config.GetValue("menuRecFolderSize") + 2;
+ menuItemHeightTracks = config.GetValue("tracksItemHeight");
menuButtonsBorder = menuFooterHeight / 6;
menuButtonWidth = (osdWidth / 4) - 2 * menuButtonsBorder;
menuButtonHeight = menuFooterHeight - 3 * menuButtonsBorder;
- menuDiskUsageWidth = menuDiskUsageHeight = osdWidth * config.menuSizeDiskUsage / 100;
- menuTimersWidth = osdWidth * config.menuWidthRightItems / 100;
+ menuDiskUsageWidth = menuDiskUsageHeight = osdWidth * config.GetValue("menuSizeDiskUsage") / 100;
+ menuTimersWidth = osdWidth * config.GetValue("menuWidthRightItems") / 100;
menuMessageWidth = 0.8 * osdWidth;
menuMessageHeight = 0.1 * osdHeight;
}
void cGeometryManager::SetDisplayChannelSizes(void) {
- channelHeight = osdHeight * config.channelHeight / 100;
- channelTop = osdTop + osdHeight - channelHeight - config.channelBorderBottom;
- switch (config.logoPosition) {
+ channelX = config.GetValue("channelBorderVertical");
+ channelWidth = osdWidth - 2 * config.GetValue("channelBorderVertical");
+ channelHeight = osdHeight * config.GetValue("channelHeight") / 100;
+ channelTop = osdTop + osdHeight - channelHeight - config.GetValue("channelBorderBottom");
+
+ channelHeaderHeight = 0.2 * channelHeight;
+ channelFooterHeight = 0.2 * channelHeight;
+ channelContentHeight = channelHeight - channelHeaderHeight - channelFooterHeight;
+
+ int logoWidthTotalPercent = 16;
+ channelLogoWidthTotal = logoWidthTotalPercent * channelWidth /100;
+
+ int logoMaxWidth = logoMaxWidth = channelLogoWidthTotal - 10;
+ int logoMaxHeight;
+ if (config.GetValue("displayType") == dtGraphical) {
+ logoMaxHeight = channelHeight - channelHeaderHeight - 2;
+ } else {
+ logoMaxHeight = channelHeight - 2;
+ }
+ cSize logoSize = ScaleToFit(logoMaxWidth,
+ logoMaxHeight,
+ config.GetValue("logoWidthOriginal"),
+ config.GetValue("logoHeightOriginal"));
+ channelLogoWidth = logoSize.Width();
+ channelLogoHeight = logoSize.Height();
+ channelLogoX = (channelLogoWidthTotal - channelLogoWidth) / 2;
+
+ if (config.GetValue("displayType") == dtGraphical) {
+ channelLogoY = (channelTop + channelHeaderHeight)
+ + (channelHeight - channelHeaderHeight - channelLogoHeight)/2;
+ } else {
+ channelLogoY = channelTop + (channelHeight - channelLogoHeight)/2;
+ }
+
+ switch (config.GetValue("logoPosition")) {
case lpLeft:
- channelWidth = osdWidth - (config.logoWidth + 2 * config.channelBorderVertical + config.logoBorder);
- channelX = config.logoWidth + config.channelBorderVertical + config.logoBorder;
+ channelContentX = channelLogoWidthTotal;
+ channelContentWidth = channelWidth - channelLogoWidthTotal;
break;
case lpRight:
- channelWidth = osdWidth - (config.logoWidth + 2 * config.channelBorderVertical + config.logoBorder);
- channelX = config.channelBorderVertical;
+ channelContentX = 0;
+ channelContentWidth = channelWidth - channelLogoWidthTotal;
+ channelLogoX = channelContentWidth;
break;
case lpNone:
- channelWidth = osdWidth - 2 * config.channelBorderVertical;
- channelX = config.channelBorderVertical;
+ channelContentX = 0;
+ channelContentWidth = channelWidth;
break;
}
- channelInfoWidth = channelWidth * 0.7;
- channelDateWidth = channelWidth - channelInfoWidth;
- channelInfoHeight = channelHeight * 0.2;
- if (channelInfoHeight%2 != 0)
- channelInfoHeight++;
+
+ channelChannelNameWidth = channelContentWidth * 70 / 100;
+ channelDateWidth = channelContentWidth - channelChannelNameWidth;
channelProgressBarHeight = channelHeight * 0.1;
- channelStreamInfoHeight = channelHeight * 0.2;
- if (channelStreamInfoHeight%2 != 0)
- channelStreamInfoHeight++;
- channelEpgInfoHeight = channelHeight - channelInfoHeight - channelStreamInfoHeight - channelProgressBarHeight;
+ channelEpgInfoHeight = channelContentHeight - channelProgressBarHeight;
channelEpgInfoLineHeight = channelEpgInfoHeight / 4;
- channelStreamInfoY = channelInfoHeight + channelProgressBarHeight + channelEpgInfoHeight;
- channelIconSize = config.statusIconSize;
- channelIconsWidth = 5*channelIconSize;
+ channelFooterY = channelTop + channelHeaderHeight + channelContentHeight;
}
void cGeometryManager::SetDisplayReplaySizes(void) {
- replayHeight = osdHeight * config.replayHeight / 100;
- replayWidth = osdWidth - 2 * config.replayBorderVertical;
+ replayHeight = osdHeight * config.GetValue("replayHeight") / 100;
+ replayWidth = osdWidth - 2 * config.GetValue("replayBorderVertical");
replayHeaderHeight = replayHeight * 0.2;
if (replayHeaderHeight%2 != 0)
replayHeaderHeight++;
replayFooterHeight = replayHeaderHeight;
- replayResolutionX = 10;
- replayResolutionY = 5;
- replayInfo2Height = max(replayHeaderHeight,config.resolutionIconSize+replayResolutionY*2-replayHeaderHeight);
+ replayResolutionSize = replayHeaderHeight - 10;
+ replayResolutionX = replayWidth - replayResolutionSize*3 - replayHeaderHeight/2;
+ replayResolutionY = replayHeight - replayFooterHeight;
+ replayInfo2Height = replayHeaderHeight;
replayProgressBarHeight = 0.1 * replayHeight;
if (replayProgressBarHeight%2 != 0)
replayProgressBarHeight++;
- replayCurrentHeight = replayProgressBarHeight + config.fontReplay;
+ replayCurrentHeight = replayProgressBarHeight + config.GetValue("fontReplay");
replayControlsHeight = replayHeight - replayHeaderHeight - replayInfo2Height - replayFooterHeight - replayProgressBarHeight;
if (replayControlsHeight < 11)
replayControlsHeight = 11;
- replayInfoWidth = 0.75 * replayWidth - config.resolutionIconSize - 10;
+ replayInfoWidth = 0.75 * replayWidth;
replayDateWidth = replayWidth - replayInfoWidth;
replayJumpX = (replayWidth - 4 * replayControlsHeight)/2 + 5*replayControlsHeight;
@@ -149,17 +175,17 @@ void cGeometryManager::SetDisplayReplaySizes(void) {
}
void cGeometryManager::SetDisplayMessageSizes(void) {
- messageWidth = osdWidth * config.messageWidth / 100;
- messageHeight = osdHeight * config.messageHeight / 100;
+ messageWidth = osdWidth * config.GetValue("messageWidth") / 100;
+ messageHeight = osdHeight * config.GetValue("messageHeight") / 100;
}
void cGeometryManager::SetDisplayTrackSizes(void) {
- trackWidth = osdWidth * config.tracksWidth / 100;
+ trackWidth = osdWidth * config.GetValue("tracksWidth") / 100;
}
void cGeometryManager::SetDisplayVolumeSizes(void) {
- volumeWidth = osdWidth * config.volumeWidth / 100;
- volumeHeight = osdHeight * config.volumeHeight / 100;
+ volumeWidth = osdWidth * config.GetValue("volumeWidth") / 100;
+ volumeHeight = osdHeight * config.GetValue("volumeHeight") / 100;
volumeLabelHeight = volumeHeight/3;
volumeProgressBarWidth = 0.9 * volumeWidth;
volumeProgressBarHeight = 0.3 * volumeHeight;