1 | // Copyright 2013 The Flutter Authors. All rights reserved. |
---|---|
2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. |
4 | |
5 | #ifndef FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ |
6 | #define FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ |
7 | |
8 | #include "third_party/dart/runtime/include/dart_api.h" |
9 | #include "third_party/skia/include/core/SkRect.h" |
10 | #include "third_party/tonic/converter/dart_converter.h" |
11 | |
12 | namespace flutter { |
13 | |
14 | enum class TextDirection { |
15 | rtl, |
16 | ltr, |
17 | }; |
18 | |
19 | struct TextBox { |
20 | SkRect rect; |
21 | TextDirection direction; |
22 | |
23 | TextBox(SkRect r, TextDirection d) : rect(r), direction(d) {} |
24 | }; |
25 | |
26 | } // namespace flutter |
27 | |
28 | namespace tonic { |
29 | |
30 | template <> |
31 | struct DartConverter<flutter::TextBox> { |
32 | static Dart_Handle ToDart(const flutter::TextBox& val); |
33 | }; |
34 | |
35 | template <> |
36 | struct DartListFactory<flutter::TextBox> { |
37 | static Dart_Handle NewList(intptr_t length); |
38 | }; |
39 | |
40 | } // namespace tonic |
41 | |
42 | #endif // FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_ |
43 |