Annotation of Amaya/amaya/amaya.h, revision 1.20
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:
34: /* libwww interface */
1.2 cvs 35: #include "WWWLib.h"
36: #include "WWWApp.h"
37: #include "WWWHTTP.h"
38: #include "WWWInit.h"
39: #include "HTReqMan.h"
1.10 cvs 40: #include "HTReq.h"
1.2 cvs 41: #include "HTAncMan.h"
42: #include "HTAccess.h"
43: #include "HTEvntrg.h"
44: #include "HTAlert.h"
45: #include "HTNetMan.h"
46: #include "HTBInit.h"
1.5 cvs 47: #include "WWWHTTP.h" /* HTTP access module */
1.2 cvs 48: #include "HTProxy.h"
1.1 cvs 49:
1.5 cvs 50: typedef char PathBuffer[MAX_PATH];
1.1 cvs 51:
1.20 ! cvs 52: /* The different events for a DoubleClick */
! 53:
! 54: typedef enum _DoubleClickEvent
! 55: {
! 56: DC_FALSE = 0,
! 57: DC_TRUE = 1,
! 58: DC_FORM_POST = 2,
! 59: DC_FORM_GET = 4
! 60: }
! 61: DoubleClickEvent;
! 62:
! 63: typedef char AmayaReadChar ();
! 64:
! 65: /*typedef void *PresentationTarget; */
! 66:
! 67: #define NO 0
! 68: #define YES 1
! 69:
! 70: /* dialogue */
! 71: #define URLForm 1
! 72: #define OpenForm 2
! 73: #define URLName 3
! 74: #define LocalName 4
! 75: #define DirSelect 5
! 76: #define DocSelect 6
! 77: #define StopCommand 7
! 78: #define SaveForm 8
! 79: #define DirSave 9
! 80: #define DocSave 10
! 81: #define ToggleSave 11
! 82: #define NameSave 12
! 83: #define Lbl1Save 13
! 84: #define Lbl2Save 14
! 85: #define ImgDirSave 14
! 86: #define Lbl3Save 15
! 87: #define Lbl4Save 16
! 88: #define Lbl5Save 17
! 89: #define ConfirmForm 18
! 90: #define ConfirmText 19
! 91: #define AttrHREFForm 20
! 92: #define AttrHREFText 21
! 93: #define FormAnswer 22
! 94: #define TextLabel 23
! 95: #define AnswerText 24
! 96: #define NameText 25
! 97: #define PasswordText 26
! 98: #define ClassForm 27
! 99: #define ClassLabel 28
! 100: #define ClassSelect 29
! 101: #define AClassForm 30
! 102: #define AClassLabel 31
! 103: #define AClassSelect 32
! 104: #define ConfirmSave 33
! 105: #define ConfirmSaveLbl 34
! 106: #define ConfirmSaveList 35
! 107: #define OptionMenu 36
! 108: #define MAX_REF 40
! 109:
! 110: #define MAX_LENGTH 512
! 111: #define NAME_LENGTH 32
! 112: #define HTAppName "amaya"
! 113: #define HTAppVersion "V0.95b Beta"
! 114:
1.5 cvs 115: typedef struct _AHTDocIdStatus
116: {
117: int docid; /* a docid */
118: int counter; /* number of open requests associated with dicid */
119: }
120: AHTDocId_Status;
121:
122:
123: typedef struct __AmayaContext
124: {
125: HTList *reqlist; /* List of current requests */
126: HTList *docid_status; /* Status for each active docid */
127: int open_requests; /* number of open requests */
128: }
129: AmayaContext;
1.1 cvs 130:
1.11 cvs 131: /* The possible GET/POST/PUT request modes */
1.1 cvs 132:
1.11 cvs 133: /*synchronous request*/
134: #define AMAYA_SYNC 1 /*0x000001 */
135: /*synchronous request with incremental callbacks */
136: #define AMAYA_ISYNC 2 /*0x000010 */
137: /*asynchronous request */
1.5 cvs 138: #define AMAYA_ASYNC 4 /*0x000100 */
1.11 cvs 139: /*asynchronous request with incremental callbacks */
1.5 cvs 140: #define AMAYA_IASYNC 8 /*0x001000 */
1.11 cvs 141: /* send the form using the POST HTTP method */
1.5 cvs 142: #define AMAYA_FORM_POST 16 /*0x010000 */
1.11 cvs 143: /* send the form using the GET HTTP method */
1.5 cvs 144: #define AMAYA_FORM_GET 32 /*0x100000 */
1.1 cvs 145:
1.11 cvs 146: /* the possible states for a request */
1.5 cvs 147:
148: typedef enum _AHTReqStatus
149: {
1.11 cvs 150: HT_NEW = 0, /* new request */
151: HT_NEW_PENDING = 1, /* new request, waiting for a socket */
152: HT_WAITING = 2, /* active request, waiting for socket events */
153: HT_BUSY = 4, /* the request is currently being processed */
154: HT_END = 8, /* the request has ended */
155: HT_ABORT = 16, /* user aborted the request */
156: HT_ERR = 32 /* an error happened during the request */
1.5 cvs 157: }
158: AHTReqStatus;
159:
1.11 cvs 160: /* The structure used for requests */
161:
1.5 cvs 162: typedef void TIcbf (void *request_context, const char *data_block, int data_block_size, int request_status);
163:
164: typedef void TTcbf (void *request_context, int request_status);
165:
166: typedef struct _AHTReqContext
167: {
168: HTRequest *request; /* Pointer to the associated request object */
169: HTParentAnchor *anchor;
170: HTMethod method; /* What method are we envoking */
1.11 cvs 171: int docid; /* docid to which this request belongs */
1.5 cvs 172: AHTReqStatus reqStatus; /* status of the request */
173: SockOps read_ops; /* The ops operation which must be used during
174: ** an Xt read callback */
1.1 cvs 175:
1.5 cvs 176: SockOps write_ops; /* The ops operation which must be used during
177: ** an Xt write callback */
1.1 cvs 178:
1.5 cvs 179: SockOps except_ops; /* The ops operation which must be used during
180: ** an Xt exception callback */
1.1 cvs 181:
182: #ifdef WWW_XWINDOWS
1.5 cvs 183: XtInputId read_xtinput_id; /* The read xt event id assocciated with
184: the request */
185: XtInputId write_xtinput_id; /* The write xt event id assocciated with
186: the request */
187: XtInputId except_xtinput_id; /* The except xt event id assocciated with
188: the request */
189: #endif /* WWW_XWINDOWS */
1.20 ! cvs 190:
! 191: /*** Experimental ****/
1.19 cvs 192: SOCKET read_sock; /* read socket associated with the request */
193: SOCKET write_sock; /* write socket associated with the request */
194: SOCKET except_sock; /* except socket associated with the request */
1.20 ! cvs 195: /*** End of experimental stuff ****/
! 196:
1.5 cvs 197: char *outputfile; /* file to receive incoming data */
198: FILE *output; /* file pointer to outputfile */
1.11 cvs 199: int mode; /* Mode of request: SYNC/ASYNC/IASYNC/FORM POST/FORM GET */
1.5 cvs 200: char *urlName; /* url to retrieve/or that was retrieved */
1.20 ! cvs 201: char status_urlName [MAX_LENGTH]; /* url name to be displayed on the status bar */
1.5 cvs 202: TIcbf *incremental_cbf; /* For IASYNC mode, @ of callback function */
203: /* It'll be called each time a new data package */
204: /* is received */
205: void *context_icbf; /* Context for the above cbf */
206: TTcbf *terminate_cbf; /* optional CBF which will be invoked after */
207: /* a file has been received */
208: void *context_tcbf; /* Context for the above cbf */
209:
210: /* The following elements are used for the PUT and POST */
211:
212: HTParentAnchor *dest; /* Destination for PUT etc. */
213: unsigned long block_size; /* size in bytes of the file to put */
214: int put_counter; /* number of bytes already put */
215: char *mem_ptr; /* ptr to a struct in mem which contains a copy */
216: /* of the file to put */
1.11 cvs 217: char *error_stream; /* pointer to an error message associated with the
218: request */
219: int error_stream_size; /* size of the above message */
220: boolean error_html; /* If TRUE, means the applications wants to display
221: error_stream. If false, error_stream is not
222: displayed at all */
1.5 cvs 223: }
224: AHTReqContext;
1.1 cvs 225:
226:
1.14 cvs 227: THOT_EXPORT int appArgc;
228: THOT_EXPORT char **appArgv;
229: THOT_EXPORT char TempFileDirectory[MAX_LENGTH];
230: THOT_EXPORT char Answer_text[MAX_LENGTH];
231: THOT_EXPORT char Answer_name[NAME_LENGTH];
232: THOT_EXPORT char Answer_password[NAME_LENGTH];
233: THOT_EXPORT char Display_password[NAME_LENGTH];
234: THOT_EXPORT int Lg_password;
235: THOT_EXPORT int BaseDialog;
236: THOT_EXPORT char *LastURLName; /* last URL requested */
237: THOT_EXPORT char *DirectoryName; /* local path of the document */
238: THOT_EXPORT char *DocumentName; /* document name */
239: THOT_EXPORT char *ObjectName; /* document name */
240: THOT_EXPORT char *SaveImgsURL; /* where to save remote Images */
241: THOT_EXPORT char *TargetName;
242: THOT_EXPORT int CopyImages; /* should we copy images in Save As */
243: THOT_EXPORT int UpdateURLs; /* should we update URLs in Save As */
244: THOT_EXPORT boolean UserAnswer;
245: THOT_EXPORT int ReturnOption;
246: THOT_EXPORT boolean InNewWindow;
247: THOT_EXPORT Document CurrentDocument;
248: THOT_EXPORT Document SavingDocument;
249: THOT_EXPORT Document SavingObject;
250: THOT_EXPORT char *SavingFile; /* complete path or URL of the document */
251: THOT_EXPORT Document AttrHREFdocument;
252: THOT_EXPORT Element AttrHREFelement;
253: THOT_EXPORT char *AttrHREFvalue;
254: THOT_EXPORT Document SelectionDoc;
255: THOT_EXPORT boolean SelectionInPRE;
256: THOT_EXPORT boolean SelectionInComment;
257: THOT_EXPORT boolean SelectionInEM;
258: THOT_EXPORT boolean SelectionInSTRONG;
259: THOT_EXPORT boolean SelectionInCITE;
260: THOT_EXPORT boolean SelectionInDFN;
261: THOT_EXPORT boolean SelectionInCODE;
262: THOT_EXPORT boolean SelectionInVAR;
263: THOT_EXPORT boolean SelectionInSAMP;
264: THOT_EXPORT boolean SelectionInKBD;
265: THOT_EXPORT boolean SelectionInI;
266: THOT_EXPORT boolean SelectionInB;
267: THOT_EXPORT boolean SelectionInTT;
1.15 cvs 268: THOT_EXPORT boolean SelectionInU;
1.14 cvs 269: THOT_EXPORT boolean SelectionInSTRIKE;
270: THOT_EXPORT boolean SelectionInBIG;
271: THOT_EXPORT boolean SelectionInSMALL;
1.1 cvs 272:
273: #define DocumentTableLength 10
1.14 cvs 274: THOT_EXPORT char *DocumentURLs[DocumentTableLength];
1.5 cvs 275:
1.1 cvs 276: /* The whole document is loaded when the corresponding value
277: in FilesLoading is equal to 0 */
1.14 cvs 278: THOT_EXPORT int FilesLoading[DocumentTableLength];
279: THOT_EXPORT Document W3Loading; /* the document being loaded */
280: THOT_EXPORT int IButton;
281: THOT_EXPORT int BButton;
282: THOT_EXPORT int TTButton;
1.5 cvs 283:
1.18 cvs 284: THOT_EXPORT char AmayaLastHTTPErrorMsg [];
285:
1.1 cvs 286: #define IMAGE_NOT_LOADED 0
287: #define IMAGE_LOCAL 1
288: #define IMAGE_LOADED 2
289: #define IMAGE_MODIFIED 3
290:
1.5 cvs 291: typedef struct _ElemImage
292: {
293: Element currentElement; /* first element using this image */
294: struct _ElemImage *nextElement;
295: }
296: ElemImage;
297:
298: typedef struct _LoadedImageDesc
299: {
300: char *originalName; /* complete URL of the image */
301: char *localName; /* local name (without path) of the image */
302: struct _LoadedImageDesc *prevImage;
303: struct _LoadedImageDesc *nextImage;
304: Document document; /* document concerned */
305: struct _ElemImage *elImage; /* first element using this image */
306: int status;
307: }
308: LoadedImageDesc;
309:
1.14 cvs 310: THOT_EXPORT LoadedImageDesc *ImageURLs;
1.1 cvs 311:
1.14 cvs 312: THOT_EXPORT HTList *conv; /* List of global converters */
313: THOT_EXPORT AmayaContext *Amaya; /* Amaya's request global context */
1.1 cvs 314:
315: #define EOS '\0'
316: #define EOL '\n'
317: #define TAB '\t'
318: #define SPACE ' '
319:
320: #endif /* AMAYA_H */
Webmaster