xbmc
xbmc
guilib
GUIColorButtonControl.h
1
/*
2
* Copyright (C) 2005-2021 Team Kodi
3
* This file is part of Kodi - https://kodi.tv
4
*
5
* SPDX-License-Identifier: GPL-2.0-or-later
6
* See LICENSES/README.md for more information.
7
*/
8
9
#pragma once
10
15
#include "
GUIButtonControl.h
"
16
#include "
guilib/GUILabel.h
"
17
#include "
guilib/guiinfo/GUIInfoColor.h
"
18
#include "utils/ColorUtils.h"
19
24
class
CGUIColorButtonControl
:
public
CGUIButtonControl
25
{
26
public
:
27
CGUIColorButtonControl
(
int
parentID,
28
int
controlID,
29
float
posX,
30
float
posY,
31
float
width,
32
float
height,
33
const
CTextureInfo
& textureFocus,
34
const
CTextureInfo
& textureNoFocus,
35
const
CLabelInfo
& labelInfo,
36
const
CTextureInfo
& colorMask,
37
const
CTextureInfo
& colorDisabledMask);
38
39
~
CGUIColorButtonControl
()
override
=
default
;
40
CGUIColorButtonControl
* Clone()
const override
{
return
new
CGUIColorButtonControl
(*
this
); }
41
CGUIColorButtonControl
(
const
CGUIColorButtonControl
& control);
42
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);
59
60
protected
:
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;
67
float
m_colorPosX;
68
float
m_colorPosY;
69
KODI::GUILIB::GUIINFO::CGUIInfoColor
m_imgBoxColor;
70
CGUILabel
m_labelInfo;
71
};
CGUILabel
Class for rendering text labels. Handles alignment and rendering of text within a control...
Definition:
GUILabel.h:69
CGUIListItem
Definition:
GUIListItem.h:30
CGUIButtonControl
Definition:
GUIButtonControl.h:27
GUILabel.h
GUIButtonControl.h
CAction
class encapsulating information regarding a particular user action to be sent to windows and controls...
Definition:
Action.h:22
CTextureInfo
Definition:
GUITexture.h:51
CGUIColorButtonControl
Definition:
GUIColorButtonControl.h:24
GUIInfoColor.h
CGUIMessage
Definition:
GUIMessage.h:365
CLabelInfo
Definition:
GUILabel.h:22
CGUILabel::COLOR
COLOR
allowed color categories for labels, as defined by the skin
Definition:
GUILabel.h:74
KODI::GUILIB::GUIINFO::CGUIInfoColor
Definition:
GUIInfoColor.h:30
Generated by
1.8.13