Initial revision
[ssr] / StraySrc / Sculptrix / sculptrix / sh / utils
1 ;
2 ; utilsh
3 ;
4 ; Various useful routines
5 ;
6 ; © 1995-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sculptrix.
12 ;
13 ; Sculptrix is free software; you can redistribute it and/or modify
14 ; it under the terms of the GNU General Public License as published by
15 ; the Free Software Foundation; either version 2, or (at your option)
16 ; any later version.
17 ;
18 ; Sculptrix is distributed in the hope that it will be useful,
19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ; GNU General Public License for more details.
22 ;
23 ; You should have received a copy of the GNU General Public License
24 ; along with Sculptrix. If not, write to the Free Software Foundation,
25 ; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27 ;----- Overview -------------------------------------------------------------
28 ;
29 ; Functions provided:
30 ;
31 ; utils_strWidth
32
33 [ :LNOT::DEF:utils__dfn
34 GBLL utils__dfn
35
36 ; --- utils_strWidth ---
37 ;
38 ; On entry: R0 == pointer to a string
39 ;
40 ; On exit: R0 == width of the string in OS units
41 ;
42 ; Use: Returns the width of a string, as it would be displayed in
43 ; an icon (i.e. taking into account things like the current
44 ; desktop font etc.) The width is exact, so if you want to
45 ; e.g. draw a box round it, you'll have to add on a little
46 ; clearance at each end. 8 OS units seems to be a good size
47 ; for the clearance (so the total width you'd use is given by
48 ; utils_strWidth(string)+16, because it has two ends).
49 ;
50 ; [Stolen and bodged from sapphire/wimp.s by mdw]
51
52 IMPORT utils_strWidth
53
54 ]
55
56 ;----- That's all, folks ----------------------------------------------------
57
58 END