home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / program / d / eventshel1 / Docs / Draw < prev    next >
Encoding:
Text File  |  1994-01-16  |  9.0 KB  |  345 lines

  1. Draw units
  2. The units used by the DrawLib routines can
  3. be specified in several different units.
  4. Choosing units can be achieved with the
  5. following calls :
  6.  
  7. PROCshell_DrawSetUnitsMM millimeters
  8. PROCshell_DrawSetUnitsCM centimeters
  9. PROCshell_DrawSetUnitsIN inches
  10. PROCshell_DrawSetUnitsOS OS units
  11. PROCshell_DrawSetUnitsPT points
  12.  
  13. Drawfiles are created in millimeters by
  14. default.
  15.  
  16. --------------------------------------------------------
  17.  
  18. PROCshell_DrawCreateFile
  19. Params =>
  20.          int address of drawfile buffer
  21.              (contents ignored on entry)
  22.  
  23.        <=
  24.          address of drawfile buffer is
  25.          updated
  26.  
  27. The drawfile is created in a RAM buffer,
  28. the address of which is returned by the
  29. routine. As objects are added to the file
  30. the address of the buffer may change.
  31.  
  32. At any time the buffer contains a valid
  33. drawfile that can be displayed with
  34. PROCshell_DrawRenderFile.
  35.  
  36. Multiple drawfiles can be created at the
  37. same time, adding objects to a particular
  38. drawfile is achieved by specifying the
  39. buffer address.
  40.               
  41. --------------------------------------------------------
  42.  
  43. PROCshell_DrawRenderFile()
  44. Params =>
  45.          int  address of drawfile buffer
  46.          int  x coordinate to render drawfile
  47.               (os units)
  48.          int  y coordinate to render drawfile
  49.               (os units)
  50.          real x scale factor
  51.          real y scale factor
  52.          int  address of wimp redraw block
  53.  
  54. This routine renders (plots) a drawfile which must
  55. be loaded into a buffer using PROCshell_DrawLoadFile,
  56. or created by the user application with
  57. PROCshell_DrawCreateFile.
  58.  
  59. The drawfile is always plotted relative to the current
  60. graphics origin and may be scaled independantly in the
  61. x and y directions.
  62.  
  63. All draw objects except text areas are supported, the
  64. actual rendering is performed by the WimpEXT module which
  65. must be loaded by the application's !Run file.
  66.  
  67. Wimp redraw block
  68.   0  Window handle
  69.   4  Visible area minx (incl)
  70.   8               miny (incl)
  71.  12               maxx (excl)
  72.  16               maxy (excl)
  73.  20  Scrollx
  74.  24  Scrolly
  75.  28  Redraw rect  minx (incl)
  76.  32               miny (incl)
  77.  36               maxx (excl)
  78.  40               maxy (excl)
  79.  
  80. --------------------------------------------------------
  81.  
  82. FNshell_DrawLoadFile()
  83. Params =>
  84.          str file name
  85.  
  86.        <=
  87.          int address of drawfile buffer
  88.  
  89. --------------------------------------------------------
  90.  
  91. PROCshell_DrawSaveFile()
  92. Params =>
  93.          int address of drawfile buffer
  94.          str file name
  95.  
  96. This routine saves the drawfile and sets
  97. the filetype to &AFF (draw).
  98.  
  99. --------------------------------------------------------
  100.  
  101. PROCshell_DrawGetFileSize()
  102. Params =>
  103.          int address of drawfile buffer
  104.   
  105.        <=
  106.          int file size in bytes (excluding EvntShell
  107.              pre-header)
  108.  
  109. --------------------------------------------------------
  110.  
  111. PROCshell_DrawGetBoundingBox()
  112. Params =>
  113.          int address of drawfile buffer
  114.          int x position (os units)
  115.          int y position (os units)
  116.          int width  (os units)
  117.          int height (os units)
  118.  
  119.        <=
  120.          The x,y,height and width values are
  121.          returned
  122.  
  123. --------------------------------------------------------
  124.  
  125. PROCshell_DrawInitFont()
  126. Params =>
  127.          int address of drawfile buffer
  128.          str name of font to initialise
  129.              i.e. 'Trinity.Medium.Italic'
  130.  
  131.        <=
  132.           address of drawfile buffer is
  133.           updated
  134.  
  135. Before text using outline fonts can be used
  136. in a drawfile it is vital that they are
  137. initialised using this call. Once you have
  138. called this routine for the first time you
  139. must continue initialising all the fonts that
  140. will be needed before creating other objects.
  141.  
  142. It would appear (despite what the PRMs say!)
  143. that font initialisation must occur before any
  144. other objects are defined - that is you must
  145. initialise any fonts directly after creating
  146. the drawfile.
  147.  
  148. Attempting to use fonts that are not available
  149. (has !Fonts been 'seen' by the Filer?) will
  150. cause an error. You should also bear in mind
  151. that using fonts that other people may not have
  152. can cause problems as various applications
  153. react in different ways to this situation.
  154.  
  155. --------------------------------------------------------
  156.  
  157. PROCshell_DrawSetFont()
  158. Params =>
  159.          int  address of drawfile buffer
  160.          str  name of font ("" for System Font)
  161.  
  162. Before this call can be made the font specified must be
  163. initialised with a call to PROCshell_DrawInitFont,
  164. otherwise an error will be generated.
  165.  
  166. All text objects created with PROCshell_DrawOutlineFont
  167. will be in the specified font until the next call to
  168. PROCshell_DrawSetFont.
  169.  
  170. --------------------------------------------------------
  171.  
  172. PROCshell_DrawBox()
  173. Params =>
  174.          int  address of drawfile buffer
  175.          real x coordinate of bottom left
  176.               of box
  177.          real y coordinate of bottom left
  178.               of box
  179.          real width of box
  180.          real height of box
  181.  
  182.        <=
  183.          address of drawfile buffer is
  184.          updated
  185.  
  186. The coordinates and dimensions of the box
  187. are given in the currently selected units.
  188.  
  189. --------------------------------------------------------
  190.  
  191. PROCshell_DrawCircle()
  192. Params =>
  193.          int  address of drawfile buffer
  194.          real x coordinate of centre of
  195.               circle
  196.          real y coordinate of centre of
  197.               circle
  198.          real radius of circle
  199.  
  200.        <=
  201.          address of drawfile buffer is
  202.          updated
  203.  
  204. The coordinates and dimensions of the circle
  205. are given in the currently selected units.
  206.  
  207. --------------------------------------------------------
  208.  
  209. PROCshell_DrawEllipse()
  210. Params =>
  211.          int  address of drawfile buffer
  212.          real x coordinate of centre of
  213.               ellipse
  214.          real y coordinate of centre of
  215.               ellipse
  216.          real major axis of ellipse
  217.          real minor axis of ellipse
  218.           
  219.        <=
  220.          address of drawfile buffer is
  221.          updated
  222.  
  223. The coordinates and dimensions of the ellipse
  224. are given in the currently selected units.
  225.  
  226. --------------------------------------------------------
  227.  
  228. PROCshell_DrawLine()
  229. Params =>
  230.          int  address of drawfile buffer
  231.          real x coordinate of start of line
  232.          real y coordinate of start of line
  233.          real x coordinate of end of line
  234.          real y coordinate of end of line
  235.           
  236.        <=
  237.          address of drawfile buffer is
  238.          updated
  239.  
  240. The coordinates and dimensions of the line
  241. are given in the currently selected units.
  242.  
  243. --------------------------------------------------------
  244.  
  245. PROCshell_DrawOutlineFont()
  246. Params =>
  247.          int  address of drawfile buffer
  248.          str  text to insert
  249.          real width of font  (points)
  250.          real height of font (points)
  251.          real x coordinate of bottom left
  252.               of text (current units)
  253.          real y coordinate of bottom left
  254.               of text (current units)
  255.  
  256.        <=
  257.           address of drawfile buffer is
  258.           updated
  259.  
  260. Before a text object can inserted the font
  261. used must be initialised with a call to
  262. PROCshell_DrawInitFont, otherwise an error
  263. will be generated. The font to use must also
  264. be selected with PROCshell_DrawSetFont.
  265.  
  266. --------------------------------------------------------
  267.  
  268. PROCshell_DrawSetFillColour()
  269. Params =>
  270.          int address of drawfile buffer
  271.          int red   value (0-255)
  272.          int green value (0-255)
  273.          int blue  value (0-255)
  274.  
  275. The colour value is supplied as a 24 bit
  276. value, RISC OS handles the display of the
  277. colour by dithering.
  278.  
  279. --------------------------------------------------------
  280.  
  281. PROCshell_DrawSetPathColour()
  282. Params =>
  283.          int address of drawfile buffer
  284.          int red   value (0-255)
  285.          int green value (0-255)
  286.          int blue  value (0-255)
  287.  
  288. The colour value is supplied as a 24 bit
  289. value, RISC OS handles the display of the
  290. colour by dithering.
  291.  
  292. --------------------------------------------------------
  293.  
  294. PROCshell_DrawSetPathWidth()
  295. Params =>
  296.          int  address of drawfile buffer
  297.          real path width (current units)
  298.  
  299. --------------------------------------------------------
  300.  
  301. PROCshell_DrawSetUnitsCM()
  302. Params =>
  303.          int address of drawfile buffer
  304.  
  305. Sets centimeters to be the current unit of
  306. measurement for the other library routines.
  307.  
  308. --------------------------------------------------------
  309.  
  310. PROCshell_DrawSetUnitsIN()
  311. Params =>
  312.          int address of drawfile buffer
  313.  
  314. Sets inches to be the current unit of
  315. measurement for the other library routines.
  316.  
  317. --------------------------------------------------------
  318.  
  319. PROCshell_DrawSetUnitsMM()
  320. Params =>
  321.          int address of drawfile buffer
  322.  
  323. Sets millimeters to be the current unit of
  324. measurement for the other library routines.
  325.  
  326. --------------------------------------------------------
  327.  
  328. PROCshell_DrawSetUnitsOS()
  329. Params =>
  330.          int address of drawfile buffer
  331.  
  332. Sets OS units to be the current unit of
  333. measurement for the other library routines.
  334.  
  335. --------------------------------------------------------
  336.  
  337. PROCshell_DrawSetUnitsPT()
  338. Params =>
  339.          int address of drawfile buffer
  340.  
  341. Sets points to be the current unit of
  342. measurement for the other library routines.
  343.  
  344. --------------------------------------------------------
  345.