/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
/*
*
* (C) Copyright IBM Corp. and others 1998-2013 - All Rights Reserved
*
*/
#include "LETypes.h"
#include "MorphTables.h"
#include "StateTables.h"
#include "MorphStateTables.h"
#include "SubtableProcessor2.h"
#include "StateTableProcessor2.h"
#include "IndicRearrangementProcessor2.h"
#include "LEGlyphStorage.h"
#include "LESwaps.h"
: StateTableProcessor2(morphSubtableHeader, success), indicRearrangementSubtableHeader(morphSubtableHeader, success),
{
}
{
}
{
firstGlyph = 0;
lastGlyph = 0;
}
le_uint16 IndicRearrangementProcessor2::processStateEntry(LEGlyphStorage &glyphStorage, le_int32 &currGlyph,
{
if (flags & irfMarkFirst) {
}
if (flags & irfMarkLast) {
}
if (!(flags & irfDontAdvance)) {
}
return newState; // index to new state
}
{
}
void IndicRearrangementProcessor2::doRearrangementAction(LEGlyphStorage &glyphStorage, IndicRearrangementVerb verb) const
{
LEGlyphID a, b, c, d;
switch(verb)
{
case irvNoAction:
break;
case irvxA:
a = glyphStorage[firstGlyph];
x = firstGlyph + 1;
while (x <= lastGlyph) {
x += 1;
}
glyphStorage[lastGlyph] = a;
break;
case irvDx:
d = glyphStorage[lastGlyph];
x = lastGlyph - 1;
while (x >= firstGlyph) {
x -= 1;
}
glyphStorage[firstGlyph] = d;
break;
case irvDxA:
a = glyphStorage[firstGlyph];
glyphStorage[lastGlyph] = a;
break;
case irvxAB:
a = glyphStorage[firstGlyph];
x = firstGlyph + 2;
while (x <= lastGlyph) {
x += 1;
}
glyphStorage[lastGlyph] = b;
break;
case irvxBA:
a = glyphStorage[firstGlyph];
x = firstGlyph + 2;
while (x <= lastGlyph) {
x += 1;
}
glyphStorage[lastGlyph] = a;
break;
case irvCDx:
d = glyphStorage[lastGlyph];
x = lastGlyph - 2;
while (x >= firstGlyph) {
x -= 1;
}
glyphStorage[firstGlyph] = c;
break;
case irvDCx:
d = glyphStorage[lastGlyph];
x = lastGlyph - 2;
while (x >= firstGlyph) {
x -= 1;
}
glyphStorage[firstGlyph] = d;
break;
case irvCDxA:
a = glyphStorage[firstGlyph];
d = glyphStorage[lastGlyph];
x = lastGlyph - 2;
while (x > firstGlyph) {
x -= 1;
}
glyphStorage[firstGlyph] = c;
glyphStorage[lastGlyph] = a;
break;
case irvDCxA:
a = glyphStorage[firstGlyph];
d = glyphStorage[lastGlyph];
x = lastGlyph - 2;
while (x > firstGlyph) {
x -= 1;
}
glyphStorage[firstGlyph] = d;
glyphStorage[lastGlyph] = a;
break;
case irvDxAB:
a = glyphStorage[firstGlyph];
d = glyphStorage[lastGlyph];
x = firstGlyph + 2;
while (x < lastGlyph) {
x += 1;
}
glyphStorage[firstGlyph] = d;
glyphStorage[lastGlyph] = b;
break;
case irvDxBA:
a = glyphStorage[firstGlyph];
d = glyphStorage[lastGlyph];
x = firstGlyph + 2;
while (x < lastGlyph) {
x += 1;
}
glyphStorage[firstGlyph] = d;
glyphStorage[lastGlyph] = a;
break;
case irvCDxAB:
a = glyphStorage[firstGlyph];
glyphStorage[lastGlyph] = b;
break;
case irvCDxBA:
a = glyphStorage[firstGlyph];
glyphStorage[lastGlyph] = a;
break;
case irvDCxAB:
a = glyphStorage[firstGlyph];
glyphStorage[lastGlyph] = b;
break;
case irvDCxBA:
a = glyphStorage[firstGlyph];
glyphStorage[lastGlyph] = a;
break;
default:
break;
}
}