2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
5 Desc: Layers Resident and initialization.
9 #include LC_LIBDEFS_FILE
10 #include <graphics/gfxbase.h>
11 #include <proto/exec.h>
12 #include <aros/symbolsets.h>
14 #include "layers_intern.h"
16 static int LayersInit(LIBBASETYPEPTR LIBBASE
)
18 GfxBase
= (APTR
)OpenLibrary("graphics.library", 41);
22 UtilityBase
= (APTR
)OpenLibrary("utility.library", 0);
23 if (UtilityBase
== NULL
) {
24 CloseLibrary((APTR
)GfxBase
);
28 LIBBASE
->lb_ClipRectPool
= CreatePool(MEMF_CLEAR
|MEMF_PUBLIC
|MEMF_SEM_PROTECTED
, sizeof(struct ClipRect
) * 50, sizeof(struct ClipRect
) * 50);
29 if (!LIBBASE
->lb_ClipRectPool
) {
30 CloseLibrary((struct Library
*)UtilityBase
);
31 CloseLibrary((struct Library
*)GfxBase
);
35 /* Install ourself as graphics.library's layer manager */
36 GfxBase
->gb_LayersBase
= (APTR
)LIBBASE
;
41 ADD2INITLIB(LayersInit
, 0);