Mercurial > hg > Members > kono > nitros9-code
comparison 3rdparty/utils/winfo/winfo.doc @ 396:00b1c751fad7
Added WInfo
author | boisy |
---|---|
date | Mon, 26 Aug 2002 13:25:25 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
395:35d038fa4f85 | 396:00b1c751fad7 |
---|---|
1 WInfo - v2.0 by Alan DeKok | |
2 Minor modifications to make WInfo use the I$Attach system call | |
3 to find the device table entry of the window in question. | |
4 The old WInfo rooted through system memory by hand, and used | |
5 a FIXED device table size which broke under NitrOS-9 v1.22 | |
6 | |
7 This corrected version will work properly under ANY version | |
8 of OS-9 or NitrOS-9, past, present, or future. | |
9 | |
10 NitrOS-9 Level III patches by request of Erik Tromp, thanks! | |
11 | |
12 WInfo - v1.0 copyright December,1987 by Ron Lammardo | |
13 Placed in the Public Domain December,1987 | |
14 This subroutine may not be sold or used in any commercial package | |
15 without the permission of the author. | |
16 | |
17 WInfo is an OS9 Level II subroutine to return window information on any | |
18 window in use. Although WInfo is written in ASM, it is set up to be callable | |
19 from an ASM, Basic09, and (hopefully) C main programs. This subroutine directly | |
20 accesses system window tables, screen tables, and device memory. As such, if a | |
21 new level/version of OS9 were to be released, the subroutine module would | |
22 possibly need to be re-written. However, by putting all the 'cheating' code | |
23 into this subroutine, any applications program calling it would not need | |
24 modification or re-assembling. To further ensure upward compatability between | |
25 editions of WInfo, a sizable amount of space is allocated in the return buffer | |
26 to allow additional fields to be added without impacting the position of | |
27 existing fields. | |
28 | |
29 WInfo requires two parameters : a string containing the requested device | |
30 name, and a return buffer (described below) to place the information into. To | |
31 maintain compatability with basic09, the sizes of these two parameters along | |
32 with the parameter count (always 2) must be passed if the calling program is | |
33 ASM. WInfo also requires 512 bytes for its own use...ASM calling programs | |
34 should allow at least that much buffer space just below the stack address at | |
35 the time of call. | |
36 | |
37 If WInfo encounters a system-type error, it will return with the carry bit | |
38 set and the b register containing the appropriate error code. If a WInfo error | |
39 condition is encountered, the first byte of the return buffer (WI$Stat) will | |
40 contain the error number and the error message will be returned at the end of | |
41 the buffer (WI$ErMsg). If the length of the buffer passed to WInfo is too | |
42 small, the error status returned (WI$Stat) will be $FF with no error message, | |
43 as the error message is normally placed at the end of the return buffer. | |
44 | |
45 WInfo also returns its edition # (the byte after the module name) as part of | |
46 the return packet (WI$Edtn). This edition # can be checked to determine if the | |
47 correct minimum level of WInfo is being accessed by the main program. For | |
48 example, if WInfo edition #4 is the first edition to return the # of users | |
49 accessing a window, the main program could check the edition # to insure it | |
50 was accessing WInfo edition #4 or higher, as any earlier edition would not | |
51 return the needed information. | |
52 | |
53 Most of the return packet fields are self-explanitory, but a few might need | |
54 further clarification. | |
55 | |
56 WI$BPR - bytes per row. This is the number of bytes making up a line of | |
57 charactrers, not the number of bytes in 1 dot row. To get the number | |
58 of bytes per dot row,divide by 8. | |
59 | |
60 WI$Lset- Logic set # - see OS9 Level II manual page 3-21 in the winows section. | |
61 | |
62 WI$VDG - VDG type screen indicator. The following values are possible: | |
63 0 = Non-vdg type screen | |
64 1 = VDG text type screen | |
65 2 = VDG medium-res (coco2) graphics screen - WI$Sty contains the screen | |
66 mode in the first 4 bits and the foreground color in the last 4 bits. | |
67 The modes and colors are fully described in the OS9 Level-II manual | |
68 pages B-5 & B-6 of the command reference. | |
69 3 = VDG hi-res (coco3) graphics screen - WI$Sty contains the screen type as | |
70 defined in the SS.AScrn Set Status call. This is the only VDG code | |
71 which will return valid palette information (WI$PRegs). | |
72 | |
73 The following fields are never valid for VDG type screens: | |
74 | |
75 WI$CBsw - character binary switch bits | |
76 WI$BDPRN - Border palette register number | |
77 WI$FGPRN - Foreground palette register number | |
78 WI$BGPRN - Background palette register number | |
79 WI$Lset - Logic set number | |
80 WI$FntGr - Active font group number | |
81 WI$FntBf - Active font buffer number | |
82 WI$PstGr - Pattern set group number | |
83 WI$PstBf - Pattern set buffer number | |
84 WI$GcrGr - Gfx cursor group number | |
85 WI$GcrBf - Gfx cursor buffer number | |
86 WI$DrCrx - Draw cursor x position | |
87 WI$DrCry - Draw cursor y position | |
88 | |
89 | |
90 ------------------------------------------------------------------------------- | |
91 | |
92 This subroutine is available for use by any and all for whatever application. | |
93 Comments and suggestions for improvements/enhancements are greatly appreciated. | |
94 However,due to the nature of the subroutine I would appreciate retaining | |
95 control of any update issuances so that the edition numbers etc. stay | |
96 controlled. | |
97 | |
98 Ron Lammardo | |
99 75706,336 | |
100 | |
101 |