RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

DragAnObject_Start

Programmer's Reference Manuals
» Part 15 – SWI Calls
» DragAnObject
» DragAnObject_Start

DragAnObject_Start

(SWI &49C40)
Entry  
R0 Flags
R1 renderer called to render the object (SWI number or pointer to C/assembler function)
R2 Pointer to block holding registers for SWI / function parameters
R3 Pointer to 16-byte block containing drag box
R4 Pointer to optional block containing bounding box
Exit  
R0 Preserved
R1 Preserved
R2 Preserved
R3 Preserved
R4 Preserved

Use

The purpose of this call is to start dragging an object.

Notes

As per the DragASprite_Start, this SWI starts the dragging process (calling DragASprite_Start and in turn Wimp_DragBox on the clients behalf), usually in response to a Drag (Mouse_Click) Event.

The renderer can be a C (or assembler) function or a SWI (determined by setting bits 16 and 17 in the flags word).

e.g.


SWI renderer:

void start_drag(…)
{
_kernel_swi_regs regs, render;

render.r1 = (int) &icon; /* oh dear, bug in the wimp */ render.r4 =0; render.r5 =0; regs.r0 = some flags; regs.r1 = Wimp_PlotIcon; regs.r2 = (int) &render; regs.r3 = (int) &bbox; kernel_swi(DragAnObjectStart,&regs,&regs);

}

Code renderer:

void _my_render(data)
{
/* do the render */

}

void start_drag(…)
{
_kernel_swi_regs regs;
int render4;

/* render0 … render3 will be passed to the function as parameters */ render0 = (int) data required by renderer; /* tell it we’re a function and a module */ regs.r0 = some flags + (1<<16) + (1<<17); regs.r1 = (int) _my_render; regs.r2 = (int) &render; regs.r3 = (int) &bbox; kernel_swi(DragAnObjectStart,&regs,&regs);

}

See also

  • DragAnObject Flags
  • DragAnObject_Stop
Created on December 13, 2009 14:54:14 by Alan Robertson (52)? (127.0.0.1)
Edit | Views: Print | Source | Linked from: DragAnObject SWI Calls, DragAnObject Flags, DragAnObject_Stop

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys