00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __LAYOUTENGINE_H
00009 #define __LAYOUTENGINE_H
00010
00011 #include "LETypes.h"
00012
00018 U_NAMESPACE_BEGIN
00019
00020 class LEFontInstance;
00021 class LEGlyphFilter;
00022 class LEGlyphStorage;
00023
00067 class U_LAYOUT_API LayoutEngine : public UObject {
00068 protected:
00074 LEGlyphStorage *fGlyphStorage;
00075
00083 const LEFontInstance *fFontInstance;
00084
00092 le_int32 fScriptCode;
00093
00101 le_int32 fLanguageCode;
00102
00108 le_int32 fTypoFlags;
00109
00125 LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typoFlags);
00126
00134 LayoutEngine();
00135
00158 virtual le_int32 characterProcessing(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft,
00159 LEUnicode *&outChars, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00160
00187 virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00188
00202 virtual void positionGlyphs(LEGlyphStorage &glyphStorage, float x, float y, LEErrorCode &success);
00203
00224 virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00225
00238 virtual const void *getFontTable(LETag tableTag) const;
00239
00265 virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphStorage &glyphStorage, LEErrorCode &success);
00266
00279 static void adjustMarkGlyphs(LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00280
00281
00300 static void adjustMarkGlyphs(const LEUnicode chars[], le_int32 charCount, le_bool reverse, LEGlyphStorage &glyphStorage, LEGlyphFilter *markFilter, LEErrorCode &success);
00301
00302
00303 public:
00312 virtual ~LayoutEngine();
00313
00335 virtual le_int32 layoutChars(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, float x, float y, LEErrorCode &success);
00336
00346 le_int32 getGlyphCount() const;
00347
00358 void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
00359
00372 virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
00373
00384 void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
00385
00397 void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
00398
00410 void getGlyphPositions(float positions[], LEErrorCode &success) const;
00411
00426 void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
00427
00435 virtual void reset();
00436
00453 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success);
00454
00459 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, le_int32 typo_flags, LEErrorCode &success);
00460
00466 virtual UClassID getDynamicClassID() const;
00467
00473 static UClassID getStaticClassID();
00474
00475 };
00476
00477 U_NAMESPACE_END
00478 #endif
00479