revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-linux / hidd / linuxfb / linuxfbgfx_init.c
blobd89c2a412cd26a289dcd34c1155b8d8538f32fca
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: LinuxFB Hidd initialization code.
6 Lang: English.
7 */
9 #define DEBUG 0
11 #define __OOP_NOATTRBASES__
13 #include <aros/symbolsets.h>
14 #include <aros/debug.h>
15 #include <utility/utility.h>
16 #include <oop/oop.h>
17 #include <hidd/gfx.h>
18 #include <proto/exec.h>
19 #include <proto/oop.h>
20 #include <hidd/unixio.h>
22 #include LC_LIBDEFS_FILE
24 #include "linuxfbgfx_intern.h"
26 static CONST_STRPTR const abd[] =
28 IID_Hidd_Gfx,
29 IID_Hidd_BitMap,
30 IID_Hidd_Sync,
31 IID_Hidd_PixFmt,
32 IID_Hidd_ColorMap,
33 IID_Hidd_ChunkyBM,
34 IID_Hidd_Gfx_LinuxFB,
35 IID_Hidd_BitMap_LinuxFB,
36 NULL
39 static int Init_Hidd(LIBBASETYPEPTR LIBBASE)
41 LIBBASE->lsd.unixio = OOP_NewObject(NULL, CLID_Hidd_UnixIO, NULL);
42 if (!LIBBASE->lsd.unixio)
43 return FALSE;
45 InitSemaphore(&LIBBASE->lsd.sema);
47 return !OOP_ObtainAttrBasesArray(&LIBBASE->lsd.gfxAttrBase, abd);
50 static int Expunge_Hidd(LIBBASETYPEPTR LIBBASE)
52 OOP_ReleaseAttrBasesArray(&LIBBASE->lsd.gfxAttrBase, abd);
54 if (LIBBASE->lsd.unixio)
55 OOP_DisposeObject(LIBBASE->lsd.unixio);
57 return TRUE;
60 ADD2INITLIB(Init_Hidd, 1)
61 ADD2EXPUNGELIB(Expunge_Hidd, 1)