Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(497)

Side by Side Diff: core/include/fxcrt/fx_bidi.h

Issue 1423103002: XFA: Manual merge of Clean up IFX_BidiChar (Closed) Base URL: https://pdfium.googlesource.com/pdfium@xfa
Patch Set: address comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/include/fxcrt/fx_arb.h ('k') | core/include/fxcrt/fx_ucd.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 PDFium 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 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6
7 #ifndef CORE_INCLUDE_FXCRT_FX_BIDI_H_
8 #define CORE_INCLUDE_FXCRT_FX_BIDI_H_
9
10 #include "fx_system.h"
11
12 // Processes characters and group them into segments based on text direction.
13 class CFX_BidiChar {
14 public:
15 enum Direction { NEUTRAL, LEFT, RIGHT };
16
17 CFX_BidiChar();
18 ~CFX_BidiChar();
19
20 // Append a character and classify it as left, right, or neutral.
21 // Returns true if the character has a different direction than the
22 // existing direction to indicate there is a segment to process.
23 bool AppendChar(FX_WCHAR wch);
24
25 // Call this after the last character has been appended. AppendChar()
26 // must not be called after this.
27 // Returns true if there is still a segment to process.
28 bool EndChar();
29
30 // Get information about the segment to process.
31 // The segment's start position and character count is returned in |iStart|
32 // and |iCount|, respectively. Pass in null pointers if the information is
33 // not needed.
34 // Returns the segment direction.
35 Direction GetBidiInfo(int32_t* iStart, int32_t* iCount) const;
36
37 private:
38 void SaveCurrentStateToLastState();
39
40 // Position of the current segment.
41 int32_t m_iCurStart;
42
43 // Number of characters in the current segment.
44 int32_t m_iCurCount;
45
46 // Direction of the current segment.
47 Direction m_CurBidi;
48
49 // Number of characters in the last segment.
50 int32_t m_iLastStart;
51
52 // Number of characters in the last segment.
53 int32_t m_iLastCount;
54
55 // Direction of the last segment.
56 Direction m_LastBidi;
57 };
58
59 #endif // CORE_INCLUDE_FXCRT_FX_BIDI_H_
OLDNEW
« no previous file with comments | « core/include/fxcrt/fx_arb.h ('k') | core/include/fxcrt/fx_ucd.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698