Tabs to spaces; more consistent formatting.
[AROS.git] / rom / devs / console / consoleif.h
blobdb9bff48a092174b603acc026c66cd211df1f666
1 #ifndef CONSOLEIF_H
2 #define CONSOLEIF_H
3 /*
4 Copyright © 1995-2014, The AROS Development Team. All rights reserved.
5 $Id$
7 Desc: Include for the console class
8 Lang: english
9 */
11 #ifndef UTILITY_TAGITEM_H
12 # include <utility/tagitem.h>
13 #endif
14 #ifndef PROTO_INTUITION_H
15 # include <proto/intuition.h>
16 #endif
18 enum
20 A_Console_Window = TAG_USER + 1
23 enum
25 M_Console_Write = TAG_USER + 1,
26 M_Console_Scroll,
27 M_Console_DoCommand,
28 M_Console_Left,
29 M_Console_Right,
30 M_Console_Up,
31 M_Console_Down,
32 M_Console_GetDefaultParams,
33 M_Console_RenderCursor,
34 M_Console_UnRenderCursor,
35 M_Console_ClearCell,
36 M_Console_NewWindowSize,
37 M_Console_HandleGadgets,
38 M_Console_Copy,
39 M_Console_Paste
42 struct P_Console_ScrollDown
44 ULONG MethodID;
45 WORD LinePos; /* Lines including this one will be scrolled */
49 struct P_Console_ScrollUp
51 ULONG MethodID;
52 WORD LinePos; /* Lines including this one will be scrolled */
56 struct P_Console_DoCommand
58 ULONG MethodID;
59 BYTE Command; /* Erase in display, scroll, next line etc.. */
60 UBYTE NumParams;
61 IPTR *Params; /* The command's parameters */
64 struct P_Console_Left
66 ULONG MethodID;
67 UWORD Num;
69 struct P_Console_Right
71 ULONG MethodID;
72 UWORD Num;
74 struct P_Console_Up
76 ULONG MethodID;
77 UWORD Num;
80 struct P_Console_Down
82 ULONG MethodID;
83 UWORD Num;
86 struct P_Console_RenderCursor
88 ULONG MethodID;
91 struct P_Console_UnRenderCursor
93 ULONG MethodID;
96 struct P_Console_ClearCell
98 ULONG MethodID;
99 WORD X;
100 WORD Y;
103 struct P_Console_NewWindowSize
105 ULONG MethodID;
108 struct P_Console_Copy
110 ULONG MethodID;
113 struct P_Console_Paste
115 ULONG MethodID;
118 struct P_Console_HandleGadgets
120 ULONG MethodID;
121 struct InputEvent *Event;
124 struct P_Console_GetDefaultParams
126 ULONG MethodID;
127 BYTE Command;
128 IPTR *Params;
131 #define Console_DoCommand(o, cmd, numparams, params) \
132 ({ \
133 struct P_Console_DoCommand p; \
134 p.MethodID = M_Console_DoCommand; \
135 p.Command = cmd; \
136 p.NumParams = numparams; \
137 p.Params = (IPTR *)params; \
138 DoMethodA((o), (Msg)&p); \
141 #define Console_Left(o, num) \
142 ({ \
143 struct P_Console_Left p; \
144 p.MethodID = M_Console_Left; \
145 p.Num = num; \
146 DoMethodA((o), (Msg)&p); \
150 #define Console_Right(o, num) \
151 ({ \
152 struct P_Console_Right p; \
153 p.MethodID = M_Console_Right; \
154 p.Num = num; \
155 DoMethodA((o), (Msg)&p); \
158 #define Console_Up(o, num) \
159 ({ \
160 struct P_Console_Up p; \
161 p.MethodID = M_Console_Up; \
162 p.Num = num; \
163 DoMethodA((o), (Msg)&p); \
166 #define Console_Down(o, num) \
167 ({ \
168 struct P_Console_Down p; \
169 p.MethodID = M_Console_Down; \
170 p.Num = num; \
171 DoMethodA((o), (Msg)&p); \
174 #define Console_GetDefaultParams(o, cmd, params) \
175 ({ \
176 struct P_Console_GetDefaultParams p; \
177 p.MethodID = M_Console_GetDefaultParams; \
178 p.Command = cmd; \
179 p.Params = params; \
180 DoMethodA((o), (Msg)&p); \
184 #define Console_RenderCursor(o) \
185 ({ \
186 struct P_Console_RenderCursor p; \
187 p.MethodID = M_Console_RenderCursor; \
188 DoMethodA((o), (Msg)&p); \
191 #define Console_UnRenderCursor(o) \
192 ({ \
193 struct P_Console_UnRenderCursor p; \
194 p.MethodID = M_Console_UnRenderCursor; \
195 DoMethodA((o), (Msg)&p); \
198 #define Console_ClearCell(o, x, y) \
199 ({ \
200 struct P_Console_ClearCell p; \
201 p.MethodID = M_Console_ClearCell; \
202 p.X = x; \
203 p.Y = y; \
204 DoMethodA((o), (Msg)&p); \
207 #define Console_NewWindowSize(o) \
208 ({ \
209 struct P_Console_NewWindowSize p; \
210 p.MethodID = M_Console_NewWindowSize; \
211 DoMethodA((o), (Msg)&p); \
214 #define Console_HandleGadgets(o, e) \
215 ({ \
216 struct P_Console_HandleGadgets p; \
217 p.MethodID = M_Console_HandleGadgets; \
218 p.Event = e; \
219 DoMethodA((o), (Msg)&p); \
222 #define Console_Copy(o) \
223 ({ \
224 struct P_Console_Copy p; \
225 p.MethodID = M_Console_Copy; \
226 DoMethodA((o), (Msg)&p); \
229 #define Console_Paste(o) \
230 ({ \
231 struct P_Console_Paste p; \
232 p.MethodID = M_Console_Paste; \
233 DoMethodA((o), (Msg)&p); \
237 #endif /* CONSOLEIF_H */