1 /* DirectInput Joystick device
3 * Copyright 1998 Marcus Meissner
4 * Copyright 1998,1999 Lionel Ulmer
5 * Copyright 2000-2001 TransGaming Technologies Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
29 #include "wine/port.h"
38 #ifdef HAVE_SYS_TIME_H
39 # include <sys/time.h>
42 #ifdef HAVE_SYS_IOCTL_H
43 # include <sys/ioctl.h>
46 #ifdef HAVE_SYS_ERRNO_H
47 # include <sys/errno.h>
49 #ifdef HAVE_LINUX_IOCTL_H
50 # include <linux/ioctl.h>
52 #ifdef HAVE_LINUX_JOYSTICK_H
53 # include <linux/joystick.h>
56 #ifdef HAVE_SYS_POLL_H
57 # include <sys/poll.h>
60 #include "wine/debug.h"
61 #include "wine/unicode.h"
67 #include "dinput_private.h"
68 #include "device_private.h"
69 #include "joystick_private.h"
71 WINE_DEFAULT_DEBUG_CHANNEL(dinput);
73 #ifdef HAVE_LINUX_22_JOYSTICK_API
75 #define JOYDEV_NEW "/dev/input/js"
76 #define JOYDEV_OLD "/dev/js"
80 char device[MAX_PATH];
83 BYTE dev_axes_map[ABS_MAX + 1];
87 typedef struct JoystickImpl JoystickImpl;
88 static const IDirectInputDevice8AVtbl JoystickAvt;
89 static const IDirectInputDevice8WVtbl JoystickWvt;
92 struct JoystickGenericImpl generic;
94 struct JoyDev *joydev;
96 /* joystick private */
101 static const GUID DInput_Wine_Joystick_GUID = { /* 9e573ed9-7734-11d2-8d4a-23903fb6bdf7 */
105 {0x8d, 0x4a, 0x23, 0x90, 0x3f, 0xb6, 0xbd, 0xf7}
108 #define MAX_JOYSTICKS 64
109 static INT joystick_devices_count = -1;
110 static struct JoyDev *joystick_devices;
112 static void joy_polldev(JoystickGenericImpl *This);
114 static INT find_joystick_devices(void)
118 if (joystick_devices_count != -1) return joystick_devices_count;
120 joystick_devices_count = 0;
121 for (i = 0; i < MAX_JOYSTICKS; i++)
124 struct JoyDev joydev, *new_joydevs;
126 snprintf(joydev.device, sizeof(joydev.device), "%s%d", JOYDEV_NEW, i);
127 if ((fd = open(joydev.device, O_RDONLY)) < 0)
129 snprintf(joydev.device, sizeof(joydev.device), "%s%d", JOYDEV_OLD, i);
130 if ((fd = open(joydev.device, O_RDONLY)) < 0) continue;
133 strcpy(joydev.name, "Wine Joystick");
134 #if defined(JSIOCGNAME)
135 if (ioctl(fd, JSIOCGNAME(sizeof(joydev.name)), joydev.name) < 0)
136 WARN("ioctl(%s,JSIOCGNAME) failed: %s\n", joydev.device, strerror(errno));
139 if (ioctl(fd, JSIOCGAXMAP, joydev.dev_axes_map) < 0)
141 WARN("ioctl(%s,JSIOCGNAME) failed: %s\n", joydev.device, strerror(errno));
142 joydev.have_axes_map = 0;
147 joydev.have_axes_map = 1;
149 /* Remap to DI numbers */
150 for (j = 0; j < ABS_MAX; j++)
151 if (joydev.dev_axes_map[j] < 8)
152 /* Axis match 1-to-1 */
153 joydev.dev_axes_map[j] = j;
154 else if (joydev.dev_axes_map[j] == 16 ||
155 joydev.dev_axes_map[j] == 17)
157 joydev.dev_axes_map[j] = 8;
159 joydev.dev_axes_map[j] = -1;
164 if (!joystick_devices_count)
165 new_joydevs = HeapAlloc(GetProcessHeap(), 0, sizeof(struct JoyDev));
167 new_joydevs = HeapReAlloc(GetProcessHeap(), 0, joystick_devices,
168 (joystick_devices_count + 1) * sizeof(struct JoyDev));
169 if (!new_joydevs) continue;
171 joystick_devices = new_joydevs;
172 joystick_devices[joystick_devices_count++] = joydev;
175 return joystick_devices_count;
178 static BOOL joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id)
182 if (id >= find_joystick_devices()) return FALSE;
184 if (dwFlags & DIEDFL_FORCEFEEDBACK) {
185 WARN("force feedback not supported\n");
189 if ((dwDevType == 0) ||
190 ((dwDevType == DIDEVTYPE_JOYSTICK) && (version > 0x0300 && version < 0x0800)) ||
191 (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 0x0800))) {
192 /* check whether we have a joystick */
193 if ((fd = open(joystick_devices[id].device, O_RDONLY)) < 0)
195 WARN("open(%s, O_RDONLY) failed: %s\n", joystick_devices[id].name, strerror(errno));
199 /* Return joystick */
200 lpddi->guidInstance = DInput_Wine_Joystick_GUID;
201 lpddi->guidInstance.Data3 = id;
202 lpddi->guidProduct = DInput_Wine_Joystick_GUID;
203 /* we only support traditional joysticks for now */
204 if (version >= 0x0800)
205 lpddi->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
207 lpddi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
209 strcpy(lpddi->tszInstanceName, joystick_devices[id].name);
210 strcpy(lpddi->tszProductName, joystick_devices[id].name);
212 lpddi->guidFFDriver = GUID_NULL;
214 TRACE("Enumerating the linux Joystick device: %s (%s)\n", joystick_devices[id].device, lpddi->tszProductName);
221 static BOOL joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, DWORD version, int id)
225 if (id >= find_joystick_devices()) return FALSE;
227 if (dwFlags & DIEDFL_FORCEFEEDBACK) {
228 WARN("force feedback not supported\n");
232 if ((dwDevType == 0) ||
233 ((dwDevType == DIDEVTYPE_JOYSTICK) && (version > 0x0300 && version < 0x0800)) ||
234 (((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 0x0800))) {
235 /* check whether we have a joystick */
236 if ((fd = open(joystick_devices[id].device, O_RDONLY)) < 0)
238 WARN("open(%s,O_RDONLY) failed: %s\n", joystick_devices[id].device, strerror(errno));
242 /* Return joystick */
243 lpddi->guidInstance = DInput_Wine_Joystick_GUID;
244 lpddi->guidInstance.Data3 = id;
245 lpddi->guidProduct = DInput_Wine_Joystick_GUID;
246 /* we only support traditional joysticks for now */
247 if (version >= 0x0800)
248 lpddi->dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
250 lpddi->dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
252 MultiByteToWideChar(CP_ACP, 0, joystick_devices[id].name, -1, lpddi->tszInstanceName, MAX_PATH);
253 MultiByteToWideChar(CP_ACP, 0, joystick_devices[id].name, -1, lpddi->tszProductName, MAX_PATH);
254 lpddi->guidFFDriver = GUID_NULL;
256 TRACE("Enumerating the linux Joystick device: %s (%s)\n", joystick_devices[id].device, joystick_devices[id].name);
263 static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *dinput,
264 LPDIRECTINPUTDEVICEA* pdev, unsigned short index)
267 JoystickImpl* newDevice;
269 LPDIDATAFORMAT df = NULL;
272 TRACE("%s %p %p %p %hu\n", debugstr_guid(rguid), jvt, dinput, pdev, index);
274 newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(JoystickImpl));
275 if (newDevice == 0) {
276 WARN("out of memory\n");
278 return DIERR_OUTOFMEMORY;
281 newDevice->joydev = &joystick_devices[index];
282 if ((newDevice->joyfd = open(newDevice->joydev->device, O_RDONLY)) < 0)
284 WARN("open(%s, O_RDONLY) failed: %s\n", newDevice->joydev->device, strerror(errno));
285 HeapFree(GetProcessHeap(), 0, newDevice);
286 return DIERR_DEVICENOTREG;
289 newDevice->generic.guidInstance = DInput_Wine_Joystick_GUID;
290 newDevice->generic.guidInstance.Data3 = index;
291 newDevice->generic.guidProduct = DInput_Wine_Joystick_GUID;
292 newDevice->generic.joy_polldev = joy_polldev;
293 newDevice->generic.name = newDevice->joydev->name;
296 if (ioctl(newDevice->joyfd, JSIOCGAXES, &newDevice->generic.device_axis_count) < 0) {
297 WARN("ioctl(%s,JSIOCGAXES) failed: %s, defauting to 2\n", newDevice->joydev->device, strerror(errno));
298 newDevice->generic.device_axis_count = 2;
302 if (ioctl(newDevice->joyfd, JSIOCGBUTTONS, &newDevice->generic.devcaps.dwButtons) < 0) {
303 WARN("ioctl(%s,JSIOCGBUTTONS) failed: %s, defauting to 2\n", newDevice->joydev->device, strerror(errno));
304 newDevice->generic.devcaps.dwButtons = 2;
308 if (newDevice->generic.devcaps.dwButtons > 128)
310 WARN("Can't support %d buttons. Clamping down to 128\n", newDevice->generic.devcaps.dwButtons);
311 newDevice->generic.devcaps.dwButtons = 128;
314 newDevice->generic.base.lpVtbl = jvt;
315 newDevice->generic.base.ref = 1;
316 newDevice->generic.base.dinput = dinput;
317 newDevice->generic.base.guid = *rguid;
318 InitializeCriticalSection(&newDevice->generic.base.crit);
319 newDevice->generic.base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": JoystickImpl*->generic.base.crit");
321 /* setup_dinput_options may change these */
322 newDevice->generic.deadzone = 0;
324 /* do any user specified configuration */
325 hr = setup_dinput_options(&newDevice->generic, newDevice->joydev->have_axes_map ?
326 newDevice->joydev->dev_axes_map : NULL);
330 /* Create copy of default data format */
331 if (!(df = HeapAlloc(GetProcessHeap(), 0, c_dfDIJoystick2.dwSize))) goto FAILED;
332 memcpy(df, &c_dfDIJoystick2, c_dfDIJoystick2.dwSize);
334 df->dwNumObjs = newDevice->generic.devcaps.dwAxes + newDevice->generic.devcaps.dwPOVs + newDevice->generic.devcaps.dwButtons;
335 if (!(df->rgodf = HeapAlloc(GetProcessHeap(), 0, df->dwNumObjs * df->dwObjSize))) goto FAILED;
337 for (i = 0; i < newDevice->generic.device_axis_count; i++)
339 int wine_obj = newDevice->generic.axis_map[i];
341 if (wine_obj < 0) continue;
343 memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[wine_obj], df->dwObjSize);
345 df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(wine_obj) | DIDFT_ABSAXIS;
348 df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(wine_obj - 8) | DIDFT_POV;
349 i++; /* POV takes 2 axes */
352 for (i = 0; i < newDevice->generic.devcaps.dwButtons; i++)
354 memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[i + 12], df->dwObjSize);
355 df->rgodf[idx ].pguid = &GUID_Button;
356 df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_PSHBUTTON;
358 newDevice->generic.base.data_format.wine_df = df;
360 /* initialize default properties */
361 for (i = 0; i < c_dfDIJoystick2.dwNumObjs; i++) {
362 newDevice->generic.props[i].lDevMin = -32767;
363 newDevice->generic.props[i].lDevMax = +32767;
364 newDevice->generic.props[i].lMin = 0;
365 newDevice->generic.props[i].lMax = 0xffff;
366 newDevice->generic.props[i].lDeadZone = newDevice->generic.deadzone; /* % * 1000 */
367 newDevice->generic.props[i].lSaturation = 0;
370 IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->generic.base.dinput);
372 newDevice->generic.devcaps.dwSize = sizeof(newDevice->generic.devcaps);
373 newDevice->generic.devcaps.dwFlags = DIDC_ATTACHED;
374 if (newDevice->generic.base.dinput->dwVersion >= 0x0800)
375 newDevice->generic.devcaps.dwDevType = DI8DEVTYPE_JOYSTICK | (DI8DEVTYPEJOYSTICK_STANDARD << 8);
377 newDevice->generic.devcaps.dwDevType = DIDEVTYPE_JOYSTICK | (DIDEVTYPEJOYSTICK_TRADITIONAL << 8);
378 newDevice->generic.devcaps.dwFFSamplePeriod = 0;
379 newDevice->generic.devcaps.dwFFMinTimeResolution = 0;
380 newDevice->generic.devcaps.dwFirmwareRevision = 0;
381 newDevice->generic.devcaps.dwHardwareRevision = 0;
382 newDevice->generic.devcaps.dwFFDriverVersion = 0;
384 if (TRACE_ON(dinput)) {
385 _dump_DIDATAFORMAT(newDevice->generic.base.data_format.wine_df);
386 for (i = 0; i < (newDevice->generic.device_axis_count); i++)
387 TRACE("axis_map[%d] = %d\n", i, newDevice->generic.axis_map[i]);
388 _dump_DIDEVCAPS(&newDevice->generic.devcaps);
391 *pdev = (LPDIRECTINPUTDEVICEA)newDevice;
396 hr = DIERR_OUTOFMEMORY;
398 if (df) HeapFree(GetProcessHeap(), 0, df->rgodf);
399 HeapFree(GetProcessHeap(), 0, df);
400 release_DataFormat(&newDevice->generic.base.data_format);
401 HeapFree(GetProcessHeap(),0,newDevice->generic.axis_map);
402 HeapFree(GetProcessHeap(),0,newDevice);
408 /******************************************************************************
409 * get_joystick_index : Get the joystick index from a given GUID
411 static unsigned short get_joystick_index(REFGUID guid)
413 GUID wine_joystick = DInput_Wine_Joystick_GUID;
414 GUID dev_guid = *guid;
416 wine_joystick.Data3 = 0;
419 /* for the standard joystick GUID use index 0 */
420 if(IsEqualGUID(&GUID_Joystick,guid)) return 0;
422 /* for the wine joystick GUIDs use the index stored in Data3 */
423 if(IsEqualGUID(&wine_joystick, &dev_guid)) return guid->Data3;
425 return MAX_JOYSTICKS;
428 static HRESULT joydev_create_deviceA(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* pdev)
430 unsigned short index;
432 TRACE("%p %s %p %p\n",dinput, debugstr_guid(rguid), riid, pdev);
433 find_joystick_devices();
436 if ((index = get_joystick_index(rguid)) < MAX_JOYSTICKS &&
437 joystick_devices_count && index < joystick_devices_count)
439 if ((riid == NULL) ||
440 IsEqualGUID(&IID_IDirectInputDeviceA, riid) ||
441 IsEqualGUID(&IID_IDirectInputDevice2A, riid) ||
442 IsEqualGUID(&IID_IDirectInputDevice7A, riid) ||
443 IsEqualGUID(&IID_IDirectInputDevice8A, riid))
445 return alloc_device(rguid, &JoystickAvt, dinput, pdev, index);
448 WARN("no interface\n");
449 return DIERR_NOINTERFACE;
452 return DIERR_DEVICENOTREG;
455 static HRESULT joydev_create_deviceW(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEW* pdev)
457 unsigned short index;
459 TRACE("%p %s %p %p\n",dinput, debugstr_guid(rguid), riid, pdev);
460 find_joystick_devices();
463 if ((index = get_joystick_index(rguid)) < MAX_JOYSTICKS &&
464 joystick_devices_count && index < joystick_devices_count)
466 if ((riid == NULL) ||
467 IsEqualGUID(&IID_IDirectInputDeviceW, riid) ||
468 IsEqualGUID(&IID_IDirectInputDevice2W, riid) ||
469 IsEqualGUID(&IID_IDirectInputDevice7W, riid) ||
470 IsEqualGUID(&IID_IDirectInputDevice8W, riid))
472 return alloc_device(rguid, &JoystickWvt, dinput, (LPDIRECTINPUTDEVICEA *)pdev, index);
474 WARN("no interface\n");
475 return DIERR_NOINTERFACE;
478 WARN("invalid device GUID %s\n",debugstr_guid(rguid));
479 return DIERR_DEVICENOTREG;
484 const struct dinput_device joystick_linux_device = {
485 "Wine Linux joystick driver",
488 joydev_create_deviceA,
489 joydev_create_deviceW
492 /******************************************************************************
493 * Acquire : gets exclusive control of the joystick
495 static HRESULT WINAPI JoystickLinuxAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
497 JoystickImpl *This = (JoystickImpl *)iface;
500 TRACE("(%p)\n",This);
502 res = IDirectInputDevice2AImpl_Acquire(iface);
506 /* open the joystick device */
507 if (This->joyfd==-1) {
508 TRACE("opening joystick device %s\n", This->joydev->device);
510 This->joyfd = open(This->joydev->device, O_RDONLY);
511 if (This->joyfd==-1) {
512 ERR("open(%s) failed: %s\n", This->joydev->device, strerror(errno));
513 IDirectInputDevice2AImpl_Unacquire(iface);
514 return DIERR_NOTFOUND;
521 /******************************************************************************
522 * Unacquire : frees the joystick
524 static HRESULT WINAPI JoystickLinuxAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
526 JoystickImpl *This = (JoystickImpl *)iface;
529 TRACE("(%p)\n",This);
531 res = IDirectInputDevice2AImpl_Unacquire(iface);
536 if (This->joyfd!=-1) {
537 TRACE("closing joystick device\n");
546 static void joy_polldev(JoystickGenericImpl *This_in) {
549 JoystickImpl *This = (JoystickImpl*) This_in;
551 TRACE("(%p)\n", This);
553 if (This->joyfd==-1) {
562 plfd.fd = This->joyfd;
563 plfd.events = POLLIN;
564 if (poll(&plfd,1,0) != 1)
566 /* we have one event, so we can read */
567 if (sizeof(jse)!=read(This->joyfd,&jse,sizeof(jse))) {
570 TRACE("js_event: type 0x%x, number %d, value %d\n",
571 jse.type,jse.number,jse.value);
572 if (jse.type & JS_EVENT_BUTTON)
574 if (jse.number >= This->generic.devcaps.dwButtons) return;
576 inst_id = DIDFT_MAKEINSTANCE(jse.number) | DIDFT_PSHBUTTON;
577 This->generic.js.rgbButtons[jse.number] = value = jse.value ? 0x80 : 0x00;
579 else if (jse.type & JS_EVENT_AXIS)
581 int number = This->generic.axis_map[jse.number]; /* wine format object index */
583 if (number < 0) return;
584 inst_id = DIDFT_MAKEINSTANCE(number) | (number < 8 ? DIDFT_ABSAXIS : DIDFT_POV);
585 value = joystick_map_axis(&This->generic.props[id_to_object(This->generic.base.data_format.wine_df, inst_id)], jse.value);
587 TRACE("changing axis %d => %d\n", jse.number, number);
590 case 0: This->generic.js.lX = value; break;
591 case 1: This->generic.js.lY = value; break;
592 case 2: This->generic.js.lZ = value; break;
593 case 3: This->generic.js.lRx = value; break;
594 case 4: This->generic.js.lRy = value; break;
595 case 5: This->generic.js.lRz = value; break;
596 case 6: This->generic.js.rglSlider[0] = value; break;
597 case 7: This->generic.js.rglSlider[1] = value; break;
598 case 8: case 9: case 10: case 11:
600 int idx = number - 8;
603 This->povs[idx].y = jse.value;
605 This->povs[idx].x = jse.value;
607 This->generic.js.rgdwPOV[idx] = value = joystick_map_pov(&This->povs[idx]);
611 WARN("axis %d not supported\n", number);
615 queue_event((LPDIRECTINPUTDEVICE8A)This,
616 id_to_offset(&This->generic.base.data_format, inst_id),
617 value, jse.time, This->generic.base.dinput->evsequence++);
621 static const IDirectInputDevice8AVtbl JoystickAvt =
623 IDirectInputDevice2AImpl_QueryInterface,
624 IDirectInputDevice2AImpl_AddRef,
625 IDirectInputDevice2AImpl_Release,
626 JoystickAGenericImpl_GetCapabilities,
627 IDirectInputDevice2AImpl_EnumObjects,
628 JoystickAGenericImpl_GetProperty,
629 JoystickAGenericImpl_SetProperty,
630 JoystickLinuxAImpl_Acquire,
631 JoystickLinuxAImpl_Unacquire,
632 JoystickAGenericImpl_GetDeviceState,
633 IDirectInputDevice2AImpl_GetDeviceData,
634 IDirectInputDevice2AImpl_SetDataFormat,
635 IDirectInputDevice2AImpl_SetEventNotification,
636 IDirectInputDevice2AImpl_SetCooperativeLevel,
637 JoystickAGenericImpl_GetObjectInfo,
638 JoystickAGenericImpl_GetDeviceInfo,
639 IDirectInputDevice2AImpl_RunControlPanel,
640 IDirectInputDevice2AImpl_Initialize,
641 IDirectInputDevice2AImpl_CreateEffect,
642 IDirectInputDevice2AImpl_EnumEffects,
643 IDirectInputDevice2AImpl_GetEffectInfo,
644 IDirectInputDevice2AImpl_GetForceFeedbackState,
645 IDirectInputDevice2AImpl_SendForceFeedbackCommand,
646 IDirectInputDevice2AImpl_EnumCreatedEffectObjects,
647 IDirectInputDevice2AImpl_Escape,
648 JoystickAGenericImpl_Poll,
649 IDirectInputDevice2AImpl_SendDeviceData,
650 IDirectInputDevice7AImpl_EnumEffectsInFile,
651 IDirectInputDevice7AImpl_WriteEffectToFile,
652 IDirectInputDevice8AImpl_BuildActionMap,
653 IDirectInputDevice8AImpl_SetActionMap,
654 IDirectInputDevice8AImpl_GetImageInfo
657 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
658 # define XCAST(fun) (typeof(JoystickWvt.fun))
660 # define XCAST(fun) (void*)
663 static const IDirectInputDevice8WVtbl JoystickWvt =
665 IDirectInputDevice2WImpl_QueryInterface,
666 XCAST(AddRef)IDirectInputDevice2AImpl_AddRef,
667 XCAST(Release)IDirectInputDevice2AImpl_Release,
668 XCAST(GetCapabilities)JoystickAGenericImpl_GetCapabilities,
669 IDirectInputDevice2WImpl_EnumObjects,
670 XCAST(GetProperty)JoystickAGenericImpl_GetProperty,
671 XCAST(SetProperty)JoystickAGenericImpl_SetProperty,
672 XCAST(Acquire)JoystickLinuxAImpl_Acquire,
673 XCAST(Unacquire)JoystickLinuxAImpl_Unacquire,
674 XCAST(GetDeviceState)JoystickAGenericImpl_GetDeviceState,
675 XCAST(GetDeviceData)IDirectInputDevice2AImpl_GetDeviceData,
676 XCAST(SetDataFormat)IDirectInputDevice2AImpl_SetDataFormat,
677 XCAST(SetEventNotification)IDirectInputDevice2AImpl_SetEventNotification,
678 XCAST(SetCooperativeLevel)IDirectInputDevice2AImpl_SetCooperativeLevel,
679 JoystickWGenericImpl_GetObjectInfo,
680 JoystickWGenericImpl_GetDeviceInfo,
681 XCAST(RunControlPanel)IDirectInputDevice2AImpl_RunControlPanel,
682 XCAST(Initialize)IDirectInputDevice2AImpl_Initialize,
683 XCAST(CreateEffect)IDirectInputDevice2AImpl_CreateEffect,
684 IDirectInputDevice2WImpl_EnumEffects,
685 IDirectInputDevice2WImpl_GetEffectInfo,
686 XCAST(GetForceFeedbackState)IDirectInputDevice2AImpl_GetForceFeedbackState,
687 XCAST(SendForceFeedbackCommand)IDirectInputDevice2AImpl_SendForceFeedbackCommand,
688 XCAST(EnumCreatedEffectObjects)IDirectInputDevice2AImpl_EnumCreatedEffectObjects,
689 XCAST(Escape)IDirectInputDevice2AImpl_Escape,
690 XCAST(Poll)JoystickAGenericImpl_Poll,
691 XCAST(SendDeviceData)IDirectInputDevice2AImpl_SendDeviceData,
692 IDirectInputDevice7WImpl_EnumEffectsInFile,
693 IDirectInputDevice7WImpl_WriteEffectToFile,
694 IDirectInputDevice8WImpl_BuildActionMap,
695 IDirectInputDevice8WImpl_SetActionMap,
696 IDirectInputDevice8WImpl_GetImageInfo
700 #else /* HAVE_LINUX_22_JOYSTICK_API */
702 const struct dinput_device joystick_linux_device = {
703 "Wine Linux joystick driver",
710 #endif /* HAVE_LINUX_22_JOYSTICK_API */