From a8bbad2772a221d335e8ba5d3593eb1509053b56 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 22 Jan 2018 12:06:15 +0100 Subject: [PATCH] framebuffer: better name for getWindowWidth/Height() functions getScreenWidth/HeightRel() was confusing because it depends on users window settings. Replace names in old unused framebuffer code too. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/86cdc12c8f2b73b248052c235991c3e4824b032d Author: vanhofen Date: 2018-01-22 (Mon, 22 Jan 2018) Origin message was: ------------------ - framebuffer: better name for getWindowWidth/Height() functions getScreenWidth/HeightRel() was confusing because it depends on users window settings. Replace names in old unused framebuffer code too. ------------------ This commit was generated by Migit --- src/driver/fb_generic.cpp | 8 ++++---- src/driver/fb_generic.h | 6 +++--- src/driver/framebuffer.cpp | 8 ++++---- src/driver/framebuffer.h | 6 +++--- src/driver/framebuffer_ng.cpp | 8 ++++---- src/driver/framebuffer_ng.h | 6 +++--- src/gui/audioplayer.cpp | 4 ++-- src/gui/bedit/bouqueteditor_globals.cpp | 4 ++-- src/gui/channellist.cpp | 4 ++-- src/gui/epgplus.cpp | 4 ++-- src/gui/epgview.cpp | 4 ++-- src/gui/eventlist.cpp | 4 ++-- src/gui/filebrowser.cpp | 4 ++-- src/gui/moviebrowser/mb.cpp | 4 ++-- src/gui/osd_setup.cpp | 4 ++-- src/gui/pictureviewer.cpp | 4 ++-- src/gui/upnpbrowser.cpp | 4 ++-- 17 files changed, 43 insertions(+), 43 deletions(-) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 964c2035f..083fbef92 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -269,16 +269,16 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) return g_settings.screen_EndY - g_settings.screen_StartY; } -unsigned int CFrameBuffer::getScreenWidthRel(bool force_small) +unsigned int CFrameBuffer::getWindowWidth(bool force_small) { - int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_width; + int percent = force_small ? WINDOW_SIZE_SMALL : g_settings.window_width; // always reduce a possible detailsline return (g_settings.screen_EndX - g_settings.screen_StartX - 2*DETAILSLINE_WIDTH) * percent / 100; } -unsigned int CFrameBuffer::getScreenHeightRel(bool force_small) +unsigned int CFrameBuffer::getWindowHeight(bool force_small) { - int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_height; + int percent = force_small ? WINDOW_SIZE_SMALL : g_settings.window_height; return (g_settings.screen_EndY - g_settings.screen_StartY) * percent / 100; } diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index a298c9171..3b855dfba 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -74,7 +74,7 @@ typedef struct gradientData_t #define WINDOW_SIZE_MAX 100 // % #define WINDOW_SIZE_MIN 50 // % -#define WINDOW_SIZE_MIN_FORCED 80 // % +#define WINDOW_SIZE_SMALL 80 // % /** Ausfuehrung als Singleton */ class CFrameBuffer : public sigc::trackable @@ -184,8 +184,8 @@ class CFrameBuffer : public sigc::trackable virtual unsigned int getStride() const; // size of a single line in the framebuffer (in bytes) unsigned int getScreenWidth(bool real = false); unsigned int getScreenHeight(bool real = false); - unsigned int getScreenWidthRel(bool force_small = false); - unsigned int getScreenHeightRel(bool force_small = false); + unsigned int getWindowWidth(bool force_small = false); + unsigned int getWindowHeight(bool force_small = false); unsigned int getScreenX(); unsigned int getScreenY(); diff --git a/src/driver/framebuffer.cpp b/src/driver/framebuffer.cpp index 86384b446..0fa056138 100644 --- a/src/driver/framebuffer.cpp +++ b/src/driver/framebuffer.cpp @@ -460,16 +460,16 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) return g_settings.screen_EndY - g_settings.screen_StartY; } -unsigned int CFrameBuffer::getScreenWidthRel(bool force_small) +unsigned int CFrameBuffer::getWindowWidth(bool force_small) { - int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_width; + int percent = force_small ? WINDOW_SIZE_SMALL : g_settings.window_width; // always reduce a possible detailsline return (g_settings.screen_EndX - g_settings.screen_StartX - 2*DETAILSLINE_WIDTH) * percent / 100; } -unsigned int CFrameBuffer::getScreenHeightRel(bool force_small) +unsigned int CFrameBuffer::getWindowHeight(bool force_small) { - int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_height; + int percent = force_small ? WINDOW_SIZE_SMALL : g_settings.window_height; return (g_settings.screen_EndY - g_settings.screen_StartY) * percent / 100; } diff --git a/src/driver/framebuffer.h b/src/driver/framebuffer.h index 6b2dced9c..db1929d06 100644 --- a/src/driver/framebuffer.h +++ b/src/driver/framebuffer.h @@ -69,7 +69,7 @@ typedef struct gradientData_t #define WINDOW_SIZE_MAX 100 // % #define WINDOW_SIZE_MIN 50 // % -#define WINDOW_SIZE_MIN_FORCED 80 // % +#define WINDOW_SIZE_SMALL 80 // % /** Ausfuehrung als Singleton */ class CFrameBuffer : public sigc::trackable @@ -184,8 +184,8 @@ class CFrameBuffer : public sigc::trackable unsigned int getStride() const; // size of a single line in the framebuffer (in bytes) unsigned int getScreenWidth(bool real = false); unsigned int getScreenHeight(bool real = false); - unsigned int getScreenWidthRel(bool force_small = false); - unsigned int getScreenHeightRel(bool force_small = false); + unsigned int getWindowWidth(bool force_small = false); + unsigned int getWindowHeight(bool force_small = false); unsigned int getScreenX(); unsigned int getScreenY(); diff --git a/src/driver/framebuffer_ng.cpp b/src/driver/framebuffer_ng.cpp index 7c70ec5c8..340d4ddee 100644 --- a/src/driver/framebuffer_ng.cpp +++ b/src/driver/framebuffer_ng.cpp @@ -314,16 +314,16 @@ unsigned int CFrameBuffer::getScreenHeight(bool real) return g_settings.screen_EndY - g_settings.screen_StartY; } -unsigned int CFrameBuffer::getScreenWidthRel(bool force_small) +unsigned int CFrameBuffer::getWindowWidth(bool force_small) { - int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_width; + int percent = force_small ? WINDOW_SIZE_SMALL : g_settings.window_width; // always reduce a possible detailline return (g_settings.screen_EndX - g_settings.screen_StartX - 2*ConnectLineBox_Width) * percent / 100; } -unsigned int CFrameBuffer::getScreenHeightRel(bool force_small) +unsigned int CFrameBuffer::getWindowHeight(bool force_small) { - int percent = force_small ? WINDOW_SIZE_MIN_FORCED : g_settings.window_height; + int percent = force_small ? WINDOW_SIZE_SMALL : g_settings.window_height; return (g_settings.screen_EndY - g_settings.screen_StartY) * percent / 100; } diff --git a/src/driver/framebuffer_ng.h b/src/driver/framebuffer_ng.h index 6618aa074..b99c3e10f 100644 --- a/src/driver/framebuffer_ng.h +++ b/src/driver/framebuffer_ng.h @@ -67,7 +67,7 @@ typedef struct gradientData_t #define WINDOW_SIZE_MAX 100 // % #define WINDOW_SIZE_MIN 50 // % -#define WINDOW_SIZE_MIN_FORCED 80 // % +#define WINDOW_SIZE_SMALL 80 // % #define ConnectLineBox_Width 16 // px #if HAVE_GENERIC_HARDWARE @@ -173,8 +173,8 @@ class CFrameBuffer : public sigc::trackable unsigned int getStride() const; // size of a single line in the framebuffer (in bytes) unsigned int getScreenWidth(bool real = false); unsigned int getScreenHeight(bool real = false); - unsigned int getScreenWidthRel(bool force_small = false); - unsigned int getScreenHeightRel(bool force_small = false); + unsigned int getWindowWidth(bool force_small = false); + unsigned int getWindowHeight(bool force_small = false); unsigned int getScreenX(); unsigned int getScreenY(); diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index a528968a8..c88fb4747 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -300,8 +300,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_selected = 0; - m_width = m_frameBuffer->getScreenWidthRel(); - m_height = m_frameBuffer->getScreenHeightRel(); + m_width = m_frameBuffer->getWindowWidth(); + m_height = m_frameBuffer->getWindowHeight(); m_header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); m_item_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); diff --git a/src/gui/bedit/bouqueteditor_globals.cpp b/src/gui/bedit/bouqueteditor_globals.cpp index 8e0235edc..939224ff8 100644 --- a/src/gui/bedit/bouqueteditor_globals.cpp +++ b/src/gui/bedit/bouqueteditor_globals.cpp @@ -49,8 +49,8 @@ void CBEGlobals::init() item_font = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST]; info_font = g_Font[SNeutrinoSettings::FONT_TYPE_CHANNELLIST_DESCR]; - width = frameBuffer->getScreenWidthRel(); - height = frameBuffer->getScreenHeightRel(); + width = frameBuffer->getWindowWidth(); + height = frameBuffer->getWindowHeight(); if (!header) header = new CComponentsHeader(); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index c857f7c41..2f9361571 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -498,7 +498,7 @@ void CChannelList::calcSize() minitv_is_active = ( (g_settings.channellist_additional == SNeutrinoSettings::CHANNELLIST_ADDITIONAL_MODE_MINITV) && (CNeutrinoApp::getInstance()->getMode() != NeutrinoModes::mode_ts) ); // calculate width - full_width = frameBuffer->getScreenWidthRel(); //NI + full_width = frameBuffer->getWindowWidth(); //NI if (g_settings.channellist_additional) width = full_width / 3 * 2; @@ -510,7 +510,7 @@ void CChannelList::calcSize() info_height = 2*fheight + fdescrheight + 2*OFFSET_INNER_SMALL; else info_height = 0; - height = frameBuffer->getScreenHeightRel(); //NI + height = frameBuffer->getWindowHeight(); //NI height = height - OFFSET_INTER - info_height; // calculate x position diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index f7057b1c3..473492ccb 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -798,8 +798,8 @@ void EpgPlus::init() currentViewMode = ViewMode_Scroll; currentSwapMode = SwapMode_ByPage; #endif - usableScreenWidth = frameBuffer->getScreenWidthRel(); - usableScreenHeight = frameBuffer->getScreenHeightRel(); + usableScreenWidth = frameBuffer->getWindowWidth(); + usableScreenHeight = frameBuffer->getWindowHeight(); for (size_t i = 0; i < NumberOfSizeSettings; ++i) { diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 9a6083955..a89efaaeb 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -143,8 +143,8 @@ CEpgData::~CEpgData() void CEpgData::start() { - ox = frameBuffer->getScreenWidthRel(bigFonts ? false /* big */ : true /* small */); - oy = frameBuffer->getScreenHeightRel(bigFonts ? false /* big */ : true /* small */); + ox = frameBuffer->getWindowWidth(bigFonts ? false /* big */ : true /* small */); + oy = frameBuffer->getWindowHeight(bigFonts ? false /* big */ : true /* small */); font_title = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; //NI topheight = font_title->getHeight(); diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 894a9ced7..3568a7be9 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -307,14 +307,14 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna if (ch) epg_id = ch->getEpgID(); - full_width = frameBuffer->getScreenWidthRel(); + full_width = frameBuffer->getWindowWidth(); x = getScreenStartX(full_width); if (g_settings.eventlist_additional) width = full_width / 3 * 2; else width = full_width; - height = frameBuffer->getScreenHeightRel(); + height = frameBuffer->getWindowHeight(); // Calculate header_height header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index eaf308aa3..174185e08 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -265,8 +265,8 @@ void CFileBrowser::fontInit() fnt_title = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; fnt_item = g_Font[SNeutrinoSettings::FONT_TYPE_FILEBROWSER_ITEM]; fnt_foot = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]; - width = frameBuffer->getScreenWidthRel(); - height = frameBuffer->getScreenHeightRel(); + width = frameBuffer->getWindowWidth(); + height = frameBuffer->getWindowHeight(); x = getScreenStartX(width); header_height = fnt_title->getHeight(); diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index d0fb48d8b..da405cc77 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -510,8 +510,8 @@ void CMovieBrowser::initFrames(void) m_pcFontTitle = TITLE_FONT; //TRACE("[mb]->%s\n", __func__); - m_cBoxFrame.iWidth = framebuffer->getScreenWidthRel(); - m_cBoxFrame.iHeight = framebuffer->getScreenHeightRel(); + m_cBoxFrame.iWidth = framebuffer->getWindowWidth(); + m_cBoxFrame.iHeight = framebuffer->getWindowHeight(); m_cBoxFrame.iX = getScreenStartX(m_cBoxFrame.iWidth); m_cBoxFrame.iY = getScreenStartY(m_cBoxFrame.iHeight); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 2f7dfbec9..780033108 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -1790,8 +1790,8 @@ void COsdSetup::paintWindowSize(int w, int h) if (g_settings.window_height < WINDOW_SIZE_MIN) g_settings.window_height = WINDOW_SIZE_MIN; - win_demo->setWidth(frameBuffer->getScreenWidthRel()); - win_demo->setHeight(frameBuffer->getScreenHeightRel()); + win_demo->setWidth(frameBuffer->getWindowWidth()); + win_demo->setHeight(frameBuffer->getWindowHeight()); win_demo->setXPos(getScreenStartX(win_demo->getWidth())); win_demo->setYPos(getScreenStartY(win_demo->getHeight())); diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index c4a99bc2f..d571cb0b0 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -164,8 +164,8 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) selected = 0; - width = frameBuffer->getScreenWidthRel(); - height = frameBuffer->getScreenHeightRel(); + width = frameBuffer->getWindowWidth(); + height = frameBuffer->getWindowHeight(); header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); item_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 56efe297d..2ad01c05d 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -114,8 +114,8 @@ void CUpnpBrowserGui::Init() timebox.enableColBodyGradient(g_settings.theme.menu_Hint_gradient, COL_SHADOW_PLUS_0, g_settings.theme.menu_Hint_gradient_direction); timebox.enableShadow(CC_SHADOW_ON); - m_width = m_frameBuffer->getScreenWidthRel(); - m_height = m_frameBuffer->getScreenHeightRel(); + m_width = m_frameBuffer->getWindowWidth(); + m_height = m_frameBuffer->getWindowHeight(); int _top_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_INFO]->getHeight(); int _title_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();