2 Copyright © 2002, The AROS Development Team.
8 #include <exec/types.h>
9 #include <exec/libraries.h>
11 #include <proto/exec.h>
12 #include <clib/alib_protos.h>
14 #include "muimaster_intern.h"
17 /****************************************************************************************/
19 /* #define MYDEBUG 1 */
22 /* Global libbase vars */
25 /* Undef the following bases because the casts struct Libaray * -> struct <Lib>Base * casts
31 struct Library
*MUIMasterBase
;
32 struct IntuitionBase
*IntuitionBase
;
33 struct Library
*DataTypesBase
;
35 struct Library
**MUIMasterBasePtr
= &MUIMasterBase
;
37 /****************************************************************************************/
39 ULONG SAVEDS STDARGS
LC_BUILDNAME(L_InitLib
) (LC_LIBHEADERTYPEPTR MUIMasterBase
)
41 D(bug("Inside Init func of muimaster.library\n"));
43 *MUIMasterBasePtr
= MUIMasterBase
;
45 if (!MUIMB(MUIMasterBase
)->dosbase
)
47 if (!(MUIMB(MUIMasterBase
)->dosbase
= (struct DosLibrary
*)OpenLibrary("dos.library", 37)))
51 if (!MUIMB(MUIMasterBase
)->utilitybase
)
53 if (!(MUIMB(MUIMasterBase
)->utilitybase
= (struct UtilityBase
*)OpenLibrary("utility.library", 37)))
57 if (!MUIMB(MUIMasterBase
)->gfxbase
)
59 if (!(MUIMB(MUIMasterBase
)->gfxbase
= (struct GfxBase
*)OpenLibrary("graphics.library", 39)))
64 AslBase
= OpenLibrary("asl.library", 37);
69 LayersBase
= OpenLibrary("layers.library", 37);
74 IntuitionBase
= (struct IntuitionBase
*)OpenLibrary("intuition.library", 39);
79 CxBase
= OpenLibrary("commodities.library", 37);
84 RexxSysBase
= OpenLibrary("rexxsyslib.library", 37);
89 GadToolsBase
= OpenLibrary("gadtools.library", 37);
94 KeymapBase
= OpenLibrary("keymap.library", 37);
99 DataTypesBase
= OpenLibrary("datatypes.library", 37);
104 IFFParseBase
= OpenLibrary("iffparse.library", 37);
109 DiskfontBase
= OpenLibrary("diskfont.library", 37);
114 IconBase
= OpenLibrary("icon.library", 37); /* V44 really */
119 CyberGfxBase
= OpenLibrary("cybergraphics.library", 0);
120 /* continue even if cybergraphics.library is not available */
123 WorkbenchBase
= OpenLibrary("workbench.library", 37);
127 #ifdef HAVE_COOLIMAGES
129 CoolImagesBase
= OpenLibrary("coolimages.library", 0);
132 MUIMB(MUIMasterBase
)->intuibase
= IntuitionBase
;
134 InitSemaphore(&MUIMB(MUIMasterBase
)->ZuneSemaphore
);
136 NewList((struct List
*)&MUIMB(MUIMasterBase
)->BuiltinClasses
);
137 NewList((struct List
*)&MUIMB(MUIMasterBase
)->Applications
);
141 /****************************************************************************************/
143 ULONG SAVEDS STDARGS
LC_BUILDNAME(L_OpenLib
) (LC_LIBHEADERTYPEPTR MUIMasterBase
)
145 D(bug("Inside Open func of muimaster.library\n"));
150 /****************************************************************************************/
152 void SAVEDS STDARGS
LC_BUILDNAME(L_CloseLib
) (LC_LIBHEADERTYPEPTR MUIMasterBase
)
154 D(bug("Inside Close func of muimaster.library\n"));
157 /****************************************************************************************/
159 void SAVEDS STDARGS
LC_BUILDNAME(L_ExpungeLib
) (LC_LIBHEADERTYPEPTR MUIMasterBase
)
161 D(bug("Inside Expunge func of muimaster.library\n"));
163 /* CloseLibrary() checks for NULL-pointers */
165 CloseLibrary((struct Library
*)MUIMB(MUIMasterBase
)->gfxbase
);
166 MUIMB(MUIMasterBase
)->gfxbase
= NULL
;
168 CloseLibrary((struct Library
*)MUIMB(MUIMasterBase
)->utilitybase
);
169 MUIMB(MUIMasterBase
)->utilitybase
= NULL
;
171 CloseLibrary(AslBase
);
172 CloseLibrary((struct Library
*)MUIMB(MUIMasterBase
)->dosbase
);
173 MUIMB(MUIMasterBase
)->dosbase
= NULL
;
177 CloseLibrary(LayersBase
);
180 CloseLibrary((struct Library
*)MUIMB(MUIMasterBase
)->intuibase
);
181 MUIMB(MUIMasterBase
)->intuibase
= IntuitionBase
= NULL
;
183 CloseLibrary(CxBase
);
186 CloseLibrary(RexxSysBase
);
189 CloseLibrary(GadToolsBase
);
192 CloseLibrary(KeymapBase
);
195 CloseLibrary(DataTypesBase
);
196 DataTypesBase
= NULL
;
198 CloseLibrary(IFFParseBase
);
201 CloseLibrary(DiskfontBase
);
204 CloseLibrary(IconBase
);
207 CloseLibrary(CyberGfxBase
);
210 CloseLibrary(WorkbenchBase
);
211 WorkbenchBase
= NULL
;
213 #ifdef HAVE_COOLIMAGES
214 CloseLibrary(CoolImagesBase
);
215 CoolImagesBase
= NULL
;
219 /****************************************************************************************/