Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
TextBoxSlide Class Reference
Inheritance diagram for TextBoxSlide:
Slide SkRefCnt SkRefCntBase

Public Member Functions

 TextBoxSlide (ShaperFactory fact, MakeBidiIteratorCallback bidi, MakeScriptRunCallback script, const char suffix[])
 
void load (SkScalar w, SkScalar h) override
 
void resize (SkScalar w, SkScalar h) override
 
void draw (SkCanvas *canvas) override
 
- Public Member Functions inherited from Slide
virtual SkISize getDimensions () const
 
virtual void gpuTeardown ()
 
virtual void draw (SkCanvas *canvas)=0
 
virtual bool animate (double nanos)
 
virtual void load (SkScalar winWidth, SkScalar winHeight)
 
virtual void resize (SkScalar winWidth, SkScalar winHeight)
 
virtual void unload ()
 
virtual bool onChar (SkUnichar c)
 
virtual bool onMouse (SkScalar x, SkScalar y, skui::InputState state, skui::ModifierKey modifiers)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
const SkStringgetName ()
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Additional Inherited Members

- Protected Attributes inherited from Slide
SkString fName
 

Detailed Description

Definition at line 123 of file TextBoxSlide.cpp.

Constructor & Destructor Documentation

◆ TextBoxSlide()

TextBoxSlide::TextBoxSlide ( ShaperFactory  fact,
MakeBidiIteratorCallback  bidi,
MakeScriptRunCallback  script,
const char  suffix[] 
)
inline

Definition at line 125 of file TextBoxSlide.cpp.

129 : fShaper(fact()), fBidiCallback(bidi), fScriptRunCallback(script) {
130 fName = SkStringPrintf("TextBox_%s", suffix);
131 }
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
SkString fName
Definition: Slide.h:54

Member Function Documentation

◆ draw()

void TextBoxSlide::draw ( SkCanvas canvas)
inlineoverridevirtual

Implements Slide.

Definition at line 137 of file TextBoxSlide.cpp.

137 {
138 SkScalar width = fSize.width() / 3;
139 drawTest(canvas, width, fSize.height(), SK_ColorBLACK, SK_ColorWHITE);
140 canvas->translate(width, 0);
141 drawTest(canvas, width, fSize.height(), SK_ColorWHITE, SK_ColorBLACK);
142 canvas->translate(width, 0);
143 drawTest(canvas, width, fSize.height()/2, SK_ColorGRAY, SK_ColorWHITE);
144 canvas->translate(0, fSize.height()/2);
145 drawTest(canvas, width, fSize.height()/2, SK_ColorGRAY, SK_ColorBLACK);
146 }
constexpr SkColor SK_ColorGRAY
Definition: SkColor.h:113
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
float SkScalar
Definition: extension.cpp:12
int32_t width
SkScalar width() const
Definition: SkSize.h:76
SkScalar height() const
Definition: SkSize.h:77

◆ load()

void TextBoxSlide::load ( SkScalar  w,
SkScalar  h 
)
inlineoverridevirtual

Reimplemented from Slide.

Definition at line 133 of file TextBoxSlide.cpp.

133{ fSize = {w, h}; }
SkScalar w
SkScalar h

◆ resize()

void TextBoxSlide::resize ( SkScalar  w,
SkScalar  h 
)
inlineoverridevirtual

Reimplemented from Slide.

Definition at line 135 of file TextBoxSlide.cpp.

135{ fSize = {w, h}; }

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