ICU-2243 implement boiler plate methods.

X-SVN-Rev: 11869
This commit is contained in:
Eric Mader 2003-05-09 20:37:58 +00:00
parent 12929b76f3
commit e063556b81
3 changed files with 89 additions and 6 deletions

View file

@ -458,7 +458,7 @@ le_int32 ParagraphLayout::getLeading() const
return fLeading;
}
const ParagraphLayout::Line *ParagraphLayout::nextLine(float width)
ParagraphLayout::Line *ParagraphLayout::nextLine(float width)
{
if (fLineEnd >= fCharCount) {
return NULL;
@ -749,7 +749,7 @@ le_int32 ParagraphLayout::previousBreak(le_int32 charIndex)
return fBreakIterator->preceding(charIndex + 1);
}
const ParagraphLayout::Line *ParagraphLayout::computeVisualRuns()
ParagraphLayout::Line *ParagraphLayout::computeVisualRuns()
{
UErrorCode bidiStatus = U_ZERO_ERROR;
le_int32 dirRunCount, visualRun;

View file

@ -148,6 +148,8 @@ public:
VisualRun **fRuns;
Line();
Line(const Line &other);
Line &operator=(const Line &other) { return *this; };
void computeMetrics();
@ -221,7 +223,7 @@ public:
/**
* Get the (x, y) positions of the glyphs in the visual run. To simplify storage
* management, the x and y positions are stored in a single array with the x positions
* at even offsets in the array and the corresponding y position in the following even offset.
* at even offsets in the array and the corresponding y position in the following odd offset.
* There is an extra (x, y) pair at the end of the array which represents the advance of
* the final glyph in the run.
*
@ -309,6 +311,8 @@ public:
friend class Line;
VisualRun();
VisualRun(const VisualRun &other);
VisualRun &operator=(const VisualRun &other) { return *this; };
VisualRun(const LEFontInstance *font, UBiDiDirection direction, le_int32 glyphCount,
const LEGlyphID glyphs[], const float positions[], const le_int32 glyphToCharMap[]);
@ -454,13 +458,14 @@ public:
* rest of the paragraph will be returned.
*
* @return a <code>ParagraphLayout::Line</code> object which represents the line. The caller
* is responsible for deleting the object.
* is responsible for deleting the object. Returns <code>NULL</code> if there are no
* more lines in the paragraph.
*
* @see ParagraphLayout::Line
*
* @draft ICU 2.6
*/
const Line *nextLine(float width);
Line *nextLine(float width);
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.
@ -501,10 +506,12 @@ private:
};
ParagraphLayout() {};
ParagraphLayout(const ParagraphLayout &other) {};
ParagraphLayout &operator=(const ParagraphLayout &other) { return *this; };
void computeLevels(UBiDiLevel paragraphLevel);
const Line *computeVisualRuns();
Line *computeVisualRuns();
void appendRun(Line *line, le_int32 run, le_int32 firstChar, le_int32 lastChar);
void computeScripts();
@ -587,6 +594,12 @@ inline ParagraphLayout::Line::Line()
// nothing else to do
}
inline ParagraphLayout::Line::Line(const Line &other)
: fAscent(0), fDescent(0), fLeading(0), fRunCount(0), fRunCapacity(0), fRuns(NULL)
{
// nothing else to do
}
inline le_int32 ParagraphLayout::Line::countRuns() const
{
return fRunCount;
@ -643,6 +656,12 @@ inline ParagraphLayout::VisualRun::VisualRun()
// nothing
}
inline ParagraphLayout::VisualRun::VisualRun(const VisualRun &other)
: fFont(NULL), fDirection(UBIDI_LTR), fGlyphCount(0), fGlyphs(NULL), fPositions(NULL), fGlyphToCharMap(NULL)
{
// nothing
}
inline ParagraphLayout::VisualRun::VisualRun(const LEFontInstance *font, UBiDiDirection direction, le_int32 glyphCount,
const LEGlyphID glyphs[], const float positions[], const le_int32 glyphToCharMap[])
: fFont(font), fDirection(direction), fGlyphCount(glyphCount),

View file

@ -192,11 +192,27 @@ private:
le_int32 ensureCapacity();
RunArray();
RunArray(const RunArray &other);
RunArray &operator=(const RunArray &other) { return *this; };
const le_int32 *fLimits;
le_int32 fCount;
le_int32 fCapacity;
};
inline RunArray::RunArray()
: fClientArrays(false), fLimits(NULL), fCount(0), fCapacity(0)
{
// nothing else to do...
}
inline RunArray::RunArray(const RunArray &other)
: fClientArrays(false), fLimits(NULL), fCount(0), fCapacity(0)
{
// nothing else to do...
}
inline RunArray::RunArray(const le_int32 *limits, le_int32 count)
: fClientArrays(true), fLimits(limits), fCount(count), fCapacity(count)
{
@ -339,6 +355,11 @@ protected:
virtual void grow(le_int32 capacity);
private:
FontRuns();
FontRuns(const FontRuns &other);
FontRuns &operator=(const FontRuns &other) { return *this; };
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
@ -348,6 +369,17 @@ private:
const LEFontInstance **fFonts;
};
inline FontRuns::FontRuns()
: RunArray(0), fFonts(NULL)
{
// nothing else to do...
}
inline FontRuns::FontRuns(const FontRuns &other)
: RunArray(0), fFonts(NULL)
{
// nothing else to do...
}
inline FontRuns::FontRuns(const LEFontInstance **fonts, const le_int32 *limits, le_int32 count)
: RunArray(limits, count), fFonts(fonts)
@ -472,6 +504,11 @@ protected:
virtual void grow(le_int32 capacity);
private:
LocaleRuns();
LocaleRuns(const LocaleRuns &other);
LocaleRuns &operator=(const LocaleRuns &other) { return *this; };
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
@ -481,6 +518,17 @@ private:
const Locale **fLocales;
};
inline LocaleRuns::LocaleRuns()
: RunArray(0), fLocales(NULL)
{
// nothing else to do...
}
inline LocaleRuns::LocaleRuns(const LocaleRuns &other)
: RunArray(0), fLocales(NULL)
{
// nothing else to do...
}
inline LocaleRuns::LocaleRuns(const Locale **locales, const le_int32 *limits, le_int32 count)
: RunArray(limits, count), fLocales(locales)
@ -604,6 +652,11 @@ protected:
virtual void grow(le_int32 capacity);
private:
ValueRuns();
ValueRuns(const ValueRuns &other);
ValueRuns &operator=(const ValueRuns &other) { return *this; };
/**
* The address of this static class variable serves as this class's ID
* for ICU "poor man's RTTI".
@ -613,6 +666,17 @@ private:
const le_int32 *fValues;
};
inline ValueRuns::ValueRuns()
: RunArray(0), fValues(NULL)
{
// nothing else to do...
}
inline ValueRuns::ValueRuns(const ValueRuns &other)
: RunArray(0), fValues(NULL)
{
// nothing else to do...
}
inline ValueRuns::ValueRuns(const le_int32 *values, const le_int32 *limits, le_int32 count)
: RunArray(limits, count), fValues(values)