home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Toolbox / h / dcs < prev    next >
Encoding:
Text File  |  1995-09-05  |  6.2 KB  |  222 lines

  1. #ifndef dcs_H
  2. #define dcs_H
  3.  
  4. /* C header file for DCS
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 15:14:32 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef toolbox_H
  14. #include "toolbox.h"
  15. #endif
  16.  
  17. #ifndef window_H
  18. #include "window.h"
  19. #endif
  20.  
  21. /**********************************
  22.  * SWI names and SWI reason codes *
  23.  **********************************/
  24. #undef  DCS_ClassSWI
  25. #define DCS_ClassSWI                            0x82A80
  26. #undef  XDCS_ClassSWI
  27. #define XDCS_ClassSWI                           0xA2A80
  28. #undef  DCS_PostFilter
  29. #define DCS_PostFilter                          0x82A81
  30. #undef  XDCS_PostFilter
  31. #define XDCS_PostFilter                         0xA2A81
  32. #undef  DCS_PreFilter
  33. #define DCS_PreFilter                           0x82A82
  34. #undef  XDCS_PreFilter
  35. #define XDCS_PreFilter                          0xA2A82
  36. #undef  DCS_GetWindowId
  37. #define DCS_GetWindowId                         0x0
  38. #undef  DCS_SetMessage
  39. #define DCS_SetMessage                          0x1
  40. #undef  DCS_GetMessage
  41. #define DCS_GetMessage                          0x2
  42. #undef  DCS_SetTitle
  43. #define DCS_SetTitle                            0x3
  44. #undef  DCS_GetTitle
  45. #define DCS_GetTitle                            0x4
  46.  
  47. /************************************
  48.  * Structure and union declarations *
  49.  ************************************/
  50. typedef struct dcs_object                       dcs_object;
  51. typedef struct dcs_action_about_to_be_shown     dcs_action_about_to_be_shown;
  52.  
  53. /********************
  54.  * Type definitions *
  55.  ********************/
  56. typedef bits dcs_flags;
  57.  
  58. struct dcs_object
  59.    {  dcs_flags flags;
  60.       toolbox_msg_reference title;
  61.       int title_limit;
  62.       toolbox_msg_reference message;
  63.       int message_limit;
  64.       toolbox_string_reference alternative_window_name;
  65.    };
  66.  
  67. typedef toolbox_full dcs_full;
  68.  
  69. struct dcs_action_about_to_be_shown
  70.    {  toolbox_position_tag tag;
  71.       union
  72.       {  os_coord top_left;
  73.          dcs_full full;
  74.       }
  75.       position;
  76.    };
  77.  
  78. /************************
  79.  * Constant definitions *
  80.  ************************/
  81. #define class_DCS                               ((toolbox_class) 0x82A80u)
  82. #define dcs_GENERATE_ABOUT_TO_BE_SHOWN          ((dcs_flags) 0x1u)
  83. #define dcs_GENERATE_DIALOGUE_COMPLETED         ((dcs_flags) 0x2u)
  84. #define action_DCS_ABOUT_TO_BE_SHOWN            0x82A80u
  85. #define action_DCS_DISCARD                      0x82A81u
  86. #define action_DCS_SAVE                         0x82A82u
  87. #define action_DCS_DIALOGUE_COMPLETED           0x82A83u
  88. #define action_DCS_CANCEL                       0x82A84u
  89. #define error_DCS_ALLOC_FAILED                  0x80B101u
  90. #define error_DCS_TASKS_ACTIVE                  0x80B102u
  91. #define dcs_FILE_ICON                           ((toolbox_c) 0x82A800u)
  92. #define dcs_DISCARD                             ((toolbox_c) 0x82A801u)
  93. #define dcs_CANCEL                              ((toolbox_c) 0x82A802u)
  94. #define dcs_SAVE                                ((toolbox_c) 0x82A803u)
  95.  
  96. /*************************
  97.  * Function declarations *
  98.  *************************/
  99.  
  100. #ifdef __cplusplus
  101.    extern "C" {
  102. #endif
  103.  
  104. /* ------------------------------------------------------------------------
  105.  * Function:      dcs_get_window_id()
  106.  *
  107.  * Description:   Calls reason code 0 of SWI 0x44EC6
  108.  *
  109.  * Input:         flags - value of R0 on entry
  110.  *                dcs - value of R1 on entry
  111.  *
  112.  * Output:        window - value of R0 on exit (X version only)
  113.  *
  114.  * Returns:       R0 (non-X version only)
  115.  *
  116.  * Other notes:   Before entry, R2 = 0x0.
  117.  */
  118.  
  119. extern os_error *xdcs_get_window_id (bits flags,
  120.       toolbox_o dcs,
  121.       toolbox_o *window);
  122. extern toolbox_o dcs_get_window_id (bits flags,
  123.       toolbox_o dcs);
  124.  
  125. /* ------------------------------------------------------------------------
  126.  * Function:      dcs_set_message()
  127.  *
  128.  * Description:   Calls reason code 1 of SWI 0x44EC6
  129.  *
  130.  * Input:         flags - value of R0 on entry
  131.  *                dcs - value of R1 on entry
  132.  *                message - value of R3 on entry
  133.  *
  134.  * Other notes:   Before entry, R2 = 0x1.
  135.  */
  136.  
  137. extern os_error *xdcs_set_message (bits flags,
  138.       toolbox_o dcs,
  139.       char const *message);
  140. extern void dcs_set_message (bits flags,
  141.       toolbox_o dcs,
  142.       char const *message);
  143.  
  144. /* ------------------------------------------------------------------------
  145.  * Function:      dcs_get_message()
  146.  *
  147.  * Description:   Calls reason code 2 of SWI 0x44EC6
  148.  *
  149.  * Input:         flags - value of R0 on entry
  150.  *                dcs - value of R1 on entry
  151.  *                buffer - value of R3 on entry
  152.  *                size - value of R4 on entry
  153.  *
  154.  * Output:        used - value of R4 on exit (X version only)
  155.  *
  156.  * Returns:       R4 (non-X version only)
  157.  *
  158.  * Other notes:   Before entry, R2 = 0x2.
  159.  */
  160.  
  161. extern os_error *xdcs_get_message (bits flags,
  162.       toolbox_o dcs,
  163.       char *buffer,
  164.       int size,
  165.       int *used);
  166. extern int dcs_get_message (bits flags,
  167.       toolbox_o dcs,
  168.       char *buffer,
  169.       int size);
  170.  
  171. /* ------------------------------------------------------------------------
  172.  * Function:      dcs_set_title()
  173.  *
  174.  * Description:   Calls reason code 3 of SWI 0x44EC6
  175.  *
  176.  * Input:         flags - value of R0 on entry
  177.  *                dcs - value of R1 on entry
  178.  *                title - value of R3 on entry
  179.  *
  180.  * Other notes:   Before entry, R2 = 0x3.
  181.  */
  182.  
  183. extern os_error *xdcs_set_title (bits flags,
  184.       toolbox_o dcs,
  185.       char const *title);
  186. extern void dcs_set_title (bits flags,
  187.       toolbox_o dcs,
  188.       char const *title);
  189.  
  190. /* ------------------------------------------------------------------------
  191.  * Function:      dcs_get_title()
  192.  *
  193.  * Description:   Calls reason code 4 of SWI 0x44EC6
  194.  *
  195.  * Input:         flags - value of R0 on entry
  196.  *                dcs - value of R1 on entry
  197.  *                buffer - value of R3 on entry
  198.  *                size - value of R4 on entry
  199.  *
  200.  * Output:        used - value of R4 on exit (X version only)
  201.  *
  202.  * Returns:       R4 (non-X version only)
  203.  *
  204.  * Other notes:   Before entry, R2 = 0x4.
  205.  */
  206.  
  207. extern os_error *xdcs_get_title (bits flags,
  208.       toolbox_o dcs,
  209.       char *buffer,
  210.       int size,
  211.       int *used);
  212. extern int dcs_get_title (bits flags,
  213.       toolbox_o dcs,
  214.       char *buffer,
  215.       int size);
  216.  
  217. #ifdef __cplusplus
  218.    }
  219. #endif
  220.  
  221. #endif
  222.