2 * Copyright (C) 2005-2021 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
12 \file CGUIColorButtonControl.h
15 #include "GUIButtonControl.h"
16 #include "guilib/GUILabel.h"
17 #include "guilib/guiinfo/GUIInfoColor.h"
18 #include "utils/ColorUtils.h"
24 class CGUIColorButtonControl
: public CGUIButtonControl
27 CGUIColorButtonControl(int parentID
,
33 const CTextureInfo
& textureFocus
,
34 const CTextureInfo
& textureNoFocus
,
35 const CLabelInfo
& labelInfo
,
36 const CTextureInfo
& colorMask
,
37 const CTextureInfo
& colorDisabledMask
);
39 ~CGUIColorButtonControl() override
= default;
40 CGUIColorButtonControl
* Clone() const override
{ return new CGUIColorButtonControl(*this); }
41 CGUIColorButtonControl(const CGUIColorButtonControl
& control
);
43 void Process(unsigned int currentTime
, CDirtyRegionList
& dirtyregions
) override
;
44 void Render() override
;
45 bool OnAction(const CAction
& action
) override
;
46 bool OnMessage(CGUIMessage
& message
) override
;
47 void AllocResources() override
;
48 void FreeResources(bool immediately
= false) override
;
49 void DynamicResourceAlloc(bool bOnOff
) override
;
50 void SetInvalid() override
;
51 void SetPosition(float posX
, float posY
) override
;
52 void SetWidth(float width
) override
;
53 void SetHeight(float height
) override
;
54 std::string
GetDescription() const override
;
55 void SetColorDimensions(float posX
, float posY
, float width
, float height
);
56 bool IsSelected() const { return m_bSelected
; }
57 void SetImageBoxColor(const std::string
& hexColor
);
58 void SetImageBoxColor(KODI::GUILIB::GUIINFO::CGUIInfoColor color
);
61 bool UpdateColors(const CGUIListItem
* item
) override
;
62 void ProcessInfoText(unsigned int currentTime
);
63 void RenderInfoText();
64 CGUILabel::COLOR
GetTextColor() const override
;
65 std::unique_ptr
<CGUITexture
> m_imgColorMask
;
66 std::unique_ptr
<CGUITexture
> m_imgColorDisabledMask
;
69 KODI::GUILIB::GUIINFO::CGUIInfoColor m_imgBoxColor
;
70 CGUILabel m_labelInfo
;