Attempt to build Scalos core. Compiles but stops
[AROS-Contrib.git] / scalos / main / Patches.h
blob8baf1cf229013dc77a73767edb72794ebc8249e6
1 // Patches.c
2 // $Date$
3 // $Revision$
6 #include <exec/types.h>
7 #include <graphics/rastport.h>
8 #include <utility/hooks.h>
9 #include <intuition/gadgetclass.h>
10 #include <workbench/workbench.h>
11 #include <workbench/startup.h>
12 #include <workbench/icon.h>
13 #include <libraries/gadtools.h>
14 #include <libraries/iffparse.h>
15 #include <datatypes/pictureclass.h>
16 #include <dos/dostags.h>
17 #include <guigfx/guigfx.h>
19 #define __USE_SYSBASE
21 #include <proto/dos.h>
22 #include <proto/exec.h>
23 #include <proto/layers.h>
24 #include <proto/intuition.h>
25 #include <proto/graphics.h>
26 #include <proto/utility.h>
27 #include <proto/icon.h>
28 #include <proto/iconobject.h>
29 #include <proto/guigfx.h>
30 #include <proto/datatypes.h>
31 #include <proto/gadtools.h>
32 #include "debug.h"
33 #include <proto/scalos.h>
35 #include <clib/alib_protos.h>
37 #include <defs.h>
38 #include <datatypes/iconobject.h>
39 #include <scalos/palette.h>
40 #include <scalos/pattern.h>
41 #include <scalos/scalos.h>
43 #include <stdlib.h>
44 #include <stdio.h>
45 #include <string.h>
47 #include "scalos_structures.h"
48 #include "functions.h"
49 #include "Variables.h"
51 //----------------------------------------------------------------------------
52 // Revision history :
54 // 20011203 jl initial history
55 //----------------------------------------------------------------------------
57 //----------------------------------------------------------------------------
59 // global functions
61 LIBFUNC_P3_PROTO(struct Window *, sca_OpenWindowTagList,
62 A0, struct NewWindow *, newWin,
63 A1, const struct TagItem *, TagList,
64 A6, struct IntuitionBase *, iBase, 0);
66 LIBFUNC_P1_PROTO(LONG, sca_CloseWorkBench,
67 A6, struct IntuitionBase *, iBase, 0);
68 LIBFUNC_P1_PROTO(LONG, sca_OpenWorkBench,
69 A6, struct IntuitionBase *, iBase, 0);
70 LIBFUNC_P8_PROTO(struct AppIcon *, sca_AddAppIconA,
71 D0, ULONG, Id,
72 D1, ULONG, UserData,
73 A0, CONST_STRPTR, IconText,
74 A1, struct MsgPort *, iconPort,
75 A2, BPTR, lock,
76 A3, struct DiskObject *, DiskObj,
77 A4, struct TagItem *, TagList,
78 A6, struct Library *, wbBase, 0);
79 LIBFUNC_P2_PROTO(ULONG, sca_RemoveAppIcon,
80 A0, struct AppIcon *, appIcon,
81 A6, struct Library *, wbBase, 0);
82 LIBFUNC_P6_PROTO(struct AppWindow *, sca_AddAppWindowA,
83 D0, ULONG, Id,
84 D1, ULONG, UserData,
85 A0, struct Window *, window,
86 A1, struct MsgPort *, iconPort,
87 A2, struct TagItem *, TagList,
88 A6, struct Library *, wbBase, 0);
89 LIBFUNC_P2_PROTO(BOOL, sca_RemoveAppWindow,
90 A0, struct AppWindow *, aw,
91 A6, struct Library *, wbBase, 0);
92 LIBFUNC_P6_PROTO(struct AppMenuItem *, sca_AddAppMenuItemA,
93 D0, ULONG, Id,
94 D1, ULONG, UserData,
95 A0, CONST_STRPTR, text,
96 A1, struct MsgPort *, iconPort,
97 A2, struct TagItem *, TagList,
98 A6, struct Library *, wbBase, 0);
99 LIBFUNC_P2_PROTO(BOOL, sca_RemoveAppMenuItem,
100 A0, struct AppMenuItem *, ami,
101 A6, struct Library *, wbBase, 0);
102 LIBFUNC_P3_PROTO(struct Screen *, sca_OpenScreenTagList,
103 A0, struct NewScreen *, newScr,
104 A1, const struct TagItem *, TagList,
105 A6, struct IntuitionBase *, iBase, 0);
106 LIBFUNC_P4_PROTO(void, sca_UpdateWorkbench,
107 A0, CONST_STRPTR, Name,
108 A1, BPTR, ParentLock,
109 D0, LONG, Action,
110 A6, struct Library *, wbBase, 0);
111 LIBFUNC_P1_PROTO(LONG, sca_SetBackFill,
112 A6, struct Library *, wbBase, 0);
113 LIBFUNC_P4_PROTO(ULONG, sca_WBInfo,
114 A0, BPTR, lock,
115 A1, STRPTR, name,
116 A2, struct Screen *, screen,
117 A6, struct Library *, wbBase, 0);
118 LIBFUNC_P3_PROTO(BOOL, sca_PutDiskObject,
119 A0, CONST_STRPTR, Name,
120 A1, const struct DiskObject *, diskObj,
121 A6, struct Library *, IconBase, 0);
122 LIBFUNC_P2_PROTO(BOOL, sca_DeleteDiskObject,
123 A0, CONST_STRPTR, Name,
124 A6, struct Library *, IconBase, 0);
125 LIBFUNC_P4_PROTO(BOOL, sca_PutIconTagList,
126 A0, CONST_STRPTR, Name,
127 A1, const struct DiskObject *, diskObj,
128 A2, struct TagItem *, tags,
129 A6, struct Library *, IconBase, 0);
131 LIBFUNC_P2_PROTO(ULONG, sca_DeleteFile,
132 D1, CONST_STRPTR, Name,
133 A6, struct DosLibrary *, DOSBase, 0);
134 LIBFUNC_P3_PROTO(ULONG, sca_Rename,
135 D1, CONST_STRPTR, oldName,
136 D2, CONST_STRPTR, newName,
137 A6, struct DosLibrary *, DOSBase, 0);
138 LIBFUNC_P3_PROTO(BPTR, sca_Open,
139 D1, CONST_STRPTR, name,
140 D2, LONG, accessMode,
141 A6, struct DosLibrary *, DOSBase, 0);
142 LIBFUNC_P2_PROTO(ULONG, sca_Close,
143 D1, BPTR, file,
144 A6, struct DosLibrary *, DOSBase, 0);
145 LIBFUNC_P2_PROTO(BPTR, sca_CreateDir,
146 D1, CONST_STRPTR, name,
147 A6, struct DosLibrary *, DOSBase, 0);
149 //LIBFUNC_P2_PROTO(CONST_STRPTR, sca_GetLocString,
150 // D0, ULONG, StringID,
151 // A6, struct Library *, wbBase);
153 //----------------------------------------------------------------------------
155 // public data items
157 #ifdef __AROS__
159 #ifdef TEST_OPENWINDOWTAGLIST
160 extern struct Window * (*OldOpenWindowTagList) ();
161 #endif /* TEST_OPENWINDOWTAGLIST */
162 extern ULONG (*OldCloseWB) ();
163 extern ULONG (*OldOpenWB) ();
164 extern ULONG (*OldRemoveAppIcon) ();
165 extern BOOL (*OldRemoveAppWindow) ();
166 extern BOOL (*OldRemoveAppMenuItem) ();
167 extern struct Screen * (*OldOpenScreenTagList) ();
168 extern void (*OldUpdateWorkbench) ();
169 extern APTR OldAddAppIconA;
170 extern APTR OldAddAppWindowA;
171 extern APTR OldAppAppMenuItemA;
172 extern APTR OldSetBackFill;
173 extern APTR OldWBInfo;
174 extern BOOL (*OldPutDiskObject) ();
175 extern BOOL (*OldDeleteDiskObject) ();
176 extern BOOL (*OldPutIconTagList) ();
177 extern ULONG (*OldDeleteFile) ();
178 extern ULONG (*OldRename) ();
179 extern BPTR (*OldOpen) ();
180 extern ULONG (*OldClose) ();
181 extern BPTR (*OldCreateDir) ();
183 #else
185 #ifdef TEST_OPENWINDOWTAGLIST
186 extern LIBFUNC_P3_DPROTO(struct Window *, (*OldOpenWindowTagList),
187 A0, struct NewWindow *, newWin,
188 A1, const struct TagItem *, TagList,
189 A6, struct IntuitionBase *, iBase);
190 #endif /* TEST_OPENWINDOWTAGLIST */
191 extern LIBFUNC_P1_DPROTO(ULONG, (*OldCloseWB),
192 A6, struct IntuitionBase *, iBase);
193 extern LIBFUNC_P1_DPROTO(ULONG, (*OldOpenWB),
194 A6, struct IntuitionBase *, iBase);
195 extern LIBFUNC_P2_DPROTO(ULONG, (*OldRemoveAppIcon),
196 A0, struct AppIcon *, appIcon,
197 A6, struct Library *, qq);
198 extern LIBFUNC_P2_DPROTO(BOOL, (*OldRemoveAppWindow),
199 A0, struct AppWindow *, aw,
200 A6, struct Library *, wbBase);
201 extern LIBFUNC_P2_DPROTO(BOOL, (*OldRemoveAppMenuItem),
202 A0, struct AppMenuItem *, ami,
203 A6, struct Library *, wbBase);
204 extern LIBFUNC_P3_DPROTO(struct Screen *, (*OldOpenScreenTagList),
205 A0, struct NewScreen *, newScr,
206 A1, const struct TagItem *, TagList,
207 A6, struct IntuitionBase *, iBase);
208 extern LIBFUNC_P4_DPROTO(void, (*OldUpdateWorkbench),
209 A0, CONST_STRPTR, Name,
210 A1, BPTR, ParentLock,
211 D0, LONG, Action,
212 A6, struct Library *, wbBase);
213 extern APTR OldAddAppIconA;
214 extern APTR OldAddAppWindowA;
215 extern APTR OldAppAppMenuItemA;
216 extern APTR OldSetBackFill;
217 extern APTR OldWBInfo;
218 extern LIBFUNC_P3_DPROTO(BOOL, (*OldPutDiskObject),
219 A0, CONST_STRPTR, Name,
220 A1, const struct DiskObject *, diskObj,
221 A6, struct Library *, IconBase);
222 extern LIBFUNC_P2_DPROTO(BOOL, (*OldDeleteDiskObject),
223 A0, CONST_STRPTR, Name,
224 A6, struct Library *, IconBase);
225 extern LIBFUNC_P4_DPROTO(BOOL, (*OldPutIconTagList),
226 A0, CONST_STRPTR, Name,
227 A1, const struct DiskObject *, diskObj,
228 A2, struct TagItem *, tags,
229 A6, struct Library *, IconBase);
231 extern LIBFUNC_P2_DPROTO(ULONG, (*OldDeleteFile),
232 D1, CONST_STRPTR, Name,
233 A6, struct DosLibrary *, DOSBase);
234 extern LIBFUNC_P3_DPROTO(ULONG, (*OldRename),
235 D1, CONST_STRPTR, oldName,
236 D2, CONST_STRPTR, newName,
237 A6, struct DosLibrary *, DOSBase);
238 extern LIBFUNC_P3_DPROTO(BPTR, (*OldOpen),
239 D1, CONST_STRPTR, name,
240 D2, LONG, accessMode,
241 A6, struct DosLibrary *, DOSBase);
242 extern LIBFUNC_P2_DPROTO(ULONG, (*OldClose),
243 D1, BPTR, file,
244 A6, struct DosLibrary *, DOSBase);
245 extern LIBFUNC_P2_DPROTO(BPTR, (*OldCreateDir),
246 D1, CONST_STRPTR, name,
247 A6, struct DosLibrary *, DOSBase);
249 //extern LIBFUNC_P1_DPROTO(CONST_STRPTR, (*OldwbPrivate2),
250 // D0, ULONG, StringID);
252 #endif
254 //----------------------------------------------------------------------------