summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-06-17 04:55:07 +0300
committerQt by Nokia <qt-info@nokia.com>2012-06-22 09:47:59 +0200
commitb57e2162ef632d7fb8e595fad86a2f26f1737e72 (patch)
treeda0010b9c65c99921bb79bb476e29e9fc22db419 /src/corelib
parentc1329fba135b86df22f3f99e9334cea11c7a2db9 (diff)
QUnicodeTables: some internal API renamings
enums GraphemeBreak, WordBreak, and SentenceBreak has been renamed to GraphemeBreakClass, WordBreakClass, and SentenceBreakClass respectively, their values has been renamed to contain a '_' as logical enum-value separator (just like many other nums in Qt, e.g. LineBreakClass); *BreakFormat has been replaced with *Break_Extend (some format characters are kind of subtype of the extender characters, not vice versa). Change-Id: I9ddbcf8848da87409736c2d6d1798a62fa28cab8 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/tools/qunicodetables.cpp14
-rw-r--r--src/corelib/tools/qunicodetables_p.h102
-rw-r--r--src/corelib/tools/qunicodetools.cpp46
3 files changed, 81 insertions, 81 deletions
diff --git a/src/corelib/tools/qunicodetables.cpp b/src/corelib/tools/qunicodetables.cpp
index 945eadd03f..04d4b0212e 100644
--- a/src/corelib/tools/qunicodetables.cpp
+++ b/src/corelib/tools/qunicodetables.cpp
@@ -6339,24 +6339,24 @@ Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2)
return qGetProp(ucs2);
}
-Q_CORE_EXPORT GraphemeBreak QT_FASTCALL graphemeBreakClass(uint ucs4)
+Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4)
{
- return (GraphemeBreak)qGetProp(ucs4)->graphemeBreak;
+ return (GraphemeBreakClass)qGetProp(ucs4)->graphemeBreakClass;
}
-Q_CORE_EXPORT WordBreak QT_FASTCALL wordBreakClass(uint ucs4)
+Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4)
{
- return (WordBreak)qGetProp(ucs4)->wordBreak;
+ return (WordBreakClass)qGetProp(ucs4)->wordBreakClass;
}
-Q_CORE_EXPORT SentenceBreak QT_FASTCALL sentenceBreakClass(uint ucs4)
+Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4)
{
- return (SentenceBreak)qGetProp(ucs4)->sentenceBreak;
+ return (SentenceBreakClass)qGetProp(ucs4)->sentenceBreakClass;
}
Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4)
{
- return (LineBreakClass)qGetProp(ucs4)->line_break_class;
+ return (LineBreakClass)qGetProp(ucs4)->lineBreakClass;
}
Q_CORE_EXPORT Script QT_FASTCALL script(uint ucs4)
diff --git a/src/corelib/tools/qunicodetables_p.h b/src/corelib/tools/qunicodetables_p.h
index 1ba8ad9f1f..77ba8f6f6a 100644
--- a/src/corelib/tools/qunicodetables_p.h
+++ b/src/corelib/tools/qunicodetables_p.h
@@ -79,10 +79,10 @@ struct Properties {
ushort titleCaseSpecial : 1;
ushort caseFoldSpecial : 1;
ushort unicodeVersion : 4;
- ushort graphemeBreak : 8; /* 4 used */
- ushort wordBreak : 8; /* 4 used */
- ushort sentenceBreak : 8; /* 4 used */
- ushort line_break_class : 8; /* 6 used */
+ ushort graphemeBreakClass : 8; /* 4 used */
+ ushort wordBreakClass : 8; /* 4 used */
+ ushort sentenceBreakClass : 8; /* 4 used */
+ ushort lineBreakClass : 8; /* 6 used */
ushort script : 8; /* 5 used */
};
@@ -196,51 +196,51 @@ enum Script {
Takri = Common
};
-enum GraphemeBreak {
- GraphemeBreakOther,
- GraphemeBreakCR,
- GraphemeBreakLF,
- GraphemeBreakControl,
- GraphemeBreakExtend,
- GraphemeBreakPrepend,
- GraphemeBreakSpacingMark,
- GraphemeBreakL,
- GraphemeBreakV,
- GraphemeBreakT,
- GraphemeBreakLV,
- GraphemeBreakLVT
+enum GraphemeBreakClass {
+ GraphemeBreak_Other,
+ GraphemeBreak_CR,
+ GraphemeBreak_LF,
+ GraphemeBreak_Control,
+ GraphemeBreak_Extend,
+ GraphemeBreak_Prepend,
+ GraphemeBreak_SpacingMark,
+ GraphemeBreak_L,
+ GraphemeBreak_V,
+ GraphemeBreak_T,
+ GraphemeBreak_LV,
+ GraphemeBreak_LVT
};
-enum WordBreak {
- WordBreakOther,
- WordBreakCR,
- WordBreakLF,
- WordBreakNewline,
- WordBreakFormat,
- WordBreakKatakana,
- WordBreakALetter,
- WordBreakMidNumLet,
- WordBreakMidLetter,
- WordBreakMidNum,
- WordBreakNumeric,
- WordBreakExtendNumLet
+enum WordBreakClass {
+ WordBreak_Other,
+ WordBreak_CR,
+ WordBreak_LF,
+ WordBreak_Newline,
+ WordBreak_Extend,
+ WordBreak_Katakana,
+ WordBreak_ALetter,
+ WordBreak_MidNumLet,
+ WordBreak_MidLetter,
+ WordBreak_MidNum,
+ WordBreak_Numeric,
+ WordBreak_ExtendNumLet
};
-enum SentenceBreak {
- SentenceBreakOther,
- SentenceBreakCR,
- SentenceBreakLF,
- SentenceBreakSep,
- SentenceBreakFormat,
- SentenceBreakSp,
- SentenceBreakLower,
- SentenceBreakUpper,
- SentenceBreakOLetter,
- SentenceBreakNumeric,
- SentenceBreakATerm,
- SentenceBreakSContinue,
- SentenceBreakSTerm,
- SentenceBreakClose
+enum SentenceBreakClass {
+ SentenceBreak_Other,
+ SentenceBreak_CR,
+ SentenceBreak_LF,
+ SentenceBreak_Sep,
+ SentenceBreak_Extend,
+ SentenceBreak_Sp,
+ SentenceBreak_Lower,
+ SentenceBreak_Upper,
+ SentenceBreak_OLetter,
+ SentenceBreak_Numeric,
+ SentenceBreak_ATerm,
+ SentenceBreak_SContinue,
+ SentenceBreak_STerm,
+ SentenceBreak_Close
};
// see http://www.unicode.org/reports/tr14/tr14-28.html
@@ -255,16 +255,16 @@ enum LineBreakClass {
LineBreak_SG, LineBreak_SP, LineBreak_CR, LineBreak_LF, LineBreak_BK
};
-Q_CORE_EXPORT GraphemeBreak QT_FASTCALL graphemeBreakClass(uint ucs4);
-inline GraphemeBreak graphemeBreakClass(QChar ch)
+Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4);
+inline GraphemeBreakClass graphemeBreakClass(QChar ch)
{ return graphemeBreakClass(ch.unicode()); }
-Q_CORE_EXPORT WordBreak QT_FASTCALL wordBreakClass(uint ucs4);
-inline WordBreak wordBreakClass(QChar ch)
+Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4);
+inline WordBreakClass wordBreakClass(QChar ch)
{ return wordBreakClass(ch.unicode()); }
-Q_CORE_EXPORT SentenceBreak QT_FASTCALL sentenceBreakClass(uint ucs4);
-inline SentenceBreak sentenceBreakClass(QChar ch)
+Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4);
+inline SentenceBreakClass sentenceBreakClass(QChar ch)
{ return sentenceBreakClass(ch.unicode()); }
Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4);
diff --git a/src/corelib/tools/qunicodetools.cpp b/src/corelib/tools/qunicodetools.cpp
index a9d54496ee..1fef6aefc4 100644
--- a/src/corelib/tools/qunicodetools.cpp
+++ b/src/corelib/tools/qunicodetools.cpp
@@ -59,7 +59,7 @@ namespace QUnicodeTools {
namespace GB {
-static const uchar breakTable[QUnicodeTables::GraphemeBreakLVT + 1][QUnicodeTables::GraphemeBreakLVT + 1] = {
+static const uchar breakTable[QUnicodeTables::GraphemeBreak_LVT + 1][QUnicodeTables::GraphemeBreak_LVT + 1] = {
// Other CR LF Control Extend Prepend S-Mark L V T LV LVT
{ true , true , true , true , false, true , false, true , true , true , true , true }, // Other
{ true , true , false, true , true , true , true , true , true , true , true , true }, // CR
@@ -79,7 +79,7 @@ static const uchar breakTable[QUnicodeTables::GraphemeBreakLVT + 1][QUnicodeTabl
static void getGraphemeBreaks(const ushort *string, quint32 len, HB_CharAttributes *attributes)
{
- QUnicodeTables::GraphemeBreak lcls = QUnicodeTables::GraphemeBreakLF; // to meet GB1
+ QUnicodeTables::GraphemeBreakClass lcls = QUnicodeTables::GraphemeBreak_LF; // to meet GB1
for (quint32 i = 0; i != len; ++i) {
quint32 pos = i;
uint ucs4 = string[i];
@@ -92,7 +92,7 @@ static void getGraphemeBreaks(const ushort *string, quint32 len, HB_CharAttribut
}
const QUnicodeTables::Properties *prop = QUnicodeTables::properties(ucs4);
- QUnicodeTables::GraphemeBreak cls = (QUnicodeTables::GraphemeBreak) prop->graphemeBreak;
+ QUnicodeTables::GraphemeBreakClass cls = (QUnicodeTables::GraphemeBreakClass) prop->graphemeBreakClass;
attributes[pos].charStop = GB::breakTable[lcls][cls];
@@ -109,13 +109,13 @@ enum Action {
Lookup = 2
};
-static const uchar breakTable[QUnicodeTables::WordBreakExtendNumLet + 1][QUnicodeTables::WordBreakExtendNumLet + 1] = {
-// Other CR LF Newline Format Katakana ALetter MidNumLet MidLetter MidNum Numeric ExtendNumLet
+static const uchar breakTable[QUnicodeTables::WordBreak_ExtendNumLet + 1][QUnicodeTables::WordBreak_ExtendNumLet + 1] = {
+// Other CR LF Newline Extend Katakana ALetter MidNumLet MidLetter MidNum Numeric ExtendNumLet
{ Break , Break , Break , Break , NoBreak, Break , Break , Break , Break , Break , Break , Break }, // Other
{ Break , Break , NoBreak, Break , Break , Break , Break , Break , Break , Break , Break , Break }, // CR
{ Break , Break , Break , Break , Break , Break , Break , Break , Break , Break , Break , Break }, // LF
{ Break , Break , Break , Break , Break , Break , Break , Break , Break , Break , Break , Break }, // Newline
- { Break , Break , Break , Break , NoBreak, Break , Break , Break , Break , Break , Break , Break }, // Format
+ { Break , Break , Break , Break , NoBreak, Break , Break , Break , Break , Break , Break , Break }, // Extend
{ Break , Break , Break , Break , NoBreak, NoBreak, Break , Break , Break , Break , Break , NoBreak }, // Katakana
{ Break , Break , Break , Break , NoBreak, Break , NoBreak, Lookup , Lookup , Break , NoBreak, NoBreak }, // ALetter
{ Break , Break , Break , Break , NoBreak, Break , Break , Break , Break , Break , Break , Break }, // MidNumLet
@@ -129,7 +129,7 @@ static const uchar breakTable[QUnicodeTables::WordBreakExtendNumLet + 1][QUnicod
static void getWordBreaks(const ushort *string, quint32 len, HB_CharAttributes *attributes)
{
- QUnicodeTables::WordBreak cls = QUnicodeTables::WordBreakLF; // to meet WB1
+ QUnicodeTables::WordBreakClass cls = QUnicodeTables::WordBreak_LF; // to meet WB1
for (quint32 i = 0; i != len; ++i) {
quint32 pos = i;
uint ucs4 = string[i];
@@ -142,7 +142,7 @@ static void getWordBreaks(const ushort *string, quint32 len, HB_CharAttributes *
}
const QUnicodeTables::Properties *prop = QUnicodeTables::properties(ucs4);
- QUnicodeTables::WordBreak ncls = (QUnicodeTables::WordBreak) prop->wordBreak;
+ QUnicodeTables::WordBreakClass ncls = (QUnicodeTables::WordBreakClass) prop->wordBreakClass;
uchar action = WB::breakTable[cls][ncls];
if (Q_UNLIKELY(action == WB::Lookup)) {
@@ -158,8 +158,8 @@ static void getWordBreaks(const ushort *string, quint32 len, HB_CharAttributes *
}
prop = QUnicodeTables::properties(ucs4);
- QUnicodeTables::WordBreak tcls = (QUnicodeTables::WordBreak) prop->wordBreak;
- if (Q_UNLIKELY(tcls == QUnicodeTables::WordBreakFormat))
+ QUnicodeTables::WordBreakClass tcls = (QUnicodeTables::WordBreakClass) prop->wordBreakClass;
+ if (Q_UNLIKELY(tcls == QUnicodeTables::WordBreak_Extend))
continue;
if (Q_LIKELY(tcls == cls)) {
i = lookahead;
@@ -168,7 +168,7 @@ static void getWordBreaks(const ushort *string, quint32 len, HB_CharAttributes *
}
break;
}
- } else if (Q_UNLIKELY(ncls == QUnicodeTables::WordBreakFormat)) {
+ } else if (Q_UNLIKELY(ncls == QUnicodeTables::WordBreak_Extend)) {
// WB4: X(Extend|Format)* -> X
if (Q_LIKELY(action != WB::Break))
continue;
@@ -198,8 +198,8 @@ enum State {
Lookup
};
-static const uchar breakTable[BAfter + 1][QUnicodeTables::SentenceBreakClose + 1] = {
-// Other CR LF Sep Format Sp Lower Upper OLetter Numeric ATerm SContinue STerm Close
+static const uchar breakTable[BAfter + 1][QUnicodeTables::SentenceBreak_Close + 1] = {
+// Other CR LF Sep Extend Sp Lower Upper OLetter Numeric ATerm SContinue STerm Close
{ Initial, BAfterC, BAfter , BAfter , Initial, Initial, Initial, Upper , Initial, Initial, ATerm , Initial, STerm , Initial }, // Initial
{ Initial, BAfterC, BAfter , BAfter , Upper , Initial, Initial, Upper , Initial, Initial, UpATerm, STerm , STerm , Initial }, // Upper
@@ -232,7 +232,7 @@ static void getSentenceBreaks(const ushort *string, quint32 len, HB_CharAttribut
}
const QUnicodeTables::Properties *prop = QUnicodeTables::properties(ucs4);
- QUnicodeTables::SentenceBreak ncls = (QUnicodeTables::SentenceBreak) prop->sentenceBreak;
+ QUnicodeTables::SentenceBreakClass ncls = (QUnicodeTables::SentenceBreakClass) prop->sentenceBreakClass;
Q_ASSERT(state <= SB::BAfter);
state = SB::breakTable[state][ncls];
@@ -249,16 +249,16 @@ static void getSentenceBreaks(const ushort *string, quint32 len, HB_CharAttribut
}
prop = QUnicodeTables::properties(ucs4);
- QUnicodeTables::SentenceBreak tcls = (QUnicodeTables::SentenceBreak) prop->sentenceBreak;
+ QUnicodeTables::SentenceBreakClass tcls = (QUnicodeTables::SentenceBreakClass) prop->sentenceBreakClass;
switch (tcls) {
- case QUnicodeTables::SentenceBreakOther:
- case QUnicodeTables::SentenceBreakFormat:
- case QUnicodeTables::SentenceBreakSp:
- case QUnicodeTables::SentenceBreakNumeric:
- case QUnicodeTables::SentenceBreakSContinue:
- case QUnicodeTables::SentenceBreakClose:
+ case QUnicodeTables::SentenceBreak_Other:
+ case QUnicodeTables::SentenceBreak_Extend:
+ case QUnicodeTables::SentenceBreak_Sp:
+ case QUnicodeTables::SentenceBreak_Numeric:
+ case QUnicodeTables::SentenceBreak_SContinue:
+ case QUnicodeTables::SentenceBreak_Close:
continue;
- case QUnicodeTables::SentenceBreakLower:
+ case QUnicodeTables::SentenceBreak_Lower:
i = lookahead;
state = SB::Initial;
break;
@@ -422,7 +422,7 @@ static void getLineBreaks(const ushort *string, quint32 len, HB_CharAttributes *
}
const QUnicodeTables::Properties *prop = QUnicodeTables::properties(ucs4);
- QUnicodeTables::LineBreakClass ncls = (QUnicodeTables::LineBreakClass) prop->line_break_class;
+ QUnicodeTables::LineBreakClass ncls = (QUnicodeTables::LineBreakClass) prop->lineBreakClass;
if (Q_UNLIKELY(ncls == QUnicodeTables::LineBreak_SA)) {
// LB1: resolve SA to AL, except of those that have Category Mn or Mc be resolved to CM