24#include <unordered_map>
76 typedef std::unordered_map<std::string, std::string>
StyleList;
77 typedef std::unordered_map<std::string, std::string>
AttrsList;
92 core::dimension2d<u32>
dim;
93 core::position2d<s32>
pos;
148 bool closeTag(
const std::string &name);
153 u32
parseTag(
const wchar_t *text, u32 cursor);
154 void parse(
const wchar_t *text);
176 void place(
const core::rect<s32> &dest_rect);
178 void draw(
const core::rect<s32> &clip_rect,
179 const core::position2d<s32> &dest_offset);
203 GUIHyperText(
const wchar_t *text, gui::IGUIEnvironment *environment,
204 gui::IGUIElement *parent, s32
id,
216 bool OnEvent(
const SEvent &event);
Definition: guiHyperText.h:200
ISimpleTextureSource * m_tsrc
Definition: guiHyperText.h:220
core::position2d< s32 > m_text_scrollpos
Definition: guiHyperText.h:227
virtual void draw()
draws the element and its children
Definition: guiHyperText.cpp:1134
u32 m_scrollbar_width
Definition: guiHyperText.h:225
void checkHover(s32 X, s32 Y)
Definition: guiHyperText.cpp:1039
core::dimension2du getTextDimension()
ParsedText::Element * getElementAt(s32 X, s32 Y)
Definition: guiHyperText.cpp:1031
bool OnEvent(const SEvent &event)
Definition: guiHyperText.cpp:1062
GUIScrollBar * m_vscrollbar
Definition: guiHyperText.h:221
core::rect< s32 > m_display_text_rect
Definition: guiHyperText.h:226
virtual ~GUIHyperText()
destructor
Definition: guiHyperText.cpp:1025
TextDrawer m_drawer
Definition: guiHyperText.h:222
Definition: texturesource.h:34
Definition: guiHyperText.h:35
void enterParagraph()
Definition: guiHyperText.cpp:264
void enterElement(ElementType type)
Definition: guiHyperText.cpp:274
void endElement()
Definition: guiHyperText.cpp:241
EndReason
Definition: guiHyperText.h:138
@ ER_NONE
Definition: guiHyperText.h:138
@ ER_TAG
Definition: guiHyperText.h:138
@ ER_NEWLINE
Definition: guiHyperText.h:138
std::unordered_map< std::string, std::string > AttrsList
Definition: guiHyperText.h:77
bool closeTag(const std::string &name)
Definition: guiHyperText.cpp:319
ParsedText::Tag * openTag(const std::string &name, const AttrsList &attrs)
Definition: guiHyperText.cpp:312
std::vector< Tag * > m_not_root_tags
Definition: guiHyperText.h:159
void globalTag(const ParsedText::AttrsList &attrs)
Definition: guiHyperText.cpp:359
BackgroundType
Definition: guiHyperText.h:49
@ BACKGROUND_NONE
Definition: guiHyperText.h:50
@ BACKGROUND_COLOR
Definition: guiHyperText.h:51
void endParagraph(EndReason reason)
Definition: guiHyperText.cpp:246
std::unordered_map< std::string, std::string > StyleList
Definition: guiHyperText.h:76
ValignType
Definition: guiHyperText.h:70
@ VALIGN_MIDDLE
Definition: guiHyperText.h:71
@ VALIGN_BOTTOM
Definition: guiHyperText.h:73
@ VALIGN_TOP
Definition: guiHyperText.h:72
void parse(const wchar_t *text)
Definition: guiHyperText.cpp:183
Paragraph * m_paragraph
Definition: guiHyperText.h:165
u32 parseTag(const wchar_t *text, u32 cursor)
Definition: guiHyperText.cpp:399
StyleList m_style
Definition: guiHyperText.h:163
irr::video::SColor background_color
Definition: guiHyperText.h:133
~ParsedText()
Definition: guiHyperText.cpp:177
Tag m_root_tag
Definition: guiHyperText.h:135
void parseGenericStyleAttr(const std::string &name, const std::string &value, StyleList &style)
Definition: guiHyperText.cpp:331
void pushChar(wchar_t c)
Definition: guiHyperText.cpp:287
FloatType
Definition: guiHyperText.h:55
@ FLOAT_NONE
Definition: guiHyperText.h:56
@ FLOAT_LEFT
Definition: guiHyperText.h:58
@ FLOAT_RIGHT
Definition: guiHyperText.h:57
std::list< Tag * > m_active_tags
Definition: guiHyperText.h:160
EndReason m_end_paragraph_reason
Definition: guiHyperText.h:167
HalignType
Definition: guiHyperText.h:62
@ HALIGN_RIGHT
Definition: guiHyperText.h:65
@ HALIGN_LEFT
Definition: guiHyperText.h:64
@ HALIGN_JUSTIFY
Definition: guiHyperText.h:66
@ HALIGN_CENTER
Definition: guiHyperText.h:63
ValignType valign
Definition: guiHyperText.h:131
std::unordered_map< std::string, StyleList > m_paragraphtags
Definition: guiHyperText.h:157
void parseStyles(const AttrsList &attrs, StyleList &style)
Definition: guiHyperText.cpp:353
std::unordered_map< std::string, StyleList > m_elementtags
Definition: guiHyperText.h:156
s32 margin
Definition: guiHyperText.h:130
ElementType
Definition: guiHyperText.h:41
@ ELEMENT_SEPARATOR
Definition: guiHyperText.h:43
@ ELEMENT_TEXT
Definition: guiHyperText.h:42
@ ELEMENT_IMAGE
Definition: guiHyperText.h:44
@ ELEMENT_ITEM
Definition: guiHyperText.h:45
bool m_empty_paragraph
Definition: guiHyperText.h:166
Element * m_element
Definition: guiHyperText.h:164
std::vector< Paragraph > m_paragraphs
Definition: guiHyperText.h:127
BackgroundType background_type
Definition: guiHyperText.h:132
ParsedText::Tag * newTag(const std::string &name, const AttrsList &attrs)
Definition: guiHyperText.cpp:302
Definition: guiHyperText.h:171
s32 getHeight()
Definition: guiHyperText.h:177
std::vector< RectWithMargin > m_floating
Definition: guiHyperText.h:196
void draw(const core::rect< s32 > &clip_rect, const core::position2d< s32 > &dest_offset)
Definition: guiHyperText.cpp:920
ParsedText::Element * getElementAt(core::position2d< s32 > pos)
Definition: guiHyperText.cpp:664
ParsedText::Tag * m_hovertag
Definition: guiHyperText.h:181
Client * m_client
null in the mainmenu
Definition: guiHyperText.h:191
s32 m_voffset
Definition: guiHyperText.h:195
void place(const core::rect< s32 > &dest_rect)
Definition: guiHyperText.cpp:685
ISimpleTextureSource * m_tsrc
Definition: guiHyperText.h:192
s32 m_height
Definition: guiHyperText.h:194
gui::IGUIEnvironment * m_guienv
Definition: guiHyperText.h:193
ParsedText m_text
Definition: guiHyperText.h:190
core::vector3d< s16 > v3s16
Definition: irr_v3d.h:28
Definition: activeobjectmgr.cpp:26
Definition: guiHyperText.h:87
s32 baseline
Definition: guiHyperText.h:106
irr::video::SColor hovercolor
Definition: guiHyperText.h:103
std::string name
Definition: guiHyperText.h:109
s32 margin
Definition: guiHyperText.h:113
bool underline
Definition: guiHyperText.h:104
v3s16 rotation
Definition: guiHyperText.h:111
v3s16 angle
Definition: guiHyperText.h:110
core::position2d< s32 > pos
Definition: guiHyperText.h:93
void setStyle(StyleList &style)
Definition: guiHyperText.cpp:55
std::list< Tag * > tags
Definition: guiHyperText.h:88
irr::video::SColor color
Definition: guiHyperText.h:102
s32 drawwidth
Definition: guiHyperText.h:94
gui::IGUIFont * font
Definition: guiHyperText.h:100
ElementType type
Definition: guiHyperText.h:89
ValignType valign
Definition: guiHyperText.h:98
FloatType floating
Definition: guiHyperText.h:96
core::dimension2d< u32 > dim
Definition: guiHyperText.h:92
core::stringw text
Definition: guiHyperText.h:90
Definition: guiHyperText.h:119
void setStyle(StyleList &style)
Definition: guiHyperText.cpp:90
std::vector< Element > elements
Definition: guiHyperText.h:120
HalignType halign
Definition: guiHyperText.h:121
s32 margin
Definition: guiHyperText.h:122
Definition: guiHyperText.h:80
AttrsList attrs
Definition: guiHyperText.h:82
std::string name
Definition: guiHyperText.h:81
StyleList style
Definition: guiHyperText.h:83
Definition: guiHyperText.h:185
s32 margin
Definition: guiHyperText.h:187
core::rect< s32 > rect
Definition: guiHyperText.h:186