#include <textrenderer.h>
Public Types | |
| typedef list< PG_Widget * > | Widgets |
Public Member Functions | |
| TextRenderer (PG_Widget *parent, const PG_Rect &r, const std::string &text, const std::string &style="ScrollWidget") | |
| TextRenderer (PG_Widget *parent, const PG_Rect &r=PG_Rect::null) | |
| void | SetText (const std::string &text) |
| virtual const PG_String & | GetText () |
| void | saveText (bool stripFormatting) |
| PG_Widget * | parsingError (const ASCString &errorMessage) |
Static Public Member Functions | |
| static bool | registerTagRenderer (TagRenderer *renderer) |
Protected Member Functions | |
| bool | isSpace (ASCString::charT character) |
| bool | isBreaker (ASCString::charT character) |
| int | arrangeLine (int y, const Widgets &line, int lineHeight, int indent) |
| int | AreaWidth () |
| void | layout () |
| void | addWidget (PG_Widget *w) |
| void | addWidget (Widgets w) |
| void | addSpace (int space) |
| void | addLinebreak (int pixel, int lines) |
| void | addIndentation (int firstLine, int furtherLines) |
| void | addAbsPosition (int pos) |
| ASCString | substr (const ASCString &text, ASCString::const_iterator begin, ASCString::const_iterator end) |
| ASCString::const_iterator | token (const ASCString &text, ASCString::const_iterator start) |
| ASCString::const_iterator | token_command (const ASCString &text, ASCString::const_iterator start) |
| void | parse (const ASCString &text) |
| virtual PG_Widget * | render (const ASCString &token) |
| virtual Widgets | eval_command (const ASCString &token) |
| bool | eventKeyDown (const SDL_KeyboardEvent *key) |
| void | clear () |
Classes | |
| struct | RenderingAttribute |
| class | TagRenderer |
| struct | TextAttributes |
Definition at line 20 of file textrenderer.h.
| typedef list<PG_Widget*> TextRenderer::Widgets |
Definition at line 47 of file textrenderer.h.
| TextRenderer::TextRenderer | ( | PG_Widget * | parent, | |
| const PG_Rect & | r, | |||
| const std::string & | text, | |||
| const std::string & | style = "ScrollWidget" | |||
| ) |
| TextRenderer::TextRenderer | ( | PG_Widget * | parent, | |
| const PG_Rect & | r = PG_Rect::null | |||
| ) |
Definition at line 45 of file textrenderer.cpp.
| bool TextRenderer::isSpace | ( | ASCString::charT | character | ) | [inline, protected] |
| bool TextRenderer::isBreaker | ( | ASCString::charT | character | ) | [inline, protected] |
| int TextRenderer::arrangeLine | ( | int | y, | |
| const Widgets & | line, | |||
| int | lineHeight, | |||
| int | indent | |||
| ) | [protected] |
| int TextRenderer::AreaWidth | ( | ) | [protected] |
| void TextRenderer::layout | ( | ) | [protected] |
| void TextRenderer::addWidget | ( | PG_Widget * | w | ) | [protected] |
Definition at line 151 of file textrenderer.cpp.
Referenced by addAbsPosition(), addIndentation(), addWidget(), token(), and token_command().
| void TextRenderer::addWidget | ( | Widgets | w | ) | [protected] |
| void TextRenderer::addSpace | ( | int | space | ) | [protected] |
| void TextRenderer::addLinebreak | ( | int | pixel, | |
| int | lines | |||
| ) | [protected] |
| void TextRenderer::addIndentation | ( | int | firstLine, | |
| int | furtherLines | |||
| ) | [protected] |
Definition at line 177 of file textrenderer.cpp.
References addWidget().
Referenced by eval_command().
| void TextRenderer::addAbsPosition | ( | int | pos | ) | [protected] |
Definition at line 190 of file textrenderer.cpp.
References addWidget().
Referenced by eval_command().
| ASCString::const_iterator TextRenderer::token | ( | const ASCString & | text, | |
| ASCString::const_iterator | start | |||
| ) | [protected] |
Definition at line 217 of file textrenderer.cpp.
References addLinebreak(), addSpace(), addWidget(), isBreaker(), isSpace(), render(), and substr().
Referenced by eval_command(), parse(), and render().
| ASCString::const_iterator TextRenderer::token_command | ( | const ASCString & | text, | |
| ASCString::const_iterator | start | |||
| ) | [protected] |
Definition at line 205 of file textrenderer.cpp.
References addWidget(), eval_command(), isSpace(), and substr().
Referenced by parse().
| void TextRenderer::parse | ( | const ASCString & | text | ) | [protected] |
Definition at line 259 of file textrenderer.cpp.
References isSpace(), token(), and token_command().
| PG_Widget * TextRenderer::render | ( | const ASCString & | token | ) | [protected, virtual] |
| TextRenderer::Widgets TextRenderer::eval_command | ( | const ASCString & | token | ) | [protected, virtual] |
Definition at line 302 of file textrenderer.cpp.
References addAbsPosition(), addIndentation(), addLinebreak(), Surface::getBaseSurface(), IconRepository::getIcon(), pal, parsingError(), s1, s2, and token().
Referenced by token_command().
| bool TextRenderer::eventKeyDown | ( | const SDL_KeyboardEvent * | key | ) | [protected] |
| void TextRenderer::clear | ( | ) | [protected] |
| void TextRenderer::SetText | ( | const std::string & | text | ) |
| const PG_String & TextRenderer::GetText | ( | ) | [virtual] |
| void TextRenderer::saveText | ( | bool | stripFormatting | ) |
Definition at line 463 of file textrenderer.cpp.
References selectFile(), and tnstream::writing.
Referenced by eventKeyDown(), and IngameMessageViewer::eventKeyDown().
| PG_Widget * TextRenderer::parsingError | ( | const ASCString & | errorMessage | ) |
Definition at line 281 of file textrenderer.cpp.
References errorMessage().
Referenced by eval_command(), and VehicleTypeRenderer::renderWidget().
| bool TextRenderer::registerTagRenderer | ( | TagRenderer * | renderer | ) | [static] |
Definition at line 293 of file textrenderer.cpp.
1.5.1