www.riscos.com Technical Support: |
|
The TaskWindow module is intended to allow programs which do not call SWI Wimp_Poll to be pre-emptively scheduled in the RISC OS desktop. In the following sections Child refers to the task created from a call to *TaskWindow and Parent refers to the task being used to display the Child's output.
Any screen output produced by the Child is intercepted and sent in Wimp messages to the Parent. These messages are documented on TaskWindow messages.
Changing screen mode from task windows can have unpredictable results.
R0 = reason code
Registers' values depend on value of R0 on entry (see below)
Interrupt status is undefined
Fast interrupts are enabled
Processor is in SVC mode
SWI is re-entrant
This call is used to obtain information from the TaskWindow module which is not readily available otherwise. The reason code in R0 on entry indicates which item of information is required. The registers on exit return the requested information.
Valid reason codes in R0 are:
On entry | On exit |
---|---|
0 | R0 is non-zero if the calling task is running in a task window; |
otherwise it is zero |
All other reason codes are reserved.
Wimp_ReadSysInfo with R0 = 3 on entry
None
Runs an application in a window
*ShellCLI_Task xxxxxxxx xxxxxxxx
xxxxxxxx - an 8 digit hex number giving the task handle of the parent task
xxxxxxxx - an 8 digit hex number giving a handle which may be used by the parent task to identify the task
*ShellCLI_Task runs an application in a window. This command is intended for use only within desktop applications.
Use of this command is deprecated. Its functionality is subsumed within *TaskWindow.
None
None
Quits the current task window
*ShellCLI_TaskQuit
None
*ShellCLI_TaskQuit quits the current task window. This command is intended for use only within desktop applications.
None
None
Starts a background task, which will obtain a task window if necessary
*TaskWindow [command] [[-wimpslot] nK] [[-name] taskname] [-ctrl] [-display] [-quit] [-task &xxxxxxxx] [-txt &xxxxxxxx]
command - command to execute as a background task
n - size of memory to allocate to task
taskname - name of task
-ctrl - allow control characters through, depending on setting of Ignore Ctrl menu option
-display - open the task window immediately, rather than waiting for a character to be printed
-quit - make that task quit after the command, even if the task window has been opened
-task &xxxxxxxx - an 8 digit hex number giving the Wimp task-id of the calling task
-txt &xxxxxxxx - an 8 digit hex number giving the handle for the Parent to identify the Child by
*TaskWindow starts a background task, which will obtain a task window if it needs to get input, or to output a character to the screen.
Any fields comprising more than one word must be enclosed in double quotes.
You must call *TaskWindow using *WimpTask or the SWI Wimp_StartTask, rather than using the command line or the SWI OS_CLI. You can only call Wimp_StartTask or *WimpTask from within an active task.
If -txt and -task are not used, then before starting the task, a TaskWindow_NewTask message is broadcast to find an application (eg Edit) that can provide a window in which to show the task's output. An application task which receives this broadcast, and which wishes to receive output from the task, should acknowledge the message and then SWI Wimp_StartTask the command given in the message block.
*TaskWindow "Cat Ram:$" -ctrl -display -quit
None
None