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

  1. #ifndef taskwindow_H
  2. #define taskwindow_H
  3.  
  4. /* C header file for TaskWindow
  5.  * written by DefMod (Sep  7 1994) on Wed Sep  7 21:19:03 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. /**********************************
  24.  * SWI names and SWI reason codes *
  25.  **********************************/
  26. #undef  TaskWindow_TaskInfo
  27. #define TaskWindow_TaskInfo                     0x43380
  28. #undef  XTaskWindow_TaskInfo
  29. #define XTaskWindow_TaskInfo                    0x63380
  30. #undef  TaskWindowTaskInfo_WindowTask
  31. #define TaskWindowTaskInfo_WindowTask           0x0
  32. #undef  UpCall_Sleep
  33. #define UpCall_Sleep                            0x6
  34.  
  35. /************************************
  36.  * Structure and union declarations *
  37.  ************************************/
  38. typedef struct taskwindow_message_data          taskwindow_message_data;
  39. typedef struct taskwindow_message_ego           taskwindow_message_ego;
  40. typedef struct taskwindow_message_new_task      taskwindow_message_new_task;
  41.  
  42. /********************
  43.  * Type definitions *
  44.  ********************/
  45. struct taskwindow_message_data
  46.    {  int size;
  47.       char data [232];
  48.    };
  49.  
  50. struct taskwindow_message_ego
  51.    {  int txt;
  52.    };
  53.  
  54. struct taskwindow_message_new_task
  55.    {  char command [236];
  56.    };
  57.  
  58. /************************
  59.  * Constant definitions *
  60.  ************************/
  61. #define error_TASK_WINDOW_CANT_KILL             0xA80u
  62. #define error_TASK_WINDOW_BAD_SWI_ENTRY         0xA81u
  63. #define error_TASK_WINDOW_BAD_TASK_HANDLE       0xA82u
  64. #define error_TASK_WINDOW_DYING                 0xA83u
  65. #define error_TASK_WINDOW_FILE_SLEEP            0xA84u
  66. #define error_TASK_WINDOW_NO_EDITOR             0xA85u
  67. #define error_TASK_WINDOW_NO_REDIRECTION        0xA86u
  68. #define message_TASK_WINDOW_INPUT               0x808C0u
  69. #define message_TASK_WINDOW_OUTPUT              0x808C1u
  70. #define message_TASK_WINDOW_EGO                 0x808C2u
  71. #define message_TASK_WINDOW_MORIO               0x808C3u
  72. #define message_TASK_WINDOW_MORITE              0x808C4u
  73. #define message_TASK_WINDOW_NEW_TASK            0x808C5u
  74. #define message_TASK_WINDOW_SUSPEND             0x808C6u
  75. #define message_TASK_WINDOW_RESUME              0x808C7u
  76.  
  77. /*************************
  78.  * Function declarations *
  79.  *************************/
  80.  
  81. #ifdef __cplusplus
  82.    extern "C" {
  83. #endif
  84.  
  85. /*************************************************************
  86.  * NOTE: The following functions provide direct access to    *
  87.  *       the SWI's noted in the function description.        *
  88.  *       Please read the relevant PRM section for more       *
  89.  *       information on their input/output parameters.       *
  90.  *************************************************************/
  91.  
  92. /* ------------------------------------------------------------------------
  93.  * Function:      taskwindowtaskinfo_window_task()
  94.  *
  95.  * Description:   Obtains whether the calling task is running in a task
  96.  *                window
  97.  *
  98.  * Output:        window_task - value of R0 on exit (X version only)
  99.  *
  100.  * Returns:       R0 (non-X version only)
  101.  *
  102.  * Other notes:   Calls SWI 0x43380 with R0 = 0x0.
  103.  */
  104.  
  105. extern os_error *xtaskwindowtaskinfo_window_task (bool *window_task);
  106. extern bool taskwindowtaskinfo_window_task (void);
  107.  
  108. /* ------------------------------------------------------------------------
  109.  * Function:      upcall_sleep()
  110.  *
  111.  * Description:   Informs the TaskWindow module that a task wants to sleep
  112.  *                until some termination condition is met
  113.  *
  114.  * Input:         pollword - value of R1 on entry
  115.  *
  116.  * Output:        claimed - value of R0 on exit
  117.  *
  118.  * Other notes:   Calls SWI 0x33 with R0 = 0x6.
  119.  */
  120.  
  121. extern os_error *xupcall_sleep (int *pollword,
  122.       bool *claimed);
  123. extern void upcall_sleep (int *pollword,
  124.       bool *claimed);
  125.  
  126. #ifdef __cplusplus
  127.    }
  128. #endif
  129.  
  130. #endif
  131.