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 GadToolsBase
= OpenLibrary("gadtools.library", 37);
89 KeymapBase
= OpenLibrary("keymap.library", 37);
94 DataTypesBase
= OpenLibrary("datatypes.library", 37);
99 IFFParseBase
= OpenLibrary("iffparse.library", 37);
104 DiskfontBase
= OpenLibrary("diskfont.library", 37);
109 IconBase
= OpenLibrary("icon.library", 37); /* V44 really */
114 CyberGfxBase
= OpenLibrary("cybergraphics.library", 0);
115 /* continue even if cybergraphics.library is not available */
117 #ifdef HAVE_COOLIMAGES
119 CoolImagesBase
= OpenLibrary("coolimages.library", 0);
122 MUIMB(MUIMasterBase
)->intuibase
= IntuitionBase
;
124 InitSemaphore(&MUIMB(MUIMasterBase
)->ZuneSemaphore
);
126 NewList((struct List
*)&MUIMB(MUIMasterBase
)->BuiltinClasses
);
127 NewList((struct List
*)&MUIMB(MUIMasterBase
)->Applications
);
131 /****************************************************************************************/
133 ULONG SAVEDS STDARGS
LC_BUILDNAME(L_OpenLib
) (LC_LIBHEADERTYPEPTR MUIMasterBase
)
135 D(bug("Inside Open func of muimaster.library\n"));
140 /****************************************************************************************/
142 void SAVEDS STDARGS
LC_BUILDNAME(L_CloseLib
) (LC_LIBHEADERTYPEPTR MUIMasterBase
)
144 D(bug("Inside Close func of muimaster.library\n"));
147 /****************************************************************************************/
149 void SAVEDS STDARGS
LC_BUILDNAME(L_ExpungeLib
) (LC_LIBHEADERTYPEPTR MUIMasterBase
)
151 D(bug("Inside Expunge func of muimaster.library\n"));
153 /* CloseLibrary() checks for NULL-pointers */
155 CloseLibrary((struct Library
*)MUIMB(MUIMasterBase
)->gfxbase
);
156 MUIMB(MUIMasterBase
)->gfxbase
= NULL
;
158 CloseLibrary((struct Library
*)MUIMB(MUIMasterBase
)->utilitybase
);
159 MUIMB(MUIMasterBase
)->utilitybase
= NULL
;
161 CloseLibrary(AslBase
);
162 CloseLibrary((struct Library
*)MUIMB(MUIMasterBase
)->dosbase
);
163 MUIMB(MUIMasterBase
)->dosbase
= NULL
;
167 CloseLibrary(LayersBase
);
170 CloseLibrary((struct Library
*)MUIMB(MUIMasterBase
)->intuibase
);
171 MUIMB(MUIMasterBase
)->intuibase
= IntuitionBase
= NULL
;
173 CloseLibrary(CxBase
);
176 CloseLibrary(GadToolsBase
);
179 CloseLibrary(KeymapBase
);
182 CloseLibrary(DataTypesBase
);
183 DataTypesBase
= NULL
;
185 CloseLibrary(IFFParseBase
);
188 CloseLibrary(DiskfontBase
);
191 CloseLibrary(IconBase
);
194 CloseLibrary(CyberGfxBase
);
197 #ifdef HAVE_COOLIMAGES
198 CloseLibrary(CoolImagesBase
);
199 CoolImagesBase
= NULL
;
203 /****************************************************************************************/