Initial revision
[ssr] / StraySrc / Libraries / Sapphire / sh / nopoll
1 ;
2 ; nopoll.sh
3 ;
4 ; Handling nonpolling dialogue boxes
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 ; nopoll_open
32 ; nopoll_close
33 ; nopoll_init
34 ; nopoll_process
35
36 [ :LNOT::DEF:nopoll__dfn
37 GBLL nopoll__dfn
38
39 ; --- nopoll_open ---
40 ;
41 ; On entry: R0 == a window handle to take over
42 ;
43 ; On exit: --
44 ;
45 ; Use: Sets up the window with the given handle to be a nonpolling
46 ; dialogue box. The window must already be open on the screen.
47 ; This call will force it to be painted on the screen, and
48 ; then start faking events for it.
49
50 IMPORT nopoll_open
51
52 ; --- nopoll_close ---
53 ;
54 ; On entry: R0 == return value for nopoll_process (can be anything)
55 ;
56 ; On exit: --
57 ;
58 ; Use: Tells nopoll that the nonpolling window has been killed,
59 ; and hence that polling can return to normal again. You can
60 ; specify a return value to give from nopoll_process (if that
61 ; system is being used).
62
63 IMPORT nopoll_close
64
65 ; --- nopoll_init ---
66 ;
67 ; On entry: --
68 ;
69 ; On exit: --
70 ;
71 ; Use: Initialises nopoll so it can be used.
72
73 IMPORT nopoll_init
74
75 ; --- nopoll_process ---
76 ;
77 ; On entry: --
78 ;
79 ; On exit: R0 == value passed to nopoll_close
80 ;
81 ; Use: Processes a nonpolling window until it calls nopoll_close.
82 ; It then returns the value passed to nopoll_close in R0,
83 ; which can be defined in any way you want.
84 ;
85 ; Some notes on the use of this routine:
86 ;
87 ; * It calls event_poll, so any functions that get called
88 ; after the normal event_poll don't get called. Since the
89 ; Wimp isn't actually being polled at all, this isn't a
90 ; real problem as long as your handlers are registered at the
91 ; event filter level or higher (e.g. win event handlers or
92 ; even dbox handlers).
93 ;
94 ; * It uses up an extra 256 bytes of stack for a poll block.
95 ; If you think you might miss this stack space, then you'd
96 ; better not use this routine.
97 ;
98 ; * It isn't reentrant, but then again, nor is the rest of the
99 ; nopoll system -- you can only have one nonpolling box open
100 ; at a time.
101
102 IMPORT nopoll_process
103
104 ]
105
106 ;----- That's all, folks ----------------------------------------------------
107
108 END