2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <exec/types.h>
9 #include <exec/lists.h>
10 #include <exec/interrupts.h>
11 #include <proto/exec.h>
12 #include <proto/oop.h>
14 #include <utility/utility.h>
16 #include "touchscreen.h"
19 //#define SysBase (*(struct ExecBase **)4UL)
20 //#define SysBase (LC_SYSBASE_FIELD(lh))
22 /* Customize libheader.c */
23 #define LC_SYSBASE_FIELD(lib) (((LIBBASETYPEPTR )(lib))->sysbase)
24 #define LC_SEGLIST_FIELD(lib) (((LIBBASETYPEPTR )(lib))->seglist)
25 #define LC_RESIDENTNAME touchscreenHidd_resident
26 #define LC_RESIDENTFLAGS RTF_AUTOINIT|RTF_COLDSTART
27 #define LC_RESIDENTPRI 9
28 #define LC_LIBBASESIZE sizeof(LIBBASETYPE)
29 #define LC_LIBHEADERTYPEPTR LIBBASETYPEPTR
30 #define LC_LIB_FIELD(lib) (((LIBBASETYPEPTR)(lib))->library)
33 #define LC_NO_EXPUNGELIB
34 #define LC_NO_CLOSELIB
39 struct touchscreenbase
41 struct Library library
;
42 struct ExecBase
*sysbase
;
46 #include <libcore/libheader.c>
51 #include <aros/debug.h>
53 #define SysBase (LC_SYSBASE_FIELD(lh))
55 ULONG SAVEDS STDARGS
LC_BUILDNAME(L_OpenLib
) (LC_LIBHEADERTYPEPTR lh
)
57 struct mouse_staticdata
*tsd
;
59 D(bug("_touchscreen: Initializing\n"));
61 tsd
= AllocMem( sizeof (struct mouse_staticdata
), MEMF_CLEAR
|MEMF_PUBLIC
);
63 InitSemaphore(&tsd
->sema
);
64 tsd
->sysbase
= SysBase
;
65 tsd
->oopbase
= OpenLibrary(AROSOOP_NAME
, 0);
67 tsd
->utilitybase
= OpenLibrary(UTILITYNAME
, 37);
68 if (tsd
->utilitybase
) {
69 if (_init_mouseclass(tsd
)) {
70 D(bug("----------- Successfully initialized mouseclass!\n"));
74 CloseLibrary(tsd
->oopbase
);
76 FreeMem(tsd
, sizeof (struct mouse_staticdata
));