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