9#include <unordered_map>
11#include <IGUIElement.h>
12#include <IGUIEnvironment.h>
62 typedef std::unordered_map<std::string, std::string>
StyleList;
63 typedef std::unordered_map<std::string, std::string>
AttrsList;
78 core::dimension2d<u32>
dim;
79 core::position2d<s32>
pos;
134 bool closeTag(
const std::string &name);
139 u32
parseTag(
const wchar_t *text, u32 cursor);
140 void parse(
const wchar_t *text);
162 void place(
const core::rect<s32> &dest_rect);
164 void draw(
const core::rect<s32> &clip_rect,
165 const core::position2d<s32> &dest_offset);
189 GUIHyperText(
const wchar_t *text, gui::IGUIEnvironment *environment,
190 gui::IGUIElement *parent, s32
id,
202 bool OnEvent(
const SEvent &event);
Definition guiHyperText.h:186
ISimpleTextureSource * m_tsrc
Definition guiHyperText.h:206
core::position2d< s32 > m_text_scrollpos
Definition guiHyperText.h:213
virtual void draw()
draws the element and its children
Definition guiHyperText.cpp:1142
u32 m_scrollbar_width
Definition guiHyperText.h:211
void checkHover(s32 X, s32 Y)
Definition guiHyperText.cpp:1047
core::dimension2du getTextDimension()
ParsedText::Element * getElementAt(s32 X, s32 Y)
Definition guiHyperText.cpp:1039
bool OnEvent(const SEvent &event)
Definition guiHyperText.cpp:1070
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:207
core::rect< s32 > m_display_text_rect
Definition guiHyperText.h:212
virtual ~GUIHyperText()
destructor
Definition guiHyperText.cpp:1033
TextDrawer m_drawer
Definition guiHyperText.h:208
Definition texturesource.h:34
Definition guiHyperText.h:21
void enterParagraph()
Definition guiHyperText.cpp:250
void enterElement(ElementType type)
Definition guiHyperText.cpp:260
void endElement()
Definition guiHyperText.cpp:227
EndReason
Definition guiHyperText.h:124
@ ER_NONE
Definition guiHyperText.h:124
@ ER_TAG
Definition guiHyperText.h:124
@ ER_NEWLINE
Definition guiHyperText.h:124
std::unordered_map< std::string, std::string > AttrsList
Definition guiHyperText.h:63
video::SColor background_color
Definition guiHyperText.h:119
bool closeTag(const std::string &name)
Definition guiHyperText.cpp:305
ParsedText::Tag * openTag(const std::string &name, const AttrsList &attrs)
Definition guiHyperText.cpp:298
std::vector< Tag * > m_not_root_tags
Definition guiHyperText.h:145
void globalTag(const ParsedText::AttrsList &attrs)
Definition guiHyperText.cpp:345
BackgroundType
Definition guiHyperText.h:35
@ BACKGROUND_NONE
Definition guiHyperText.h:36
@ BACKGROUND_COLOR
Definition guiHyperText.h:37
void endParagraph(EndReason reason)
Definition guiHyperText.cpp:232
std::unordered_map< std::string, std::string > StyleList
Definition guiHyperText.h:62
ValignType
Definition guiHyperText.h:56
@ VALIGN_MIDDLE
Definition guiHyperText.h:57
@ VALIGN_BOTTOM
Definition guiHyperText.h:59
@ VALIGN_TOP
Definition guiHyperText.h:58
void parse(const wchar_t *text)
Definition guiHyperText.cpp:169
Paragraph * m_paragraph
Definition guiHyperText.h:151
u32 parseTag(const wchar_t *text, u32 cursor)
Definition guiHyperText.cpp:385
StyleList m_style
Definition guiHyperText.h:149
~ParsedText()
Definition guiHyperText.cpp:163
Tag m_root_tag
Definition guiHyperText.h:121
void parseGenericStyleAttr(const std::string &name, const std::string &value, StyleList &style)
Definition guiHyperText.cpp:317
void pushChar(wchar_t c)
Definition guiHyperText.cpp:273
FloatType
Definition guiHyperText.h:41
@ FLOAT_NONE
Definition guiHyperText.h:42
@ FLOAT_LEFT
Definition guiHyperText.h:44
@ FLOAT_RIGHT
Definition guiHyperText.h:43
std::list< Tag * > m_active_tags
Definition guiHyperText.h:146
EndReason m_end_paragraph_reason
Definition guiHyperText.h:153
HalignType
Definition guiHyperText.h:48
@ HALIGN_RIGHT
Definition guiHyperText.h:51
@ HALIGN_LEFT
Definition guiHyperText.h:50
@ HALIGN_JUSTIFY
Definition guiHyperText.h:52
@ HALIGN_CENTER
Definition guiHyperText.h:49
ValignType valign
Definition guiHyperText.h:117
std::unordered_map< std::string, StyleList > m_paragraphtags
Definition guiHyperText.h:143
void parseStyles(const AttrsList &attrs, StyleList &style)
Definition guiHyperText.cpp:339
std::unordered_map< std::string, StyleList > m_elementtags
Definition guiHyperText.h:142
ParsedText(const wchar_t *text)
Definition guiHyperText.cpp:88
s32 margin
Definition guiHyperText.h:116
ElementType
Definition guiHyperText.h:27
@ ELEMENT_SEPARATOR
Definition guiHyperText.h:29
@ ELEMENT_TEXT
Definition guiHyperText.h:28
@ ELEMENT_IMAGE
Definition guiHyperText.h:30
@ ELEMENT_ITEM
Definition guiHyperText.h:31
bool m_empty_paragraph
Definition guiHyperText.h:152
Element * m_element
Definition guiHyperText.h:150
std::vector< Paragraph > m_paragraphs
Definition guiHyperText.h:113
BackgroundType background_type
Definition guiHyperText.h:118
ParsedText::Tag * newTag(const std::string &name, const AttrsList &attrs)
Definition guiHyperText.cpp:288
Definition guiHyperText.h:157
s32 getHeight()
Definition guiHyperText.h:163
std::vector< RectWithMargin > m_floating
Definition guiHyperText.h:182
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:167
Client * m_client
null in the mainmenu
Definition guiHyperText.h:177
s32 m_voffset
Definition guiHyperText.h:181
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:178
s32 m_height
Definition guiHyperText.h:180
gui::IGUIEnvironment * m_guienv
Definition guiHyperText.h:179
ParsedText m_text
Definition guiHyperText.h:176
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
Definition activeobjectmgr.cpp:11
Definition guiHyperText.h:73
video::SColor hovercolor
Definition guiHyperText.h:89
s32 baseline
Definition guiHyperText.h:92
std::string name
Definition guiHyperText.h:95
s32 margin
Definition guiHyperText.h:99
video::SColor color
Definition guiHyperText.h:88
bool underline
Definition guiHyperText.h:90
v3s16 rotation
Definition guiHyperText.h:97
v3s16 angle
Definition guiHyperText.h:96
core::position2d< s32 > pos
Definition guiHyperText.h:79
void setStyle(StyleList &style)
Definition guiHyperText.cpp:41
std::list< Tag * > tags
Definition guiHyperText.h:74
s32 drawwidth
Definition guiHyperText.h:80
gui::IGUIFont * font
Definition guiHyperText.h:86
ElementType type
Definition guiHyperText.h:75
ValignType valign
Definition guiHyperText.h:84
FloatType floating
Definition guiHyperText.h:82
core::dimension2d< u32 > dim
Definition guiHyperText.h:78
core::stringw text
Definition guiHyperText.h:76
Definition guiHyperText.h:105
void setStyle(StyleList &style)
Definition guiHyperText.cpp:76
std::vector< Element > elements
Definition guiHyperText.h:106
HalignType halign
Definition guiHyperText.h:107
s32 margin
Definition guiHyperText.h:108
Definition guiHyperText.h:66
AttrsList attrs
Definition guiHyperText.h:68
std::string name
Definition guiHyperText.h:67
StyleList style
Definition guiHyperText.h:69
Definition guiHyperText.h:171
s32 margin
Definition guiHyperText.h:173
core::rect< s32 > rect
Definition guiHyperText.h:172