Diff for /Amaya/amaya/MathMLbuilder.c between versions 1.38 and 1.39

version 1.38, 2000/01/03 08:40:27 version 1.39, 2000/01/06 18:54:45
Line 786  Element el; Line 786  Element el;
     
   ret = FALSE;    ret = FALSE;
   elType = TtaGetElementType (el);    elType = TtaGetElementType (el);
   if (elType.ElTypeNum == MathML_EL_MROW ||    if (elType.ElTypeNum == MathML_EL_MSPACE ||
       elType.ElTypeNum == MathML_EL_MF ||        elType.ElTypeNum == MathML_EL_MROW ||
       elType.ElTypeNum == MathML_EL_MFENCED ||  
       elType.ElTypeNum == MathML_EL_MACTION ||  
       elType.ElTypeNum == MathML_EL_MROOT ||  
       elType.ElTypeNum == MathML_EL_MSQRT ||  
       elType.ElTypeNum == MathML_EL_MFRAC ||        elType.ElTypeNum == MathML_EL_MFRAC ||
       elType.ElTypeNum == MathML_EL_MSUBSUP ||        elType.ElTypeNum == MathML_EL_MSQRT ||
         elType.ElTypeNum == MathML_EL_MROOT ||
         elType.ElTypeNum == MathML_EL_MSTYLE ||
         elType.ElTypeNum == MathML_EL_MERROR ||
         elType.ElTypeNum == MathML_EL_MPADDED ||
         elType.ElTypeNum == MathML_EL_MPHANTOM ||
         elType.ElTypeNum == MathML_EL_MFENCED ||
         elType.ElTypeNum == MathML_EL_MF ||
       elType.ElTypeNum == MathML_EL_MSUB ||        elType.ElTypeNum == MathML_EL_MSUB ||
       elType.ElTypeNum == MathML_EL_MSUP ||        elType.ElTypeNum == MathML_EL_MSUP ||
         elType.ElTypeNum == MathML_EL_MSUBSUP ||
       elType.ElTypeNum == MathML_EL_MUNDER ||        elType.ElTypeNum == MathML_EL_MUNDER ||
       elType.ElTypeNum == MathML_EL_MOVER ||        elType.ElTypeNum == MathML_EL_MOVER ||
       elType.ElTypeNum == MathML_EL_MUNDEROVER ||        elType.ElTypeNum == MathML_EL_MUNDEROVER ||
       elType.ElTypeNum == MathML_EL_MMULTISCRIPTS ||        elType.ElTypeNum == MathML_EL_MMULTISCRIPTS ||
       elType.ElTypeNum == MathML_EL_MTABLE)        elType.ElTypeNum == MathML_EL_MTABLE ||
         elType.ElTypeNum == MathML_EL_MACTION)
      ret = TRUE;       ret = TRUE;
   else    else
      if (elType.ElTypeNum == MathML_EL_MO)       if (elType.ElTypeNum == MathML_EL_MO)
Line 1465  static void BuildMultiscript (elMMULTISC Line 1470  static void BuildMultiscript (elMMULTISC
     }      }
 }  }
   
   /*----------------------------------------------------------------------
      CreateWrapper
   
      Create an element of type wrapperType as a child of element el and
      move all chidren of element el within the new element.
    -----------------------------------------------------------------------*/
   #ifdef __STDC__
   static void CreateWrapper (Element el, int wrapperType, Document doc)
   #else /* __STDC__*/
   static void CreateWrapper (el, wrapperType, doc)
   Element el;
   int wrapperType;
   Document doc;
   #endif /* __STDC__*/
   {
      Element       wrapper, child, prevChild, nextChild;
      ElementType   elType;
   
      child = TtaGetFirstChild (el);
      elType.ElSSchema = GetMathMLSSchema (doc);
      elType.ElTypeNum = wrapperType;
      wrapper = TtaNewElement (doc, elType);
      TtaInsertFirstChild (&wrapper, el, doc);
      prevChild = NULL;
      while (child)
        {
          nextChild = child;
          TtaNextSibling (&nextChild);
          TtaRemoveTree (child, doc);
          if (prevChild == NULL)
            TtaInsertFirstChild (&child, wrapper, doc);
          else
            TtaInsertSibling (child, prevChild, FALSE, doc);
          prevChild = child;
          child = nextChild;
        }
   }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
    CheckMTable     CheckMTable
Line 1563  void CheckMTable (elMTABLE, doc) Line 1605  void CheckMTable (elMTABLE, doc)
          }           }
       if (elType.ElTypeNum == MathML_EL_MTD)        if (elType.ElTypeNum == MathML_EL_MTD)
          /* This is a MTD element. Wrap its contents with a CellWrapper */           /* This is a MTD element. Wrap its contents with a CellWrapper */
          {           CreateWrapper (cell, MathML_EL_CellWrapper, doc);
          child = TtaGetFirstChild (cell);  
          elType.ElSSchema = MathMLSSchema;  
          elType.ElTypeNum = MathML_EL_CellWrapper;  
          wrapper = TtaNewElement (doc, elType);  
          TtaInsertFirstChild (&wrapper, cell, doc);  
          prevChild = NULL;  
          while (child)  
               {  
               nextChild = child;  
               TtaNextSibling (&nextChild);  
               TtaRemoveTree (child, doc);  
               if (prevChild == NULL)  
                  TtaInsertFirstChild (&child, wrapper, doc);  
               else  
                  TtaInsertSibling (child, prevChild, FALSE, doc);  
               prevChild = child;  
               child = nextChild;  
               }  
          }  
       cell = nextCell;        cell = nextCell;
       }        }
     row = nextRow;      row = nextRow;
Line 2151  Document doc; Line 2174  Document doc;
           SetIntAddSpaceAttr (el, doc);            SetIntAddSpaceAttr (el, doc);
           SetIntVertStretchAttr (el, doc, 0, NULL);            SetIntVertStretchAttr (el, doc, 0, NULL);
           break;            break;
          case MathML_EL_MROW:
             /* end of MROW */
             /*if the first and the last child are MO containing a fence character
                transform the MO into a MF and the character into a Thot SYMBOL */
             child = TtaGetFirstChild (el);
             if (child != NULL)
               {
               CheckFence (child, doc);
               child = TtaGetLastChild (el);
               if (child != NULL)
                 CheckFence (child, doc);
               /* Create placeholders within the MROW */
               CreatePlaceholders (TtaGetFirstChild (el), doc);
               }
             break;
          case MathML_EL_MFRAC:
             /* end of a fraction. Create a Numerator and a Denominator */
             CheckMathSubExpressions (el, MathML_EL_Numerator,
                                      MathML_EL_Denominator, 0, doc);
             break;
          case MathML_EL_MSQRT:
             /* end od a Square Root. Create a SqrtBase that contains all
                children of the MSQRT element */
             CreateWrapper (el, MathML_EL_SqrtBase, doc);
             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 */
           CheckMathSubExpressions (el, MathML_EL_RootBase, MathML_EL_Index,            CheckMathSubExpressions (el, MathML_EL_RootBase, MathML_EL_Index,
                                    0, doc);                                     0, doc);
           break;            break;
        case MathML_EL_MSQRT:         case MathML_EL_MSTYLE:
           /* end od a Square Root. Create a RootBase */         case MathML_EL_MERROR:
           CheckMathSubExpressions (el, MathML_EL_RootBase, 0, 0, doc);         case MathML_EL_MPADDED:
           break;         case MathML_EL_MPHANTOM:
        case MathML_EL_MFRAC:            /* Create placeholders within the element */
           /* end of a fraction. Create a Numerator and a Denominator */            CreatePlaceholders (TtaGetFirstChild (el), doc);
           CheckMathSubExpressions (el, MathML_EL_Numerator,  
                                  MathML_EL_Denominator, 0, doc);  
           break;            break;
        case MathML_EL_MFENCED:         case MathML_EL_MFENCED:
           TransformMFENCED (el, doc);            TransformMFENCED (el, doc);
           break;            break;
        case MathML_EL_MSUBSUP:  
           /* end of a MSUBSUP. Create Base, Subscript, and Superscript */  
           CheckMathSubExpressions (el, MathML_EL_Base, MathML_EL_Subscript,  
                                    MathML_EL_Superscript, doc);  
           SetIntVertStretchAttr (el, doc, MathML_EL_Base, NULL);  
           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,
Line 2186  Document doc; Line 2226  Document doc;
                                    0, doc);                                     0, doc);
           SetIntVertStretchAttr (el, doc, MathML_EL_Base, NULL);            SetIntVertStretchAttr (el, doc, MathML_EL_Base, NULL);
           break;            break;
        case MathML_EL_MUNDEROVER:         case MathML_EL_MSUBSUP:
           /* end of a MUNDEROVER. Create UnderOverBase, Underscript, and            /* end of a MSUBSUP. Create Base, Subscript, and Superscript */
              Overscript */            CheckMathSubExpressions (el, MathML_EL_Base, MathML_EL_Subscript,
           CheckMathSubExpressions (el, MathML_EL_UnderOverBase,                                     MathML_EL_Superscript, doc);
                           MathML_EL_Underscript, MathML_EL_Overscript, doc);            SetIntVertStretchAttr (el, doc, MathML_EL_Base, NULL);
           SetIntHorizStretchAttr (el, doc);  
           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 */
Line 2208  Document doc; Line 2246  Document doc;
           SetIntHorizStretchAttr (el, doc);            SetIntHorizStretchAttr (el, doc);
           SetIntVertStretchAttr (el, doc, MathML_EL_UnderOverBase, NULL);            SetIntVertStretchAttr (el, doc, MathML_EL_UnderOverBase, NULL);
           break;            break;
          case MathML_EL_MUNDEROVER:
             /* end of a MUNDEROVER. Create UnderOverBase, Underscript, and
                Overscript */
             CheckMathSubExpressions (el, MathML_EL_UnderOverBase,
                             MathML_EL_Underscript, MathML_EL_Overscript, doc);
             SetIntHorizStretchAttr (el, doc);
             SetIntVertStretchAttr (el, doc, MathML_EL_UnderOverBase, NULL);
             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
              MathML S schema */               MathML S schema */
Line 2218  Document doc; Line 2264  Document doc;
              schema */               schema */
           CheckMTable (el, doc);            CheckMTable (el, doc);
           break;            break;
        case MathML_EL_MROW:         case MathML_EL_MTD:
           /* end of MROW */            /* Create placeholders within the table cell */
           /*if the first and the last child are MO containing a fence character            CreatePlaceholders (TtaGetFirstChild (el), doc);
              transform the MO into a MF and the character into a Thot SYMBOL */            break;
           child = TtaGetFirstChild (el);         case MathML_EL_MACTION:
           if (child != NULL)            /* Create placeholders within the MACTION element */
             {            CreatePlaceholders (TtaGetFirstChild (el), doc);
             CheckFence (child, doc);  
             child = TtaGetLastChild (el);  
             if (child != NULL)  
               CheckFence (child, doc);  
             /* Create placeholders within the MROW */  
             CreatePlaceholders (TtaGetFirstChild (el), doc);  
             }  
           break;            break;
        default:         default:
           break;            break;

Removed from v.1.38  
changed lines
  Added in v.1.39


Webmaster