home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / filer < prev    next >
Encoding:
Text File  |  1994-09-14  |  7.5 KB  |  251 lines

  1. #ifndef filer_H
  2. #define filer_H
  3.  
  4. /* C header file for Filer
  5.  * written by DefMod (Sep  7 1994) on Wed Sep 14 13:19:09 1994
  6.  * Copyright © Acorn Computers Ltd, 1994
  7.  */
  8.  
  9. /*************************************************************************
  10.  * This source file was written by Acorn Computers Limited. It is part   *
  11.  * of the OSLib library for writing applications for RISC OS. It may be  *
  12.  * used freely in the creation of programs for RISC OS.                  *
  13.  *************************************************************************/
  14.  
  15. #ifndef types_H
  16.    #include "types.h"
  17. #endif
  18.  
  19. #ifndef os_H
  20.    #include "os.h"
  21. #endif
  22.  
  23. #ifndef wimp_H
  24.    #include "wimp.h"
  25. #endif
  26.  
  27. /**********************************
  28.  * SWI names and SWI reason codes *
  29.  **********************************/
  30. #undef  Service_StartFiler
  31. #define Service_StartFiler                      0x4B
  32. #undef  Service_StartedFiler
  33. #define Service_StartedFiler                    0x4C
  34. #undef  Service_FilerDying
  35. #define Service_FilerDying                      0x4F
  36. #undef  Service_EnumerateFormats
  37. #define Service_EnumerateFormats                0x6A
  38. #undef  Service_DiscDismounted
  39. #define Service_DiscDismounted                  0x7D
  40.  
  41. /************************************
  42.  * Structure and union declarations *
  43.  ************************************/
  44. typedef struct filer_message_dir                filer_message_dir;
  45. typedef struct filer_message_open_dir_at        filer_message_open_dir_at;
  46. typedef struct filer_message_selection_dir      filer_message_selection_dir;
  47. typedef struct filer_message_add_selection      filer_message_add_selection;
  48. typedef struct filer_message_action             filer_message_action;
  49. typedef struct filer_message_control_action     filer_message_control_action;
  50. typedef struct filer_message_selection          filer_message_selection;
  51. typedef struct filer_format                     filer_format;
  52.  
  53. /********************
  54.  * Type definitions *
  55.  ********************/
  56. struct filer_message_dir
  57.    {  int fs_no;
  58.       bits flags;
  59.       char dir_name [228];
  60.    };
  61.  
  62. struct filer_message_open_dir_at
  63.    {  int fs_no;
  64.       bits flags;
  65.       os_coord at;
  66.       int width;
  67.       int height;
  68.       byte display;
  69.       char dir_name [211];
  70.    };
  71.  
  72. struct filer_message_selection_dir
  73.    {  char dir_name [236];
  74.    };
  75.  
  76. struct filer_message_add_selection
  77.    {  char leaf_list [236];
  78.    };
  79.  
  80. struct filer_message_action
  81.    {  int operation;
  82.       bits options;
  83.       union
  84.       {  char destination_dir_name [228];
  85.          struct
  86.          {  short access;
  87.             short mask;
  88.          }
  89.          access;
  90.          bits file_type;
  91.          char find_leaf [228];
  92.       }
  93.       data;
  94.    };
  95.  
  96. struct filer_message_control_action
  97.    {  int control;
  98.    };
  99.  
  100. struct filer_message_selection
  101.    {  os_box bbox;
  102.       int width;
  103.       int height;
  104.       bits display;
  105.       int col0;
  106.       int row0;
  107.       int col1;
  108.       int row1;
  109.    };
  110.  
  111. struct filer_format
  112.    {  filer_format *next;
  113.       char *menu_text;
  114.       char *help_text;
  115.       int disc_format_swi;
  116.       int disc_format_handle;
  117.       int layout_structure_swi;
  118.       int layout_structure_handle;
  119.       bits flags;
  120.    };
  121.  
  122. /************************
  123.  * Constant definitions *
  124.  ************************/
  125. #define error_FILER_NO_RECURSION                0xB80u
  126. #define error_FILER_NO_TEMPLATE                 0xB81u
  127. #define error_FILER_FAILED_SAVE                 0xB82u
  128. #define error_FILER_BAD_PATH                    0xB83u
  129. #define message_FILER_OPEN_DIR                  0x400u
  130. #define message_FILER_CLOSE_DIR                 0x401u
  131. #define message_FILER_OPEN_DIR_AT               0x402u
  132. #define message_FILER_SELECTION_DIR             0x403u
  133. #define message_FILER_ADD_SELECTION             0x404u
  134. #define message_FILER_ACTION                    0x405u
  135. #define message_FILER_CONTROL_ACTION            0x406u
  136. #define message_FILER_SELECTION                 0x407u
  137. #define filer_FORMAT_NATIVE                     0x1u
  138. #define filer_DIR_NONCANONICAL                  0x1u
  139. #define filer_DISPLAY_LARGE_ICONS               0x0u
  140. #define filer_DISPLAY_SMALL_ICONS               0x1u
  141. #define filer_DISPLAY_FULL_INFO                 0x2u
  142. #define filer_DISPLAY                           0x3u
  143. #define filer_DISPLAY_SHIFT                     0
  144. #define filer_SORT_BY_NAME                      0x0u
  145. #define filer_SORT_BY_SIZE                      0x1u
  146. #define filer_SORT_BY_TYPE                      0x2u
  147. #define filer_SORT_BY_DATE                      0x3u
  148. #define filer_SORT                              0xCu
  149. #define filer_SORT_SHIFT                        2
  150. #define filer_GIVEN_DISPLAY                     0x10u
  151. #define filer_GIVEN_SORT                        0x20u
  152. #define filer_CONTROL_ACKNOWLEDGE               0
  153. #define filer_CONTROL_VERBOSE_ON                1
  154. #define filer_CONTROL_VERBOSE_OFF               2
  155.  
  156. /*************************
  157.  * Function declarations *
  158.  *************************/
  159.  
  160. #ifdef __cplusplus
  161.    extern "C" {
  162. #endif
  163.  
  164. /*************************************************************
  165.  * NOTE: The following functions provide direct access to    *
  166.  *       the SWI's noted in the function description.        *
  167.  *       Please read the relevant PRM section for more       *
  168.  *       information on their input/output parameters.       *
  169.  *************************************************************/
  170.  
  171. /* ------------------------------------------------------------------------
  172.  * Function:      service_start_filer()
  173.  *
  174.  * Description:   Request to filing-system-specific desktop filers to start
  175.  *                up
  176.  *
  177.  * Input:         task - value of R0 on entry
  178.  *
  179.  * Output:        command - value of R0 on exit
  180.  *                unclaimed - value of R1 on exit (X version only)
  181.  *
  182.  * Returns:       R1 (non-X version only)
  183.  *
  184.  * Other notes:   Calls SWI 0x30 with R1 = 0x4B.
  185.  */
  186.  
  187. extern os_error *xservice_start_filer (wimp_t task,
  188.       char **command,
  189.       bool *unclaimed);
  190. extern bool service_start_filer (wimp_t task,
  191.       char **command);
  192.  
  193. /* ------------------------------------------------------------------------
  194.  * Function:      service_started_filer()
  195.  *
  196.  * Description:   Request to filing-system-specific desktop filers to set
  197.  *                task_handle variable to 0
  198.  *
  199.  * Other notes:   Calls SWI 0x30 with R1 = 0x4C.
  200.  */
  201.  
  202. extern os_error *xservice_started_filer (void);
  203. extern void service_started_filer (void);
  204.  
  205. /* ------------------------------------------------------------------------
  206.  * Function:      service_filer_dying()
  207.  *
  208.  * Description:   Notification that the Filer module is about to close down
  209.  *
  210.  * Other notes:   Calls SWI 0x30 with R1 = 0x4F.
  211.  */
  212.  
  213. extern os_error *xservice_filer_dying (void);
  214. extern void service_filer_dying (void);
  215.  
  216. /* ------------------------------------------------------------------------
  217.  * Function:      service_enumerate_formats()
  218.  *
  219.  * Description:   Enumerate available disc formats
  220.  *
  221.  * Input:         format_list - value of R2 on entry
  222.  *
  223.  * Output:        format_list_out - value of R2 on exit
  224.  *
  225.  * Other notes:   Calls SWI 0x30 with R1 = 0x6A.
  226.  */
  227.  
  228. extern os_error *xservice_enumerate_formats (filer_format *format_list,
  229.       filer_format **format_list_out);
  230. extern void service_enumerate_formats (filer_format *format_list,
  231.       filer_format **format_list_out);
  232.  
  233. /* ------------------------------------------------------------------------
  234.  * Function:      service_disc_dismounted()
  235.  *
  236.  * Description:   Disc dismounted
  237.  *
  238.  * Input:         disc_name - value of R2 on entry
  239.  *
  240.  * Other notes:   Calls SWI 0x30 with R1 = 0x7D.
  241.  */
  242.  
  243. extern os_error *xservice_disc_dismounted (char *disc_name);
  244. extern void service_disc_dismounted (char *disc_name);
  245.  
  246. #ifdef __cplusplus
  247.    }
  248. #endif
  249.  
  250. #endif
  251.