Diff for /Amaya/amaya/HTMLbook.c between versions 1.37 and 1.38

version 1.37, 1999/03/02 09:45:05 version 1.38, 1999/03/09 14:38:27
Line 427  Document            document; Line 427  Document            document;
    PrintAs prints the document using predefined parameters.     PrintAs prints the document using predefined parameters.
    ----------------------------------------------------------------------*/       ----------------------------------------------------------------------*/  
 #ifdef __STDC__  #ifdef __STDC__
 void                PrintAs (Document document, View view)  void                PrintAs (Document doc, View view)
 #else  /* __STDC__ */  #else  /* __STDC__ */
 void                PrintAs (document, view)  void                PrintAs (doc, view)
 Document            document;  Document            doc;
 #endif /* __STDC__ */  #endif /* __STDC__ */
 {  {
   AttributeType      attrType;    AttributeType      attrType;
   Attribute          attr;    Attribute          attr;
   Element            el;    Element            el;
   CHAR               viewsToPrint[MAX_PATH];    CHAR               viewsToPrint[MAX_PATH];
   boolean            status;    boolean            status, textFile;
   
    CheckPrintingDocument (document);    textFile = (DocumentTypes[doc] == docText ||
                 DocumentTypes[doc] == docTextRO ||
                 DocumentTypes[doc] == docCSS ||
                 DocumentTypes[doc] == docCSSRO);
   
      CheckPrintingDocument (doc);
    ustrcpy (viewsToPrint, "Formatted_view ");     ustrcpy (viewsToPrint, "Formatted_view ");
    if (withToC)     if (!textFile && withToC)
      ustrcat (viewsToPrint, "Table_of_contents ");       ustrcat (viewsToPrint, "Table_of_contents ");
    if (numberLinks)     if (!textFile && numberLinks)
      /* display numbered links */       /* display numbered links */
      {       {
        /* associate an attribute InternalLink with all anchors refering         /* associate an attribute InternalLink with all anchors refering
Line 459  Document            document; Line 464  Document            document;
    else     else
      {       {
        if (PageSize == PP_A4)         if (PageSize == PP_A4)
          TtaSetPrintSchema ("HTMLPP");           {
              if (textFile)
                TtaSetPrintSchema ("TextFilePP");
              else
                TtaSetPrintSchema ("HTMLPP");
            }
        else         else
          TtaSetPrintSchema ("HTMLPPUS");                {
              if (textFile)
                TtaSetPrintSchema ("TextFilePPUS");
              else
                TtaSetPrintSchema ("HTMLPPUS");
            }    
      }       }
    /* post or remove the PrintURL attribute */     /* post or remove the PrintURL attribute */
    el =  TtaGetMainRoot (document);     el =  TtaGetMainRoot (doc);
    status = TtaIsDocumentModified (document);     status = TtaIsDocumentModified (doc);
    attrType.AttrSSchema = TtaGetDocumentSSchema (document);     attrType.AttrSSchema = TtaGetDocumentSSchema (doc);
    attrType.AttrTypeNum = HTML_ATTR_PrintURL;     if (textFile)
        attrType.AttrTypeNum = TextFile_ATTR_PrintURL;
      else
        attrType.AttrTypeNum = HTML_ATTR_PrintURL;
    attr = TtaGetAttribute (el, attrType);     attr = TtaGetAttribute (el, attrType);
    if (attr == 0 && printURL)     if (attr == 0 && printURL)
      {       {
         attr = TtaNewAttribute (attrType);          attr = TtaNewAttribute (attrType);
         TtaAttachAttribute (el, attr, document);          TtaAttachAttribute (el, attr, doc);
      }       }
    if (attr != 0 && !printURL)     if (attr != 0 && !printURL)
      TtaRemoveAttribute (el, attr, document);       TtaRemoveAttribute (el, attr, doc);
    TtaPrint (docPrint, viewsToPrint);     TtaPrint (docPrint, viewsToPrint);
    if (!status)     if (!status)
      TtaSetDocumentUnmodified (document);       TtaSetDocumentUnmodified (doc);
 }  }
   
   
Line 625  void                InitPrint () Line 643  void                InitPrint ()
   SetupAndPrint sets printing parameters and starts the printing process    SetupAndPrint sets printing parameters and starts the printing process
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 #ifdef __STDC__  #ifdef __STDC__
 void                SetupAndPrint (Document document, View view)  void                SetupAndPrint (Document doc, View view)
 #else  #else
 void                SetupAndPrint (document, view)  void                SetupAndPrint (doc, view)
 Document            document;  Document            doc;
 View                view;  View                view;
 #endif  #endif
 {  {
Line 636  View                view; Line 654  View                view;
    CHAR             bufMenu[MAX_LENGTH];     CHAR             bufMenu[MAX_LENGTH];
    int              i;     int              i;
 #  endif /* !_WINDOWS */  #  endif /* !_WINDOWS */
      boolean            status, textFile;
   
      textFile = (DocumentTypes[doc] == docText ||
                  DocumentTypes[doc] == docTextRO ||
                  DocumentTypes[doc] == docCSS ||
                  DocumentTypes[doc] == docCSSRO);
   
    /* Print form */     /* Print form */
    CheckPrintingDocument (document);     CheckPrintingDocument (doc);
   
 #  ifndef _WINDOWS  #  ifndef _WINDOWS
    TtaNewSheet (basePrint+NumFormPrint, TtaGetViewFrame (document, view),      TtaNewSheet (basePrint+NumFormPrint, TtaGetViewFrame (doc, view), 
                 TtaGetMessage (LIB, TMSG_LIB_PRINT),                  TtaGetMessage (LIB, TMSG_LIB_PRINT),
            1, TtaGetMessage (AMAYA, AM_BUTTON_PRINT), FALSE, 2, 'L', D_CANCEL);             1, TtaGetMessage (AMAYA, AM_BUTTON_PRINT), FALSE, 2, 'L', D_CANCEL);
    i = 0;     i = 0;
Line 700  View                view; Line 724  View                view;
    /* activates the Print form */     /* activates the Print form */
     TtaShowDialogue (basePrint+NumFormPrint, FALSE);      TtaShowDialogue (basePrint+NumFormPrint, FALSE);
 #   else  /* _WINDOWS */  #   else  /* _WINDOWS */
     CreatePrintDlgWindow (TtaGetViewFrame (document, view), PSdir, basePrint, NumMenuSupport, NumMenuOptions, NumMenuPaperFormat, NumZonePrinterName, NumFormPrint);       CreatePrintDlgWindow (TtaGetViewFrame (doc, view), PSdir, basePrint, NumMenuSupport, NumMenuOptions, NumMenuPaperFormat, NumZonePrinterName, NumFormPrint); 
 #   endif /* _WINDOWS */  #   endif /* _WINDOWS */
       if (textFile)
         {
           /* invalid dialogue entries */
           TtaRedrawMenuEntry (basePrint+NumMenuOptions, 1, NULL, -1, FALSE);
           TtaRedrawMenuEntry (basePrint+NumMenuOptions, 2, NULL, -1, FALSE);            }
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------
Line 709  View                view; Line 738  View                view;
   Execute the "Section Numbering" command    Execute the "Section Numbering" command
   ----------------------------------------------------------------------*/    ----------------------------------------------------------------------*/
 #ifdef __STDC__  #ifdef __STDC__
 void                SectionNumbering (Document document, View view)  void                SectionNumbering (Document doc, View view)
 #else  #else
 void                SectionNumbering (document, view)  void                SectionNumbering (doc, view)
 Document            document;  Document            doc;
 View                view;  View                view;
 #endif  #endif
 {  {
    ChangeAttrOnRoot (document, HTML_ATTR_SectionNumbering);     ChangeAttrOnRoot (doc, HTML_ATTR_SectionNumbering);
 }  }
   
 /*----------------------------------------------------------------------  /*----------------------------------------------------------------------

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


Webmaster