| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef Character_h | 31 #ifndef Character_h |
| 32 #define Character_h | 32 #define Character_h |
| 33 | 33 |
| 34 #include "platform/PlatformExport.h" | 34 #include "platform/PlatformExport.h" |
| 35 #include "platform/text/TextDirection.h" | 35 #include "platform/text/TextDirection.h" |
| 36 #include "platform/text/TextPath.h" | 36 #include "platform/text/TextPath.h" |
| 37 #include "platform/text/TextRun.h" |
| 37 #include "wtf/HashSet.h" | 38 #include "wtf/HashSet.h" |
| 38 #include "wtf/text/WTFString.h" | 39 #include "wtf/text/WTFString.h" |
| 39 #include "wtf/unicode/CharacterNames.h" | 40 #include "wtf/unicode/CharacterNames.h" |
| 40 | 41 |
| 41 namespace blink { | 42 namespace blink { |
| 42 | 43 |
| 43 class PLATFORM_EXPORT Character { | 44 class PLATFORM_EXPORT Character { |
| 44 public: | 45 public: |
| 45 static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simp
lePath; } | 46 static CodePath characterRangeCodePath(const LChar*, unsigned) { return Simp
lePath; } |
| 46 static CodePath characterRangeCodePath(const UChar*, unsigned len); | 47 static CodePath characterRangeCodePath(const UChar*, unsigned len); |
| 47 | 48 |
| 48 static bool isCJKIdeograph(UChar32); | 49 static bool isCJKIdeograph(UChar32); |
| 49 static bool isCJKIdeographOrSymbol(UChar32); | 50 static bool isCJKIdeographOrSymbol(UChar32); |
| 50 | 51 |
| 51 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD
irection, bool& isAfterExpansion); | 52 static unsigned expansionOpportunityCount(const LChar*, size_t length, TextD
irection, bool& isAfterExpansion, const TextJustify); |
| 52 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD
irection, bool& isAfterExpansion); | 53 static unsigned expansionOpportunityCount(const UChar*, size_t length, TextD
irection, bool& isAfterExpansion, const TextJustify); |
| 53 | 54 |
| 54 static bool treatAsSpace(UChar c) | 55 static bool treatAsSpace(UChar c) |
| 55 { | 56 { |
| 56 return c == space | 57 return c == space |
| 57 || c == characterTabulation | 58 || c == characterTabulation |
| 58 || c == newlineCharacter | 59 || c == newlineCharacter |
| 59 || c == noBreakSpace; | 60 || c == noBreakSpace; |
| 60 } | 61 } |
| 61 static bool treatAsZeroWidthSpace(UChar c) | 62 static bool treatAsZeroWidthSpace(UChar c) |
| 62 { | 63 { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 static String normalizeSpaces(const LChar*, unsigned length); | 103 static String normalizeSpaces(const LChar*, unsigned length); |
| 103 static String normalizeSpaces(const UChar*, unsigned length); | 104 static String normalizeSpaces(const UChar*, unsigned length); |
| 104 | 105 |
| 105 private: | 106 private: |
| 106 Character(); | 107 Character(); |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace blink | 110 } // namespace blink |
| 110 | 111 |
| 111 #endif | 112 #endif |
| OLD | NEW |