version 1.137, 2001/12/10 10:07:59
|
version 1.138, 2001/12/17 08:40:19
|
Line 238 void MapMathMLEntity (char *entityName,
|
Line 238 void MapMathMLEntity (char *entityName,
|
----------------------------------------------------------------------*/ |
----------------------------------------------------------------------*/ |
void MathMLEntityCreated (unsigned char *entityValue, Language lang, |
void MathMLEntityCreated (unsigned char *entityValue, Language lang, |
char *entityName, Document doc) |
char *entityName, Document doc) |
|
|
{ |
{ |
} |
} |
|
|
Line 249 void MathMLEntityCreated (unsigned char
|
Line 248 void MathMLEntityCreated (unsigned char
|
ThotBool ElementNeedsPlaceholder (Element el) |
ThotBool ElementNeedsPlaceholder (Element el) |
{ |
{ |
ElementType elType; |
ElementType elType; |
Element child, parent; |
Element child, parent, sibling; |
ThotBool ret; |
ThotBool ret; |
|
|
ret = FALSE; |
ret = FALSE; |
elType = TtaGetElementType (el); |
elType = TtaGetElementType (el); |
if (elType.ElTypeNum == MathML_EL_MS || |
if (elType.ElTypeNum == MathML_EL_MS || |
elType.ElTypeNum == MathML_EL_MSPACE || |
elType.ElTypeNum == MathML_EL_MSPACE || |
elType.ElTypeNum == MathML_EL_MROW || |
|
elType.ElTypeNum == MathML_EL_MFRAC || |
elType.ElTypeNum == MathML_EL_MFRAC || |
elType.ElTypeNum == MathML_EL_BevelledMFRAC || |
elType.ElTypeNum == MathML_EL_BevelledMFRAC || |
elType.ElTypeNum == MathML_EL_MSQRT || |
elType.ElTypeNum == MathML_EL_MSQRT || |
Line 277 ThotBool ElementNeedsPlaceholder (El
|
Line 275 ThotBool ElementNeedsPlaceholder (El
|
elType.ElTypeNum == MathML_EL_MTABLE || |
elType.ElTypeNum == MathML_EL_MTABLE || |
elType.ElTypeNum == MathML_EL_MACTION) |
elType.ElTypeNum == MathML_EL_MACTION) |
ret = TRUE; |
ret = TRUE; |
else |
else if (elType.ElTypeNum == MathML_EL_MROW) |
if (elType.ElTypeNum == MathML_EL_MO) |
/* a mrow needs a place holder only if it's not the sole child of |
/* an operator that contains a single Symbol needs a placeholder, |
an element such as Numerator, Denominator, RootBase, Index, etc. */ |
except when it is in a Base or UnderOverBase */ |
{ |
|
ret = TRUE; |
|
sibling = el; TtaNextSibling (&sibling); |
|
if (!sibling) |
{ |
{ |
child = TtaGetFirstChild (el); |
sibling = el; TtaNextSibling (&sibling); |
if (child != NULL) |
if (!sibling) |
{ |
{ |
elType = TtaGetElementType (child); |
parent = TtaGetParent (el); |
if (elType.ElTypeNum == MathML_EL_SYMBOL_UNIT) |
if (parent) |
{ |
{ |
|
elType = TtaGetElementType (parent); |
|
if (elType.ElTypeNum == MathML_EL_Numerator || |
|
elType.ElTypeNum == MathML_EL_Denominator || |
|
elType.ElTypeNum == MathML_EL_RootBase || |
|
elType.ElTypeNum == MathML_EL_Index || |
|
elType.ElTypeNum == MathML_EL_FencedExpression || |
|
elType.ElTypeNum == MathML_EL_Base || |
|
elType.ElTypeNum == MathML_EL_Subscript || |
|
elType.ElTypeNum == MathML_EL_Superscript || |
|
elType.ElTypeNum == MathML_EL_UnderOverBase || |
|
elType.ElTypeNum == MathML_EL_Underscript || |
|
elType.ElTypeNum == MathML_EL_Overscript || |
|
elType.ElTypeNum == MathML_EL_MultiscriptBase || |
|
elType.ElTypeNum == MathML_EL_MSubscript || |
|
elType.ElTypeNum == MathML_EL_MSuperscript) |
|
ret = FALSE; |
|
} |
|
} |
|
} |
|
} |
|
else if (elType.ElTypeNum == MathML_EL_MO) |
|
/* an operator that contains a single Symbol needs a placeholder, |
|
except when it is in a Base or UnderOverBase */ |
|
{ |
|
child = TtaGetFirstChild (el); |
|
if (child != NULL) |
|
{ |
|
elType = TtaGetElementType (child); |
|
if (elType.ElTypeNum == MathML_EL_SYMBOL_UNIT) |
|
{ |
ret = TRUE; |
ret = TRUE; |
parent = TtaGetParent (el); |
parent = TtaGetParent (el); |
if (parent != NULL) |
if (parent != NULL) |
{ |
{ |
elType = TtaGetElementType (parent); |
elType = TtaGetElementType (parent); |
if (elType.ElTypeNum == MathML_EL_Base || |
if (elType.ElTypeNum == MathML_EL_Base || |
elType.ElTypeNum == MathML_EL_UnderOverBase) |
elType.ElTypeNum == MathML_EL_UnderOverBase) |
ret = FALSE; |
ret = FALSE; |
} |
} |
} |
} |
} |
|
} |
} |
|
} |
return ret; |
return ret; |
} |
} |
|
|
Line 2284 void MathMLlinethickness (Document doc,
|
Line 2315 void MathMLlinethickness (Document doc,
|
The MathML attribute attr is associated with element el. Generate |
The MathML attribute attr is associated with element el. Generate |
the corresponding style property for this element. |
the corresponding style property for this element. |
-----------------------------------------------------------------------*/ |
-----------------------------------------------------------------------*/ |
void MathMLAttrToStyleProperty (Document doc, Element el, char *value, int attr) |
void MathMLAttrToStyleProperty (Document doc, Element el, char *value, |
|
int attr) |
{ |
{ |
char css_command[buflen+20]; |
char css_command[buflen+20]; |
|
|
Line 2517 void MathMLAttributeComplete (Attribute
|
Line 2549 void MathMLAttributeComplete (Attribute
|
else if (attrType.AttrTypeNum == MathML_ATTR_columnalign) |
else if (attrType.AttrTypeNum == MathML_ATTR_columnalign) |
*/ |
*/ |
|
|
|
else if (attrType.AttrTypeNum == MathML_ATTR_Language) |
|
{ |
|
if (el == TtaGetRootElement (doc)) |
|
/* it's the lang attribute on the root element */ |
|
/* set the RealLang attribute */ |
|
{ |
|
depAttrType.AttrSSchema = attrType.AttrSSchema ; |
|
depAttrType.AttrTypeNum = MathML_ATTR_RealLang; |
|
if (!TtaGetAttribute (el, depAttrType)) |
|
/* it's not present. Add it */ |
|
{ |
|
intAttr = TtaNewAttribute (depAttrType); |
|
TtaAttachAttribute (el, intAttr, doc); |
|
TtaSetAttributeValue (intAttr, MathML_ATTR_RealLang_VAL_Yes_, |
|
el, doc); |
|
} |
|
} |
|
} |
|
|
else if (attrType.AttrTypeNum == MathML_ATTR_color || |
else if (attrType.AttrTypeNum == MathML_ATTR_color || |
attrType.AttrTypeNum == MathML_ATTR_mathcolor || |
attrType.AttrTypeNum == MathML_ATTR_mathcolor || |
attrType.AttrTypeNum == MathML_ATTR_background_ || |
attrType.AttrTypeNum == MathML_ATTR_background_ || |