OpenMW
|
Public Types | |
typedef TypesetBookImpl | Book |
typedef boost::shared_ptr< Book > | BookPtr |
Public Member Functions | |
Typesetter (size_t width, size_t height) | |
virtual | ~Typesetter () |
Style * | createStyle (char const *fontName, Colour fontColour) |
Create a simple text style consisting of a font and a text color. | |
Style * | createHotStyle (Style *baseStyle, Colour normalColour, Colour hoverColour, Colour activeColour, InteractiveId id, bool unique) |
void | write (Style *style, Utf8Span text) |
intptr_t | addContent (Utf8Span text, bool select) |
void | selectContent (intptr_t contentHandle) |
Select a previously created content block for future writes. | |
void | write (Style *style, size_t begin, size_t end) |
void | lineBreak (float margin) |
void | sectionBreak (float margin) |
void | setSectionAlignment (Alignment sectionAlignment) |
TypesetBook::Ptr | complete () |
Finalize the document layout, and return a pointer to it. | |
void | writeImpl (StyleImpl *style, Utf8Stream::Point _begin, Utf8Stream::Point _end) |
void | append_run (StyleImpl *style, Utf8Stream::Point begin, Utf8Stream::Point end, int pc, int right, int bottom) |
Public Attributes | |
int | mPageWidth |
int | mPageHeight |
BookPtr | mBook |
Section * | mSection |
Line * | mLine |
Run * | mRun |
std::vector< Alignment > | mSectionAlignment |
Book::Content const * | mCurrentContent |
Alignment | mCurrentAlignment |
typedef boost::shared_ptr<Book> MWGui::TypesetBookImpl::Typesetter::BookPtr |
MWGui::TypesetBookImpl::Typesetter::Typesetter | ( | size_t | width, |
size_t | height | ||
) | [inline] |
virtual MWGui::TypesetBookImpl::Typesetter::~Typesetter | ( | ) | [inline, virtual] |
intptr_t MWGui::TypesetBookImpl::Typesetter::addContent | ( | Utf8Span | Text, |
bool | Select | ||
) | [inline, virtual] |
Adds a content block to the document without laying it out. An identifier is returned that can be used to refer to it. If select is true, the block is activated to be references by future writes.
Implements MWGui::BookTypesetter.
void MWGui::TypesetBookImpl::Typesetter::append_run | ( | StyleImpl * | style, |
Utf8Stream::Point | begin, | ||
Utf8Stream::Point | end, | ||
int | pc, | ||
int | right, | ||
int | bottom | ||
) | [inline] |
TypesetBook::Ptr MWGui::TypesetBookImpl::Typesetter::complete | ( | ) | [inline, virtual] |
Finalize the document layout, and return a pointer to it.
Implements MWGui::BookTypesetter.
Style* MWGui::TypesetBookImpl::Typesetter::createHotStyle | ( | Style * | BaseStyle, |
Colour | NormalColour, | ||
Colour | HoverColour, | ||
Colour | ActiveColour, | ||
InteractiveId | Id, | ||
bool | Unique | ||
) | [inline, virtual] |
Create a hyper-link style with a user-defined identifier based on an existing style. The unique flag forces a new instance of this style to be created even if an existing instance is present.
Implements MWGui::BookTypesetter.
Style* MWGui::TypesetBookImpl::Typesetter::createStyle | ( | char const * | Font, |
Colour | Colour | ||
) | [inline, virtual] |
Create a simple text style consisting of a font and a text color.
Implements MWGui::BookTypesetter.
void MWGui::TypesetBookImpl::Typesetter::lineBreak | ( | float | margin | ) | [inline, virtual] |
Insert a line break into the document. Newline characters in the input text have the same affect. The margin parameter adds additional space before the next line of text.
Implements MWGui::BookTypesetter.
void MWGui::TypesetBookImpl::Typesetter::sectionBreak | ( | float | margin | ) | [inline, virtual] |
Insert a section break into the document. This causes a new section to begin when additional text is inserted. Pagination attempts to keep sections together on a single page. The margin parameter adds additional space before the next line of text.
Implements MWGui::BookTypesetter.
void MWGui::TypesetBookImpl::Typesetter::selectContent | ( | intptr_t | contentHandle | ) | [inline, virtual] |
Select a previously created content block for future writes.
Implements MWGui::BookTypesetter.
void MWGui::TypesetBookImpl::Typesetter::setSectionAlignment | ( | Alignment | sectionAlignment | ) | [inline] |
void MWGui::TypesetBookImpl::Typesetter::write | ( | Style * | style, |
Utf8Span | text | ||
) | [inline, virtual] |
Implements MWGui::BookTypesetter.
void MWGui::TypesetBookImpl::Typesetter::write | ( | Style * | Style, |
size_t | Begin, | ||
size_t | End | ||
) | [inline, virtual] |
Layout a span of the selected content block into the document using the specified style.
Implements MWGui::BookTypesetter.
void MWGui::TypesetBookImpl::Typesetter::writeImpl | ( | StyleImpl * | style, |
Utf8Stream::Point | _begin, | ||
Utf8Stream::Point | _end | ||
) | [inline] |