2 Copyright © 1995-2019, The AROS Development Team. All rights reserved.
7 #include <aros/debug.h>
9 #include <aros/symbolsets.h>
10 #include <proto/oop.h>
12 #include <hidd/hidd.h>
13 #include <hidd/mouse.h>
20 static int AmigaMouse_Init(struct mousebase
*LIBBASE
)
22 struct mouse_staticdata
*msd
= &LIBBASE
->msd
;
23 struct OOP_ABDescr attrbases
[] =
25 { IID_Hidd
, &HiddAttrBase
},
26 { IID_Hidd_Mouse
, &HiddMouseAB
},
30 OOP_Object
*drv
= NULL
;
32 EnterFunc(bug("AmigaMouse_Init\n"));
34 InitSemaphore(&msd
->sema
);
36 ms
= OOP_NewObject(NULL
, CLID_Hidd_Mouse
, NULL
);
38 if (OOP_ObtainAttrBases(attrbases
))
40 HiddMouseBase
= OOP_GetMethodID(IID_Hidd_Mouse
, 0);
41 drv
= HIDD_Mouse_AddHardwareDriver(ms
, LIBBASE
->msd
.mouseclass
, NULL
);
43 OOP_DisposeObject(ms
);
49 LIBBASE
->library
.lib_OpenCnt
= 1;
51 ReturnInt("AmigaMouse_Init", int, TRUE
);
54 static int AmigaMouse_Expunge(struct mousebase
*LIBBASE
)
56 struct mouse_staticdata
*msd
= &LIBBASE
->msd
;
57 struct OOP_ABDescr attrbases
[] =
59 { IID_Hidd
, &HiddAttrBase
},
60 { IID_Hidd_Mouse
, &HiddMouseAB
},
64 EnterFunc(bug("AmigaMouse_Expunge\n"));
66 OOP_ReleaseAttrBases(attrbases
);
68 ReturnInt("AmigaMouse_Expunge", int, TRUE
);
71 ADD2INITLIB( AmigaMouse_Init
, 0)
72 ADD2EXPUNGELIB(AmigaMouse_Expunge
, 0)