diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /xbmc/guilib/GUIProgressControl.h | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/guilib/GUIProgressControl.h')
-rw-r--r-- | xbmc/guilib/GUIProgressControl.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/xbmc/guilib/GUIProgressControl.h b/xbmc/guilib/GUIProgressControl.h new file mode 100644 index 0000000..9509e1c --- /dev/null +++ b/xbmc/guilib/GUIProgressControl.h @@ -0,0 +1,71 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +/*! +\file GUIProgressControl.h +\brief +*/ + +#include "GUIControl.h" +#include "GUITexture.h" + +/*! + \ingroup controls + \brief + */ +class CGUIProgressControl : + public CGUIControl +{ +public: + CGUIProgressControl(int parentID, int controlID, float posX, float posY, + float width, float height, const CTextureInfo& backGroundTexture, + const CTextureInfo& leftTexture, const CTextureInfo& midTexture, + const CTextureInfo& rightTexture, const CTextureInfo& overlayTexture, + bool reveal=false); + ~CGUIProgressControl() override = default; + CGUIProgressControl* Clone() const override { return new CGUIProgressControl(*this); } + + void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override; + void Render() override; + bool CanFocus() const override; + void AllocResources() override; + void FreeResources(bool immediately = false) override; + void DynamicResourceAlloc(bool bOnOff) override; + void SetInvalid() override; + bool OnMessage(CGUIMessage& message) override; + void SetPosition(float posX, float posY) override; + void SetPercentage(float fPercent); + void SetInfo(int iInfo, int iInfo2 = 0); + int GetInfo() const { return m_iInfoCode; } + + float GetPercentage() const; + std::string GetDescription() const override; + void UpdateInfo(const CGUIListItem *item = NULL) override; + bool UpdateLayout(void); +protected: + bool UpdateColors(const CGUIListItem* item) override; + std::unique_ptr<CGUITexture> m_guiBackground; + std::unique_ptr<CGUITexture> m_guiLeft; + std::unique_ptr<CGUITexture> m_guiMid; + std::unique_ptr<CGUITexture> m_guiRight; + std::unique_ptr<CGUITexture> m_guiOverlay; + CRect m_guiMidClipRect; + + int m_iInfoCode; + int m_iInfoCode2 = 0; + float m_fPercent; + float m_fPercent2 = 0.0f; + bool m_bReveal; + bool m_bChanged; + +private: + CGUIProgressControl(const CGUIProgressControl& control); +}; + |