OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef CORE_INCLUDE_FXCRT_FX_BIDI_H_ | 7 #ifndef CORE_FXCRT_FX_BIDI_H_ |
8 #define CORE_INCLUDE_FXCRT_FX_BIDI_H_ | 8 #define CORE_FXCRT_FX_BIDI_H_ |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "core/include/fxcrt/fx_string.h" | 13 #include "core/fxcrt/include/fx_string.h" |
14 #include "core/include/fxcrt/fx_system.h" | 14 #include "core/fxcrt/include/fx_system.h" |
15 | 15 |
16 // Processes characters and group them into segments based on text direction. | 16 // Processes characters and group them into segments based on text direction. |
17 class CFX_BidiChar { | 17 class CFX_BidiChar { |
18 public: | 18 public: |
19 enum Direction { NEUTRAL, LEFT, RIGHT }; | 19 enum Direction { NEUTRAL, LEFT, RIGHT }; |
20 struct Segment { | 20 struct Segment { |
21 int32_t start; // Start position. | 21 int32_t start; // Start position. |
22 int32_t count; // Character count. | 22 int32_t count; // Character count. |
23 Direction direction; // Segment direction. | 23 Direction direction; // Segment direction. |
24 }; | 24 }; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 const_iterator begin() const { return m_Order.begin(); } | 63 const_iterator begin() const { return m_Order.begin(); } |
64 const_iterator end() const { return m_Order.end(); } | 64 const_iterator end() const { return m_Order.end(); } |
65 | 65 |
66 private: | 66 private: |
67 const CFX_WideString m_Str; | 67 const CFX_WideString m_Str; |
68 std::unique_ptr<CFX_BidiChar> m_pBidiChar; | 68 std::unique_ptr<CFX_BidiChar> m_pBidiChar; |
69 std::vector<CFX_BidiChar::Segment> m_Order; | 69 std::vector<CFX_BidiChar::Segment> m_Order; |
70 CFX_BidiChar::Direction m_eOverallDirection; | 70 CFX_BidiChar::Direction m_eOverallDirection; |
71 }; | 71 }; |
72 | 72 |
73 #endif // CORE_INCLUDE_FXCRT_FX_BIDI_H_ | 73 #endif // CORE_FXCRT_FX_BIDI_H_ |
OLD | NEW |