1 // © 2016 and later: Unicode, Inc. and others. 2 // License & terms of use: http://www.unicode.org/copyright.html 4 ********************************************************************** 5 * Copyright (C) 2003-2008, International Business Machines 6 * Corporation and others. All Rights Reserved. 7 ********************************************************************** 14 #include "layout/LETypes.h" 15 #include "layout/LEFontInstance.h" 32 #define INITIAL_CAPACITY 16 40 #define CAPACITY_GROW_LIMIT 128 64 inlineRunArray(
const le_int32 *limits, le_int32 count);
93 inline le_int32 getCount()
const;
113 inline le_int32 getLimit()
const;
124 inline le_int32 getLimit(le_int32 run)
const;
150 le_int32
add(le_int32 limit);
179 virtualvoidinit(le_int32 capacity);
193 virtualvoidgrow(le_int32 capacity);
211 staticconstchar fgClassID;
213 le_int32 ensureCapacity();
219 const le_int32 *fLimits;
224 inline RunArray::RunArray()
225 : UObject(), fClientArrays(false), fLimits(nullptr), fCount(0), fCapacity(0)
227 // nothing else to do... 230 inline RunArray::RunArray(
const RunArray &
/*other*/)
231 : UObject(), fClientArrays(false), fLimits(nullptr), fCount(0), fCapacity(0)
233 // nothing else to do... 236 inline RunArray::RunArray(
const le_int32 *limits, le_int32 count)
237 :
UObject(), fClientArrays(true), fLimits(limits), fCount(count), fCapacity(count)
239 // nothing else to do... 254 if (run < 0 || run >= fCount) {
290 inlineFontRuns(
const LEFontInstance **fonts,
const le_int32 *limits, le_int32 count);
325 const LEFontInstance *
getFont(le_int32 run)
const;
350 le_int32
add(
const LEFontInstance *font, le_int32 limit);
367 voidinit(le_int32 capacity)
override;
368 voidgrow(le_int32 capacity)
override;
380 staticconstchar fgClassID;
382 const LEFontInstance **fFonts;
385 inline FontRuns::FontRuns()
386 : RunArray(0), fFonts(nullptr)
388 // nothing else to do... 391 inline FontRuns::FontRuns(
const FontRuns &
/*other*/)
392 : RunArray(0), fFonts(nullptr)
394 // nothing else to do... 397 inline FontRuns::FontRuns(
const LEFontInstance **fonts,
const le_int32 *limits, le_int32 count)
398 :
RunArray(limits, count), fFonts(fonts)
400 // nothing else to do... 427 inlineLocaleRuns(
constLocale **locales,
const le_int32 *limits, le_int32 count);
504 voidinit(le_int32 capacity)
override;
505 voidgrow(le_int32 capacity)
override;
522 staticconstchar fgClassID;
525 inline LocaleRuns::LocaleRuns()
526 : RunArray(0), fLocales(nullptr)
528 // nothing else to do... 531 inline LocaleRuns::LocaleRuns(
const LocaleRuns &
/*other*/)
532 : RunArray(0), fLocales(nullptr)
534 // nothing else to do... 537 inline LocaleRuns::LocaleRuns(
constLocale **locales,
const le_int32 *limits, le_int32 count)
538 :
RunArray(limits, count), fLocales(locales)
540 // nothing else to do... 565 inlineValueRuns(
const le_int32 *values,
const le_int32 *limits, le_int32 count);
624 le_int32
add(le_int32 value, le_int32 limit);
641 voidinit(le_int32 capacity)
override;
642 voidgrow(le_int32 capacity)
override;
654 staticconstchar fgClassID;
656 const le_int32 *fValues;
659 inline ValueRuns::ValueRuns()
660 : RunArray(0), fValues(nullptr)
662 // nothing else to do... 665 inline ValueRuns::ValueRuns(
const ValueRuns &
/*other*/)
666 : RunArray(0), fValues(nullptr)
668 // nothing else to do... 671 inline ValueRuns::ValueRuns(
const le_int32 *values,
const le_int32 *limits, le_int32 count)
672 :
RunArray(limits, count), fValues(values)
674 // nothing else to do... The FontRuns class associates pointers to LEFontInstance objects with runs of text.
void grow(le_int32 capacity) override
Grow a data array to the given initial size.
virtual ~FontRuns()
The destructor; virtual so that subclass destructors are invoked as well.
UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
const LEFontInstance * getFont(le_int32 run) const
Get the LEFontInstance object associated with the given run of text.
FontRuns(le_int32 initialCapacity)
Construct an empty FontRuns object.
void init(le_int32 capacity) override
Create a data array with the given initial size.
le_int32 add(const LEFontInstance *font, le_int32 limit)
Add an LEFontInstance and limit index pair to the data arrays and return the run index where the data...
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
The LocaleRuns class associates pointers to Locale objects with runs of text.
virtual ~LocaleRuns()
The destructor; virtual so that subclass destructors are invoked as well.
void init(le_int32 capacity) override
Create a data array with the given initial size.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
LocaleRuns(le_int32 initialCapacity)
Construct an empty LocaleRuns object.
const Locale * getLocale(le_int32 run) const
Get the Locale object associated with the given run of text.
void grow(le_int32 capacity) override
Grow a data array to the given initial size.
le_int32 add(const Locale *locale, le_int32 limit)
Add a Locale and limit index pair to the data arrays and return the run index where the data was stor...
A Locale object represents a specific geographical, political, or cultural region.
The RunArray class is a base class for building classes which represent data that is associated with ...
virtual ~RunArray()
The destructor; virtual so that subclass destructors are invoked as well.
le_int32 getLimit() const
Get the last limit index.
virtual void grow(le_int32 capacity)
Grow a data array to the given initial size.
le_bool fClientArrays
Set by the constructors to indicate whether or not the client supplied the data arrays.
void reset()
Reset the limit indices array.
UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
virtual void init(le_int32 capacity)
Create a data array with the given initial size.
RunArray(le_int32 initialCapacity)
Construct an empty RunArray object.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
le_int32 getCount() const
Get the number of entries in the limit indices array.
le_int32 add(le_int32 limit)
Add a limit index to the limit indices array and return the run index where it was stored.
UObject is the common ICU "boilerplate" class.
The ValueRuns class associates integer values with runs of text.
virtual ~ValueRuns()
The destructor; virtual so that subclass destructors are invoked as well.
void init(le_int32 capacity) override
Create a data array with the given initial size.
UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
le_int32 add(le_int32 value, le_int32 limit)
Add an integer value and limit index pair to the data arrays and return the run index where the data ...
le_int32 getValue(le_int32 run) const
Get the integer value associated with the given run of text.
void grow(le_int32 capacity) override
Grow a data array to the given initial size.
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
ValueRuns(le_int32 initialCapacity)
Construct an empty ValueRuns object.
C++ API: Locale ID object.
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Basic definitions for ICU, for both C and C++ APIs.
#define U_LAYOUTEX_API
Set to export library symbols from inside the layout extensions library, and to import them from outs...