Annotation of Amaya/amaya/amaya.h, revision 1.240

1.8       cvs         1: /*
                      2:  *
1.223     vatton      3:  *  (c) COPYRIGHT MIT and INRIA, 1996-2002
1.8       cvs         4:  *  Please first read the full copyright statement in file COPYRIGHT.
                      5:  *
                      6:  */
                      7: 
1.59      cvs         8: #ifndef AMAYA_H 
1.1       cvs         9: #define AMAYA_H
                     10: 
1.10      cvs        11: /* Thot interface */
                     12: #include "thot_gui.h"
                     13: #include "thot_sys.h"
1.79      cvs        14: #include "appstruct.h"
1.10      cvs        15: #include "application.h"
                     16: #include "attribute.h"
                     17: #include "browser.h"
                     18: #include "content.h"
                     19: #include "dialog.h"
1.103     cvs        20: #include "fileaccess.h"
1.10      cvs        21: #include "interface.h"
                     22: #include "libmsg.h"
                     23: #include "message.h"
                     24: #include "presentation.h"
                     25: #include "selection.h"
                     26: #include "reference.h"
                     27: #include "tree.h"
                     28: #include "view.h"
1.105     cvs        29: #include "uconvert.h"
1.82      cvs        30: #include "undo.h"
1.1       cvs        31: /* Included headerfiles */
1.10      cvs        32: #include "EDITOR.h"
1.1       cvs        33: #include "HTML.h"
1.197     kahan      34: #include "MathML.h"
1.217     vatton     35: #include "SVG.h"
1.84      cvs        36: #include "TextFile.h"
1.224     cvs        37: #include "XML.h"
1.1       cvs        38: #include "amayamsg.h"
1.156     cvs        39: #include "parser.h"
1.1       cvs        40: 
1.25      cvs        41: #define NAME_LENGTH     32
                     42: 
1.198     cvs        43: #define HTAppName     "amaya"
1.239     vatton     44: #define HTAppVersion  "6.4"
                     45: #define HTAppDate     " 16 September 2002"
1.130     cvs        46: 
                     47: #define URL_STR       "/"
                     48: #define URL_SEP       '/'
1.36      cvs        49: 
1.94      cvs        50: /* Number of views used in Amaya */
                     51: #define AMAYA_MAX_VIEW_DOC  7
                     52: 
1.141     cvs        53: /* the type of character convertion we want to make on local URLs */
                     54: typedef enum _ConvertionType
                     55: {
                     56:   AM_CONV_NONE = 0,
                     57:   AM_CONV_URL_SEP = 0x1, /* converts URL_SEPs into DIR_SEPs */
                     58:   AM_CONV_PERCENT = 0x2, /* converts %xx into the equiv. char */
                     59:   AM_CONV_ALL = 0xFFFF   /* do everything */
                     60: }
                     61: ConvertionType;
                     62: 
1.139     cvs        63: /* the HTTP header name we want to make visible to the application */
                     64: typedef enum _AHTHeaderName
                     65:   {
                     66:     AM_HTTP_CONTENT_TYPE = 0,
1.175     kahan      67:     AM_HTTP_CHARSET = 1,
1.196     kahan      68:     AM_HTTP_CONTENT_LENGTH = 2,
1.214     kahan      69:     AM_HTTP_REASON = 3,
1.238     kahan      70:     AM_HTTP_CONTENT_LOCATION = 4,
                     71:     AM_HTTP_FULL_CONTENT_LOCATION = 5
1.139     cvs        72:   } 
                     73: AHTHeaderName;
                     74: 
                     75: /* the structure used for exchanging HTTP header info between the net library
                     76:    and amaya */
                     77: typedef struct _AHTHeaders
                     78:   {
1.198     cvs        79:     char *content_type;
                     80:     char *charset;
                     81:     char *content_length;
                     82:     char *reason;
1.214     kahan      83:     char *content_location;
1.238     kahan      84:     char *full_content_location;
1.139     cvs        85:   }
                     86: AHTHeaders;
                     87: 
1.50      cvs        88: /* The structures used for request callbacks */
                     89: typedef void   TIcbf (Document doc, int status, char *urlName,
1.139     cvs        90:                      char *outputfile, const AHTHeaders *http_headers,
1.50      cvs        91:                      const char *data_block, int data_block_size,
                     92:                      void *context);
                     93: 
1.198     cvs        94: typedef void  TTcbf (Document doc, int status, char *urlName,
                     95:                      char *outputfile, const AHTHeaders *http_headers,
1.50      cvs        96:                      void *context);
                     97: 
1.25      cvs        98: /* How are Network accesses provided ? */
                     99: #include "libwww.h"
1.1       cvs       100: 
1.66      cvs       101: /* The different events to open a new document */
1.41      cvs       102: typedef enum _ClickEvent {
1.73      cvs       103:   CE_ABSOLUTE, CE_RELATIVE, CE_FORM_POST, CE_FORM_GET,
1.153     cvs       104:   CE_HELP, CE_MAKEBOOK, CE_LOG , CE_TEMPLATE, CE_INIT,
1.190     cvs       105:   CE_CSS, CE_ANNOT
1.41      cvs       106: } ClickEvent;
1.20      cvs       107: 
                    108: #define NO               0
                    109: #define YES              1
                    110: 
1.165     cvs       111: /* dialogues */
1.20      cvs       112: #define URLForm          1
1.29      cvs       113: #define OpenForm         2
                    114: #define URLName          3
                    115: #define LocalName        4
                    116: #define DirSelect        5
                    117: #define DocSelect        6
1.20      cvs       118: #define StopCommand      7
1.29      cvs       119: #define SaveForm         8
1.20      cvs       120: #define DirSave          9
                    121: #define DocSave         10
                    122: #define ToggleSave      11
1.29      cvs       123: #define NameSave        12
1.30      cvs       124: #define ImgDirSave      13
1.208     vatton    125: #define ConfirmForm     14
                    126: #define ConfirmText     15
                    127: #define AttrHREFForm    16
                    128: #define AttrHREFText    17
                    129: #define FormAnswer      18
                    130: #define RealmText       19
                    131: #define AnswerText      20
                    132: #define NameText        21
                    133: #define PasswordText    22
                    134: #define FilterText      23
                    135: #define ClassForm       24
                    136: #define ClassSelect     25
                    137: #define AClassForm      26
                    138: #define AClassSelect    27
                    139: #define ConfirmSave     28
                    140: #define ConfirmSaveList 29
                    141: #define BrowserDirSelect   30
                    142: #define BrowserDocSelect   31
                    143: #define BrowserFilterText  32
                    144: #define HREFLocalName   33
                    145: #define MakeIdMenu      34
                    146: #define mElemName       35
                    147: #define mAddId          36
                    148: #define mRemoveId       37
                    149: #define mIdUseSelection 38
                    150: #define mIdStatus       39
                    151: #define FileBrowserForm 40
                    152: #define FileBrowserText 41
                    153: #define FileBrowserFilter 42
                    154: #define FileBrowserLocalName 43
                    155: #define MimeTypeForm    44
                    156: #define MimeTypeSel     45
                    157: #define MimeTypeSave    46
                    158: #define CharsetForm     47
                    159: #define CharsetSave     48
                    160: #define CharsetSel      49
                    161: #define RadioSave       50
                    162: #define MimeFormStatus  51
                    163: #define SaveFormStatus  52
                    164: /* do not add items before this entry */
                    165: #define OptionMenu     53
1.205     kahan     166: 
1.134     cvs       167: /* MAX_SUBMENUS references reserved for submenus of Option menu */
                    168: /* Do not insert new entries here */
1.91      cvs       169: #define MAX_SUBMENUS    400
1.208     vatton    170: #define Label1          54 /* no callback */
                    171: #define Label2          55 /* no callback */
                    172: #define Label3          56 /* no callback */
                    173: #define Label4          57 /* no callback */
                    174: #define About1         58 /* no callback */
                    175: #define About2         59 /* no callback */
                    176: #define About3         60 /* no callback */
                    177: #define Version                61 /* no callback */
                    178: #define CharsetSaveL    62 /* no callback */
                    179: #define MimeTypeSaveL   63 /* no callback */
                    180: /* first callback available: 454 */
1.177     cvs       181: #define AboutForm              454
                    182: #define TableForm       455
                    183: #define TableRows       456
                    184: #define TableCols       457
                    185: #define TableBorder     458
                    186: #define MathEntityForm  459
                    187: #define MathEntityText  460
                    188: #define TitleForm       461
                    189: #define TitleText       462
1.192     cvs       190: #define DocInfoForm           463
                    191: #define DocInfoMimeTypeTitle  464
                    192: #define DocInfoMimeType       465
                    193: #define DocInfoCharsetTitle   466
                    194: #define DocInfoCharset        467
                    195: #define DocInfoContentTitle   468
                    196: #define DocInfoContent        469
1.215     kahan     197: #define DocInfoURLTitle       470
                    198: #define DocInfoURL            471
1.194     cvs       199: #define DocInfoTitle1         472
                    200: #define DocInfoTitle2         473
                    201: #define DocInfoContent1       474
                    202: #define DocInfoContent2       475
1.215     kahan     203: #define DocInfoLocationTitle  476
                    204: #define DocInfoLocation       477
1.222     kahan     205: #define DocInfoDocTypeTitle   478
                    206: #define DocInfoDocType        479
                    207: #define MAX_REF         480
1.20      cvs       208: 
1.150     cvs       209: #define FormPrint        1
                    210: #define PrintOptions     2
                    211: #define PaperFormat      3
                    212: #define PrintSupport     4
                    213: #define PPrinterName     5
                    214: #define PaperOrientation 6
                    215: #define PPagesPerSheet   7
                    216: #define PRINT_MAX_REF   8
1.147     cvs       217: 
1.234     cvs       218: #define FormLibrary              1
                    219: #define CopySVGLibSelection      2
                    220: #define ReferToSVGLibSelection   3
                    221: #define AddSVGModel              4
                    222: #define NewSVGFileURL            5
                    223: #define SVGLibCatalogueTitle     6
                    224: #define SVGLibraryLabel          7
                    225: #define SVGLibraryLabel1         8
                    226: #define SVGLibraryLabel2         9
                    227: #define SVGLibraryLabel3        10
1.240   ! cvs       228: #define SVGLibraryLabel4        11
        !           229: #define NewSVGLibraryTitle      12
        !           230: #define NewSVGLibrary           13
        !           231: #define SVGLibraryURL           14
        !           232: #define SVGFileDir              15
        !           233: #define SVGFileSel              16
        !           234: #define SVGFilter               17
        !           235: #define SVGLibraryDir           18
        !           236: #define SVGLibrarySel           19
        !           237: #define LibraryFilter           20
        !           238: #define SVGFileBrowser          21
        !           239: #define SVGFileBrowserText      22
        !           240: #define SVGLibFileBrowser       23
        !           241: #define SVGLibFileBrowserText   24
        !           242: #define LibraryCopyOption       25
        !           243: #define SVGLibStaticCopy        26
        !           244: #define SVGLibDynamicCopy       27
        !           245: #define LIBRARY_MAX_REF         28
1.234     cvs       246: 
1.147     cvs       247: #define ImageURL       1
                    248: #define ImageLabel     2
                    249: #define ImageLabel2    3
                    250: #define ImageLabel3    4
                    251: #define ImageLabel4    5
                    252: #define ImageDir       6
                    253: #define ImageSel       7
                    254: #define ImageFilter     8
                    255: #define FormImage      9
                    256: #define RepeatImage    10
                    257: #define FormBackground 11
                    258: #define ImageAlt       12
                    259: #define FormAlt        13
                    260: #define IMAGE_MAX_REF  14
                    261: 
                    262: #define CSSForm         0
                    263: #define CSSSelect       1
                    264: #define MAX_CSS_REF     2
                    265: 
                    266: #define FormMaths 0
                    267: #define MenuMaths 1
1.225     vatton    268: #define MenuMaths1 2
                    269: #define MAX_MATHS  3
1.147     cvs       270: 
1.165     cvs       271: #define FormGraph 0
                    272: #define MenuGraph 1
1.225     vatton    273: #define MenuGraph1 2
                    274: #define MAX_GRAPH 3
1.165     cvs       275: 
1.11      cvs       276: /* The possible GET/POST/PUT request modes */
                    277: /*synchronous request*/
                    278: #define AMAYA_SYNC     1       /*0x000001 */  
                    279: /*synchronous request with incremental callbacks */
                    280: #define AMAYA_ISYNC    2       /*0x000010 */  
                    281: /*asynchronous request */
1.5       cvs       282: #define AMAYA_ASYNC    4       /*0x000100 */
1.11      cvs       283: /*asynchronous request with incremental callbacks */
1.5       cvs       284: #define AMAYA_IASYNC   8       /*0x001000 */
1.11      cvs       285: /* send the form using the POST HTTP method */
1.5       cvs       286: #define AMAYA_FORM_POST 16     /*0x010000 */
1.11      cvs       287: /* send the form using the GET HTTP method */
1.5       cvs       288: #define AMAYA_FORM_GET  32     /*0x100000 */
1.23      cvs       289: /* bypass caching */
                    290: #define AMAYA_NOCACHE  64
                    291: /* don't follow redirections */
                    292: #define AMAYA_NOREDIR  128
1.48      cvs       293: /* Prevents a stop race condition in ASYNC transfers */
                    294: #define AMAYA_ASYNC_SAFE_STOP  256
1.60      cvs       295: #define AMAYA_LOAD_CSS   512
1.67      cvs       296: #define AMAYA_FLUSH_REQUEST 1024
1.80      cvs       297: #define AMAYA_USE_PRECONDITIONS 2048
1.123     cvs       298: #define AMAYA_LOAD_IMAGE 4096
1.167     kahan     299: /* post an annonation */
                    300: #define AMAYA_FILE_POST 8192
                    301: /* delete an annotation */
                    302: #define AMAYA_DELETE    16384
1.180     kahan     303: #define AMAYA_MBOOK_IMAGE 32768
1.87      cvs       304: /*
                    305:  * Flags to indicate the action to take when the network options
                    306:  * are modified
                    307:  */
                    308: #define AMAYA_CACHE_RESTART 1
                    309: #define AMAYA_PROXY_RESTART 2
1.114     cvs       310: #define AMAYA_LANNEG_RESTART 4
                    311: #define AMAYA_SAFEPUT_RESTART 8
1.87      cvs       312: 
1.26      cvs       313: /*
                    314:  * Flags to indicate the status of the network requests associated
                    315:  * to a document.
                    316:  */
                    317: 
                    318: #define AMAYA_NET_INACTIVE 1
                    319: #define AMAYA_NET_ERROR    2
                    320: #define AMAYA_NET_ACTIVE   4
                    321: 
1.25      cvs       322: /*
                    323:  * Flags for HTParse, specifying which parts of the URL are needed
                    324:  */
                    325: #define AMAYA_PARSE_ACCESS      16  /* Access scheme, e.g. "HTTP" */
                    326: #define AMAYA_PARSE_HOST        8   /* Host name, e.g. "www.w3.org" */
                    327: #define AMAYA_PARSE_PATH        4   /* URL Path, e.g. "pub/WWW/TheProject.html" */
                    328: #define AMAYA_PARSE_ANCHOR      2   /* Fragment identifier, e.g. "news" */
                    329: #define AMAYA_PARSE_PUNCTUATION 1   /* Include delimiters, e.g, "/" and ":" */
                    330: #define AMAYA_PARSE_ALL         31  /* All the parts */
1.1       cvs       331: 
1.198     cvs       332: THOT_EXPORT int        AMAYA;     /* Index of amaya message table */
                    333: THOT_EXPORT int        appArgc;
                    334: THOT_EXPORT char     **appArgv;
                    335: THOT_EXPORT char       TempFileDirectory[MAX_LENGTH];
                    336: THOT_EXPORT char       Answer_text[MAX_LENGTH];
                    337: THOT_EXPORT char       Answer_name[NAME_LENGTH];
                    338: THOT_EXPORT char       Answer_password[NAME_LENGTH];
                    339: THOT_EXPORT char       Display_password[NAME_LENGTH];
                    340: THOT_EXPORT char       ScanFilter[NAME_LENGTH]; /* to scan directories    */
                    341: THOT_EXPORT char       MathMLEntityName[MAX_LENGTH]; /* entity name typed by the user for a MathML expression */
                    342: THOT_EXPORT char       IdElemName[MAX_LENGTH]; /* element name typed by the user from the MakeID menu */
                    343: THOT_EXPORT char       IdStatus[50]; /* element name typed by the user from the MakeID menu */
                    344: THOT_EXPORT char       ImgFilter[NAME_LENGTH];
                    345: THOT_EXPORT char      *LastURLName;    /* last URL requested               */
                    346: THOT_EXPORT char      *DirectoryName;  /* local path of the document       */
                    347: THOT_EXPORT char      *DocumentName;   /* document name                    */
                    348: THOT_EXPORT char      *SavePath;       /* saving path                      */
                    349: THOT_EXPORT char      *SaveName;       /* saving name of the document      */
                    350: THOT_EXPORT char      *ObjectName;     /* document name                    */
                    351: THOT_EXPORT char      *SaveImgsURL;    /* where to save remote Images      */
                    352: THOT_EXPORT char      *TargetName;
                    353: THOT_EXPORT char      *SavingFile;     /* complete path or URL of the document */
1.202     cvs       354: THOT_EXPORT char      *SavedDocumentURL;/* URL of the document that contained
                    355:                                           the elements that are now in the
                    356:                                           Cut and Paste buffer */
1.205     kahan     357: THOT_EXPORT char      UserMimeType[MAX_LENGTH];
                    358:                                         /* Used to pass the user's MIME type 
                    359:                                           choice when doing a Save As of a
                    360:                                           local object to a server */
                    361: THOT_EXPORT char      UserCharset[MAX_LENGTH];
                    362:                                         /* Used to pass the user's charset
                    363:                                           choice when doing a Save As of a
                    364:                                           local object to a server */
1.207     kahan     365: THOT_EXPORT char      SaveFormTmp[MAX_LENGTH];
                    366:                                         /* Used for storing the temporary
                    367:                                           changes in the ChangeCharset and
                    368:                                           ChangeMimetype forms */
1.198     cvs       369: THOT_EXPORT int        Lg_password;
                    370: THOT_EXPORT int        BaseDialog;
                    371: THOT_EXPORT int        BasePrint;
                    372: THOT_EXPORT int        BaseImage;
                    373: THOT_EXPORT int               MathsDialogue;
                    374: THOT_EXPORT int               GraphDialogue;
                    375: THOT_EXPORT int               BaseCSS;
                    376: THOT_EXPORT int        ReturnOption;
                    377: THOT_EXPORT int        NumberRows;
                    378: THOT_EXPORT int        NumberCols;
                    379: THOT_EXPORT int        TBorder;
                    380: THOT_EXPORT int        ReturnOptionMenu;
                    381: THOT_EXPORT int        IdDoc;
1.234     cvs       382: THOT_EXPORT int        BaseLibrary;
1.198     cvs       383: THOT_EXPORT Document   CurrentDocument;
                    384: THOT_EXPORT Document   SavingDocument;
                    385: THOT_EXPORT Document   SavingObject;
                    386: THOT_EXPORT Document   AttrHREFdocument;
                    387: THOT_EXPORT Document   DocBook;
                    388: THOT_EXPORT Document   IncludedDocument;
                    389: THOT_EXPORT Element    AttrHREFelement;
                    390: THOT_EXPORT char      *AttrHREFvalue;
                    391: THOT_EXPORT Document   SelectionDoc;
                    392: THOT_EXPORT ThotBool  IsNewAnchor;
                    393: THOT_EXPORT ThotBool  UseLastTarget;
                    394: THOT_EXPORT ThotBool  LinkAsCSS;
                    395: THOT_EXPORT ThotBool   SaveAsHTML;
                    396: THOT_EXPORT ThotBool   SaveAsXML;
                    397: THOT_EXPORT ThotBool   SaveAsText;
                    398: THOT_EXPORT ThotBool   CopyImages;     /* should we copy images in Save As */
                    399: THOT_EXPORT ThotBool   UpdateURLs;     /* should we update URLs in Save As */
                    400: THOT_EXPORT ThotBool   UserAnswer;
                    401: THOT_EXPORT ThotBool   InNewWindow;
                    402: THOT_EXPORT ThotBool   SelectionInPRE;
                    403: THOT_EXPORT ThotBool   SelectionInComment;
                    404: THOT_EXPORT ThotBool   SelectionInEM;
                    405: THOT_EXPORT ThotBool   SelectionInSTRONG;
                    406: THOT_EXPORT ThotBool   SelectionInCITE;
                    407: THOT_EXPORT ThotBool   SelectionInABBR;
                    408: THOT_EXPORT ThotBool   SelectionInACRONYM;
                    409: THOT_EXPORT ThotBool   SelectionInINS;
                    410: THOT_EXPORT ThotBool   SelectionInDEL;
                    411: THOT_EXPORT ThotBool   SelectionInDFN;
                    412: THOT_EXPORT ThotBool   SelectionInCODE;
                    413: THOT_EXPORT ThotBool   SelectionInVAR;
                    414: THOT_EXPORT ThotBool   SelectionInSAMP;
                    415: THOT_EXPORT ThotBool   SelectionInKBD;
                    416: THOT_EXPORT ThotBool   SelectionInI;
                    417: THOT_EXPORT ThotBool   SelectionInB;
                    418: THOT_EXPORT ThotBool   SelectionInTT;
                    419: THOT_EXPORT ThotBool   SelectionInBIG;
                    420: THOT_EXPORT ThotBool   SelectionInSMALL;
                    421: THOT_EXPORT ThotBool   SelectionInSub;
                    422: THOT_EXPORT ThotBool   SelectionInSup;
                    423: THOT_EXPORT ThotBool   SelectionInQuote;
                    424: THOT_EXPORT ThotBool   SelectionInBDO;
                    425: THOT_EXPORT ThotBool   HTMLErrorsFound;
                    426: THOT_EXPORT ThotBool   XMLErrorsFound;
1.203     cvs       427: THOT_EXPORT ThotBool   CSSErrorsFound;
1.198     cvs       428: THOT_EXPORT ThotBool   XMLErrorsFoundInProfile;
                    429: THOT_EXPORT ThotBool   XMLNotWellFormed;
1.204     cvs       430: THOT_EXPORT ThotBool   XMLCharacterNotSupported;
                    431: THOT_EXPORT ThotBool   XMLUnknownEncoding;
                    432: 
1.198     cvs       433: THOT_EXPORT ThotBool   IdApplyToSelection; /* used in the Make ID menu */
                    434: THOT_EXPORT FILE      *ErrFile;
1.53      cvs       435: typedef enum
                    436: {
                    437:   docHTML,
1.74      cvs       438:   docText,
1.75      cvs       439:   docImage,
1.85      cvs       440:   docCSS,
1.110     cvs       441:   docSource,
1.127     cvs       442:   docAnnot,
1.164     cvs       443:   docLog,
                    444:   docSVG,
                    445:   docMath,
1.234     cvs       446:   docXml,
                    447:   docLibrary
1.53      cvs       448: } DocumentType;
1.64      cvs       449: 
                    450: 
                    451: /* a record for data associated with a request */
                    452: typedef struct _DocumentMetaDataElement
                    453: {
1.198     cvs       454:   char    *initial_url;      /* if the server returns a different URL name
                    455:                                after a redirection, we store here the one
                    456:                                that the browser first asked */
                    457:   char    *form_data;        /* form data associated with a URL */
                    458:   char    *content_type;     /* content type returned by the server */
                    459:   char    *charset;          /* charset returned by the server */
                    460:   char    *content_length;   /* content length returned by the server */
1.238     kahan     461:   char    *content_location; /* simplified content location returned by the server */
                    462:   char    *full_content_location; /* full content location returned by the server */
1.166     cvs       463:   ClickEvent method;           /* method used to send this data */
1.135     cvs       464:   ThotBool   xmlformat;        /* the document should be exported in xml format */
1.166     cvs       465:   
1.144     kahan     466: #ifdef ANNOTATIONS
                    467:   Document   source_doc;       /* if the document is an annotation,
                    468:                                  this variable giveso the annoted document
                    469:                                  docid */
                    470: #endif /* ANNOTATIONS */
1.64      cvs       471: } DocumentMetaDataElement;
1.202     cvs       472: 
1.64      cvs       473: 
1.200     cvs       474: #define DocumentTableLength MAX_DOCUMENTS
1.110     cvs       475: /* URL of each loaded document */
1.198     cvs       476: THOT_EXPORT char                    *DocumentURLs[DocumentTableLength];
1.64      cvs       477: /* Any formdata associated with a URL */
                    478: THOT_EXPORT DocumentMetaDataElement *DocumentMeta[DocumentTableLength];
1.110     cvs       479: /* Type of document */
1.198     cvs       480: THOT_EXPORT DocumentType             DocumentTypes[DocumentTableLength];
1.166     cvs       481: /* Document is in read only mode */
1.198     cvs       482: THOT_EXPORT ThotBool                 ReadOnlyDocument[DocumentTableLength];
1.212     vatton    483: /* Document with section numbering */
                    484: THOT_EXPORT ThotBool                 SNumbering[DocumentTableLength];
1.236     vatton    485: /* Document that shows buttons */
                    486: THOT_EXPORT ThotBool                 SButtons[DocumentTableLength];
                    487: /* Document that shows address */
                    488: THOT_EXPORT ThotBool                 SAddress[DocumentTableLength];
1.213     vatton    489: /* Document that shows map areas */
                    490: THOT_EXPORT ThotBool                 MapAreas[DocumentTableLength];
1.110     cvs       491: /* identifier of the document displaying the source code */
1.198     cvs       492: THOT_EXPORT Document                 DocumentSource[DocumentTableLength];
1.110     cvs       493: /* The whole document is loaded when the corresponding entry in FilesLoading is 0 */
1.198     cvs       494: THOT_EXPORT int                      FilesLoading[DocumentTableLength];
1.110     cvs       495: /* Status (error, success) of the download of the objects of a document */
1.198     cvs       496: THOT_EXPORT int                      DocNetworkStatus[DocumentTableLength];
1.42      cvs       497: 
1.198     cvs       498: THOT_EXPORT Document                 W3Loading; /* the document being loaded */
                    499: THOT_EXPORT Document                 BackupDocument; /* the current backup */
1.104     cvs       500: 
                    501: /* button indexes */
                    502: THOT_EXPORT int iStop;
                    503: THOT_EXPORT int iBack;
                    504: THOT_EXPORT int iForward;
                    505: THOT_EXPORT int iReload;
                    506: THOT_EXPORT int iHome;
                    507: THOT_EXPORT int iEditor;
                    508: THOT_EXPORT int iSave;
                    509: THOT_EXPORT int iPrint;
                    510: THOT_EXPORT int iFind;
                    511: THOT_EXPORT int iI;
                    512: THOT_EXPORT int iB;
                    513: THOT_EXPORT int iT;
                    514: THOT_EXPORT int iImage;
                    515: THOT_EXPORT int iH1;
                    516: THOT_EXPORT int iH2;
                    517: THOT_EXPORT int iH3;
                    518: THOT_EXPORT int iBullet;
                    519: THOT_EXPORT int iNum;
                    520: THOT_EXPORT int iDL;
                    521: THOT_EXPORT int iLink;
                    522: THOT_EXPORT int iTable;
1.5       cvs       523: 
1.64      cvs       524: #define IMAGE_NOT_LOADED        0
1.1       cvs       525: #define IMAGE_LOCAL            1
                    526: #define IMAGE_LOADED           2
                    527: #define IMAGE_MODIFIED         3
                    528: 
1.109     cvs       529: 
1.198     cvs       530: typedef void (*LoadedImageCallback)(Document doc, Element el, char *file, void *extra);
1.5       cvs       531: typedef struct _ElemImage
                    532:   {
1.27      cvs       533:      Element             currentElement;/* first element using this image */
1.5       cvs       534:      struct _ElemImage  *nextElement;
1.27      cvs       535:      LoadedImageCallback callback;     /* Callback for non-standard handling */
                    536:      void              *extra;         /* any extra info for the CallBack */
1.5       cvs       537:   }
                    538: ElemImage;
                    539: 
                    540: typedef struct _LoadedImageDesc
                    541:   {
1.198     cvs       542:      char               *originalName;  /* complete URL of the image                */
                    543:      char               *localName;     /* local name (without path) of the image   */
1.205     kahan     544:      char               *content_type;  /* the MIME type as sent by the server      */
1.58      cvs       545:      struct _LoadedImageDesc *prevImage;/* double linked list                       */
                    546:      struct _LoadedImageDesc *nextImage;/* easier to unchain                        */
                    547:      Document            document;     /* document concerned                       */
                    548:      struct _ElemImage  *elImage;      /* first element using this image           */
                    549:      int                 imageType;     /* the type of the image                    */
                    550:      int                 status;       /* the status of the image loading          */
1.5       cvs       551:   }
                    552: LoadedImageDesc;
1.109     cvs       553: 
                    554: /* the structure used for storing the context of the 
                    555:    FetchAndDisplayImages_callback function */
                    556: typedef struct _FetchImage_context {
1.198     cvs       557:   char               *base_url;
1.109     cvs       558:   LoadedImageDesc    *desc;
                    559: } FetchImage_context;
                    560: 
1.5       cvs       561: 
1.14      cvs       562: THOT_EXPORT LoadedImageDesc *ImageURLs;
1.31      cvs       563: THOT_EXPORT LoadedImageDesc *ImageLocal;
1.1       cvs       564: 
1.88      cvs       565: /* The default Amaya HOME pages (page shown at boot time */
1.198     cvs       566: #define AMAYA_PAGE  "AmayaPage.html"
                    567: #define AMAYA_PAGE_DOC  "http://www.w3.org/Amaya/User/"
1.137     cvs       568: 
                    569: #ifndef MAX_TXT_LEN
                    570: #define MAX_TXT_LEN 1024       /* Max. length of strings */
                    571: #endif  /* MAX_TXT_LEN */
1.88      cvs       572: 
1.226     kahan     573: /* a collection of the XML MIME types that keep changing and that we use in Amaya */
                    574: 
                    575: #define AM_XHTML_MIME_TYPE        "application/xhtml+xml"
1.229     kahan     576: #define AM_SVG_MIME_TYPE          "image/svg+xml"
1.226     kahan     577: #define AM_MATHML_MIME_TYPE       "application/mathml+xml"
                    578: #define AM_GENERIC_XML_MIME_TYPE  "text/xml"
                    579: 
1.231     cvs       580: 
                    581: /* Doctype declarations used in Amaya */
1.232     vatton    582: #define DOCTYPE1_HTML_STRICT          "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\""
                    583: #define DOCTYPE1_HTML_TRANSITIONAL    "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\""
                    584: #define DOCTYPE1_XHTML10_BASIC        "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\""
                    585: #define DOCTYPE1_XHTML10_STRICT       "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
                    586: #define DOCTYPE1_XHTML11              "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\""
                    587: #define DOCTYPE1_XHTML11_PLUS_MATHML  "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\""
1.235     quint     588: #define DOCTYPE1_XHTML11_PLUS_MATHML_PLUS_SVG  "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN\""
1.232     vatton    589: #define DOCTYPE1_XHTML10_TRANSITIONAL "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""
                    590: #define DOCTYPE1_MATHML20             "<!DOCTYPE math PUBLIC \"-//W3C//DTD MathML 2.0//EN\""
                    591: #define DOCTYPE1_SVG10                "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\""
1.231     cvs       592: 
1.232     vatton    593: #define DOCTYPE2_HTML_STRICT          "      \"http://www.w3.org/TR/html4/strict.dtd\">"
                    594: #define DOCTYPE2_HTML_TRANSITIONAL    "      \"http://www.w3.org/TR/html4/loose.dtd\">"
                    595: #define DOCTYPE2_XHTML10_BASIC        "      \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">"
                    596: #define DOCTYPE2_XHTML10_STRICT       "      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
                    597: #define DOCTYPE2_XHTML11              "      \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"
                    598: #define DOCTYPE2_XHTML11_PLUS_MATHML  "      \"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd\">"
                    599: #define DOCTYPE2_XHTML11_PLUS_MATHML_PLUS_SVG  "      \"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd\">"
                    600: #define DOCTYPE2_XHTML10_TRANSITIONAL "      \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
                    601: #define DOCTYPE2_MATHML20             "      \"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd\">"
                    602: #define DOCTYPE2_SVG10                "      \"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd\">"
                    603: 
                    604: #define MATHML_XSLT_NAME     "pmathml.xsl"
1.235     quint     605: #define MATHML_XSLT_URI      "<!-- Processing Instruction generated by Amaya; the stylesheet is\n     available on the W3C site at http://www.w3.org/Math/XSL/pmathml.xsl -->\n<?xml-stylesheet type=\"text/xsl\" href=\""
1.231     cvs       606: 
1.25      cvs       607: #endif /* AMAYA_H */

Webmaster