diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2018-04-16 13:01:08 +0200 |
---|---|---|
committer | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2018-04-16 20:51:43 +0200 |
commit | 2d39ae960fd284706a25b22333fc379b882af975 (patch) | |
tree | 5af20c9c3424565cf729c043046e97336d825778 | |
parent | 9ed19a7f87e0e009b84417def5f2902ec13be2d1 (diff) |
[guiinfo] Move CGUIInfo* classes from 'guilib' to 'guilib/guinfo', including namespace change to GUILIB::GUIINFO.
42 files changed, 178 insertions, 122 deletions
diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index 0e8e846e90..b17e06bbe4 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -228,6 +228,7 @@ using namespace JSONRPC; using namespace ANNOUNCEMENT; using namespace PVR; using namespace PERIPHERALS; +using namespace KODI; using namespace KODI::MESSAGING; using namespace ActiveAE; @@ -4196,9 +4197,9 @@ bool CApplication::ExecuteXBMCAction(std::string actionStr, const CGUIListItemPt //postpone any logging const std::string in_actionStr(actionStr); if (item) - actionStr = CGUIInfoLabel::GetItemLabel(actionStr, item.get()); + actionStr = GUILIB::GUIINFO::CGUIInfoLabel::GetItemLabel(actionStr, item.get()); else - actionStr = CGUIInfoLabel::GetLabel(actionStr); + actionStr = GUILIB::GUIINFO::CGUIInfoLabel::GetLabel(actionStr); // user has asked for something to be executed if (CBuiltins::GetInstance().HasCommand(actionStr)) diff --git a/xbmc/addons/interfaces/GUI/controls/Image.cpp b/xbmc/addons/interfaces/GUI/controls/Image.cpp index 529ff06107..9bd45b24cf 100644 --- a/xbmc/addons/interfaces/GUI/controls/Image.cpp +++ b/xbmc/addons/interfaces/GUI/controls/Image.cpp @@ -25,6 +25,8 @@ #include "guilib/GUIImage.h" #include "utils/log.h" +using namespace KODI; + extern "C" { namespace ADDON @@ -89,7 +91,7 @@ void Interface_GUIControlImage::set_color_diffuse(void* kodiBase, void* handle, return; } - control->SetColorDiffuse(CGUIInfoColor(colorDiffuse)); + control->SetColorDiffuse(GUILIB::GUIINFO::CGUIInfoColor(colorDiffuse)); } } /* namespace ADDON */ diff --git a/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.cpp b/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.cpp index 4729de5aa4..9671c99920 100644 --- a/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.cpp +++ b/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.cpp @@ -71,12 +71,12 @@ CGUIGameControl::~CGUIGameControl() UnregisterControl(); } -void CGUIGameControl::SetScalingMethod(const CGUIInfoLabel &scalingMethod) +void CGUIGameControl::SetScalingMethod(const GUILIB::GUIINFO::CGUIInfoLabel &scalingMethod) { m_scalingMethodInfo = scalingMethod; } -void CGUIGameControl::SetViewMode(const CGUIInfoLabel &viewMode) +void CGUIGameControl::SetViewMode(const GUILIB::GUIINFO::CGUIInfoLabel &viewMode) { m_viewModeInfo = viewMode; } diff --git a/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.h b/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.h index 5bb238297a..1803b69423 100644 --- a/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.h +++ b/xbmc/cores/RetroPlayer/guicontrols/GUIGameControl.h @@ -20,12 +20,10 @@ #pragma once #include "guilib/GUIControl.h" -#include "guilib/GUIInfoTypes.h" +#include "guilib/guiinfo/GUIInfoTypes.h" #include <memory> -class CGUIInfoLabel; - namespace KODI { namespace RETRO @@ -42,8 +40,8 @@ public: ~CGUIGameControl() override; // GUI functions - void SetScalingMethod(const CGUIInfoLabel &scalingMethod); - void SetViewMode(const CGUIInfoLabel &viewMode); + void SetScalingMethod(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &scalingMethod); + void SetViewMode(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &viewMode); // Rendering functions bool HasScalingMethod() const { return m_bHasScalingMethod; } @@ -68,8 +66,8 @@ private: void UnregisterControl(); // GUI properties - CGUIInfoLabel m_scalingMethodInfo; - CGUIInfoLabel m_viewModeInfo; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_scalingMethodInfo; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_viewModeInfo; // Rendering properties bool m_bHasScalingMethod = false; diff --git a/xbmc/guilib/CMakeLists.txt b/xbmc/guilib/CMakeLists.txt index bdce23ba8a..3cf02385e8 100644 --- a/xbmc/guilib/CMakeLists.txt +++ b/xbmc/guilib/CMakeLists.txt @@ -25,7 +25,6 @@ set(SOURCES DDSImage.cpp GUIFontTTF.cpp GUIImage.cpp GUIIncludes.cpp - GUIInfoTypes.cpp GUIKeyboardFactory.cpp GUILabelControl.cpp GUILabel.cpp @@ -101,7 +100,6 @@ set(HEADERS DDSImage.h GUIFontTTF.h GUIImage.h GUIIncludes.h - GUIInfoTypes.h GUIKeyboard.h GUIKeyboardFactory.h GUILabel.h diff --git a/xbmc/guilib/GUIButtonControl.h b/xbmc/guilib/GUIButtonControl.h index 3a390122c8..452f318560 100644 --- a/xbmc/guilib/GUIButtonControl.h +++ b/xbmc/guilib/GUIButtonControl.h @@ -98,8 +98,8 @@ protected: float m_minWidth; float m_maxWidth; - CGUIInfoLabel m_info; - CGUIInfoLabel m_info2; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_info; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_info2; CGUILabel m_label; CGUILabel m_label2; diff --git a/xbmc/guilib/GUIControl.cpp b/xbmc/guilib/GUIControl.cpp index 1183c9751d..2a8a8bc560 100644 --- a/xbmc/guilib/GUIControl.cpp +++ b/xbmc/guilib/GUIControl.cpp @@ -31,6 +31,8 @@ #include "input/Key.h" #include "ServiceBroker.h" +using namespace KODI::GUILIB; + CGUIControl::CGUIControl() : m_hitColor(0xffffffff), m_diffuseColor(0xffffffff) @@ -450,7 +452,7 @@ void CGUIControl::SetPosition(float posX, float posY) } } -bool CGUIControl::SetColorDiffuse(const CGUIInfoColor &color) +bool CGUIControl::SetColorDiffuse(const GUIINFO::CGUIInfoColor &color) { bool changed = m_diffuseColor != color; m_diffuseColor = color; diff --git a/xbmc/guilib/GUIControl.h b/xbmc/guilib/GUIControl.h index 2af07e3134..92a74a9523 100644 --- a/xbmc/guilib/GUIControl.h +++ b/xbmc/guilib/GUIControl.h @@ -32,7 +32,7 @@ #include "windowing/GraphicContext.h" // needed by any rendering operation (all controls) #include "GUIMessage.h" // needed by practically all controls #include "VisibleEffect.h" // needed for the CAnimation members -#include "GUIInfoTypes.h" // needed for CGUIInfoColor to handle infolabel'ed colors +#include "guiinfo/GUIInfoTypes.h" // needed for CGUIInfoColor to handle infolabel'ed colors #include "DirtyRegion.h" #include "GUIAction.h" @@ -178,7 +178,7 @@ public: virtual void SetHitRect(const CRect &rect, const color_t &color); virtual void SetCamera(const CPoint &camera); virtual void SetStereoFactor(const float &factor); - bool SetColorDiffuse(const CGUIInfoColor &color); + bool SetColorDiffuse(const KODI::GUILIB::GUIINFO::CGUIInfoColor &color); CPoint GetRenderPosition() const; virtual float GetXPosition() const; virtual float GetYPosition() const; @@ -343,7 +343,7 @@ protected: float m_width; CRect m_hitRect; color_t m_hitColor; - CGUIInfoColor m_diffuseColor; + KODI::GUILIB::GUIINFO::CGUIInfoColor m_diffuseColor; int m_controlID; int m_parentID; bool m_bHasFocus; @@ -360,7 +360,7 @@ protected: GUIVISIBLE m_visible; bool m_visibleFromSkinCondition; bool m_forceHidden; // set from the code when a hidden operation is given - overrides m_visible - CGUIInfoBool m_allowHiddenFocus; + KODI::GUILIB::GUIINFO::CGUIInfoBool m_allowHiddenFocus; bool m_hasProcessed; // enable/disable state INFO::InfoPtr m_enableCondition; diff --git a/xbmc/guilib/GUIControlFactory.cpp b/xbmc/guilib/GUIControlFactory.cpp index aa18c26b16..2a1b9b04fc 100644 --- a/xbmc/guilib/GUIControlFactory.cpp +++ b/xbmc/guilib/GUIControlFactory.cpp @@ -66,6 +66,7 @@ #include "Util.h" using namespace KODI; +using namespace KODI::GUILIB; using namespace PVR; typedef struct @@ -331,7 +332,7 @@ bool CGUIControlFactory::GetAspectRatio(const TiXmlNode* pRootNode, const char* return true; } -bool CGUIControlFactory::GetInfoTexture(const TiXmlNode* pRootNode, const char* strTag, CTextureInfo &image, CGUIInfoLabel &info, int parentID) +bool CGUIControlFactory::GetInfoTexture(const TiXmlNode* pRootNode, const char* strTag, CTextureInfo &image, GUIINFO::CGUIInfoLabel &info, int parentID) { GetTexture(pRootNode, strTag, image); image.filename = ""; @@ -551,7 +552,7 @@ bool CGUIControlFactory::GetColor(const TiXmlNode *control, const char *strTag, return false; } -bool CGUIControlFactory::GetInfoColor(const TiXmlNode *control, const char *strTag, CGUIInfoColor &value,int parentID) +bool CGUIControlFactory::GetInfoColor(const TiXmlNode *control, const char *strTag, GUIINFO::CGUIInfoColor &value,int parentID) { const TiXmlElement* node = control->FirstChildElement(strTag); if (node && node->FirstChild()) @@ -562,15 +563,15 @@ bool CGUIControlFactory::GetInfoColor(const TiXmlNode *control, const char *strT return false; } -void CGUIControlFactory::GetInfoLabel(const TiXmlNode *pControlNode, const std::string &labelTag, CGUIInfoLabel &infoLabel, int parentID) +void CGUIControlFactory::GetInfoLabel(const TiXmlNode *pControlNode, const std::string &labelTag, GUIINFO::CGUIInfoLabel &infoLabel, int parentID) { - std::vector<CGUIInfoLabel> labels; + std::vector<GUIINFO::CGUIInfoLabel> labels; GetInfoLabels(pControlNode, labelTag, labels, parentID); if (labels.size()) infoLabel = labels[0]; } -bool CGUIControlFactory::GetInfoLabelFromElement(const TiXmlElement *element, CGUIInfoLabel &infoLabel, int parentID) +bool CGUIControlFactory::GetInfoLabelFromElement(const TiXmlElement *element, GUIINFO::CGUIInfoLabel &infoLabel, int parentID) { if (!element || !element->FirstChild()) return false; @@ -590,7 +591,7 @@ bool CGUIControlFactory::GetInfoLabelFromElement(const TiXmlElement *element, CG return true; } -void CGUIControlFactory::GetInfoLabels(const TiXmlNode *pControlNode, const std::string &labelTag, std::vector<CGUIInfoLabel> &infoLabels, int parentID) +void CGUIControlFactory::GetInfoLabels(const TiXmlNode *pControlNode, const std::string &labelTag, std::vector<GUIINFO::CGUIInfoLabel> &infoLabels, int parentID) { // we can have the following infolabels: // 1. <number>1234</number> -> direct number @@ -601,13 +602,13 @@ void CGUIControlFactory::GetInfoLabels(const TiXmlNode *pControlNode, const std: if (XMLUtils::GetInt(pControlNode, "number", labelNumber)) { std::string label = StringUtils::Format("%i", labelNumber); - infoLabels.push_back(CGUIInfoLabel(label)); + infoLabels.push_back(GUIINFO::CGUIInfoLabel(label)); return; // done } const TiXmlElement *labelNode = pControlNode->FirstChildElement(labelTag); while (labelNode) { - CGUIInfoLabel label; + GUIINFO::CGUIInfoLabel label; if (GetInfoLabelFromElement(labelNode, label, parentID)) infoLabels.push_back(label); labelNode = labelNode->NextSiblingElement(labelTag); @@ -624,7 +625,7 @@ void CGUIControlFactory::GetInfoLabels(const TiXmlNode *pControlNode, const std: if (infoNode->FirstChild()) { std::string info = StringUtils::Format("$INFO[%s]", infoNode->FirstChild()->Value()); - infoLabels.push_back(CGUIInfoLabel(info, fallback, parentID)); + infoLabels.push_back(GUIINFO::CGUIInfoLabel(info, fallback, parentID)); } infoNode = infoNode->NextSibling("info"); } @@ -673,7 +674,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl CGUIControl::ActionMap actions; int pageControl = 0; - CGUIInfoColor colorDiffuse(0xFFFFFFFF); + GUIINFO::CGUIInfoColor colorDiffuse(0xFFFFFFFF); int defaultControl = 0; bool defaultAlways = false; std::string strTmp; @@ -701,14 +702,14 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl CTextureInfo textureUpFocus, textureDownFocus; CTextureInfo textureUpDisabled, textureDownDisabled; CTextureInfo texture, borderTexture; - CGUIInfoLabel textureFile; + GUIINFO::CGUIInfoLabel textureFile; CTextureInfo textureFocus, textureNoFocus; CTextureInfo textureAltFocus, textureAltNoFocus; CTextureInfo textureRadioOnFocus, textureRadioOnNoFocus; CTextureInfo textureRadioOffFocus, textureRadioOffNoFocus; CTextureInfo textureRadioOnDisabled, textureRadioOffDisabled; CTextureInfo textureProgressIndicator; - CGUIInfoLabel texturePath; + GUIINFO::CGUIInfoLabel texturePath; CRect borderSize; float sliderWidth = 150, sliderHeight = 16; @@ -746,9 +747,9 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl CLabelInfo labelInfo, labelInfoMono; - CGUIInfoColor hitColor(0xFFFFFFFF); - CGUIInfoColor textColor3; - CGUIInfoColor headlineColor; + GUIINFO::CGUIInfoColor hitColor(0xFFFFFFFF); + GUIINFO::CGUIInfoColor textColor3; + GUIINFO::CGUIInfoColor headlineColor; float radioWidth = 0; float radioHeight = 0; @@ -950,7 +951,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl GetTexture(pControlNode, "bordertexture", borderTexture); // fade label can have a whole bunch, but most just have one - std::vector<CGUIInfoLabel> infoLabels; + std::vector<GUIINFO::CGUIInfoLabel> infoLabels; GetInfoLabels(pControlNode, "label", infoLabels, parentID); GetString(pControlNode, "label", strLabel); @@ -1051,7 +1052,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl viewType = VIEW_TYPE_BIG_INFO; const char *label = itemElement->Attribute("label"); if (label) - viewLabel = CGUIInfoLabel::GetLabel(FilterLabel(label)); + viewLabel = GUIINFO::CGUIInfoLabel::GetLabel(FilterLabel(label)); } TiXmlElement *cam = pControlNode->FirstChildElement("camera"); @@ -1107,7 +1108,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl break; case CGUIControl::GUICONTROL_LABEL: { - const CGUIInfoLabel &content = (infoLabels.size()) ? infoLabels[0] : CGUIInfoLabel(""); + const GUIINFO::CGUIInfoLabel &content = (infoLabels.size()) ? infoLabels[0] : GUIINFO::CGUIInfoLabel(""); if (insideContainer) { // inside lists we use CGUIListLabel control = new CGUIListLabel(parentID, id, posX, posY, width, height, labelInfo, content, scrollValue); @@ -1128,7 +1129,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl parentID, id, posX, posY, width, height, textureFocus, textureNoFocus, labelInfo, strLabel); - CGUIInfoLabel hint_text; + GUIINFO::CGUIInfoLabel hint_text; GetInfoLabel(pControlNode, "hinttext", hint_text, parentID); static_cast<CGUIEditControl*>(control)->SetHint(hint_text); @@ -1145,17 +1146,15 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl break; case CGUIControl::GUICONTROL_GAME: { - using namespace RETRO; + control = new RETRO::CGUIGameControl(parentID, id, posX, posY, width, height); - control = new CGUIGameControl(parentID, id, posX, posY, width, height); - - CGUIInfoLabel scalingMethod; + GUIINFO::CGUIInfoLabel scalingMethod; GetInfoLabel(pControlNode, "scalingmethod", scalingMethod, parentID); - static_cast<CGUIGameControl*>(control)->SetScalingMethod(scalingMethod); + static_cast<RETRO::CGUIGameControl*>(control)->SetScalingMethod(scalingMethod); - CGUIInfoLabel viewMode; + GUIINFO::CGUIInfoLabel viewMode; GetInfoLabel(pControlNode, "viewmode", viewMode, parentID); - static_cast<CGUIGameControl*>(control)->SetViewMode(viewMode); + static_cast<RETRO::CGUIGameControl*>(control)->SetViewMode(viewMode); } break; case CGUIControl::GUICONTROL_FADELABEL: diff --git a/xbmc/guilib/GUIControlFactory.h b/xbmc/guilib/GUIControlFactory.h index 2831d56733..64fd913d95 100644 --- a/xbmc/guilib/GUIControlFactory.h +++ b/xbmc/guilib/GUIControlFactory.h @@ -35,10 +35,20 @@ class CTextureInfo; // forward class CAspectRatio; -class CGUIInfoLabel; class TiXmlNode; class CGUIAction; +namespace KODI +{ +namespace GUILIB +{ +namespace GUIINFO +{ + class CGUIInfoLabel; +} +} +} + /*! \ingroup controls \brief @@ -63,7 +73,7 @@ public: static std::string TranslateControlType(CGUIControl::GUICONTROLTYPES type); static bool GetAspectRatio(const TiXmlNode* pRootNode, const char* strTag, CAspectRatio &aspectRatio); - static bool GetInfoTexture(const TiXmlNode* pRootNode, const char* strTag, CTextureInfo &image, CGUIInfoLabel &info, int parentID); + static bool GetInfoTexture(const TiXmlNode* pRootNode, const char* strTag, CTextureInfo &image, KODI::GUILIB::GUIINFO::CGUIInfoLabel &info, int parentID); static bool GetTexture(const TiXmlNode* pRootNode, const char* strTag, CTextureInfo &image); static bool GetAlignment(const TiXmlNode* pRootNode, const char* strTag, uint32_t& dwAlignment); static bool GetAlignmentY(const TiXmlNode* pRootNode, const char* strTag, uint32_t& dwAlignment); @@ -92,11 +102,11 @@ public: */ static float ParsePosition(const char* pos, const float parentSize); - static bool GetInfoLabelFromElement(const TiXmlElement *element, CGUIInfoLabel &infoLabel, int parentID); - static void GetInfoLabel(const TiXmlNode *pControlNode, const std::string &labelTag, CGUIInfoLabel &infoLabel, int parentID); - static void GetInfoLabels(const TiXmlNode *pControlNode, const std::string &labelTag, std::vector<CGUIInfoLabel> &infoLabels, int parentID); + static bool GetInfoLabelFromElement(const TiXmlElement *element, KODI::GUILIB::GUIINFO::CGUIInfoLabel &infoLabel, int parentID); + static void GetInfoLabel(const TiXmlNode *pControlNode, const std::string &labelTag, KODI::GUILIB::GUIINFO::CGUIInfoLabel &infoLabel, int parentID); + static void GetInfoLabels(const TiXmlNode *pControlNode, const std::string &labelTag, std::vector<KODI::GUILIB::GUIINFO::CGUIInfoLabel> &infoLabels, int parentID); static bool GetColor(const TiXmlNode* pRootNode, const char* strTag, color_t &value); - static bool GetInfoColor(const TiXmlNode* pRootNode, const char* strTag, CGUIInfoColor &value, int parentID); + static bool GetInfoColor(const TiXmlNode* pRootNode, const char* strTag, KODI::GUILIB::GUIINFO::CGUIInfoColor &value, int parentID); static std::string FilterLabel(const std::string &label); static bool GetConditionalVisibility(const TiXmlNode* control, std::string &condition); static bool GetActions(const TiXmlNode* pRootNode, const char* strTag, CGUIAction& actions); diff --git a/xbmc/guilib/GUIEditControl.cpp b/xbmc/guilib/GUIEditControl.cpp index 14af360152..ae5a0e789c 100644 --- a/xbmc/guilib/GUIEditControl.cpp +++ b/xbmc/guilib/GUIEditControl.cpp @@ -37,6 +37,8 @@ #include "platform/darwin/osx/CocoaInterface.h" #endif +using namespace KODI::GUILIB; + using KODI::UTILITY::CDigest; const char* CGUIEditControl::smsLetters[10] = { " !@#$%^&*()[]{}<>/\\|0", ".,;:\'\"-+_=?`~1", "abc2ABC", "def3DEF", "ghi4GHI", "jkl5JKL", "mno6MNO", "pqrs7PQRS", "tuv8TUV", "wxyz9WXYZ" }; @@ -520,7 +522,7 @@ CGUILabel::COLOR CGUIEditControl::GetTextColor() const return color; } -void CGUIEditControl::SetHint(const CGUIInfoLabel& hint) +void CGUIEditControl::SetHint(const GUIINFO::CGUIInfoLabel& hint) { m_hintInfo = hint; } diff --git a/xbmc/guilib/GUIEditControl.h b/xbmc/guilib/GUIEditControl.h index 421bccf852..133719385c 100644 --- a/xbmc/guilib/GUIEditControl.h +++ b/xbmc/guilib/GUIEditControl.h @@ -66,7 +66,7 @@ public: void SetLabel(const std::string &text) override; void SetLabel2(const std::string &text) override; - void SetHint(const CGUIInfoLabel& hint); + void SetHint(const KODI::GUILIB::GUIINFO::CGUIInfoLabel& hint); std::string GetLabel2() const override; @@ -107,7 +107,7 @@ protected: std::wstring m_text2; std::string m_text; - CGUIInfoLabel m_hintInfo; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_hintInfo; float m_textOffset; float m_textWidth; CRect m_clipRect; ///< clipping rect for the second label diff --git a/xbmc/guilib/GUIFadeLabelControl.cpp b/xbmc/guilib/GUIFadeLabelControl.cpp index 28e117b5ba..88e58d87be 100644 --- a/xbmc/guilib/GUIFadeLabelControl.cpp +++ b/xbmc/guilib/GUIFadeLabelControl.cpp @@ -21,6 +21,8 @@ #include "GUIFadeLabelControl.h" #include "utils/Random.h" +using namespace KODI::GUILIB; + CGUIFadeLabelControl::CGUIFadeLabelControl(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, bool scrollOut, unsigned int timeToDelayAtEnd, bool resetOnLabelChange, bool randomized) : CGUIControl(parentID, controlID, posX, posY, width, height), m_label(labelInfo), m_scrollInfo(50, labelInfo.offsetX, labelInfo.scrollSpeed) , m_textLayout(labelInfo.font, false) @@ -57,7 +59,7 @@ CGUIFadeLabelControl::CGUIFadeLabelControl(const CGUIFadeLabelControl &from) CGUIFadeLabelControl::~CGUIFadeLabelControl(void) = default; -void CGUIFadeLabelControl::SetInfo(const std::vector<CGUIInfoLabel> &infoLabels) +void CGUIFadeLabelControl::SetInfo(const std::vector<GUIINFO::CGUIInfoLabel> &infoLabels) { m_lastLabel = -1; m_infoLabels = infoLabels; @@ -67,7 +69,7 @@ void CGUIFadeLabelControl::SetInfo(const std::vector<CGUIInfoLabel> &infoLabels) void CGUIFadeLabelControl::AddLabel(const std::string &label) { - m_infoLabels.push_back(CGUIInfoLabel(label, "", GetParentID())); + m_infoLabels.push_back(GUIINFO::CGUIInfoLabel(label, "", GetParentID())); } void CGUIFadeLabelControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) diff --git a/xbmc/guilib/GUIFadeLabelControl.h b/xbmc/guilib/GUIFadeLabelControl.h index 66c4141616..48094527d5 100644 --- a/xbmc/guilib/GUIFadeLabelControl.h +++ b/xbmc/guilib/GUIFadeLabelControl.h @@ -50,7 +50,7 @@ public: bool CanFocus() const override; bool OnMessage(CGUIMessage& message) override; - void SetInfo(const std::vector<CGUIInfoLabel> &vecInfo); + void SetInfo(const std::vector<KODI::GUILIB::GUIINFO::CGUIInfoLabel> &vecInfo); void SetScrolling(bool scroll) { m_scroll = scroll; } protected: @@ -68,7 +68,7 @@ protected: */ std::string GetLabel(); - std::vector< CGUIInfoLabel > m_infoLabels; + std::vector<KODI::GUILIB::GUIINFO::CGUIInfoLabel> m_infoLabels; unsigned int m_currentLabel; unsigned int m_lastLabel; diff --git a/xbmc/guilib/GUIImage.cpp b/xbmc/guilib/GUIImage.cpp index 26ae17628e..e565cf25c7 100644 --- a/xbmc/guilib/GUIImage.cpp +++ b/xbmc/guilib/GUIImage.cpp @@ -23,6 +23,8 @@ #include <cassert> +using namespace KODI::GUILIB; + CGUIImage::CGUIImage(int parentID, int controlID, float posX, float posY, float width, float height, const CTextureInfo& texture) : CGUIControl(parentID, controlID, posX, posY, width, height) , m_texture(posX, posY, width, height, texture) @@ -379,7 +381,7 @@ void CGUIImage::SetPosition(float posX, float posY) CGUIControl::SetPosition(posX, posY); } -void CGUIImage::SetInfo(const CGUIInfoLabel &info) +void CGUIImage::SetInfo(const GUIINFO::CGUIInfoLabel &info) { m_info = info; // a constant image never needs updating diff --git a/xbmc/guilib/GUIImage.h b/xbmc/guilib/GUIImage.h index a0b4ff20a8..39e97941df 100644 --- a/xbmc/guilib/GUIImage.h +++ b/xbmc/guilib/GUIImage.h @@ -85,7 +85,7 @@ public: bool CanFocus() const override; void UpdateInfo(const CGUIListItem *item = NULL) override; - virtual void SetInfo(const CGUIInfoLabel &info); + virtual void SetInfo(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &info); virtual void SetFileName(const std::string& strFileName, bool setConstant = false, const bool useCache = true); virtual void SetAspectRatio(const CAspectRatio &aspect); void SetWidth(float width) override; @@ -114,7 +114,7 @@ protected: // border + conditional info CTextureInfo m_image; - CGUIInfoLabel m_info; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_info; CGUITexture m_texture; std::vector<CFadingTexture *> m_fadingTextures; diff --git a/xbmc/guilib/GUIIncludes.cpp b/xbmc/guilib/GUIIncludes.cpp index b2ed96e185..e7728bac9e 100644 --- a/xbmc/guilib/GUIIncludes.cpp +++ b/xbmc/guilib/GUIIncludes.cpp @@ -21,7 +21,7 @@ #include "GUIIncludes.h" #include "addons/Skin.h" #include "GUIInfoManager.h" -#include "GUIInfoTypes.h" +#include "guiinfo/GUIInfoTypes.h" #include "guilib/GUIComponent.h" #include "utils/log.h" #include "utils/XBMCTinyXML.h" @@ -29,6 +29,8 @@ #include "utils/StringUtils.h" #include "interfaces/info/SkinVariable.h" +using namespace KODI::GUILIB; + CGUIIncludes::CGUIIncludes() { m_constantAttributes.insert("x"); @@ -264,7 +266,7 @@ void CGUIIncludes::FlattenExpressions() void CGUIIncludes::FlattenExpression(std::string &expression, const std::vector<std::string> &resolved) { std::string original(expression); - CGUIInfoLabel::ReplaceSpecialKeywordReferences(expression, "EXP", [&](const std::string &expressionName) -> std::string { + GUIINFO::CGUIInfoLabel::ReplaceSpecialKeywordReferences(expression, "EXP", [&](const std::string &expressionName) -> std::string { if (std::find(resolved.begin(), resolved.end(), expressionName) != resolved.end()) { CLog::Log(LOGERROR, "Skin has a circular expression \"%s\": %s", resolved.back().c_str(), original.c_str()); @@ -659,7 +661,7 @@ public: CGUIIncludes::ResolveParamsResult CGUIIncludes::ResolveParameters(const std::string& strInput, std::string& strOutput, const Params& params) { ParamReplacer paramReplacer(params); - if (CGUIInfoLabel::ReplaceSpecialKeywordReferences(strInput, "PARAM", std::ref(paramReplacer), strOutput)) + if (GUIINFO::CGUIInfoLabel::ReplaceSpecialKeywordReferences(strInput, "PARAM", std::ref(paramReplacer), strOutput)) // detect special input values of the form "$PARAM[undefinedParam]" (with no extra characters around) return paramReplacer.GetNumUndefinedParams() == 1 && paramReplacer.GetNumTotalParams() == 1 && strOutput.empty() ? SINGLE_UNDEFINED_PARAM_RESOLVED : PARAMS_RESOLVED; return NO_PARAMS_FOUND; @@ -680,7 +682,7 @@ std::string CGUIIncludes::ResolveConstant(const std::string &constant) const std::string CGUIIncludes::ResolveExpressions(const std::string &expression) const { std::string work(expression); - CGUIInfoLabel::ReplaceSpecialKeywordReferences(work, "EXP", [&](const std::string &str) -> std::string { + GUIINFO::CGUIInfoLabel::ReplaceSpecialKeywordReferences(work, "EXP", [&](const std::string &str) -> std::string { std::map<std::string, std::string>::const_iterator it = m_expressions.find(str); if (it != m_expressions.end()) return it->second; diff --git a/xbmc/guilib/GUILabel.h b/xbmc/guilib/GUILabel.h index 418f14b327..d5ea27ecf6 100644 --- a/xbmc/guilib/GUILabel.h +++ b/xbmc/guilib/GUILabel.h @@ -26,7 +26,7 @@ */ #include "GUITextLayout.h" -#include "GUIInfoTypes.h" +#include "guiinfo/GUIInfoTypes.h" #include "GUIFont.h" #include "utils/Geometry.h" @@ -57,12 +57,12 @@ public: return changed; }; - CGUIInfoColor textColor; - CGUIInfoColor shadowColor; - CGUIInfoColor selectedColor; - CGUIInfoColor disabledColor; - CGUIInfoColor focusedColor; - CGUIInfoColor invalidColor; + KODI::GUILIB::GUIINFO::CGUIInfoColor textColor; + KODI::GUILIB::GUIINFO::CGUIInfoColor shadowColor; + KODI::GUILIB::GUIINFO::CGUIInfoColor selectedColor; + KODI::GUILIB::GUIINFO::CGUIInfoColor disabledColor; + KODI::GUILIB::GUIINFO::CGUIInfoColor focusedColor; + KODI::GUILIB::GUIINFO::CGUIInfoColor invalidColor; uint32_t align; float offsetX; float offsetY; diff --git a/xbmc/guilib/GUILabelControl.cpp b/xbmc/guilib/GUILabelControl.cpp index fefbf96624..7ffbecfcb0 100644 --- a/xbmc/guilib/GUILabelControl.cpp +++ b/xbmc/guilib/GUILabelControl.cpp @@ -22,6 +22,8 @@ #include "utils/CharsetConverter.h" #include "utils/StringUtils.h" +using namespace KODI::GUILIB; + CGUILabelControl::CGUILabelControl(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, bool wrapMultiLine, bool bHasPath) : CGUIControl(parentID, controlID, posX, posY, width, height) , m_label(posX, posY, width, height, labelInfo, wrapMultiLine ? CGUILabel::OVER_FLOW_WRAP : CGUILabel::OVER_FLOW_TRUNCATE) @@ -58,7 +60,7 @@ void CGUILabelControl::SetCursorPos(int iPos) m_iCursorPos = iPos; } -void CGUILabelControl::SetInfo(const CGUIInfoLabel &infoLabel) +void CGUILabelControl::SetInfo(const GUIINFO::CGUIInfoLabel &infoLabel) { m_infoLabel = infoLabel; } diff --git a/xbmc/guilib/GUILabelControl.h b/xbmc/guilib/GUILabelControl.h index 22ad155228..c24104e589 100644 --- a/xbmc/guilib/GUILabelControl.h +++ b/xbmc/guilib/GUILabelControl.h @@ -58,7 +58,7 @@ public: void ShowCursor(bool bShow = true); void SetCursorPos(int iPos); int GetCursorPos() const { return m_iCursorPos;}; - void SetInfo(const CGUIInfoLabel&labelInfo); + void SetInfo(const KODI::GUILIB::GUIINFO::CGUIInfoLabel&labelInfo); void SetWidthControl(float minWidth, bool bScroll); void SetAlignment(uint32_t align); void SetHighlight(unsigned int start, unsigned int end); @@ -84,7 +84,7 @@ protected: float m_minWidth; // multi-info stuff - CGUIInfoLabel m_infoLabel; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_infoLabel; unsigned int m_startHighlight; unsigned int m_endHighlight; diff --git a/xbmc/guilib/GUIListItemLayout.cpp b/xbmc/guilib/GUIListItemLayout.cpp index da99188b19..00e18bcff8 100644 --- a/xbmc/guilib/GUIListItemLayout.cpp +++ b/xbmc/guilib/GUIListItemLayout.cpp @@ -26,6 +26,8 @@ #include "GUIImage.h" #include "utils/XBMCTinyXML.h" +using namespace KODI::GUILIB; + CGUIListItemLayout::CGUIListItemLayout() : m_group(0, 0, 0, 0, 0, 0) { @@ -209,14 +211,14 @@ void CGUIListItemLayout::CreateListControlLayouts(float width, float height, boo m_group.AddControl(tex); } CGUIImage *image = new CGUIImage(0, 0, 8, 0, iconWidth, texHeight, CTextureInfo("")); - image->SetInfo(CGUIInfoLabel("$INFO[ListItem.Icon]", "", m_group.GetParentID())); + image->SetInfo(GUIINFO::CGUIInfoLabel("$INFO[ListItem.Icon]", "", m_group.GetParentID())); image->SetAspectRatio(CAspectRatio::AR_KEEP); m_group.AddControl(image); float x = iconWidth + labelInfo.offsetX + 10; - CGUIListLabel *label = new CGUIListLabel(0, 0, x, labelInfo.offsetY, width - x - 18, height, labelInfo, CGUIInfoLabel("$INFO[ListItem.Label]", "", m_group.GetParentID()), CGUIControl::FOCUS); + CGUIListLabel *label = new CGUIListLabel(0, 0, x, labelInfo.offsetY, width - x - 18, height, labelInfo, GUIINFO::CGUIInfoLabel("$INFO[ListItem.Label]", "", m_group.GetParentID()), CGUIControl::FOCUS); m_group.AddControl(label); x = labelInfo2.offsetX ? labelInfo2.offsetX : m_width - 16; - label = new CGUIListLabel(0, 0, x, labelInfo2.offsetY, x - iconWidth - 20, height, labelInfo2, CGUIInfoLabel("$INFO[ListItem.Label2]", "", m_group.GetParentID()), CGUIControl::FOCUS); + label = new CGUIListLabel(0, 0, x, labelInfo2.offsetY, x - iconWidth - 20, height, labelInfo2, GUIINFO::CGUIInfoLabel("$INFO[ListItem.Label2]", "", m_group.GetParentID()), CGUIControl::FOCUS); m_group.AddControl(label); } //#endif diff --git a/xbmc/guilib/GUIListItemLayout.h b/xbmc/guilib/GUIListItemLayout.h index 14498c2d71..a8991b1817 100644 --- a/xbmc/guilib/GUIListItemLayout.h +++ b/xbmc/guilib/GUIListItemLayout.h @@ -22,7 +22,7 @@ #include "GUIListGroup.h" #include "GUITexture.h" -#include "GUIInfoTypes.h" +#include "guiinfo/GUIInfoTypes.h" class CGUIListItem; class CFileItem; @@ -72,6 +72,6 @@ protected: bool m_invalidated; INFO::InfoPtr m_condition; - CGUIInfoBool m_isPlaying; + KODI::GUILIB::GUIINFO::CGUIInfoBool m_isPlaying; }; diff --git a/xbmc/guilib/GUIListLabel.cpp b/xbmc/guilib/GUIListLabel.cpp index ad18133216..8ba7668929 100644 --- a/xbmc/guilib/GUIListLabel.cpp +++ b/xbmc/guilib/GUIListLabel.cpp @@ -22,7 +22,10 @@ #include <limits> #include "addons/Skin.h" -CGUIListLabel::CGUIListLabel(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, const CGUIInfoLabel &info, CGUIControl::GUISCROLLVALUE scroll) +using namespace KODI::GUILIB; + +CGUIListLabel::CGUIListLabel(int parentID, int controlID, float posX, float posY, float width, float height, + const CLabelInfo& labelInfo, const GUIINFO::CGUIInfoLabel &info, CGUIControl::GUISCROLLVALUE scroll) : CGUIControl(parentID, controlID, posX, posY, width, height) , m_label(posX, posY, width, height, labelInfo, (scroll == CGUIControl::ALWAYS) ? CGUILabel::OVER_FLOW_SCROLL : CGUILabel::OVER_FLOW_TRUNCATE) , m_info(info) diff --git a/xbmc/guilib/GUIListLabel.h b/xbmc/guilib/GUIListLabel.h index e50f3641cf..1d4796b7cd 100644 --- a/xbmc/guilib/GUIListLabel.h +++ b/xbmc/guilib/GUIListLabel.h @@ -36,7 +36,8 @@ class CGUIListLabel : public CGUIControl { public: - CGUIListLabel(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, const CGUIInfoLabel &label, CGUIControl::GUISCROLLVALUE scroll); + CGUIListLabel(int parentID, int controlID, float posX, float posY, float width, float height, + const CLabelInfo& labelInfo, const KODI::GUILIB::GUIINFO::CGUIInfoLabel &label, CGUIControl::GUISCROLLVALUE scroll); ~CGUIListLabel(void) override; CGUIListLabel *Clone() const override { return new CGUIListLabel(*this); }; @@ -63,6 +64,6 @@ protected: bool UpdateColors() override; CGUILabel m_label; - CGUIInfoLabel m_info; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_info; CGUIControl::GUISCROLLVALUE m_scroll; }; diff --git a/xbmc/guilib/GUIMultiImage.cpp b/xbmc/guilib/GUIMultiImage.cpp index 7b66ba3fc1..30ccdf63d7 100644 --- a/xbmc/guilib/GUIMultiImage.cpp +++ b/xbmc/guilib/GUIMultiImage.cpp @@ -33,6 +33,7 @@ #include "utils/Random.h" #include "utils/StringUtils.h" +using namespace KODI::GUILIB; using namespace XFILE; CGUIMultiImage::CGUIMultiImage(int parentID, int controlID, float posX, float posY, float width, float height, const CTextureInfo& texture, unsigned int timePerImage, unsigned int fadeTime, bool randomized, bool loop, unsigned int timeToPauseAtEnd) @@ -281,7 +282,7 @@ void CGUIMultiImage::OnJobComplete(unsigned int jobID, bool success, CJob *job) } } -void CGUIMultiImage::SetInfo(const CGUIInfoLabel &info) +void CGUIMultiImage::SetInfo(const GUIINFO::CGUIInfoLabel &info) { m_texturePath = info; if (m_texturePath.IsConstant()) diff --git a/xbmc/guilib/GUIMultiImage.h b/xbmc/guilib/GUIMultiImage.h index bf0de7798b..39a6d23471 100644 --- a/xbmc/guilib/GUIMultiImage.h +++ b/xbmc/guilib/GUIMultiImage.h @@ -61,7 +61,7 @@ public: bool CanFocus() const override; std::string GetDescription() const override; - void SetInfo(const CGUIInfoLabel &info); + void SetInfo(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &info); void SetAspectRatio(const CAspectRatio &ratio); protected: @@ -83,7 +83,7 @@ protected: std::string m_path; }; - CGUIInfoLabel m_texturePath; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_texturePath; std::string m_currentPath; unsigned int m_currentImage; CStopWatch m_imageTimer; diff --git a/xbmc/guilib/GUIRSSControl.cpp b/xbmc/guilib/GUIRSSControl.cpp index a8f5ea38bd..25320b892b 100644 --- a/xbmc/guilib/GUIRSSControl.cpp +++ b/xbmc/guilib/GUIRSSControl.cpp @@ -26,7 +26,11 @@ #include "utils/RssReader.h" #include "utils/StringUtils.h" -CGUIRSSControl::CGUIRSSControl(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, const CGUIInfoColor &channelColor, const CGUIInfoColor &headlineColor, std::string& strRSSTags) +using namespace KODI::GUILIB; + +CGUIRSSControl::CGUIRSSControl(int parentID, int controlID, float posX, float posY, float width, float height, + const CLabelInfo& labelInfo, const GUIINFO::CGUIInfoColor &channelColor, + const GUIINFO::CGUIInfoColor &headlineColor, std::string& strRSSTags) : CGUIControl(parentID, controlID, posX, posY, width, height), m_strRSSTags(strRSSTags), m_label(labelInfo), diff --git a/xbmc/guilib/GUIRSSControl.h b/xbmc/guilib/GUIRSSControl.h index f6ffd25649..d3675187e7 100644 --- a/xbmc/guilib/GUIRSSControl.h +++ b/xbmc/guilib/GUIRSSControl.h @@ -46,7 +46,9 @@ class CRssReader; class CGUIRSSControl : public CGUIControl, public IRssObserver { public: - CGUIRSSControl(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, const CGUIInfoColor &channelColor, const CGUIInfoColor &headlineColor, std::string& strRSSTags); + CGUIRSSControl(int parentID, int controlID, float posX, float posY, float width, float height, + const CLabelInfo& labelInfo, const KODI::GUILIB::GUIINFO::CGUIInfoColor &channelColor, + const KODI::GUILIB::GUIINFO::CGUIInfoColor &headlineColor, std::string& strRSSTags); CGUIRSSControl(const CGUIRSSControl &from); ~CGUIRSSControl(void) override; CGUIRSSControl *Clone() const override { return new CGUIRSSControl(*this); }; @@ -74,8 +76,8 @@ protected: std::string m_strRSSTags; CLabelInfo m_label; - CGUIInfoColor m_channelColor; - CGUIInfoColor m_headlineColor; + KODI::GUILIB::GUIINFO::CGUIInfoColor m_channelColor; + KODI::GUILIB::GUIINFO::CGUIInfoColor m_headlineColor; std::vector<std::string> m_vecUrls; std::vector<int> m_vecIntervals; diff --git a/xbmc/guilib/GUIStaticItem.cpp b/xbmc/guilib/GUIStaticItem.cpp index fcd0a42c4c..57b91efd92 100644 --- a/xbmc/guilib/GUIStaticItem.cpp +++ b/xbmc/guilib/GUIStaticItem.cpp @@ -26,13 +26,15 @@ #include "utils/Variant.h" #include "utils/StringUtils.h" +using namespace KODI::GUILIB; + CGUIStaticItem::CGUIStaticItem(const TiXmlElement *item, int parentID) : CFileItem() { m_visState = false; assert(item); - CGUIInfoLabel label, label2, thumb, icon; + GUIINFO::CGUIInfoLabel label, label2, thumb, icon; CGUIControlFactory::GetInfoLabel(item, "label", label, parentID); CGUIControlFactory::GetInfoLabel(item, "label2", label2, parentID); CGUIControlFactory::GetInfoLabel(item, "thumb", thumb, parentID); @@ -56,7 +58,7 @@ CGUIStaticItem::CGUIStaticItem(const TiXmlElement *item, int parentID) : CFileIt while (property) { std::string name = XMLUtils::GetAttribute(property, "name"); - CGUIInfoLabel prop; + GUIINFO::CGUIInfoLabel prop; if (!name.empty() && CGUIControlFactory::GetInfoLabelFromElement(property, prop, parentID)) { SetProperty(name, prop.GetLabel(parentID, true).c_str()); @@ -77,7 +79,7 @@ void CGUIStaticItem::UpdateProperties(int contextWindow) { for (InfoVector::const_iterator i = m_info.begin(); i != m_info.end(); ++i) { - const CGUIInfoLabel &info = i->first; + const GUIINFO::CGUIInfoLabel &info = i->first; const std::string &name = i->second; bool preferTexture = strnicmp("label", name.c_str(), 5) != 0; std::string value(info.GetLabel(contextWindow, preferTexture)); diff --git a/xbmc/guilib/GUIStaticItem.h b/xbmc/guilib/GUIStaticItem.h index 66dbfee46d..d42214f909 100644 --- a/xbmc/guilib/GUIStaticItem.h +++ b/xbmc/guilib/GUIStaticItem.h @@ -29,7 +29,7 @@ #include <vector> #include "GUIAction.h" -#include "GUIInfoTypes.h" +#include "guiinfo/GUIInfoTypes.h" #include "FileItem.h" #include "GUIAction.h" @@ -91,7 +91,7 @@ public: const CGUIAction &GetClickActions() const { return m_clickActions; }; private: - typedef std::vector< std::pair<CGUIInfoLabel, std::string> > InfoVector; + typedef std::vector< std::pair<KODI::GUILIB::GUIINFO::CGUIInfoLabel, std::string> > InfoVector; InfoVector m_info; INFO::InfoPtr m_visCondition; bool m_visState; diff --git a/xbmc/guilib/GUITextBox.cpp b/xbmc/guilib/GUITextBox.cpp index a80f3eae15..3cee71a8c9 100644 --- a/xbmc/guilib/GUITextBox.cpp +++ b/xbmc/guilib/GUITextBox.cpp @@ -28,6 +28,8 @@ #include <algorithm> +using namespace KODI::GUILIB; + CGUITextBox::CGUITextBox(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, int scrollTime, const CLabelInfo* labelInfoMono) @@ -340,7 +342,7 @@ void CGUITextBox::SetPageControl(int pageControl) m_pageControl = pageControl; } -void CGUITextBox::SetInfo(const CGUIInfoLabel &infoLabel) +void CGUITextBox::SetInfo(const GUIINFO::CGUIInfoLabel &infoLabel) { m_info = infoLabel; } diff --git a/xbmc/guilib/GUITextBox.h b/xbmc/guilib/GUITextBox.h index 5061299e9c..38e4858007 100644 --- a/xbmc/guilib/GUITextBox.h +++ b/xbmc/guilib/GUITextBox.h @@ -59,7 +59,7 @@ public: void SetPageControl(int pageControl); bool CanFocus() const override; - void SetInfo(const CGUIInfoLabel &info); + void SetInfo(const KODI::GUILIB::GUIINFO::CGUIInfoLabel &info); void SetAutoScrolling(const TiXmlNode *node); void SetAutoScrolling(int delay, int time, int repeatTime, const std::string &condition = ""); void ResetAutoScrolling(); @@ -106,6 +106,6 @@ protected: int m_pageControl; - CGUIInfoLabel m_info; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_info; }; #endif diff --git a/xbmc/guilib/GUITexture.h b/xbmc/guilib/GUITexture.h index dbf5f2d3a4..e0f3bfa38a 100644 --- a/xbmc/guilib/GUITexture.h +++ b/xbmc/guilib/GUITexture.h @@ -30,7 +30,7 @@ #include "TextureManager.h" #include "utils/Geometry.h" -#include "GUIInfoTypes.h" +#include "guiinfo/GUIInfoTypes.h" typedef uint32_t color_t; @@ -77,7 +77,7 @@ public: CRect border; // scaled - unneeded if we get rid of scale on load int orientation; // orientation of the texture (0 - 7 == EXIForientation - 1) std::string diffuse; // diffuse overlay texture - CGUIInfoColor diffuseColor; // diffuse color + KODI::GUILIB::GUIINFO::CGUIInfoColor diffuseColor; // diffuse color std::string filename; // main texture file }; diff --git a/xbmc/guilib/GUIWindow.h b/xbmc/guilib/GUIWindow.h index 1a1b774f50..955913a671 100644 --- a/xbmc/guilib/GUIWindow.h +++ b/xbmc/guilib/GUIWindow.h @@ -283,7 +283,7 @@ protected: bool m_dynamicResourceAlloc; bool m_closing; bool m_active; // true if window is active or dialog is running - CGUIInfoColor m_clearBackground; // colour to clear the window + KODI::GUILIB::GUIINFO::CGUIInfoColor m_clearBackground; // colour to clear the window int m_renderOrder; // for render order of dialogs diff --git a/xbmc/guilib/guiinfo/CMakeLists.txt b/xbmc/guilib/guiinfo/CMakeLists.txt index 38d788bf0e..9eda08a54a 100644 --- a/xbmc/guilib/guiinfo/CMakeLists.txt +++ b/xbmc/guilib/guiinfo/CMakeLists.txt @@ -1,6 +1,7 @@ set(SOURCES GUIInfo.cpp GUIInfoHelper.cpp GUIInfoProviders.cpp + GUIInfoTypes.cpp AddonsGUIInfo.cpp GamesGUIInfo.cpp GUIControlsGUIInfo.cpp @@ -19,6 +20,7 @@ set(HEADERS GUIInfo.h GUIInfoLabels.h GUIInfoProvider.h GUIInfoProviders.h + GUIInfoTypes.h IGUIInfoProvider.h AddonsGUIInfo.h GamesGUIInfo.h diff --git a/xbmc/guilib/GUIInfoTypes.cpp b/xbmc/guilib/guiinfo/GUIInfoTypes.cpp index 1f090012a5..1bac1f238f 100644 --- a/xbmc/guilib/GUIInfoTypes.cpp +++ b/xbmc/guilib/guiinfo/GUIInfoTypes.cpp @@ -18,18 +18,20 @@ * */ -#include "GUIInfoTypes.h" +#include "guilib/guiinfo/GUIInfoTypes.h" + #include "GUIInfoManager.h" -#include "guilib/GUIComponent.h" #include "addons/AddonManager.h" -#include "utils/log.h" -#include "LocalizeStrings.h" -#include "GUIColorManager.h" -#include "GUIListItem.h" -#include "utils/StringUtils.h" #include "addons/Skin.h" +#include "guilib/GUIColorManager.h" +#include "guilib/GUIComponent.h" +#include "guilib/GUIListItem.h" +#include "guilib/LocalizeStrings.h" +#include "utils/StringUtils.h" +#include "utils/log.h" using ADDON::CAddonMgr; +using namespace KODI::GUILIB::GUIINFO; CGUIInfoBool::CGUIInfoBool(bool value) { diff --git a/xbmc/guilib/GUIInfoTypes.h b/xbmc/guilib/guiinfo/GUIInfoTypes.h index 085ec7deee..7a81a79356 100644 --- a/xbmc/guilib/GUIInfoTypes.h +++ b/xbmc/guilib/guiinfo/GUIInfoTypes.h @@ -36,6 +36,13 @@ class CGUIListItem; +namespace KODI +{ +namespace GUILIB +{ +namespace GUIINFO +{ + class CGUIInfoBool { public: @@ -177,4 +184,8 @@ private: std::vector<CInfoPortion> m_info; }; +} // namespace GUIINFO +} // namespace GUILIB +} // namespace KODI + #endif diff --git a/xbmc/interfaces/info/SkinVariable.cpp b/xbmc/interfaces/info/SkinVariable.cpp index cf689d6e9d..d591eee0fa 100644 --- a/xbmc/interfaces/info/SkinVariable.cpp +++ b/xbmc/interfaces/info/SkinVariable.cpp @@ -25,6 +25,7 @@ #include "utils/XBMCTinyXML.h" using namespace INFO; +using namespace KODI; const CSkinVariableString* CSkinVariable::CreateFromXML(const TiXmlElement& node, int context) { @@ -43,7 +44,7 @@ const CSkinVariableString* CSkinVariable::CreateFromXML(const TiXmlElement& node pair.m_condition = CServiceBroker::GetGUI()->GetInfoManager().Register(condition, context); auto label = valuenode->FirstChild() ? valuenode->FirstChild()->ValueStr() : ""; - pair.m_label = CGUIInfoLabel(label); + pair.m_label = GUILIB::GUIINFO::CGUIInfoLabel(label); tmp->m_conditionLabelPairs.push_back(pair); if (!pair.m_condition) break; // once we reach default value (without condition) break iterating diff --git a/xbmc/interfaces/info/SkinVariable.h b/xbmc/interfaces/info/SkinVariable.h index 77b54cd213..9b72d40769 100644 --- a/xbmc/interfaces/info/SkinVariable.h +++ b/xbmc/interfaces/info/SkinVariable.h @@ -21,7 +21,7 @@ #include <string> #include <vector> -#include "guilib/GUIInfoTypes.h" +#include "guilib/guiinfo/GUIInfoTypes.h" #include "interfaces/info/InfoBool.h" class TiXmlElement; @@ -51,7 +51,7 @@ private: struct ConditionLabelPair { INFO::InfoPtr m_condition; - CGUIInfoLabel m_label; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_label; }; typedef std::vector<ConditionLabelPair> VECCONDITIONLABELPAIR; diff --git a/xbmc/interfaces/legacy/Control.cpp b/xbmc/interfaces/legacy/Control.cpp index 1d4c1b1b0c..ad6c90eb09 100644 --- a/xbmc/interfaces/legacy/Control.cpp +++ b/xbmc/interfaces/legacy/Control.cpp @@ -44,6 +44,8 @@ #include "utils/StringUtils.h" #include "WindowException.h" +using namespace KODI; + namespace XBMCAddon { namespace xbmcgui @@ -345,7 +347,7 @@ namespace XBMCAddon XBMCAddonUtils::GuiLock lock(languageHook, false); if (pGUIControl) - static_cast<CGUIImage*>(pGUIControl)->SetColorDiffuse(CGUIInfoColor(colorDiffuse)); + static_cast<CGUIImage*>(pGUIControl)->SetColorDiffuse(GUILIB::GUIINFO::CGUIInfoColor(colorDiffuse)); } CGUIControl* ControlImage::Create() @@ -358,7 +360,7 @@ namespace XBMCAddon static_cast<CGUIImage*>(pGUIControl)->SetAspectRatio((CAspectRatio::ASPECT_RATIO)aspectRatio); if (pGUIControl && colorDiffuse) - static_cast<CGUIImage*>(pGUIControl)->SetColorDiffuse(CGUIInfoColor(colorDiffuse)); + static_cast<CGUIImage*>(pGUIControl)->SetColorDiffuse(GUILIB::GUIINFO::CGUIInfoColor(colorDiffuse)); return pGUIControl; } @@ -413,7 +415,7 @@ namespace XBMCAddon CTextureInfo(strTextureOverlay)); if (pGUIControl && colorDiffuse) - static_cast<CGUIProgressControl*>(pGUIControl)->SetColorDiffuse(CGUIInfoColor(colorDiffuse)); + static_cast<CGUIProgressControl*>(pGUIControl)->SetColorDiffuse(GUILIB::GUIINFO::CGUIInfoColor(colorDiffuse)); return pGUIControl; } diff --git a/xbmc/interfaces/legacy/ModuleXbmc.cpp b/xbmc/interfaces/legacy/ModuleXbmc.cpp index 075204a3ca..9d97d7ec83 100644 --- a/xbmc/interfaces/legacy/ModuleXbmc.cpp +++ b/xbmc/interfaces/legacy/ModuleXbmc.cpp @@ -60,6 +60,7 @@ #include <vector> #include "utils/log.h" +using namespace KODI; using namespace KODI::MESSAGING; #ifdef TARGET_POSIX @@ -296,7 +297,7 @@ namespace XBMCAddon //doesn't seem to be a single InfoTag? //try full blown GuiInfoLabel then if (ret == 0) - return CGUIInfoLabel::GetLabel(cLine); + return GUILIB::GUIINFO::CGUIInfoLabel::GetLabel(cLine); else return infoMgr.GetLabel(ret); } diff --git a/xbmc/listproviders/DirectoryProvider.h b/xbmc/listproviders/DirectoryProvider.h index 102bcfb64d..a621ba111e 100644 --- a/xbmc/listproviders/DirectoryProvider.h +++ b/xbmc/listproviders/DirectoryProvider.h @@ -73,11 +73,11 @@ private: UpdateState m_updateState; bool m_isAnnounced; unsigned int m_jobID; - CGUIInfoLabel m_url; - CGUIInfoLabel m_target; - CGUIInfoLabel m_sortMethod; - CGUIInfoLabel m_sortOrder; - CGUIInfoLabel m_limit; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_url; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_target; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_sortMethod; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_sortOrder; + KODI::GUILIB::GUIINFO::CGUIInfoLabel m_limit; std::string m_currentUrl; std::string m_currentTarget; ///< \brief node.target property on the list as a whole SortDescription m_currentSort; |