// Range 3 0x10000u < XHTML_DECIMAL_ENTITY_RANGE <= 0x10FFFFu
const unsigned long XHTML_DECIMAL_ENTITY_RANGE[] = {0x0u, 0xD7FFu, 0xE000u, 0xFFFDu, 0x10000u, 0x10FFFFu};
-const unsigned int MAX_NUM_OF_ATTRIBUTES = 11u; ///< The span tag has the 'font-family', 'font-size' 'font-weight', 'font-width', 'font-slant','text-color', 'u-color', 'u-height','u-type','u-dash-gap'and 'u-dash-width' attrubutes.
+const unsigned int MAX_NUM_OF_ATTRIBUTES = 12u; ///< The span tag has the 'font-family', 'font-size' 'font-weight', 'font-width', 'font-slant','text-color', 'u-color', 'u-height','u-type','u-dash-gap', 'u-dash-width' and 's-color' attrubutes.
const unsigned int DEFAULT_VECTOR_SIZE = 16u; ///< Default size of run vectors.
#if defined(DEBUG_ENABLED)
RunIndex colorRunIndex;
RunIndex fontRunIndex;
RunIndex underlinedCharacterRunIndex;
- bool isColorDefined;
- bool isFontDefined;
- bool isUnderlinedCharacterDefined;
+ RunIndex backgroundColorRunIndex;
+ RunIndex strikethroughCharacterRunIndex;
+
+ bool isColorDefined;
+ bool isFontDefined;
+ bool isUnderlinedCharacterDefined;
+ bool isBackgroundColorDefined;
+ bool isStrikethroughDefined;
};
/**
span.isFontDefined = false;
span.underlinedCharacterRunIndex = 0u;
span.isUnderlinedCharacterDefined = false;
+ span.backgroundColorRunIndex = 0u;
+ span.isBackgroundColorDefined = false;
+
+ //strikethrough
+ span.strikethroughCharacterRunIndex = 0u;
+ span.isStrikethroughDefined = false;
}
/**
* @brief Processes span tag for the color-run & font-run.
*
* @param[in] spanTag The tag we are currently processing
- * @param[in/out] spanStack The spans stack
- * @param[int/out] colorRuns The container containing all the color runs
- * @param[int/out] fontRuns The container containing all the font description runs
- * @param[in/out] colorRunIndex The color run index
- * @param[in/out] fontRunIndex The font run index
+ * @param[inout] spanStack The spans stack
+ * @param[inout] colorRuns The container containing all the color runs
+ * @param[inout] fontRuns The container containing all the font description runs
+ * @param[inout] underlinedCharacterRuns The container containing all the underlined character runs
+ * @param[inout] strikethroughCharacterRuns The container containing all the strikethroughed character runs
+ * @param[inout] colorRunIndex The color run index
+ * @param[inout] fontRunIndex The font run index
+ * @param[inout] underlinedCharacterRunIndex The underlined character run index
+ * @param[inout] strikethroughCharacterRunIndex The strikethroughed character run index
* @param[in] characterIndex The current character index
* @param[in] tagReference The tagReference we should increment/decrement
*/
void ProcessSpanForRun(
- const Tag& spanTag,
- StyleStack<Span>& spanStack,
- Vector<ColorRun>& colorRuns,
- Vector<FontDescriptionRun>& fontRuns,
- Vector<UnderlinedCharacterRun>& underlinedCharacterRuns,
- RunIndex& colorRunIndex,
- RunIndex& fontRunIndex,
- RunIndex& underlinedCharacterRunIndex,
- const CharacterIndex characterIndex,
- int& tagReference)
+ const Tag& spanTag,
+ StyleStack<Span>& spanStack,
+ Vector<ColorRun>& colorRuns,
+ Vector<FontDescriptionRun>& fontRuns,
+ Vector<UnderlinedCharacterRun>& underlinedCharacterRuns,
+ Vector<ColorRun>& backgroundColorRuns,
+ Vector<StrikethroughCharacterRun>& strikethroughCharacterRuns,
+ RunIndex& colorRunIndex,
+ RunIndex& fontRunIndex,
+ RunIndex& underlinedCharacterRunIndex,
+ RunIndex& backgroundColorRunIndex,
+ RunIndex& strikethroughCharacterRunIndex,
+ const CharacterIndex characterIndex,
+ int& tagReference)
{
if(!spanTag.isEndTag)
{
UnderlinedCharacterRun underlinedCharacterRun;
Initialize(underlinedCharacterRun);
+ ColorRun backgroundColorRun;
+ Initialize(backgroundColorRun);
+
+ StrikethroughCharacterRun strikethroughCharacterRun;
+ Initialize(strikethroughCharacterRun);
+
Span span;
Initialize(span);
// Fill the run with the parameters.
- colorRun.characterRun.characterIndex = characterIndex;
- fontRun.characterRun.characterIndex = characterIndex;
- underlinedCharacterRun.characterRun.characterIndex = characterIndex;
-
- span.colorRunIndex = colorRunIndex;
- span.fontRunIndex = fontRunIndex;
- span.underlinedCharacterRunIndex = underlinedCharacterRunIndex;
-
- ProcessSpanTag(spanTag, colorRun, fontRun, underlinedCharacterRun, span.isColorDefined, span.isFontDefined, span.isUnderlinedCharacterDefined);
+ colorRun.characterRun.characterIndex = characterIndex;
+ fontRun.characterRun.characterIndex = characterIndex;
+ underlinedCharacterRun.characterRun.characterIndex = characterIndex;
+ backgroundColorRun.characterRun.characterIndex = characterIndex;
+ strikethroughCharacterRun.characterRun.characterIndex = characterIndex;
+
+ span.colorRunIndex = colorRunIndex;
+ span.fontRunIndex = fontRunIndex;
+ span.underlinedCharacterRunIndex = underlinedCharacterRunIndex;
+ span.backgroundColorRunIndex = backgroundColorRunIndex;
+ span.strikethroughCharacterRunIndex = strikethroughCharacterRunIndex;
+
+ ProcessSpanTag(spanTag,
+ colorRun,
+ fontRun,
+ underlinedCharacterRun,
+ backgroundColorRun,
+ strikethroughCharacterRun,
+ span.isColorDefined,
+ span.isFontDefined,
+ span.isUnderlinedCharacterDefined,
+ span.isBackgroundColorDefined,
+ span.isStrikethroughDefined);
// Push the span into the stack.
spanStack.Push(span);
++underlinedCharacterRunIndex;
}
+ if(span.isBackgroundColorDefined)
+ {
+ // Push the run in the logical model.
+ backgroundColorRuns.PushBack(backgroundColorRun);
+ ++backgroundColorRunIndex;
+ }
+
+ if(span.isStrikethroughDefined)
+ {
+ // Push the run in the logical model.
+ strikethroughCharacterRuns.PushBack(strikethroughCharacterRun);
+ ++strikethroughCharacterRunIndex;
+ }
+
// Increase reference
++tagReference;
}
underlinedCharacterRun.characterRun.numberOfCharacters = characterIndex - underlinedCharacterRun.characterRun.characterIndex;
}
+ if(span.isBackgroundColorDefined)
+ {
+ ColorRun& backgroundColorRun = *(backgroundColorRuns.Begin() + span.backgroundColorRunIndex);
+ backgroundColorRun.characterRun.numberOfCharacters = characterIndex - backgroundColorRun.characterRun.characterIndex;
+ }
+
+ if(span.isStrikethroughDefined)
+ {
+ StrikethroughCharacterRun& strikethroughCharacterRun = *(strikethroughCharacterRuns.Begin() + span.strikethroughCharacterRunIndex);
+ strikethroughCharacterRun.characterRun.numberOfCharacters = characterIndex - strikethroughCharacterRun.characterRun.characterIndex;
+ }
+
--tagReference;
}
}
/**
* @brief Resizes the model's vectors
*
- * @param[in/out] markupProcessData The markup process data
+ * @param[inout] markupProcessData The markup process data
* @param[in] fontRunIndex The font run index
* @param[in] colorRunIndex The color run index
* @param[in] underlinedCharacterRunIndex The underlined character run index
+ * @param[in] strikethroughCharacterRunIndex The strikethroughed character run index
* @param[in] backgroundRunIndex The background run index
* @param[in] boundedParagraphRunIndex The bounded paragraph run index
*
const RunIndex fontRunIndex,
const RunIndex colorRunIndex,
const RunIndex underlinedCharacterRunIndex,
+ const RunIndex strikethroughCharacterRunIndex,
const RunIndex backgroundRunIndex,
const RunIndex boundedParagraphRunIndex)
{
markupProcessData.fontRuns.Resize(fontRunIndex);
markupProcessData.colorRuns.Resize(colorRunIndex);
markupProcessData.underlinedCharacterRuns.Resize(underlinedCharacterRunIndex);
+ markupProcessData.strikethroughCharacterRuns.Resize(strikethroughCharacterRunIndex);
markupProcessData.backgroundColorRuns.Resize(backgroundRunIndex);
markupProcessData.boundedParagraphRuns.Resize(boundedParagraphRunIndex);
markupProcessData.fontRuns.Reserve(DEFAULT_VECTOR_SIZE);
markupProcessData.underlinedCharacterRuns.Reserve(DEFAULT_VECTOR_SIZE);
markupProcessData.backgroundColorRuns.Reserve(DEFAULT_VECTOR_SIZE);
+ markupProcessData.strikethroughCharacterRuns.Reserve(DEFAULT_VECTOR_SIZE);
// Get the mark-up string buffer.
const char* markupStringBuffer = markupString.c_str();
}
else if(TokenComparison(XHTML_SPAN_TAG, tag.buffer, tag.length))
{
- ProcessSpanForRun(tag, spanStack, markupProcessData.colorRuns, markupProcessData.fontRuns, markupProcessData.underlinedCharacterRuns, colorRunIndex, fontRunIndex, underlinedCharacterRunIndex, characterIndex, spanTagReference);
+ ProcessSpanForRun(tag,
+ spanStack,
+ markupProcessData.colorRuns,
+ markupProcessData.fontRuns,
+ markupProcessData.underlinedCharacterRuns,
+ markupProcessData.backgroundColorRuns,
+ markupProcessData.strikethroughCharacterRuns,
+ colorRunIndex,
+ fontRunIndex,
+ underlinedCharacterRunIndex,
+ backgroundRunIndex,
+ strikethroughCharacterRunIndex,
+ characterIndex,
+ spanTagReference);
}
else if(TokenComparison(XHTML_STRIKETHROUGH_TAG, tag.buffer, tag.length))
{
}
// Resize the model's vectors.
- ResizeModelVectors(markupProcessData, fontRunIndex, colorRunIndex, underlinedCharacterRunIndex, backgroundRunIndex, boundedParagraphRunIndex);
+ ResizeModelVectors(markupProcessData, fontRunIndex, colorRunIndex, underlinedCharacterRunIndex, strikethroughCharacterRunIndex, backgroundRunIndex, boundedParagraphRunIndex);
// Handle the nested tags
OverrideNestedUnderlinedCharacterRuns(markupProcessData.underlinedCharacterRuns);