www.riscos.com Technical Support: |
|
The DragASprite module provides SWI calls with which you can make the pointer drag a sprite around the screen. Since not all users will prefer this effect to dragging an outline - whether for aesthetics or performance - there is a bit in the CMOS RAM used to indicate their preference. (See the chapter entitled Non-volatile memory (CMOS RAM).) You should examine that bit before using this module; if it shows that the user would prefer to drag outlines, oblige them!
To drag a sprite:
R0 = flags
R1 = sprite area holding sprite:
0 | system sprite area |
1 | wimp sprite area |
Other | address of sprite area |
R2 = pointer to sprite name
R3 = pointer to 16-byte block containing box
R4 = pointer to optional 16-byte block containing bounding box (see flags)
R0 - R4 preserved
Interrupt status is undefined
Fast interrupts are enabled
Processor is in SVC mode
Not defined
This call starts dragging a sprite. The sprite you supply is copied, so there is no problem if you dispose of your copy of the sprite. If there is insufficient memory available to start the drag, the call reverts to a normal drag of a dotted outline.
The flags given in R0 have the following meanings:
Bits | Meaning | |
---|---|---|
0 - 1 | Horizontal location of sprite in box: | |
00 | left | |
01 | centre | |
10 | right | |
2 - 3 | Vertical location of sprite in box: | |
00 | bottom | |
01 | centre | |
10 | top | |
4 - 5 | Drag bounding box is: | |
00 | whole screen | |
01 | display area of window that the pointer's over | |
10 | specified in block pointed to by R4 | |
6 | Bounding box applies to: | |
0 | the box | |
1 | the pointer | |
7 | Control of drop-shadow: | |
0 | don't do a drop-shadow | |
1 | make a drop shadow when copying the sprite | |
8 - 31 | Reserved for future use - should be set to 0 |
The blocks pointed to by R3 and - optionally - R4 have the following format:
Offset | Use | ||
---|---|---|---|
0 | x-low | box | |
4 | y-low | bottom-left (x-low, y-low) is inclusive | |
8 | x-high | top-right (x-high, y-high) is exclusive | |
12 | y-high |
None
Terminates any current drag operation, and releases workspace
--
--
Interrupt status is undefined
Fast interrupts are enabled
Processor is in SVC mode
Not defined
This call terminates any current drag operation, and releases any workspace claimed by the DragASprite module to do a drag. You should make this call when your application receives the User_Drag_Box reason code from Wimp_Poll (see Wimp_Poll) during a drag.