Annotation of Amaya/amaya/amaya.h, revision 1.47
1.8 cvs 1: /*
2: *
3: * (c) COPYRIGHT MIT and INRIA, 1996.
4: * Please first read the full copyright statement in file COPYRIGHT.
5: *
6: */
7:
1.1 cvs 8: #ifndef AMAYA_H
9: #define AMAYA_H
10:
1.10 cvs 11: /* Thot interface */
12: #include "thot_gui.h"
13: #include "thot_sys.h"
14: #include "app.h"
15: #include "application.h"
16: #include "attribute.h"
17: #include "browser.h"
18: #include "content.h"
19: #include "dialog.h"
20: #include "interface.h"
21: #include "libmsg.h"
22: #include "message.h"
23: #include "presentation.h"
24: #include "selection.h"
25: #include "reference.h"
26: #include "tree.h"
27: #include "view.h"
28:
1.1 cvs 29: /* Included headerfiles */
1.10 cvs 30: #include "EDITOR.h"
1.1 cvs 31: #include "HTML.h"
32: #include "amayamsg.h"
33:
1.25 cvs 34: #define MAX_LENGTH 512
35: #define NAME_LENGTH 32
36: #define HTAppName "amaya"
1.47 ! cvs 37: #define HTAppVersion "V1.1d"
1.25 cvs 38:
1.36 cvs 39: #define URL_SEP '/'
40: #define URL_STR "/"
41:
1.25 cvs 42: /* How are Network accesses provided ? */
43: #ifdef AMAYA_JAVA
44: #include "libjava.h"
45: #else
1.39 cvs 46: #ifdef AMAYA_ILU
47: #include "libilu.h"
48: #else
1.25 cvs 49: #include "libwww.h"
50: #endif
1.39 cvs 51: #endif
1.1 cvs 52:
1.20 cvs 53: /* The different events for a DoubleClick */
1.41 cvs 54: typedef enum _ClickEvent {
55: CE_FALSE, CE_TRUE, CE_FORM_POST, CE_FORM_GET, CE_HELP, CE_MAKEBOOK
56: } ClickEvent;
1.20 cvs 57:
58: typedef char AmayaReadChar ();
59: #define NO 0
60: #define YES 1
61:
62: /* dialogue */
63: #define URLForm 1
1.29 cvs 64: #define OpenForm 2
65: #define URLName 3
66: #define LocalName 4
67: #define DirSelect 5
68: #define DocSelect 6
1.20 cvs 69: #define StopCommand 7
1.29 cvs 70: #define SaveForm 8
1.20 cvs 71: #define DirSave 9
72: #define DocSave 10
73: #define ToggleSave 11
1.29 cvs 74: #define NameSave 12
1.30 cvs 75: #define ImgDirSave 13
76: #define Label1 14
77: #define Label2 15
78: #define Label3 16
79: #define Label4 17
1.29 cvs 80: #define ConfirmForm 18
81: #define ConfirmText 19
1.20 cvs 82: #define AttrHREFForm 20
83: #define AttrHREFText 21
84: #define FormAnswer 22
85: #define AnswerText 24
86: #define NameText 25
87: #define PasswordText 26
1.30 cvs 88: #define FilterText 27
89: #define ClassForm 28
1.20 cvs 90: #define ClassSelect 29
91: #define AClassForm 30
1.30 cvs 92: #define AClassSelect 31
93: #define ConfirmSave 32
94: #define ConfirmSaveList 33
95: #define OptionMenu 34
1.33 cvs 96: #define About1 35
97: #define About2 36
98: #define About3 37
99: #define Version 38
100: #define FormAbout 39
1.20 cvs 101: #define MAX_REF 40
102:
1.11 cvs 103: /* The possible GET/POST/PUT request modes */
1.1 cvs 104:
1.11 cvs 105: /*synchronous request*/
106: #define AMAYA_SYNC 1 /*0x000001 */
107: /*synchronous request with incremental callbacks */
108: #define AMAYA_ISYNC 2 /*0x000010 */
109: /*asynchronous request */
1.5 cvs 110: #define AMAYA_ASYNC 4 /*0x000100 */
1.11 cvs 111: /*asynchronous request with incremental callbacks */
1.5 cvs 112: #define AMAYA_IASYNC 8 /*0x001000 */
1.11 cvs 113: /* send the form using the POST HTTP method */
1.5 cvs 114: #define AMAYA_FORM_POST 16 /*0x010000 */
1.11 cvs 115: /* send the form using the GET HTTP method */
1.5 cvs 116: #define AMAYA_FORM_GET 32 /*0x100000 */
1.23 cvs 117: /* bypass caching */
118: #define AMAYA_NOCACHE 64
119: /* don't follow redirections */
120: #define AMAYA_NOREDIR 128
1.1 cvs 121:
1.26 cvs 122: /*
123: * Flags to indicate the status of the network requests associated
124: * to a document.
125: */
126:
127: #define AMAYA_NET_INACTIVE 1
128: #define AMAYA_NET_ERROR 2
129: #define AMAYA_NET_ACTIVE 4
130:
1.25 cvs 131: /*
132: * Flags for HTParse, specifying which parts of the URL are needed
133: */
134: #define AMAYA_PARSE_ACCESS 16 /* Access scheme, e.g. "HTTP" */
135: #define AMAYA_PARSE_HOST 8 /* Host name, e.g. "www.w3.org" */
136: #define AMAYA_PARSE_PATH 4 /* URL Path, e.g. "pub/WWW/TheProject.html" */
137: #define AMAYA_PARSE_ANCHOR 2 /* Fragment identifier, e.g. "news" */
138: #define AMAYA_PARSE_PUNCTUATION 1 /* Include delimiters, e.g, "/" and ":" */
139: #define AMAYA_PARSE_ALL 31 /* All the parts */
1.1 cvs 140:
1.14 cvs 141: THOT_EXPORT int appArgc;
142: THOT_EXPORT char **appArgv;
143: THOT_EXPORT char TempFileDirectory[MAX_LENGTH];
144: THOT_EXPORT char Answer_text[MAX_LENGTH];
145: THOT_EXPORT char Answer_name[NAME_LENGTH];
146: THOT_EXPORT char Answer_password[NAME_LENGTH];
147: THOT_EXPORT char Display_password[NAME_LENGTH];
1.30 cvs 148: THOT_EXPORT char ScanFilter[NAME_LENGTH]; /* to scan directories */
1.14 cvs 149: THOT_EXPORT char *LastURLName; /* last URL requested */
150: THOT_EXPORT char *DirectoryName; /* local path of the document */
151: THOT_EXPORT char *DocumentName; /* document name */
1.43 cvs 152: THOT_EXPORT char *SavePath; /* saving path */
153: THOT_EXPORT char *SaveName; /* saving name of the document */
1.30 cvs 154: THOT_EXPORT char *ObjectName; /* document name */
1.14 cvs 155: THOT_EXPORT char *SaveImgsURL; /* where to save remote Images */
156: THOT_EXPORT char *TargetName;
1.45 cvs 157: THOT_EXPORT char *SavingFile; /* complete path or URL of the document */
158: THOT_EXPORT int Lg_password;
159: THOT_EXPORT int BaseDialog;
1.14 cvs 160: THOT_EXPORT int ReturnOption;
161: THOT_EXPORT Document CurrentDocument;
162: THOT_EXPORT Document SavingDocument;
163: THOT_EXPORT Document SavingObject;
164: THOT_EXPORT Document AttrHREFdocument;
1.45 cvs 165: THOT_EXPORT Document DocBook;
166: THOT_EXPORT Document IncludedDocument;
1.14 cvs 167: THOT_EXPORT Element AttrHREFelement;
168: THOT_EXPORT char *AttrHREFvalue;
169: THOT_EXPORT Document SelectionDoc;
1.45 cvs 170: THOT_EXPORT boolean SaveAsHTML;
171: THOT_EXPORT boolean SaveAsText;
172: THOT_EXPORT boolean CopyImages; /* should we copy images in Save As */
173: THOT_EXPORT boolean UpdateURLs; /* should we update URLs in Save As */
174: THOT_EXPORT boolean UserAnswer;
175: THOT_EXPORT boolean InNewWindow;
1.14 cvs 176: THOT_EXPORT boolean SelectionInPRE;
177: THOT_EXPORT boolean SelectionInComment;
178: THOT_EXPORT boolean SelectionInEM;
179: THOT_EXPORT boolean SelectionInSTRONG;
180: THOT_EXPORT boolean SelectionInCITE;
181: THOT_EXPORT boolean SelectionInDFN;
182: THOT_EXPORT boolean SelectionInCODE;
183: THOT_EXPORT boolean SelectionInVAR;
184: THOT_EXPORT boolean SelectionInSAMP;
185: THOT_EXPORT boolean SelectionInKBD;
186: THOT_EXPORT boolean SelectionInI;
187: THOT_EXPORT boolean SelectionInB;
188: THOT_EXPORT boolean SelectionInTT;
1.15 cvs 189: THOT_EXPORT boolean SelectionInU;
1.14 cvs 190: THOT_EXPORT boolean SelectionInSTRIKE;
191: THOT_EXPORT boolean SelectionInBIG;
192: THOT_EXPORT boolean SelectionInSMALL;
1.1 cvs 193:
194: #define DocumentTableLength 10
1.14 cvs 195: THOT_EXPORT char *DocumentURLs[DocumentTableLength];
1.41 cvs 196: /* TRUE if the document is displayed by help commands */
197: THOT_EXPORT boolean HelpDocuments[DocumentTableLength];
1.1 cvs 198: /* The whole document is loaded when the corresponding value
199: in FilesLoading is equal to 0 */
1.14 cvs 200: THOT_EXPORT int FilesLoading[DocumentTableLength];
1.26 cvs 201: /* Gives the status (error, success) of the download of the objects of
202: a document */
1.42 cvs 203:
1.26 cvs 204: THOT_EXPORT int DocNetworkStatus[DocumentTableLength];
1.14 cvs 205: THOT_EXPORT Document W3Loading; /* the document being loaded */
206: THOT_EXPORT int IButton;
207: THOT_EXPORT int BButton;
208: THOT_EXPORT int TTButton;
1.5 cvs 209:
1.1 cvs 210: #define IMAGE_NOT_LOADED 0
211: #define IMAGE_LOCAL 1
212: #define IMAGE_LOADED 2
213: #define IMAGE_MODIFIED 3
214:
1.27 cvs 215: #ifdef __STDC__
1.41 cvs 216: typedef void (*LoadedImageCallback)(Document doc, Element el, char *file, void *extra);
1.27 cvs 217: #else
218: typedef void (*LoadedImageCallback)();
219: #endif
1.5 cvs 220: typedef struct _ElemImage
221: {
1.27 cvs 222: Element currentElement;/* first element using this image */
1.5 cvs 223: struct _ElemImage *nextElement;
1.27 cvs 224: LoadedImageCallback callback; /* Callback for non-standard handling */
225: void *extra; /* any extra info for the CallBack */
1.5 cvs 226: }
227: ElemImage;
228:
229: typedef struct _LoadedImageDesc
230: {
231: char *originalName; /* complete URL of the image */
232: char *localName; /* local name (without path) of the image */
1.27 cvs 233: struct _LoadedImageDesc *prevImage;/* double linked list */
234: struct _LoadedImageDesc *nextImage;/* easier to unchain */
1.5 cvs 235: Document document; /* document concerned */
236: struct _ElemImage *elImage; /* first element using this image */
1.27 cvs 237: int status; /* the status of the Image loading */
1.5 cvs 238: }
239: LoadedImageDesc;
240:
1.14 cvs 241: THOT_EXPORT LoadedImageDesc *ImageURLs;
1.31 cvs 242: THOT_EXPORT LoadedImageDesc *ImageLocal;
1.1 cvs 243:
244: #define EOS '\0'
245: #define EOL '\n'
246: #define TAB '\t'
247: #define SPACE ' '
1.22 cvs 248:
1.25 cvs 249: #endif /* AMAYA_H */
1.1 cvs 250:
Webmaster