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

  1. #ifndef quit_H
  2. #define quit_H
  3.  
  4. /* C header file for Quit
  5.  * written by DefMod (Aug 30 1995) on Tue Sep  5 15:14:05 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. /**********************************
  14.  * SWI names and SWI reason codes *
  15.  **********************************/
  16. #undef  Quit_ClassSWI
  17. #define Quit_ClassSWI                           0x82A90
  18. #undef  XQuit_ClassSWI
  19. #define XQuit_ClassSWI                          0xA2A90
  20. #undef  Quit_PostFilter
  21. #define Quit_PostFilter                         0x82A91
  22. #undef  XQuit_PostFilter
  23. #define XQuit_PostFilter                        0xA2A91
  24. #undef  Quit_PreFilter
  25. #define Quit_PreFilter                          0x82A92
  26. #undef  XQuit_PreFilter
  27. #define XQuit_PreFilter                         0xA2A92
  28. #undef  Quit_GetWindowID
  29. #define Quit_GetWindowID                        0x0
  30. #undef  Quit_SetMessage
  31. #define Quit_SetMessage                         0x1
  32. #undef  Quit_GetMessage
  33. #define Quit_GetMessage                         0x2
  34. #undef  Quit_SetTitle
  35. #define Quit_SetTitle                           0x3
  36. #undef  Quit_GetTitle
  37. #define Quit_GetTitle                           0x4
  38.  
  39. /************************************
  40.  * Structure and union declarations *
  41.  ************************************/
  42. typedef struct quit_object                      quit_object;
  43. typedef struct quit_action_about_to_be_shown    quit_action_about_to_be_shown;
  44.  
  45. /********************
  46.  * Type definitions *
  47.  ********************/
  48. typedef bits quit_flags;
  49.  
  50. struct quit_object
  51.    {  quit_flags flags;
  52.       toolbox_msg_reference title;
  53.       int title_limit;
  54.       toolbox_msg_reference message;
  55.       int message_limit;
  56.       toolbox_string_reference alternative_window_name;
  57.    };
  58.  
  59. typedef os_coord quit_full;
  60.  
  61. struct quit_action_about_to_be_shown
  62.    {  toolbox_position_tag tag;
  63.       union
  64.       {  os_coord top_left;
  65.          quit_full full;
  66.       }
  67.       position;
  68.    };
  69.  
  70. /************************
  71.  * Constant definitions *
  72.  ************************/
  73. #define class_QUIT                              ((toolbox_class) 0x82A90u)
  74. #define quit_GENERATE_ABOUT_TO_BE_SHOWN         ((quit_flags) 0x1u)
  75. #define quit_GENERATE_DIALOGUE_COMPLETED        ((quit_flags) 0x2u)
  76. #define quit_FILE_TYPE_ICON                     ((toolbox_c) 0x82A900u)
  77. #define quit_QUIT                               ((toolbox_c) 0x82A901u)
  78. #define quit_CANCEL                             ((toolbox_c) 0x82A902u)
  79. #define action_QUIT_ABOUT_TO_BE_SHOWN           0x82A90u
  80. #define action_QUIT_QUIT                        0x82A91u
  81. #define action_QUIT_DIALOGUE_COMPLETED          0x82A92u
  82. #define action_QUIT_CANCEL                      0x82A93u
  83.  
  84. /*************************
  85.  * Function declarations *
  86.  *************************/
  87.  
  88. #ifdef __cplusplus
  89.    extern "C" {
  90. #endif
  91.  
  92. /* ------------------------------------------------------------------------
  93.  * Function:      quit_get_window_id()
  94.  *
  95.  * Description:   Calls reason code 0 of SWI 0x44EC6
  96.  *
  97.  * Input:         flags - value of R0 on entry
  98.  *                quit - value of R1 on entry
  99.  *
  100.  * Output:        window - value of R0 on exit (X version only)
  101.  *
  102.  * Returns:       R0 (non-X version only)
  103.  *
  104.  * Other notes:   Before entry, R2 = 0x0.
  105.  */
  106.  
  107. extern os_error *xquit_get_window_id (bits flags,
  108.       toolbox_o quit,
  109.       toolbox_o *window);
  110. extern toolbox_o quit_get_window_id (bits flags,
  111.       toolbox_o quit);
  112.  
  113. /* ------------------------------------------------------------------------
  114.  * Function:      quit_set_message()
  115.  *
  116.  * Description:   Calls reason code 1 of SWI 0x44EC6
  117.  *
  118.  * Input:         flags - value of R0 on entry
  119.  *                quit - value of R1 on entry
  120.  *                message - value of R3 on entry
  121.  *
  122.  * Other notes:   Before entry, R2 = 0x1.
  123.  */
  124.  
  125. extern os_error *xquit_set_message (bits flags,
  126.       toolbox_o quit,
  127.       char const *message);
  128. extern void quit_set_message (bits flags,
  129.       toolbox_o quit,
  130.       char const *message);
  131.  
  132. /* ------------------------------------------------------------------------
  133.  * Function:      quit_get_message()
  134.  *
  135.  * Description:   Calls reason code 2 of SWI 0x44EC6
  136.  *
  137.  * Input:         flags - value of R0 on entry
  138.  *                quit - value of R1 on entry
  139.  *                buffer - value of R3 on entry
  140.  *                size - value of R4 on entry
  141.  *
  142.  * Output:        used - value of R4 on exit (X version only)
  143.  *
  144.  * Returns:       R4 (non-X version only)
  145.  *
  146.  * Other notes:   Before entry, R2 = 0x2.
  147.  */
  148.  
  149. extern os_error *xquit_get_message (bits flags,
  150.       toolbox_o quit,
  151.       char *buffer,
  152.       int size,
  153.       int *used);
  154. extern int quit_get_message (bits flags,
  155.       toolbox_o quit,
  156.       char *buffer,
  157.       int size);
  158.  
  159. /* ------------------------------------------------------------------------
  160.  * Function:      quit_set_title()
  161.  *
  162.  * Description:   Calls reason code 3 of SWI 0x44EC6
  163.  *
  164.  * Input:         flags - value of R0 on entry
  165.  *                quit - value of R1 on entry
  166.  *                title - value of R3 on entry
  167.  *
  168.  * Other notes:   Before entry, R2 = 0x3.
  169.  */
  170.  
  171. extern os_error *xquit_set_title (bits flags,
  172.       toolbox_o quit,
  173.       char const *title);
  174. extern void quit_set_title (bits flags,
  175.       toolbox_o quit,
  176.       char const *title);
  177.  
  178. /* ------------------------------------------------------------------------
  179.  * Function:      quit_get_title()
  180.  *
  181.  * Description:   Calls reason code 4 of SWI 0x44EC6
  182.  *
  183.  * Input:         flags - value of R0 on entry
  184.  *                quit - value of R1 on entry
  185.  *                buffer - value of R3 on entry
  186.  *                size - value of R4 on entry
  187.  *
  188.  * Output:        used - value of R4 on exit (X version only)
  189.  *
  190.  * Returns:       R4 (non-X version only)
  191.  *
  192.  * Other notes:   Before entry, R2 = 0x4.
  193.  */
  194.  
  195. extern os_error *xquit_get_title (bits flags,
  196.       toolbox_o quit,
  197.       char *buffer,
  198.       int size,
  199.       int *used);
  200. extern int quit_get_title (bits flags,
  201.       toolbox_o quit,
  202.       char *buffer,
  203.       int size);
  204.  
  205. #ifdef __cplusplus
  206.    }
  207. #endif
  208.  
  209. #endif
  210.