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
00426 void adoptCharIndicesArray(LEGlyphStorage &from);
00427
00438 void adoptPositionArray(LEGlyphStorage &from);
00439
00450 void adoptAuxDataArray(LEGlyphStorage &from);
00451
00461 void adoptGlyphCount(LEGlyphStorage &from);
00462
00470 void adoptGlyphCount(le_int32 newGlyphCount);
00471
00480 void reset();
00481
00487 virtual UClassID getDynamicClassID() const;
00488
00494 static UClassID getStaticClassID();
00495 };
00496
00497 inline le_int32 LEGlyphStorage::getGlyphCount() const
00498 {
00499 return fGlyphCount;
00500 }
00501
00502 inline LEGlyphID &LEGlyphStorage::operator[](le_int32 glyphIndex) const
00503 {
00504 return fGlyphs[glyphIndex];
00505 }
00506
00507
00508 U_NAMESPACE_END
00509 #endif
00510