#include <paragraph.h>
|
| ~Paragraph () override |
|
double | width () |
|
double | height () |
|
double | longestLine () |
|
double | minIntrinsicWidth () |
|
double | maxIntrinsicWidth () |
|
double | alphabeticBaseline () |
|
double | ideographicBaseline () |
|
bool | didExceedMaxLines () |
|
void | layout (double width) |
|
void | paint (Canvas *canvas, double x, double y) |
|
tonic::Float32List | getRectsForRange (unsigned start, unsigned end, unsigned boxHeightStyle, unsigned boxWidthStyle) |
|
tonic::Float32List | getRectsForPlaceholders () |
|
Dart_Handle | getPositionForOffset (double dx, double dy) |
|
Dart_Handle | getGlyphInfoAt (unsigned utf16Offset, Dart_Handle constructor) const |
|
Dart_Handle | getClosestGlyphInfo (double dx, double dy, Dart_Handle constructor) const |
|
Dart_Handle | getWordBoundary (unsigned offset) |
|
Dart_Handle | getLineBoundary (unsigned offset) |
|
tonic::Float64List | computeLineMetrics () const |
|
Dart_Handle | getLineMetricsAt (int lineNumber, Dart_Handle constructor) const |
|
size_t | getNumberOfLines () const |
|
int | getLineNumberAt (size_t utf16Offset) const |
|
void | dispose () |
|
virtual void | RetainDartWrappableReference () const override |
|
virtual void | ReleaseDartWrappableReference () const override |
|
void | Release () const |
|
void | AddRef () const |
|
bool | HasOneRef () const |
|
void | AssertHasOneRef () const |
|
| DartWrappable () |
|
virtual const DartWrapperInfo & | GetDartWrapperInfo () const =0 |
|
virtual void | RetainDartWrappableReference () const =0 |
|
virtual void | ReleaseDartWrappableReference () const =0 |
|
Dart_Handle | CreateDartWrapper (DartState *dart_state) |
|
void | AssociateWithDartWrapper (Dart_Handle wrappable) |
|
void | ClearDartWrapper () |
|
Dart_WeakPersistentHandle | dart_wrapper () const |
|
Definition at line 15 of file paragraph.h.
◆ ~Paragraph()
flutter::Paragraph::~Paragraph |
( |
| ) |
|
|
overridedefault |
◆ alphabeticBaseline()
double flutter::Paragraph::alphabeticBaseline |
( |
| ) |
|
Definition at line 49 of file paragraph.cc.
49 {
50 return m_paragraph_->GetAlphabeticBaseline();
51}
◆ computeLineMetrics()
tonic::Float64List flutter::Paragraph::computeLineMetrics |
( |
| ) |
const |
Definition at line 187 of file paragraph.cc.
187 {
188 std::vector<txt::LineMetrics> metrics = m_paragraph_->GetLineMetrics();
189
190
191
192
193 tonic::Float64List
result(
195 uint64_t position = 0;
196 for (uint64_t
i = 0;
i < metrics.size();
i++) {
198 result[position++] =
static_cast<double>(
line.hard_break);
202
203
204
209 result[position++] =
static_cast<double>(
line.line_number);
210 }
211
213}
static void round(SkPoint *p)
@ Dart_TypedData_kFloat64
DART_EXPORT Dart_Handle Dart_NewTypedData(Dart_TypedData_Type type, intptr_t length)
◆ Create()
Definition at line 20 of file paragraph.h.
21 {
22 auto paragraph = fml::MakeRefCounted<Paragraph>(std::move(txt_paragraph));
23 paragraph->AssociateWithDartWrapper(paragraph_handle);
24 }
◆ didExceedMaxLines()
bool flutter::Paragraph::didExceedMaxLines |
( |
| ) |
|
Definition at line 57 of file paragraph.cc.
57 {
58 return m_paragraph_->DidExceedMaxLines();
59}
◆ dispose()
void flutter::Paragraph::dispose |
( |
| ) |
|
Definition at line 251 of file paragraph.cc.
251 {
252 m_paragraph_.reset();
254}
◆ getClosestGlyphInfo()
Definition at line 151 of file paragraph.cc.
153 {
155 const bool found =
156 m_paragraph_->GetClosestGlyphInfoAtCoordinate(
dx, dy, &glyphInfo);
157 if (!found) {
159 }
162 return handle;
163}
struct _Dart_Handle * Dart_Handle
DART_EXPORT Dart_Handle Dart_Null(void)
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
Dart_Handle glyphInfoFrom(Dart_Handle constructor, const skia::textlayout::Paragraph::GlyphInfo &glyphInfo)
bool CheckAndHandleError(Dart_Handle handle)
◆ getGlyphInfoAt()
Definition at line 139 of file paragraph.cc.
140 {
142 const bool found = m_paragraph_->GetGlyphInfoAt(utf16Offset, &glyphInfo);
143 if (!found) {
145 }
148 return handle;
149}
◆ getLineBoundary()
Dart_Handle flutter::Paragraph::getLineBoundary |
( |
unsigned |
offset | ) |
|
Definition at line 172 of file paragraph.cc.
172 {
173 std::vector<txt::LineMetrics> metrics = m_paragraph_->GetLineMetrics();
174 int line_start = -1;
175 int line_end = -1;
177 if (utf16Offset >=
line.start_index && utf16Offset <=
line.end_index) {
178 line_start =
line.start_index;
179 line_end =
line.end_index;
180 break;
181 }
182 }
183 std::vector<int>
result = {line_start, line_end};
185}
Dart_Handle ToDart(const T &object)
◆ getLineMetricsAt()
Definition at line 215 of file paragraph.cc.
216 {
218 const bool found = m_paragraph_->GetLineMetricsAt(lineNumber, &
line);
219 if (!found) {
221 }
222 std::array<Dart_Handle, 9> arguments = {
227
228
229
235 };
236
240 return handle;
241}
DART_EXPORT Dart_Handle Dart_NewDouble(double value)
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_InvokeClosure(Dart_Handle closure, int number_of_arguments, Dart_Handle *arguments)
DART_EXPORT Dart_Handle Dart_NewInteger(int64_t value)
DART_EXPORT Dart_Handle Dart_NewBoolean(bool value)
◆ getLineNumberAt()
int flutter::Paragraph::getLineNumberAt |
( |
size_t |
utf16Offset | ) |
const |
Definition at line 247 of file paragraph.cc.
247 {
248 return m_paragraph_->GetLineNumberAt(utf16Offset);
249}
◆ getNumberOfLines()
size_t flutter::Paragraph::getNumberOfLines |
( |
| ) |
const |
Definition at line 243 of file paragraph.cc.
243 {
244 return m_paragraph_->GetNumberOfLines();
245}
◆ getPositionForOffset()
Dart_Handle flutter::Paragraph::getPositionForOffset |
( |
double |
dx, |
|
|
double |
dy |
|
) |
| |
Definition at line 113 of file paragraph.cc.
113 {
115 m_paragraph_->GetGlyphPositionAtCoordinate(
dx, dy);
116 std::vector<size_t>
result = {
118 static_cast<size_t>(
pos.affinity)
119 };
121}
◆ getRectsForPlaceholders()
tonic::Float32List flutter::Paragraph::getRectsForPlaceholders |
( |
| ) |
|
Definition at line 107 of file paragraph.cc.
107 {
108 std::vector<txt::Paragraph::TextBox> boxes =
109 m_paragraph_->GetRectsForPlaceholders();
111}
static tonic::Float32List EncodeTextBoxes(const std::vector< txt::Paragraph::TextBox > &boxes)
◆ getRectsForRange()
tonic::Float32List flutter::Paragraph::getRectsForRange |
( |
unsigned |
start, |
|
|
unsigned |
end, |
|
|
unsigned |
boxHeightStyle, |
|
|
unsigned |
boxWidthStyle |
|
) |
| |
Definition at line 97 of file paragraph.cc.
100 {
101 std::vector<txt::Paragraph::TextBox> boxes = m_paragraph_->GetRectsForRange(
105}
◆ getWordBoundary()
Dart_Handle flutter::Paragraph::getWordBoundary |
( |
unsigned |
offset | ) |
|
Definition at line 165 of file paragraph.cc.
165 {
167 m_paragraph_->GetWordBoundary(utf16Offset);
170}
◆ height()
double flutter::Paragraph::height |
( |
| ) |
|
Definition at line 33 of file paragraph.cc.
33 {
34 return m_paragraph_->GetHeight();
35}
◆ ideographicBaseline()
double flutter::Paragraph::ideographicBaseline |
( |
| ) |
|
Definition at line 53 of file paragraph.cc.
53 {
54 return m_paragraph_->GetIdeographicBaseline();
55}
◆ layout()
void flutter::Paragraph::layout |
( |
double |
width | ) |
|
◆ longestLine()
double flutter::Paragraph::longestLine |
( |
| ) |
|
Definition at line 37 of file paragraph.cc.
37 {
38 return m_paragraph_->GetLongestLine();
39}
◆ maxIntrinsicWidth()
double flutter::Paragraph::maxIntrinsicWidth |
( |
| ) |
|
Definition at line 45 of file paragraph.cc.
45 {
46 return m_paragraph_->GetMaxIntrinsicWidth();
47}
◆ minIntrinsicWidth()
double flutter::Paragraph::minIntrinsicWidth |
( |
| ) |
|
Definition at line 41 of file paragraph.cc.
41 {
42 return m_paragraph_->GetMinIntrinsicWidth();
43}
◆ paint()
void flutter::Paragraph::paint |
( |
Canvas * |
canvas, |
|
|
double |
x, |
|
|
double |
y |
|
) |
| |
Definition at line 65 of file paragraph.cc.
65 {
66 if (!m_paragraph_ || !canvas) {
67
68 return;
69 }
70
71 DisplayListBuilder*
builder = canvas->builder();
74 }
75}
◆ width()
double flutter::Paragraph::width |
( |
| ) |
|
Definition at line 29 of file paragraph.cc.
29 {
30 return m_paragraph_->GetMaxWidth();
31}
The documentation for this class was generated from the following files: