Issue #325 Part 12: Manually edit Unicode property tables.

Although this is generated code, the #ifdefs in it are blockers.
!! Do not regenerate these files until the script has been updated !!
See #326.
This commit is contained in:
wolfbeast 2018-05-04 17:57:48 +02:00 committed by Roy Tam
commit f3ce7263ac
4 changed files with 1 additions and 1754 deletions

View file

@ -12,10 +12,8 @@
#include "nsUnicodeScriptCodes.h"
#include "harfbuzz/hb.h"
#if ENABLE_INTL_API
#include "unicode/uchar.h"
#include "unicode/uscript.h"
#endif
const nsCharProps2& GetCharProps2(uint32_t aCh);
@ -56,7 +54,7 @@ enum XidmodType {
XIDMOD_NOT_CHARS
};
#if ENABLE_INTL_API // ICU is available, so simply forward to its API
// ICU is available, so simply forward to its API
extern const hb_unicode_general_category_t sICUtoHBcategory[];
@ -172,47 +170,6 @@ IsEastAsianWidthFWH(uint32_t aCh)
return false;
}
#else // not ENABLE_INTL_API
// Return whether the char has a mirrored-pair counterpart.
uint32_t GetMirroredChar(uint32_t aCh);
bool HasMirroredChar(uint32_t aChr);
uint8_t GetCombiningClass(uint32_t aCh);
// returns the detailed General Category in terms of HB_UNICODE_* values
uint8_t GetGeneralCategory(uint32_t aCh);
nsCharType GetBidiCat(uint32_t aCh);
uint8_t GetLineBreakClass(uint32_t aCh);
Script GetScriptCode(uint32_t aCh);
uint32_t GetScriptTagForCode(Script aScriptCode);
PairedBracketType GetPairedBracketType(uint32_t aCh);
uint32_t GetPairedBracket(uint32_t aCh);
/**
* Return the numeric value of the character. The value returned is the value
* of the Numeric_Value in field 7 of the UCD, or -1 if field 7 is empty.
* To restrict to decimal digits, the caller should also check whether
* GetGeneralCategory returns HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER
*/
int8_t GetNumericValue(uint32_t aCh);
uint32_t GetUppercase(uint32_t aCh);
uint32_t GetLowercase(uint32_t aCh);
uint32_t GetTitlecaseForLower(uint32_t aCh); // maps LC to titlecase, UC unchanged
uint32_t GetTitlecaseForAll(uint32_t aCh); // maps both UC and LC to titlecase
// Return whether the char has EastAsianWidth class F or W or H.
bool IsEastAsianWidthFWH(uint32_t aCh);
#endif // !ENABLE_INTL_API
// returns the simplified Gen Category as defined in nsIUGenCategory
inline nsIUGenCategory::nsUGenCategory GetGenCategory(uint32_t aCh) {
return sDetailedToGeneralCategory[GetGeneralCategory(aCh)];