ICU 50.1.2  50.1.2
LEGlyphStorage.h
Go to the documentation of this file.
1 /*
2  **********************************************************************
3  * Copyright (C) 1998-2010, International Business Machines
4  * Corporation and others. All Rights Reserved.
5  **********************************************************************
6  */
7 
8 #ifndef __LEGLYPHSTORAGE_H
9 #define __LEGLYPHSTORAGE_H
10 
11 #include "LETypes.h"
12 #include "LEInsertionList.h"
13 
20 
34 class U_LAYOUT_API LEGlyphStorage : public UObject, protected LEInsertionCallback
35 {
36 private:
42  le_int32 fGlyphCount;
43 
49  LEGlyphID *fGlyphs;
50 
56  le_int32 *fCharIndices;
57 
63  float *fPositions;
64 
70  le_uint32 *fAuxData;
71 
72 
78  LEInsertionList *fInsertionList;
79 
85  le_int32 fSrcIndex;
86 
92  le_int32 fDestIndex;
93 
94 protected:
110  virtual le_bool applyInsertion(le_int32 atPosition, le_int32 count, LEGlyphID newGlyphs[]);
111 
112 public:
113 
121  LEGlyphStorage();
122 
128  ~LEGlyphStorage();
129 
137  inline le_int32 getGlyphCount() const;
138 
149  void getGlyphs(LEGlyphID glyphs[], LEErrorCode &success) const;
150 
163  void getGlyphs(le_uint32 glyphs[], le_uint32 extraBits, LEErrorCode &success) const;
164 
175  void getCharIndices(le_int32 charIndices[], LEErrorCode &success) const;
176 
188  void getCharIndices(le_int32 charIndices[], le_int32 indexBase, LEErrorCode &success) const;
189 
201  void getGlyphPositions(float positions[], LEErrorCode &success) const;
202 
217  void getGlyphPosition(le_int32 glyphIndex, float &x, float &y, LEErrorCode &success) const;
218 
231  void allocateGlyphArray(le_int32 initialGlyphCount, le_bool rightToLeft, LEErrorCode &success);
232 
243  le_int32 allocatePositions(LEErrorCode &success);
244 
254  le_int32 allocateAuxData(LEErrorCode &success);
255 
264  void getAuxData(le_uint32 auxData[], LEErrorCode &success) const;
265 
276  LEGlyphID getGlyphID(le_int32 glyphIndex, LEErrorCode &success) const;
277 
288  le_int32 getCharIndex(le_int32 glyphIndex, LEErrorCode &success) const;
289 
290 
301  le_uint32 getAuxData(le_int32 glyphIndex, LEErrorCode &success) const;
302 
313  inline LEGlyphID &operator[](le_int32 glyphIndex) const;
314 
332  LEGlyphID *insertGlyphs(le_int32 atIndex, le_int32 insertCount, LEErrorCode& success);
333 
352  LEGlyphID *insertGlyphs(le_int32 atIndex, le_int32 insertCount);
353 
367  void moveGlyph(le_int32 fromPosition, le_int32 toPosition, le_uint32 marker);
368 
381  le_int32 applyInsertions();
382 
392  void setGlyphID(le_int32 glyphIndex, LEGlyphID glyphID, LEErrorCode &success);
393 
403  void setCharIndex(le_int32 glyphIndex, le_int32 charIndex, LEErrorCode &success);
404 
415  void setPosition(le_int32 glyphIndex, float x, float y, LEErrorCode &success);
416 
427  void adjustPosition(le_int32 glyphIndex, float xAdjust, float yAdjust, LEErrorCode &success);
428 
438  void setAuxData(le_int32 glyphIndex, le_uint32 auxData, LEErrorCode &success);
439 
450  void adoptGlyphArray(LEGlyphStorage &from);
451 
462  void adoptCharIndicesArray(LEGlyphStorage &from);
463 
474  void adoptPositionArray(LEGlyphStorage &from);
475 
486  void adoptAuxDataArray(LEGlyphStorage &from);
487 
497  void adoptGlyphCount(LEGlyphStorage &from);
498 
506  void adoptGlyphCount(le_int32 newGlyphCount);
507 
516  void reset();
517 
523  virtual UClassID getDynamicClassID() const;
524 
530  static UClassID getStaticClassID();
531 };
532 
533 inline le_int32 LEGlyphStorage::getGlyphCount() const
534 {
535  return fGlyphCount;
536 }
537 
538 inline LEGlyphID &LEGlyphStorage::operator[](le_int32 glyphIndex) const
539 {
540  return fGlyphs[glyphIndex];
541 }
542 
543 
545 #endif
546 
uint32_t le_uint32
A type used for unsigned, 32-bit integers.
Definition: LETypes.h:41
#define U_LAYOUT_API
Set to export library symbols from inside the layout engine library, and to import them from outside...
Definition: utypes.h:359
virtual UClassID getDynamicClassID() const =0
ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition: uobject.h:96
C API: Basic definitions for the ICU LayoutEngine.
int32_t le_int32
A type used for signed, 32-bit integers.
Definition: LETypes.h:34
UBool le_bool
A type used for boolean values.
Definition: LETypes.h:77
#define U_NAMESPACE_BEGIN
This is used to begin a declaration of a public ICU C++ API.
Definition: uversion.h:129
LEErrorCode
Error codes returned by the LayoutEngine.
Definition: LETypes.h:678
#define U_NAMESPACE_END
This is used to end a declaration of a public ICU C++ API.
Definition: uversion.h:130
This class encapsulates the per-glyph storage used by the ICU LayoutEngine.
le_uint32 LEGlyphID
Used for glyph indices.
Definition: LETypes.h:112
UObject is the common ICU "boilerplate" class.
Definition: uobject.h:229