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