• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/skia/include/core/SkRect.h"
9 #include "flutter/lib/ui/dart_wrapper.h"
10 
11 namespace flutter {
12 
13 enum class TextDirection {
14   rtl,
15   ltr,
16 };
17 
18 struct TextBox {
19   SkRect rect;
20   TextDirection direction;
21 
TextBoxTextBox22   TextBox(SkRect r, TextDirection d) : rect(r), direction(d) {}
23 };
24 
25 }  // namespace flutter
26 
27 namespace tonic {
28 
29 template <>
30 struct DartConverter<flutter::TextBox> {
31   static Dart_Handle ToDart(const flutter::TextBox& val);
32 };
33 
34 template <>
35 struct DartListFactory<flutter::TextBox> {
36   static Dart_Handle NewList(intptr_t length);
37 };
38 
39 }  // namespace tonic
40 
41 #endif  // FLUTTER_LIB_UI_TEXT_TEXT_BOX_H_
42