Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include <GUITextLayout.h>
Public Member Functions | |
CGUITextLayout (CGUIFont *font, bool wrap, float fHeight=0.0f, CGUIFont *borderFont=NULL) | |
bool | UpdateScrollinfo (CScrollInfo &scrollInfo) |
void | Render (float x, float y, float angle, KODI::UTILS::COLOR::Color color, KODI::UTILS::COLOR::Color shadowColor, uint32_t alignment, float maxWidth, bool solid=false) |
void | RenderScrolling (float x, float y, float angle, KODI::UTILS::COLOR::Color color, KODI::UTILS::COLOR::Color shadowColor, uint32_t alignment, float maxWidth, const CScrollInfo &scrollInfo) |
void | RenderOutline (float x, float y, KODI::UTILS::COLOR::Color color, KODI::UTILS::COLOR::Color outlineColor, uint32_t alignment, float maxWidth) |
void | GetTextExtent (float &width, float &height) const |
Returns the precalculated width and height of the text to be rendered (in constant time). | |
float | GetTextWidth () const |
Returns the precalculated width of the text to be rendered (in constant time). | |
float | GetTextWidth (const std::wstring &text) const |
float | GetTextWidth (const vecText &text) const |
float | GetTextHeight () const |
Returns the precalculated height of the text to be rendered (in constant time). | |
bool | Update (const std::string &text, float maxWidth=0, bool forceUpdate=false, bool forceLTRReadingOrder=false) |
bool | UpdateW (const std::wstring &text, float maxWidth=0, bool forceUpdate=false, bool forceLTRReadingOrder=false) |
void | UpdateStyled (const vecText &text, const std::vector< KODI::UTILS::COLOR::Color > &colors, float maxWidth=0, bool forceLTRReadingOrder=false) |
Update text from a pre-styled vecText/std::vector<KODI::UTILS::COLOR::Color> combination Allows styled text to be passed directly to the text layout. | |
unsigned int | GetTextLength () const |
void | GetFirstText (vecText &text) const |
void | Reset () |
void | SetWrap (bool bWrap=true) |
void | SetMaxHeight (float fHeight) |
Static Public Member Functions | |
static void | DrawText (CGUIFont *font, float x, float y, KODI::UTILS::COLOR::Color color, KODI::UTILS::COLOR::Color shadowColor, const std::string &text, uint32_t align) |
static void | Filter (std::string &text) |
Protected Types | |
typedef std::vector< CGUIString >::iterator | iLine |
Protected Member Functions | |
void | LineBreakText (const vecText &text, std::vector< CGUIString > &lines) |
void | WrapText (const vecText &text, float maxWidth) |
void | CalcTextExtent () |
void | UpdateCommon (const std::wstring &text, float maxWidth, bool forceLTRReadingOrder) |
std::string | GetText () const |
Returns the text, utf8 encoded. | |
void | SetMonoFont (CGUIFont *font) |
Set the monospaced font to use. | |
void | UseMonoFont (bool use) |
Set whether or not to use the monospace font. | |
Static Protected Member Functions | |
static void | BidiTransform (std::vector< CGUIString > &lines, bool forceLTRReadingOrder) |
static std::wstring | BidiFlip (const std::wstring &text, bool forceLTRReadingOrder, int *visualToLogicalMap=nullptr) |
Protected Attributes | |
std::vector< KODI::UTILS::COLOR::Color > | m_colors |
std::vector< CGUIString > | m_lines |
CGUIFont * | m_font |
CGUIFont * | m_borderFont |
CGUIFont * | m_monoFont = nullptr |
Mono-space font to use. | |
CGUIFont * | m_varFont |
Varible-space font to use. | |
bool | m_wrap |
float | m_maxHeight |
KODI::UTILS::COLOR::Color | m_textColor |
std::string | m_lastUtf8Text |
std::wstring | m_lastText |
bool | m_lastUpdateW |
true if the last string we updated was the wstring version | |
float | m_textWidth |
float | m_textHeight |
|
protected |
CGUITextLayout::CGUITextLayout | ( | CGUIFont * | font, |
bool | wrap, | ||
float | fHeight = 0.0f, | ||
CGUIFont * | borderFont = NULL ) |
|
staticprotected |
|
staticprotected |
|
protected |
|
static |
|
static |
|
protected |
Returns the text, utf8 encoded.
void CGUITextLayout::GetTextExtent | ( | float & | width, |
float & | height ) const |
Returns the precalculated width and height of the text to be rendered (in constant time).
width | [out] width of text |
height | [out] height of text |
|
inline |
Returns the precalculated height of the text to be rendered (in constant time).
unsigned int CGUITextLayout::GetTextLength | ( | ) | const |
|
inline |
Returns the precalculated width of the text to be rendered (in constant time).
float CGUITextLayout::GetTextWidth | ( | const std::wstring & | text | ) | const |
float CGUITextLayout::GetTextWidth | ( | const vecText & | text | ) | const |
|
protected |
void CGUITextLayout::Render | ( | float | x, |
float | y, | ||
float | angle, | ||
KODI::UTILS::COLOR::Color | color, | ||
KODI::UTILS::COLOR::Color | shadowColor, | ||
uint32_t | alignment, | ||
float | maxWidth, | ||
bool | solid = false ) |
void CGUITextLayout::RenderOutline | ( | float | x, |
float | y, | ||
KODI::UTILS::COLOR::Color | color, | ||
KODI::UTILS::COLOR::Color | outlineColor, | ||
uint32_t | alignment, | ||
float | maxWidth ) |
void CGUITextLayout::RenderScrolling | ( | float | x, |
float | y, | ||
float | angle, | ||
KODI::UTILS::COLOR::Color | color, | ||
KODI::UTILS::COLOR::Color | shadowColor, | ||
uint32_t | alignment, | ||
float | maxWidth, | ||
const CScrollInfo & | scrollInfo ) |
void CGUITextLayout::Reset | ( | ) |
void CGUITextLayout::SetMaxHeight | ( | float | fHeight | ) |
bool CGUITextLayout::Update | ( | const std::string & | text, |
float | maxWidth = 0, | ||
bool | forceUpdate = false, | ||
bool | forceLTRReadingOrder = false ) |
|
protected |
bool CGUITextLayout::UpdateScrollinfo | ( | CScrollInfo & | scrollInfo | ) |
void CGUITextLayout::UpdateStyled | ( | const vecText & | text, |
const std::vector< KODI::UTILS::COLOR::Color > & | colors, | ||
float | maxWidth = 0, | ||
bool | forceLTRReadingOrder = false ) |
Update text from a pre-styled vecText/std::vector<KODI::UTILS::COLOR::Color> combination Allows styled text to be passed directly to the text layout.
text | the styled text to set. |
colors | the colors used on the text. |
maxWidth | the maximum width for wrapping text, defaults to 0 (no max width). |
forceLTRReadingOrder | whether to force left to right reading order, defaults to false. |
bool CGUITextLayout::UpdateW | ( | const std::wstring & | text, |
float | maxWidth = 0, | ||
bool | forceUpdate = false, | ||
bool | forceLTRReadingOrder = false ) |
Set whether or not to use the monospace font.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
true if the last string we updated was the wstring version
|
protected |
|
protected |
|
protected |
|
protected |
Mono-space font to use.
|
protected |
|
protected |
|
protected |
|
protected |
Varible-space font to use.
|
protected |