Annotation of Amaya/amaya/amaya.h, revision 1.9

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

Webmaster