Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / winUtils
1 ;
2 ; winUtils.sh
3 ;
4 ; Various window utility functions
5 ;
6 ; © 1994-1998 Straylight
7 ;
8
9 ;----- Licensing note -------------------------------------------------------
10 ;
11 ; This file is part of Straylight's Sapphire library.
12 ;
13 ; Sapphire 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 ; Sapphire 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 Sapphire. 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 ; winUtils_setTitle
32 ; winUtils_setPosition
33 ; winUtils_findValid
34 ; winUtils_shaded
35
36 [ :LNOT::DEF:winUtils__dfn
37 GBLL winUtils__dfn
38
39 ; --- winUtils_setTitle ---
40 ;
41 ; On entry: R0 == pointer to string to set in title
42 ; R1 == pointer to title bar buffer
43 ; R2 == window handle to write to
44 ;
45 ; On exit: --
46 ;
47 ; Use: Sets a window's title string. If the string is different,
48 ; the title is redrawn. The contortion to do this is
49 ; unpleasant, and is not to be performed in public.
50
51 IMPORT winUtils_setTitle
52
53 ; --- winUtils_setPosition ---
54 ;
55 ; On entry: R0 == window opening style
56 ; R1 == pointer to window state block
57 ; R2,R3 == extra arguments for displaying the window
58 ;
59 ; On exit: R2,R3 contain position for opening with Wimp_CreateMenu
60 ;
61 ; Use: Modifies the window state block pointed to by R0 so that the
62 ; window appears as required in the given opening style. The
63 ; window is always moved to the top.
64
65 IMPORT winUtils_setPosition
66
67 ; --- winUtils_findValid ---
68 ;
69 ; On entry: R0 == pointer to icon block
70 ; R1 == character to find in block (not case-sensitive)
71 ; R2 == old pointer to search from, or 0
72 ;
73 ; On exit: R1 == character forced to lower case
74 ; CS if found, and
75 ; R2 points to command string
76 ; else CC and
77 ; R2 corrupted
78 ;
79 ; Use: Tries to find a validation string command in the given
80 ; icon block.
81
82 IMPORT winUtils_findValid
83
84 ; --- winUtils_shaded ---
85 ;
86 ; On entry: R0 == window handle
87 ; R1 == icon handle
88 ;
89 ; On exit: CS if icon is shaded, CC otherwise
90 ;
91 ; Use: Informs caller whether an icon is shaded in the Sapphire
92 ; sense (ESG 31 or shaded bit set).
93
94 IMPORT winUtils_shaded
95
96 ; --- Opening styles for winUtils_setPosition ---
97 ;
98 ; These are actually the same as the dbox_open styles, without the flags
99 ; bits.
100
101 ^ 0
102 wStyle_current # 1 ;In its current position
103 wStyle_centre # 1 ;Centred on the screen
104 wStyle_pointer # 1 ;Centred over the pointer
105 wStyle_givenY # 1 ;At a given height on screen
106 ; R2 == y coordinate to open
107 wStyle_givenXY # 1 ;At a given position on scrn
108 ; R2 == x coordinate
109 ; R3 == y coordinate
110
111 ]
112
113 ;----- That's all, folks ----------------------------------------------------
114
115 END