2 Copyright © 1995-2004, The AROS Development Team. All rights reserved.
5 Desc: Layers Resident and initialization.
9 #include "layers_intern.h"
10 #include LC_LIBDEFS_FILE
11 #include <graphics/gfxbase.h>
12 #include <proto/exec.h>
13 #include <aros/symbolsets.h>
18 #define SysBase LIBBASE->lb_SysBase
20 AROS_SET_LIBFUNC(LayersInit
, LIBBASETYPE
, LIBBASE
)
24 InitSemaphore(&LIBBASE
->lb_MemLock
);
26 LIBBASE
->lb_ClipRectPool
= CreatePool(MEMF_CLEAR
| MEMF_PUBLIC
, sizeof(struct ClipRect
) * 50, sizeof(struct ClipRect
) * 50);
27 LIBBASE
->lb_GfxBase
= (struct GfxBase
*) OpenLibrary("graphics.library",0);
28 LIBBASE
->lb_UtilityBase
= (struct UtilityBase
*) OpenLibrary("utility.library",0);
30 if (!LIBBASE
->lb_GfxBase
|| !LIBBASE
->lb_UtilityBase
|| !LIBBASE
->lb_ClipRectPool
)
32 if (LIBBASE
->lb_GfxBase
)
34 CloseLibrary((struct Library
*)LIBBASE
->lb_GfxBase
);
35 LIBBASE
->lb_GfxBase
= NULL
;
37 if (LIBBASE
->lb_UtilityBase
)
39 CloseLibrary((struct Library
*)LIBBASE
->lb_UtilityBase
);
40 LIBBASE
->lb_UtilityBase
= NULL
;
42 if (LIBBASE
->lb_ClipRectPool
)
44 DeletePool(LIBBASE
->lb_ClipRectPool
);
45 LIBBASE
->lb_ClipRectPool
= NULL
;
54 ADD2INITLIB(LayersInit
, 0);