home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 2 / RISC_DISC_2.iso / the_web / browsers / arcweb / _arcweb / h / requester
Encoding:
Text File  |  1995-07-14  |  11.0 KB  |  286 lines

  1. /*
  2.  * ArcWeb
  3.  *
  4.  * Copyright (C) Stewart Brodie, 1994,1995
  5.  *
  6.  * This product is supplied under the terms laid down in the `Terms' file.
  7.  *
  8.  * This file may be distributed freely with any ArcWeb related software,
  9.  * provided it meets with the definition of 'free' in the 'Terms' file.
  10.  *
  11.  * This file: requester.h
  12.  *
  13.  *   A WIMP-library-independent interface definition.  All structures are
  14.  *   defined in terms of basic types.
  15.  *
  16.  */
  17. #ifndef _requester_h_included
  18. #define _requester_h_included
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22.  
  23. #define arcweb_MAXURL           (200)
  24.  
  25.  
  26. #define msg_Arcweb__base        (0x4A240)
  27. #define swi_Arcweb__base        (msg_Arcweb__base)
  28. #define err_Arcweb__base        (0x80D200)
  29.  
  30. typedef enum {
  31.  
  32.         Message_ArcwebFetchRequest    = (msg_Arcweb__base +  0),
  33.         Message_ArcwebFetchDone       = (msg_Arcweb__base +  1),
  34.         Message_ArcwebRenderRequest   = (msg_Arcweb__base +  2),
  35.         Message_ArcwebRenderDone      = (msg_Arcweb__base +  3),
  36.         Message_ArcwebPostRequest     = (msg_Arcweb__base +  4),
  37.         Message_ArcwebPostDone        = (msg_Arcweb__base +  5),
  38.         Message_ArcwebEMailRequest    = (msg_Arcweb__base +  6),
  39.         Message_ArcwebEMailDone       = (msg_Arcweb__base +  7),
  40.  
  41.         Message_ArcwebImageSize       = (msg_Arcweb__base + 16),
  42.         Message_ArcwebImageComplete   = (msg_Arcweb__base + 17),
  43.         Message_ArcwebXferControl     = (msg_Arcweb__base + 18),
  44.         Message_ArcwebXferControlAck  = (msg_Arcweb__base + 19),
  45.  
  46.         Message_ArcwebQuit            = (msg_Arcweb__base + 32),
  47.         Message_ArcwebExpire          = (msg_Arcweb__base + 33),
  48.         Message_ArcwebAbortRequest    = (msg_Arcweb__base + 34),
  49.         Message_ArcwebTransferStatus  = (msg_Arcweb__base + 35),
  50.         Message_ArcwebConfigure       = (msg_Arcweb__base + 36),
  51.         Message_ArcwebExternalLaunch  = (msg_Arcweb__base + 37),
  52.         Message_ArcwebLaunchDone      = (msg_Arcweb__base + 38),
  53.         Message_ArcwebWebBrowser      = (msg_Arcweb__base + 39)
  54.  
  55. } arcweb_msgid;
  56.  
  57.  
  58. /* Use these constants in the flag words in the messages below */
  59.  
  60. #define arcweb_FLAGS_error              0x80000000
  61. #define arcweb_FLAGS_typeknown          0x40000000
  62. #define arcweb_FLAGS_inhibit_render     0x20000000
  63. #define arcweb_FLAGS_want_symlink       0x10000000
  64. #define arcweb_FLAGS_url_changed        0x08000000
  65. #define arcweb_FLAGS_close_previous     0x04000000
  66. #define arcweb_FLAGS_image_fetch        0x02000000
  67. #define arcweb_FLAGS_error_handled      0x01000000
  68. #define arcweb_FLAGS_inhibit_display    0x00800000
  69. #define arcweb_FLAGS_extended_url       0x00400000
  70. #define arcweb_FLAGS_email_complete     0x00200000
  71. #define arcweb_FLAGS_reload        0x00100000
  72. #define arcweb_FLAGS_load_to_disc    0x00080000
  73. #define arcweb_FLAGS_reserved_mask      0x00060000
  74. #define arcweb_FLAGS_extended_type      0x00010000
  75. #define arcweb_FLAGS_typemask           0x0001ffff
  76. #define arcweb_FLAGS_xfer_control       0x00000020
  77. #define arcweb_FLAGS_images_disabled    0x00000010
  78. #define arcweb_FLAGS_post_was_put       0x00000008
  79. #define arcweb_FLAGS_fast_images    0x00000004
  80. #define arcweb_FLAGS_local_launch    0x00000002
  81. #define arcweb_FLAGS_document_fetch    0x00000000
  82.  
  83. #define arcweb_TYPES_plaintext          0x00010000
  84. #define arcweb_TYPES_html               0x00010001
  85. #define arcweb_TYPES_image              0x00010002
  86. #define arcweb_TYPES_audio              0x00010003
  87. #define arcweb_TYPES_video              0x00010004
  88. #define arcweb_TYPES_binary             0x00010005
  89. #define arcweb_TYPES_image_jpeg         0x00010100
  90. #define arcweb_TYPES_image_gif          0x00010101
  91. #define arcweb_TYPES_image_jfif         0x00010102
  92. #define arcweb_TYPES_image_mswinbitmap  0x00010103
  93. #define arcweb_TYPES_image_xbm          0x00010104
  94. #define arcweb_TYPES_image_clear        0x00010105
  95. #define arcweb_TYPES_image_tiff         0x00010106
  96. #define arcweb_TYPES_image_png          0x00010107
  97. #define arcweb_TYPES_video_mpeg         0x00010200
  98. #define arcweb_TYPES_video_armovie      0x00010201
  99. #define arcweb_TYPES_audio_misc         0x00010300
  100. #define arcweb_TYPES_audio_simple       0x00010301
  101. #define arcweb_TYPES_audio_aiff         0x00010302
  102. #define arcweb_TYPES_unknown            0x0001ffff
  103.  
  104. #define arcweb_XFER_xmit_running        0x00000001
  105. #define arcweb_XFER_recv_running        0x00000002
  106. #define arcweb_XFER_xmit_complete       0x00000004
  107. #define arcweb_XFER_recv_complete       0x00000008
  108. #define arcweb_XFER_misc_running        0x00000010
  109. #define arcweb_XFER_reserved            0xffffffe0
  110.  
  111.  
  112. /* Flag bit meanings:
  113.  *
  114.  *  Responses only:
  115.  *      bits 0 to 15    : RISC OS/ArcWeb filetype indicator
  116.  *      bit 16          : if set, type is arcweb_TYPES_*, else RISC OS type
  117.  *
  118.  *  Requests only:
  119.  *      bit  1          : the previous page was a local: URL
  120.  *      bit  2          : if set, 'fast images' are being used - not implemented yet
  121.  *      bit  3          : if set, the POST request should be sent as a PUT instead
  122.  *      bit  4          : if set, user has disabled image fetching
  123.  *      bit  5          : if set, control transfer protocol is available
  124.  *
  125.  *  Both:
  126.  *
  127.  *      bits 17 and 18  : reserved (must be preserved in replies)
  128.  *      bit 19          : if set, user has requested a 'load to disc'
  129.  *      bit 20          : if set, this is a reload, so flush any cache
  130.  *      bit 21          : if set, the e-mail message is complete
  131.  *      bit 22          : if set, this is an extended URL
  132.  *      bit 23          : if set, ArcWeb will not display the results of the render
  133.  *      bit 24          : if set, ArcWeb wont raise any error to user
  134.  *      bit 25          : if set, this is an inline image fetch, not a page fetch
  135.  *      bit 26          : if set, the previous ArcWeb window should be closed
  136.  *      bit 27          : if set, URL has been changed (+ is in URL file)
  137.  *      bit 28          : if set, request use of symbolic link in host filesystem
  138.  *      bit 29          : if set, (in FetchDone), ArcWeb will not render it
  139.  *      bit 30          : if set, bits 0-16 are valid, else they are invalid
  140.  *      bit 31          : if set, the buffer contains an error message
  141.  *
  142.  */
  143.  
  144. typedef struct {
  145.         struct arcweb_msghdr {    /* message block header. */
  146.           int size;               /* 20<=size<=256, multiple of 4 */
  147.           int task;               /* task handle of sender (filled in by wimp) */
  148.           int my_ref;             /* unique ref number (filled in by wimp) */
  149.           int your_ref;           /* (0==>none) if non-zero, acknowledge */
  150.           arcweb_msgid action;    /* message action code */
  151.         } hdr;
  152.         void           *handle;         /* MUST be preserved */
  153.         int             flags;          /* See above */
  154.         union {
  155.                 int  _arcweb_words[57]; /* Ensure the right size */
  156.                 char _arcweb_data[228]; /* a char version        */
  157.  
  158.                 struct {
  159.                         int     localfile;  /* *RISC OS* file handle */
  160.                         union {
  161.                                 int     url_file;            /* if bit 22 set */
  162.                                 char    URL[arcweb_MAXURL];  /* if bit 22 clr */
  163.                         } url;
  164.                 } fetch_request;
  165.  
  166.                 union {
  167.                         struct {
  168.                                 int     use_given_expiry;
  169.                                 int     use_default_expiry;
  170.                                 char    date[8]; /* to stop Cv5 warnings */
  171.                         } expiry;
  172.                         char    error[228];
  173.                 } fetch_done;
  174.  
  175.                struct {
  176.                         int     localfile;
  177.                         int     formfile;
  178.                         union {
  179.                                 int     url_file;            /* if bit 22 set */
  180.                                 char    URL[arcweb_MAXURL];  /* if bit 22 clr */
  181.                         } url;
  182.                 } post_request;
  183.  
  184.                 struct {
  185.                         int     localsrc;
  186.                         int     localtmp;
  187.                         int     localdiag;
  188.                         int     locallink;
  189.                         int     size_in_msg;
  190.                         char    fileheader[228-5*sizeof(int)];
  191.                 } render_request;
  192.  
  193.                 union {
  194.                         struct {
  195.                                 int x_pix;
  196.                                 int y_pix;
  197.                         } size;
  198.                         char    error[228];
  199.                 } render_done;
  200.  
  201.                 struct {
  202.                         int     formfile;
  203.                 } email_request;
  204.  
  205.                 struct {
  206.                         char    error[228]; /* Do I want this? */
  207.                 } email_done;
  208.  
  209.                 struct {
  210.                         union {
  211.                                 int  url_file;           /* if bit 22 set   */
  212.                                 char URL[arcweb_MAXURL]; /* if bit 22 clear */
  213.                         } url;
  214.                 } expire;
  215.  
  216.                  union {
  217.                         struct {
  218.                                 int     use_given_expiry;
  219.                                 int     use_default_expiry;
  220.                                 char    date[5];
  221.                         } expiry;
  222.                         char    error[228];
  223.                 } post_done;
  224.  
  225.                 struct {
  226.                         int     flags;
  227.                         int     transmit_total;
  228.                         int     transmit_sofar;
  229.                         int     receive_total;
  230.                         int     receive_sofar;
  231.                         char    message[208];
  232.                 } status_report;
  233.  
  234.                 struct {
  235.                         char    reason[228];
  236.                 } abort_request;
  237.  
  238.                 struct {
  239.                         int     renderer_handle;
  240.                         int     x_os_units;
  241.                         int     y_os_units;
  242.                 } image_size;
  243.  
  244.                 struct {
  245.                         int     renderer_handle;
  246.                 } image_complete;
  247.  
  248.                 struct {
  249.                     char    application[228];
  250.                 } configure;
  251.  
  252.                 struct {
  253.                         union {
  254.                                 int  url_file;           /* if bit 22 set   */
  255.                                 char URL[arcweb_MAXURL]; /* if bit 22 clear */
  256.                         } url;
  257.                 } launch_request;
  258.  
  259.                 struct {
  260.                         char    error[228];
  261.                 } launch_done;
  262.  
  263.                 struct {
  264.                         int     localfile;  /* *RISC OS* file handle */
  265.                         union {
  266.                                 int     url_file;            /* if bit 22 set */
  267.                                 char    URL[arcweb_MAXURL];  /* if bit 22 clr */
  268.                         } url;
  269.                 } xfer_request;
  270.  
  271.                 struct {
  272.                         char    error[228];
  273.                 } xfer_request_ack;
  274.                 
  275.                 struct {
  276.                         char     browser[228];
  277.                 } web_browser;
  278.  
  279.         } data;
  280. } arcweb_msg; /* use as a wimp_msgstr */
  281.  
  282. #ifdef __cplusplus
  283. }
  284. #endif
  285. #endif
  286.