00001
00002
00003
00004
00005
00006
00007
00008 #ifndef __LEGLYPHSTORAGE_H
00009 #define __LEGLYPHSTORAGE_H
00010
00011 #include "LETypes.h"
00012 #include "LEInsertionList.h"
00013
00019 U_NAMESPACE_BEGIN
00020
00034 class U_LAYOUT_API LEGlyphStorage : public UObject, protected LEInsertionCallback
00035 {
00036 private:
00042 le_int32 fGlyphCount;
00043
00049 LEGlyphID *fGlyphs;
00050
00056 le_int32 *fCharIndices;
00057
00063 float *fPositions;
00064
00070 le_uint32 *fAuxData;
00071
00072
00078 LEInsertionList *fInsertionList;
00079
00085 le_int32 fSrcIndex;
00086
00092 le_int32 fDestIndex;
00093
00094 protected:
00110 virtual le_bool applyInsertion(le_int32 atPosition, le_int32 count, LEGlyphID newGlyphs[]);
00111
00112 public:
00113
00121 LEGlyphStorage();
00122
00128 ~LEGlyphStorage();
00129
00137 inline le_int32 getGlyphCount() const;
00138
00149 void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
00150
00163 void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
00164
00175 void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
00176
00188 void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
00189
00201 void getGlyphPositions(float positions[], LEErrorCode &success) const;
00202
00217 void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
00218
00231 void allocateGlyphArray(le_int32 initialGlyphCount, le_bool rightToLeft, LEErrorCode &success);
00232
00243 le_int32 allocatePositions(LEErrorCode &success);
00244
00254 le_int32 allocateAuxData(LEErrorCode &success);
00255
00264 void getAuxData(le_uint32 auxData[], LEErrorCode &success) const;
00265
00276 LEGlyphID getGlyphID(le_int32 glyphIndex, LEErrorCode &success) const;
00277
00288 le_int32 getCharIndex(le_int32 glyphIndex, LEErrorCode &success) const;
00289
00290
00301 le_uint32 getAuxData(le_int32 glyphIndex, LEErrorCode &success) const;
00302
00313 inline LEGlyphID &operator[](le_int32 glyphIndex) const;
00314
00331 LEGlyphID *insertGlyphs(le_int32 atIndex, le_int32 insertCount);
00332
00345 le_int32 applyInsertions();
00346
00356 void setGlyphID(le_int32 glyphIndex, LEGlyphID glyphID, LEErrorCode &success);
00357
00367 void setCharIndex(le_int32 glyphIndex, le_int32 charIndex, LEErrorCode &success);
00368
00379 void setPosition(le_int32 glyphIndex, float x, float y, LEErrorCode &success);
00380
00391 void adjustPosition(le_int32 glyphIndex, float xAdjust, float yAdjust, LEErrorCode &success);
00392
00402 void setAuxData(le_int32 glyphIndex, le_uint32 auxData, LEErrorCode &success);
00403
00414 void adoptGlyphArray(LEGlyphStorage &from);
00415
00416 void appendGlyphStorage(LEGlyphStorage &from);
00417
00428 void adoptCharIndicesArray(LEGlyphStorage &from);
00429
00440 void adoptPositionArray(LEGlyphStorage &from);
00441
00452 void adoptAuxDataArray(LEGlyphStorage &from);
00453
00463 void adoptGlyphCount(LEGlyphStorage &from);
00464
00472 void adoptGlyphCount(le_int32 newGlyphCount);
00473
00482 void reset();
00483
00489 virtual UClassID getDynamicClassID() const;
00490
00496 static UClassID getStaticClassID();
00497 };
00498
00499 inline le_int32 LEGlyphStorage::getGlyphCount() const
00500 {
00501 return fGlyphCount;
00502 }
00503
00504 inline LEGlyphID &LEGlyphStorage::operator[](le_int32 glyphIndex) const
00505 {
00506 return fGlyphs[glyphIndex];
00507 }
00508
00509
00510 U_NAMESPACE_END
00511 #endif
00512