home *** CD-ROM | disk | FTP | other *** search
- Draw units
- The units used by the DrawLib routines can
- be specified in several different units.
- Choosing units can be achieved with the
- following calls :
-
- PROCshell_DrawSetUnitsMM millimeters
- PROCshell_DrawSetUnitsCM centimeters
- PROCshell_DrawSetUnitsIN inches
- PROCshell_DrawSetUnitsOS OS units
- PROCshell_DrawSetUnitsPT points
-
- Drawfiles are created in millimeters by
- default.
-
- --------------------------------------------------------
-
- PROCshell_DrawCreateFile
- Params =>
- int address of drawfile buffer
- (contents ignored on entry)
-
- <=
- address of drawfile buffer is
- updated
-
- The drawfile is created in a RAM buffer,
- the address of which is returned by the
- routine. As objects are added to the file
- the address of the buffer may change.
-
- At any time the buffer contains a valid
- drawfile that can be displayed with
- PROCshell_DrawRenderFile.
-
- Multiple drawfiles can be created at the
- same time, adding objects to a particular
- drawfile is achieved by specifying the
- buffer address.
-
- --------------------------------------------------------
-
- PROCshell_DrawRenderFile()
- Params =>
- int address of drawfile buffer
- int x coordinate to render drawfile
- (os units)
- int y coordinate to render drawfile
- (os units)
- real x scale factor
- real y scale factor
- int address of wimp redraw block
-
- This routine renders (plots) a drawfile which must
- be loaded into a buffer using PROCshell_DrawLoadFile,
- or created by the user application with
- PROCshell_DrawCreateFile.
-
- The drawfile is always plotted relative to the current
- graphics origin and may be scaled independantly in the
- x and y directions.
-
- All draw objects except text areas are supported, the
- actual rendering is performed by the WimpEXT module which
- must be loaded by the application's !Run file.
-
- Wimp redraw block
- 0 Window handle
- 4 Visible area minx (incl)
- 8 miny (incl)
- 12 maxx (excl)
- 16 maxy (excl)
- 20 Scrollx
- 24 Scrolly
- 28 Redraw rect minx (incl)
- 32 miny (incl)
- 36 maxx (excl)
- 40 maxy (excl)
-
- --------------------------------------------------------
-
- FNshell_DrawLoadFile()
- Params =>
- str file name
-
- <=
- int address of drawfile buffer
-
- --------------------------------------------------------
-
- PROCshell_DrawSaveFile()
- Params =>
- int address of drawfile buffer
- str file name
-
- This routine saves the drawfile and sets
- the filetype to &AFF (draw).
-
- --------------------------------------------------------
-
- PROCshell_DrawGetFileSize()
- Params =>
- int address of drawfile buffer
-
- <=
- int file size in bytes (excluding EvntShell
- pre-header)
-
- --------------------------------------------------------
-
- PROCshell_DrawGetBoundingBox()
- Params =>
- int address of drawfile buffer
- int x position (os units)
- int y position (os units)
- int width (os units)
- int height (os units)
-
- <=
- The x,y,height and width values are
- returned
-
- --------------------------------------------------------
-
- PROCshell_DrawInitFont()
- Params =>
- int address of drawfile buffer
- str name of font to initialise
- i.e. 'Trinity.Medium.Italic'
-
- <=
- address of drawfile buffer is
- updated
-
- Before text using outline fonts can be used
- in a drawfile it is vital that they are
- initialised using this call. Once you have
- called this routine for the first time you
- must continue initialising all the fonts that
- will be needed before creating other objects.
-
- It would appear (despite what the PRMs say!)
- that font initialisation must occur before any
- other objects are defined - that is you must
- initialise any fonts directly after creating
- the drawfile.
-
- Attempting to use fonts that are not available
- (has !Fonts been 'seen' by the Filer?) will
- cause an error. You should also bear in mind
- that using fonts that other people may not have
- can cause problems as various applications
- react in different ways to this situation.
-
- --------------------------------------------------------
-
- PROCshell_DrawSetFont()
- Params =>
- int address of drawfile buffer
- str name of font ("" for System Font)
-
- Before this call can be made the font specified must be
- initialised with a call to PROCshell_DrawInitFont,
- otherwise an error will be generated.
-
- All text objects created with PROCshell_DrawOutlineFont
- will be in the specified font until the next call to
- PROCshell_DrawSetFont.
-
- --------------------------------------------------------
-
- PROCshell_DrawBox()
- Params =>
- int address of drawfile buffer
- real x coordinate of bottom left
- of box
- real y coordinate of bottom left
- of box
- real width of box
- real height of box
-
- <=
- address of drawfile buffer is
- updated
-
- The coordinates and dimensions of the box
- are given in the currently selected units.
-
- --------------------------------------------------------
-
- PROCshell_DrawCircle()
- Params =>
- int address of drawfile buffer
- real x coordinate of centre of
- circle
- real y coordinate of centre of
- circle
- real radius of circle
-
- <=
- address of drawfile buffer is
- updated
-
- The coordinates and dimensions of the circle
- are given in the currently selected units.
-
- --------------------------------------------------------
-
- PROCshell_DrawEllipse()
- Params =>
- int address of drawfile buffer
- real x coordinate of centre of
- ellipse
- real y coordinate of centre of
- ellipse
- real major axis of ellipse
- real minor axis of ellipse
-
- <=
- address of drawfile buffer is
- updated
-
- The coordinates and dimensions of the ellipse
- are given in the currently selected units.
-
- --------------------------------------------------------
-
- PROCshell_DrawLine()
- Params =>
- int address of drawfile buffer
- real x coordinate of start of line
- real y coordinate of start of line
- real x coordinate of end of line
- real y coordinate of end of line
-
- <=
- address of drawfile buffer is
- updated
-
- The coordinates and dimensions of the line
- are given in the currently selected units.
-
- --------------------------------------------------------
-
- PROCshell_DrawOutlineFont()
- Params =>
- int address of drawfile buffer
- str text to insert
- real width of font (points)
- real height of font (points)
- real x coordinate of bottom left
- of text (current units)
- real y coordinate of bottom left
- of text (current units)
-
- <=
- address of drawfile buffer is
- updated
-
- Before a text object can inserted the font
- used must be initialised with a call to
- PROCshell_DrawInitFont, otherwise an error
- will be generated. The font to use must also
- be selected with PROCshell_DrawSetFont.
-
- --------------------------------------------------------
-
- PROCshell_DrawSetFillColour()
- Params =>
- int address of drawfile buffer
- int red value (0-255)
- int green value (0-255)
- int blue value (0-255)
-
- The colour value is supplied as a 24 bit
- value, RISC OS handles the display of the
- colour by dithering.
-
- --------------------------------------------------------
-
- PROCshell_DrawSetPathColour()
- Params =>
- int address of drawfile buffer
- int red value (0-255)
- int green value (0-255)
- int blue value (0-255)
-
- The colour value is supplied as a 24 bit
- value, RISC OS handles the display of the
- colour by dithering.
-
- --------------------------------------------------------
-
- PROCshell_DrawSetPathWidth()
- Params =>
- int address of drawfile buffer
- real path width (current units)
-
- --------------------------------------------------------
-
- PROCshell_DrawSetUnitsCM()
- Params =>
- int address of drawfile buffer
-
- Sets centimeters to be the current unit of
- measurement for the other library routines.
-
- --------------------------------------------------------
-
- PROCshell_DrawSetUnitsIN()
- Params =>
- int address of drawfile buffer
-
- Sets inches to be the current unit of
- measurement for the other library routines.
-
- --------------------------------------------------------
-
- PROCshell_DrawSetUnitsMM()
- Params =>
- int address of drawfile buffer
-
- Sets millimeters to be the current unit of
- measurement for the other library routines.
-
- --------------------------------------------------------
-
- PROCshell_DrawSetUnitsOS()
- Params =>
- int address of drawfile buffer
-
- Sets OS units to be the current unit of
- measurement for the other library routines.
-
- --------------------------------------------------------
-
- PROCshell_DrawSetUnitsPT()
- Params =>
- int address of drawfile buffer
-
- Sets points to be the current unit of
- measurement for the other library routines.
-
- --------------------------------------------------------
-