Merge
This commit is contained in:
commit
46360bd868
@ -76,6 +76,10 @@ FILES_java = \
|
||||
sun/text/Normalizer.java \
|
||||
sun/text/SupplementaryCharacterData.java \
|
||||
sun/text/UCompactIntArray.java \
|
||||
sun/text/bidi/BidiBase.java \
|
||||
sun/text/bidi/BidiLine.java \
|
||||
sun/text/bidi/BidiRun.java \
|
||||
\
|
||||
sun/text/normalizer/CharTrie.java \
|
||||
sun/text/normalizer/CharacterIteratorWrapper.java \
|
||||
sun/text/normalizer/ICUBinary.java \
|
||||
|
@ -24,10 +24,6 @@
|
||||
#
|
||||
|
||||
FILES_c_shared = \
|
||||
jbidi.c \
|
||||
ubidi.c \
|
||||
ubidiln.c \
|
||||
uchardir.c \
|
||||
DrawGlyphList.c \
|
||||
sunFont.c
|
||||
|
||||
|
@ -145,7 +145,6 @@ include $(BUILDDIR)/common/Library.gmk
|
||||
# Add to the ambient vpath to pick up files in subdirectories
|
||||
#
|
||||
vpath %.c $(PLATFORM_SRC)/native/$(PKGDIR)
|
||||
vpath %.c $(SHARE_SRC)/native/$(PKGDIR)/bidi
|
||||
vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)/layout
|
||||
vpath %.cpp $(SHARE_SRC)/native/$(PKGDIR)
|
||||
|
||||
@ -187,7 +186,6 @@ endif # PLATFORM
|
||||
|
||||
CPPFLAGS += -I$(SHARE_SRC)/native/$(PKGDIR) \
|
||||
-I$(SHARE_SRC)/native/$(PKGDIR)/layout \
|
||||
-I$(SHARE_SRC)/native/$(PKGDIR)/bidi \
|
||||
-I$(SHARE_SRC)/native/sun/awt/image/cvutils \
|
||||
-I$(PLATFORM_SRC)/native/sun/awt \
|
||||
-I$(SHARE_SRC)/native/sun/awt/debug \
|
||||
|
@ -31,8 +31,6 @@ SUNWprivate_1.1 {
|
||||
newLayoutTableCache;
|
||||
freeLayoutTableCache;
|
||||
isNullScalerContext;
|
||||
Java_java_text_Bidi_nativeBidiChars;
|
||||
Java_java_text_Bidi_nativeGetDirectionCode;
|
||||
Java_sun_font_NullFontScaler_getNullScalerContext;
|
||||
Java_sun_font_NullFontScaler_getGlyphImage;
|
||||
Java_sun_font_FontManager_getPlatformFontVar;
|
||||
|
@ -33,8 +33,6 @@ SUNWprivate_1.1 {
|
||||
newLayoutTableCache;
|
||||
freeLayoutTableCache;
|
||||
isNullScalerContext;
|
||||
Java_java_text_Bidi_nativeBidiChars;
|
||||
Java_java_text_Bidi_nativeGetDirectionCode;
|
||||
Java_sun_font_NullFontScaler_getNullScalerContext;
|
||||
Java_sun_font_NullFontScaler_getGlyphImage;
|
||||
Java_sun_font_FontManager_getPlatformFontVar;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 2000-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -35,10 +35,7 @@
|
||||
|
||||
package java.text;
|
||||
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.font.TextAttribute;
|
||||
import java.awt.font.NumericShaper;
|
||||
import sun.text.CodePointIterator;
|
||||
import sun.text.bidi.BidiBase;
|
||||
|
||||
/**
|
||||
* This class implements the Unicode Bidirectional Algorithm.
|
||||
@ -62,15 +59,6 @@ import sun.text.CodePointIterator;
|
||||
* @since 1.4
|
||||
*/
|
||||
public final class Bidi {
|
||||
byte dir;
|
||||
byte baselevel;
|
||||
int length;
|
||||
int[] runs;
|
||||
int[] cws;
|
||||
|
||||
static {
|
||||
sun.font.FontManagerNativeLibrary.load();
|
||||
}
|
||||
|
||||
/** Constant indicating base direction is left-to-right. */
|
||||
public static final int DIRECTION_LEFT_TO_RIGHT = 0;
|
||||
@ -94,7 +82,7 @@ public final class Bidi {
|
||||
*/
|
||||
public static final int DIRECTION_DEFAULT_RIGHT_TO_LEFT = -1;
|
||||
|
||||
private static final int DIR_MIXED = 2;
|
||||
private BidiBase bidiBase;
|
||||
|
||||
/**
|
||||
* Create Bidi from the given paragraph of text and base direction.
|
||||
@ -109,7 +97,7 @@ public final class Bidi {
|
||||
throw new IllegalArgumentException("paragraph is null");
|
||||
}
|
||||
|
||||
nativeBidiChars(this, paragraph.toCharArray(), 0, null, 0, paragraph.length(), flags);
|
||||
bidiBase = new BidiBase(paragraph.toCharArray(), 0, null, 0, paragraph.length(), flags);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -142,67 +130,8 @@ public final class Bidi {
|
||||
throw new IllegalArgumentException("paragraph is null");
|
||||
}
|
||||
|
||||
int flags = DIRECTION_DEFAULT_LEFT_TO_RIGHT;
|
||||
byte[] embeddings = null;
|
||||
|
||||
int start = paragraph.getBeginIndex();
|
||||
int limit = paragraph.getEndIndex();
|
||||
int length = limit - start;
|
||||
int n = 0;
|
||||
char[] text = new char[length];
|
||||
for (char c = paragraph.first(); c != paragraph.DONE; c = paragraph.next()) {
|
||||
text[n++] = c;
|
||||
}
|
||||
|
||||
paragraph.first();
|
||||
try {
|
||||
Boolean runDirection = (Boolean)paragraph.getAttribute(TextAttribute.RUN_DIRECTION);
|
||||
if (runDirection != null) {
|
||||
if (TextAttribute.RUN_DIRECTION_LTR.equals(runDirection)) {
|
||||
flags = DIRECTION_LEFT_TO_RIGHT; // clears default setting
|
||||
} else {
|
||||
flags = DIRECTION_RIGHT_TO_LEFT;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ClassCastException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
NumericShaper shaper = (NumericShaper)paragraph.getAttribute(TextAttribute.NUMERIC_SHAPING);
|
||||
if (shaper != null) {
|
||||
shaper.shape(text, 0, text.length);
|
||||
}
|
||||
}
|
||||
catch (ClassCastException e) {
|
||||
}
|
||||
|
||||
int pos = start;
|
||||
do {
|
||||
paragraph.setIndex(pos);
|
||||
Object embeddingLevel = paragraph.getAttribute(TextAttribute.BIDI_EMBEDDING);
|
||||
int newpos = paragraph.getRunLimit(TextAttribute.BIDI_EMBEDDING);
|
||||
|
||||
if (embeddingLevel != null) {
|
||||
try {
|
||||
int intLevel = ((Integer)embeddingLevel).intValue();
|
||||
if (intLevel >= -61 && intLevel < 61) {
|
||||
byte level = (byte)(intLevel < 0 ? (-intLevel | 0x80) : intLevel);
|
||||
if (embeddings == null) {
|
||||
embeddings = new byte[length];
|
||||
}
|
||||
for (int i = pos - start; i < newpos - start; ++i) {
|
||||
embeddings[i] = level;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ClassCastException e) {
|
||||
}
|
||||
}
|
||||
pos = newpos;
|
||||
} while (pos < limit);
|
||||
|
||||
nativeBidiChars(this, text, 0, embeddings, 0, text.length, flags);
|
||||
bidiBase = new BidiBase(0, 0);
|
||||
bidiBase.setPara(paragraph);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -240,46 +169,7 @@ public final class Bidi {
|
||||
" for embeddings of length: " + text.length);
|
||||
}
|
||||
|
||||
if (embeddings != null) {
|
||||
// native uses high bit to indicate override, not negative value, sigh
|
||||
|
||||
for (int i = embStart, embLimit = embStart + paragraphLength; i < embLimit; ++i) {
|
||||
if (embeddings[i] < 0) {
|
||||
byte[] temp = new byte[paragraphLength];
|
||||
System.arraycopy(embeddings, embStart, temp, 0, paragraphLength);
|
||||
|
||||
for (i -= embStart; i < paragraphLength; ++i) {
|
||||
if (temp[i] < 0) {
|
||||
temp[i] = (byte)(-temp[i] | 0x80);
|
||||
}
|
||||
}
|
||||
|
||||
embeddings = temp;
|
||||
embStart = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
nativeBidiChars(this, text, textStart, embeddings, embStart, paragraphLength, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Private constructor used by line bidi.
|
||||
*/
|
||||
private Bidi(int dir, int baseLevel, int length, int[] data, int[] cws) {
|
||||
reset(dir, baseLevel, length, data, cws);
|
||||
}
|
||||
|
||||
/**
|
||||
* Private mutator used by native code.
|
||||
*/
|
||||
private void reset(int dir, int baselevel, int length, int[] data, int[] cws) {
|
||||
this.dir = (byte)dir;
|
||||
this.baselevel = (byte)baselevel;
|
||||
this.length = length;
|
||||
this.runs = data;
|
||||
this.cws = cws;
|
||||
bidiBase = new BidiBase(text, textStart, embeddings, embStart, paragraphLength, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -290,96 +180,10 @@ public final class Bidi {
|
||||
* @param lineLimit the offset from the start of the paragraph to the limit of the line.
|
||||
*/
|
||||
public Bidi createLineBidi(int lineStart, int lineLimit) {
|
||||
if (lineStart == 0 && lineLimit == length) {
|
||||
return this;
|
||||
}
|
||||
AttributedString astr = new AttributedString("");
|
||||
Bidi newBidi = new Bidi(astr.getIterator());
|
||||
|
||||
int lineLength = lineLimit - lineStart;
|
||||
if (lineStart < 0 ||
|
||||
lineLimit < lineStart ||
|
||||
lineLimit > length) {
|
||||
throw new IllegalArgumentException("range " + lineStart +
|
||||
" to " + lineLimit +
|
||||
" is invalid for paragraph of length " + length);
|
||||
}
|
||||
|
||||
if (runs == null) {
|
||||
return new Bidi(dir, baselevel, lineLength, null, null);
|
||||
} else {
|
||||
int cwspos = -1;
|
||||
int[] ncws = null;
|
||||
if (cws != null) {
|
||||
int cwss = 0;
|
||||
int cwsl = cws.length;
|
||||
while (cwss < cwsl) {
|
||||
if (cws[cwss] >= lineStart) {
|
||||
cwsl = cwss;
|
||||
while (cwsl < cws.length && cws[cwsl] < lineLimit) {
|
||||
cwsl++;
|
||||
}
|
||||
int ll = lineLimit-1;
|
||||
while (cwsl > cwss && cws[cwsl-1] == ll) {
|
||||
cwspos = ll; // record start of counter-directional whitespace
|
||||
--cwsl;
|
||||
--ll;
|
||||
}
|
||||
|
||||
if (cwspos == lineStart) { // entire line is cws, so ignore
|
||||
return new Bidi(dir, baselevel, lineLength, null, null);
|
||||
}
|
||||
|
||||
int ncwslen = cwsl - cwss;
|
||||
if (ncwslen > 0) {
|
||||
ncws = new int[ncwslen];
|
||||
for (int i = 0; i < ncwslen; ++i) {
|
||||
ncws[i] = cws[cwss+i] - lineStart;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
++cwss;
|
||||
}
|
||||
}
|
||||
|
||||
int[] nruns = null;
|
||||
int nlevel = baselevel;
|
||||
int limit = cwspos == -1 ? lineLimit : cwspos;
|
||||
int rs = 0;
|
||||
int rl = runs.length;
|
||||
int ndir = dir;
|
||||
for (; rs < runs.length; rs += 2) {
|
||||
if (runs[rs] > lineStart) {
|
||||
rl = rs;
|
||||
while (rl < runs.length && runs[rl] < limit) {
|
||||
rl += 2;
|
||||
}
|
||||
if ((rl > rs) || (runs[rs+1] != baselevel)) {
|
||||
rl += 2;
|
||||
|
||||
if (cwspos != -1 && rl > rs && runs[rl-1] != baselevel) { // add level for cws
|
||||
nruns = new int[rl - rs + 2];
|
||||
nruns[rl - rs] = lineLength;
|
||||
nruns[rl - rs + 1] = baselevel;
|
||||
} else {
|
||||
limit = lineLimit;
|
||||
nruns = new int[rl - rs];
|
||||
}
|
||||
|
||||
int n = 0;
|
||||
for (int i = rs; i < rl; i += 2) {
|
||||
nruns[n++] = runs[i] - lineStart;
|
||||
nruns[n++] = runs[i+1];
|
||||
}
|
||||
nruns[n-2] = limit - lineStart;
|
||||
} else {
|
||||
ndir = (runs[rs+1] & 0x1) == 0 ? DIRECTION_LEFT_TO_RIGHT : DIRECTION_RIGHT_TO_LEFT;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new Bidi(ndir, baselevel, lineLength, nruns, ncws);
|
||||
}
|
||||
return bidiBase.setLine(this, bidiBase, newBidi, newBidi.bidiBase,lineStart, lineLimit);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -388,7 +192,7 @@ public final class Bidi {
|
||||
* @return true if the line is not left-to-right or right-to-left.
|
||||
*/
|
||||
public boolean isMixed() {
|
||||
return dir == DIR_MIXED;
|
||||
return bidiBase.isMixed();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -396,7 +200,7 @@ public final class Bidi {
|
||||
* @return true if the line is all left-to-right text and the base direction is left-to-right
|
||||
*/
|
||||
public boolean isLeftToRight() {
|
||||
return dir == DIRECTION_LEFT_TO_RIGHT;
|
||||
return bidiBase.isLeftToRight();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -404,7 +208,7 @@ public final class Bidi {
|
||||
* @return true if the line is all right-to-left text, and the base direction is right-to-left
|
||||
*/
|
||||
public boolean isRightToLeft() {
|
||||
return dir == DIRECTION_RIGHT_TO_LEFT;
|
||||
return bidiBase.isRightToLeft();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -412,7 +216,7 @@ public final class Bidi {
|
||||
* @return the length of text in the line
|
||||
*/
|
||||
public int getLength() {
|
||||
return length;
|
||||
return bidiBase.getLength();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -420,7 +224,7 @@ public final class Bidi {
|
||||
* @return true if the base direction is left-to-right
|
||||
*/
|
||||
public boolean baseIsLeftToRight() {
|
||||
return (baselevel & 0x1) == 0;
|
||||
return bidiBase.baseIsLeftToRight();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -428,7 +232,7 @@ public final class Bidi {
|
||||
* @return the base level
|
||||
*/
|
||||
public int getBaseLevel() {
|
||||
return baselevel;
|
||||
return bidiBase.getParaLevel();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -438,17 +242,7 @@ public final class Bidi {
|
||||
* @return the resolved level of the character at offset
|
||||
*/
|
||||
public int getLevelAt(int offset) {
|
||||
if (runs == null || offset < 0 || offset >= length) {
|
||||
return baselevel;
|
||||
} else {
|
||||
int i = 0;
|
||||
do {
|
||||
if (offset < runs[i]) {
|
||||
return runs[i+1];
|
||||
}
|
||||
i += 2;
|
||||
} while (true);
|
||||
}
|
||||
return bidiBase.getLevelAt(offset);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -456,7 +250,7 @@ public final class Bidi {
|
||||
* @return the number of level runs
|
||||
*/
|
||||
public int getRunCount() {
|
||||
return runs == null ? 1 : runs.length / 2;
|
||||
return bidiBase.countRuns();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -465,7 +259,7 @@ public final class Bidi {
|
||||
* @return the level of the run
|
||||
*/
|
||||
public int getRunLevel(int run) {
|
||||
return runs == null ? baselevel : runs[run * 2 + 1];
|
||||
return bidiBase.getRunLevel(run);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -475,7 +269,7 @@ public final class Bidi {
|
||||
* @return the start of the run
|
||||
*/
|
||||
public int getRunStart(int run) {
|
||||
return (runs == null || run == 0) ? 0 : runs[run * 2 - 2];
|
||||
return bidiBase.getRunStart(run);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -486,7 +280,7 @@ public final class Bidi {
|
||||
* @return limit the limit of the run
|
||||
*/
|
||||
public int getRunLimit(int run) {
|
||||
return runs == null ? length : runs[run * 2];
|
||||
return bidiBase.getRunLimit(run);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -501,16 +295,7 @@ public final class Bidi {
|
||||
* @return true if the range of characters requires bidi analysis
|
||||
*/
|
||||
public static boolean requiresBidi(char[] text, int start, int limit) {
|
||||
CodePointIterator cpi = CodePointIterator.create(text, start, limit);
|
||||
for (int cp = cpi.next(); cp != CodePointIterator.DONE; cp = cpi.next()) {
|
||||
if (cp > 0x0590) {
|
||||
int dc = nativeGetDirectionCode(cp);
|
||||
if ((RMASK & (1 << dc)) != 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return BidiBase.requiresBidi(text, start, limit);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -530,124 +315,14 @@ public final class Bidi {
|
||||
* @param count the number of objects to reorder
|
||||
*/
|
||||
public static void reorderVisually(byte[] levels, int levelStart, Object[] objects, int objectStart, int count) {
|
||||
|
||||
if (count < 0) {
|
||||
throw new IllegalArgumentException("count " + count + " must be >= 0");
|
||||
}
|
||||
if (levelStart < 0 || levelStart + count > levels.length) {
|
||||
throw new IllegalArgumentException("levelStart " + levelStart + " and count " + count +
|
||||
" out of range [0, " + levels.length + "]");
|
||||
}
|
||||
if (objectStart < 0 || objectStart + count > objects.length) {
|
||||
throw new IllegalArgumentException("objectStart " + objectStart + " and count " + count +
|
||||
" out of range [0, " + objects.length + "]");
|
||||
}
|
||||
|
||||
byte lowestOddLevel = (byte)(NUMLEVELS + 1);
|
||||
byte highestLevel = 0;
|
||||
|
||||
// initialize mapping and levels
|
||||
|
||||
int levelLimit = levelStart + count;
|
||||
for (int i = levelStart; i < levelLimit; i++) {
|
||||
byte level = levels[i];
|
||||
if (level > highestLevel) {
|
||||
highestLevel = level;
|
||||
}
|
||||
|
||||
if ((level & 0x01) != 0 && level < lowestOddLevel) {
|
||||
lowestOddLevel = level;
|
||||
}
|
||||
}
|
||||
|
||||
int delta = objectStart - levelStart;
|
||||
|
||||
while (highestLevel >= lowestOddLevel) {
|
||||
int i = levelStart;
|
||||
|
||||
for (;;) {
|
||||
while (i < levelLimit && levels[i] < highestLevel) {
|
||||
i++;
|
||||
}
|
||||
int begin = i++;
|
||||
|
||||
if (begin == levelLimit) {
|
||||
break; // no more runs at this level
|
||||
}
|
||||
|
||||
while (i < levelLimit && levels[i] >= highestLevel) {
|
||||
i++;
|
||||
}
|
||||
int end = i - 1;
|
||||
|
||||
begin += delta;
|
||||
end += delta;
|
||||
while (begin < end) {
|
||||
Object temp = objects[begin];
|
||||
objects[begin] = objects[end];
|
||||
objects[end] = temp;
|
||||
++begin;
|
||||
--end;
|
||||
}
|
||||
}
|
||||
|
||||
--highestLevel;
|
||||
}
|
||||
BidiBase.reorderVisually(levels, levelStart, objects, objectStart, count);
|
||||
}
|
||||
|
||||
private static final char NUMLEVELS = 62;
|
||||
|
||||
private static final int RMASK =
|
||||
(1 << 1 /* U_RIGHT_TO_LEFT */) |
|
||||
(1 << 5 /* U_ARABIC_NUMBER */) |
|
||||
(1 << 13 /* U_RIGHT_TO_LEFT_ARABIC */) |
|
||||
(1 << 14 /* U_RIGHT_TO_LEFT_EMBEDDING */) |
|
||||
(1 << 15 /* U_RIGHT_TO_LEFT_OVERRIDE */);
|
||||
|
||||
/** Access native bidi implementation. */
|
||||
private static native int nativeGetDirectionCode(int cp);
|
||||
|
||||
/** Access native bidi implementation. */
|
||||
private static synchronized native void nativeBidiChars(Bidi bidi, char[] text, int textStart,
|
||||
byte[] embeddings, int embeddingStart,
|
||||
int length, int flags);
|
||||
|
||||
/**
|
||||
* Display the bidi internal state, used in debugging.
|
||||
*/
|
||||
public String toString() {
|
||||
StringBuffer buf = new StringBuffer(super.toString());
|
||||
buf.append("[dir: " + dir);
|
||||
buf.append(" baselevel: " + baselevel);
|
||||
buf.append(" length: " + length);
|
||||
if (runs == null) {
|
||||
buf.append(" runs: null");
|
||||
} else {
|
||||
buf.append(" runs: [");
|
||||
for (int i = 0; i < runs.length; i += 2) {
|
||||
if (i != 0) {
|
||||
buf.append(' ');
|
||||
}
|
||||
buf.append(runs[i]); // limit
|
||||
buf.append('/');
|
||||
buf.append(runs[i+1]); // level
|
||||
}
|
||||
buf.append(']');
|
||||
}
|
||||
if (cws == null) {
|
||||
buf.append(" cws: null");
|
||||
} else {
|
||||
buf.append(" cws: [");
|
||||
for (int i = 0; i < cws.length; ++i) {
|
||||
if (i != 0) {
|
||||
buf.append(' ');
|
||||
}
|
||||
buf.append(Integer.toHexString(cws[i]));
|
||||
}
|
||||
buf.append(']');
|
||||
}
|
||||
buf.append(']');
|
||||
|
||||
return buf.toString();
|
||||
return bidiBase.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
3444
jdk/src/share/classes/sun/text/bidi/BidiBase.java
Normal file
3444
jdk/src/share/classes/sun/text/bidi/BidiBase.java
Normal file
File diff suppressed because it is too large
Load Diff
849
jdk/src/share/classes/sun/text/bidi/BidiLine.java
Normal file
849
jdk/src/share/classes/sun/text/bidi/BidiLine.java
Normal file
@ -0,0 +1,849 @@
|
||||
/*
|
||||
* Portions Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
/*
|
||||
*******************************************************************************
|
||||
* (C) Copyright IBM Corp. and others, 1996-2009 - All Rights Reserved *
|
||||
* *
|
||||
* The original version of this source code and documentation is copyrighted *
|
||||
* and owned by IBM, These materials are provided under terms of a License *
|
||||
* Agreement between IBM and Sun. This technology is protected by multiple *
|
||||
* US and International patents. This notice and attribution to IBM may not *
|
||||
* to removed. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
/* Written by Simon Montagu, Matitiahu Allouche
|
||||
* (ported from C code written by Markus W. Scherer)
|
||||
*/
|
||||
|
||||
package sun.text.bidi;
|
||||
|
||||
import java.text.Bidi;
|
||||
import java.util.Arrays;
|
||||
|
||||
public final class BidiLine {
|
||||
|
||||
/*
|
||||
* General remarks about the functions in this file:
|
||||
*
|
||||
* These functions deal with the aspects of potentially mixed-directional
|
||||
* text in a single paragraph or in a line of a single paragraph
|
||||
* which has already been processed according to
|
||||
* the Unicode 3.0 Bidi algorithm as defined in
|
||||
* http://www.unicode.org/unicode/reports/tr9/ , version 13,
|
||||
* also described in The Unicode Standard, Version 4.0.1 .
|
||||
*
|
||||
* This means that there is a Bidi object with a levels
|
||||
* and a dirProps array.
|
||||
* paraLevel and direction are also set.
|
||||
* Only if the length of the text is zero, then levels==dirProps==NULL.
|
||||
*
|
||||
* The overall directionality of the paragraph
|
||||
* or line is used to bypass the reordering steps if possible.
|
||||
* Even purely RTL text does not need reordering there because
|
||||
* the getLogical/VisualIndex() methods can compute the
|
||||
* index on the fly in such a case.
|
||||
*
|
||||
* The implementation of the access to same-level-runs and of the reordering
|
||||
* do attempt to provide better performance and less memory usage compared to
|
||||
* a direct implementation of especially rule (L2) with an array of
|
||||
* one (32-bit) integer per text character.
|
||||
*
|
||||
* Here, the levels array is scanned as soon as necessary, and a vector of
|
||||
* same-level-runs is created. Reordering then is done on this vector.
|
||||
* For each run of text positions that were resolved to the same level,
|
||||
* only 8 bytes are stored: the first text position of the run and the visual
|
||||
* position behind the run after reordering.
|
||||
* One sign bit is used to hold the directionality of the run.
|
||||
* This is inefficient if there are many very short runs. If the average run
|
||||
* length is <2, then this uses more memory.
|
||||
*
|
||||
* In a further attempt to save memory, the levels array is never changed
|
||||
* after all the resolution rules (Xn, Wn, Nn, In).
|
||||
* Many methods have to consider the field trailingWSStart:
|
||||
* if it is less than length, then there is an implicit trailing run
|
||||
* at the paraLevel,
|
||||
* which is not reflected in the levels array.
|
||||
* This allows a line Bidi object to use the same levels array as
|
||||
* its paragraph parent object.
|
||||
*
|
||||
* When a Bidi object is created for a line of a paragraph, then the
|
||||
* paragraph's levels and dirProps arrays are reused by way of setting
|
||||
* a pointer into them, not by copying. This again saves memory and forbids to
|
||||
* change the now shared levels for (L1).
|
||||
*/
|
||||
|
||||
/* handle trailing WS (L1) -------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* setTrailingWSStart() sets the start index for a trailing
|
||||
* run of WS in the line. This is necessary because we do not modify
|
||||
* the paragraph's levels array that we just point into.
|
||||
* Using trailingWSStart is another form of performing (L1).
|
||||
*
|
||||
* To make subsequent operations easier, we also include the run
|
||||
* before the WS if it is at the paraLevel - we merge the two here.
|
||||
*
|
||||
* This method is called only from setLine(), so paraLevel is
|
||||
* set correctly for the line even when contextual multiple paragraphs.
|
||||
*/
|
||||
|
||||
static void setTrailingWSStart(BidiBase bidiBase)
|
||||
{
|
||||
byte[] dirProps = bidiBase.dirProps;
|
||||
byte[] levels = bidiBase.levels;
|
||||
int start = bidiBase.length;
|
||||
byte paraLevel = bidiBase.paraLevel;
|
||||
|
||||
/* If the line is terminated by a block separator, all preceding WS etc...
|
||||
are already set to paragraph level.
|
||||
Setting trailingWSStart to pBidi->length will avoid changing the
|
||||
level of B chars from 0 to paraLevel in getLevels when
|
||||
orderParagraphsLTR==TRUE
|
||||
*/
|
||||
if (BidiBase.NoContextRTL(dirProps[start - 1]) == BidiBase.B) {
|
||||
bidiBase.trailingWSStart = start; /* currently == bidiBase.length */
|
||||
return;
|
||||
}
|
||||
/* go backwards across all WS, BN, explicit codes */
|
||||
while (start > 0 &&
|
||||
(BidiBase.DirPropFlagNC(dirProps[start - 1]) & BidiBase.MASK_WS) != 0) {
|
||||
--start;
|
||||
}
|
||||
|
||||
/* if the WS run can be merged with the previous run then do so here */
|
||||
while (start > 0 && levels[start - 1] == paraLevel) {
|
||||
--start;
|
||||
}
|
||||
|
||||
bidiBase.trailingWSStart=start;
|
||||
}
|
||||
|
||||
public static Bidi setLine(Bidi bidi, BidiBase paraBidi,
|
||||
Bidi newBidi, BidiBase newBidiBase,
|
||||
int start, int limit) {
|
||||
int length;
|
||||
|
||||
BidiBase lineBidi = newBidiBase;
|
||||
|
||||
/* set the values in lineBidi from its paraBidi parent */
|
||||
/* class members are already initialized to 0 */
|
||||
// lineBidi.paraBidi = null; /* mark unfinished setLine */
|
||||
// lineBidi.flags = 0;
|
||||
// lineBidi.controlCount = 0;
|
||||
|
||||
length = lineBidi.length = lineBidi.originalLength =
|
||||
lineBidi.resultLength = limit - start;
|
||||
|
||||
lineBidi.text = new char[length];
|
||||
System.arraycopy(paraBidi.text, start, lineBidi.text, 0, length);
|
||||
lineBidi.paraLevel = paraBidi.GetParaLevelAt(start);
|
||||
lineBidi.paraCount = paraBidi.paraCount;
|
||||
lineBidi.runs = new BidiRun[0];
|
||||
if (paraBidi.controlCount > 0) {
|
||||
int j;
|
||||
for (j = start; j < limit; j++) {
|
||||
if (BidiBase.IsBidiControlChar(paraBidi.text[j])) {
|
||||
lineBidi.controlCount++;
|
||||
}
|
||||
}
|
||||
lineBidi.resultLength -= lineBidi.controlCount;
|
||||
}
|
||||
/* copy proper subset of DirProps */
|
||||
lineBidi.getDirPropsMemory(length);
|
||||
lineBidi.dirProps = lineBidi.dirPropsMemory;
|
||||
System.arraycopy(paraBidi.dirProps, start, lineBidi.dirProps, 0,
|
||||
length);
|
||||
/* copy proper subset of Levels */
|
||||
lineBidi.getLevelsMemory(length);
|
||||
lineBidi.levels = lineBidi.levelsMemory;
|
||||
System.arraycopy(paraBidi.levels, start, lineBidi.levels, 0,
|
||||
length);
|
||||
lineBidi.runCount = -1;
|
||||
|
||||
if (paraBidi.direction != BidiBase.MIXED) {
|
||||
/* the parent is already trivial */
|
||||
lineBidi.direction = paraBidi.direction;
|
||||
|
||||
/*
|
||||
* The parent's levels are all either
|
||||
* implicitly or explicitly ==paraLevel;
|
||||
* do the same here.
|
||||
*/
|
||||
if (paraBidi.trailingWSStart <= start) {
|
||||
lineBidi.trailingWSStart = 0;
|
||||
} else if (paraBidi.trailingWSStart < limit) {
|
||||
lineBidi.trailingWSStart = paraBidi.trailingWSStart - start;
|
||||
} else {
|
||||
lineBidi.trailingWSStart = length;
|
||||
}
|
||||
} else {
|
||||
byte[] levels = lineBidi.levels;
|
||||
int i, trailingWSStart;
|
||||
byte level;
|
||||
|
||||
setTrailingWSStart(lineBidi);
|
||||
trailingWSStart = lineBidi.trailingWSStart;
|
||||
|
||||
/* recalculate lineBidi.direction */
|
||||
if (trailingWSStart == 0) {
|
||||
/* all levels are at paraLevel */
|
||||
lineBidi.direction = (byte)(lineBidi.paraLevel & 1);
|
||||
} else {
|
||||
/* get the level of the first character */
|
||||
level = (byte)(levels[0] & 1);
|
||||
|
||||
/* if there is anything of a different level, then the line
|
||||
is mixed */
|
||||
if (trailingWSStart < length &&
|
||||
(lineBidi.paraLevel & 1) != level) {
|
||||
/* the trailing WS is at paraLevel, which differs from
|
||||
levels[0] */
|
||||
lineBidi.direction = BidiBase.MIXED;
|
||||
} else {
|
||||
/* see if levels[1..trailingWSStart-1] have the same
|
||||
direction as levels[0] and paraLevel */
|
||||
for (i = 1; ; i++) {
|
||||
if (i == trailingWSStart) {
|
||||
/* the direction values match those in level */
|
||||
lineBidi.direction = level;
|
||||
break;
|
||||
} else if ((levels[i] & 1) != level) {
|
||||
lineBidi.direction = BidiBase.MIXED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch(lineBidi.direction) {
|
||||
case Bidi.DIRECTION_LEFT_TO_RIGHT:
|
||||
/* make sure paraLevel is even */
|
||||
lineBidi.paraLevel = (byte)
|
||||
((lineBidi.paraLevel + 1) & ~1);
|
||||
|
||||
/* all levels are implicitly at paraLevel (important for
|
||||
getLevels()) */
|
||||
lineBidi.trailingWSStart = 0;
|
||||
break;
|
||||
case Bidi.DIRECTION_RIGHT_TO_LEFT:
|
||||
/* make sure paraLevel is odd */
|
||||
lineBidi.paraLevel |= 1;
|
||||
|
||||
/* all levels are implicitly at paraLevel (important for
|
||||
getLevels()) */
|
||||
lineBidi.trailingWSStart = 0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
newBidiBase.paraBidi = paraBidi; /* mark successful setLine */
|
||||
return newBidi;
|
||||
}
|
||||
|
||||
static byte getLevelAt(BidiBase bidiBase, int charIndex)
|
||||
{
|
||||
/* return paraLevel if in the trailing WS run, otherwise the real level */
|
||||
if (bidiBase.direction != BidiBase.MIXED || charIndex >= bidiBase.trailingWSStart) {
|
||||
return bidiBase.GetParaLevelAt(charIndex);
|
||||
} else {
|
||||
return bidiBase.levels[charIndex];
|
||||
}
|
||||
}
|
||||
|
||||
static byte[] getLevels(BidiBase bidiBase)
|
||||
{
|
||||
int start = bidiBase.trailingWSStart;
|
||||
int length = bidiBase.length;
|
||||
|
||||
if (start != length) {
|
||||
/* the current levels array does not reflect the WS run */
|
||||
/*
|
||||
* After the previous if(), we know that the levels array
|
||||
* has an implicit trailing WS run and therefore does not fully
|
||||
* reflect itself all the levels.
|
||||
* This must be a Bidi object for a line, and
|
||||
* we need to create a new levels array.
|
||||
*/
|
||||
/* bidiBase.paraLevel is ok even if contextual multiple paragraphs,
|
||||
since bidiBase is a line object */
|
||||
Arrays.fill(bidiBase.levels, start, length, bidiBase.paraLevel);
|
||||
|
||||
/* this new levels array is set for the line and reflects the WS run */
|
||||
bidiBase.trailingWSStart = length;
|
||||
}
|
||||
if (length < bidiBase.levels.length) {
|
||||
byte[] levels = new byte[length];
|
||||
System.arraycopy(bidiBase.levels, 0, levels, 0, length);
|
||||
return levels;
|
||||
}
|
||||
return bidiBase.levels;
|
||||
}
|
||||
|
||||
static BidiRun getLogicalRun(BidiBase bidiBase, int logicalPosition)
|
||||
{
|
||||
/* this is done based on runs rather than on levels since levels have
|
||||
a special interpretation when REORDER_RUNS_ONLY
|
||||
*/
|
||||
BidiRun newRun = new BidiRun(), iRun;
|
||||
getRuns(bidiBase);
|
||||
int runCount = bidiBase.runCount;
|
||||
int visualStart = 0, logicalLimit = 0;
|
||||
iRun = bidiBase.runs[0];
|
||||
|
||||
for (int i = 0; i < runCount; i++) {
|
||||
iRun = bidiBase.runs[i];
|
||||
logicalLimit = iRun.start + iRun.limit - visualStart;
|
||||
if ((logicalPosition >= iRun.start) &&
|
||||
(logicalPosition < logicalLimit)) {
|
||||
break;
|
||||
}
|
||||
visualStart = iRun.limit;
|
||||
}
|
||||
newRun.start = iRun.start;
|
||||
newRun.limit = logicalLimit;
|
||||
newRun.level = iRun.level;
|
||||
return newRun;
|
||||
}
|
||||
|
||||
/* in trivial cases there is only one trivial run; called by getRuns() */
|
||||
private static void getSingleRun(BidiBase bidiBase, byte level) {
|
||||
/* simple, single-run case */
|
||||
bidiBase.runs = bidiBase.simpleRuns;
|
||||
bidiBase.runCount = 1;
|
||||
|
||||
/* fill and reorder the single run */
|
||||
bidiBase.runs[0] = new BidiRun(0, bidiBase.length, level);
|
||||
}
|
||||
|
||||
/* reorder the runs array (L2) ---------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Reorder the same-level runs in the runs array.
|
||||
* Here, runCount>1 and maxLevel>=minLevel>=paraLevel.
|
||||
* All the visualStart fields=logical start before reordering.
|
||||
* The "odd" bits are not set yet.
|
||||
*
|
||||
* Reordering with this data structure lends itself to some handy shortcuts:
|
||||
*
|
||||
* Since each run is moved but not modified, and since at the initial maxLevel
|
||||
* each sequence of same-level runs consists of only one run each, we
|
||||
* don't need to do anything there and can predecrement maxLevel.
|
||||
* In many simple cases, the reordering is thus done entirely in the
|
||||
* index mapping.
|
||||
* Also, reordering occurs only down to the lowest odd level that occurs,
|
||||
* which is minLevel|1. However, if the lowest level itself is odd, then
|
||||
* in the last reordering the sequence of the runs at this level or higher
|
||||
* will be all runs, and we don't need the elaborate loop to search for them.
|
||||
* This is covered by ++minLevel instead of minLevel|=1 followed
|
||||
* by an extra reorder-all after the reorder-some loop.
|
||||
* About a trailing WS run:
|
||||
* Such a run would need special treatment because its level is not
|
||||
* reflected in levels[] if this is not a paragraph object.
|
||||
* Instead, all characters from trailingWSStart on are implicitly at
|
||||
* paraLevel.
|
||||
* However, for all maxLevel>paraLevel, this run will never be reordered
|
||||
* and does not need to be taken into account. maxLevel==paraLevel is only reordered
|
||||
* if minLevel==paraLevel is odd, which is done in the extra segment.
|
||||
* This means that for the main reordering loop we don't need to consider
|
||||
* this run and can --runCount. If it is later part of the all-runs
|
||||
* reordering, then runCount is adjusted accordingly.
|
||||
*/
|
||||
private static void reorderLine(BidiBase bidiBase, byte minLevel, byte maxLevel) {
|
||||
|
||||
/* nothing to do? */
|
||||
if (maxLevel<=(minLevel|1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
BidiRun[] runs;
|
||||
BidiRun tempRun;
|
||||
byte[] levels;
|
||||
int firstRun, endRun, limitRun, runCount;
|
||||
|
||||
/*
|
||||
* Reorder only down to the lowest odd level
|
||||
* and reorder at an odd minLevel in a separate, simpler loop.
|
||||
* See comments above for why minLevel is always incremented.
|
||||
*/
|
||||
++minLevel;
|
||||
|
||||
runs = bidiBase.runs;
|
||||
levels = bidiBase.levels;
|
||||
runCount = bidiBase.runCount;
|
||||
|
||||
/* do not include the WS run at paraLevel<=old minLevel except in the simple loop */
|
||||
if (bidiBase.trailingWSStart < bidiBase.length) {
|
||||
--runCount;
|
||||
}
|
||||
|
||||
while (--maxLevel >= minLevel) {
|
||||
firstRun = 0;
|
||||
|
||||
/* loop for all sequences of runs */
|
||||
for ( ; ; ) {
|
||||
/* look for a sequence of runs that are all at >=maxLevel */
|
||||
/* look for the first run of such a sequence */
|
||||
while (firstRun < runCount && levels[runs[firstRun].start] < maxLevel) {
|
||||
++firstRun;
|
||||
}
|
||||
if (firstRun >= runCount) {
|
||||
break; /* no more such runs */
|
||||
}
|
||||
|
||||
/* look for the limit run of such a sequence (the run behind it) */
|
||||
for (limitRun = firstRun; ++limitRun < runCount &&
|
||||
levels[runs[limitRun].start]>=maxLevel; ) {}
|
||||
|
||||
/* Swap the entire sequence of runs from firstRun to limitRun-1. */
|
||||
endRun = limitRun - 1;
|
||||
while (firstRun < endRun) {
|
||||
tempRun = runs[firstRun];
|
||||
runs[firstRun] = runs[endRun];
|
||||
runs[endRun] = tempRun;
|
||||
++firstRun;
|
||||
--endRun;
|
||||
}
|
||||
|
||||
if (limitRun == runCount) {
|
||||
break; /* no more such runs */
|
||||
} else {
|
||||
firstRun = limitRun + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* now do maxLevel==old minLevel (==odd!), see above */
|
||||
if ((minLevel & 1) == 0) {
|
||||
firstRun = 0;
|
||||
|
||||
/* include the trailing WS run in this complete reordering */
|
||||
if (bidiBase.trailingWSStart == bidiBase.length) {
|
||||
--runCount;
|
||||
}
|
||||
|
||||
/* Swap the entire sequence of all runs. (endRun==runCount) */
|
||||
while (firstRun < runCount) {
|
||||
tempRun = runs[firstRun];
|
||||
runs[firstRun] = runs[runCount];
|
||||
runs[runCount] = tempRun;
|
||||
++firstRun;
|
||||
--runCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* compute the runs array --------------------------------------------------- */
|
||||
|
||||
static int getRunFromLogicalIndex(BidiBase bidiBase, int logicalIndex) {
|
||||
BidiRun[] runs = bidiBase.runs;
|
||||
int runCount = bidiBase.runCount, visualStart = 0, i, length, logicalStart;
|
||||
|
||||
for (i = 0; i < runCount; i++) {
|
||||
length = runs[i].limit - visualStart;
|
||||
logicalStart = runs[i].start;
|
||||
if ((logicalIndex >= logicalStart) && (logicalIndex < (logicalStart+length))) {
|
||||
return i;
|
||||
}
|
||||
visualStart += length;
|
||||
}
|
||||
/* we should never get here */
|
||||
throw new IllegalStateException("Internal ICU error in getRunFromLogicalIndex");
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute the runs array from the levels array.
|
||||
* After getRuns() returns true, runCount is guaranteed to be >0
|
||||
* and the runs are reordered.
|
||||
* Odd-level runs have visualStart on their visual right edge and
|
||||
* they progress visually to the left.
|
||||
* If option OPTION_INSERT_MARKS is set, insertRemove will contain the
|
||||
* sum of appropriate LRM/RLM_BEFORE/AFTER flags.
|
||||
* If option OPTION_REMOVE_CONTROLS is set, insertRemove will contain the
|
||||
* negative number of BiDi control characters within this run.
|
||||
*/
|
||||
static void getRuns(BidiBase bidiBase) {
|
||||
/*
|
||||
* This method returns immediately if the runs are already set. This
|
||||
* includes the case of length==0 (handled in setPara)..
|
||||
*/
|
||||
if (bidiBase.runCount >= 0) {
|
||||
return;
|
||||
}
|
||||
if (bidiBase.direction != BidiBase.MIXED) {
|
||||
/* simple, single-run case - this covers length==0 */
|
||||
/* bidiBase.paraLevel is ok even for contextual multiple paragraphs */
|
||||
getSingleRun(bidiBase, bidiBase.paraLevel);
|
||||
} else /* BidiBase.MIXED, length>0 */ {
|
||||
/* mixed directionality */
|
||||
int length = bidiBase.length, limit;
|
||||
byte[] levels = bidiBase.levels;
|
||||
int i, runCount;
|
||||
byte level = BidiBase.INTERNAL_LEVEL_DEFAULT_LTR; /* initialize with no valid level */
|
||||
/*
|
||||
* If there are WS characters at the end of the line
|
||||
* and the run preceding them has a level different from
|
||||
* paraLevel, then they will form their own run at paraLevel (L1).
|
||||
* Count them separately.
|
||||
* We need some special treatment for this in order to not
|
||||
* modify the levels array which a line Bidi object shares
|
||||
* with its paragraph parent and its other line siblings.
|
||||
* In other words, for the trailing WS, it may be
|
||||
* levels[]!=paraLevel but we have to treat it like it were so.
|
||||
*/
|
||||
limit = bidiBase.trailingWSStart;
|
||||
/* count the runs, there is at least one non-WS run, and limit>0 */
|
||||
runCount = 0;
|
||||
for (i = 0; i < limit; ++i) {
|
||||
/* increment runCount at the start of each run */
|
||||
if (levels[i] != level) {
|
||||
++runCount;
|
||||
level = levels[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't need to see if the last run can be merged with a trailing
|
||||
* WS run because setTrailingWSStart() would have done that.
|
||||
*/
|
||||
if (runCount == 1 && limit == length) {
|
||||
/* There is only one non-WS run and no trailing WS-run. */
|
||||
getSingleRun(bidiBase, levels[0]);
|
||||
} else /* runCount>1 || limit<length */ {
|
||||
/* allocate and set the runs */
|
||||
BidiRun[] runs;
|
||||
int runIndex, start;
|
||||
byte minLevel = BidiBase.MAX_EXPLICIT_LEVEL + 1;
|
||||
byte maxLevel=0;
|
||||
|
||||
/* now, count a (non-mergeable) WS run */
|
||||
if (limit < length) {
|
||||
++runCount;
|
||||
}
|
||||
|
||||
/* runCount > 1 */
|
||||
bidiBase.getRunsMemory(runCount);
|
||||
runs = bidiBase.runsMemory;
|
||||
|
||||
/* set the runs */
|
||||
/* FOOD FOR THOUGHT: this could be optimized, e.g.:
|
||||
* 464->444, 484->444, 575->555, 595->555
|
||||
* However, that would take longer. Check also how it would
|
||||
* interact with BiDi control removal and inserting Marks.
|
||||
*/
|
||||
runIndex = 0;
|
||||
|
||||
/* search for the run limits and initialize visualLimit values with the run lengths */
|
||||
i = 0;
|
||||
do {
|
||||
/* prepare this run */
|
||||
start = i;
|
||||
level = levels[i];
|
||||
if (level < minLevel) {
|
||||
minLevel = level;
|
||||
}
|
||||
if (level > maxLevel) {
|
||||
maxLevel = level;
|
||||
}
|
||||
|
||||
/* look for the run limit */
|
||||
while (++i < limit && levels[i] == level) {}
|
||||
|
||||
/* i is another run limit */
|
||||
runs[runIndex] = new BidiRun(start, i - start, level);
|
||||
++runIndex;
|
||||
} while (i < limit);
|
||||
|
||||
if (limit < length) {
|
||||
/* there is a separate WS run */
|
||||
runs[runIndex] = new BidiRun(limit, length - limit, bidiBase.paraLevel);
|
||||
/* For the trailing WS run, bidiBase.paraLevel is ok even
|
||||
if contextual multiple paragraphs. */
|
||||
if (bidiBase.paraLevel < minLevel) {
|
||||
minLevel = bidiBase.paraLevel;
|
||||
}
|
||||
}
|
||||
|
||||
/* set the object fields */
|
||||
bidiBase.runs = runs;
|
||||
bidiBase.runCount = runCount;
|
||||
|
||||
reorderLine(bidiBase, minLevel, maxLevel);
|
||||
|
||||
/* now add the direction flags and adjust the visualLimit's to be just that */
|
||||
/* this loop will also handle the trailing WS run */
|
||||
limit = 0;
|
||||
for (i = 0; i < runCount; ++i) {
|
||||
runs[i].level = levels[runs[i].start];
|
||||
limit = (runs[i].limit += limit);
|
||||
}
|
||||
|
||||
/* Set the embedding level for the trailing WS run. */
|
||||
/* For a RTL paragraph, it will be the *first* run in visual order. */
|
||||
/* For the trailing WS run, bidiBase.paraLevel is ok even if
|
||||
contextual multiple paragraphs. */
|
||||
if (runIndex < runCount) {
|
||||
int trailingRun = ((bidiBase.paraLevel & 1) != 0)? 0 : runIndex;
|
||||
runs[trailingRun].level = bidiBase.paraLevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* handle insert LRM/RLM BEFORE/AFTER run */
|
||||
if (bidiBase.insertPoints.size > 0) {
|
||||
BidiBase.Point point;
|
||||
int runIndex, ip;
|
||||
for (ip = 0; ip < bidiBase.insertPoints.size; ip++) {
|
||||
point = bidiBase.insertPoints.points[ip];
|
||||
runIndex = getRunFromLogicalIndex(bidiBase, point.pos);
|
||||
bidiBase.runs[runIndex].insertRemove |= point.flag;
|
||||
}
|
||||
}
|
||||
|
||||
/* handle remove BiDi control characters */
|
||||
if (bidiBase.controlCount > 0) {
|
||||
int runIndex, ic;
|
||||
char c;
|
||||
for (ic = 0; ic < bidiBase.length; ic++) {
|
||||
c = bidiBase.text[ic];
|
||||
if (BidiBase.IsBidiControlChar(c)) {
|
||||
runIndex = getRunFromLogicalIndex(bidiBase, ic);
|
||||
bidiBase.runs[runIndex].insertRemove--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int[] prepareReorder(byte[] levels, byte[] pMinLevel, byte[] pMaxLevel)
|
||||
{
|
||||
int start;
|
||||
byte level, minLevel, maxLevel;
|
||||
|
||||
if (levels == null || levels.length <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/* determine minLevel and maxLevel */
|
||||
minLevel = BidiBase.MAX_EXPLICIT_LEVEL + 1;
|
||||
maxLevel = 0;
|
||||
for (start = levels.length; start>0; ) {
|
||||
level = levels[--start];
|
||||
if (level > BidiBase.MAX_EXPLICIT_LEVEL + 1) {
|
||||
return null;
|
||||
}
|
||||
if (level < minLevel) {
|
||||
minLevel = level;
|
||||
}
|
||||
if (level > maxLevel) {
|
||||
maxLevel = level;
|
||||
}
|
||||
}
|
||||
pMinLevel[0] = minLevel;
|
||||
pMaxLevel[0] = maxLevel;
|
||||
|
||||
/* initialize the index map */
|
||||
int[] indexMap = new int[levels.length];
|
||||
for (start = levels.length; start > 0; ) {
|
||||
--start;
|
||||
indexMap[start] = start;
|
||||
}
|
||||
|
||||
return indexMap;
|
||||
}
|
||||
|
||||
static int[] reorderVisual(byte[] levels)
|
||||
{
|
||||
byte[] aMinLevel = new byte[1];
|
||||
byte[] aMaxLevel = new byte[1];
|
||||
int start, end, limit, temp;
|
||||
byte minLevel, maxLevel;
|
||||
|
||||
int[] indexMap = prepareReorder(levels, aMinLevel, aMaxLevel);
|
||||
if (indexMap == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
minLevel = aMinLevel[0];
|
||||
maxLevel = aMaxLevel[0];
|
||||
|
||||
/* nothing to do? */
|
||||
if (minLevel == maxLevel && (minLevel & 1) == 0) {
|
||||
return indexMap;
|
||||
}
|
||||
|
||||
/* reorder only down to the lowest odd level */
|
||||
minLevel |= 1;
|
||||
|
||||
/* loop maxLevel..minLevel */
|
||||
do {
|
||||
start = 0;
|
||||
|
||||
/* loop for all sequences of levels to reorder at the current maxLevel */
|
||||
for ( ; ; ) {
|
||||
/* look for a sequence of levels that are all at >=maxLevel */
|
||||
/* look for the first index of such a sequence */
|
||||
while (start < levels.length && levels[start] < maxLevel) {
|
||||
++start;
|
||||
}
|
||||
if (start >= levels.length) {
|
||||
break; /* no more such runs */
|
||||
}
|
||||
|
||||
/* look for the limit of such a sequence (the index behind it) */
|
||||
for (limit = start; ++limit < levels.length && levels[limit] >= maxLevel; ) {}
|
||||
|
||||
/*
|
||||
* Swap the entire interval of indexes from start to limit-1.
|
||||
* We don't need to swap the levels for the purpose of this
|
||||
* algorithm: the sequence of levels that we look at does not
|
||||
* move anyway.
|
||||
*/
|
||||
end = limit - 1;
|
||||
while (start < end) {
|
||||
temp = indexMap[start];
|
||||
indexMap[start] = indexMap[end];
|
||||
indexMap[end] = temp;
|
||||
|
||||
++start;
|
||||
--end;
|
||||
}
|
||||
|
||||
if (limit == levels.length) {
|
||||
break; /* no more such sequences */
|
||||
} else {
|
||||
start = limit + 1;
|
||||
}
|
||||
}
|
||||
} while (--maxLevel >= minLevel);
|
||||
|
||||
return indexMap;
|
||||
}
|
||||
|
||||
static int[] getVisualMap(BidiBase bidiBase)
|
||||
{
|
||||
/* fill a visual-to-logical index map using the runs[] */
|
||||
BidiRun[] runs = bidiBase.runs;
|
||||
int logicalStart, visualStart, visualLimit;
|
||||
int allocLength = bidiBase.length > bidiBase.resultLength ? bidiBase.length
|
||||
: bidiBase.resultLength;
|
||||
int[] indexMap = new int[allocLength];
|
||||
|
||||
visualStart = 0;
|
||||
int idx = 0;
|
||||
for (int j = 0; j < bidiBase.runCount; ++j) {
|
||||
logicalStart = runs[j].start;
|
||||
visualLimit = runs[j].limit;
|
||||
if (runs[j].isEvenRun()) {
|
||||
do { /* LTR */
|
||||
indexMap[idx++] = logicalStart++;
|
||||
} while (++visualStart < visualLimit);
|
||||
} else {
|
||||
logicalStart += visualLimit - visualStart; /* logicalLimit */
|
||||
do { /* RTL */
|
||||
indexMap[idx++] = --logicalStart;
|
||||
} while (++visualStart < visualLimit);
|
||||
}
|
||||
/* visualStart==visualLimit; */
|
||||
}
|
||||
|
||||
if (bidiBase.insertPoints.size > 0) {
|
||||
int markFound = 0, runCount = bidiBase.runCount;
|
||||
int insertRemove, i, j, k;
|
||||
runs = bidiBase.runs;
|
||||
/* count all inserted marks */
|
||||
for (i = 0; i < runCount; i++) {
|
||||
insertRemove = runs[i].insertRemove;
|
||||
if ((insertRemove & (BidiBase.LRM_BEFORE|BidiBase.RLM_BEFORE)) > 0) {
|
||||
markFound++;
|
||||
}
|
||||
if ((insertRemove & (BidiBase.LRM_AFTER|BidiBase.RLM_AFTER)) > 0) {
|
||||
markFound++;
|
||||
}
|
||||
}
|
||||
/* move back indexes by number of preceding marks */
|
||||
k = bidiBase.resultLength;
|
||||
for (i = runCount - 1; i >= 0 && markFound > 0; i--) {
|
||||
insertRemove = runs[i].insertRemove;
|
||||
if ((insertRemove & (BidiBase.LRM_AFTER|BidiBase.RLM_AFTER)) > 0) {
|
||||
indexMap[--k] = BidiBase.MAP_NOWHERE;
|
||||
markFound--;
|
||||
}
|
||||
visualStart = i > 0 ? runs[i-1].limit : 0;
|
||||
for (j = runs[i].limit - 1; j >= visualStart && markFound > 0; j--) {
|
||||
indexMap[--k] = indexMap[j];
|
||||
}
|
||||
if ((insertRemove & (BidiBase.LRM_BEFORE|BidiBase.RLM_BEFORE)) > 0) {
|
||||
indexMap[--k] = BidiBase.MAP_NOWHERE;
|
||||
markFound--;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (bidiBase.controlCount > 0) {
|
||||
int runCount = bidiBase.runCount, logicalEnd;
|
||||
int insertRemove, length, i, j, k, m;
|
||||
char uchar;
|
||||
boolean evenRun;
|
||||
runs = bidiBase.runs;
|
||||
visualStart = 0;
|
||||
/* move forward indexes by number of preceding controls */
|
||||
k = 0;
|
||||
for (i = 0; i < runCount; i++, visualStart += length) {
|
||||
length = runs[i].limit - visualStart;
|
||||
insertRemove = runs[i].insertRemove;
|
||||
/* if no control found yet, nothing to do in this run */
|
||||
if ((insertRemove == 0) && (k == visualStart)) {
|
||||
k += length;
|
||||
continue;
|
||||
}
|
||||
/* if no control in this run */
|
||||
if (insertRemove == 0) {
|
||||
visualLimit = runs[i].limit;
|
||||
for (j = visualStart; j < visualLimit; j++) {
|
||||
indexMap[k++] = indexMap[j];
|
||||
}
|
||||
continue;
|
||||
}
|
||||
logicalStart = runs[i].start;
|
||||
evenRun = runs[i].isEvenRun();
|
||||
logicalEnd = logicalStart + length - 1;
|
||||
for (j = 0; j < length; j++) {
|
||||
m = evenRun ? logicalStart + j : logicalEnd - j;
|
||||
uchar = bidiBase.text[m];
|
||||
if (!BidiBase.IsBidiControlChar(uchar)) {
|
||||
indexMap[k++] = m;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (allocLength == bidiBase.resultLength) {
|
||||
return indexMap;
|
||||
}
|
||||
int[] newMap = new int[bidiBase.resultLength];
|
||||
System.arraycopy(indexMap, 0, newMap, 0, bidiBase.resultLength);
|
||||
return newMap;
|
||||
}
|
||||
|
||||
}
|
124
jdk/src/share/classes/sun/text/bidi/BidiRun.java
Normal file
124
jdk/src/share/classes/sun/text/bidi/BidiRun.java
Normal file
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Portions Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
/*
|
||||
*******************************************************************************
|
||||
* (C) Copyright IBM Corp. and others, 1996-2009 - All Rights Reserved *
|
||||
* *
|
||||
* The original version of this source code and documentation is copyrighted *
|
||||
* and owned by IBM, These materials are provided under terms of a License *
|
||||
* Agreement between IBM and Sun. This technology is protected by multiple *
|
||||
* US and International patents. This notice and attribution to IBM may not *
|
||||
* to removed. *
|
||||
*******************************************************************************
|
||||
*/
|
||||
/* Written by Simon Montagu, Matitiahu Allouche
|
||||
* (ported from C code written by Markus W. Scherer)
|
||||
*/
|
||||
|
||||
package sun.text.bidi;
|
||||
|
||||
/**
|
||||
* A BidiRun represents a sequence of characters at the same embedding level.
|
||||
* The Bidi algorithm decomposes a piece of text into sequences of characters
|
||||
* at the same embedding level, each such sequence is called a <quote>run</quote>.
|
||||
*
|
||||
* <p>A BidiRun represents such a run by storing its essential properties,
|
||||
* but does not duplicate the characters which form the run.
|
||||
*
|
||||
* <p>The "limit" of the run is the position just after the
|
||||
* last character, i.e., one more than that position.
|
||||
*
|
||||
* <p>This class has no public constructor, and its members cannot be
|
||||
* modified by users.
|
||||
*
|
||||
* @see com.ibm.icu.text.Bidi
|
||||
*/
|
||||
public class BidiRun {
|
||||
|
||||
int start; /* first logical position of the run */
|
||||
int limit; /* last visual position of the run +1 */
|
||||
int insertRemove; /* if >0, flags for inserting LRM/RLM before/after run,
|
||||
if <0, count of bidi controls within run */
|
||||
byte level;
|
||||
|
||||
/*
|
||||
* Default constructor
|
||||
*
|
||||
* Note that members start and limit of a run instance have different
|
||||
* meanings depending whether the run is part of the runs array of a Bidi
|
||||
* object, or if it is a reference returned by getVisualRun() or
|
||||
* getLogicalRun().
|
||||
* For a member of the runs array of a Bidi object,
|
||||
* - start is the first logical position of the run in the source text.
|
||||
* - limit is one after the last visual position of the run.
|
||||
* For a reference returned by getLogicalRun() or getVisualRun(),
|
||||
* - start is the first logical position of the run in the source text.
|
||||
* - limit is one after the last logical position of the run.
|
||||
*/
|
||||
BidiRun()
|
||||
{
|
||||
this(0, 0, (byte)0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
BidiRun(int start, int limit, byte embeddingLevel)
|
||||
{
|
||||
this.start = start;
|
||||
this.limit = limit;
|
||||
this.level = embeddingLevel;
|
||||
}
|
||||
|
||||
/*
|
||||
* Copy the content of a BidiRun instance
|
||||
*/
|
||||
void copyFrom(BidiRun run)
|
||||
{
|
||||
this.start = run.start;
|
||||
this.limit = run.limit;
|
||||
this.level = run.level;
|
||||
this.insertRemove = run.insertRemove;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get level of run
|
||||
*/
|
||||
public byte getEmbeddingLevel()
|
||||
{
|
||||
return level;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if run level is even
|
||||
* @return true if the embedding level of this run is even, i.e. it is a
|
||||
* left-to-right run.
|
||||
*/
|
||||
boolean isEvenRun()
|
||||
{
|
||||
return (level & 1) == 0;
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Portions Copyright 2005-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Portions Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -355,7 +355,7 @@ public final class UCharacter
|
||||
private static int getEuropeanDigit(int ch) {
|
||||
if ((ch > 0x7a && ch < 0xff21)
|
||||
|| ch < 0x41 || (ch > 0x5a && ch < 0x61)
|
||||
|| ch > 0xff5a || (ch > 0xff31 && ch < 0xff41)) {
|
||||
|| ch > 0xff5a || (ch > 0xff3a && ch < 0xff41)) {
|
||||
return -1;
|
||||
}
|
||||
if (ch <= 0x7a) {
|
||||
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Portions Copyright 2000 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corp. 1998, 1999 - All Rights Reserved
|
||||
*
|
||||
* The original version of this source code and documentation is
|
||||
* copyrighted and owned by IBM. These materials are provided
|
||||
* under terms of a License Agreement between IBM and Sun.
|
||||
* This technology is protected by multiple US and International
|
||||
* patents. This notice and attribution to IBM may not be removed.
|
||||
*/
|
||||
|
||||
/*
|
||||
* File CMEMORY.H
|
||||
*
|
||||
* Contains stdlib.h/string.h memory functions
|
||||
*
|
||||
* @author Bertrand A. Damiba
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 6/20/98 Bertrand Created.
|
||||
* 05/03/99 stephen Changed from functions to macros.
|
||||
*
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef CMEMORY_H
|
||||
#define CMEMORY_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define icu_malloc(size) malloc(size)
|
||||
#define icu_realloc(buffer, size) realloc(buffer, size)
|
||||
#define icu_free(buffer) free(buffer)
|
||||
#define icu_memcpy(dst, src, size) memcpy(dst, src, size)
|
||||
#define icu_memmove(dst, src, size) memmove(dst, src, size)
|
||||
#define icu_memset(buffer, mark, size) memset(buffer, mark, size)
|
||||
#define icu_memcmp(buffer1, buffer2, size) memcmp(buffer1, buffer2,size)
|
||||
|
||||
#endif
|
@ -1,167 +0,0 @@
|
||||
/*
|
||||
* Portions Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corp. 2000 - 2003 - All Rights Reserved
|
||||
*
|
||||
* The original version of this source code and documentation is
|
||||
* copyrighted and owned by IBM. These materials are provided
|
||||
* under terms of a License Agreement between IBM and Sun.
|
||||
* This technology is protected by multiple US and International
|
||||
* patents. This notice and attribution to IBM may not be removed.
|
||||
*/
|
||||
|
||||
// jni interface to native bidi from java
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "jbidi.h"
|
||||
|
||||
#define U_COMMON_IMPLEMENTATION
|
||||
#include "ubidi.h"
|
||||
#include "ubidiimp.h"
|
||||
#include "uchardir.h"
|
||||
|
||||
static jclass g_bidi_class = 0;
|
||||
static jmethodID g_bidi_reset = 0;
|
||||
|
||||
static void resetBidi(JNIEnv *env, jclass cls, jobject bidi, jint dir, jint level, jint len, jintArray runs, jintArray cws) {
|
||||
if (!g_bidi_class) {
|
||||
g_bidi_class = (*env)->NewGlobalRef(env, cls);
|
||||
g_bidi_reset = (*env)->GetMethodID(env, g_bidi_class, "reset", "(III[I[I)V");
|
||||
}
|
||||
|
||||
(*env)->CallVoidMethod(env, bidi, g_bidi_reset, dir, level, len, runs, cws);
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL Java_java_text_Bidi_nativeGetDirectionCode
|
||||
(JNIEnv *env, jclass cls, jint cp)
|
||||
{
|
||||
return (jint)u_getDirection((uint32_t)cp);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_java_text_Bidi_nativeBidiChars
|
||||
(JNIEnv *env, jclass cls, jobject jbidi, jcharArray text, jint tStart, jbyteArray embs, jint eStart, jint length, jint dir)
|
||||
{
|
||||
UErrorCode err = U_ZERO_ERROR;
|
||||
UBiDi* bidi = ubidi_openSized(length, length, &err);
|
||||
if (!U_FAILURE(err)) {
|
||||
jchar *cText = (jchar*)(*env)->GetPrimitiveArrayCritical(env, text, NULL);
|
||||
if (cText) {
|
||||
UBiDiLevel baseLevel = (UBiDiLevel)dir;
|
||||
jbyte *cEmbs = 0;
|
||||
uint8_t *cEmbsAdj = 0;
|
||||
if (embs != NULL) {
|
||||
cEmbs = (jbyte*)(*env)->GetPrimitiveArrayCritical(env, embs, NULL);
|
||||
if (cEmbs) {
|
||||
cEmbsAdj = (uint8_t*)(cEmbs + eStart);
|
||||
}
|
||||
}
|
||||
ubidi_setPara(bidi, cText + tStart, length, baseLevel, cEmbsAdj, &err);
|
||||
if (cEmbs) {
|
||||
(*env)->ReleasePrimitiveArrayCritical(env, embs, cEmbs, JNI_ABORT);
|
||||
}
|
||||
|
||||
(*env)->ReleasePrimitiveArrayCritical(env, text, cText, JNI_ABORT);
|
||||
|
||||
if (!U_FAILURE(err)) {
|
||||
jint resDir = (jint)ubidi_getDirection(bidi);
|
||||
jint resLevel = (jint)ubidi_getParaLevel(bidi);
|
||||
jint resRunCount = 0;
|
||||
jintArray resRuns = 0;
|
||||
jintArray resCWS = 0;
|
||||
if (resDir == UBIDI_MIXED) {
|
||||
resRunCount = (jint)ubidi_countRuns(bidi, &err);
|
||||
if (!U_FAILURE(err)) {
|
||||
if (resRunCount) {
|
||||
jint* cResRuns = (jint*)calloc(resRunCount * 2, sizeof(jint));
|
||||
if (cResRuns) {
|
||||
int32_t limit = 0;
|
||||
UBiDiLevel level;
|
||||
jint *p = cResRuns;
|
||||
while (limit < length) {
|
||||
ubidi_getLogicalRun(bidi, limit, &limit, &level);
|
||||
*p++ = (jint)limit;
|
||||
*p++ = (jint)level;
|
||||
}
|
||||
|
||||
{
|
||||
const DirProp *dp = bidi->dirProps;
|
||||
jint ccws = 0;
|
||||
jint n = 0;
|
||||
p = cResRuns;
|
||||
do {
|
||||
if ((*(p+1) ^ resLevel) & 0x1) {
|
||||
while (n < *p) {
|
||||
if (dp[n++] == WS) {
|
||||
++ccws;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
n = *p;
|
||||
}
|
||||
p += 2;
|
||||
} while (n < length);
|
||||
|
||||
resCWS = (*env)->NewIntArray(env, ccws);
|
||||
if (resCWS) {
|
||||
jint* cResCWS = (jint*)(*env)->GetPrimitiveArrayCritical(env, resCWS, NULL);
|
||||
if (cResCWS) {
|
||||
jint ccws = 0;
|
||||
jint n = 0;
|
||||
p = cResRuns;
|
||||
do {
|
||||
if ((*(p+1) ^ resLevel) & 0x1) {
|
||||
while (n < *p) {
|
||||
if (dp[n] == WS) {
|
||||
cResCWS[ccws++] = n;
|
||||
}
|
||||
++n;
|
||||
}
|
||||
} else {
|
||||
n = *p;
|
||||
}
|
||||
p += 2;
|
||||
} while (n < length);
|
||||
(*env)->ReleasePrimitiveArrayCritical(env, resCWS, cResCWS, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resRuns = (*env)->NewIntArray(env, resRunCount * 2);
|
||||
if (resRuns) {
|
||||
(*env)->SetIntArrayRegion(env, resRuns, 0, resRunCount * 2, cResRuns);
|
||||
}
|
||||
free(cResRuns);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resetBidi(env, cls, jbidi, resDir, resLevel, length, resRuns, resCWS);
|
||||
}
|
||||
}
|
||||
ubidi_close(bidi);
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Portions Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corp. 2000 - 2003 - All Rights Reserved
|
||||
*
|
||||
* The original version of this source code and documentation is
|
||||
* copyrighted and owned by IBM. These materials are provided
|
||||
* under terms of a License Agreement between IBM and Sun.
|
||||
* This technology is protected by multiple US and International
|
||||
* patents. This notice and attribution to IBM may not be removed.
|
||||
*/
|
||||
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class Bidi */
|
||||
|
||||
#ifndef _Included_Bidi
|
||||
#define _Included_Bidi
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#undef Bidi_DIR_LTR
|
||||
#define Bidi_DIR_LTR 0L
|
||||
#undef Bidi_DIR_RTL
|
||||
#define Bidi_DIR_RTL 1L
|
||||
#undef Bidi_DIR_DEFAULT_LTR
|
||||
#define Bidi_DIR_DEFAULT_LTR -2L
|
||||
#undef Bidi_DIR_DEFAULT_RTL
|
||||
#define Bidi_DIR_DEFAULT_RTL -1L
|
||||
#undef Bidi_DIR_MIXED
|
||||
#define Bidi_DIR_MIXED -1L
|
||||
#undef Bidi_DIR_MIN
|
||||
#define Bidi_DIR_MIN -2L
|
||||
#undef Bidi_DIR_MAX
|
||||
#define Bidi_DIR_MAX 1L
|
||||
|
||||
JNIEXPORT jint JNICALL Java_java_text_Bidi_nativeGetDirectionCode
|
||||
(JNIEnv *, jclass, jint);
|
||||
|
||||
JNIEXPORT void JNICALL Java_java_text_Bidi_nativeBidiChars
|
||||
(JNIEnv *, jclass, jobject, jcharArray, jint, jbyteArray, jint, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
@ -1,913 +0,0 @@
|
||||
/*
|
||||
* Portions Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corp. 1999-2003 - All Rights Reserved
|
||||
*
|
||||
* The original version of this source code and documentation is
|
||||
* copyrighted and owned by IBM. These materials are provided
|
||||
* under terms of a License Agreement between IBM and Sun.
|
||||
* This technology is protected by multiple US and International
|
||||
* patents. This notice and attribution to IBM may not be removed.
|
||||
*/
|
||||
|
||||
/*
|
||||
* file name: ubidi.h
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 1999jul27
|
||||
* created by: Markus W. Scherer
|
||||
*/
|
||||
|
||||
#ifndef UBIDI_H
|
||||
#define UBIDI_H
|
||||
|
||||
#include "utypes.h"
|
||||
#include "uchardir.h"
|
||||
|
||||
/*
|
||||
* javadoc-style comments are intended to be transformed into HTML
|
||||
* using DOC++ - see
|
||||
* http://www.zib.de/Visual/software/doc++/index.html .
|
||||
*
|
||||
* The HTML documentation is created with
|
||||
* doc++ -H ubidi.h
|
||||
*
|
||||
* The following #define trick allows us to do it all in one file
|
||||
* and still be able to compile it.
|
||||
*/
|
||||
#define DOCXX_TAG
|
||||
#define BIDI_SAMPLE_CODE
|
||||
|
||||
/**
|
||||
* @name BiDi algorithm for ICU
|
||||
*
|
||||
* <h2>BiDi algorithm for ICU</h2>
|
||||
*
|
||||
* This is an implementation of the Unicode Bidirectional algorithm.
|
||||
* The algorithm is defined in the
|
||||
* <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Technical Report 9</a>,
|
||||
* version 5, also described in The Unicode Standard, Version 3.0 .<p>
|
||||
*
|
||||
* <h3>General remarks about the API:</h3>
|
||||
*
|
||||
* In functions with an error code parameter,
|
||||
* the <code>pErrorCode</code> pointer must be valid
|
||||
* and the value that it points to must not indicate a failure before
|
||||
* the function call. Otherwise, the function returns immediately.
|
||||
* After the function call, the value indicates success or failure.<p>
|
||||
*
|
||||
* The <quote>limit</quote> of a sequence of characters is the position just after their
|
||||
* last character, i.e., one more than that position.<p>
|
||||
*
|
||||
* Some of the API functions provide access to <quote>runs</quote>.
|
||||
* Such a <quote>run</quote> is defined as a sequence of characters
|
||||
* that are at the same embedding level
|
||||
* after performing the BiDi algorithm.<p>
|
||||
*
|
||||
* @author Markus W. Scherer
|
||||
*/
|
||||
DOCXX_TAG
|
||||
/*@{*/
|
||||
|
||||
/**
|
||||
* UBiDiLevel is the type of the level values in this
|
||||
* BiDi implementation.
|
||||
* It holds an embedding level and indicates the visual direction
|
||||
* by its bit 0 (even/odd value).<p>
|
||||
*
|
||||
* It can also hold non-level values for the
|
||||
* <code>paraLevel</code> and <code>embeddingLevels</code>
|
||||
* arguments of <code>ubidi_setPara()</code>; there:
|
||||
* <ul>
|
||||
* <li>bit 7 of an <code>embeddingLevels[]</code>
|
||||
* value indicates whether the using application is
|
||||
* specifying the level of a character to <i>override</i> whatever the
|
||||
* BiDi implementation would resolve it to.</li>
|
||||
* <li><code>paraLevel</code> can be set to the
|
||||
* pesudo-level values <code>UBIDI_DEFAULT_LTR</code>
|
||||
* and <code>UBIDI_DEFAULT_RTL</code>.</li>
|
||||
*
|
||||
* @see ubidi_setPara
|
||||
*
|
||||
* <p>The related constants are not real, valid level values.
|
||||
* <code>UBIDI_DEFAULT_XXX</code> can be used to specify
|
||||
* a default for the paragraph level for
|
||||
* when the <code>ubidi_setPara()</code> function
|
||||
* shall determine it but there is no
|
||||
* strongly typed character in the input.<p>
|
||||
*
|
||||
* Note that the value for <code>UBIDI_DEFAULT_LTR</code> is even
|
||||
* and the one for <code>UBIDI_DEFAULT_RTL</code> is odd,
|
||||
* just like with normal LTR and RTL level values -
|
||||
* these special values are designed that way. Also, the implementation
|
||||
* assumes that UBIDI_MAX_EXPLICIT_LEVEL is odd.
|
||||
*
|
||||
* @see UBIDI_DEFAULT_LTR
|
||||
* @see UBIDI_DEFAULT_RTL
|
||||
* @see UBIDI_LEVEL_OVERRIDE
|
||||
* @see UBIDI_MAX_EXPLICIT_LEVEL
|
||||
*/
|
||||
typedef uint8_t UBiDiLevel;
|
||||
|
||||
/** @memo If there is no strong character, then set the paragraph level to 0 (left-to-right). */
|
||||
#define UBIDI_DEFAULT_LTR 0xfe
|
||||
|
||||
/** @memo If there is no strong character, then set the paragraph level to 1 (right-to-left). */
|
||||
#define UBIDI_DEFAULT_RTL 0xff
|
||||
|
||||
/**
|
||||
* @memo Maximum explicit embedding level
|
||||
* (The maximum resolved level can be up to <code>UBIDI_MAX_EXPLICIT_LEVEL+1</code>).
|
||||
*/
|
||||
#define UBIDI_MAX_EXPLICIT_LEVEL 61
|
||||
|
||||
/** @memo Bit flag for level input: overrides directional properties. */
|
||||
#define UBIDI_LEVEL_OVERRIDE 0x80
|
||||
|
||||
/**
|
||||
* @memo <code>UBiDiDirection</code> values indicate the text direction.
|
||||
*/
|
||||
enum UBiDiDirection {
|
||||
/** @memo All left-to-right text. This is a 0 value. */
|
||||
UBIDI_LTR,
|
||||
/** @memo All right-to-left text. This is a 1 value. */
|
||||
UBIDI_RTL,
|
||||
/** @memo Mixed-directional text. */
|
||||
UBIDI_MIXED
|
||||
};
|
||||
|
||||
typedef enum UBiDiDirection UBiDiDirection;
|
||||
|
||||
/**
|
||||
* Forward declaration of the <code>UBiDi</code> structure for the declaration of
|
||||
* the API functions. Its fields are implementation-specific.<p>
|
||||
* This structure holds information about a paragraph of text
|
||||
* with BiDi-algorithm-related details, or about one line of
|
||||
* such a paragraph.<p>
|
||||
* Reordering can be done on a line, or on a paragraph which is
|
||||
* then interpreted as one single line.
|
||||
*/
|
||||
struct UBiDi;
|
||||
|
||||
typedef struct UBiDi UBiDi;
|
||||
|
||||
/**
|
||||
* Allocate a <code>UBiDi</code> structure.
|
||||
* Such an object is initially empty. It is assigned
|
||||
* the BiDi properties of a paragraph by <code>ubidi_setPara()</code>
|
||||
* or the BiDi properties of a line of a paragraph by
|
||||
* <code>ubidi_getLine()</code>.<p>
|
||||
* This object can be reused for as long as it is not deallocated
|
||||
* by calling <code>ubidi_close()</code>.<p>
|
||||
* <code>ubidi_set()</code> will allocate additional memory for
|
||||
* internal structures as necessary.
|
||||
*
|
||||
* @return An empty <code>UBiDi</code> object.
|
||||
*/
|
||||
U_CAPI UBiDi * U_EXPORT2
|
||||
ubidi_open();
|
||||
|
||||
/**
|
||||
* Allocate a <code>UBiDi</code> structure with preallocated memory
|
||||
* for internal structures.
|
||||
* This function provides a <code>UBiDi</code> object like <code>ubidi_open()</code>
|
||||
* with no arguments, but it also preallocates memory for internal structures
|
||||
* according to the sizings supplied by the caller.<p>
|
||||
* Subsequent functions will not allocate any more memory, and are thus
|
||||
* guaranteed not to fail because of lack of memory.<p>
|
||||
* The preallocation can be limited to some of the internal memory
|
||||
* by setting some values to 0 here. That means that if, e.g.,
|
||||
* <code>maxRunCount</code> cannot be reasonably predetermined and should not
|
||||
* be set to <code>maxLength</code> (the only failproof value) to avoid
|
||||
* wasting memory, then <code>maxRunCount</code> could be set to 0 here
|
||||
* and the internal structures that are associated with it will be allocated
|
||||
* on demand, just like with <code>ubidi_open()</code>.
|
||||
*
|
||||
* @param maxLength is the maximum paragraph or line length that internal memory
|
||||
* will be preallocated for. An attempt to associate this object with a
|
||||
* longer text will fail, unless this value is 0, which leaves the allocation
|
||||
* up to the implementation.
|
||||
*
|
||||
* @param maxRunCount is the maximum anticipated number of same-level runs
|
||||
* that internal memory will be preallocated for. An attempt to access
|
||||
* visual runs on an object that was not preallocated for as many runs
|
||||
* as the text was actually resolved to will fail,
|
||||
* unless this value is 0, which leaves the allocation up to the implementation.<p>
|
||||
* The number of runs depends on the actual text and maybe anywhere between
|
||||
* 1 and <code>maxLength</code>. It is typically small.<p>
|
||||
*
|
||||
* @param pErrorCode must be a valid pointer to an error code value,
|
||||
* which must not indicate a failure before the function call.
|
||||
*
|
||||
* @return An empty <code>UBiDi</code> object with preallocated memory.
|
||||
*/
|
||||
U_CAPI UBiDi * U_EXPORT2
|
||||
ubidi_openSized(int32_t maxLength, int32_t maxRunCount, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* <code>ubidi_close()</code> must be called to free the memory
|
||||
* associated with a UBiDi object.<p>
|
||||
*
|
||||
* <strong>Important: </strong>
|
||||
* If a <code>UBiDi</code> object is the <quote>child</quote>
|
||||
* of another one (its <quote>parent</quote>), after calling
|
||||
* <code>ubidi_setLine()</code>, then the child object must
|
||||
* be destroyed (closed) or reused (by calling
|
||||
* <code>ubidi_setPara()</code> or <code>ubidi_setLine()</code>)
|
||||
* before the parent object.
|
||||
*
|
||||
* @param pBiDi is a <code>UBiDi</code> object.
|
||||
*
|
||||
* @see ubidi_setPara
|
||||
* @see ubidi_setLine
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_close(UBiDi *pBiDi);
|
||||
|
||||
/**
|
||||
* Perform the Unicode BiDi algorithm. It is defined in the
|
||||
* <a href="http://www.unicode.org/unicode/reports/tr9/">Unicode Technical Report 9</a>,
|
||||
* version 5,
|
||||
* also described in The Unicode Standard, Version 3.0 .<p>
|
||||
*
|
||||
* This function takes a single plain text paragraph with or without
|
||||
* externally specified embedding levels from <quote>styled</quote> text
|
||||
* and computes the left-right-directionality of each character.<p>
|
||||
*
|
||||
* If the entire paragraph consists of text of only one direction, then
|
||||
* the function may not perform all the steps described by the algorithm,
|
||||
* i.e., some levels may not be the same as if all steps were performed.
|
||||
* This is not relevant for unidirectional text.<br>
|
||||
* For example, in pure LTR text with numbers the numbers would get
|
||||
* a resolved level of 2 higher than the surrounding text according to
|
||||
* the algorithm. This implementation may set all resolved levels to
|
||||
* the same value in such a case.<p>
|
||||
*
|
||||
* The text must be externally split into separate paragraphs (rule P1).
|
||||
* Paragraph separators (B) should appear at most at the very end.
|
||||
*
|
||||
* @param pBiDi A <code>UBiDi</code> object allocated with <code>ubidi_open()</code>
|
||||
* which will be set to contain the reordering information,
|
||||
* especially the resolved levels for all the characters in <code>text</code>.
|
||||
*
|
||||
* @param text is a pointer to the single-paragraph text that the
|
||||
* BiDi algorithm will be performed on
|
||||
* (step (P1) of the algorithm is performed externally).
|
||||
* <strong>The text must be (at least) <code>length</code> long.</strong>
|
||||
*
|
||||
* @param length is the length of the text; if <code>length==-1</code> then
|
||||
* the text must be zero-terminated.
|
||||
*
|
||||
* @param paraLevel specifies the default level for the paragraph;
|
||||
* it is typically 0 (LTR) or 1 (RTL).
|
||||
* If the function shall determine the paragraph level from the text,
|
||||
* then <code>paraLevel</code> can be set to
|
||||
* either <code>UBIDI_DEFAULT_LTR</code>
|
||||
* or <code>UBIDI_DEFAULT_RTL</code>;
|
||||
* if there is no strongly typed character, then
|
||||
* the desired default is used (0 for LTR or 1 for RTL).
|
||||
* Any other value between 0 and <code>UBIDI_MAX_EXPLICIT_LEVEL</code> is also valid,
|
||||
* with odd levels indicating RTL.
|
||||
*
|
||||
* @param embeddingLevels (in) may be used to preset the embedding and override levels,
|
||||
* ignoring characters like LRE and PDF in the text.
|
||||
* A level overrides the directional property of its corresponding
|
||||
* (same index) character if the level has the
|
||||
* <code>UBIDI_LEVEL_OVERRIDE</code> bit set.<p>
|
||||
* Except for that bit, it must be
|
||||
* <code>paraLevel<=embeddingLevels[]<=UBIDI_MAX_EXPLICIT_LEVEL</code>.<p>
|
||||
* <strong>Caution: </strong>A copy of this pointer, not of the levels,
|
||||
* will be stored in the <code>UBiDi</code> object;
|
||||
* the <code>embeddingLevels</code> array must not be
|
||||
* deallocated before the <code>UBiDi</code> structure is destroyed or reused,
|
||||
* and the <code>embeddingLevels</code>
|
||||
* should not be modified to avoid unexpected results on subsequent BiDi operations.
|
||||
* However, the <code>ubidi_setPara()</code> and
|
||||
* <code>ubidi_setLine()</code> functions may modify some or all of the levels.<p>
|
||||
* After the <code>UBiDi</code> object is reused or destroyed, the caller
|
||||
* must take care of the deallocation of the <code>embeddingLevels</code> array.<p>
|
||||
* <strong>The <code>embeddingLevels</code> array must be
|
||||
* at least <code>length</code> long.</strong>
|
||||
*
|
||||
* @param pErrorCode must be a valid pointer to an error code value,
|
||||
* which must not indicate a failure before the function call.
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_setPara(UBiDi *pBiDi, const UChar *text, int32_t length,
|
||||
UBiDiLevel paraLevel, UBiDiLevel *embeddingLevels,
|
||||
UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* <code>ubidi_getLine()</code> sets a <code>UBiDi</code> to
|
||||
* contain the reordering information, especially the resolved levels,
|
||||
* for all the characters in a line of text. This line of text is
|
||||
* specified by referring to a <code>UBiDi</code> object representing
|
||||
* this information for a paragraph of text, and by specifying
|
||||
* a range of indexes in this paragraph.<p>
|
||||
* In the new line object, the indexes will range from 0 to <code>limit-start</code>.<p>
|
||||
*
|
||||
* This is used after calling <code>ubidi_setPara()</code>
|
||||
* for a paragraph, and after line-breaking on that paragraph.
|
||||
* It is not necessary if the paragraph is treated as a single line.<p>
|
||||
*
|
||||
* After line-breaking, rules (L1) and (L2) for the treatment of
|
||||
* trailing WS and for reordering are performed on
|
||||
* a <code>UBiDi</code> object that represents a line.<p>
|
||||
*
|
||||
* <strong>Important: </strong><code>pLineBiDi</code> shares data with
|
||||
* <code>pParaBiDi</code>.
|
||||
* You must destroy or reuse <code>pLineBiDi</code> before <code>pParaBiDi</code>.
|
||||
* In other words, you must destroy or reuse the <code>UBiDi</code> object for a line
|
||||
* before the object for its parent paragraph.
|
||||
*
|
||||
* @param pParaBiDi is the parent paragraph object.
|
||||
*
|
||||
* @param start is the line's first index into the paragraph text.
|
||||
*
|
||||
* @param limit is just behind the line's last index into the paragraph text
|
||||
* (its last index +1).<br>
|
||||
* It must be <code>0<=start<=limit<=</code>paragraph length.
|
||||
*
|
||||
* @param pLineBiDi is the object that will now represent a line of the paragraph.
|
||||
*
|
||||
* @param pErrorCode must be a valid pointer to an error code value,
|
||||
* which must not indicate a failure before the function call.
|
||||
*
|
||||
* @see ubidi_setPara
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_setLine(const UBiDi *pParaBiDi,
|
||||
int32_t start, int32_t limit,
|
||||
UBiDi *pLineBiDi,
|
||||
UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* Get the directionality of the text.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @return A <code>UBIDI_XXX</code> value that indicates if the entire text
|
||||
* represented by this object is unidirectional,
|
||||
* and which direction, or if it is mixed-directional.
|
||||
*
|
||||
* @see UBiDiDirection
|
||||
*/
|
||||
U_CAPI UBiDiDirection U_EXPORT2
|
||||
ubidi_getDirection(const UBiDi *pBiDi);
|
||||
|
||||
/**
|
||||
* Get the length of the text.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @return The length of the text that the UBiDi object was created for.
|
||||
*/
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ubidi_getLength(const UBiDi *pBiDi);
|
||||
|
||||
/**
|
||||
* Get the paragraph level of the text.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @return The paragraph level.
|
||||
*
|
||||
* @see UBiDiLevel
|
||||
*/
|
||||
U_CAPI UBiDiLevel U_EXPORT2
|
||||
ubidi_getParaLevel(const UBiDi *pBiDi);
|
||||
|
||||
/**
|
||||
* Get the level for one character.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @param charIndex the index of a character.
|
||||
*
|
||||
* @return The level for the character at charIndex.
|
||||
*
|
||||
* @see UBiDiLevel
|
||||
*/
|
||||
U_CAPI UBiDiLevel U_EXPORT2
|
||||
ubidi_getLevelAt(const UBiDi *pBiDi, int32_t charIndex);
|
||||
|
||||
/**
|
||||
* Get an array of levels for each character.<p>
|
||||
*
|
||||
* Note that this function may allocate memory under some
|
||||
* circumstances, unlike <code>ubidi_getLevelAt()</code>.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @param pErrorCode must be a valid pointer to an error code value,
|
||||
* which must not indicate a failure before the function call.
|
||||
*
|
||||
* @return The levels array for the text,
|
||||
* or <code>NULL</code> if an error occurs.
|
||||
*
|
||||
* @see UBiDiLevel
|
||||
*/
|
||||
U_CAPI const UBiDiLevel * U_EXPORT2
|
||||
ubidi_getLevels(UBiDi *pBiDi, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* Get a logical run.
|
||||
* This function returns information about a run and is used
|
||||
* to retrieve runs in logical order.<p>
|
||||
* This is especially useful for line-breaking on a paragraph.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @param logicalStart is the first character of the run.
|
||||
*
|
||||
* @param pLogicalLimit will receive the limit of the run.
|
||||
* The l-value that you point to here may be the
|
||||
* same expression (variable) as the one for
|
||||
* <code>logicalStart</code>.
|
||||
* This pointer can be <code>NULL</code> if this
|
||||
* value is not necessary.
|
||||
*
|
||||
* @param pLevel will receive the level of the run.
|
||||
* This pointer can be <code>NULL</code> if this
|
||||
* value is not necessary.
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_getLogicalRun(const UBiDi *pBiDi, int32_t logicalStart,
|
||||
int32_t *pLogicalLimit, UBiDiLevel *pLevel);
|
||||
|
||||
/**
|
||||
* Get the number of runs.
|
||||
* This function may invoke the actual reordering on the
|
||||
* <code>UBiDi</code> object, after <code>ubidi_setPara()</code>
|
||||
* may have resolved only the levels of the text. Therefore,
|
||||
* <code>ubidi_countRuns()</code> may have to allocate memory,
|
||||
* and may fail doing so.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @param pErrorCode must be a valid pointer to an error code value,
|
||||
* which must not indicate a failure before the function call.
|
||||
*
|
||||
* @return The number of runs.
|
||||
*/
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ubidi_countRuns(UBiDi *pBiDi, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* Get one run's logical start, length, and directionality,
|
||||
* which can be 0 for LTR or 1 for RTL.
|
||||
* In an RTL run, the character at the logical start is
|
||||
* visually on the right of the displayed run.
|
||||
* The length is the number of characters in the run.<p>
|
||||
* <code>ubidi_countRuns()</code> should be called
|
||||
* before the runs are retrieved.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @param runIndex is the number of the run in visual order, in the
|
||||
* range <code>[0..ubidi_countRuns(pBiDi)-1]</code>.
|
||||
*
|
||||
* @param pLogicalStart is the first logical character index in the text.
|
||||
* The pointer may be <code>NULL</code> if this index is not needed.
|
||||
*
|
||||
* @param pLength is the number of characters (at least one) in the run.
|
||||
* The pointer may be <code>NULL</code> if this is not needed.
|
||||
*
|
||||
* @return the directionality of the run,
|
||||
* <code>UBIDI_LTR==0</code> or <code>UBIDI_RTL==1</code>,
|
||||
* never <code>UBIDI_MIXED</code>.
|
||||
*
|
||||
* @see ubidi_countRuns
|
||||
*
|
||||
* Example:
|
||||
* <pre>
|
||||
* int32_t i, count=ubidi_countRuns(pBiDi),
|
||||
* logicalStart, visualIndex=0, length;
|
||||
* for(i=0; i<count; ++i) {
|
||||
* if(UBIDI_LTR==ubidi_getVisualRun(pBiDi, i, &logicalStart, &length)) {
|
||||
* do { // LTR
|
||||
* show_char(text[logicalStart++], visualIndex++);
|
||||
* } while(--length>0);
|
||||
* } else {
|
||||
* logicalStart+=length; // logicalLimit
|
||||
* do { // RTL
|
||||
* show_char(text[--logicalStart], visualIndex++);
|
||||
* } while(--length>0);
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
*
|
||||
* Note that in right-to-left runs, code like this places
|
||||
* modifier letters before base characters and second surrogates
|
||||
* before first ones.
|
||||
*/
|
||||
U_CAPI UBiDiDirection U_EXPORT2
|
||||
ubidi_getVisualRun(UBiDi *pBiDi, int32_t runIndex,
|
||||
int32_t *pLogicalStart, int32_t *pLength);
|
||||
|
||||
/**
|
||||
* Get the visual position from a logical text position.
|
||||
* If such a mapping is used many times on the same
|
||||
* <code>UBiDi</code> object, then calling
|
||||
* <code>ubidi_getLogicalMap()</code> is more efficient.<p>
|
||||
*
|
||||
* Note that in right-to-left runs, this mapping places
|
||||
* modifier letters before base characters and second surrogates
|
||||
* before first ones.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @param logicalIndex is the index of a character in the text.
|
||||
*
|
||||
* @param pErrorCode must be a valid pointer to an error code value,
|
||||
* which must not indicate a failure before the function call.
|
||||
*
|
||||
* @return The visual position of this character.
|
||||
*
|
||||
* @see ubidi_getLogicalMap
|
||||
* @see ubidi_getLogicalIndex
|
||||
*/
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ubidi_getVisualIndex(UBiDi *pBiDi, int32_t logicalIndex, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* Get the logical text position from a visual position.
|
||||
* If such a mapping is used many times on the same
|
||||
* <code>UBiDi</code> object, then calling
|
||||
* <code>ubidi_getVisualMap()</code> is more efficient.<p>
|
||||
*
|
||||
* This is the inverse function to <code>ubidi_getVisualIndex()</code>.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @param visualIndex is the visual position of a character.
|
||||
*
|
||||
* @param pErrorCode must be a valid pointer to an error code value,
|
||||
* which must not indicate a failure before the function call.
|
||||
*
|
||||
* @return The index of this character in the text.
|
||||
*
|
||||
* @see ubidi_getVisualMap
|
||||
* @see ubidi_getVisualIndex
|
||||
*/
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ubidi_getLogicalIndex(UBiDi *pBiDi, int32_t visualIndex, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* Get a logical-to-visual index map (array) for the characters in the UBiDi
|
||||
* (paragraph or line) object.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @param indexMap is a pointer to an array of <code>ubidi_getLength()</code>
|
||||
* indexes which will reflect the reordering of the characters.
|
||||
* The array does not need to be initialized.<p>
|
||||
* The index map will result in <code>indexMap[logicalIndex]==visualIndex</code>.<p>
|
||||
*
|
||||
* @param pErrorCode must be a valid pointer to an error code value,
|
||||
* which must not indicate a failure before the function call.
|
||||
*
|
||||
* @see ubidi_getVisualMap
|
||||
* @see ubidi_getVisualIndex
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_getLogicalMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* Get a visual-to-logical index map (array) for the characters in the UBiDi
|
||||
* (paragraph or line) object.
|
||||
*
|
||||
* @param pBiDi is the paragraph or line <code>UBiDi</code> object.
|
||||
*
|
||||
* @param indexMap is a pointer to an array of <code>ubidi_getLength()</code>
|
||||
* indexes which will reflect the reordering of the characters.
|
||||
* The array does not need to be initialized.<p>
|
||||
* The index map will result in <code>indexMap[visualIndex]==logicalIndex</code>.<p>
|
||||
*
|
||||
* @param pErrorCode must be a valid pointer to an error code value,
|
||||
* which must not indicate a failure before the function call.
|
||||
*
|
||||
* @see ubidi_getLogicalMap
|
||||
* @see ubidi_getLogicalIndex
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_getVisualMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode);
|
||||
|
||||
/**
|
||||
* This is a convenience function that does not use a UBiDi object.
|
||||
* It is intended to be used for when an application has determined the levels
|
||||
* of objects (character sequences) and just needs to have them reordered (L2).
|
||||
* This is equivalent to using <code>ubidi_getLogicalMap</code> on a
|
||||
* <code>UBiDi</code> object.
|
||||
*
|
||||
* @param levels is an array with <code>length</code> levels that have been determined by
|
||||
* the application.
|
||||
*
|
||||
* @param length is the number of levels in the array, or, semantically,
|
||||
* the number of objects to be reordered.
|
||||
* It must be <code>length>0</code>.
|
||||
*
|
||||
* @param indexMap is a pointer to an array of <code>length</code>
|
||||
* indexes which will reflect the reordering of the characters.
|
||||
* The array does not need to be initialized.<p>
|
||||
* The index map will result in <code>indexMap[logicalIndex]==visualIndex</code>.
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_reorderLogical(const UBiDiLevel *levels, int32_t length, int32_t *indexMap);
|
||||
|
||||
/**
|
||||
* This is a convenience function that does not use a UBiDi object.
|
||||
* It is intended to be used for when an application has determined the levels
|
||||
* of objects (character sequences) and just needs to have them reordered (L2).
|
||||
* This is equivalent to using <code>ubidi_getVisualMap</code> on a
|
||||
* <code>UBiDi</code> object.
|
||||
*
|
||||
* @param levels is an array with <code>length</code> levels that have been determined by
|
||||
* the application.
|
||||
*
|
||||
* @param length is the number of levels in the array, or, semantically,
|
||||
* the number of objects to be reordered.
|
||||
* It must be <code>length>0</code>.
|
||||
*
|
||||
* @param indexMap is a pointer to an array of <code>length</code>
|
||||
* indexes which will reflect the reordering of the characters.
|
||||
* The array does not need to be initialized.<p>
|
||||
* The index map will result in <code>indexMap[visualIndex]==logicalIndex</code>.
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_reorderVisual(const UBiDiLevel *levels, int32_t length, int32_t *indexMap);
|
||||
|
||||
/**
|
||||
* Invert an index map.
|
||||
* The one-to-one index mapping of the first map is inverted and written to
|
||||
* the second one.
|
||||
*
|
||||
* @param srcMap is an array with <code>length</code> indexes
|
||||
* which define the original mapping.
|
||||
*
|
||||
* @param destMap is an array with <code>length</code> indexes
|
||||
* which will be filled with the inverse mapping.
|
||||
*
|
||||
* @param length is the length of each array.
|
||||
*/
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_invertMap(const int32_t *srcMap, int32_t *destMap, int32_t length);
|
||||
|
||||
/**
|
||||
* @name Sample code for the ICU BiDi API
|
||||
*
|
||||
* <h2>Rendering a paragraph with the ICU BiDi API</h2>
|
||||
*
|
||||
* This is (hypothetical) sample code that illustrates
|
||||
* how the ICU BiDi API could be used to render a paragraph of text.
|
||||
* Rendering code depends highly on the graphics system,
|
||||
* therefore this sample code must make a lot of assumptions,
|
||||
* which may or may not match any existing graphics system's properties.
|
||||
*
|
||||
* <p>The basic assumptions are:</p>
|
||||
* <ul>
|
||||
* <li>Rendering is done from left to right on a horizontal line.</li>
|
||||
* <li>A run of single-style, unidirectional text can be rendered at once.</li>
|
||||
* <li>Such a run of text is passed to the graphics system with
|
||||
* characters (code units) in logical order.</li>
|
||||
* <li>The line-breaking algorithm is very complicated
|
||||
* and Locale-dependent -
|
||||
* and therefore its implementation omitted from this sample code.</li>
|
||||
* </ul>
|
||||
*
|
||||
* <pre>
|
||||
* #include "ubidi.h"
|
||||
*
|
||||
* typedef enum {
|
||||
* styleNormal=0, styleSelected=1,
|
||||
* styleBold=2, styleItalics=4,
|
||||
* styleSuper=8, styleSub=16
|
||||
* } Style;
|
||||
*
|
||||
* typedef struct { int32_t limit; Style style; } StyleRun;
|
||||
*
|
||||
* int getTextWidth(const UChar *text, int32_t start, int32_t limit,
|
||||
* const StyleRun *styleRuns, int styleRunCount);
|
||||
*
|
||||
* // set *pLimit and *pStyleRunLimit for a line
|
||||
* // from text[start] and from styleRuns[styleRunStart]
|
||||
* // using ubidi_getLogicalRun(para, ...)
|
||||
* void getLineBreak(const UChar *text, int32_t start, int32_t *pLimit,
|
||||
* UBiDi *para,
|
||||
* const StyleRun *styleRuns, int styleRunStart, int *pStyleRunLimit,
|
||||
* int *pLineWidth);
|
||||
*
|
||||
* // render runs on a line sequentially, always from left to right
|
||||
*
|
||||
* // prepare rendering a new line
|
||||
* void startLine(UBiDiDirection textDirection, int lineWidth);
|
||||
*
|
||||
* // render a run of text and advance to the right by the run width
|
||||
* // the text[start..limit-1] is always in logical order
|
||||
* void renderRun(const UChar *text, int32_t start, int32_t limit,
|
||||
* UBiDiDirection textDirection, Style style);
|
||||
*
|
||||
* // We could compute a cross-product
|
||||
* // from the style runs with the directional runs
|
||||
* // and then reorder it.
|
||||
* // Instead, here we iterate over each run type
|
||||
* // and render the intersections -
|
||||
* // with shortcuts in simple (and common) cases.
|
||||
* // renderParagraph() is the main function.
|
||||
*
|
||||
* // render a directional run with
|
||||
* // (possibly) multiple style runs intersecting with it
|
||||
* void renderDirectionalRun(const UChar *text,
|
||||
* int32_t start, int32_t limit,
|
||||
* UBiDiDirection direction,
|
||||
* const StyleRun *styleRuns, int styleRunCount) {
|
||||
* int i;
|
||||
*
|
||||
* // iterate over style runs
|
||||
* if(direction==UBIDI_LTR) {
|
||||
* int styleLimit;
|
||||
*
|
||||
* for(i=0; i<styleRunCount; ++i) {
|
||||
* styleLimit=styleRun[i].limit;
|
||||
* if(start<styleLimit) {
|
||||
* if(styleLimit>limit) { styleLimit=limit; }
|
||||
* renderRun(text, start, styleLimit,
|
||||
* direction, styleRun[i].style);
|
||||
* if(styleLimit==limit) { break; }
|
||||
* start=styleLimit;
|
||||
* }
|
||||
* }
|
||||
* } else {
|
||||
* int styleStart;
|
||||
*
|
||||
* for(i=styleRunCount-1; i>=0; --i) {
|
||||
* if(i>0) {
|
||||
* styleStart=styleRun[i-1].limit;
|
||||
* } else {
|
||||
* styleStart=0;
|
||||
* }
|
||||
* if(limit>=styleStart) {
|
||||
* if(styleStart<start) { styleStart=start; }
|
||||
* renderRun(text, styleStart, limit,
|
||||
* direction, styleRun[i].style);
|
||||
* if(styleStart==start) { break; }
|
||||
* limit=styleStart;
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* // the line object represents text[start..limit-1]
|
||||
* void renderLine(UBiDi *line, const UChar *text,
|
||||
* int32_t start, int32_t limit,
|
||||
* const StyleRun *styleRuns, int styleRunCount) {
|
||||
* UBiDiDirection direction=ubidi_getDirection(line);
|
||||
* if(direction!=UBIDI_MIXED) {
|
||||
* // unidirectional
|
||||
* if(styleRunCount<=1) {
|
||||
* renderRun(text, start, limit, direction, styleRuns[0].style);
|
||||
* } else {
|
||||
* renderDirectionalRun(text, start, limit,
|
||||
* direction, styleRuns, styleRunCount);
|
||||
* }
|
||||
* } else {
|
||||
* // mixed-directional
|
||||
* int32_t count, i, length;
|
||||
* UBiDiLevel level;
|
||||
*
|
||||
* count=ubidi_countRuns(para, pErrorCode);
|
||||
* if(U_SUCCESS(*pErrorCode)) {
|
||||
* if(styleRunCount<=1) {
|
||||
* Style style=styleRuns[0].style;
|
||||
*
|
||||
* // iterate over directional runs
|
||||
* for(i=0; i<count; ++i) {
|
||||
* direction=ubidi_getVisualRun(para, i, &start, &length);
|
||||
* renderRun(text, start, start+length, direction, style);
|
||||
* }
|
||||
* } else {
|
||||
* int32_t j;
|
||||
*
|
||||
* // iterate over both directional and style runs
|
||||
* for(i=0; i<count; ++i) {
|
||||
* direction=ubidi_getVisualRun(line, i, &start, &length);
|
||||
* renderDirectionalRun(text, start, start+length,
|
||||
* direction, styleRuns, styleRunCount);
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* void renderParagraph(const UChar *text, int32_t length,
|
||||
* UBiDiDirection textDirection,
|
||||
* const StyleRun *styleRuns, int styleRunCount,
|
||||
* int lineWidth,
|
||||
* UErrorCode *pErrorCode) {
|
||||
* UBiDi *para;
|
||||
*
|
||||
* if(pErrorCode==NULL || U_FAILURE(*pErrorCode) || length<=0) {
|
||||
* return;
|
||||
* }
|
||||
*
|
||||
* para=ubidi_openSized(length, 0, pErrorCode);
|
||||
* if(para==NULL) { return; }
|
||||
*
|
||||
* ubidi_setPara(para, text, length,
|
||||
* textDirection ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR,
|
||||
* NULL, pErrorCode);
|
||||
* if(U_SUCCESS(*pErrorCode)) {
|
||||
* UBiDiLevel paraLevel=1&ubidi_getParaLevel(para);
|
||||
* StyleRun styleRun={ length, styleNormal };
|
||||
* int width;
|
||||
*
|
||||
* if(styleRuns==NULL || styleRunCount<=0) {
|
||||
* styleRunCount=1;
|
||||
* styleRuns=&styleRun;
|
||||
* }
|
||||
*
|
||||
* // assume styleRuns[styleRunCount-1].limit>=length
|
||||
*
|
||||
* width=getTextWidth(text, 0, length, styleRuns, styleRunCount);
|
||||
* if(width<=lineWidth) {
|
||||
* // everything fits onto one line
|
||||
*
|
||||
* // prepare rendering a new line from either left or right
|
||||
* startLine(paraLevel, width);
|
||||
*
|
||||
* renderLine(para, text, 0, length,
|
||||
* styleRuns, styleRunCount);
|
||||
* } else {
|
||||
* UBiDi *line;
|
||||
*
|
||||
* // we need to render several lines
|
||||
* line=ubidi_openSized(length, 0, pErrorCode);
|
||||
* if(line!=NULL) {
|
||||
* int32_t start=0, limit;
|
||||
* int styleRunStart=0, styleRunLimit;
|
||||
*
|
||||
* for(;;) {
|
||||
* limit=length;
|
||||
* styleRunLimit=styleRunCount;
|
||||
* getLineBreak(text, start, &limit, para,
|
||||
* styleRuns, styleRunStart, &styleRunLimit,
|
||||
* &width);
|
||||
* ubidi_setLine(para, start, limit, line, pErrorCode);
|
||||
* if(U_SUCCESS(*pErrorCode)) {
|
||||
* // prepare rendering a new line
|
||||
* // from either left or right
|
||||
* startLine(paraLevel, width);
|
||||
*
|
||||
* renderLine(line, text, start, limit,
|
||||
* styleRuns+styleRunStart,
|
||||
* styleRunLimit-styleRunStart);
|
||||
* }
|
||||
* if(limit==length) { break; }
|
||||
* start=limit;
|
||||
* styleRunStart=styleRunLimit-1;
|
||||
* if(start>=styleRuns[styleRunStart].limit) {
|
||||
* ++styleRunStart;
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* ubidi_close(line);
|
||||
* }
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* ubidi_close(para);
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
BIDI_SAMPLE_CODE
|
||||
/*@{*/
|
||||
/*@}*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
#endif
|
@ -1,246 +0,0 @@
|
||||
/*
|
||||
* Portions Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corp. 1999-2003 - All Rights Reserved
|
||||
*
|
||||
* The original version of this source code and documentation is
|
||||
* copyrighted and owned by IBM. These materials are provided
|
||||
* under terms of a License Agreement between IBM and Sun.
|
||||
* This technology is protected by multiple US and International
|
||||
* patents. This notice and attribution to IBM may not be removed.
|
||||
*/
|
||||
|
||||
/*
|
||||
* file name: ubidiimp.h
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 1999aug06
|
||||
* created by: Markus W. Scherer
|
||||
*/
|
||||
|
||||
#ifndef UBIDIIMP_H
|
||||
#define UBIDIIMP_H
|
||||
|
||||
/* set import/export definitions */
|
||||
#ifdef U_COMMON_IMPLEMENTATION
|
||||
|
||||
#include "utypes.h"
|
||||
#include "uchardir.h"
|
||||
|
||||
/* miscellaneous definitions ---------------------------------------------- */
|
||||
|
||||
typedef uint8_t DirProp;
|
||||
typedef uint32_t Flags;
|
||||
|
||||
/* Comparing the description of the BiDi algorithm with this implementation
|
||||
is easier with the same names for the BiDi types in the code as there.
|
||||
See UCharDirection in uchar.h .
|
||||
*/
|
||||
enum {
|
||||
L= U_LEFT_TO_RIGHT,
|
||||
R= U_RIGHT_TO_LEFT,
|
||||
EN= U_EUROPEAN_NUMBER,
|
||||
ES= U_EUROPEAN_NUMBER_SEPARATOR,
|
||||
ET= U_EUROPEAN_NUMBER_TERMINATOR,
|
||||
AN= U_ARABIC_NUMBER,
|
||||
CS= U_COMMON_NUMBER_SEPARATOR,
|
||||
B= U_BLOCK_SEPARATOR,
|
||||
S= U_SEGMENT_SEPARATOR,
|
||||
WS= U_WHITE_SPACE_NEUTRAL,
|
||||
ON= U_OTHER_NEUTRAL,
|
||||
LRE=U_LEFT_TO_RIGHT_EMBEDDING,
|
||||
LRO=U_LEFT_TO_RIGHT_OVERRIDE,
|
||||
AL= U_RIGHT_TO_LEFT_ARABIC,
|
||||
RLE=U_RIGHT_TO_LEFT_EMBEDDING,
|
||||
RLO=U_RIGHT_TO_LEFT_OVERRIDE,
|
||||
PDF=U_POP_DIRECTIONAL_FORMAT,
|
||||
NSM=U_DIR_NON_SPACING_MARK,
|
||||
BN= U_BOUNDARY_NEUTRAL,
|
||||
dirPropCount
|
||||
};
|
||||
|
||||
/*
|
||||
* Sometimes, bit values are more appropriate
|
||||
* to deal with directionality properties.
|
||||
* Abbreviations in these macro names refer to names
|
||||
* used in the BiDi algorithm.
|
||||
*/
|
||||
#define DIRPROP_FLAG(dir) (1UL<<(dir))
|
||||
|
||||
/* special flag for multiple runs from explicit embedding codes */
|
||||
#define DIRPROP_FLAG_MULTI_RUNS (1UL<<31)
|
||||
|
||||
/* are there any characters that are LTR or RTL? */
|
||||
#define MASK_LTR (DIRPROP_FLAG(L)|DIRPROP_FLAG(EN)|DIRPROP_FLAG(AN)|DIRPROP_FLAG(LRE)|DIRPROP_FLAG(LRO))
|
||||
#define MASK_RTL (DIRPROP_FLAG(R)|DIRPROP_FLAG(AL)|DIRPROP_FLAG(RLE)|DIRPROP_FLAG(RLO))
|
||||
|
||||
/* explicit embedding codes */
|
||||
#define MASK_LRX (DIRPROP_FLAG(LRE)|DIRPROP_FLAG(LRO))
|
||||
#define MASK_RLX (DIRPROP_FLAG(RLE)|DIRPROP_FLAG(RLO))
|
||||
#define MASK_OVERRIDE (DIRPROP_FLAG(LRO)|DIRPROP_FLAG(RLO))
|
||||
|
||||
#define MASK_EXPLICIT (MASK_LRX|MASK_RLX|DIRPROP_FLAG(PDF))
|
||||
#define MASK_BN_EXPLICIT (DIRPROP_FLAG(BN)|MASK_EXPLICIT)
|
||||
|
||||
/* paragraph and segment separators */
|
||||
#define MASK_B_S (DIRPROP_FLAG(B)|DIRPROP_FLAG(S))
|
||||
|
||||
/* all types that are counted as White Space or Neutral in some steps */
|
||||
#define MASK_WS (MASK_B_S|DIRPROP_FLAG(WS)|MASK_BN_EXPLICIT)
|
||||
#define MASK_N (DIRPROP_FLAG(ON)|MASK_WS)
|
||||
|
||||
/* all types that are included in a sequence of European Terminators for (W5) */
|
||||
#define MASK_ET_NSM_BN (DIRPROP_FLAG(ET)|DIRPROP_FLAG(NSM)|MASK_BN_EXPLICIT)
|
||||
|
||||
/* types that are neutrals or could becomes neutrals in (Wn) */
|
||||
#define MASK_POSSIBLE_N (DIRPROP_FLAG(CS)|DIRPROP_FLAG(ES)|DIRPROP_FLAG(ET)|MASK_N)
|
||||
|
||||
/*
|
||||
* These types may be changed to "e",
|
||||
* the embedding type (L or R) of the run,
|
||||
* in the BiDi algorithm (N2)
|
||||
*/
|
||||
#define MASK_EMBEDDING (DIRPROP_FLAG(NSM)|MASK_POSSIBLE_N)
|
||||
|
||||
/* the dirProp's L and R are defined to 0 and 1 values in UCharDirection */
|
||||
#define GET_LR_FROM_LEVEL(level) ((DirProp)((level)&1))
|
||||
|
||||
#define IS_DEFAULT_LEVEL(level) (((level)&0xfe)==0xfe)
|
||||
|
||||
/* handle surrogate pairs --------------------------------------------------- */
|
||||
/* Note: dlf added for java */
|
||||
#define IS_FIRST_SURROGATE(uchar) (((uchar)&0xfc00)==0xd800)
|
||||
#define IS_SECOND_SURROGATE(uchar) (((uchar)&0xfc00)==0xdc00)
|
||||
|
||||
/* get the UTF-32 value directly from the surrogate pseudo-characters */
|
||||
#define SURROGATE_OFFSET ((0xd800<<10UL)+0xdc00-0x10000)
|
||||
#define GET_UTF_32(first, second) (((first)<<10UL)+(second)-SURROGATE_OFFSET)
|
||||
|
||||
/* Run structure for reordering --------------------------------------------- */
|
||||
|
||||
typedef struct Run {
|
||||
int32_t logicalStart, /* first character of the run; b31 indicates even/odd level */
|
||||
visualLimit; /* last visual position of the run +1 */
|
||||
} Run;
|
||||
|
||||
/* in a Run, logicalStart will get this bit set if the run level is odd */
|
||||
#define INDEX_ODD_BIT (1UL<<31)
|
||||
|
||||
#define MAKE_INDEX_ODD_PAIR(index, level) (index|((uint32_t)level<<31))
|
||||
#define ADD_ODD_BIT_FROM_LEVEL(x, level) ((x)|=((uint32_t)level<<31))
|
||||
#define REMOVE_ODD_BIT(x) ((x)&=~INDEX_ODD_BIT)
|
||||
|
||||
#define GET_INDEX(x) (x&~INDEX_ODD_BIT)
|
||||
#define GET_ODD_BIT(x) ((uint32_t)x>>31)
|
||||
#define IS_ODD_RUN(x) ((x&INDEX_ODD_BIT)!=0)
|
||||
#define IS_EVEN_RUN(x) ((x&INDEX_ODD_BIT)==0)
|
||||
|
||||
U_CFUNC bool_t
|
||||
ubidi_getRuns(UBiDi *pBiDi);
|
||||
|
||||
/* UBiDi structure ----------------------------------------------------------- */
|
||||
|
||||
struct UBiDi {
|
||||
/* alias pointer to the current text */
|
||||
const UChar *text;
|
||||
|
||||
/* length of the current text */
|
||||
int32_t length;
|
||||
|
||||
/* memory sizes in bytes */
|
||||
int32_t dirPropsSize, levelsSize, runsSize;
|
||||
|
||||
/* allocated memory */
|
||||
DirProp *dirPropsMemory;
|
||||
UBiDiLevel *levelsMemory;
|
||||
Run *runsMemory;
|
||||
|
||||
/* indicators for whether memory may be allocated after ubidi_open() */
|
||||
bool_t mayAllocateText, mayAllocateRuns;
|
||||
|
||||
/* arrays with one value per text-character */
|
||||
const DirProp *dirProps;
|
||||
UBiDiLevel *levels;
|
||||
|
||||
/* are we performing an approximation of the "inverse BiDi" algorithm? */
|
||||
bool_t isInverse;
|
||||
|
||||
/* the paragraph level */
|
||||
UBiDiLevel paraLevel;
|
||||
|
||||
/* the overall paragraph or line directionality - see UBiDiDirection */
|
||||
UBiDiDirection direction;
|
||||
|
||||
/* flags is a bit set for which directional properties are in the text */
|
||||
Flags flags;
|
||||
|
||||
/* characters after trailingWSStart are WS and are */
|
||||
/* implicitly at the paraLevel (rule (L1)) - levels may not reflect that */
|
||||
int32_t trailingWSStart;
|
||||
|
||||
/* fields for line reordering */
|
||||
int32_t runCount; /* ==-1: runs not set up yet */
|
||||
Run *runs;
|
||||
|
||||
/* for non-mixed text, we only need a tiny array of runs (no malloc()) */
|
||||
Run simpleRuns[1];
|
||||
};
|
||||
|
||||
/* helper function to (re)allocate memory if allowed */
|
||||
extern bool_t
|
||||
ubidi_getMemory(void **pMemory, int32_t *pSize, bool_t mayAllocate, int32_t sizeNeeded);
|
||||
|
||||
/* helper macros for each allocated array in UBiDi */
|
||||
#define getDirPropsMemory(pBiDi, length) \
|
||||
ubidi_getMemory((void **)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \
|
||||
(pBiDi)->mayAllocateText, (length))
|
||||
|
||||
#define getLevelsMemory(pBiDi, length) \
|
||||
ubidi_getMemory((void **)&(pBiDi)->levelsMemory, &(pBiDi)->levelsSize, \
|
||||
(pBiDi)->mayAllocateText, (length))
|
||||
|
||||
#define getRunsMemory(pBiDi, length) \
|
||||
ubidi_getMemory((void **)&(pBiDi)->runsMemory, &(pBiDi)->runsSize, \
|
||||
(pBiDi)->mayAllocateRuns, (length)*sizeof(Run))
|
||||
|
||||
/* additional macros used by ubidi_open() - always allow allocation */
|
||||
#define getInitialDirPropsMemory(pBiDi, length) \
|
||||
ubidi_getMemory((void **)&(pBiDi)->dirPropsMemory, &(pBiDi)->dirPropsSize, \
|
||||
TRUE, (length))
|
||||
|
||||
#define getInitialLevelsMemory(pBiDi, length) \
|
||||
ubidi_getMemory((void **)&(pBiDi)->levelsMemory, &(pBiDi)->levelsSize, \
|
||||
TRUE, (length))
|
||||
|
||||
#define getInitialRunsMemory(pBiDi, length) \
|
||||
ubidi_getMemory((void **)&(pBiDi)->runsMemory, &(pBiDi)->runsSize, \
|
||||
TRUE, (length)*sizeof(Run))
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
@ -1,996 +0,0 @@
|
||||
/*
|
||||
* Portions Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corp. 1999-2003 - All Rights Reserved
|
||||
*
|
||||
* The original version of this source code and documentation is
|
||||
* copyrighted and owned by IBM. These materials are provided
|
||||
* under terms of a License Agreement between IBM and Sun.
|
||||
* This technology is protected by multiple US and International
|
||||
* patents. This notice and attribution to IBM may not be removed.
|
||||
*/
|
||||
|
||||
/*
|
||||
* file name: ubidiln.c
|
||||
* encoding: US-ASCII
|
||||
* tab size: 8 (not used)
|
||||
* indentation:4
|
||||
*
|
||||
* created on: 1999aug06
|
||||
* created by: Markus W. Scherer
|
||||
*/
|
||||
|
||||
/* set import/export definitions */
|
||||
#ifndef U_COMMON_IMPLEMENTATION
|
||||
# define U_COMMON_IMPLEMENTATION
|
||||
#endif
|
||||
|
||||
#include "cmemory.h"
|
||||
#include "utypes.h"
|
||||
#include "uchardir.h"
|
||||
#include "ubidi.h"
|
||||
#include "ubidiimp.h"
|
||||
|
||||
/*
|
||||
* General remarks about the functions in this file:
|
||||
*
|
||||
* These functions deal with the aspects of potentially mixed-directional
|
||||
* text in a single paragraph or in a line of a single paragraph
|
||||
* which has already been processed according to
|
||||
* the Unicode 3.0 BiDi algorithm as defined in
|
||||
* http://www.unicode.org/unicode/reports/tr9/ , version 5,
|
||||
* also described in The Unicode Standard, Version 3.0 .
|
||||
*
|
||||
* This means that there is a UBiDi object with a levels
|
||||
* and a dirProps array.
|
||||
* paraLevel and direction are also set.
|
||||
* Only if the length of the text is zero, then levels==dirProps==NULL.
|
||||
*
|
||||
* The overall directionality of the paragraph
|
||||
* or line is used to bypass the reordering steps if possible.
|
||||
* Even purely RTL text does not need reordering there because
|
||||
* the ubidi_getLogical/VisualIndex() functions can compute the
|
||||
* index on the fly in such a case.
|
||||
*
|
||||
* The implementation of the access to same-level-runs and of the reordering
|
||||
* do attempt to provide better performance and less memory usage compared to
|
||||
* a direct implementation of especially rule (L2) with an array of
|
||||
* one (32-bit) integer per text character.
|
||||
*
|
||||
* Here, the levels array is scanned as soon as necessary, and a vector of
|
||||
* same-level-runs is created. Reordering then is done on this vector.
|
||||
* For each run of text positions that were resolved to the same level,
|
||||
* only 8 bytes are stored: the first text position of the run and the visual
|
||||
* position behind the run after reordering.
|
||||
* One sign bit is used to hold the directionality of the run.
|
||||
* This is inefficient if there are many very short runs. If the average run
|
||||
* length is <2, then this uses more memory.
|
||||
*
|
||||
* In a further attempt to save memory, the levels array is never changed
|
||||
* after all the resolution rules (Xn, Wn, Nn, In).
|
||||
* Many functions have to consider the field trailingWSStart:
|
||||
* if it is less than length, then there is an implicit trailing run
|
||||
* at the paraLevel,
|
||||
* which is not reflected in the levels array.
|
||||
* This allows a line UBiDi object to use the same levels array as
|
||||
* its paragraph parent object.
|
||||
*
|
||||
* When a UBiDi object is created for a line of a paragraph, then the
|
||||
* paragraph's levels and dirProps arrays are reused by way of setting
|
||||
* a pointer into them, not by copying. This again saves memory and forbids to
|
||||
* change the now shared levels for (L1).
|
||||
*/
|
||||
|
||||
/* prototypes --------------------------------------------------------------- */
|
||||
|
||||
static void
|
||||
setTrailingWSStart(UBiDi *pBiDi);
|
||||
|
||||
static void
|
||||
getSingleRun(UBiDi *pBiDi, UBiDiLevel level);
|
||||
|
||||
static void
|
||||
reorderLine(UBiDi *pBiDi, UBiDiLevel minLevel, UBiDiLevel maxLevel);
|
||||
|
||||
static bool_t
|
||||
prepareReorder(const UBiDiLevel *levels, int32_t length,
|
||||
int32_t *indexMap,
|
||||
UBiDiLevel *pMinLevel, UBiDiLevel *pMaxLevel);
|
||||
|
||||
/* ubidi_setLine ------------------------------------------------------------ */
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_setLine(const UBiDi *pParaBiDi,
|
||||
int32_t start, int32_t limit,
|
||||
UBiDi *pLineBiDi,
|
||||
UErrorCode *pErrorCode) {
|
||||
int32_t length;
|
||||
|
||||
/* check the argument values */
|
||||
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
|
||||
return;
|
||||
} else if(pParaBiDi==NULL || pLineBiDi==NULL) {
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return;
|
||||
} else if(start<0 || start>limit || limit>pParaBiDi->length) {
|
||||
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return;
|
||||
}
|
||||
|
||||
/* set the values in pLineBiDi from its pParaBiDi parent */
|
||||
pLineBiDi->text=pParaBiDi->text+start;
|
||||
length=pLineBiDi->length=limit-start;
|
||||
pLineBiDi->paraLevel=pParaBiDi->paraLevel;
|
||||
|
||||
pLineBiDi->runs=NULL;
|
||||
pLineBiDi->flags=0;
|
||||
|
||||
if(length>0) {
|
||||
pLineBiDi->dirProps=pParaBiDi->dirProps+start;
|
||||
pLineBiDi->levels=pParaBiDi->levels+start;
|
||||
pLineBiDi->runCount=-1;
|
||||
|
||||
if(pParaBiDi->direction!=UBIDI_MIXED) {
|
||||
/* the parent is already trivial */
|
||||
pLineBiDi->direction=pParaBiDi->direction;
|
||||
|
||||
/*
|
||||
* The parent's levels are all either
|
||||
* implicitly or explicitly ==paraLevel;
|
||||
* do the same here.
|
||||
*/
|
||||
if(pParaBiDi->trailingWSStart<=start) {
|
||||
pLineBiDi->trailingWSStart=0;
|
||||
} else if(pParaBiDi->trailingWSStart<limit) {
|
||||
pLineBiDi->trailingWSStart=pParaBiDi->trailingWSStart-start;
|
||||
} else {
|
||||
pLineBiDi->trailingWSStart=length;
|
||||
}
|
||||
} else {
|
||||
const UBiDiLevel *levels=pLineBiDi->levels;
|
||||
int32_t i, trailingWSStart;
|
||||
UBiDiLevel level;
|
||||
|
||||
setTrailingWSStart(pLineBiDi);
|
||||
trailingWSStart=pLineBiDi->trailingWSStart;
|
||||
|
||||
/* recalculate pLineBiDi->direction */
|
||||
if(trailingWSStart==0) {
|
||||
/* all levels are at paraLevel */
|
||||
pLineBiDi->direction=(UBiDiDirection)(pLineBiDi->paraLevel&1);
|
||||
} else {
|
||||
/* get the level of the first character */
|
||||
level=(UBiDiLevel)(levels[0]&1);
|
||||
|
||||
/* if there is anything of a different level, then the line is mixed */
|
||||
if(trailingWSStart<length && (pLineBiDi->paraLevel&1)!=level) {
|
||||
/* the trailing WS is at paraLevel, which differs from levels[0] */
|
||||
pLineBiDi->direction=UBIDI_MIXED;
|
||||
} else {
|
||||
/* see if levels[1..trailingWSStart-1] have the same direction as levels[0] and paraLevel */
|
||||
i=1;
|
||||
for(;;) {
|
||||
if(i==trailingWSStart) {
|
||||
/* the direction values match those in level */
|
||||
pLineBiDi->direction=(UBiDiDirection)level;
|
||||
break;
|
||||
} else if((levels[i]&1)!=level) {
|
||||
pLineBiDi->direction=UBIDI_MIXED;
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch(pLineBiDi->direction) {
|
||||
case UBIDI_LTR:
|
||||
/* make sure paraLevel is even */
|
||||
pLineBiDi->paraLevel=(UBiDiLevel)((pLineBiDi->paraLevel+1)&~1);
|
||||
|
||||
/* all levels are implicitly at paraLevel (important for ubidi_getLevels()) */
|
||||
pLineBiDi->trailingWSStart=0;
|
||||
break;
|
||||
case UBIDI_RTL:
|
||||
/* make sure paraLevel is odd */
|
||||
pLineBiDi->paraLevel|=1;
|
||||
|
||||
/* all levels are implicitly at paraLevel (important for ubidi_getLevels()) */
|
||||
pLineBiDi->trailingWSStart=0;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/* create an object for a zero-length line */
|
||||
pLineBiDi->direction=pLineBiDi->paraLevel&1 ? UBIDI_RTL : UBIDI_LTR;
|
||||
pLineBiDi->trailingWSStart=pLineBiDi->runCount=0;
|
||||
|
||||
pLineBiDi->dirProps=NULL;
|
||||
pLineBiDi->levels=NULL;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
U_CAPI UBiDiLevel U_EXPORT2
|
||||
ubidi_getLevelAt(const UBiDi *pBiDi, int32_t charIndex) {
|
||||
/* return paraLevel if in the trailing WS run, otherwise the real level */
|
||||
if(pBiDi==NULL || charIndex<0 || pBiDi->length<=charIndex) {
|
||||
return 0;
|
||||
} else if(pBiDi->direction!=UBIDI_MIXED || charIndex>=pBiDi->trailingWSStart) {
|
||||
return pBiDi->paraLevel;
|
||||
} else {
|
||||
return pBiDi->levels[charIndex];
|
||||
}
|
||||
}
|
||||
|
||||
U_CAPI const UBiDiLevel * U_EXPORT2
|
||||
ubidi_getLevels(UBiDi *pBiDi, UErrorCode *pErrorCode) {
|
||||
int32_t start, length;
|
||||
|
||||
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
|
||||
return NULL;
|
||||
} else if(pBiDi==NULL || (length=pBiDi->length)<=0) {
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if((start=pBiDi->trailingWSStart)==length) {
|
||||
/* the current levels array reflects the WS run */
|
||||
return pBiDi->levels;
|
||||
}
|
||||
|
||||
/*
|
||||
* After the previous if(), we know that the levels array
|
||||
* has an implicit trailing WS run and therefore does not fully
|
||||
* reflect itself all the levels.
|
||||
* This must be a UBiDi object for a line, and
|
||||
* we need to create a new levels array.
|
||||
*/
|
||||
|
||||
if(getLevelsMemory(pBiDi, length)) {
|
||||
UBiDiLevel *levels=pBiDi->levelsMemory;
|
||||
|
||||
if(start>0 && levels!=pBiDi->levels) {
|
||||
icu_memcpy(levels, pBiDi->levels, start);
|
||||
}
|
||||
icu_memset(levels+start, pBiDi->paraLevel, length-start);
|
||||
|
||||
/* this new levels array is set for the line and reflects the WS run */
|
||||
pBiDi->trailingWSStart=length;
|
||||
return pBiDi->levels=levels;
|
||||
} else {
|
||||
/* out of memory */
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_getLogicalRun(const UBiDi *pBiDi, int32_t logicalStart,
|
||||
int32_t *pLogicalLimit, UBiDiLevel *pLevel) {
|
||||
int32_t length;
|
||||
|
||||
if(pBiDi==NULL || logicalStart<0 || (length=pBiDi->length)<=logicalStart) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(pBiDi->direction!=UBIDI_MIXED || logicalStart>=pBiDi->trailingWSStart) {
|
||||
if(pLogicalLimit!=NULL) {
|
||||
*pLogicalLimit=length;
|
||||
}
|
||||
if(pLevel!=NULL) {
|
||||
*pLevel=pBiDi->paraLevel;
|
||||
}
|
||||
} else {
|
||||
UBiDiLevel *levels=pBiDi->levels;
|
||||
UBiDiLevel level=levels[logicalStart];
|
||||
|
||||
/* search for the end of the run */
|
||||
length=pBiDi->trailingWSStart;
|
||||
while(++logicalStart<length && level==levels[logicalStart]) {}
|
||||
|
||||
if(pLogicalLimit!=NULL) {
|
||||
*pLogicalLimit=logicalStart;
|
||||
}
|
||||
if(pLevel!=NULL) {
|
||||
*pLevel=level;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* handle trailing WS (L1) -------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* setTrailingWSStart() sets the start index for a trailing
|
||||
* run of WS in the line. This is necessary because we do not modify
|
||||
* the paragraph's levels array that we just point into.
|
||||
* Using trailingWSStart is another form of performing (L1).
|
||||
*
|
||||
* To make subsequent operations easier, we also include the run
|
||||
* before the WS if it is at the paraLevel - we merge the two here.
|
||||
*/
|
||||
static void
|
||||
setTrailingWSStart(UBiDi *pBiDi) {
|
||||
/* pBiDi->direction!=UBIDI_MIXED */
|
||||
|
||||
const DirProp *dirProps=pBiDi->dirProps;
|
||||
UBiDiLevel *levels=pBiDi->levels;
|
||||
int32_t start=pBiDi->length;
|
||||
UBiDiLevel paraLevel=pBiDi->paraLevel;
|
||||
|
||||
/* go backwards across all WS, BN, explicit codes */
|
||||
while(start>0 && DIRPROP_FLAG(dirProps[start-1])&MASK_WS) {
|
||||
--start;
|
||||
}
|
||||
|
||||
/* if the WS run can be merged with the previous run then do so here */
|
||||
while(start>0 && levels[start-1]==paraLevel) {
|
||||
--start;
|
||||
}
|
||||
|
||||
pBiDi->trailingWSStart=start;
|
||||
}
|
||||
|
||||
/* runs API functions ------------------------------------------------------- */
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ubidi_countRuns(UBiDi *pBiDi, UErrorCode *pErrorCode) {
|
||||
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
|
||||
return -1;
|
||||
} else if(pBiDi==NULL || (pBiDi->runCount<0 && !ubidi_getRuns(pBiDi))) {
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return -1;
|
||||
} else {
|
||||
return pBiDi->runCount;
|
||||
}
|
||||
}
|
||||
|
||||
U_CAPI UBiDiDirection U_EXPORT2
|
||||
ubidi_getVisualRun(UBiDi *pBiDi, int32_t runIndex,
|
||||
int32_t *pLogicalStart, int32_t *pLength) {
|
||||
if( pBiDi==NULL || runIndex<0 ||
|
||||
(pBiDi->runCount==-1 && !ubidi_getRuns(pBiDi)) ||
|
||||
runIndex>=pBiDi->runCount
|
||||
) {
|
||||
return UBIDI_LTR;
|
||||
} else {
|
||||
int32_t start=pBiDi->runs[runIndex].logicalStart;
|
||||
if(pLogicalStart!=NULL) {
|
||||
*pLogicalStart=GET_INDEX(start);
|
||||
}
|
||||
if(pLength!=NULL) {
|
||||
if(runIndex>0) {
|
||||
*pLength=pBiDi->runs[runIndex].visualLimit-
|
||||
pBiDi->runs[runIndex-1].visualLimit;
|
||||
} else {
|
||||
*pLength=pBiDi->runs[0].visualLimit;
|
||||
}
|
||||
}
|
||||
return (UBiDiDirection)GET_ODD_BIT(start);
|
||||
}
|
||||
}
|
||||
|
||||
/* compute the runs array --------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Compute the runs array from the levels array.
|
||||
* After ubidi_getRuns() returns TRUE, runCount is guaranteed to be >0
|
||||
* and the runs are reordered.
|
||||
* Odd-level runs have visualStart on their visual right edge and
|
||||
* they progress visually to the left.
|
||||
*/
|
||||
U_CFUNC bool_t
|
||||
ubidi_getRuns(UBiDi *pBiDi) {
|
||||
if(pBiDi->direction!=UBIDI_MIXED) {
|
||||
/* simple, single-run case - this covers length==0 */
|
||||
getSingleRun(pBiDi, pBiDi->paraLevel);
|
||||
} else /* UBIDI_MIXED, length>0 */ {
|
||||
/* mixed directionality */
|
||||
int32_t length=pBiDi->length, limit;
|
||||
|
||||
/*
|
||||
* If there are WS characters at the end of the line
|
||||
* and the run preceding them has a level different from
|
||||
* paraLevel, then they will form their own run at paraLevel (L1).
|
||||
* Count them separately.
|
||||
* We need some special treatment for this in order to not
|
||||
* modify the levels array which a line UBiDi object shares
|
||||
* with its paragraph parent and its other line siblings.
|
||||
* In other words, for the trailing WS, it may be
|
||||
* levels[]!=paraLevel but we have to treat it like it were so.
|
||||
*/
|
||||
limit=pBiDi->trailingWSStart;
|
||||
if(limit==0) {
|
||||
/* there is only WS on this line */
|
||||
getSingleRun(pBiDi, pBiDi->paraLevel);
|
||||
} else {
|
||||
UBiDiLevel *levels=pBiDi->levels;
|
||||
int32_t i, runCount;
|
||||
UBiDiLevel level=UBIDI_DEFAULT_LTR; /* initialize with no valid level */
|
||||
|
||||
/* count the runs, there is at least one non-WS run, and limit>0 */
|
||||
runCount=0;
|
||||
for(i=0; i<limit; ++i) {
|
||||
/* increment runCount at the start of each run */
|
||||
if(levels[i]!=level) {
|
||||
++runCount;
|
||||
level=levels[i];
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't need to see if the last run can be merged with a trailing
|
||||
* WS run because setTrailingWSStart() would have done that.
|
||||
*/
|
||||
if(runCount==1 && limit==length) {
|
||||
/* There is only one non-WS run and no trailing WS-run. */
|
||||
getSingleRun(pBiDi, levels[0]);
|
||||
} else /* runCount>1 || limit<length */ {
|
||||
/* allocate and set the runs */
|
||||
Run *runs;
|
||||
int32_t runIndex, start;
|
||||
UBiDiLevel minLevel=UBIDI_MAX_EXPLICIT_LEVEL+1, maxLevel=0;
|
||||
|
||||
/* now, count a (non-mergable) WS run */
|
||||
if(limit<length) {
|
||||
++runCount;
|
||||
}
|
||||
|
||||
/* runCount>1 */
|
||||
if(getRunsMemory(pBiDi, runCount)) {
|
||||
runs=pBiDi->runsMemory;
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* set the runs */
|
||||
/* this could be optimized, e.g.: 464->444, 484->444, 575->555, 595->555 */
|
||||
/* however, that would take longer and make other functions more complicated */
|
||||
runIndex=0;
|
||||
|
||||
/* search for the run limits and initialize visualLimit values with the run lengths */
|
||||
i=0;
|
||||
do {
|
||||
/* prepare this run */
|
||||
start=i;
|
||||
level=levels[i];
|
||||
if(level<minLevel) {
|
||||
minLevel=level;
|
||||
}
|
||||
if(level>maxLevel) {
|
||||
maxLevel=level;
|
||||
}
|
||||
|
||||
/* look for the run limit */
|
||||
while(++i<limit && levels[i]==level) {}
|
||||
|
||||
/* i is another run limit */
|
||||
runs[runIndex].logicalStart=start;
|
||||
runs[runIndex].visualLimit=i-start;
|
||||
++runIndex;
|
||||
} while(i<limit);
|
||||
|
||||
if(limit<length) {
|
||||
/* there is a separate WS run */
|
||||
runs[runIndex].logicalStart=limit;
|
||||
runs[runIndex].visualLimit=length-limit;
|
||||
if(pBiDi->paraLevel<minLevel) {
|
||||
minLevel=pBiDi->paraLevel;
|
||||
}
|
||||
}
|
||||
|
||||
/* set the object fields */
|
||||
pBiDi->runs=runs;
|
||||
pBiDi->runCount=runCount;
|
||||
|
||||
reorderLine(pBiDi, minLevel, maxLevel);
|
||||
|
||||
/* now add the direction flags and adjust the visualLimit's to be just that */
|
||||
ADD_ODD_BIT_FROM_LEVEL(runs[0].logicalStart, levels[runs[0].logicalStart]);
|
||||
limit=runs[0].visualLimit;
|
||||
for(i=1; i<runIndex; ++i) {
|
||||
ADD_ODD_BIT_FROM_LEVEL(runs[i].logicalStart, levels[runs[i].logicalStart]);
|
||||
limit=runs[i].visualLimit+=limit;
|
||||
}
|
||||
|
||||
/* same for the trailing WS run */
|
||||
if(runIndex<runCount) {
|
||||
ADD_ODD_BIT_FROM_LEVEL(runs[i].logicalStart, pBiDi->paraLevel);
|
||||
runs[runIndex].visualLimit+=limit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* in trivial cases there is only one trivial run; called by ubidi_getRuns() */
|
||||
static void
|
||||
getSingleRun(UBiDi *pBiDi, UBiDiLevel level) {
|
||||
/* simple, single-run case */
|
||||
pBiDi->runs=pBiDi->simpleRuns;
|
||||
pBiDi->runCount=1;
|
||||
|
||||
/* fill and reorder the single run */
|
||||
pBiDi->runs[0].logicalStart=MAKE_INDEX_ODD_PAIR(0, level);
|
||||
pBiDi->runs[0].visualLimit=pBiDi->length;
|
||||
}
|
||||
|
||||
/* reorder the runs array (L2) ---------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Reorder the same-level runs in the runs array.
|
||||
* Here, runCount>1 and maxLevel>=minLevel>=paraLevel.
|
||||
* All the visualStart fields=logical start before reordering.
|
||||
* The "odd" bits are not set yet.
|
||||
*
|
||||
* Reordering with this data structure lends itself to some handy shortcuts:
|
||||
*
|
||||
* Since each run is moved but not modified, and since at the initial maxLevel
|
||||
* each sequence of same-level runs consists of only one run each, we
|
||||
* don't need to do anything there and can predecrement maxLevel.
|
||||
* In many simple cases, the reordering is thus done entirely in the
|
||||
* index mapping.
|
||||
* Also, reordering occurs only down to the lowest odd level that occurs,
|
||||
* which is minLevel|1. However, if the lowest level itself is odd, then
|
||||
* in the last reordering the sequence of the runs at this level or higher
|
||||
* will be all runs, and we don't need the elaborate loop to search for them.
|
||||
* This is covered by ++minLevel instead of minLevel|=1 followed
|
||||
* by an extra reorder-all after the reorder-some loop.
|
||||
* About a trailing WS run:
|
||||
* Such a run would need special treatment because its level is not
|
||||
* reflected in levels[] if this is not a paragraph object.
|
||||
* Instead, all characters from trailingWSStart on are implicitly at
|
||||
* paraLevel.
|
||||
* However, for all maxLevel>paraLevel, this run will never be reordered
|
||||
* and does not need to be taken into account. maxLevel==paraLevel is only reordered
|
||||
* if minLevel==paraLevel is odd, which is done in the extra segment.
|
||||
* This means that for the main reordering loop we don't need to consider
|
||||
* this run and can --runCount. If it is later part of the all-runs
|
||||
* reordering, then runCount is adjusted accordingly.
|
||||
*/
|
||||
static void
|
||||
reorderLine(UBiDi *pBiDi, UBiDiLevel minLevel, UBiDiLevel maxLevel) {
|
||||
Run *runs;
|
||||
UBiDiLevel *levels;
|
||||
int32_t firstRun, endRun, limitRun, runCount,
|
||||
temp;
|
||||
|
||||
/* nothing to do? */
|
||||
if(maxLevel<=(minLevel|1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reorder only down to the lowest odd level
|
||||
* and reorder at an odd minLevel in a separate, simpler loop.
|
||||
* See comments above for why minLevel is always incremented.
|
||||
*/
|
||||
++minLevel;
|
||||
|
||||
runs=pBiDi->runs;
|
||||
levels=pBiDi->levels;
|
||||
runCount=pBiDi->runCount;
|
||||
|
||||
/* do not include the WS run at paraLevel<=old minLevel except in the simple loop */
|
||||
if(pBiDi->trailingWSStart<pBiDi->length) {
|
||||
--runCount;
|
||||
}
|
||||
|
||||
while(--maxLevel>=minLevel) {
|
||||
firstRun=0;
|
||||
|
||||
/* loop for all sequences of runs */
|
||||
for(;;) {
|
||||
/* look for a sequence of runs that are all at >=maxLevel */
|
||||
/* look for the first run of such a sequence */
|
||||
while(firstRun<runCount && levels[runs[firstRun].logicalStart]<maxLevel) {
|
||||
++firstRun;
|
||||
}
|
||||
if(firstRun>=runCount) {
|
||||
break; /* no more such runs */
|
||||
}
|
||||
|
||||
/* look for the limit run of such a sequence (the run behind it) */
|
||||
for(limitRun=firstRun; ++limitRun<runCount && levels[runs[limitRun].logicalStart]>=maxLevel;) {}
|
||||
|
||||
/* Swap the entire sequence of runs from firstRun to limitRun-1. */
|
||||
endRun=limitRun-1;
|
||||
while(firstRun<endRun) {
|
||||
temp=runs[firstRun].logicalStart;
|
||||
runs[firstRun].logicalStart=runs[endRun].logicalStart;
|
||||
runs[endRun].logicalStart=temp;
|
||||
|
||||
temp=runs[firstRun].visualLimit;
|
||||
runs[firstRun].visualLimit=runs[endRun].visualLimit;
|
||||
runs[endRun].visualLimit=temp;
|
||||
|
||||
++firstRun;
|
||||
--endRun;
|
||||
}
|
||||
|
||||
if(limitRun==runCount) {
|
||||
break; /* no more such runs */
|
||||
} else {
|
||||
firstRun=limitRun+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* now do maxLevel==old minLevel (==odd!), see above */
|
||||
if(!(minLevel&1)) {
|
||||
firstRun=0;
|
||||
|
||||
/* include the trailing WS run in this complete reordering */
|
||||
if(pBiDi->trailingWSStart==pBiDi->length) {
|
||||
--runCount;
|
||||
}
|
||||
|
||||
/* Swap the entire sequence of all runs. (endRun==runCount) */
|
||||
while(firstRun<runCount) {
|
||||
temp=runs[firstRun].logicalStart;
|
||||
runs[firstRun].logicalStart=runs[runCount].logicalStart;
|
||||
runs[runCount].logicalStart=temp;
|
||||
|
||||
temp=runs[firstRun].visualLimit;
|
||||
runs[firstRun].visualLimit=runs[runCount].visualLimit;
|
||||
runs[runCount].visualLimit=temp;
|
||||
|
||||
++firstRun;
|
||||
--runCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* reorder a line based on a levels array (L2) ------------------------------ */
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_reorderLogical(const UBiDiLevel *levels, int32_t length, int32_t *indexMap) {
|
||||
int32_t start, limit, sumOfSosEos;
|
||||
UBiDiLevel minLevel, maxLevel;
|
||||
|
||||
if(indexMap==NULL || !prepareReorder(levels, length, indexMap, &minLevel, &maxLevel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* nothing to do? */
|
||||
if(minLevel==maxLevel && (minLevel&1)==0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* reorder only down to the lowest odd level */
|
||||
minLevel|=1;
|
||||
|
||||
/* loop maxLevel..minLevel */
|
||||
do {
|
||||
start=0;
|
||||
|
||||
/* loop for all sequences of levels to reorder at the current maxLevel */
|
||||
for(;;) {
|
||||
/* look for a sequence of levels that are all at >=maxLevel */
|
||||
/* look for the first index of such a sequence */
|
||||
while(start<length && levels[start]<maxLevel) {
|
||||
++start;
|
||||
}
|
||||
if(start>=length) {
|
||||
break; /* no more such sequences */
|
||||
}
|
||||
|
||||
/* look for the limit of such a sequence (the index behind it) */
|
||||
for(limit=start; ++limit<length && levels[limit]>=maxLevel;) {}
|
||||
|
||||
/*
|
||||
* sos=start of sequence, eos=end of sequence
|
||||
*
|
||||
* The closed (inclusive) interval from sos to eos includes all the logical
|
||||
* and visual indexes within this sequence. They are logically and
|
||||
* visually contiguous and in the same range.
|
||||
*
|
||||
* For each run, the new visual index=sos+eos-old visual index;
|
||||
* we pre-add sos+eos into sumOfSosEos ->
|
||||
* new visual index=sumOfSosEos-old visual index;
|
||||
*/
|
||||
sumOfSosEos=start+limit-1;
|
||||
|
||||
/* reorder each index in the sequence */
|
||||
do {
|
||||
indexMap[start]=sumOfSosEos-indexMap[start];
|
||||
} while(++start<limit);
|
||||
|
||||
/* start==limit */
|
||||
if(limit==length) {
|
||||
break; /* no more such sequences */
|
||||
} else {
|
||||
start=limit+1;
|
||||
}
|
||||
}
|
||||
} while(--maxLevel>=minLevel);
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_reorderVisual(const UBiDiLevel *levels, int32_t length, int32_t *indexMap) {
|
||||
int32_t start, end, limit, temp;
|
||||
UBiDiLevel minLevel, maxLevel;
|
||||
|
||||
if(indexMap==NULL || !prepareReorder(levels, length, indexMap, &minLevel, &maxLevel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* nothing to do? */
|
||||
if(minLevel==maxLevel && (minLevel&1)==0) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* reorder only down to the lowest odd level */
|
||||
minLevel|=1;
|
||||
|
||||
/* loop maxLevel..minLevel */
|
||||
do {
|
||||
start=0;
|
||||
|
||||
/* loop for all sequences of levels to reorder at the current maxLevel */
|
||||
for(;;) {
|
||||
/* look for a sequence of levels that are all at >=maxLevel */
|
||||
/* look for the first index of such a sequence */
|
||||
while(start<length && levels[start]<maxLevel) {
|
||||
++start;
|
||||
}
|
||||
if(start>=length) {
|
||||
break; /* no more such runs */
|
||||
}
|
||||
|
||||
/* look for the limit of such a sequence (the index behind it) */
|
||||
for(limit=start; ++limit<length && levels[limit]>=maxLevel;) {}
|
||||
|
||||
/*
|
||||
* Swap the entire interval of indexes from start to limit-1.
|
||||
* We don't need to swap the levels for the purpose of this
|
||||
* algorithm: the sequence of levels that we look at does not
|
||||
* move anyway.
|
||||
*/
|
||||
end=limit-1;
|
||||
while(start<end) {
|
||||
temp=indexMap[start];
|
||||
indexMap[start]=indexMap[end];
|
||||
indexMap[end]=temp;
|
||||
|
||||
++start;
|
||||
--end;
|
||||
}
|
||||
|
||||
if(limit==length) {
|
||||
break; /* no more such sequences */
|
||||
} else {
|
||||
start=limit+1;
|
||||
}
|
||||
}
|
||||
} while(--maxLevel>=minLevel);
|
||||
}
|
||||
|
||||
static bool_t
|
||||
prepareReorder(const UBiDiLevel *levels, int32_t length,
|
||||
int32_t *indexMap,
|
||||
UBiDiLevel *pMinLevel, UBiDiLevel *pMaxLevel) {
|
||||
int32_t start;
|
||||
UBiDiLevel level, minLevel, maxLevel;
|
||||
|
||||
if(levels==NULL || length<=0) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* determine minLevel and maxLevel */
|
||||
minLevel=UBIDI_MAX_EXPLICIT_LEVEL+1;
|
||||
maxLevel=0;
|
||||
for(start=length; start>0;) {
|
||||
level=levels[--start];
|
||||
if(level>UBIDI_MAX_EXPLICIT_LEVEL+1) {
|
||||
return FALSE;
|
||||
}
|
||||
if(level<minLevel) {
|
||||
minLevel=level;
|
||||
}
|
||||
if(level>maxLevel) {
|
||||
maxLevel=level;
|
||||
}
|
||||
}
|
||||
*pMinLevel=minLevel;
|
||||
*pMaxLevel=maxLevel;
|
||||
|
||||
/* initialize the index map */
|
||||
for(start=length; start>0;) {
|
||||
--start;
|
||||
indexMap[start]=start;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* API functions for logical<->visual mapping ------------------------------- */
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ubidi_getVisualIndex(UBiDi *pBiDi, int32_t logicalIndex, UErrorCode *pErrorCode) {
|
||||
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
|
||||
return 0;
|
||||
} else if(pBiDi==NULL) {
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
} else if(logicalIndex<0 || pBiDi->length<=logicalIndex) {
|
||||
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0;
|
||||
} else {
|
||||
/* we can do the trivial cases without the runs array */
|
||||
switch(pBiDi->direction) {
|
||||
case UBIDI_LTR:
|
||||
return logicalIndex;
|
||||
case UBIDI_RTL:
|
||||
return pBiDi->length-logicalIndex-1;
|
||||
default:
|
||||
if(pBiDi->runCount<0 && !ubidi_getRuns(pBiDi)) {
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
} else {
|
||||
Run *runs=pBiDi->runs;
|
||||
int32_t i, visualStart=0, offset, length;
|
||||
|
||||
/* linear search for the run, search on the visual runs */
|
||||
for(i=0;; ++i) {
|
||||
length=runs[i].visualLimit-visualStart;
|
||||
offset=logicalIndex-GET_INDEX(runs[i].logicalStart);
|
||||
if(offset>=0 && offset<length) {
|
||||
if(IS_EVEN_RUN(runs[i].logicalStart)) {
|
||||
/* LTR */
|
||||
return visualStart+offset;
|
||||
} else {
|
||||
/* RTL */
|
||||
return visualStart+length-offset-1;
|
||||
}
|
||||
}
|
||||
visualStart+=length;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U_CAPI int32_t U_EXPORT2
|
||||
ubidi_getLogicalIndex(UBiDi *pBiDi, int32_t visualIndex, UErrorCode *pErrorCode) {
|
||||
if(pErrorCode==NULL || U_FAILURE(*pErrorCode)) {
|
||||
return 0;
|
||||
} else if(pBiDi==NULL) {
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
return 0;
|
||||
} else if(visualIndex<0 || pBiDi->length<=visualIndex) {
|
||||
*pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR;
|
||||
return 0;
|
||||
} else {
|
||||
/* we can do the trivial cases without the runs array */
|
||||
switch(pBiDi->direction) {
|
||||
case UBIDI_LTR:
|
||||
return visualIndex;
|
||||
case UBIDI_RTL:
|
||||
return pBiDi->length-visualIndex-1;
|
||||
default:
|
||||
if(pBiDi->runCount<0 && !ubidi_getRuns(pBiDi)) {
|
||||
*pErrorCode=U_MEMORY_ALLOCATION_ERROR;
|
||||
return 0;
|
||||
} else {
|
||||
Run *runs=pBiDi->runs;
|
||||
int32_t i, runCount=pBiDi->runCount, start;
|
||||
|
||||
if(runCount<=10) {
|
||||
/* linear search for the run */
|
||||
for(i=0; visualIndex>=runs[i].visualLimit; ++i) {}
|
||||
} else {
|
||||
/* binary search for the run */
|
||||
int32_t begin=0, limit=runCount;
|
||||
|
||||
/* the middle if() will guaranteed find the run, we don't need a loop limit */
|
||||
for(;;) {
|
||||
i=(begin+limit)/2;
|
||||
if(visualIndex>=runs[i].visualLimit) {
|
||||
begin=i+1;
|
||||
} else if(i==0 || visualIndex>=runs[i-1].visualLimit) {
|
||||
break;
|
||||
} else {
|
||||
limit=i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
start=runs[i].logicalStart;
|
||||
if(IS_EVEN_RUN(start)) {
|
||||
/* LTR */
|
||||
/* the offset in runs[i] is visualIndex-runs[i-1].visualLimit */
|
||||
if(i>0) {
|
||||
visualIndex-=runs[i-1].visualLimit;
|
||||
}
|
||||
return GET_INDEX(start)+visualIndex;
|
||||
} else {
|
||||
/* RTL */
|
||||
return GET_INDEX(start)+runs[i].visualLimit-visualIndex-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_getLogicalMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode) {
|
||||
UBiDiLevel *levels;
|
||||
|
||||
/* ubidi_getLevels() checks all of its and our arguments */
|
||||
if((levels=(UBiDiLevel *)ubidi_getLevels(pBiDi, pErrorCode))==NULL) {
|
||||
/* no op */
|
||||
} else if(indexMap==NULL) {
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
} else {
|
||||
ubidi_reorderLogical(levels, pBiDi->length, indexMap);
|
||||
}
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_getVisualMap(UBiDi *pBiDi, int32_t *indexMap, UErrorCode *pErrorCode) {
|
||||
/* ubidi_countRuns() checks all of its and our arguments */
|
||||
if(ubidi_countRuns(pBiDi, pErrorCode)<=0) {
|
||||
/* no op */
|
||||
} else if(indexMap==NULL) {
|
||||
*pErrorCode=U_ILLEGAL_ARGUMENT_ERROR;
|
||||
} else {
|
||||
/* fill a visual-to-logical index map using the runs[] */
|
||||
Run *runs=pBiDi->runs, *runsLimit=runs+pBiDi->runCount;
|
||||
int32_t logicalStart, visualStart, visualLimit;
|
||||
|
||||
visualStart=0;
|
||||
for(; runs<runsLimit; ++runs) {
|
||||
logicalStart=runs->logicalStart;
|
||||
visualLimit=runs->visualLimit;
|
||||
if(IS_EVEN_RUN(logicalStart)) {
|
||||
do { /* LTR */
|
||||
*indexMap++ = logicalStart++;
|
||||
} while(++visualStart<visualLimit);
|
||||
} else {
|
||||
REMOVE_ODD_BIT(logicalStart);
|
||||
logicalStart+=visualLimit-visualStart; /* logicalLimit */
|
||||
do { /* RTL */
|
||||
*indexMap++ = --logicalStart;
|
||||
} while(++visualStart<visualLimit);
|
||||
}
|
||||
/* visualStart==visualLimit; */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
U_CAPI void U_EXPORT2
|
||||
ubidi_invertMap(const int32_t *srcMap, int32_t *destMap, int32_t length) {
|
||||
if(srcMap!=NULL && destMap!=NULL) {
|
||||
srcMap+=length;
|
||||
while(length>0) {
|
||||
destMap[*--srcMap]=--length;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,652 +0,0 @@
|
||||
/*
|
||||
* Portions Copyright 2000-2005 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corp. 1999-2003 - All Rights Reserved
|
||||
*
|
||||
* The original version of this source code and documentation is
|
||||
* copyrighted and owned by IBM. These materials are provided
|
||||
* under terms of a License Agreement between IBM and Sun.
|
||||
* This technology is protected by multiple US and International
|
||||
* patents. This notice and attribution to IBM may not be removed.
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* File UCHAR.CPP
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 11/30/1999 dfelt Creation. Extract from uchar.c, reduce to data
|
||||
* query only.
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#include "uchardir.h"
|
||||
|
||||
/* new 4.0 surrogate data */
|
||||
static uint32_t ASCII_START = 0x0;
|
||||
static uint32_t ASCII_LIMIT = 0x80;
|
||||
static uint8_t ASCII[] = {
|
||||
(uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12,
|
||||
(uint8_t)0x12, (uint8_t)0x08, (uint8_t)0x07, (uint8_t)0x08, (uint8_t)0x09, (uint8_t)0x07, (uint8_t)0x12, (uint8_t)0x12,
|
||||
(uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12,
|
||||
(uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x12, (uint8_t)0x07, (uint8_t)0x07, (uint8_t)0x07, (uint8_t)0x08,
|
||||
(uint8_t)0x09, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x04, (uint8_t)0x04, (uint8_t)0x04, (uint8_t)0x0a, (uint8_t)0x0a,
|
||||
(uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x04, (uint8_t)0x06, (uint8_t)0x04, (uint8_t)0x06, (uint8_t)0x03,
|
||||
(uint8_t)0x02, (uint8_t)0x02, (uint8_t)0x02, (uint8_t)0x02, (uint8_t)0x02, (uint8_t)0x02, (uint8_t)0x02, (uint8_t)0x02,
|
||||
(uint8_t)0x02, (uint8_t)0x02, (uint8_t)0x06, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x0a,
|
||||
(uint8_t)0x0a, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x0a,
|
||||
(uint8_t)0x0a, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x12,
|
||||
};
|
||||
static uint32_t RTL_START = 0x591;
|
||||
static uint32_t RTL_LIMIT = 0x671;
|
||||
static uint8_t RTL[] = {
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x11, (uint8_t)0x01, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x11, (uint8_t)0x01, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x01, (uint8_t)0x11, (uint8_t)0x01,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x01, (uint8_t)0x11, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01,
|
||||
(uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01,
|
||||
(uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01,
|
||||
(uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01,
|
||||
(uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01,
|
||||
(uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01,
|
||||
(uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01,
|
||||
(uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x01, (uint8_t)0x0d,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x06, (uint8_t)0x0d, (uint8_t)0x0a, (uint8_t)0x0a, (uint8_t)0x11,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x05,
|
||||
(uint8_t)0x05, (uint8_t)0x05, (uint8_t)0x05, (uint8_t)0x05, (uint8_t)0x05, (uint8_t)0x05, (uint8_t)0x05, (uint8_t)0x05,
|
||||
(uint8_t)0x05, (uint8_t)0x04, (uint8_t)0x05, (uint8_t)0x05, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x11,
|
||||
};
|
||||
static uint8_t t0[] = {
|
||||
(uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x9b, (uint8_t)0xab, (uint8_t)0xca, (uint8_t)0x99,
|
||||
(uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0xaa, (uint8_t)0xab,
|
||||
(uint8_t)0xcd, (uint8_t)0xd5, (uint8_t)0x55, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd5, (uint8_t)0x75, (uint8_t)0x74,
|
||||
(uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x7d, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xd9,
|
||||
(uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x9a, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99,
|
||||
(uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99,
|
||||
(uint8_t)0x7d, (uint8_t)0x55, (uint8_t)0x55, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0x55, (uint8_t)0x33, (uint8_t)0xd0, (uint8_t)0xdd, (uint8_t)0xd3, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x0d,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x88,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xd0,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0x0d, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x18, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88,
|
||||
(uint8_t)0x88, (uint8_t)0x18, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x18, (uint8_t)0x88, (uint8_t)0x18,
|
||||
(uint8_t)0x18, (uint8_t)0x81, (uint8_t)0x81, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x72, (uint8_t)0xdd,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22,
|
||||
(uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22,
|
||||
(uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x28, (uint8_t)0x88, (uint8_t)0x88,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x82, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22,
|
||||
(uint8_t)0x66, (uint8_t)0x66, (uint8_t)0x66, (uint8_t)0x66, (uint8_t)0x66, (uint8_t)0x56, (uint8_t)0x62, (uint8_t)0x22,
|
||||
(uint8_t)0x82, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22,
|
||||
(uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x82, (uint8_t)0x88,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x82, (uint8_t)0x28, (uint8_t)0x8d, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x22,
|
||||
(uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22,
|
||||
(uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x29,
|
||||
(uint8_t)0x28, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x82, (uint8_t)0x22, (uint8_t)0x22,
|
||||
(uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88,
|
||||
(uint8_t)0x08, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x80, (uint8_t)0x00,
|
||||
(uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x00,
|
||||
(uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x08, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x55, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x08, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x80, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x00,
|
||||
(uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x08, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x00,
|
||||
(uint8_t)0x05, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x80, (uint8_t)0x08,
|
||||
(uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd5, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x88,
|
||||
(uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x08, (uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x05,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x80,
|
||||
(uint8_t)0x08, (uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x08, (uint8_t)0x80, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x08, (uint8_t)0x08, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x00,
|
||||
(uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x80,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x88,
|
||||
(uint8_t)0x80, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x08, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0xc0, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xd0, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x80, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x05, (uint8_t)0x08, (uint8_t)0x00,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd8, (uint8_t)0x88, (uint8_t)0xc0,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xdd,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xdd,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xd0,
|
||||
(uint8_t)0xcc, (uint8_t)0xcc, (uint8_t)0xcc, (uint8_t)0xcc, (uint8_t)0xcc, (uint8_t)0xc9, (uint8_t)0x99, (uint8_t)0x01,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xca, (uint8_t)0xee, (uint8_t)0xee, (uint8_t)0xec,
|
||||
(uint8_t)0x55, (uint8_t)0x55, (uint8_t)0x5d, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0x0d, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0c,
|
||||
(uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99,
|
||||
(uint8_t)0x30, (uint8_t)0x00, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x55, (uint8_t)0xdd, (uint8_t)0xd0,
|
||||
(uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x55, (uint8_t)0xdd, (uint8_t)0xd0,
|
||||
(uint8_t)0x55, (uint8_t)0x55, (uint8_t)0x55, (uint8_t)0x55, (uint8_t)0x55, (uint8_t)0x55, (uint8_t)0x55, (uint8_t)0x55,
|
||||
(uint8_t)0x55, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0xdd, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xd0, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x0d, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x50,
|
||||
(uint8_t)0x00, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0x55, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33,
|
||||
(uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x33, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x3d, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x00,
|
||||
(uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x0d, (uint8_t)0x0d,
|
||||
(uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0xd0, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd0,
|
||||
(uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd0,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0xcd, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88,
|
||||
(uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xdd,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x8d, (uint8_t)0xd0, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xdd, (uint8_t)0xdd,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0xdd,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x0d,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x01, (uint8_t)0x81,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x15, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0xdd,
|
||||
(uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x22, (uint8_t)0x2d, (uint8_t)0x22,
|
||||
(uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x7d, (uint8_t)0x70, (uint8_t)0xd7, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd5,
|
||||
(uint8_t)0xdd, (uint8_t)0x55, (uint8_t)0xdd, (uint8_t)0xd0, (uint8_t)0xd5, (uint8_t)0x5d, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x0d, (uint8_t)0xd5, (uint8_t)0x55, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd5, (uint8_t)0x75, (uint8_t)0x74,
|
||||
(uint8_t)0x55, (uint8_t)0xdd, (uint8_t)0xd5, (uint8_t)0x50, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xdd, (uint8_t)0xd0,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x09, (uint8_t)0x99, (uint8_t)0xdd, (uint8_t)0x00,
|
||||
(uint8_t)0x0d, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x09, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x99, (uint8_t)0x98, (uint8_t)0x88, (uint8_t)0x88,
|
||||
(uint8_t)0x88, (uint8_t)0x80, (uint8_t)0x08, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x00, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x88, (uint8_t)0x88, (uint8_t)0x00,
|
||||
(uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x33,
|
||||
(uint8_t)0x09, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00, (uint8_t)0x00,
|
||||
};
|
||||
|
||||
static uint8_t t1[] = {
|
||||
(uint8_t)0x00, (uint8_t)0x01, (uint8_t)0x02, (uint8_t)0x03, (uint8_t)0x04, (uint8_t)0x05, (uint8_t)0x04, (uint8_t)0x06,
|
||||
(uint8_t)0x07, (uint8_t)0x08, (uint8_t)0x09, (uint8_t)0x0a, (uint8_t)0x0b, (uint8_t)0x0c, (uint8_t)0x0b, (uint8_t)0x0c,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0d, (uint8_t)0x0e, (uint8_t)0x0e, (uint8_t)0x0f, (uint8_t)0x10,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x12, (uint8_t)0x11, (uint8_t)0x13,
|
||||
(uint8_t)0x14, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x15,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x16, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x17, (uint8_t)0x18, (uint8_t)0x19, (uint8_t)0x1a, (uint8_t)0x1b, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1d, (uint8_t)0x1e, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x20, (uint8_t)0x21, (uint8_t)0x22, (uint8_t)0x23,
|
||||
(uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x24, (uint8_t)0x25, (uint8_t)0x26,
|
||||
(uint8_t)0x27, (uint8_t)0x28, (uint8_t)0x1f, (uint8_t)0x11, (uint8_t)0x29, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f,
|
||||
(uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x2a, (uint8_t)0x23, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x2b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x2c, (uint8_t)0x2d, (uint8_t)0x2e, (uint8_t)0x2f, (uint8_t)0x0b,
|
||||
(uint8_t)0x30, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x2c, (uint8_t)0x31, (uint8_t)0x0b, (uint8_t)0x2f, (uint8_t)0x32,
|
||||
(uint8_t)0x2b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x2c, (uint8_t)0x33, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x34,
|
||||
(uint8_t)0x2b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x2c, (uint8_t)0x35, (uint8_t)0x0b, (uint8_t)0x2f, (uint8_t)0x36,
|
||||
(uint8_t)0x30, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x37, (uint8_t)0x38, (uint8_t)0x39, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x3a, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x3b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x3c,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x3d, (uint8_t)0x3e, (uint8_t)0x3f, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x2c, (uint8_t)0x40, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x38, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x41, (uint8_t)0x42, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x43, (uint8_t)0x44, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x45, (uint8_t)0x46, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x47, (uint8_t)0x0b, (uint8_t)0x48, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x49,
|
||||
(uint8_t)0x4a, (uint8_t)0x4b, (uint8_t)0x11, (uint8_t)0x4c, (uint8_t)0x39, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x4d, (uint8_t)0x4e, (uint8_t)0x0b, (uint8_t)0x47, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x4f, (uint8_t)0x50, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x51, (uint8_t)0x0b, (uint8_t)0x51, (uint8_t)0x0b, (uint8_t)0x2f, (uint8_t)0x0b, (uint8_t)0x2f,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x52, (uint8_t)0x53, (uint8_t)0x54, (uint8_t)0x0b, (uint8_t)0x55,
|
||||
(uint8_t)0x56, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x57, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x58, (uint8_t)0x59, (uint8_t)0x5a, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x5b, (uint8_t)0x5c, (uint8_t)0x5d, (uint8_t)0x5d, (uint8_t)0x5e,
|
||||
(uint8_t)0x5f, (uint8_t)0x10, (uint8_t)0x60, (uint8_t)0x61, (uint8_t)0x10, (uint8_t)0x62, (uint8_t)0x63, (uint8_t)0x64,
|
||||
(uint8_t)0x65, (uint8_t)0x0b, (uint8_t)0x66, (uint8_t)0x67, (uint8_t)0x0b, (uint8_t)0x11, (uint8_t)0x68, (uint8_t)0x0b,
|
||||
(uint8_t)0x69, (uint8_t)0x6a, (uint8_t)0x6b, (uint8_t)0x6c, (uint8_t)0x6d, (uint8_t)0x6e, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x6f, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x70, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x05,
|
||||
(uint8_t)0x10, (uint8_t)0x71, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x04, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x72, (uint8_t)0x0b, (uint8_t)0x73, (uint8_t)0x0b, (uint8_t)0x74, (uint8_t)0x74,
|
||||
(uint8_t)0x74, (uint8_t)0x75, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x76, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x77, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x78,
|
||||
(uint8_t)0x10, (uint8_t)0x79, (uint8_t)0x79, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x7a, (uint8_t)0x10, (uint8_t)0x77, (uint8_t)0x10, (uint8_t)0x7b, (uint8_t)0x7c, (uint8_t)0x7d, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x7e, (uint8_t)0x10, (uint8_t)0x7f, (uint8_t)0x0b, (uint8_t)0x10, (uint8_t)0x80, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x78, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x10, (uint8_t)0x81, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x82,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x70, (uint8_t)0x0b, (uint8_t)0x80,
|
||||
(uint8_t)0x83, (uint8_t)0x10, (uint8_t)0x84, (uint8_t)0x85, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x86, (uint8_t)0x04, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x87,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x5e, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x10, (uint8_t)0x0b, (uint8_t)0x88,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x7d, (uint8_t)0x89, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x8a,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x8b, (uint8_t)0x0b, (uint8_t)0x8c,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x72, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x8d, (uint8_t)0x8e, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f,
|
||||
(uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f,
|
||||
(uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f,
|
||||
(uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f,
|
||||
(uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x8f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f,
|
||||
(uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x90,
|
||||
(uint8_t)0x11, (uint8_t)0x0b, (uint8_t)0x91, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x92, (uint8_t)0x93, (uint8_t)0x1f,
|
||||
(uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x1f, (uint8_t)0x27,
|
||||
(uint8_t)0x94, (uint8_t)0x03, (uint8_t)0x04, (uint8_t)0x05, (uint8_t)0x04, (uint8_t)0x05, (uint8_t)0x70, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x95, (uint8_t)0x96,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x97, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c, (uint8_t)0x1c,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x98, (uint8_t)0x99,
|
||||
(uint8_t)0x9a, (uint8_t)0x0b, (uint8_t)0x9b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x10, (uint8_t)0x72, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x9c, (uint8_t)0x74, (uint8_t)0x74, (uint8_t)0x74,
|
||||
(uint8_t)0x9d, (uint8_t)0x0b, (uint8_t)0x08, (uint8_t)0x08, (uint8_t)0x08, (uint8_t)0x08, (uint8_t)0x08, (uint8_t)0x08,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11,
|
||||
(uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x11, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
(uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b, (uint8_t)0x0b,
|
||||
};
|
||||
|
||||
static uint8_t ix[] = {
|
||||
(uint8_t)0x01, (uint8_t)0x23, (uint8_t)0x45, (uint8_t)0x67, (uint8_t)0x78, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x97, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x7a,
|
||||
(uint8_t)0xbc, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0xd7, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0xe7, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
(uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77, (uint8_t)0x77,
|
||||
};
|
||||
|
||||
#define LOWBITS 4
|
||||
#define MEDBITS 7
|
||||
#define HIGHBITS (21 - MEDBITS - LOWBITS)
|
||||
|
||||
#define HIGHSHIFT (LOWBITS + MEDBITS)
|
||||
|
||||
#define BLOCKSIZE (1 << LOWBITS)
|
||||
#define IBLOCKSIZE (1 << MEDBITS)
|
||||
#define ISIZE (1 << HIGHBITS)
|
||||
|
||||
#define BLOCKMASK (BLOCKSIZE - 1)
|
||||
#define IBLOCKMASK (IBLOCKSIZE - 1)
|
||||
#define IMASK (ISIZE - 1)
|
||||
|
||||
static uint8_t jx2i[] = {
|
||||
0, 1, 13, 2, 3, 4, 5, 6, 17, 18, 7, 8, 9, 10
|
||||
};
|
||||
|
||||
static uint8_t x2i[] = {
|
||||
/* LRE RLE PDF LRO RLO */
|
||||
11, 14, 16, 12, 15
|
||||
};
|
||||
|
||||
static UCharDirection u_getDirectionInternal(uint32_t cp) {
|
||||
int dc;
|
||||
int n;
|
||||
int bi = cp & BLOCKMASK;
|
||||
int ibi = (cp >> LOWBITS) & IBLOCKMASK;
|
||||
int i = (cp >> HIGHSHIFT) & IMASK;
|
||||
|
||||
n = ix[i >> 1];
|
||||
if ((i & 1) == 0) {
|
||||
n >>= 4;
|
||||
}
|
||||
n &= 0x0f;
|
||||
n = t1[n * IBLOCKSIZE + ibi];
|
||||
n = n * BLOCKSIZE + bi;
|
||||
dc = t0[n >> 1];
|
||||
if ((n & 1) == 0) {
|
||||
dc >>= 4;
|
||||
}
|
||||
dc &= 0x0f;
|
||||
if (dc > 13) {
|
||||
dc = x2i[cp - 0x202a];
|
||||
} else {
|
||||
dc = jx2i[dc];
|
||||
}
|
||||
return dc;
|
||||
}
|
||||
|
||||
UCharDirection u_getDirection(uint32_t cp) {
|
||||
if (cp < ASCII_LIMIT) {
|
||||
return ASCII[cp];
|
||||
}
|
||||
if (cp < RTL_START) {
|
||||
return u_getDirectionInternal(cp);
|
||||
}
|
||||
if (cp < RTL_LIMIT) {
|
||||
return RTL[cp - RTL_START];
|
||||
}
|
||||
if (cp < 0x110000) {
|
||||
return u_getDirectionInternal(cp);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
UCharDirection
|
||||
u_charDirection(UChar ch) {
|
||||
return u_getDirection(ch);
|
||||
}
|
||||
|
||||
#define LEAD_SURROGATE_SHIFT 10
|
||||
#define SURROGATE_OFFSET (0x010000 - (0xd800 << 10) - 0xdc00)
|
||||
|
||||
UCharDirection
|
||||
u_surrogatePairDirection(UChar lead, UChar trail) {
|
||||
uint32_t cp = ((uint32_t)lead << LEAD_SURROGATE_SHIFT) + trail + SURROGATE_OFFSET;
|
||||
return u_getDirection(cp);
|
||||
}
|
@ -1,100 +0,0 @@
|
||||
/*
|
||||
* Portions Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* (C) Copyright IBM Corp. 1999-2003 - All Rights Reserved
|
||||
*
|
||||
* The original version of this source code and documentation is
|
||||
* copyrighted and owned by IBM. These materials are provided
|
||||
* under terms of a License Agreement between IBM and Sun.
|
||||
* This technology is protected by multiple US and International
|
||||
* patents. This notice and attribution to IBM may not be removed.
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* File UCHARDIR.H
|
||||
*
|
||||
* Modification History:
|
||||
*
|
||||
* Date Name Description
|
||||
* 11/30/1999 dfelt Creation. Copied UCharDirection from uchar.h
|
||||
********************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef UCHARDIR_H
|
||||
#define UCHARDIR_H
|
||||
|
||||
#include "utypes.h"
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Unicode version number */
|
||||
/*===========================================================================*/
|
||||
#define UNICODE_VERSION "3.0.0.beta"
|
||||
|
||||
enum UCharDirection {
|
||||
U_LEFT_TO_RIGHT = 0,
|
||||
U_RIGHT_TO_LEFT = 1,
|
||||
U_EUROPEAN_NUMBER = 2,
|
||||
U_EUROPEAN_NUMBER_SEPARATOR = 3,
|
||||
U_EUROPEAN_NUMBER_TERMINATOR = 4,
|
||||
U_ARABIC_NUMBER = 5,
|
||||
U_COMMON_NUMBER_SEPARATOR = 6,
|
||||
U_BLOCK_SEPARATOR = 7,
|
||||
U_SEGMENT_SEPARATOR = 8,
|
||||
U_WHITE_SPACE_NEUTRAL = 9,
|
||||
U_OTHER_NEUTRAL = 10,
|
||||
U_LEFT_TO_RIGHT_EMBEDDING = 11,
|
||||
U_LEFT_TO_RIGHT_OVERRIDE = 12,
|
||||
U_RIGHT_TO_LEFT_ARABIC = 13,
|
||||
U_RIGHT_TO_LEFT_EMBEDDING = 14,
|
||||
U_RIGHT_TO_LEFT_OVERRIDE = 15,
|
||||
U_POP_DIRECTIONAL_FORMAT = 16,
|
||||
U_DIR_NON_SPACING_MARK = 17,
|
||||
U_BOUNDARY_NEUTRAL = 18,
|
||||
U_CHAR_DIRECTION_COUNT
|
||||
};
|
||||
|
||||
typedef enum UCharDirection UCharDirection;
|
||||
|
||||
/**
|
||||
* Returns the linguistic direction property of a character.
|
||||
* <P>
|
||||
* Returns the linguistic direction property of a character.
|
||||
* For example, 0x0041 (letter A) has the LEFT_TO_RIGHT directional
|
||||
* property.
|
||||
* @see UCharDirection
|
||||
*/
|
||||
U_CAPI UCharDirection U_EXPORT2
|
||||
u_charDirection(UChar c);
|
||||
|
||||
U_CAPI UCharDirection U_EXPORT2
|
||||
u_getDirection(uint32_t cp);
|
||||
|
||||
U_CAPI UCharDirection U_EXPORT2
|
||||
u_surrogatePairDirection(UChar lead, UChar trail);
|
||||
|
||||
#endif /*_UCHAR*/
|
||||
/*eof*/
|
@ -1,177 +0,0 @@
|
||||
/*
|
||||
* Portions Copyright 2000-2003 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Sun designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Sun in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
|
||||
/*
|
||||
* (C) Copyright Taligent, Inc., 1996, 1997 *
|
||||
* (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
|
||||
*
|
||||
* The original version of this source code and documentation is
|
||||
* copyrighted and owned by IBM. These materials are provided
|
||||
* under terms of a License Agreement between IBM and Sun.
|
||||
* This technology is protected by multiple US and International
|
||||
* patents. This notice and attribution to IBM may not be removed.
|
||||
*/
|
||||
|
||||
/*
|
||||
*
|
||||
* FILE NAME : UTYPES.H (formerly ptypes.h)
|
||||
*
|
||||
* Date Name Description
|
||||
* 12/11/96 helena Creation.
|
||||
* 02/27/97 aliu Added typedefs for UClassID, int8, int16, int32,
|
||||
* uint8, uint16, and uint32.
|
||||
* 04/01/97 aliu Added XP_CPLUSPLUS and modified to work under C as
|
||||
* well as C++.
|
||||
* Modified to use memcpy() for icu_arrayCopy() fns.
|
||||
* 04/14/97 aliu Added TPlatformUtilities.
|
||||
* 05/07/97 aliu Added import/export specifiers (replacing the old
|
||||
* broken EXT_CLASS). Added version number for our
|
||||
* code. Cleaned up header.
|
||||
* 6/20/97 helena Java class name change.
|
||||
* 08/11/98 stephen UErrorCode changed from typedef to enum
|
||||
* 08/12/98 erm Changed T_ANALYTIC_PACKAGE_VERSION to 3
|
||||
* 08/14/98 stephen Added icu_arrayCopy() for int8_t, int16_t, int32_t
|
||||
* 12/09/98 jfitz Added BUFFER_OVERFLOW_ERROR (bug 1100066)
|
||||
* 04/20/99 stephen Cleaned up & reworked for autoconf.
|
||||
* Renamed to utypes.h.
|
||||
* 05/05/99 stephen Changed to use <inttypes.h>
|
||||
* 10/12/00 dfelt Adapted to use javavm types (plus juint from j2d)
|
||||
*******************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef UTYPES_H
|
||||
#define UTYPES_H
|
||||
|
||||
// doesn't seem to be a way of getting around this
|
||||
|
||||
//#if defined(WIN32) || defined(_WIN32)
|
||||
// not needed since we don't export to another dll
|
||||
|
||||
#if 0
|
||||
|
||||
#define U_EXPORT __declspec(dllexport)
|
||||
#define U_EXPORT2
|
||||
#define U_IMPORT __declspec(dllimport)
|
||||
|
||||
#else
|
||||
|
||||
#define U_EXPORT
|
||||
#define U_EXPORT2
|
||||
#define U_IMPORT
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef XP_CPLUSPLUS
|
||||
# define U_CFUNC extern "C"
|
||||
# define U_CDECL_BEGIN extern "C" {
|
||||
# define U_CDECL_END }
|
||||
#else
|
||||
# define U_CFUNC
|
||||
# define U_CDECL_BEGIN
|
||||
# define U_CDECL_END
|
||||
#endif
|
||||
#define U_CAPI U_CFUNC U_EXPORT
|
||||
|
||||
// defines jboolean, jchar, jshort, and jint via jni_md.h
|
||||
#include "jni.h"
|
||||
// defines jubyte, jushort, juint
|
||||
#include "j2d_md.h"
|
||||
|
||||
typedef jboolean bool_t;
|
||||
|
||||
/*
|
||||
* win32 does not have standard definitions for the following:
|
||||
*/
|
||||
#ifdef WIN32
|
||||
|
||||
#ifndef __int8_t_defined
|
||||
typedef jbyte int8_t;
|
||||
typedef jshort int16_t;
|
||||
typedef jint int32_t;
|
||||
#endif
|
||||
|
||||
typedef jubyte uint8_t;
|
||||
typedef jushort uint16_t;
|
||||
typedef juint uint32_t;
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Unicode character */
|
||||
/*===========================================================================*/
|
||||
typedef uint16_t UChar;
|
||||
|
||||
|
||||
/** Error code to replace exception handling */
|
||||
enum UErrorCode {
|
||||
U_ERROR_INFO_START = -128, /* Start of information results (semantically successful) */
|
||||
U_USING_FALLBACK_ERROR = -128,
|
||||
U_USING_DEFAULT_ERROR = -127,
|
||||
U_ERROR_INFO_LIMIT,
|
||||
|
||||
U_ZERO_ERROR = 0, /* success */
|
||||
|
||||
U_ILLEGAL_ARGUMENT_ERROR = 1, /* Start of codes indicating failure */
|
||||
U_MISSING_RESOURCE_ERROR = 2,
|
||||
U_INVALID_FORMAT_ERROR = 3,
|
||||
U_FILE_ACCESS_ERROR = 4,
|
||||
U_INTERNAL_PROGRAM_ERROR = 5, /* Indicates a bug in the library code */
|
||||
U_MESSAGE_PARSE_ERROR = 6,
|
||||
U_MEMORY_ALLOCATION_ERROR = 7, /* Memory allocation error */
|
||||
U_INDEX_OUTOFBOUNDS_ERROR = 8,
|
||||
U_PARSE_ERROR = 9, /* Equivalent to Java ParseException */
|
||||
U_INVALID_CHAR_FOUND = 10, /* In the Character conversion routines: Invalid character or sequence was encountered*/
|
||||
U_TRUNCATED_CHAR_FOUND = 11, /* In the Character conversion routines: More bytes are required to complete the conversion successfully*/
|
||||
U_ILLEGAL_CHAR_FOUND = 12, /* In codeset conversion: a sequence that does NOT belong in the codepage has been encountered*/
|
||||
U_INVALID_TABLE_FORMAT = 13, /* Conversion table file found, but corrupted*/
|
||||
U_INVALID_TABLE_FILE = 14, /* Conversion table file not found*/
|
||||
U_BUFFER_OVERFLOW_ERROR = 15, /* A result would not fit in the supplied buffer */
|
||||
U_UNSUPPORTED_ERROR = 16, /* Requested operation not supported in current context */
|
||||
U_ERROR_LIMIT
|
||||
};
|
||||
|
||||
#ifndef XP_CPLUSPLUS
|
||||
typedef enum UErrorCode UErrorCode;
|
||||
#endif
|
||||
|
||||
/* Use the following to determine if an UErrorCode represents */
|
||||
/* operational success or failure. */
|
||||
#ifdef XP_CPLUSPLUS
|
||||
inline bool_t U_SUCCESS(UErrorCode code) { return (bool_t)(code<=U_ZERO_ERROR); }
|
||||
inline bool_t U_FAILURE(UErrorCode code) { return (bool_t)(code>U_ZERO_ERROR); }
|
||||
#else
|
||||
#define U_SUCCESS(x) ((x)<=U_ZERO_ERROR)
|
||||
#define U_FAILURE(x) ((x)>U_ZERO_ERROR)
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
# define TRUE 1
|
||||
#endif
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
#endif
|
||||
|
||||
// UTYPES_H
|
||||
#endif
|
@ -36,7 +36,8 @@
|
||||
#define LE_USE_CMEMORY
|
||||
|
||||
#ifdef LE_USE_CMEMORY
|
||||
#include "cmemory.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#ifndef _LP64
|
||||
|
@ -337,7 +337,7 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {
|
||||
char errmsg[128];
|
||||
int xinawareScreen;
|
||||
void* xrenderLibHandle = NULL;
|
||||
XRenderFindVisualFormatFunc *XRenderFindVisualFormat = NULL;
|
||||
XRenderFindVisualFormatFunc* xrenderFindVisualFormat = NULL;
|
||||
int major_opcode, first_event, first_error;
|
||||
|
||||
if (usingXinerama) {
|
||||
@ -435,7 +435,7 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {
|
||||
#endif
|
||||
|
||||
if (xrenderLibHandle != NULL) {
|
||||
XRenderFindVisualFormat =
|
||||
xrenderFindVisualFormat =
|
||||
(XRenderFindVisualFormatFunc*)dlsym(xrenderLibHandle,
|
||||
"XRenderFindVisualFormat");
|
||||
}
|
||||
@ -454,8 +454,8 @@ getAllConfigs (JNIEnv *env, int screen, AwtScreenDataPtr screenDataPtr) {
|
||||
graphicsConfigs [ind]->awt_depth = pVITrue [i].depth;
|
||||
memcpy (&graphicsConfigs [ind]->awt_visInfo, &pVITrue [i],
|
||||
sizeof (XVisualInfo));
|
||||
if (XRenderFindVisualFormat != NULL) {
|
||||
XRenderPictFormat *format = XRenderFindVisualFormat (awt_display,
|
||||
if (xrenderFindVisualFormat != NULL) {
|
||||
XRenderPictFormat *format = xrenderFindVisualFormat (awt_display,
|
||||
pVITrue [i].visual);
|
||||
if (format &&
|
||||
format->type == PictTypeDirect &&
|
||||
|
@ -48,6 +48,7 @@
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/keysym.h>
|
||||
#include <X11/keysymdef.h>
|
||||
#include <X11/extensions/Xrender.h>
|
||||
#ifndef XAWT
|
||||
#include <Xm/CascadeB.h>
|
||||
#include <Xm/DrawingA.h>
|
||||
@ -120,48 +121,8 @@ typedef struct _DamageRect {
|
||||
|
||||
#ifndef HEADLESS
|
||||
|
||||
/* Note: until we include the <X11/extensions/Xrender.h> explicitly
|
||||
* we have to define a couple of things ourselves.
|
||||
*/
|
||||
typedef unsigned long PictFormat;
|
||||
#define PictTypeIndexed 0
|
||||
#define PictTypeDirect 1
|
||||
|
||||
typedef struct {
|
||||
short red;
|
||||
short redMask;
|
||||
short green;
|
||||
short greenMask;
|
||||
short blue;
|
||||
short blueMask;
|
||||
short alpha;
|
||||
short alphaMask;
|
||||
} XRenderDirectFormat;
|
||||
|
||||
typedef struct {
|
||||
PictFormat id;
|
||||
int type;
|
||||
int depth;
|
||||
XRenderDirectFormat direct;
|
||||
Colormap colormap;
|
||||
} XRenderPictFormat;
|
||||
|
||||
#define PictFormatID (1 << 0)
|
||||
#define PictFormatType (1 << 1)
|
||||
#define PictFormatDepth (1 << 2)
|
||||
#define PictFormatRed (1 << 3)
|
||||
#define PictFormatRedMask (1 << 4)
|
||||
#define PictFormatGreen (1 << 5)
|
||||
#define PictFormatGreenMask (1 << 6)
|
||||
#define PictFormatBlue (1 << 7)
|
||||
#define PictFormatBlueMask (1 << 8)
|
||||
#define PictFormatAlpha (1 << 9)
|
||||
#define PictFormatAlphaMask (1 << 10)
|
||||
#define PictFormatColormap (1 << 11)
|
||||
|
||||
typedef XRenderPictFormat *
|
||||
XRenderFindVisualFormatFunc (Display *dpy, _Xconst Visual *visual);
|
||||
/* END OF Xrender.h chunk */
|
||||
|
||||
typedef struct _AwtGraphicsConfigData {
|
||||
int awt_depth;
|
||||
|
@ -1254,6 +1254,8 @@ void SpyWinMessage(HWND hwnd, UINT message, LPCTSTR szComment) {
|
||||
WIN_MSG(WM_AWT_CREATECONTEXT)
|
||||
WIN_MSG(WM_AWT_DESTROYCONTEXT)
|
||||
WIN_MSG(WM_AWT_ASSOCIATECONTEXT)
|
||||
WIN_MSG(WM_AWT_GET_DEFAULT_IME_HANDLER)
|
||||
WIN_MSG(WM_AWT_HANDLE_NATIVE_IME_EVENT)
|
||||
WIN_MSG(WM_AWT_PRE_KEYDOWN)
|
||||
WIN_MSG(WM_AWT_PRE_KEYUP)
|
||||
WIN_MSG(WM_AWT_PRE_SYSKEYDOWN)
|
||||
@ -3334,7 +3336,13 @@ AwtComponent::BuildPrimaryDynamicTable() {
|
||||
// reset
|
||||
resetKbdState( kbdState );
|
||||
}else {
|
||||
printf ("++++Whats that? wkey 0x%x (%d)\n", i,i);
|
||||
// k > 1: this key does generate multiple characters. Ignore it.
|
||||
// An example: Arabic Lam and Alef ligature.
|
||||
// There will be no extended keycode and thus shortcuts for this key.
|
||||
// XXX shouldn't we reset the kbd state?
|
||||
#ifdef DEBUG
|
||||
DTRACE_PRINTLN2("wkey 0x%02X (%d)", i,i);
|
||||
#endif
|
||||
}
|
||||
kbdState[i] = 0; // "key unpressed"
|
||||
}
|
||||
|
@ -91,16 +91,19 @@ Java_sun_awt_windows_WInputMethod_enableNativeIME(JNIEnv *env, jobject self, job
|
||||
{
|
||||
TRY;
|
||||
|
||||
//get C++ Class of Focused Component
|
||||
if (peer == 0) return;
|
||||
AwtComponent* p = (AwtComponent*)JNI_GET_PDATA(peer);
|
||||
if (p == 0) return;
|
||||
jobject selfGlobalRef = env->NewGlobalRef(self);
|
||||
jobject peerGlobalRef = env->NewGlobalRef(peer);
|
||||
|
||||
p->SetInputMethod(self, useNativeCompWindow);
|
||||
EnableNativeIMEStruct *enis = new EnableNativeIMEStruct;
|
||||
|
||||
enis->self = selfGlobalRef;
|
||||
enis->peer = peerGlobalRef;
|
||||
enis->context = context;
|
||||
enis->useNativeCompWindow = useNativeCompWindow;
|
||||
|
||||
// use special message to call ImmAssociateContext() in main thread.
|
||||
AwtToolkit::GetInstance().SendMessage(WM_AWT_ASSOCIATECONTEXT,
|
||||
reinterpret_cast<WPARAM>(p->GetHWnd()), context);
|
||||
reinterpret_cast<WPARAM>(enis), (LPARAM)0);
|
||||
// global refs are deleted in message handler
|
||||
|
||||
CATCH_BAD_ALLOC;
|
||||
}
|
||||
@ -116,16 +119,18 @@ Java_sun_awt_windows_WInputMethod_disableNativeIME(JNIEnv *env, jobject self, jo
|
||||
{
|
||||
TRY_NO_VERIFY;
|
||||
|
||||
//get C++ Class of Focused Component
|
||||
if (peer == 0) return;
|
||||
AwtComponent* p = (AwtComponent*)JNI_GET_PDATA(peer);
|
||||
if (p == 0) return;
|
||||
jobject peerGlobalRef = env->NewGlobalRef(peer);
|
||||
// self reference is not used
|
||||
|
||||
p->SetInputMethod(NULL, TRUE);
|
||||
EnableNativeIMEStruct *enis = new EnableNativeIMEStruct;
|
||||
enis->self = NULL;
|
||||
enis->peer = peerGlobalRef;
|
||||
enis->context = NULL;
|
||||
enis->useNativeCompWindow = JNI_TRUE;
|
||||
|
||||
// use special message to call ImmAssociateContext() in main thread.
|
||||
AwtToolkit::GetInstance().SendMessage(WM_AWT_ASSOCIATECONTEXT,
|
||||
reinterpret_cast<WPARAM>(p->GetHWnd()), NULL);
|
||||
reinterpret_cast<WPARAM>(enis), (LPARAM)0);
|
||||
// global refs are deleted in message handler
|
||||
|
||||
CATCH_BAD_ALLOC;
|
||||
}
|
||||
@ -167,23 +172,14 @@ Java_sun_awt_windows_WInputMethod_handleNativeIMEEvent(JNIEnv *env, jobject self
|
||||
if (id >= java_awt_event_InputMethodEvent_INPUT_METHOD_FIRST &&
|
||||
id <= java_awt_event_InputMethodEvent_INPUT_METHOD_LAST)
|
||||
{
|
||||
long modifiers = p->GetJavaModifiers();
|
||||
if (msg.message==WM_CHAR || msg.message==WM_SYSCHAR) {
|
||||
WCHAR unicodeChar = L'\0';
|
||||
unicodeChar = (WCHAR)msg.wParam;
|
||||
p->SendKeyEvent(java_awt_event_KeyEvent_KEY_TYPED,
|
||||
0, //to be fixed nowMillis(),
|
||||
java_awt_event_KeyEvent_CHAR_UNDEFINED,
|
||||
unicodeChar,
|
||||
modifiers,
|
||||
java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN, (jlong)0,
|
||||
&msg);
|
||||
} else {
|
||||
MSG* pCopiedMsg = new MSG;
|
||||
*pCopiedMsg = msg;
|
||||
p->SendMessage(WM_AWT_HANDLE_EVENT, (WPARAM) FALSE,
|
||||
(LPARAM) pCopiedMsg);
|
||||
}
|
||||
jobject peerGlobalRef = env->NewGlobalRef(peer);
|
||||
|
||||
// use special message to access pData on the toolkit thread
|
||||
AwtToolkit::GetInstance().SendMessage(WM_AWT_HANDLE_NATIVE_IME_EVENT,
|
||||
reinterpret_cast<WPARAM>(peerGlobalRef),
|
||||
reinterpret_cast<LPARAM>(&msg));
|
||||
// global ref is deleted in message handler
|
||||
|
||||
(env)->SetBooleanField(event, AwtAWTEvent::consumedID, JNI_TRUE);
|
||||
}
|
||||
|
||||
@ -373,22 +369,27 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WInputMethod_setStatusWindowVisible
|
||||
Windows system creates a default input method window for the
|
||||
toolkit thread.
|
||||
*/
|
||||
HWND hwndIME = AwtToolkit::GetInstance().GetInputMethodWindow();
|
||||
if (hwndIME == NULL) {
|
||||
if (peer == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
AwtComponent* p = (AwtComponent*)JNI_GET_PDATA(peer);
|
||||
if (p == NULL || (hwndIME = ImmGetDefaultIMEWnd(p->GetHWnd())) == NULL) {
|
||||
return;
|
||||
}
|
||||
HWND defaultIMEHandler = AwtToolkit::GetInstance().GetInputMethodWindow();
|
||||
|
||||
AwtToolkit::GetInstance().SetInputMethodWindow(hwndIME);
|
||||
if (defaultIMEHandler == NULL)
|
||||
{
|
||||
jobject peerGlobalRef = env->NewGlobalRef(peer);
|
||||
|
||||
// use special message to access pData on the toolkit thread
|
||||
LRESULT res = AwtToolkit::GetInstance().SendMessage(WM_AWT_GET_DEFAULT_IME_HANDLER,
|
||||
reinterpret_cast<WPARAM>(peerGlobalRef), 0);
|
||||
// global ref is deleted in message handler
|
||||
|
||||
if (res == TRUE) {
|
||||
defaultIMEHandler = AwtToolkit::GetInstance().GetInputMethodWindow();
|
||||
}
|
||||
}
|
||||
|
||||
::SendMessage(hwndIME, WM_IME_CONTROL,
|
||||
visible ? IMC_OPENSTATUSWINDOW : IMC_CLOSESTATUSWINDOW, 0);
|
||||
if (defaultIMEHandler != NULL) {
|
||||
::SendMessage(defaultIMEHandler, WM_IME_CONTROL,
|
||||
visible ? IMC_OPENSTATUSWINDOW : IMC_CLOSESTATUSWINDOW, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -417,6 +418,7 @@ JNIEXPORT void JNICALL Java_sun_awt_windows_WInputMethod_openCandidateWindow
|
||||
// use special message to open candidate window in main thread.
|
||||
AwtToolkit::GetInstance().SendMessage(WM_AWT_OPENCANDIDATEWINDOW,
|
||||
(WPARAM)peerGlobalRef, MAKELONG(x, y));
|
||||
// global ref is deleted in message handler
|
||||
|
||||
CATCH_BAD_ALLOC;
|
||||
}
|
||||
|
@ -804,8 +804,73 @@ LRESULT CALLBACK AwtToolkit::WndProc(HWND hWnd, UINT message,
|
||||
return 0;
|
||||
}
|
||||
case WM_AWT_ASSOCIATECONTEXT: {
|
||||
AwtComponent *p = AwtComponent::GetComponent((HWND)wParam);
|
||||
p->ImmAssociateContext((HIMC)lParam);
|
||||
EnableNativeIMEStruct *data = (EnableNativeIMEStruct*)wParam;
|
||||
|
||||
jobject peer = data->peer;
|
||||
jobject self = data->self;
|
||||
jint context = data->context;
|
||||
jboolean useNativeCompWindow = data->useNativeCompWindow;
|
||||
|
||||
AwtComponent* comp = (AwtComponent*)JNI_GET_PDATA(peer);
|
||||
if (comp != NULL)
|
||||
{
|
||||
comp->SetInputMethod(self, useNativeCompWindow);
|
||||
comp->ImmAssociateContext((HIMC)context);
|
||||
}
|
||||
|
||||
if (peer != NULL) {
|
||||
env->DeleteGlobalRef(peer);
|
||||
}
|
||||
if (self != NULL) {
|
||||
env->DeleteGlobalRef(self);
|
||||
}
|
||||
|
||||
delete data;
|
||||
return 0;
|
||||
}
|
||||
case WM_AWT_GET_DEFAULT_IME_HANDLER: {
|
||||
LRESULT ret = (LRESULT)FALSE;
|
||||
jobject peer = (jobject)wParam;
|
||||
|
||||
AwtComponent* comp = (AwtComponent*)JNI_GET_PDATA(peer);
|
||||
if (comp != NULL) {
|
||||
HWND defaultIMEHandler = ImmGetDefaultIMEWnd(comp->GetHWnd());
|
||||
if (defaultIMEHandler != NULL) {
|
||||
AwtToolkit::GetInstance().SetInputMethodWindow(defaultIMEHandler);
|
||||
ret = (LRESULT)TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (peer != NULL) {
|
||||
env->DeleteGlobalRef(peer);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
case WM_AWT_HANDLE_NATIVE_IME_EVENT: {
|
||||
jobject peer = (jobject)wParam;
|
||||
AwtComponent* comp = (AwtComponent*)JNI_GET_PDATA(peer);
|
||||
MSG* msg = (MSG*)lParam;
|
||||
|
||||
long modifiers = comp->GetJavaModifiers();
|
||||
if ((comp != NULL) && (msg->message==WM_CHAR || msg->message==WM_SYSCHAR)) {
|
||||
WCHAR unicodeChar = (WCHAR)msg->wParam;
|
||||
comp->SendKeyEvent(java_awt_event_KeyEvent_KEY_TYPED,
|
||||
0, //to be fixed nowMillis(),
|
||||
java_awt_event_KeyEvent_CHAR_UNDEFINED,
|
||||
unicodeChar,
|
||||
modifiers,
|
||||
java_awt_event_KeyEvent_KEY_LOCATION_UNKNOWN, (jlong)0,
|
||||
msg);
|
||||
} else if (comp != NULL) {
|
||||
MSG* pCopiedMsg = new MSG;
|
||||
*pCopiedMsg = *msg;
|
||||
comp->SendMessage(WM_AWT_HANDLE_EVENT, (WPARAM) FALSE,
|
||||
(LPARAM) pCopiedMsg);
|
||||
}
|
||||
|
||||
if (peer != NULL) {
|
||||
env->DeleteGlobalRef(peer);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case WM_AWT_ENDCOMPOSITION: {
|
||||
|
@ -61,6 +61,14 @@ class AwtDropTarget;
|
||||
typedef VOID (CALLBACK* IDLEPROC)(VOID);
|
||||
typedef BOOL (CALLBACK* PEEKMESSAGEPROC)(MSG&);
|
||||
|
||||
// Struct for _WInputMethod_enable|disableNativeIME method
|
||||
struct EnableNativeIMEStruct {
|
||||
jobject self;
|
||||
jobject peer;
|
||||
jint context;
|
||||
jboolean useNativeCompWindow;
|
||||
};
|
||||
|
||||
/*
|
||||
* class JNILocalFrame
|
||||
* Push/PopLocalFrame helper
|
||||
|
@ -208,6 +208,8 @@ enum {
|
||||
WM_AWT_CREATECONTEXT,
|
||||
WM_AWT_DESTROYCONTEXT,
|
||||
WM_AWT_ASSOCIATECONTEXT,
|
||||
WM_AWT_GET_DEFAULT_IME_HANDLER,
|
||||
WM_AWT_HANDLE_NATIVE_IME_EVENT,
|
||||
WM_AWT_PRE_KEYDOWN,
|
||||
WM_AWT_PRE_KEYUP,
|
||||
WM_AWT_PRE_SYSKEYDOWN,
|
||||
|
@ -0,0 +1,22 @@
|
||||
<HTML>
|
||||
<!-- @test
|
||||
@bug 4023283
|
||||
@summary Checks that an Error which propogate up to the EventDispatch
|
||||
loop does not crash AWT.
|
||||
@author Andrei Dmitriev: area=awt.event
|
||||
@library ../../regtesthelpers
|
||||
@build Util
|
||||
@run main LoopRobustness
|
||||
-->
|
||||
<HEAD>
|
||||
<TITLE>LoopRobustness</TITLE>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
This is automatic test.
|
||||
|
||||
<APPLET CODE="LoopRobustness.class"
|
||||
CODEBASE = "."
|
||||
WIDTH=350 HEIGHT=100>
|
||||
</APPLET>
|
||||
</BODY>
|
||||
</HTML>
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,7 +26,10 @@
|
||||
* @bug 4023283
|
||||
* @summary Checks that an Error which propogate up to the EventDispatch
|
||||
* loop does not crash AWT.
|
||||
* @author Andrei Dmitriev Oleg Sukhodolsky
|
||||
* @author Andrei Dmitriev: area=awt.event
|
||||
* @library ../../regtesthelpers
|
||||
* @build Util
|
||||
* @run main LoopRobustness
|
||||
*/
|
||||
|
||||
import java.awt.*;
|
||||
|
@ -59,7 +59,6 @@ public class SystemBgColorTest {
|
||||
if (errcount > 0) {
|
||||
throw new RuntimeException(errcount+" errors");
|
||||
}
|
||||
System.exit(0); // For 1.3 and earlier VMs...
|
||||
}
|
||||
|
||||
static int cmap[] = {
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4827312
|
||||
* @bug 4827312 6850113
|
||||
* @summary verify that argument validity check is not fooled by overflow
|
||||
*/
|
||||
public class BidiBug {
|
||||
@ -33,9 +33,9 @@ public class BidiBug {
|
||||
java.text.Bidi bidi = new java.text.Bidi(new char[20],10,buff,Integer.MAX_VALUE-3,4,1);
|
||||
}
|
||||
catch (IllegalArgumentException e) {
|
||||
System.out.println(e);
|
||||
System.out.println("Passed: " + e);
|
||||
return; // success
|
||||
}
|
||||
throw new RuntimeException("didn't throw error, though we didn't crash either");
|
||||
throw new RuntimeException("Failed: Bidi didn't throw error, though we didn't crash either");
|
||||
}
|
||||
}
|
||||
|
2334
jdk/test/java/text/Bidi/BidiConformance.java
Normal file
2334
jdk/test/java/text/Bidi/BidiConformance.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,7 @@
|
||||
|
||||
/*
|
||||
* @test
|
||||
* @bug 4396492 4396496 4778510
|
||||
* @bug 4396492 4396496 4778510 6850113
|
||||
* @summary verify that the embedding values processed by the bidi code use negative values to
|
||||
* indicate overrides, rather than using bit 7. Also tests Bidi without loading awt classes to
|
||||
* confirm that Bidi can be used without awt. Verify that embedding level 0 is properly mapped
|
||||
@ -89,10 +89,12 @@ public class BidiEmbeddingTest {
|
||||
" at level " + bidi2.getRunLevel(i));
|
||||
}
|
||||
|
||||
System.out.println(bidi2);
|
||||
System.out.println(bidi2 + "\n");
|
||||
|
||||
if (bidi.getRunCount() != 3 || bidi2.getRunCount() != 3) {
|
||||
throw new Error("Bidi run count incorrect");
|
||||
} else {
|
||||
System.out.println("test1() passed.\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -123,10 +125,12 @@ public class BidiEmbeddingTest {
|
||||
" at level " + bidi.getRunLevel(i));
|
||||
}
|
||||
|
||||
System.out.println(bidi);
|
||||
System.out.println(bidi + "\n");
|
||||
|
||||
if (bidi.getRunCount() != 6) { // runs of spaces and angles at embedding bound,s and final period, each get level 1
|
||||
throw new Error("Bidi embedding processing failed");
|
||||
} else {
|
||||
System.out.println("test2() passed.\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
60
jdk/test/java/text/Bidi/Bug6850113.java
Normal file
60
jdk/test/java/text/Bidi/Bug6850113.java
Normal file
@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
|
||||
* CA 95054 USA or visit www.sun.com if you need additional information or
|
||||
* have any questions.
|
||||
*/
|
||||
/*
|
||||
* @test
|
||||
* @bug 6850113
|
||||
* @summary Verify the return value of digit() for some digits.
|
||||
*/
|
||||
|
||||
import sun.text.normalizer.UCharacter;
|
||||
|
||||
public class Bug6850113 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
boolean err = false;
|
||||
|
||||
// Fullwidth Latin capital letters
|
||||
for (int i = 0xff21, j = 10; i <= 0xff3a; i++, j++) {
|
||||
if (UCharacter.digit(i, 36) != j) {
|
||||
err = true;
|
||||
System.out.println("Error: UCharacter.digit(0x" +
|
||||
Integer.toHexString(i) + ", 36) returned " +
|
||||
UCharacter.digit(i, 36) + ", expected=" + j);
|
||||
}
|
||||
}
|
||||
|
||||
// Fullwidth Latin small letters
|
||||
for (int i = 0xff41, j = 10; i <= 0xff5a; i++, j++) {
|
||||
if (UCharacter.digit(i, 36) != j) {
|
||||
err = true;
|
||||
System.out.println("Error: UCharacter.digit(0x" +
|
||||
Integer.toHexString(i) + ", 36) returned " +
|
||||
UCharacter.digit(i, 36) + ", expected=" + j);
|
||||
}
|
||||
}
|
||||
|
||||
if (err) {
|
||||
throw new RuntimeException("UCharacter.digit(): Wrong return value");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user