Initial revision
[ssr] / StraySrc / Libraries / Steel / c / interface
1 /************************************
2
3 interface segment of Wimp routines
4
5 Controls low-level access to
6 Interface module.
7
8 Version 1.00 (29 June 1993)
9 © 1993-1998 Straylight
10
11 ************************************/
12
13 /*----- Licensing note ----------------------------------------------------*
14 *
15 * This file is part of Straylight's Steel library.
16 *
17 * Steel is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2, or (at your option)
20 * any later version.
21 *
22 * Steel is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * You should have received a copy of the GNU General Public License
28 * along with Steel. If not, write to the Free Software Foundation,
29 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
30 */
31
32 #include <stdio.h>
33
34 #include "swiv.h"
35 #include "os.h"
36 #include "wimp.h"
37 #include "swis.h"
38 #include "pointer.h"
39 #include "interface.h"
40 #include "visdelay.h"
41
42 static sprite_area *interface__area;
43
44 void interface_spritearea(sprite_area *a)
45 {
46 interface__area=a;
47 }
48
49 os_error *interface_slabButton(wimp_mousestr *mouse)
50 {
51 os_error *e;
52 visdelay_state s;
53 s=visdelay_suspend();
54 e=_swix(XInterface_SlabButton,_in(1),mouse);
55 visdelay_resume(s);
56 return (e);
57 }
58
59 os_error *interface_render3dWindow(wimp_redrawstr *rdr)
60 {
61 os_error *e;
62 e=_swix(XInterface_Render3dWindow,_in(1),rdr);
63 return (e);
64 }
65
66 os_error *interface_initialise(wimp_t task)
67 {
68 os_error *e;
69 e=_swix(XInterface_Initialise,_in(0),task);
70 return (e);
71 }
72
73 os_error *interface_closeDown(wimp_t task)
74 {
75 os_error *e;
76 e=_swix(XInterface_CloseDown,_in(0),task);
77 return (e);
78 }
79
80 os_error *interface_poll(wimp_eventstr *evnt,wimp_t task)
81 {
82 int event=evnt->e;
83 os_error *e;
84 if (interface__area)
85 event|=1<<((unsigned int)31); /* New Interface flag for sprite area */
86 e=_swix(XInterface_Poll,_inr(0,2),event,interface__area,task);
87 return (e);
88 }
89
90 os_error *interface_setWorkareaPointer(interface_pointerstr *s)
91 {
92 os_error *e;
93 e=_swix(XInterface_SetWorkareaPointer,_in(1),s);
94 return (e);
95 }
96
97 os_error *interface_removeWorkareaPointer(interface_pointerstr *s)
98 {
99 os_error *e;
100 e=_swix(XInterface_RemoveWorkareaPointer,_in(1),s);
101 return (e);
102 }