ScummVM API documentation
Graphics::MacTextCanvas Class Reference

Public Member Functions

void recalcDims ()
 
void reallocSurface ()
 
void render (int from, int to)
 
void render (int from, int to, int shadow)
 
int getAlignOffset (int row)
 
int getLineWidth (int line, bool enforce=false, int col=-1)
 
int getLineHeight (int line)
 
int getLineCharWidth (int line, bool enforce=false)
 
void splitString (const Common::U32String &str, int curLine, MacFontRun &defaultFormatting)
 
const Common::U32String::value_type * splitString (const Common::U32String::value_type *s, int curLine, MacFontRun &defaultFormatting)
 
void chopChunk (const Common::U32String &str, int *curLinePtr, int indent, int maxWidth)
 
Common::U32String getTextChunk (int startRow, int startCol, int endRow, int endCol, bool formatted=false, bool newlines=true)
 
void reshuffleParagraph (int *row, int *col, MacFontRun &defaultFormatting)
 
void setMaxWidth (int maxWidth, MacFontRun &defaultFormatting)
 
void debugPrint (const char *prefix=nullptr)
 

Public Attributes

Common::Array< MacTextLine_text
 
ManagedSurface_surface = nullptr
 
ManagedSurface_shadowSurface = nullptr
 
int _maxWidth = 0
 
int _textMaxWidth = 0
 
int _textMaxHeight = 0
 
TextAlign _textAlignment = kTextAlignLeft
 
int _interLinear = 0
 
int _textShadow = 0
 
MacWindowManager_wm = nullptr
 
uint32 _tfgcolor = 0
 
uint32 _tbgcolor = 0
 
bool _macFontMode = true
 
MacText_macText
 
MacFontRun _defaultFormatting
 
ImageArchive _imageArchive
 

Member Function Documentation

◆ getLineWidth()

int Graphics::MacTextCanvas::getLineWidth ( int  line,
bool  enforce = false,
int  col = -1 
)

Returns line width in pixels. This takes into account chunks. The result is cached for faster subsequent calls.

Parameters
lineLine number
enforceFlag for indicating skipping the cache and computing the width, must be called when text gets changed
colCompute line width up to specified column, including this column
Returns
line width in pixels, or 0 for non-existent lines

◆ reshuffleParagraph()

void Graphics::MacTextCanvas::reshuffleParagraph ( int *  row,
int *  col,
MacFontRun defaultFormatting 
)

Rewraps paragraph containing given text row. When text is modified, we redo whole thing again without touching other paragraphs. Also, cursor position is returned in the arguments


The documentation for this class was generated from the following file: