Annotation of Amaya/amaya/amaya.h, revision 1.324
1.8 cvs 1: /*
2: *
1.315 vatton 3: * (c) COPYRIGHT INRIA and W3C, 1996-2007
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.320 vatton 31:
1.1 cvs 32: /* Included headerfiles */
1.10 cvs 33: #include "EDITOR.h"
1.1 cvs 34: #include "HTML.h"
1.197 kahan 35: #include "MathML.h"
1.217 vatton 36: #include "SVG.h"
1.84 cvs 37: #include "TextFile.h"
1.224 cvs 38: #include "XML.h"
1.1 cvs 39: #include "amayamsg.h"
1.156 cvs 40: #include "parser.h"
1.25 cvs 41: #define NAME_LENGTH 32
42:
1.130 cvs 43: #define URL_STR "/"
44: #define URL_SEP '/'
1.245 cheyroul 45:
1.36 cvs 46:
1.94 cvs 47: /* Number of views used in Amaya */
48: #define AMAYA_MAX_VIEW_DOC 7
49:
1.141 cvs 50: /* the type of character convertion we want to make on local URLs */
51: typedef enum _ConvertionType
52: {
53: AM_CONV_NONE = 0,
54: AM_CONV_URL_SEP = 0x1, /* converts URL_SEPs into DIR_SEPs */
55: AM_CONV_PERCENT = 0x2, /* converts %xx into the equiv. char */
56: AM_CONV_ALL = 0xFFFF /* do everything */
57: }
58: ConvertionType;
59:
1.139 cvs 60: /* the structure used for exchanging HTTP header info between the net library
61: and amaya */
62: typedef struct _AHTHeaders
63: {
1.198 cvs 64: char *content_type;
65: char *charset;
66: char *content_length;
67: char *reason;
1.214 kahan 68: char *content_location;
1.238 kahan 69: char *full_content_location;
1.246 vatton 70: int status;
1.139 cvs 71: }
72: AHTHeaders;
73:
1.320 vatton 74: /* the HTTP header name we want to make visible to the application */
75: typedef enum _AHTHeaderName
76: {
77: AM_HTTP_CONTENT_TYPE = 0,
78: AM_HTTP_CHARSET = 1,
79: AM_HTTP_CONTENT_LENGTH = 2,
80: AM_HTTP_REASON = 3,
81: AM_HTTP_CONTENT_LOCATION = 4,
82: AM_HTTP_FULL_CONTENT_LOCATION = 5
83: }
84: AHTHeaderName;
85:
1.50 cvs 86: /* The structures used for request callbacks */
87: typedef void TIcbf (Document doc, int status, char *urlName,
1.139 cvs 88: char *outputfile, const AHTHeaders *http_headers,
1.50 cvs 89: const char *data_block, int data_block_size,
90: void *context);
91:
1.198 cvs 92: typedef void TTcbf (Document doc, int status, char *urlName,
1.312 cvs 93: char *outputfile, char *proxyName,
94: const AHTHeaders *http_headers, void *context);
1.50 cvs 95:
1.320 vatton 96: /* the structure used for storing the context of the
97: GetAmayaDoc_callback function */
98: typedef struct _AmayaDoc_context
99: {
100: Document doc;
101: Document baseDoc;
102: ThotBool history;
103: ThotBool local_link;
104: char *target;
105: char *documentname; /* the document name */
106: char *initial_url; /* initial loaded URL */
107: char *form_data;
108: int method;
109: ThotBool inNewWindow;
110: TTcbf *cbf;
111: void *ctx_cbf;
112: } AmayaDoc_context;
113:
114: /* the structure used for storing the context of the
115: Reload_callback function */
116: typedef struct _RELOAD_context
117: {
118: Document newdoc;
119: char *documentname;
120: char *form_data;
121: int method;
122: int position; /* volume preceding the the first element to be shown */
123: int distance; /* distance from the top of the window to the top of this
124: element (% of the window height) */
125: int visibility; /* register the current visibility */
126: ThotBool maparea; /* register the current maparea */
127: } RELOAD_context;
128:
1.25 cvs 129: /* How are Network accesses provided ? */
130: #include "libwww.h"
1.1 cvs 131:
1.66 cvs 132: /* The different events to open a new document */
1.41 cvs 133: typedef enum _ClickEvent {
1.73 cvs 134: CE_ABSOLUTE, CE_RELATIVE, CE_FORM_POST, CE_FORM_GET,
1.153 cvs 135: CE_HELP, CE_MAKEBOOK, CE_LOG , CE_TEMPLATE, CE_INIT,
1.320 vatton 136: CE_CSS, CE_ANNOT, CE_INSTANCE
1.41 cvs 137: } ClickEvent;
1.20 cvs 138:
139: #define NO 0
140: #define YES 1
141:
1.165 cvs 142: /* dialogues */
1.20 cvs 143: #define URLForm 1
1.29 cvs 144: #define OpenForm 2
145: #define URLName 3
146: #define LocalName 4
147: #define DirSelect 5
148: #define DocSelect 6
1.20 cvs 149: #define StopCommand 7
1.29 cvs 150: #define SaveForm 8
1.20 cvs 151: #define DirSave 9
152: #define DocSave 10
153: #define ToggleSave 11
1.29 cvs 154: #define NameSave 12
1.30 cvs 155: #define ImgDirSave 13
1.208 vatton 156: #define ConfirmForm 14
157: #define ConfirmText 15
158: #define AttrHREFForm 16
159: #define AttrHREFText 17
160: #define FormAnswer 18
161: #define RealmText 19
162: #define AnswerText 20
163: #define NameText 21
164: #define PasswordText 22
165: #define FilterText 23
166: #define ClassForm 24
167: #define ClassSelect 25
168: #define AClassForm 26
169: #define AClassSelect 27
170: #define ConfirmSave 28
171: #define ConfirmSaveList 29
172: #define BrowserDirSelect 30
173: #define BrowserDocSelect 31
174: #define BrowserFilterText 32
175: #define HREFLocalName 33
176: #define MakeIdMenu 34
177: #define mElemName 35
178: #define mAddId 36
179: #define mRemoveId 37
180: #define mIdUseSelection 38
181: #define mIdStatus 39
182: #define FileBrowserForm 40
183: #define FileBrowserText 41
184: #define FileBrowserFilter 42
185: #define FileBrowserLocalName 43
186: #define MimeTypeForm 44
187: #define MimeTypeSel 45
188: #define MimeTypeSave 46
189: #define CharsetForm 47
190: #define CharsetSave 48
191: #define CharsetSel 49
192: #define RadioSave 50
193: #define MimeFormStatus 51
194: #define SaveFormStatus 52
1.293 gully 195: #define OpenLocation 53
1.208 vatton 196: /* do not add items before this entry */
1.293 gully 197: #define OptionMenu 54
1.296 tollenae 198: #define OpenTemplate 55
1.318 carcone 199: #define PasswordSave 56
1.205 kahan 200:
1.134 cvs 201: /* MAX_SUBMENUS references reserved for submenus of Option menu */
202: /* Do not insert new entries here */
1.91 cvs 203: #define MAX_SUBMENUS 400
1.208 vatton 204: #define Label1 54 /* no callback */
205: #define Label2 55 /* no callback */
206: #define Label3 56 /* no callback */
207: #define Label4 57 /* no callback */
208: #define About1 58 /* no callback */
209: #define About2 59 /* no callback */
210: #define About3 60 /* no callback */
211: #define Version 61 /* no callback */
212: #define CharsetSaveL 62 /* no callback */
213: #define MimeTypeSaveL 63 /* no callback */
214: /* first callback available: 454 */
1.177 cvs 215: #define AboutForm 454
216: #define TableForm 455
217: #define TableRows 456
218: #define TableCols 457
219: #define TableBorder 458
220: #define MathEntityForm 459
221: #define MathEntityText 460
222: #define TitleForm 461
223: #define TitleText 462
1.192 cvs 224: #define DocInfoForm 463
225: #define DocInfoMimeTypeTitle 464
226: #define DocInfoMimeType 465
227: #define DocInfoCharsetTitle 466
228: #define DocInfoCharset 467
229: #define DocInfoContentTitle 468
230: #define DocInfoContent 469
1.215 kahan 231: #define DocInfoURLTitle 470
232: #define DocInfoURL 471
1.194 cvs 233: #define DocInfoTitle1 472
234: #define DocInfoTitle2 473
235: #define DocInfoContent1 474
236: #define DocInfoContent2 475
1.215 kahan 237: #define DocInfoLocationTitle 476
238: #define DocInfoLocation 477
1.222 kahan 239: #define DocInfoDocTypeTitle 478
240: #define DocInfoDocType 479
1.317 vatton 241: #define CssDirSave 480
1.323 vatton 242: #define JavascriptPromptForm 481
243: #define JavascriptPromptText 482
244: #define MAX_REF 483
1.20 cvs 245:
1.150 cvs 246: #define FormPrint 1
247: #define PrintOptions 2
248: #define PaperFormat 3
249: #define PrintSupport 4
250: #define PPrinterName 5
251: #define PaperOrientation 6
252: #define PPagesPerSheet 7
253: #define PRINT_MAX_REF 8
1.147 cvs 254:
1.234 cvs 255: #define FormLibrary 1
256: #define CopySVGLibSelection 2
257: #define ReferToSVGLibSelection 3
258: #define AddSVGModel 4
259: #define NewSVGFileURL 5
260: #define SVGLibCatalogueTitle 6
261: #define SVGLibraryLabel 7
262: #define SVGLibraryLabel1 8
263: #define SVGLibraryLabel2 9
264: #define SVGLibraryLabel3 10
1.240 cvs 265: #define SVGLibraryLabel4 11
266: #define NewSVGLibraryTitle 12
267: #define NewSVGLibrary 13
268: #define SVGLibraryURL 14
1.242 cvs 269: #define SVGLibraryDir 15
270: #define SVGLibrarySel 16
271: #define LibraryFilter 17
272: #define SVGLibFileBrowser 18
273: #define SVGLibFileBrowserText 19
274: #define LibraryCopyOption 20
275: #define LIBRARY_MAX_REF 21
1.234 cvs 276:
1.147 cvs 277: #define ImageURL 1
278: #define ImageLabel 2
279: #define ImageLabel2 3
280: #define ImageLabel3 4
281: #define ImageLabel4 5
282: #define ImageDir 6
283: #define ImageSel 7
284: #define ImageFilter 8
285: #define FormImage 9
286: #define RepeatImage 10
287: #define FormBackground 11
288: #define ImageAlt 12
289: #define FormAlt 13
1.289 vatton 290: #define FormObject 14
291: #define ImageType 15
292: #define IMAGE_MAX_REF 16
1.147 cvs 293:
294: #define CSSForm 0
295: #define CSSSelect 1
1.291 vatton 296: #define CSSEntry 2
1.303 vatton 297: #define CSSValue 3
298: #define MAX_CSS_REF 4
1.290 vatton 299:
1.147 cvs 300: #define FormMaths 0
1.313 vatton 301: #define FormMathOperator 1
1.316 vatton 302:
1.314 vatton 303: #define FormMathFenceAttributes 2
304: #define MathAttributeOpen 3
305: #define MathAttributeSeparators 4
306: #define MathAttributeClose 5
307:
1.316 vatton 308: #define FormMathIntegral 6
309: #define MathIntegralNumber 7
310: #define MathIntegralContour 8
311: #define MathIntegralType 9
312:
313: #define MenuMaths 10
314: #define MenuMaths1 11
315: #define MAX_MATHS 12
1.147 cvs 316:
1.165 cvs 317: #define FormGraph 0
318: #define MenuGraph 1
1.225 vatton 319: #define MenuGraph1 2
320: #define MAX_GRAPH 3
1.165 cvs 321:
1.11 cvs 322: /* The possible GET/POST/PUT request modes */
323: /*synchronous request*/
324: #define AMAYA_SYNC 1 /*0x000001 */
325: /*synchronous request with incremental callbacks */
326: #define AMAYA_ISYNC 2 /*0x000010 */
327: /*asynchronous request */
1.5 cvs 328: #define AMAYA_ASYNC 4 /*0x000100 */
1.11 cvs 329: /*asynchronous request with incremental callbacks */
1.5 cvs 330: #define AMAYA_IASYNC 8 /*0x001000 */
1.11 cvs 331: /* send the form using the POST HTTP method */
1.5 cvs 332: #define AMAYA_FORM_POST 16 /*0x010000 */
1.11 cvs 333: /* send the form using the GET HTTP method */
1.5 cvs 334: #define AMAYA_FORM_GET 32 /*0x100000 */
1.23 cvs 335: /* bypass caching */
1.265 vatton 336: #define AMAYA_NOCACHE 64 /* 2^6 */
1.23 cvs 337: /* don't follow redirections */
1.265 vatton 338: #define AMAYA_NOREDIR 128 /* 2^7 */
1.48 cvs 339: /* Prevents a stop race condition in ASYNC transfers */
1.265 vatton 340: #define AMAYA_ASYNC_SAFE_STOP 256 /* 2^8 */
341: #define AMAYA_LOAD_CSS 512 /* 2^9 */
342: #define AMAYA_FLUSH_REQUEST 1024 /* 2^10 */
343: #define AMAYA_USE_PRECONDITIONS 2048 /* 2^11 */
344: #define AMAYA_LOAD_IMAGE 4096 /* 2^12 */
1.167 kahan 345: /* post an annonation */
1.265 vatton 346: #define AMAYA_FILE_POST 8192 /* 2^13 */
1.167 kahan 347: /* delete an annotation */
1.265 vatton 348: #define AMAYA_DELETE 16384 /* 2^14 */
349: #define AMAYA_MBOOK_IMAGE 32768 /* 2^15 */
1.252 kahan 350: /* post an annotation using PUT */
1.265 vatton 351: #define AMAYA_SIMPLE_PUT 65536 /* 2^16 */
1.252 kahan 352:
1.87 cvs 353: /*
354: * Flags to indicate the action to take when the network options
355: * are modified
356: */
357: #define AMAYA_CACHE_RESTART 1
358: #define AMAYA_PROXY_RESTART 2
1.114 cvs 359: #define AMAYA_LANNEG_RESTART 4
360: #define AMAYA_SAFEPUT_RESTART 8
1.87 cvs 361:
1.26 cvs 362: /*
363: * Flags to indicate the status of the network requests associated
364: * to a document.
365: */
366:
367: #define AMAYA_NET_INACTIVE 1
368: #define AMAYA_NET_ERROR 2
369: #define AMAYA_NET_ACTIVE 4
370:
1.25 cvs 371: /*
372: * Flags for HTParse, specifying which parts of the URL are needed
373: */
374: #define AMAYA_PARSE_ACCESS 16 /* Access scheme, e.g. "HTTP" */
375: #define AMAYA_PARSE_HOST 8 /* Host name, e.g. "www.w3.org" */
376: #define AMAYA_PARSE_PATH 4 /* URL Path, e.g. "pub/WWW/TheProject.html" */
377: #define AMAYA_PARSE_ANCHOR 2 /* Fragment identifier, e.g. "news" */
378: #define AMAYA_PARSE_PUNCTUATION 1 /* Include delimiters, e.g, "/" and ":" */
379: #define AMAYA_PARSE_ALL 31 /* All the parts */
1.1 cvs 380:
1.198 cvs 381: THOT_EXPORT int AMAYA; /* Index of amaya message table */
1.273 gully 382: extern int appArgc; /* defined in EDITORAPP.c */
383: extern char **appArgv; /* defined in EDITORAPP.c */
1.198 cvs 384: THOT_EXPORT char TempFileDirectory[MAX_LENGTH];
385: THOT_EXPORT char Answer_text[MAX_LENGTH];
386: THOT_EXPORT char Answer_name[NAME_LENGTH];
387: THOT_EXPORT char Answer_password[NAME_LENGTH];
1.318 carcone 388: THOT_EXPORT ThotBool Answer_save_password;
1.198 cvs 389: THOT_EXPORT char Display_password[NAME_LENGTH];
390: THOT_EXPORT char ScanFilter[NAME_LENGTH]; /* to scan directories */
391: THOT_EXPORT char MathMLEntityName[MAX_LENGTH]; /* entity name typed by the user for a MathML expression */
1.323 vatton 392: THOT_EXPORT char JavascriptPromptValue[MAX_LENGTH]; /* value typed by the user in a prompt form */
1.198 cvs 393: THOT_EXPORT char IdElemName[MAX_LENGTH]; /* element name typed by the user from the MakeID menu */
394: THOT_EXPORT char IdStatus[50]; /* element name typed by the user from the MakeID menu */
395: THOT_EXPORT char ImgFilter[NAME_LENGTH];
1.279 cvs 396: THOT_EXPORT char DirectoryImage[MAX_LENGTH];
397: THOT_EXPORT char LastURLImage[MAX_LENGTH];
398: THOT_EXPORT char ImageName[MAX_LENGTH];
399: THOT_EXPORT char ImgAlt[MAX_LENGTH];
1.198 cvs 400: THOT_EXPORT char *LastURLName; /* last URL requested */
1.306 vatton 401: THOT_EXPORT char *Error_DocURL; /* The parsed file */
1.198 cvs 402: THOT_EXPORT char *DirectoryName; /* local path of the document */
403: THOT_EXPORT char *DocumentName; /* document name */
404: THOT_EXPORT char *SavePath; /* saving path */
405: THOT_EXPORT char *SaveName; /* saving name of the document */
1.299 gully 406: THOT_EXPORT char SaveFileName[MAX_LENGTH]; /* concatenation of SavePath+SaveName */
1.198 cvs 407: THOT_EXPORT char *ObjectName; /* document name */
408: THOT_EXPORT char *SaveImgsURL; /* where to save remote Images */
1.317 vatton 409: THOT_EXPORT char *SaveCssURL; /* where to save remote Images */
1.198 cvs 410: THOT_EXPORT char *TargetName;
411: THOT_EXPORT char *SavingFile; /* complete path or URL of the document */
1.202 cvs 412: THOT_EXPORT char *SavedDocumentURL;/* URL of the document that contained
413: the elements that are now in the
414: Cut and Paste buffer */
1.205 kahan 415: THOT_EXPORT char UserMimeType[MAX_LENGTH];
416: /* Used to pass the user's MIME type
417: choice when doing a Save As of a
418: local object to a server */
419: THOT_EXPORT char UserCharset[MAX_LENGTH];
420: /* Used to pass the user's charset
421: choice when doing a Save As of a
422: local object to a server */
1.207 kahan 423: THOT_EXPORT char SaveFormTmp[MAX_LENGTH];
424: /* Used for storing the temporary
425: changes in the ChangeCharset and
426: ChangeMimetype forms */
1.198 cvs 427: THOT_EXPORT int Lg_password;
428: THOT_EXPORT int BaseDialog;
429: THOT_EXPORT int BasePrint;
430: THOT_EXPORT int BaseImage;
431: THOT_EXPORT int MathsDialogue;
432: THOT_EXPORT int GraphDialogue;
433: THOT_EXPORT int BaseCSS;
434: THOT_EXPORT int ReturnOption;
435: THOT_EXPORT int NumberRows;
436: THOT_EXPORT int NumberCols;
437: THOT_EXPORT int TBorder;
438: THOT_EXPORT int ReturnOptionMenu;
439: THOT_EXPORT int IdDoc;
1.234 cvs 440: THOT_EXPORT int BaseLibrary;
1.198 cvs 441: THOT_EXPORT Document CurrentDocument;
442: THOT_EXPORT Document SavingDocument;
443: THOT_EXPORT Document SavingObject;
444: THOT_EXPORT Document AttrHREFdocument;
445: THOT_EXPORT Document DocBook;
446: THOT_EXPORT Document IncludedDocument;
1.294 vatton 447: THOT_EXPORT Document ParsedDoc; /* The document to which CSS are applied */
448: THOT_EXPORT Document ParsedCSS; /* The CSS document currently parsed */
1.198 cvs 449: THOT_EXPORT Element AttrHREFelement;
450: THOT_EXPORT char *AttrHREFvalue;
451: THOT_EXPORT Document SelectionDoc;
1.281 vatton 452: THOT_EXPORT ThotBool AttrHREFundoable;
453: THOT_EXPORT ThotBool IsNewAnchor;
454: THOT_EXPORT ThotBool UseLastTarget;
455: THOT_EXPORT ThotBool LinkAsCSS;
456: THOT_EXPORT ThotBool LinkAsXmlCSS;
1.323 vatton 457: THOT_EXPORT ThotBool LinkAsJavascript;
1.198 cvs 458: THOT_EXPORT ThotBool SaveAsHTML;
459: THOT_EXPORT ThotBool SaveAsXML;
460: THOT_EXPORT ThotBool SaveAsText;
1.324 ! vatton 461: THOT_EXPORT ThotBool CopyImages; /* should amaya copy images in Save As? */
! 462: THOT_EXPORT ThotBool CopyCss; /* should amaya copy CSS in Save As? */
! 463: THOT_EXPORT ThotBool UpdateURLs; /* should amaya update URLs in Save As? */
! 464: THOT_EXPORT ThotBool RemoveTemplate; /* should amaya remove template in Save As? */
1.198 cvs 465: THOT_EXPORT ThotBool UserAnswer;
1.280 vatton 466: THOT_EXPORT ThotBool ExtraChoice;
1.281 vatton 467: THOT_EXPORT ThotBool TableMenuActive;
468: THOT_EXPORT ThotBool MTableMenuActive;
1.287 gully 469: THOT_EXPORT ThotBool DontReplaceOldDoc;
1.198 cvs 470: THOT_EXPORT ThotBool InNewWindow;
471: THOT_EXPORT ThotBool SelectionInPRE;
472: THOT_EXPORT ThotBool SelectionInComment;
473: THOT_EXPORT ThotBool SelectionInEM;
474: THOT_EXPORT ThotBool SelectionInSTRONG;
475: THOT_EXPORT ThotBool SelectionInCITE;
476: THOT_EXPORT ThotBool SelectionInABBR;
477: THOT_EXPORT ThotBool SelectionInACRONYM;
478: THOT_EXPORT ThotBool SelectionInINS;
479: THOT_EXPORT ThotBool SelectionInDEL;
480: THOT_EXPORT ThotBool SelectionInDFN;
481: THOT_EXPORT ThotBool SelectionInCODE;
482: THOT_EXPORT ThotBool SelectionInVAR;
483: THOT_EXPORT ThotBool SelectionInSAMP;
484: THOT_EXPORT ThotBool SelectionInKBD;
485: THOT_EXPORT ThotBool SelectionInI;
486: THOT_EXPORT ThotBool SelectionInB;
487: THOT_EXPORT ThotBool SelectionInTT;
488: THOT_EXPORT ThotBool SelectionInBIG;
489: THOT_EXPORT ThotBool SelectionInSMALL;
490: THOT_EXPORT ThotBool SelectionInSub;
491: THOT_EXPORT ThotBool SelectionInSup;
492: THOT_EXPORT ThotBool SelectionInQuote;
493: THOT_EXPORT ThotBool SelectionInBDO;
494: THOT_EXPORT ThotBool HTMLErrorsFound;
495: THOT_EXPORT ThotBool XMLErrorsFound;
1.203 cvs 496: THOT_EXPORT ThotBool CSSErrorsFound;
1.198 cvs 497: THOT_EXPORT ThotBool XMLErrorsFoundInProfile;
498: THOT_EXPORT ThotBool XMLNotWellFormed;
1.283 vatton 499: THOT_EXPORT ThotBool XMLInvalidToken;
1.204 cvs 500: THOT_EXPORT ThotBool XMLCharacterNotSupported;
501: THOT_EXPORT ThotBool XMLUnknownEncoding;
1.261 vatton 502: /* enabling/disabling DAVLib */
503: THOT_EXPORT ThotBool DAVLibEnable;
1.267 vatton 504: THOT_EXPORT ThotBool Synchronizing;
1.272 vatton 505: THOT_EXPORT ThotBool AmayaUniqueInstance;
1.198 cvs 506: THOT_EXPORT ThotBool IdApplyToSelection; /* used in the Make ID menu */
1.310 vatton 507: THOT_EXPORT ThotBool Check_read_ids; /* check all parsed IDs */
1.198 cvs 508: THOT_EXPORT FILE *ErrFile;
1.294 vatton 509: THOT_EXPORT FILE *CSSErrFile;
1.53 cvs 510: typedef enum
511: {
1.285 vatton 512: docFree,
1.53 cvs 513: docHTML,
1.74 cvs 514: docText,
1.75 cvs 515: docImage,
1.85 cvs 516: docCSS,
1.110 cvs 517: docSource,
1.127 cvs 518: docAnnot,
1.164 cvs 519: docLog,
520: docSVG,
521: docMath,
1.234 cvs 522: docXml,
1.311 vatton 523: docTemplate,
1.256 kahan 524: docLibrary,
1.297 gully 525: docBookmark,
1.323 vatton 526: docJavascript,
1.297 gully 527: docTypeMax
1.53 cvs 528: } DocumentType;
1.64 cvs 529:
1.297 gully 530: THOT_EXPORT const char *DocumentTypeNames[docTypeMax]
531: #ifdef THOT_INITGLOBALVAR
532: =
533: {
534: "free", /* docFree */
535: "html", /* docHTML */
536: "text", /* docText */
537: "image", /* docImage */
538: "css", /* docCSS */
539: "source", /* docSource */
540: "annot", /* docAnnot */
541: "log", /* docLog */
542: "svg", /* docSVG */
543: "math", /* docMath */
544: "xml", /* docXml */
545: "library", /* docLibrary */
546: "bookmark",/* docBookmark */
547: }
548: #endif /* THOT_INITGLOBALVAR */
549: ; /* do not remove this ; */
1.64 cvs 550:
551: /* a record for data associated with a request */
552: typedef struct _DocumentMetaDataElement
553: {
1.244 vatton 554: char *initial_url; /* if the server returns a different URL name
555: after a redirection, we store here the one
556: that the browser first asked */
557: char *form_data; /* form data associated with a URL */
558: char *content_type; /* content type returned by the server */
559: char *charset; /* charset returned by the server */
560: char *content_length; /* content length returned by the server */
561: char *content_location; /* simplified content location returned by the server */
562: char *full_content_location; /* full content location returned by the server */
1.307 vatton 563: char *reason; /* http_headers reason*/
1.300 tollenae 564:
1.308 vatton 565: int method; /* method used to send this data */
1.321 vatton 566: Element link_icon; /* there is a link to an icon */
1.135 cvs 567: ThotBool xmlformat; /* the document should be exported in xml format */
1.321 vatton 568: ThotBool compound; /* the document is a compound document */
1.144 kahan 569: #ifdef ANNOTATIONS
570: Document source_doc; /* if the document is an annotation,
571: this variable giveso the annoted document
572: docid */
573: #endif /* ANNOTATIONS */
1.300 tollenae 574:
1.319 kia 575: ThotBool isTemplate; /* True if the document is a XTiger template or library,
576: False if template instance or not using XTiger.*/
1.300 tollenae 577: #ifdef TEMPLATES
1.309 francesc 578: char *template_url; /* the url of the original template (or null if not an instance) */
1.301 tollenae 579: char *template_version; /* if this document is derived from a template,
580: The name and the version of the template used to create the document
1.300 tollenae 581: is stored in this variable */
582: #endif /* TEMPLATES */
583:
1.64 cvs 584: } DocumentMetaDataElement;
1.202 cvs 585:
1.64 cvs 586:
1.200 cvs 587: #define DocumentTableLength MAX_DOCUMENTS
1.110 cvs 588: /* URL of each loaded document */
1.198 cvs 589: THOT_EXPORT char *DocumentURLs[DocumentTableLength];
1.64 cvs 590: /* Any formdata associated with a URL */
591: THOT_EXPORT DocumentMetaDataElement *DocumentMeta[DocumentTableLength];
1.110 cvs 592: /* Type of document */
1.198 cvs 593: THOT_EXPORT DocumentType DocumentTypes[DocumentTableLength];
1.236 vatton 594: /* Document that shows buttons */
595: THOT_EXPORT ThotBool SButtons[DocumentTableLength];
596: /* Document that shows address */
597: THOT_EXPORT ThotBool SAddress[DocumentTableLength];
1.213 vatton 598: /* Document that shows map areas */
599: THOT_EXPORT ThotBool MapAreas[DocumentTableLength];
1.305 cvs 600: /* Document splitted horizontally */
601: THOT_EXPORT ThotBool HSplit[DocumentTableLength];
602: /* Document splitted vertically */
603: THOT_EXPORT ThotBool VSplit[DocumentTableLength];
1.110 cvs 604: /* identifier of the document displaying the source code */
1.198 cvs 605: THOT_EXPORT Document DocumentSource[DocumentTableLength];
1.110 cvs 606: /* The whole document is loaded when the corresponding entry in FilesLoading is 0 */
1.198 cvs 607: THOT_EXPORT int FilesLoading[DocumentTableLength];
1.110 cvs 608: /* Status (error, success) of the download of the objects of a document */
1.198 cvs 609: THOT_EXPORT int DocNetworkStatus[DocumentTableLength];
1.42 cvs 610:
1.198 cvs 611: THOT_EXPORT Document W3Loading; /* the document being loaded */
612: THOT_EXPORT Document BackupDocument; /* the current backup */
1.298 gully 613:
1.243 vatton 614: /* list of previous open URLs */
615: THOT_EXPORT char *URL_list;
616: THOT_EXPORT int URL_list_len;
1.244 vatton 617: THOT_EXPORT ThotBool URL_list_keep;
1.296 tollenae 618:
619: /* list of templates */
620: THOT_EXPORT char *Template_list;
621: THOT_EXPORT int Template_list_len;
622:
1.268 vatton 623: #ifdef _SVG
1.244 vatton 624: THOT_EXPORT char *SVGlib_list;
1.268 vatton 625: #endif /* _SVG */
1.104 cvs 626:
1.269 cvs 627: /* list of auto-saved files */
628: #define MAX_AutoSave_list 20
629: THOT_EXPORT char *AutoSave_list;
630: THOT_EXPORT int AutoSave_list_len;
631: THOT_EXPORT int AutoSave_Interval;
632:
1.104 cvs 633: /* button indexes */
634: THOT_EXPORT int iStop;
635: THOT_EXPORT int iBack;
636: THOT_EXPORT int iForward;
637: THOT_EXPORT int iReload;
638: THOT_EXPORT int iHome;
639: THOT_EXPORT int iEditor;
640: THOT_EXPORT int iSave;
1.322 vatton 641: THOT_EXPORT int iSaveAll;
1.104 cvs 642: THOT_EXPORT int iPrint;
643: THOT_EXPORT int iFind;
644: THOT_EXPORT int iI;
645: THOT_EXPORT int iB;
646: THOT_EXPORT int iT;
647: THOT_EXPORT int iImage;
648: THOT_EXPORT int iH1;
649: THOT_EXPORT int iH2;
650: THOT_EXPORT int iH3;
651: THOT_EXPORT int iBullet;
652: THOT_EXPORT int iNum;
653: THOT_EXPORT int iDL;
654: THOT_EXPORT int iLink;
655: THOT_EXPORT int iTable;
1.284 gully 656: THOT_EXPORT int iLogo;
1.5 cvs 657:
1.64 cvs 658: #define IMAGE_NOT_LOADED 0
1.1 cvs 659: #define IMAGE_LOCAL 1
660: #define IMAGE_LOADED 2
661: #define IMAGE_MODIFIED 3
662:
1.109 cvs 663:
1.262 vatton 664: typedef void (*LoadedImageCallback)(Document doc, Element el, char *file,
665: void *extra, ThotBool isnew);
1.5 cvs 666: typedef struct _ElemImage
667: {
1.27 cvs 668: Element currentElement;/* first element using this image */
1.5 cvs 669: struct _ElemImage *nextElement;
1.27 cvs 670: LoadedImageCallback callback; /* Callback for non-standard handling */
671: void *extra; /* any extra info for the CallBack */
1.5 cvs 672: }
673: ElemImage;
674:
675: typedef struct _LoadedImageDesc
676: {
1.198 cvs 677: char *originalName; /* complete URL of the image */
1.262 vatton 678: char *localName; /* relative name (without path) of the image*/
679: char *tempfile; /* name of the file that stores the image */
1.205 kahan 680: char *content_type; /* the MIME type as sent by the server */
1.58 cvs 681: struct _LoadedImageDesc *prevImage;/* double linked list */
682: struct _LoadedImageDesc *nextImage;/* easier to unchain */
683: Document document; /* document concerned */
684: struct _ElemImage *elImage; /* first element using this image */
685: int imageType; /* the type of the image */
686: int status; /* the status of the image loading */
1.5 cvs 687: }
688: LoadedImageDesc;
1.109 cvs 689:
690: /* the structure used for storing the context of the
691: FetchAndDisplayImages_callback function */
692: typedef struct _FetchImage_context {
1.198 cvs 693: char *base_url;
1.109 cvs 694: LoadedImageDesc *desc;
695: } FetchImage_context;
696:
1.5 cvs 697:
1.14 cvs 698: THOT_EXPORT LoadedImageDesc *ImageURLs;
1.31 cvs 699: THOT_EXPORT LoadedImageDesc *ImageLocal;
1.1 cvs 700:
1.88 cvs 701: /* The default Amaya HOME pages (page shown at boot time */
1.292 vatton 702: #ifdef _WX
703: #define AMAYA_PAGE "AmayaPage_WX.html"
704: #else /* _WX */
1.198 cvs 705: #define AMAYA_PAGE "AmayaPage.html"
1.292 vatton 706: #endif /* _WX */
1.198 cvs 707: #define AMAYA_PAGE_DOC "http://www.w3.org/Amaya/User/"
1.137 cvs 708:
709: #ifndef MAX_TXT_LEN
710: #define MAX_TXT_LEN 1024 /* Max. length of strings */
711: #endif /* MAX_TXT_LEN */
1.88 cvs 712:
1.226 kahan 713: /* a collection of the XML MIME types that keep changing and that we use in Amaya */
714: #define AM_XHTML_MIME_TYPE "application/xhtml+xml"
1.229 kahan 715: #define AM_SVG_MIME_TYPE "image/svg+xml"
1.226 kahan 716: #define AM_MATHML_MIME_TYPE "application/mathml+xml"
717: #define AM_GENERIC_XML_MIME_TYPE "text/xml"
718:
1.231 cvs 719:
720: /* Doctype declarations used in Amaya */
1.275 cvs 721: /* first line of doctype declarations */
1.232 vatton 722: #define DOCTYPE1_HTML_STRICT "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01//EN\""
723: #define DOCTYPE1_HTML_TRANSITIONAL "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\""
724: #define DOCTYPE1_XHTML10_BASIC "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.0//EN\""
725: #define DOCTYPE1_XHTML10_STRICT "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
726: #define DOCTYPE1_XHTML11 "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\""
727: #define DOCTYPE1_XHTML11_PLUS_MATHML "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN\""
1.235 quint 728: #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 729: #define DOCTYPE1_XHTML10_TRANSITIONAL "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\""
730: #define DOCTYPE1_MATHML20 "<!DOCTYPE math PUBLIC \"-//W3C//DTD MathML 2.0//EN\""
731: #define DOCTYPE1_SVG10 "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.0//EN\""
1.231 cvs 732:
1.275 cvs 733: /* second line of doctype declarations */
1.232 vatton 734: #define DOCTYPE2_HTML_STRICT " \"http://www.w3.org/TR/html4/strict.dtd\">"
735: #define DOCTYPE2_HTML_TRANSITIONAL " \"http://www.w3.org/TR/html4/loose.dtd\">"
736: #define DOCTYPE2_XHTML10_BASIC " \"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd\">"
737: #define DOCTYPE2_XHTML10_STRICT " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">"
738: #define DOCTYPE2_XHTML11 " \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"
1.277 quint 739: #define DOCTYPE2_XHTML11_PLUS_MATHML " \"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd\">"
1.232 vatton 740: #define DOCTYPE2_XHTML11_PLUS_MATHML_PLUS_SVG " \"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd\">"
741: #define DOCTYPE2_XHTML10_TRANSITIONAL " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
742: #define DOCTYPE2_MATHML20 " \"http://www.w3.org/TR/MathML2/dtd/mathml2.dtd\">"
1.295 vatton 743: #define DOCTYPE2_SVG10 " \"http://www.w3.org/TR/2001/REC-SVG-20050904/DTD/svg10.dtd\">"
1.232 vatton 744:
745: #define MATHML_XSLT_NAME "pmathml.xsl"
1.286 vatton 746: #define MATHML_XSLT_URI "xml-stylesheet type=\"text/xsl\" href=\""
1.231 cvs 747:
1.254 quint 748: #define SVG_VERSION "1.0" /* version of the SVG specificatrion implemented
749: by the Amaya SVG editor */
750:
1.25 cvs 751: #endif /* AMAYA_H */
Webmaster