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
12namespace flutter {
13
14enum class TextDirection {
15 rtl,
16 ltr,
17};
18
19struct TextBox {
20 SkRect rect;
21 TextDirection direction;
22
23 TextBox(SkRect r, TextDirection d) : rect(r), direction(d) {}
24};
25
26} // namespace flutter
27
28namespace tonic {
29
30template <>
31struct DartConverter<flutter::TextBox> {
32 static Dart_Handle ToDart(const flutter::TextBox& val);
33};
34
35template <>
36struct 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