First public contribution.
3 * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved
7 #ifndef __THAISHAPING_H
8 #define __THAISHAPING_H
16 #include "LEGlyphFilter.h"
17 #include "OpenTypeTables.h"
23 class ThaiShaping /* not : public UObject because all methods are static */ {
49 // State Transition actions
61 struct StateTransition
66 le_uint8 getNextState() { return nextState; };
67 le_uint8 getAction() { return action; };
70 static le_int32 compose(const LEUnicode *input, le_int32 offset, le_int32 charCount, le_uint8 glyphSet,
71 LEUnicode errorChar, LEUnicode *output, LEGlyphStorage &glyphStorage);
74 // forbid instantiation
77 static const le_uint8 classTable[];
78 static const StateTransition thaiStateTable[][classCount];
80 inline static StateTransition getTransition(le_uint8 state, le_uint8 currClass);
82 static le_uint8 doTransition(StateTransition transition, LEUnicode currChar, le_int32 inputIndex, le_uint8 glyphSet,
83 LEUnicode errorChar, LEUnicode *outputBuffer, LEGlyphStorage &glyphStorage, le_int32 &outputIndex);
85 static le_uint8 getNextState(LEUnicode ch, le_uint8 state, le_int32 inputIndex, le_uint8 glyphSet, LEUnicode errorChar,
86 le_uint8 &charClass, LEUnicode *output, LEGlyphStorage &glyphStorage, le_int32 &outputIndex);
88 static le_bool isLegalHere(LEUnicode ch, le_uint8 prevState);
89 static le_uint8 getCharClass(LEUnicode ch);
91 static LEUnicode noDescenderCOD(LEUnicode cod, le_uint8 glyphSet);
92 static LEUnicode leftAboveVowel(LEUnicode vowel, le_uint8 glyphSet);
93 static LEUnicode lowerBelowVowel(LEUnicode vowel, le_uint8 glyphSet);
94 static LEUnicode lowerRightTone(LEUnicode tone, le_uint8 glyphSet);
95 static LEUnicode lowerLeftTone(LEUnicode tone, le_uint8 glyphSet);
96 static LEUnicode upperLeftTone(LEUnicode tone, le_uint8 glyphSet);
100 inline ThaiShaping::StateTransition ThaiShaping::getTransition(le_uint8 state, le_uint8 currClass)
102 return thaiStateTable[state][currClass];