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