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

  1. #ifndef wimpreadsysinfo_H
  2. #define wimpreadsysinfo_H
  3.  
  4. /* C header file for WimpReadSysInfo
  5.  * written by DefMod (Sep 16 1994) on Mon Sep 26 15:58:22 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. #ifndef font_H
  28.    #include "font.h"
  29. #endif
  30.  
  31. #ifndef osspriteop_H
  32.    #include "osspriteop.h"
  33. #endif
  34.  
  35. /**********************************
  36.  * SWI names and SWI reason codes *
  37.  **********************************/
  38. #undef  Wimp_ReadSysInfo
  39. #define Wimp_ReadSysInfo                        0x400F2
  40. #undef  XWimp_ReadSysInfo
  41. #define XWimp_ReadSysInfo                       0x600F2
  42. #undef  WimpReadSysInfo_TaskCount
  43. #define WimpReadSysInfo_TaskCount               0x0
  44. #undef  WimpReadSysInfo_WimpMode
  45. #define WimpReadSysInfo_WimpMode                0x1
  46. #undef  WimpReadSysInfo_SpriteSuffix
  47. #define WimpReadSysInfo_SpriteSuffix            0x2
  48. #undef  WimpReadSysInfo_DesktopState
  49. #define WimpReadSysInfo_DesktopState            0x3
  50. #undef  WimpReadSysInfo_WriteDir
  51. #define WimpReadSysInfo_WriteDir                0x4
  52. #undef  WimpReadSysInfo_Task
  53. #define WimpReadSysInfo_Task                    0x5
  54. #undef  WimpReadSysInfo_Version
  55. #define WimpReadSysInfo_Version                 0x7
  56. #undef  WimpReadSysInfo_Font
  57. #define WimpReadSysInfo_Font                    0x8
  58. #undef  WimpReadSysInfo_ToolSprites
  59. #define WimpReadSysInfo_ToolSprites             0x9
  60. #undef  WimpReadSysInfo_ApplicationLimit
  61. #define WimpReadSysInfo_ApplicationLimit        0xB
  62.  
  63. /************************
  64.  * Constant definitions *
  65.  ************************/
  66. #define wimpreadsysinfo_STATE_COMMANDS          0
  67. #define wimpreadsysinfo_STATE_DESKTOP           1
  68. #define wimpreadsysinfo_DIR_LEFT_TO_RIGHT       0
  69. #define wimpreadsysinfo_DIR_RIGHT_TO_LEFT       1
  70.  
  71. /*************************
  72.  * Function declarations *
  73.  *************************/
  74.  
  75. #ifdef __cplusplus
  76.    extern "C" {
  77. #endif
  78.  
  79. /*************************************************************
  80.  * NOTE: The following functions provide direct access to    *
  81.  *       the SWI's noted in the function description.        *
  82.  *       Please read the relevant PRM section for more       *
  83.  *       information on their input/output parameters.       *
  84.  *************************************************************/
  85.  
  86. /* ------------------------------------------------------------------------
  87.  * Function:      wimpreadsysinfo_task_count()
  88.  *
  89.  * Description:   Reads the number of active tasks
  90.  *
  91.  * Output:        task_count - value of R0 on exit (X version only)
  92.  *
  93.  * Returns:       R0 (non-X version only)
  94.  *
  95.  * Other notes:   Calls SWI 0x400F2 with R0 = 0x0.
  96.  */
  97.  
  98. extern os_error *xwimpreadsysinfo_task_count (int *task_count);
  99. extern int wimpreadsysinfo_task_count (void);
  100.  
  101. /* ------------------------------------------------------------------------
  102.  * Function:      wimpreadsysinfo_wimp_mode()
  103.  *
  104.  * Description:   Reads the current Wimp mode
  105.  *
  106.  * Output:        mode - value of R0 on exit (X version only)
  107.  *
  108.  * Returns:       R0 (non-X version only)
  109.  *
  110.  * Other notes:   Calls SWI 0x400F2 with R0 = 0x1.
  111.  */
  112.  
  113. extern os_error *xwimpreadsysinfo_wimp_mode (os_mode *mode);
  114. extern os_mode wimpreadsysinfo_wimp_mode (void);
  115.  
  116. /* ------------------------------------------------------------------------
  117.  * Function:      wimpreadsysinfo_sprite_suffix()
  118.  *
  119.  * Description:   Reads the *IconSprites file name suffix for the
  120.  *                configured mode
  121.  *
  122.  * Output:        suffix - value of R0 on exit (X version only)
  123.  *
  124.  * Returns:       R0 (non-X version only)
  125.  *
  126.  * Other notes:   Calls SWI 0x400F2 with R0 = 0x2.
  127.  */
  128.  
  129. extern os_error *xwimpreadsysinfo_sprite_suffix (char **suffix);
  130. extern char *wimpreadsysinfo_sprite_suffix (void);
  131.  
  132. /* ------------------------------------------------------------------------
  133.  * Function:      wimpreadsysinfo_desktop_state()
  134.  *
  135.  * Description:   Reads the Wimp state
  136.  *
  137.  * Output:        state - value of R0 on exit (X version only)
  138.  *
  139.  * Returns:       R0 (non-X version only)
  140.  *
  141.  * Other notes:   Calls SWI 0x400F2 with R0 = 0x3.
  142.  */
  143.  
  144. extern os_error *xwimpreadsysinfo_desktop_state (int *state);
  145. extern int wimpreadsysinfo_desktop_state (void);
  146.  
  147. /* ------------------------------------------------------------------------
  148.  * Function:      wimpreadsysinfo_write_dir()
  149.  *
  150.  * Description:   Reads the current writing direction
  151.  *
  152.  * Output:        write_dir - value of R0 on exit (X version only)
  153.  *
  154.  * Returns:       R0 (non-X version only)
  155.  *
  156.  * Other notes:   Calls SWI 0x400F2 with R0 = 0x4.
  157.  */
  158.  
  159. extern os_error *xwimpreadsysinfo_write_dir (int *write_dir);
  160. extern int wimpreadsysinfo_write_dir (void);
  161.  
  162. /* ------------------------------------------------------------------------
  163.  * Function:      wimpreadsysinfo_task()
  164.  *
  165.  * Description:   Reads the current task handle
  166.  *
  167.  * Output:        task - value of R0 on exit (X version only)
  168.  *                version - value of R1 on exit
  169.  *
  170.  * Returns:       R0 (non-X version only)
  171.  *
  172.  * Other notes:   Calls SWI 0x400F2 with R0 = 0x5.
  173.  */
  174.  
  175. extern os_error *xwimpreadsysinfo_task (wimp_t *task,
  176.       int *version);
  177. extern wimp_t wimpreadsysinfo_task (int *version);
  178.  
  179. /* ------------------------------------------------------------------------
  180.  * Function:      wimpreadsysinfo_version()
  181.  *
  182.  * Description:   Reads the Wimp version
  183.  *
  184.  * Output:        version - value of R0 on exit (X version only)
  185.  *
  186.  * Returns:       R0 (non-X version only)
  187.  *
  188.  * Other notes:   Calls SWI 0x400F2 with R0 = 0x7.
  189.  */
  190.  
  191. extern os_error *xwimpreadsysinfo_version (int *version);
  192. extern int wimpreadsysinfo_version (void);
  193.  
  194. /* ------------------------------------------------------------------------
  195.  * Function:      wimpreadsysinfo_font()
  196.  *
  197.  * Description:   Reads the desktop and symbol font handles
  198.  *
  199.  * Output:        font - value of R0 on exit (X version only)
  200.  *                symbol_font - value of R1 on exit
  201.  *
  202.  * Returns:       R0 (non-X version only)
  203.  *
  204.  * Other notes:   Calls SWI 0x400F2 with R0 = 0x8.
  205.  */
  206.  
  207. extern os_error *xwimpreadsysinfo_font (font_f *font,
  208.       font_f *symbol_font);
  209. extern font_f wimpreadsysinfo_font (font_f *symbol_font);
  210.  
  211. /* ------------------------------------------------------------------------
  212.  * Function:      wimpreadsysinfo_tool_sprites()
  213.  *
  214.  * Description:   Reads the toolsprite control block pointer
  215.  *
  216.  * Output:        toolsprites - value of R0 on exit (X version only)
  217.  *
  218.  * Returns:       R0 (non-X version only)
  219.  *
  220.  * Other notes:   Calls SWI 0x400F2 with R0 = 0x9.
  221.  */
  222.  
  223. extern os_error *xwimpreadsysinfo_tool_sprites (osspriteop_area **toolsprites);
  224. extern osspriteop_area *wimpreadsysinfo_tool_sprites (void);
  225.  
  226. /* ------------------------------------------------------------------------
  227.  * Function:      wimpreadsysinfo_application_limit()
  228.  *
  229.  * Description:   Reads the maximum size of application space
  230.  *
  231.  * Output:        size_limit - value of R0 on exit (X version only)
  232.  *
  233.  * Returns:       R0 (non-X version only)
  234.  *
  235.  * Other notes:   Calls SWI 0x400F2 with R0 = 0xB.
  236.  */
  237.  
  238. extern os_error *xwimpreadsysinfo_application_limit (int *size_limit);
  239. extern int wimpreadsysinfo_application_limit (void);
  240.  
  241. #ifdef __cplusplus
  242.    }
  243. #endif
  244.  
  245. #endif
  246.