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

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

Webmaster