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