| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2006, 2007, 2009, 2010 Apple Inc. All right reserve
d. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2009, 2010 Apple Inc. All right reserve
d. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 public: | 41 public: |
| 42 static PassRefPtr<BidiContext> create(unsigned char level, WTF::Unicode::Dir
ection, bool override = false, BidiEmbeddingSource = FromStyleOrDOM, BidiContext
* parent = 0); | 42 static PassRefPtr<BidiContext> create(unsigned char level, WTF::Unicode::Dir
ection, bool override = false, BidiEmbeddingSource = FromStyleOrDOM, BidiContext
* parent = 0); |
| 43 | 43 |
| 44 BidiContext* parent() const { return m_parent.get(); } | 44 BidiContext* parent() const { return m_parent.get(); } |
| 45 unsigned char level() const { return m_level; } | 45 unsigned char level() const { return m_level; } |
| 46 WTF::Unicode::Direction dir() const { return static_cast<WTF::Unicode::Direc
tion>(m_direction); } | 46 WTF::Unicode::Direction dir() const { return static_cast<WTF::Unicode::Direc
tion>(m_direction); } |
| 47 bool override() const { return m_override; } | 47 bool override() const { return m_override; } |
| 48 BidiEmbeddingSource source() const { return static_cast<BidiEmbeddingSource>
(m_source); } | 48 BidiEmbeddingSource source() const { return static_cast<BidiEmbeddingSource>
(m_source); } |
| 49 | 49 |
| 50 PassRefPtr<BidiContext> copyStackRemovingUnicodeEmbeddingContexts(); | 50 PassRefPtr<BidiContext> copyStackRemovingUnicodeEmbeddingContexts(); |
| 51 |
| 52 // http://www.unicode.org/reports/tr9/#Modifications |
| 53 // 6.3 raised the limit from 61 to 125. |
| 54 // http://unicode.org/reports/tr9/#BD2 |
| 55 static const short kMaxLevel = 125; |
| 56 |
| 51 private: | 57 private: |
| 52 BidiContext(unsigned char level, WTF::Unicode::Direction direction, bool ove
rride, BidiEmbeddingSource source, BidiContext* parent) | 58 BidiContext(unsigned char level, WTF::Unicode::Direction direction, bool ove
rride, BidiEmbeddingSource source, BidiContext* parent) |
| 53 : m_level(level) | 59 : m_level(level) |
| 54 , m_direction(direction) | 60 , m_direction(direction) |
| 55 , m_override(override) | 61 , m_override(override) |
| 56 , m_source(source) | 62 , m_source(source) |
| 57 , m_parent(parent) | 63 , m_parent(parent) |
| 58 { | 64 { |
| 59 } | 65 } |
| 60 | 66 |
| 61 static PassRefPtr<BidiContext> createUncached(unsigned char level, WTF::Unic
ode::Direction, bool override, BidiEmbeddingSource, BidiContext* parent); | 67 static PassRefPtr<BidiContext> createUncached(unsigned char level, WTF::Unic
ode::Direction, bool override, BidiEmbeddingSource, BidiContext* parent); |
| 62 | 68 |
| 63 unsigned m_level : 6; // The maximium bidi level is 62: http://unicode.org/r
eports/tr9/#Explicit_Levels_and_Directions | 69 unsigned m_level : 7; // The maximium bidi level is 125: http://unicode.org/
reports/tr9/#Explicit_Levels_and_Directions |
| 64 unsigned m_direction : 5; // Direction | 70 unsigned m_direction : 5; // Direction |
| 65 unsigned m_override : 1; | 71 unsigned m_override : 1; |
| 66 unsigned m_source : 1; // BidiEmbeddingSource | 72 unsigned m_source : 1; // BidiEmbeddingSource |
| 67 RefPtr<BidiContext> m_parent; | 73 RefPtr<BidiContext> m_parent; |
| 68 }; | 74 }; |
| 69 | 75 |
| 70 inline unsigned char nextGreaterOddLevel(unsigned char level) | 76 inline unsigned char nextGreaterOddLevel(unsigned char level) |
| 71 { | 77 { |
| 72 return (level + 1) | 1; | 78 return (level + 1) | 1; |
| 73 } | 79 } |
| 74 | 80 |
| 75 inline unsigned char nextGreaterEvenLevel(unsigned char level) | 81 inline unsigned char nextGreaterEvenLevel(unsigned char level) |
| 76 { | 82 { |
| 77 return (level + 2) & ~1; | 83 return (level + 2) & ~1; |
| 78 } | 84 } |
| 79 | 85 |
| 80 PLATFORM_EXPORT bool operator==(const BidiContext&, const BidiContext&); | 86 PLATFORM_EXPORT bool operator==(const BidiContext&, const BidiContext&); |
| 81 | 87 |
| 82 } // namespace WebCore | 88 } // namespace WebCore |
| 83 | 89 |
| 84 #endif // BidiContext_h | 90 #endif // BidiContext_h |
| OLD | NEW |