00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef __LAYOUTENGINE_H
00010 #define __LAYOUTENGINE_H
00011
00012 #ifndef __LETYPES_H
00013 #include "LETypes.h"
00014 #endif
00015
00016 #include <string.h>
00017
00018 U_NAMESPACE_BEGIN
00019
00020 class LEFontInstance;
00021 class LEGlyphFilter;
00022
00066 class U_LAYOUT_API LayoutEngine : public UObject {
00067 protected:
00073 le_int32 fGlyphCount;
00074
00080 LEGlyphID *fGlyphs;
00081
00088 le_int32 *fCharIndices;
00089
00098 float *fPositions;
00099
00107 const LEFontInstance *fFontInstance;
00108
00116 le_int32 fScriptCode;
00117
00125 le_int32 fLanguageCode;
00126
00140 LayoutEngine(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode);
00141
00149 LayoutEngine();
00150
00177 virtual le_int32 computeGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_int32 max, le_bool rightToLeft, LEGlyphID *&glyphs, le_int32 *&charIndices, LEErrorCode &success);
00178
00195 virtual void positionGlyphs(const LEGlyphID glyphs[], le_int32 glyphCount, float x, float y, float *&positions, LEErrorCode &success);
00196
00221 virtual void adjustGlyphPositions(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool , LEGlyphID glyphs[], le_int32 glyphCount, float positions[], LEErrorCode &success);
00222
00235 virtual const void *getFontTable(LETag tableTag) const;
00236
00264 virtual void mapCharsToGlyphs(const LEUnicode chars[], le_int32 offset, le_int32 count, le_bool reverse, le_bool mirror, LEGlyphID *&glyphs, le_int32 *&charIndices, LEErrorCode &success);
00265
00281 static void adjustMarkGlyphs(const LEGlyphID glyphs[], le_int32 glyphCount, le_bool reverse, LEGlyphFilter *markFilter, float positions[], LEErrorCode &success);
00282
00283 public:
00292 virtual ~LayoutEngine();
00293
00315 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);
00316
00326 le_int32 getGlyphCount() const
00327 {
00328 return fGlyphCount;
00329 };
00330
00341 void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
00342
00355 virtual void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
00356
00367 void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
00368
00380 void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
00381
00393 void getGlyphPositions(float positions[], LEErrorCode &success) const;
00394
00409 void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
00410
00418 virtual void reset();
00419
00436 static LayoutEngine *layoutEngineFactory(const LEFontInstance *fontInstance, le_int32 scriptCode, le_int32 languageCode, LEErrorCode &success);
00437
00443 virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); }
00444
00450 static inline UClassID getStaticClassID() { return (UClassID)&fgClassID; }
00451
00452 private:
00453
00458 static const char fgClassID;
00459 };
00460
00461 U_NAMESPACE_END
00462 #endif
00463