ScummVM API documentation
Graphics::MacTextWindow Class Reference
Inheritance diagram for Graphics::MacTextWindow:
Graphics::MacWindow Graphics::BaseMacWindow Graphics::MacWidget

Public Member Functions

 MacTextWindow (MacWindowManager *wm, const MacFont *font, int fgcolor, int bgcolor, int maxWidth, TextAlign textAlignment, MacMenu *menu, bool cursorHandler=true)
 
 MacTextWindow (MacWindowManager *wm, const Font *font, int fgcolor, int bgcolor, int maxWidth, TextAlign textAlignment, MacMenu *menu, bool cursorHandler=true)
 
virtual void resize (int w, int h) override
 
void setDimensions (const Common::Rect &r) override
 
virtual bool processEvent (Common::Event &event) override
 
virtual bool draw (ManagedSurface *g, bool forceRedraw=false) override
 
virtual bool draw (bool forceRedraw=false) override
 
virtual void blit (ManagedSurface *g, Common::Rect &dest) override
 
void setTextWindowFont (const MacFont *macFont)
 
const MacFontgetTextWindowFont ()
 
void appendText (const Common::U32String &str, const MacFont *macFont=nullptr, bool skipAdd=false)
 
void appendText (const Common::String &str, const MacFont *macFont=nullptr, bool skipAdd=false)
 
void clearText ()
 
void setMarkdownText (const Common::U32String &str)
 
void setEditable (bool editable)
 
void setSelectable (bool selectable)
 
void undrawCursor ()
 
const Common::U32StringgetInput ()
 
void clearInput ()
 
void appendInput (const Common::U32String &str)
 
void appendInput (const Common::String &str)
 
Common::U32String getSelection (bool formatted=false, bool newlines=true)
 
void clearSelection ()
 
Common::U32String cutSelection ()
 
const SelectedTextgetSelectedText ()
 
int getTextHeight ()
 
int getMouseLine (int x, int y)
 
void setTextColorRGB (uint32 rgb)
 
- Public Member Functions inherited from Graphics::MacWindow
 MacWindow (int id, bool scrollable, bool resizable, bool editable, MacWindowManager *wm)
 
void move (int x, int y)
 
virtual void resizeInner (int w, int h)
 
void setDimensions (const Common::Rect &r) override
 
void setInnerDimensions (const Common::Rect &r)
 
void setBackgroundPattern (int pattern)
 
bool draw (ManagedSurface *g, bool forceRedraw=false) override
 
bool draw (bool forceRedraw=false) override
 
void blit (ManagedSurface *g, Common::Rect &dest) override
 
const Common::RectgetInnerDimensions () override
 
ManagedSurfacegetBorderSurface () override
 
void center (bool toCenter=true)
 
void setActive (bool active) override
 
bool isActive () const
 
void setTitle (const Common::String &title)
 
virtual void setTitleVisible (bool visible)
 
bool isTitleVisible ()
 
const Common::StringgetTitle () const
 
void setHighlight (WindowClick highlightedPart)
 
void setScroll (float scrollPos, float scrollSize)
 
bool processEvent (Common::Event &event) override
 
bool hasAllFocus () override
 
void loadBorder (Common::SeekableReadStream &file, uint32 flags, int lo=-1, int ro=-1, int to=-1, int bo=-1)
 
void loadBorder (Common::SeekableReadStream &file, uint32 flags, BorderOffsets offsets)
 
void setBorder (Graphics::ManagedSurface *surface, uint32 flags, BorderOffsets offsets)
 
void disableBorder ()
 
void loadInternalBorder (uint32 flags)
 
void enableScrollbar (bool active)
 
void setCloseable (bool closeable)
 
void setBorderType (int borderType)
 
int getBorderType () const
 
uint32 getBorderFlags () const
 
void addDirtyRect (const Common::Rect &r)
 
void markAllDirty ()
 
void mergeDirtyRects ()
 
bool isDirty () override
 
void setBorderDirty (bool dirty)
 
void resizeBorderSurface ()
 
void setMode (uint32 mode)
 
void setBorderOffsets (BorderOffsets &offsets)
 
void updateInnerDims ()
 
- Public Member Functions inherited from Graphics::BaseMacWindow
 BaseMacWindow (int id, bool editable, MacWindowManager *wm)
 
int getId ()
 
WindowType getType ()
 
bool isEditable ()
 
virtual void setVisible (bool visible, bool silent=false)
 
bool isVisible ()
 
ManagedSurfacegetWindowSurface ()
 
void setCallback (bool(*callback)(WindowClick, Common::Event &, void *), void *data)
 
- 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 bool needsRedraw ()
 
virtual void setColors (uint32 fg, uint32 bg)
 
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
 
bool _cursorDirty
 
Common::Rect_cursorRect
 
bool _cursorOff
 
bool _editable
 
bool _selectable
 
int _scrollPos
 
- 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
 

Additional Inherited Members

- Protected Member Functions inherited from Graphics::MacWindow
void drawBorder ()
 
WindowClick isInBorder (int x, int y) const
 
BorderOffsets getBorderOffsets () const
 
- Protected Attributes inherited from Graphics::MacWindow
ManagedSurface _borderSurface
 
bool _borderIsDirty
 
Common::Rect _innerDims
 
Common::List< Common::Rect_dirtyRects
 
bool _hasScrollBar
 
uint32 _mode
 
- Protected Attributes inherited from Graphics::BaseMacWindow
int _id
 
WindowType _type
 
bool _editable
 
bool(* _callback )(WindowClick, Common::Event &, void *)
 
void * _dataPtr
 
bool _visible
 
bool _draggable
 
- Protected Attributes inherited from Graphics::MacWidget
uint16 _border
 
uint16 _gutter
 
uint16 _shadow
 
uint32 _fgcolor
 
uint32 _bgcolor
 
Graphics::ManagedSurface_composeSurface
 
bool _contentIsDirty
 

Member Function Documentation

◆ processEvent()

virtual bool Graphics::MacTextWindow::processEvent ( Common::Event event)
overridevirtual

Method called by the WM when there is an event concerning the window. Note that depending on the subclass of the window, it might not be called if the window is not active.

Parameters
eventEvent to be processed.
Returns
true If the event was successfully consumed and processed.

Implements Graphics::BaseMacWindow.

◆ draw() [1/2]

virtual bool Graphics::MacTextWindow::draw ( ManagedSurface g,
bool  forceRedraw = false 
)
overridevirtual

Method called to draw the window into the target surface. This method is most often called by the WM, and relies on the window being marked as dirty unless otherwise specified.

Parameters
gSurface on which to draw the window.
forceRedrawIt's behavior depends on the subclass.

Implements Graphics::BaseMacWindow.

◆ draw() [2/2]

virtual bool Graphics::MacTextWindow::draw ( bool  forceRedraw = false)
overridevirtual

Method called to internally draw the window. This relies on the window being marked as dirty unless otherwise specified.

Parameters
forceRedrawIts behavior depends on the subclass.

Implements Graphics::BaseMacWindow.

◆ setTextColorRGB()

void Graphics::MacTextWindow::setTextColorRGB ( uint32  rgb)
inline

if we want to draw the text which color is not black, then we need to set _textColorRGB

Parameters
rgbtext color you want to draw

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