9#include <unordered_map>
61 typedef std::unordered_map<std::string, std::string>
StyleList;
62 typedef std::unordered_map<std::string, std::string>
AttrsList;
77 core::dimension2d<u32>
dim;
78 core::position2d<s32>
pos;
133 bool closeTag(
const std::string &name);
138 u32
parseTag(
const wchar_t *text, u32 cursor);
139 void parse(
const wchar_t *text);
161 void place(
const core::rect<s32> &dest_rect);
163 void draw(
const core::rect<s32> &clip_rect,
164 const core::position2d<s32> &dest_offset);
188 GUIHyperText(
const wchar_t *text, gui::IGUIEnvironment *environment,
189 gui::IGUIElement *parent, s32
id,
201 bool OnEvent(
const SEvent &event);
Definition guiHyperText.h:185
ISimpleTextureSource * m_tsrc
Definition guiHyperText.h:205
core::position2d< s32 > m_text_scrollpos
Definition guiHyperText.h:212
virtual void draw()
draws the element and its children
Definition guiHyperText.cpp:1146
u32 m_scrollbar_width
Definition guiHyperText.h:210
void checkHover(s32 X, s32 Y)
Definition guiHyperText.cpp:1051
core::dimension2du getTextDimension()
ParsedText::Element * getElementAt(s32 X, s32 Y)
Definition guiHyperText.cpp:1043
bool OnEvent(const SEvent &event)
Definition guiHyperText.cpp:1074
GUIHyperText(const wchar_t *text, gui::IGUIEnvironment *environment, gui::IGUIElement *parent, s32 id, const core::rect< s32 > &rectangle, Client *client, ISimpleTextureSource *tsrc)
constructor
Definition guiHyperText.cpp:1010
GUIScrollBar * m_vscrollbar
Definition guiHyperText.h:206
core::rect< s32 > m_display_text_rect
Definition guiHyperText.h:211
virtual ~GUIHyperText()
destructor
Definition guiHyperText.cpp:1037
TextDrawer m_drawer
Definition guiHyperText.h:207
Definition texturesource.h:25
Definition guiHyperText.h:20
void enterParagraph()
Definition guiHyperText.cpp:251
void enterElement(ElementType type)
Definition guiHyperText.cpp:261
void endElement()
Definition guiHyperText.cpp:228
EndReason
Definition guiHyperText.h:123
@ ER_NONE
Definition guiHyperText.h:123
@ ER_TAG
Definition guiHyperText.h:123
@ ER_NEWLINE
Definition guiHyperText.h:123
std::unordered_map< std::string, std::string > AttrsList
Definition guiHyperText.h:62
bool closeTag(const std::string &name)
Definition guiHyperText.cpp:306
ParsedText::Tag * openTag(const std::string &name, const AttrsList &attrs)
Definition guiHyperText.cpp:299
std::vector< Tag * > m_not_root_tags
Definition guiHyperText.h:144
void globalTag(const ParsedText::AttrsList &attrs)
Definition guiHyperText.cpp:346
BackgroundType
Definition guiHyperText.h:34
@ BACKGROUND_NONE
Definition guiHyperText.h:35
@ BACKGROUND_COLOR
Definition guiHyperText.h:36
void endParagraph(EndReason reason)
Definition guiHyperText.cpp:233
std::unordered_map< std::string, std::string > StyleList
Definition guiHyperText.h:61
ValignType
Definition guiHyperText.h:55
@ VALIGN_MIDDLE
Definition guiHyperText.h:56
@ VALIGN_BOTTOM
Definition guiHyperText.h:58
@ VALIGN_TOP
Definition guiHyperText.h:57
void parse(const wchar_t *text)
Definition guiHyperText.cpp:170
Paragraph * m_paragraph
Definition guiHyperText.h:150
u32 parseTag(const wchar_t *text, u32 cursor)
Definition guiHyperText.cpp:386
StyleList m_style
Definition guiHyperText.h:148
irr::video::SColor background_color
Definition guiHyperText.h:118
~ParsedText()
Definition guiHyperText.cpp:164
Tag m_root_tag
Definition guiHyperText.h:120
void parseGenericStyleAttr(const std::string &name, const std::string &value, StyleList &style)
Definition guiHyperText.cpp:318
void pushChar(wchar_t c)
Definition guiHyperText.cpp:274
FloatType
Definition guiHyperText.h:40
@ FLOAT_NONE
Definition guiHyperText.h:41
@ FLOAT_LEFT
Definition guiHyperText.h:43
@ FLOAT_RIGHT
Definition guiHyperText.h:42
std::list< Tag * > m_active_tags
Definition guiHyperText.h:145
EndReason m_end_paragraph_reason
Definition guiHyperText.h:152
HalignType
Definition guiHyperText.h:47
@ HALIGN_RIGHT
Definition guiHyperText.h:50
@ HALIGN_LEFT
Definition guiHyperText.h:49
@ HALIGN_JUSTIFY
Definition guiHyperText.h:51
@ HALIGN_CENTER
Definition guiHyperText.h:48
ValignType valign
Definition guiHyperText.h:116
std::unordered_map< std::string, StyleList > m_paragraphtags
Definition guiHyperText.h:142
void parseStyles(const AttrsList &attrs, StyleList &style)
Definition guiHyperText.cpp:340
std::unordered_map< std::string, StyleList > m_elementtags
Definition guiHyperText.h:141
ParsedText(const wchar_t *text)
Definition guiHyperText.cpp:89
s32 margin
Definition guiHyperText.h:115
ElementType
Definition guiHyperText.h:26
@ ELEMENT_SEPARATOR
Definition guiHyperText.h:28
@ ELEMENT_TEXT
Definition guiHyperText.h:27
@ ELEMENT_IMAGE
Definition guiHyperText.h:29
@ ELEMENT_ITEM
Definition guiHyperText.h:30
bool m_empty_paragraph
Definition guiHyperText.h:151
Element * m_element
Definition guiHyperText.h:149
std::vector< Paragraph > m_paragraphs
Definition guiHyperText.h:112
BackgroundType background_type
Definition guiHyperText.h:117
ParsedText::Tag * newTag(const std::string &name, const AttrsList &attrs)
Definition guiHyperText.cpp:289
Definition guiHyperText.h:156
s32 getHeight()
Definition guiHyperText.h:162
std::vector< RectWithMargin > m_floating
Definition guiHyperText.h:181
void draw(const core::rect< s32 > &clip_rect, const core::position2d< s32 > &dest_offset)
Definition guiHyperText.cpp:932
ParsedText::Element * getElementAt(core::position2d< s32 > pos)
Definition guiHyperText.cpp:676
ParsedText::Tag * m_hovertag
Definition guiHyperText.h:166
Client * m_client
null in the mainmenu
Definition guiHyperText.h:176
s32 m_voffset
Definition guiHyperText.h:180
void place(const core::rect< s32 > &dest_rect)
Definition guiHyperText.cpp:697
TextDrawer(const wchar_t *text, Client *client, gui::IGUIEnvironment *environment, ISimpleTextureSource *tsrc)
Definition guiHyperText.cpp:620
ISimpleTextureSource * m_tsrc
Definition guiHyperText.h:177
s32 m_height
Definition guiHyperText.h:179
gui::IGUIEnvironment * m_guienv
Definition guiHyperText.h:178
ParsedText m_text
Definition guiHyperText.h:175
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
Definition activeobjectmgr.cpp:11
Definition clientmap.h:30
Definition guiHyperText.h:72
s32 baseline
Definition guiHyperText.h:91
irr::video::SColor hovercolor
Definition guiHyperText.h:88
std::string name
Definition guiHyperText.h:94
s32 margin
Definition guiHyperText.h:98
bool underline
Definition guiHyperText.h:89
v3s16 rotation
Definition guiHyperText.h:96
v3s16 angle
Definition guiHyperText.h:95
core::position2d< s32 > pos
Definition guiHyperText.h:78
void setStyle(StyleList &style)
Definition guiHyperText.cpp:42
std::list< Tag * > tags
Definition guiHyperText.h:73
irr::video::SColor color
Definition guiHyperText.h:87
s32 drawwidth
Definition guiHyperText.h:79
gui::IGUIFont * font
Definition guiHyperText.h:85
ElementType type
Definition guiHyperText.h:74
ValignType valign
Definition guiHyperText.h:83
FloatType floating
Definition guiHyperText.h:81
core::dimension2d< u32 > dim
Definition guiHyperText.h:77
core::stringw text
Definition guiHyperText.h:75
Definition guiHyperText.h:104
void setStyle(StyleList &style)
Definition guiHyperText.cpp:77
std::vector< Element > elements
Definition guiHyperText.h:105
HalignType halign
Definition guiHyperText.h:106
s32 margin
Definition guiHyperText.h:107
Definition guiHyperText.h:65
AttrsList attrs
Definition guiHyperText.h:67
std::string name
Definition guiHyperText.h:66
StyleList style
Definition guiHyperText.h:68
Definition guiHyperText.h:170
s32 margin
Definition guiHyperText.h:172
core::rect< s32 > rect
Definition guiHyperText.h:171