RISCOS.com

www.riscos.com Technical Support:
Programmer's Reference Manual

 

TaskWindow


Introduction and Overview

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.

Warning

Changing screen mode from task windows can have unpredictable results.

SWI calls


TaskWindow_TaskInfo
(SWI &43380)

Obtains information from the TaskWindow module

On entry

R0 = reason code

On exit

Registers' values depend on value of R0 on entry (see below)

Interrupts

Interrupt status is undefined
Fast interrupts are enabled

Processor mode

Processor is in SVC mode

Re-entrancy

SWI is re-entrant

Use

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.

Related SWIs

Wimp_ReadSysInfo with R0 = 3 on entry

Related vectors

None

* Commands


*ShellCLI_Task

Runs an application in a window

Syntax

*ShellCLI_Task xxxxxxxx xxxxxxxx

Parameters

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

Use

*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.

Related commands

*ShellCLI_TaskQuit, *TaskWindow

Related SWIs

None

Related vectors

None


*ShellCLI_TaskQuit

Quits the current task window

Syntax

*ShellCLI_TaskQuit

Parameters

None

Use

*ShellCLI_TaskQuit quits the current task window. This command is intended for use only within desktop applications.

Related commands

*ShellCLI_Task, *TaskWindow

Related SWIs

None

Related vectors

None


*TaskWindow

Starts a background task, which will obtain a task window if necessary

Syntax

*TaskWindow [command] [[-wimpslot] nK] [[-name] taskname] [-ctrl] [-display] [-quit] [-task &xxxxxxxx] [-txt &xxxxxxxx]

Parameters

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

Use

*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.

Example

*TaskWindow "Cat Ram:$" -ctrl -display -quit

Related commands

None

Related SWIs

None

Related vectors

None

This edition Copyright © 3QD Developments Ltd 2015
Last Edit: Tue,03 Nov 2015