5 *----------------------------------------------------------------------------
6 * Includes for HID class
7 *----------------------------------------------------------------------------
8 * By Chris Hodges <chrisly@platon42.de>
13 #include <devices/rawkeycodes.h>
15 #include <datatypes/soundclass.h>
17 #include <intuition/intuitionbase.h>
18 #include <libraries/gadtools.h>
19 #include <libraries/asl.h>
20 #include <libraries/lowlevel_ext.h>
21 #include <graphics/layers.h>
23 #include <devices/usb_hid.h>
34 struct NepClassHid
* GM_UNIQUENAME(usbAttemptInterfaceBinding
)(struct NepHidBase
*nh
, struct PsdInterface
*pif
);
35 struct NepClassHid
* GM_UNIQUENAME(usbForceInterfaceBinding
)(struct NepHidBase
*nh
, struct PsdInterface
*pif
);
36 void GM_UNIQUENAME(usbReleaseInterfaceBinding
)(struct NepHidBase
*nh
, struct NepClassHid
*nch
);
38 extern UBYTE usbkeymap
[];
40 BOOL
GM_UNIQUENAME(nLoadClassConfig
)(struct NepHidBase
*nh
);
41 BOOL
GM_UNIQUENAME(nLoadBindingConfig
)(struct NepClassHid
*nch
, BOOL gui
);
42 LONG
GM_UNIQUENAME(nOpenBindingCfgWindow
)(struct NepHidBase
*nh
, struct NepClassHid
*nch
);
44 void nInstallLLPatch(struct NepHidBase
*nh
);
45 struct NepClassHid
* GM_UNIQUENAME(nAllocHid
)(void);
46 void GM_UNIQUENAME(nFreeHid
)(struct NepClassHid
*nch
);
48 struct NepHidItem
* nFindItemID(struct NepClassHid
*nch
, UWORD id
, UWORD itype
, ULONG
*pos
);
49 UWORD
nFindItemUsage(struct NepClassHid
*nch
, ULONG usage
, UWORD itype
);
50 BOOL
nFindCollID(struct NepClassHid
*nch
, struct NepHidCollection
*nhc
, ULONG collidmin
, ULONG collidmax
);
51 BOOL
nDetectDefaultAction(struct NepClassHid
*nch
, struct NepHidItem
*nhi
, struct List
*lst
, struct NepHidCollection
*nhc
, ULONG uid
);
52 BOOL
nCheckForDefaultAction(struct NepClassHid
*nch
, struct NepHidItem
*nhi
, struct List
*lst
, struct NepHidCollection
*nhc
, ULONG uid
);
53 struct NepHidAction
* nAllocAction(struct NepClassHid
*nch
, struct List
*lst
, UWORD utype
);
55 void nCheckReset(struct NepClassHid
*nch
);
57 BOOL
nProcessItem(struct NepClassHid
*nch
, struct NepHidItem
*nhi
, UBYTE
*buf
);
58 BOOL
nDoAction(struct NepClassHid
*nch
, struct NepHidAction
*nha
, struct NepHidItem
*nhi
, ULONG uid
, LONG value
, BOOL downevent
);
59 void nFlushEvents(struct NepClassHid
*nch
);
60 STRPTR
nGetUsageName(struct NepClassHid
*nch
, ULONG uid
);
61 void nCleanCollection(struct NepClassHid
*nch
, struct NepHidCollection
*nhc
);
62 void nSendRawKey(struct NepClassHid
*nch
, UWORD key
);
64 void nFreeReport(struct NepClassHid
*nch
, struct NepHidReport
*nhr
);
65 BOOL
nReadReports(struct NepClassHid
*nch
);
66 BOOL
nParseReport(struct NepClassHid
*nch
, struct NepHidReport
*nhrptr
);
67 void nLoadActionConfig(struct NepClassHid
*nch
);
68 BOOL
nAddExtraReport(struct NepClassHid
*nch
);
70 BOOL
nParseWacom(struct NepClassHid
*nch
, UBYTE
*buf
, ULONG len
);
71 BOOL
nDetectWacom(struct NepClassHid
*nch
);
72 void nQuirkPS3Controller(struct NepClassHid
*nch
);
73 BOOL
nAddUsage(struct NepClassHid
*nch
, struct List
*list
, ULONG umin
, ULONG umax
);
75 void nGenerateOutReport(struct NepClassHid
*nch
, struct NepHidReport
*nhr
, UBYTE
*buf
);
76 void nGenerateFeatReport(struct NepClassHid
*nch
, struct NepHidReport
*nhr
, UBYTE
*buf
);
77 void nEncodeItemBuffer(struct NepClassHid
*nch
, struct NepHidItem
*nhi
, UBYTE
*buf
);
79 void nInstallLastActionHero(struct NepClassHid
*nch
);
81 void GM_UNIQUENAME(nGUITaskCleanup
)(struct NepClassHid
*nch
);
83 struct NepHidGItem
* nAllocGOutItem(struct NepClassHid
*nch
, struct NepHidItem
*nhi
, struct List
*actionlist
, ULONG usageid
);
84 struct NepHidGItem
* nAllocGItem(struct NepClassHid
*nch
, struct NepHidItem
*nhi
, struct List
*actionlist
, ULONG usageid
);
85 void nFreeGItem(struct NepClassHid
*nch
, struct NepHidGItem
*nhgi
);
87 BOOL
nLoadItem(struct NepClassHid
*nch
, struct PsdIFFContext
*rppic
, struct List
*lst
, UWORD idbase
);
88 struct PsdIFFContext
* nSaveItem(struct NepClassHid
*nch
, struct PsdIFFContext
*rppic
, struct List
*lst
, UWORD idbase
);
90 struct InputEvent
*nInvertString(struct NepHidBase
*nh
, STRPTR str
, struct KeyMap
*km
);
91 void nFreeIEvents(struct NepHidBase
*nh
, struct InputEvent
*event
);
92 BOOL
nSendKeyString(struct NepHidBase
*nh
, STRPTR str
);
94 void nLastActionHero(struct NepHidBase
*nh
);
96 void nDebugReport(struct NepClassHid
*nch
, struct NepHidReport
*nhr
);
98 struct NepHidSound
* nLoadSound(struct NepHidBase
*nh
, STRPTR name
);
99 BOOL
nPlaySound(struct NepHidBase
*nh
, struct NepHidAction
*nha
);
100 void nFreeSound(struct NepHidBase
*nh
, struct NepHidSound
*nhs
);
102 LONG
nEasyRequestA(struct NepHidBase
*nh
, STRPTR body
, STRPTR gadgets
, RAWARG params
);
105 LONG
nEasyRequest(struct NepHidBase
*nh
, STRPTR body
, STRPTR gadgets
, ...);
107 AROS_UFP0(void, GM_UNIQUENAME(nHidTask
));
108 AROS_UFP0(void, GM_UNIQUENAME(nGUITask
));
109 AROS_UFP0(void, GM_UNIQUENAME(nHIDCtrlGUITask
));
110 AROS_UFP0(void, GM_UNIQUENAME(nDispatcherTask
));
112 AROS_LD1(ULONG
, nReadJoyPort
,
113 AROS_LDA(ULONG
, port
, D0
),
114 struct Library
*, LowLevelBase
, 5, hid
);
116 AROS_LD2(ULONG
, nSetJoyPortAttrsA
,
117 AROS_LDA(ULONG
, port
, D0
),
118 AROS_LDA(struct TagItem
*, tags
, A1
),
119 struct Library
*, LowLevelBase
, 22, hid
);
121 AROS_UFP3(LONG
, GM_UNIQUENAME(USBKeyListDisplayHook
),
122 AROS_UFPA(struct Hook
*, hook
, A0
),
123 AROS_UFPA(char **, strarr
, A2
),
124 AROS_UFPA(struct HidUsageIDMap
*, hum
, A1
));
126 AROS_UFP3(LONG
, GM_UNIQUENAME(ReportListDisplayHook
),
127 AROS_UFPA(struct Hook
*, hook
, A0
),
128 AROS_UFPA(char **, strarr
, A2
),
129 AROS_UFPA(struct NepHidCollection
*, nhc
, A1
));
131 AROS_UFP3(LONG
, GM_UNIQUENAME(ItemListDisplayHook
),
132 AROS_UFPA(struct Hook
*, hook
, A0
),
133 AROS_UFPA(char **, strarr
, A2
),
134 AROS_UFPA(struct NepHidGItem
*, nhgi
, A1
));
136 AROS_UFP3(LONG
, GM_UNIQUENAME(ActionListDisplayHook
),
137 AROS_UFPA(struct Hook
*, hook
, A0
),
138 AROS_UFPA(char **, strarr
, A2
),
139 AROS_UFPA(struct NepHidAction
*, nha
, A1
));
141 AROS_UFP3(IPTR
, GM_UNIQUENAME(ActionDispatcher
),
142 AROS_UFPA(struct IClass
*, cl
, A0
),
143 AROS_UFPA(Object
*, obj
, A2
),
144 AROS_UFPA(Msg
, msg
, A1
));
146 AROS_UFP3(IPTR
, GM_UNIQUENAME(HCActionDispatcher
),
147 AROS_UFPA(struct IClass
*, cl
, A0
),
148 AROS_UFPA(Object
*, obj
, A2
),
149 AROS_UFPA(Msg
, msg
, A1
));
151 void GM_UNIQUENAME(nHIDCtrlGUITaskCleanup
)(struct NepClassHid
*nch
);
152 struct NepHidGItem
* nAllocGHCItem(struct NepClassHid
*nch
, struct NepHidItem
*nhi
, struct List
*actionlist
, ULONG usageid
);
154 static inline UWORD
GET_WTYPE(struct List
*list
)
156 UWORD
*w
= (UWORD
*)(&list
->lh_Type
);
160 static inline void SET_WTYPE(struct List
*list
, UWORD val
)
162 UWORD
*w
= (UWORD
*)(&list
->lh_Type
);
167 #endif /* HID_CLASS_H */