version 1.21, 1999/06/12 11:04:25
|
version 1.22, 1999/06/14 06:34:39
|
Line 286 static AttributeMapping MathMLAttributeM
|
Line 286 static AttributeMapping MathMLAttributeM
|
{"ZZGHOST", "", 'A', MathML_ATTR_Ghost_restruct}, |
{"ZZGHOST", "", 'A', MathML_ATTR_Ghost_restruct}, |
|
|
{"accent", "", 'A', MathML_ATTR_accent}, |
{"accent", "", 'A', MathML_ATTR_accent}, |
|
{"accentunder", "", 'A', MathML_ATTR_accentunder}, |
|
{"actiontype", "", 'A', MathML_ATTR_actiontype}, |
|
{"align", "", 'A', MathML_ATTR_align}, |
|
{"alignmentscope", "", 'A', MathML_ATTR_alignmentscope}, |
|
{"background", "", 'A', MathML_ATTR_background_}, |
{"class", "", 'A', MathML_ATTR_class}, |
{"class", "", 'A', MathML_ATTR_class}, |
{"close", "mfenced", 'A', MathML_ATTR_close}, |
{"close", "", 'A', MathML_ATTR_close}, |
|
{"columnalign", "", 'A', MathML_ATTR_columnalign}, |
|
{"columnlines", "", 'A', MathML_ATTR_columnlines}, |
|
{"columnspacing", "", 'A', MathML_ATTR_columnspacing}, |
|
{"columnspan", "", 'A', MathML_ATTR_columnspan}, |
{"color", "", 'A', MathML_ATTR_color}, |
{"color", "", 'A', MathML_ATTR_color}, |
|
{"depth", "", 'A', MathML_ATTR_depth_}, |
|
{"displaystyle", "", 'A', MathML_ATTR_displaystyle}, |
|
{"edge", "", 'A', MathML_ATTR_edge}, |
|
{"equalcolumns", "", 'A', MathML_ATTR_equalcolumns}, |
|
{"equalrows", "", 'A', MathML_ATTR_equalrows}, |
{"fence", "", 'A', MathML_ATTR_fence}, |
{"fence", "", 'A', MathML_ATTR_fence}, |
{"fontfamily", "", 'A', MathML_ATTR_fontfamily}, |
{"fontfamily", "", 'A', MathML_ATTR_fontfamily}, |
{"fontstyle", "", 'A', MathML_ATTR_fontstyle}, |
{"fontstyle", "", 'A', MathML_ATTR_fontstyle}, |
{"fontsize", "", 'A', MathML_ATTR_fontsize}, |
{"fontsize", "", 'A', MathML_ATTR_fontsize}, |
{"fontweight", "", 'A', MathML_ATTR_fontweight}, |
{"fontweight", "", 'A', MathML_ATTR_fontweight}, |
{"form", "", 'A', MathML_ATTR_form}, |
{"form", "", 'A', MathML_ATTR_form}, |
|
{"frame", "", 'A', MathML_ATTR_frame}, |
|
{"framespacing", "", 'A', MathML_ATTR_framespacing}, |
|
{"groupalign", "", 'A', MathML_ATTR_groupalign}, |
|
{"height", "", 'A', MathML_ATTR_height_}, |
{"id", "", 'A', MathML_ATTR_id}, |
{"id", "", 'A', MathML_ATTR_id}, |
{"largeop", "", 'A', MathML_ATTR_largeop}, |
{"largeop", "", 'A', MathML_ATTR_largeop}, |
|
{"linethickness", "", 'A', MathML_ATTR_linethickness}, |
{"link", "", 'A', MathML_ATTR_link}, |
{"link", "", 'A', MathML_ATTR_link}, |
|
{"lquote", "", 'A', MathML_ATTR_lquote}, |
{"lspace", "", 'A', MathML_ATTR_lspace}, |
{"lspace", "", 'A', MathML_ATTR_lspace}, |
{"maxsize", "", 'A', MathML_ATTR_maxsize}, |
{"maxsize", "", 'A', MathML_ATTR_maxsize}, |
{"minsize", "", 'A', MathML_ATTR_minsize}, |
{"minsize", "", 'A', MathML_ATTR_minsize}, |
{"movablelimits", "", 'A', MathML_ATTR_movablelimits}, |
{"movablelimits", "", 'A', MathML_ATTR_movablelimits}, |
{"open", "mfenced", 'A', MathML_ATTR_open}, |
{"open", "", 'A', MathML_ATTR_open}, |
{"other", "", 'A', MathML_ATTR_other}, |
{"other", "", 'A', MathML_ATTR_other}, |
|
{"rowalign", "", 'A', MathML_ATTR_rowalign}, |
|
{"rowlines", "", 'A', MathML_ATTR_rowlines}, |
|
{"rowspacing", "", 'A', MathML_ATTR_rowspacing}, |
|
{"rowspan", "", 'A', MathML_ATTR_rowspan_}, |
|
{"rquote", "", 'A', MathML_ATTR_rquote}, |
{"rspace", "", 'A', MathML_ATTR_rspace}, |
{"rspace", "", 'A', MathML_ATTR_rspace}, |
|
{"scriptlevel", "", 'A', MathML_ATTR_scriptlevel}, |
|
{"scriptminsize", "", 'A', MathML_ATTR_scriptminsize}, |
|
{"scriptsizemultiplier", "", 'A', MathML_ATTR_scriptsizemultiplier}, |
|
{"selection", "", 'A', MathML_ATTR_selection}, |
{"separator", "", 'A', MathML_ATTR_separator}, |
{"separator", "", 'A', MathML_ATTR_separator}, |
{"separators", "mfenced", 'A', MathML_ATTR_separators}, |
{"separators", "", 'A', MathML_ATTR_separators}, |
{"stretchy", "", 'A', MathML_ATTR_stretchy}, |
{"stretchy", "", 'A', MathML_ATTR_stretchy}, |
{"style", "", 'A', MathML_ATTR_style_}, |
{"style", "", 'A', MathML_ATTR_style_}, |
|
{"subscriptshift", "", 'A', MathML_ATTR_subscriptshift}, |
|
{"superscriptshift", "", 'A', MathML_ATTR_superscriptshift}, |
{"symmetric", "", 'A', MathML_ATTR_symmetric}, |
{"symmetric", "", 'A', MathML_ATTR_symmetric}, |
|
{"width", "", 'A', MathML_ATTR_width_}, |
|
|
{"", "", EOS, 0} /* Last entry. Mandatory */ |
{"", "", EOS, 0} /* Last entry. Mandatory */ |
}; |
}; |
Line 321 static AttrValueMapping MathMLAttrValueM
|
Line 353 static AttrValueMapping MathMLAttrValueM
|
{MathML_ATTR_accent, "true", MathML_ATTR_accent_VAL_true}, |
{MathML_ATTR_accent, "true", MathML_ATTR_accent_VAL_true}, |
{MathML_ATTR_accent, "false", MathML_ATTR_accent_VAL_false}, |
{MathML_ATTR_accent, "false", MathML_ATTR_accent_VAL_false}, |
|
|
|
{MathML_ATTR_accentunder, "true", MathML_ATTR_accentunder_VAL_true}, |
|
{MathML_ATTR_accentunder, "false", MathML_ATTR_accentunder_VAL_false}, |
|
|
|
{MathML_ATTR_displaystyle, "true", MathML_ATTR_displaystyle_VAL_true}, |
|
{MathML_ATTR_displaystyle, "false", MathML_ATTR_displaystyle_VAL_false}, |
|
|
|
{MathML_ATTR_edge, "left", MathML_ATTR_edge_VAL_left_}, |
|
{MathML_ATTR_edge, "right", MathML_ATTR_edge_VAL_right_}, |
|
|
{MathML_ATTR_fence, "true", MathML_ATTR_fence_VAL_true}, |
{MathML_ATTR_fence, "true", MathML_ATTR_fence_VAL_true}, |
{MathML_ATTR_fence, "false", MathML_ATTR_fence_VAL_false}, |
{MathML_ATTR_fence, "false", MathML_ATTR_fence_VAL_false}, |
|
|
Line 334 static AttrValueMapping MathMLAttrValueM
|
Line 375 static AttrValueMapping MathMLAttrValueM
|
{MathML_ATTR_form, "infix", MathML_ATTR_form_VAL_infix}, |
{MathML_ATTR_form, "infix", MathML_ATTR_form_VAL_infix}, |
{MathML_ATTR_form, "postfix", MathML_ATTR_form_VAL_postfix}, |
{MathML_ATTR_form, "postfix", MathML_ATTR_form_VAL_postfix}, |
|
|
|
{MathML_ATTR_frame, "none", MathML_ATTR_frame_VAL_none}, |
|
{MathML_ATTR_frame, "solid", MathML_ATTR_frame_VAL_solid_}, |
|
{MathML_ATTR_frame, "dashed", MathML_ATTR_frame_VAL_dashed_}, |
|
|
{MathML_ATTR_largeop, "true", MathML_ATTR_largeop_VAL_true}, |
{MathML_ATTR_largeop, "true", MathML_ATTR_largeop_VAL_true}, |
{MathML_ATTR_largeop, "false", MathML_ATTR_largeop_VAL_false}, |
{MathML_ATTR_largeop, "false", MathML_ATTR_largeop_VAL_false}, |
|
|
Line 605 Document doc;
|
Line 650 Document doc;
|
lang = TtaGetLanguageIdFromAlphabet('L'); |
lang = TtaGetLanguageIdFromAlphabet('L'); |
TtaSetTextContent (elText, buffer, lang, doc); |
TtaSetTextContent (elText, buffer, lang, doc); |
attrType.AttrSSchema = GetMathMLSSchema (doc); |
attrType.AttrSSchema = GetMathMLSSchema (doc); |
attrType.AttrTypeNum = MathML_ATTR_entity; |
attrType.AttrTypeNum = MathML_ATTR_IntEntity; |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (elText, attr, doc); |
TtaAttachAttribute (elText, attr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_entity_VAL_yes_, elText, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_IntEntity_VAL_yes_, elText, doc); |
} |
} |
} |
} |
|
|
Line 787 static void CreatePlaceholders (el, doc)
|
Line 832 static void CreatePlaceholders (el, doc)
|
constr = TtaNewElement (doc, elType); |
constr = TtaNewElement (doc, elType); |
TtaInsertSibling (constr, sibling, TRUE, doc); |
TtaInsertSibling (constr, sibling, TRUE, doc); |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrTypeNum = MathML_ATTR_placeholder; |
attrType.AttrTypeNum = MathML_ATTR_IntPlaceholder; |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (constr, attr, doc); |
TtaAttachAttribute (constr, attr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_placeholder_VAL_yes_, constr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_IntPlaceholder_VAL_yes_, constr, doc); |
} |
} |
create = TRUE; |
create = TRUE; |
} |
} |
Line 824 static void CreatePlaceholders (el, doc)
|
Line 869 static void CreatePlaceholders (el, doc)
|
constr = TtaNewElement (doc, elType); |
constr = TtaNewElement (doc, elType); |
TtaInsertSibling (constr, prev, FALSE, doc); |
TtaInsertSibling (constr, prev, FALSE, doc); |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrTypeNum = MathML_ATTR_placeholder; |
attrType.AttrTypeNum = MathML_ATTR_IntPlaceholder; |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (constr, attr, doc); |
TtaAttachAttribute (constr, attr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_placeholder_VAL_yes_, constr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_IntPlaceholder_VAL_yes_, constr, doc); |
} |
} |
} |
} |
} |
} |
Line 941 static void CheckMathSubExpressions (el,
|
Line 986 static void CheckMathSubExpressions (el,
|
|
|
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
SetSingleHorizStretchAttr |
SetSingleIntHorizStretchAttr |
|
|
Put a horizstretch attribute on element el if it contains only |
Put a IntHorizStretch attribute on element el if it contains only |
a MO element that is a stretchable symbol. |
a MO element that is a stretchable symbol. |
-----------------------------------------------------------------------*/ |
-----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void SetSingleHorizStretchAttr (Element el, Document doc, Element* selEl) |
void SetSingleIntHorizStretchAttr (Element el, Document doc, Element* selEl) |
#else /* __STDC__*/ |
#else /* __STDC__*/ |
void SetSingleHorizStretchAttr (el, doc, selEl) |
void SetSingleIntHorizStretchAttr (el, doc, selEl) |
Element el; |
Element el; |
Document doc; |
Document doc; |
Element* selEl; |
Element* selEl; |
Line 995 void SetSingleHorizStretchAttr (el, doc,
|
Line 1040 void SetSingleHorizStretchAttr (el, doc,
|
/* horizontal arrow */ |
/* horizontal arrow */ |
{ |
{ |
c = EOS; |
c = EOS; |
/* attach a horizstretch attribute */ |
/* attach a IntHorizStretch attribute */ |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrTypeNum = MathML_ATTR_horizstretch; |
attrType.AttrTypeNum = MathML_ATTR_IntHorizStretch; |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (el, attr, doc); |
TtaAttachAttribute (el, attr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_horizstretch_VAL_yes_, el, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_IntHorizStretch_VAL_yes_, el, doc); |
/* replace the TEXT element by a Thot SYMBOL element */ |
/* replace the TEXT element by a Thot SYMBOL element */ |
elType.ElTypeNum = MathML_EL_SYMBOL_UNIT; |
elType.ElTypeNum = MathML_EL_SYMBOL_UNIT; |
symbolEl = TtaNewElement (doc, elType); |
symbolEl = TtaNewElement (doc, elType); |
Line 1024 void SetSingleHorizStretchAttr (el, doc,
|
Line 1069 void SetSingleHorizStretchAttr (el, doc,
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
SetHorizStretchAttr |
SetIntHorizStretchAttr |
|
|
Put a horizstretch attribute on all children of element el which |
Put a IntHorizStretch attribute on all children of element el which |
contain only a MO element that is a stretchable symbol. |
contain only a MO element that is a stretchable symbol. |
-----------------------------------------------------------------------*/ |
-----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static void SetHorizStretchAttr (Element el, Document doc) |
static void SetIntHorizStretchAttr (Element el, Document doc) |
#else /* __STDC__*/ |
#else /* __STDC__*/ |
static void SetHorizStretchAttr (el, doc) |
static void SetIntHorizStretchAttr (el, doc) |
Element el; |
Element el; |
Document doc; |
Document doc; |
#endif /* __STDC__*/ |
#endif /* __STDC__*/ |
Line 1044 static void SetHorizStretchAttr (el, doc
|
Line 1089 static void SetHorizStretchAttr (el, doc
|
child = TtaGetFirstChild (el); |
child = TtaGetFirstChild (el); |
while (child != NULL) |
while (child != NULL) |
{ |
{ |
SetSingleHorizStretchAttr (child, doc, NULL); |
SetSingleIntHorizStretchAttr (child, doc, NULL); |
TtaNextSibling (&child); |
TtaNextSibling (&child); |
} |
} |
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
SetVertStretchAttr |
SetIntVertStretchAttr |
|
|
Put a vertstretch attribute on element el if its base element |
Put a IntVertStretch attribute on element el if its base element |
(Base for a MSUBSUP, MSUP or MSUB; UnderOverBase for a MUNDEROVER, |
(Base for a MSUBSUP, MSUP or MSUB; UnderOverBase for a MUNDEROVER, |
a MUNDER of a MOVER) contains only a MO element that is a vertically |
a MUNDER of a MOVER) contains only a MO element that is a vertically |
stretchable symbol. |
stretchable symbol. |
-----------------------------------------------------------------------*/ |
-----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void SetVertStretchAttr (Element el, Document doc, int base, Element* selEl) |
void SetIntVertStretchAttr (Element el, Document doc, int base, Element* selEl) |
#else /* __STDC__*/ |
#else /* __STDC__*/ |
void SetVertStretchAttr (el, doc, base, selEl) |
void SetIntVertStretchAttr (el, doc, base, selEl) |
Element el; |
Element el; |
Document doc; |
Document doc; |
int base; |
int base; |
Line 1145 void SetVertStretchAttr (el, doc, base,
|
Line 1190 void SetVertStretchAttr (el, doc, base,
|
if ((int)text[0] == 242) |
if ((int)text[0] == 242) |
/* Integral */ |
/* Integral */ |
{ |
{ |
/* attach a vertstretch attribute */ |
/* attach a IntVertStretch attribute */ |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrTypeNum = MathML_ATTR_vertstretch; |
attrType.AttrTypeNum = MathML_ATTR_IntVertStretch; |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (el, attr, doc); |
TtaAttachAttribute (el, attr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_vertstretch_VAL_yes_, el, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_IntVertStretch_VAL_yes_, el, doc); |
/* replace the TEXT element by a Thot SYMBOL element*/ |
/* replace the TEXT element by a Thot SYMBOL element*/ |
elType.ElTypeNum = MathML_EL_SYMBOL_UNIT; |
elType.ElTypeNum = MathML_EL_SYMBOL_UNIT; |
symbolEl = TtaNewElement (doc, elType); |
symbolEl = TtaNewElement (doc, elType); |
Line 1169 void SetVertStretchAttr (el, doc, base,
|
Line 1214 void SetVertStretchAttr (el, doc, base,
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
SetPlaceholderAttr |
SetIntPlaceholderAttr |
|
|
Put a placeholder attribute on all Construct elements in the |
Put a IntPlaceholder attribute on all Construct elements in the |
subtree of root el. |
subtree of root el. |
-----------------------------------------------------------------------*/ |
-----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
static void SetPlaceholderAttr (Element el, Document doc) |
static void SetIntPlaceholderAttr (Element el, Document doc) |
#else /* __STDC__*/ |
#else /* __STDC__*/ |
static void SetPlaceholderAttr (el, doc) |
static void SetIntPlaceholderAttr (el, doc) |
Element el; |
Element el; |
Document doc; |
Document doc; |
#endif /* __STDC__*/ |
#endif /* __STDC__*/ |
Line 1194 static void SetPlaceholderAttr (el, doc)
|
Line 1239 static void SetPlaceholderAttr (el, doc)
|
elType.ElSSchema == GetMathMLSSchema (doc)) |
elType.ElSSchema == GetMathMLSSchema (doc)) |
{ |
{ |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrTypeNum = MathML_ATTR_placeholder; |
attrType.AttrTypeNum = MathML_ATTR_IntPlaceholder; |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (el, attr, doc); |
TtaAttachAttribute (el, attr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_placeholder_VAL_yes_, el, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_IntPlaceholder_VAL_yes_, el, doc); |
} |
} |
else |
else |
{ |
{ |
child = TtaGetFirstChild (el); |
child = TtaGetFirstChild (el); |
while (child != NULL) |
while (child != NULL) |
{ |
{ |
SetPlaceholderAttr (child, doc); |
SetIntPlaceholderAttr (child, doc); |
TtaNextSibling (&child); |
TtaNextSibling (&child); |
} |
} |
} |
} |
Line 1274 static void BuildMultiscript (elMMULTISC
|
Line 1319 static void BuildMultiscript (elMMULTISC
|
/* create a first and a last PostscriptPair as placeholders */ |
/* create a first and a last PostscriptPair as placeholders */ |
pair = TtaNewTree (doc, elTypePair, ""); |
pair = TtaNewTree (doc, elTypePair, ""); |
TtaInsertFirstChild (&pair, group, doc); |
TtaInsertFirstChild (&pair, group, doc); |
SetPlaceholderAttr (pair, doc); |
SetIntPlaceholderAttr (pair, doc); |
prevPair = pair; |
prevPair = pair; |
pair = TtaNewTree (doc, elTypePair, ""); |
pair = TtaNewTree (doc, elTypePair, ""); |
TtaInsertSibling (pair, prevPair, FALSE, doc); |
TtaInsertSibling (pair, prevPair, FALSE, doc); |
SetPlaceholderAttr (pair, doc); |
SetIntPlaceholderAttr (pair, doc); |
prevScript = NULL; |
prevScript = NULL; |
} |
} |
if (prevScript == NULL) |
if (prevScript == NULL) |
Line 1311 static void BuildMultiscript (elMMULTISC
|
Line 1356 static void BuildMultiscript (elMMULTISC
|
/* insert the current element as a child of the new MSuperscript or |
/* insert the current element as a child of the new MSuperscript or |
MSubscript element */ |
MSubscript element */ |
TtaInsertFirstChild (&elem, script, doc); |
TtaInsertFirstChild (&elem, script, doc); |
SetPlaceholderAttr (elem, doc); |
SetIntPlaceholderAttr (elem, doc); |
} |
} |
|
|
CreatePlaceholders (elem, doc); |
CreatePlaceholders (elem, doc); |
Line 1332 static void BuildMultiscript (elMMULTISC
|
Line 1377 static void BuildMultiscript (elMMULTISC
|
elTypeGroup.ElTypeNum = MathML_EL_PostscriptPairs; |
elTypeGroup.ElTypeNum = MathML_EL_PostscriptPairs; |
group = TtaNewTree (doc, elTypeGroup, ""); |
group = TtaNewTree (doc, elTypeGroup, ""); |
TtaInsertSibling (group, elem, TRUE, doc); |
TtaInsertSibling (group, elem, TRUE, doc); |
SetPlaceholderAttr (group, doc); |
SetIntPlaceholderAttr (group, doc); |
} |
} |
/* the following elements will be interpreted as sub- superscripts |
/* the following elements will be interpreted as sub- superscripts |
in PrescriptPair elements, wich will be children of this |
in PrescriptPair elements, wich will be children of this |
Line 1343 static void BuildMultiscript (elMMULTISC
|
Line 1388 static void BuildMultiscript (elMMULTISC
|
/* create a first and a last PostscriptPair as placeholders */ |
/* create a first and a last PostscriptPair as placeholders */ |
pair = TtaNewTree (doc, elTypePair, ""); |
pair = TtaNewTree (doc, elTypePair, ""); |
TtaInsertFirstChild (&pair, group, doc); |
TtaInsertFirstChild (&pair, group, doc); |
SetPlaceholderAttr (pair, doc); |
SetIntPlaceholderAttr (pair, doc); |
prevPair = pair; |
prevPair = pair; |
pair = TtaNewTree (doc, elTypePair, ""); |
pair = TtaNewTree (doc, elTypePair, ""); |
TtaInsertSibling (pair, prevPair, FALSE, doc); |
TtaInsertSibling (pair, prevPair, FALSE, doc); |
SetPlaceholderAttr (pair, doc); |
SetIntPlaceholderAttr (pair, doc); |
prevScript = NULL; |
prevScript = NULL; |
TtaNextSibling (&elem); |
TtaNextSibling (&elem); |
} |
} |
Line 1363 static void BuildMultiscript (elMMULTISC
|
Line 1408 static void BuildMultiscript (elMMULTISC
|
if (group == NULL) |
if (group == NULL) |
group = base; |
group = base; |
TtaInsertSibling (elem, group, TRUE, doc); |
TtaInsertSibling (elem, group, TRUE, doc); |
SetPlaceholderAttr (elem, doc); |
SetIntPlaceholderAttr (elem, doc); |
} |
} |
} |
} |
|
|
Line 1556 void SetFontstyleAttr (el, doc)
|
Line 1601 void SetFontstyleAttr (el, doc)
|
} |
} |
|
|
/*---------------------------------------------------------------------- |
/*---------------------------------------------------------------------- |
SetAddspaceAttr |
SetIntAddSpaceAttr |
The content of a MO element has been created or modified. |
The content of a MO element has been created or modified. |
Create or change attribute addspace for that element accordingly. |
Create or change attribute IntAddSpace for that element accordingly. |
-----------------------------------------------------------------------*/ |
-----------------------------------------------------------------------*/ |
#ifdef __STDC__ |
#ifdef __STDC__ |
void SetAddspaceAttr (Element el, Document doc) |
void SetIntAddSpaceAttr (Element el, Document doc) |
#else /* __STDC__*/ |
#else /* __STDC__*/ |
void SetAddspaceAttr (el, doc) |
void SetIntAddSpaceAttr (el, doc) |
Element el; |
Element el; |
Document doc; |
Document doc; |
#endif /* __STDC__*/ |
#endif /* __STDC__*/ |
Line 1581 void SetAddspaceAttr (el, doc)
|
Line 1626 void SetAddspaceAttr (el, doc)
|
textEl = TtaGetFirstChild (el); |
textEl = TtaGetFirstChild (el); |
if (textEl != NULL) |
if (textEl != NULL) |
{ |
{ |
/* search the addspace attribute */ |
/* search the IntAddSpace attribute */ |
elType = TtaGetElementType (el); |
elType = TtaGetElementType (el); |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrTypeNum = MathML_ATTR_addspace; |
attrType.AttrTypeNum = MathML_ATTR_IntAddSpace; |
attr = TtaGetAttribute (el, attrType); |
attr = TtaGetAttribute (el, attrType); |
if (attr == NULL) |
if (attr == NULL) |
{ |
{ |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (el, attr, doc); |
TtaAttachAttribute (el, attr, doc); |
} |
} |
val = MathML_ATTR_addspace_VAL_nospace; |
val = MathML_ATTR_IntAddSpace_VAL_nospace; |
len = TtaGetTextLength (textEl); |
len = TtaGetTextLength (textEl); |
if (len > 0 && len < BUFLEN) |
if (len > 0 && len < BUFLEN) |
{ |
{ |
Line 1609 void SetAddspaceAttr (el, doc)
|
Line 1654 void SetAddspaceAttr (el, doc)
|
TtaPreviousSibling (&previous); |
TtaPreviousSibling (&previous); |
if (previous == NULL) |
if (previous == NULL) |
/* no previous sibling => unary operator */ |
/* no previous sibling => unary operator */ |
val = MathML_ATTR_addspace_VAL_nospace; |
val = MathML_ATTR_IntAddSpace_VAL_nospace; |
else |
else |
{ |
{ |
elType = TtaGetElementType (previous); |
elType = TtaGetElementType (previous); |
if (elType.ElTypeNum == MathML_EL_MO) |
if (elType.ElTypeNum == MathML_EL_MO) |
/* after an operator => unary operator */ |
/* after an operator => unary operator */ |
val = MathML_ATTR_addspace_VAL_nospace; |
val = MathML_ATTR_IntAddSpace_VAL_nospace; |
else |
else |
/* binary operator */ |
/* binary operator */ |
val = MathML_ATTR_addspace_VAL_both; |
val = MathML_ATTR_IntAddSpace_VAL_both; |
} |
} |
} |
} |
else if (text[0] == '+' || |
else if (text[0] == '+' || |
Line 1629 void SetAddspaceAttr (el, doc)
|
Line 1674 void SetAddspaceAttr (el, doc)
|
text[0] == '>' || |
text[0] == '>' || |
text[0] == '^') |
text[0] == '^') |
/* binary operator */ |
/* binary operator */ |
val = MathML_ATTR_addspace_VAL_both; |
val = MathML_ATTR_IntAddSpace_VAL_both; |
else if (text[0] == ',' || |
else if (text[0] == ',' || |
text[0] == ';') |
text[0] == ';') |
val = MathML_ATTR_addspace_VAL_spaceafter; |
val = MathML_ATTR_IntAddSpace_VAL_spaceafter; |
} |
} |
else if (alphabet == 'G') |
else if (alphabet == 'G') |
/* Symbol character set */ |
/* Symbol character set */ |
Line 1649 void SetAddspaceAttr (el, doc)
|
Line 1694 void SetAddspaceAttr (el, doc)
|
((int)text[0] >= 199 && (int)text[0] <= 209) || /* */ |
((int)text[0] >= 199 && (int)text[0] <= 209) || /* */ |
(int)text[0] == 217 || /* and */ |
(int)text[0] == 217 || /* and */ |
(int)text[0] == 218 ) /* or */ |
(int)text[0] == 218 ) /* or */ |
val = MathML_ATTR_addspace_VAL_both; |
val = MathML_ATTR_IntAddSpace_VAL_both; |
} |
} |
TtaSetAttributeValue (attr, val, el, doc); |
TtaSetAttributeValue (attr, val, el, doc); |
} |
} |
Line 1743 Document doc;
|
Line 1788 Document doc;
|
TtaDeleteTree (content, doc); |
TtaDeleteTree (content, doc); |
/* change the MO element into a MF element */ |
/* change the MO element into a MF element */ |
ChangeTypeOfElement (el, doc, MathML_EL_MF); |
ChangeTypeOfElement (el, doc, MathML_EL_MF); |
/* attach a vertstretch attribute to the MF element */ |
/* attach a IntVertStretch attribute to the MF element */ |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrTypeNum = MathML_ATTR_vertstretch; |
attrType.AttrTypeNum = MathML_ATTR_IntVertStretch; |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (el, attr, doc); |
TtaAttachAttribute (el, attr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_vertstretch_VAL_yes_, el, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_IntVertStretch_VAL_yes_, el, doc); |
/* create a new content for the MF element */ |
/* create a new content for the MF element */ |
if (text[0] == '|') |
if (text[0] == '|') |
{ |
{ |
Line 1924 Document doc;
|
Line 1969 Document doc;
|
elType.ElTypeNum = MathML_EL_Construct; |
elType.ElTypeNum = MathML_EL_Construct; |
child = TtaNewElement (doc, elType); |
child = TtaNewElement (doc, elType); |
TtaInsertFirstChild (&child, fencedExpression, doc); |
TtaInsertFirstChild (&child, fencedExpression, doc); |
SetPlaceholderAttr (child, doc); |
SetIntPlaceholderAttr (child, doc); |
} |
} |
else |
else |
{ |
{ |
Line 2032 Document doc;
|
Line 2077 Document doc;
|
child = TtaNewElement (doc, elType); |
child = TtaNewElement (doc, elType); |
TtaInsertFirstChild (&child, new, doc); |
TtaInsertFirstChild (&child, new, doc); |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrSSchema = elType.ElSSchema; |
attrType.AttrTypeNum = MathML_ATTR_placeholder; |
attrType.AttrTypeNum = MathML_ATTR_IntPlaceholder; |
attr = TtaNewAttribute (attrType); |
attr = TtaNewAttribute (attrType); |
TtaAttachAttribute (child, attr, doc); |
TtaAttachAttribute (child, attr, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_placeholder_VAL_yes_, child, doc); |
TtaSetAttributeValue (attr, MathML_ATTR_IntPlaceholder_VAL_yes_, child, doc); |
} |
} |
} |
} |
else |
else |
Line 2049 Document doc;
|
Line 2094 Document doc;
|
SetFontstyleAttr (el, doc); |
SetFontstyleAttr (el, doc); |
break; |
break; |
case MathML_EL_MO: |
case MathML_EL_MO: |
SetAddspaceAttr (el, doc); |
SetIntAddSpaceAttr (el, doc); |
SetVertStretchAttr (el, doc, 0, NULL); |
SetIntVertStretchAttr (el, doc, 0, NULL); |
break; |
break; |
case MathML_EL_MROOT: |
case MathML_EL_MROOT: |
/* end of a Root. Create a RootBase and an Index */ |
/* end of a Root. Create a RootBase and an Index */ |
Line 2073 Document doc;
|
Line 2118 Document doc;
|
/* end of a MSUBSUP. Create Base, Subscript, and Superscript */ |
/* end of a MSUBSUP. Create Base, Subscript, and Superscript */ |
CheckMathSubExpressions (el, MathML_EL_Base, MathML_EL_Subscript, |
CheckMathSubExpressions (el, MathML_EL_Base, MathML_EL_Subscript, |
MathML_EL_Superscript, doc); |
MathML_EL_Superscript, doc); |
SetVertStretchAttr (el, doc, MathML_EL_Base, NULL); |
SetIntVertStretchAttr (el, doc, MathML_EL_Base, NULL); |
break; |
break; |
case MathML_EL_MSUB: |
case MathML_EL_MSUB: |
/* end of a MSUB. Create Base and Subscript */ |
/* end of a MSUB. Create Base and Subscript */ |
CheckMathSubExpressions (el, MathML_EL_Base, MathML_EL_Subscript, |
CheckMathSubExpressions (el, MathML_EL_Base, MathML_EL_Subscript, |
0, doc); |
0, doc); |
SetVertStretchAttr (el, doc, MathML_EL_Base, NULL); |
SetIntVertStretchAttr (el, doc, MathML_EL_Base, NULL); |
break; |
break; |
case MathML_EL_MSUP: |
case MathML_EL_MSUP: |
/* end of a MSUP. Create Base and Superscript */ |
/* end of a MSUP. Create Base and Superscript */ |
CheckMathSubExpressions (el, MathML_EL_Base, MathML_EL_Superscript, |
CheckMathSubExpressions (el, MathML_EL_Base, MathML_EL_Superscript, |
0, doc); |
0, doc); |
SetVertStretchAttr (el, doc, MathML_EL_Base, NULL); |
SetIntVertStretchAttr (el, doc, MathML_EL_Base, NULL); |
break; |
break; |
case MathML_EL_MUNDEROVER: |
case MathML_EL_MUNDEROVER: |
/* end of a MUNDEROVER. Create UnderOverBase, Underscript, and |
/* end of a MUNDEROVER. Create UnderOverBase, Underscript, and |
Overscript */ |
Overscript */ |
CheckMathSubExpressions (el, MathML_EL_UnderOverBase, |
CheckMathSubExpressions (el, MathML_EL_UnderOverBase, |
MathML_EL_Underscript, MathML_EL_Overscript, doc); |
MathML_EL_Underscript, MathML_EL_Overscript, doc); |
SetHorizStretchAttr (el, doc); |
SetIntHorizStretchAttr (el, doc); |
SetVertStretchAttr (el, doc, MathML_EL_UnderOverBase, NULL); |
SetIntVertStretchAttr (el, doc, MathML_EL_UnderOverBase, NULL); |
break; |
break; |
case MathML_EL_MUNDER: |
case MathML_EL_MUNDER: |
/* end of a MUNDER. Create UnderOverBase, and Underscript */ |
/* end of a MUNDER. Create UnderOverBase, and Underscript */ |
CheckMathSubExpressions (el, MathML_EL_UnderOverBase, |
CheckMathSubExpressions (el, MathML_EL_UnderOverBase, |
MathML_EL_Underscript, 0, doc); |
MathML_EL_Underscript, 0, doc); |
SetHorizStretchAttr (el, doc); |
SetIntHorizStretchAttr (el, doc); |
SetVertStretchAttr (el, doc, MathML_EL_UnderOverBase, NULL); |
SetIntVertStretchAttr (el, doc, MathML_EL_UnderOverBase, NULL); |
break; |
break; |
case MathML_EL_MOVER: |
case MathML_EL_MOVER: |
/* end of a MOVER. Create UnderOverBase, and Overscript */ |
/* end of a MOVER. Create UnderOverBase, and Overscript */ |
CheckMathSubExpressions (el, MathML_EL_UnderOverBase, |
CheckMathSubExpressions (el, MathML_EL_UnderOverBase, |
MathML_EL_Overscript, 0, doc); |
MathML_EL_Overscript, 0, doc); |
SetHorizStretchAttr (el, doc); |
SetIntHorizStretchAttr (el, doc); |
SetVertStretchAttr (el, doc, MathML_EL_UnderOverBase, NULL); |
SetIntVertStretchAttr (el, doc, MathML_EL_UnderOverBase, NULL); |
break; |
break; |
case MathML_EL_MMULTISCRIPTS: |
case MathML_EL_MMULTISCRIPTS: |
/* end of a MMULTISCRIPTS. Create all elements defined in the |
/* end of a MMULTISCRIPTS. Create all elements defined in the |