ScummVM API documentation
Graphics::MacText Class Reference
Inheritance diagram for Graphics::MacText:
Graphics::MacWidget Graphics::MacButton

Public Member Functions

 MacText (MacWidget *parent, int x, int y, int w, int h, MacWindowManager *wm, const Common::U32String &s, const MacFont *font, uint32 fgcolor, uint32 bgcolor, int maxWidth, TextAlign textAlignment=kTextAlignLeft, int interlinear=0, uint16 border=0, uint16 gutter=0, uint16 boxShadow=0, uint16 textShadow=0, bool fixedDims=true)
 
 MacText (const Common::U32String &s, MacWindowManager *wm, const MacFont *font, uint32 fgcolor, uint32 bgcolor, int maxWidth, TextAlign textAlignment, int interlinear=0, bool fixedDims=true)
 
 MacText (const Common::U32String &s, MacWindowManager *wm, const Font *font, uint32 fgcolor, uint32 bgcolor, int maxWidth, TextAlign textAlignment, int interlinear=0, bool fixedDims=true)
 
virtual void resize (int w, int h)
 
bool processEvent (Common::Event &event) override
 
bool needsRedraw () override
 
void render ()
 
void undrawCursor ()
 
void draw (ManagedSurface *g, int x, int y, int w, int h, int xoff, int yoff)
 
bool draw (ManagedSurface *g, bool forceRedraw=false) override
 
bool draw (bool forceRedraw=false) override
 
void drawToPoint (ManagedSurface *g, Common::Rect srcRect, Common::Point dstPoint)
 
void drawToPoint (ManagedSurface *g, Common::Point dstPoint)
 
ManagedSurfacegetSurface ()
 
int getInterLinear ()
 
void setInterLinear (int interLinear)
 
void setMaxWidth (int maxWidth)
 
void setDefaultFormatting (uint16 fontId, byte textSlant, uint16 fontSize, uint16 palinfo1, uint16 palinfo2, uint16 palinfo3)
 
const MacFontRungetDefaultFormatting ()
 
void setAlignOffset (TextAlign align)
 
TextAlign getAlign ()
 
virtual Common::Point calculateOffset ()
 
void setActive (bool active) override
 
void setEditable (bool editable)
 
void setColors (uint32 fg, uint32 bg) override
 
void setTextColor (uint32 color, uint32 line)
 
void setTextColor (uint32 color, uint32 start, uint32 end)
 
void appendText (const Common::U32String &str, int fontId=kMacFontSystem, int fontSize=12, int fontSlant=kMacFontRegular, bool skipAdd=false)
 
void appendText (const Common::U32String &str, int fontId=kMacFontSystem, int fontSize=12, int fontSlant=kMacFontRegular, uint16 r=0, uint16 g=0, uint16 b=0, bool skipAdd=false)
 
void appendText (const Common::U32String &str, const Font *font, uint16 r=0, uint16 g=0, uint16 b=0, bool skipAdd=false)
 
int getTextFont ()
 
void enforceTextFont (uint16 fontId)
 
int getTextSize ()
 
void setTextSize (int textSize)
 
int getTextSize (int start, int end)
 
void setTextSize (int textSize, int start, int end)
 
uint32 getTextColor ()
 
uint32 getTextColor (int start, int end)
 
int getTextFont (int start, int end)
 
void setTextFont (int fontId, int start, int end)
 
int getTextSlant (int start, int end)
 
void setTextSlant (int textSlant, int start, int end)
 
void enforceTextSlant (int textSlant)
 
int getMouseChar (int x, int y)
 
int getMouseWord (int x, int y)
 
int getMouseItem (int x, int y)
 
int getMouseLine (int x, int y)
 
Common::U32String getMouseLink (int x, int y)
 
bool setImageArchive (const Common::Path &name)
 
void appendTextDefault (const Common::U32String &str, bool skipAdd=false)
 
void appendTextDefault (const Common::String &str, bool skipAdd=false)
 
void clearText ()
 
void removeLastLine ()
 
int getLineCount ()
 
int getLastLineWidth ()
 
int getTextHeight ()
 
int getLineHeight (int line)
 
int getTextMaxWidth ()
 
void setText (const Common::U32String &str)
 
void setFixDims (bool fixed)
 
bool getFixDims ()
 
void deleteSelection ()
 
void deletePreviousChar (int *row, int *col)
 
void addNewLine (int *row, int *col)
 
void insertChar (byte c, int *row, int *col)
 
void getChunkPosFromIndex (int index, uint &lineNum, uint &chunkNum, uint &offset)
 
void getRowCol (int x, int y, int *sx, int *sy, int *row, int *col, int *chunk_=nullptr)
 
Common::U32String getTextChunk (int startRow, int startCol, int endRow, int endCol, bool formatted=false, bool newlines=true)
 
Common::U32String getSelection (bool formatted=false, bool newlines=true)
 
uint getSelectionIndex (bool start)
 
void clearSelection ()
 
Common::U32String cutSelection ()
 
const SelectedTextgetSelectedText ()
 
int getLineSpacing ()
 
void setSelection (int pos, bool start)
 
Common::U32String getEditedString ()
 
Common::U32String getText ()
 
Common::U32String getPlainText ()
 
void setSelRange (int selStart, int selEnd)
 
void scroll (int delta)
 
void setMarkdownText (const Common::U32String &str)
 
- Public Member Functions inherited from Graphics::MacWidget
 MacWidget (MacWidget *parent, int x, int y, int w, int h, MacWindowManager *wm, bool focusable, uint16 border=0, uint16 gutter=0, uint16 shadow=0, uint32 fgcolor=0, uint32 bgcolor=0xff)
 
const Common::RectgetDimensions ()
 
void setDirty (bool dirty)
 
virtual void blit (ManagedSurface *g, Common::Rect &dest)
 
virtual bool hasAllFocus ()
 
virtual bool isEditable ()
 
virtual void setDimensions (const Common::Rect &r)
 
Common::Point getAbsolutePos ()
 
MacWidgetfindEventHandler (Common::Event &event, int dx, int dy)
 
void removeWidget (MacWidget *child, bool del=true)
 
Graphics::ManagedSurfacegetSurface ()
 

Public Attributes

int _cursorX
 
int _cursorY
 
bool _cursorState
 
int _cursorRow
 
int _cursorCol
 
bool _cursorDirty
 
Common::Rect_cursorRect
 
bool _cursorOff
 
bool _selectable
 
int _scrollPos
 
bool _fullRefresh
 
- Public Attributes inherited from Graphics::MacWidget
bool _focusable
 
bool _active
 
bool _editable
 
uint _priority
 
Common::Rect _dims
 
MacWindowManager_wm
 
MacWidget_parent
 
Common::Array< MacWidget * > _children
 

Protected Attributes

Common::U32String _str
 
const MacFont_macFont
 
bool _fixedDims
 
int _selEnd
 
int _selStart
 
MacTextCanvas _canvas
 
MacFontRun _defaultFormatting
 
MacFontRun _currentFormatting
 
- Protected Attributes inherited from Graphics::MacWidget
uint16 _border
 
uint16 _gutter
 
uint16 _shadow
 
uint32 _fgcolor
 
uint32 _bgcolor
 
Graphics::ManagedSurface_composeSurface
 
bool _contentIsDirty
 

Member Function Documentation

◆ setActive()

void Graphics::MacText::setActive ( bool  active)
overridevirtual

Method for indicating whether the widget is active or inactive. Used by the WM to handle focus on windows, etc.

Parameters
activeDesired state of the widget.

Reimplemented from Graphics::MacWidget.

◆ setSelection()

void Graphics::MacText::setSelection ( int  pos,
bool  start 
)

set the selection of mactext

Parameters
pospos of selection, 0 represent first, -1 represent the end of text
startselection start or selection end

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