Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
7123d5a0
Commit
7123d5a0
authored
Sep 24, 2007
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Sep 25, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement GetDeviceInfo for evdev joystick.
parent
ac3668a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
83 additions
and
24 deletions
+83
-24
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+83
-24
No files found.
dlls/dinput/joystick_linuxinput.c
View file @
7123d5a0
...
...
@@ -317,6 +317,48 @@ static void find_joydevs(void)
}
}
static
void
fill_joystick_dideviceinstanceA
(
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
)
{
DWORD
dwSize
=
lpddi
->
dwSize
;
TRACE
(
"%d %p
\n
"
,
dwSize
,
lpddi
);
memset
(
lpddi
,
0
,
dwSize
);
lpddi
->
dwSize
=
dwSize
;
lpddi
->
guidInstance
=
joydevs
[
id
].
guid
;
lpddi
->
guidProduct
=
DInput_Wine_Joystick_Base_GUID
;
lpddi
->
guidFFDriver
=
GUID_NULL
;
if
(
version
>=
0x0800
)
lpddi
->
dwDevType
=
DI8DEVTYPE_JOYSTICK
|
(
DI8DEVTYPEJOYSTICK_STANDARD
<<
8
);
else
lpddi
->
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
strcpy
(
lpddi
->
tszInstanceName
,
joydevs
[
id
].
name
);
strcpy
(
lpddi
->
tszProductName
,
joydevs
[
id
].
device
);
}
static
void
fill_joystick_dideviceinstanceW
(
LPDIDEVICEINSTANCEW
lpddi
,
DWORD
version
,
int
id
)
{
DWORD
dwSize
=
lpddi
->
dwSize
;
TRACE
(
"%d %p
\n
"
,
dwSize
,
lpddi
);
memset
(
lpddi
,
0
,
dwSize
);
lpddi
->
dwSize
=
dwSize
;
lpddi
->
guidInstance
=
joydevs
[
id
].
guid
;
lpddi
->
guidProduct
=
DInput_Wine_Joystick_Base_GUID
;
lpddi
->
guidFFDriver
=
GUID_NULL
;
if
(
version
>=
0x0800
)
lpddi
->
dwDevType
=
DI8DEVTYPE_JOYSTICK
|
(
DI8DEVTYPEJOYSTICK_STANDARD
<<
8
);
else
lpddi
->
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
MultiByteToWideChar
(
CP_ACP
,
0
,
joydevs
[
id
].
name
,
-
1
,
lpddi
->
tszInstanceName
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
joydevs
[
id
].
device
,
-
1
,
lpddi
->
tszProductName
,
MAX_PATH
);
}
static
BOOL
joydev_enum_deviceA
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
,
DWORD
version
,
int
id
)
{
find_joydevs
();
...
...
@@ -336,17 +378,7 @@ static BOOL joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
#endif
if
(
!
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
||
joydevs
[
id
].
has_ff
)
{
lpddi
->
guidInstance
=
joydevs
[
id
].
guid
;
lpddi
->
guidProduct
=
DInput_Wine_Joystick_Base_GUID
;
lpddi
->
guidFFDriver
=
GUID_NULL
;
if
(
version
>=
0x0800
)
lpddi
->
dwDevType
=
DI8DEVTYPE_JOYSTICK
|
(
DI8DEVTYPEJOYSTICK_STANDARD
<<
8
);
else
lpddi
->
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
strcpy
(
lpddi
->
tszInstanceName
,
joydevs
[
id
].
name
);
strcpy
(
lpddi
->
tszProductName
,
joydevs
[
id
].
device
);
fill_joystick_dideviceinstanceA
(
lpddi
,
version
,
id
);
return
TRUE
;
}
return
FALSE
;
...
...
@@ -371,17 +403,7 @@ static BOOL joydev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
#endif
if
(
!
(
dwFlags
&
DIEDFL_FORCEFEEDBACK
)
||
joydevs
[
id
].
has_ff
)
{
lpddi
->
guidInstance
=
joydevs
[
id
].
guid
;
lpddi
->
guidProduct
=
DInput_Wine_Joystick_Base_GUID
;
lpddi
->
guidFFDriver
=
GUID_NULL
;
if
(
version
>=
0x0800
)
lpddi
->
dwDevType
=
DI8DEVTYPE_JOYSTICK
|
(
DI8DEVTYPEJOYSTICK_STANDARD
<<
8
);
else
lpddi
->
dwDevType
=
DIDEVTYPE_JOYSTICK
|
(
DIDEVTYPEJOYSTICK_TRADITIONAL
<<
8
);
MultiByteToWideChar
(
CP_ACP
,
0
,
joydevs
[
id
].
name
,
-
1
,
lpddi
->
tszInstanceName
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
joydevs
[
id
].
device
,
-
1
,
lpddi
->
tszProductName
,
MAX_PATH
);
fill_joystick_dideviceinstanceW
(
lpddi
,
version
,
id
);
return
TRUE
;
}
return
FALSE
;
...
...
@@ -1325,6 +1347,43 @@ static HRESULT WINAPI JoystickAImpl_EnumCreatedEffectObjects(
return
DI_OK
;
}
/******************************************************************************
* GetDeviceInfo : get information about a device's identity
*/
static
HRESULT
WINAPI
JoystickAImpl_GetDeviceInfo
(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIDEVICEINSTANCEA
pdidi
)
{
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
TRACE
(
"(%p) %p
\n
"
,
This
,
pdidi
);
if
(
pdidi
==
NULL
)
return
E_POINTER
;
if
((
pdidi
->
dwSize
!=
sizeof
(
DIDEVICEINSTANCE_DX3A
))
&&
(
pdidi
->
dwSize
!=
sizeof
(
DIDEVICEINSTANCEA
)))
return
DIERR_INVALIDPARAM
;
fill_joystick_dideviceinstanceA
(
pdidi
,
This
->
base
.
dinput
->
dwVersion
,
get_joystick_index
(
&
This
->
base
.
guid
));
return
DI_OK
;
}
static
HRESULT
WINAPI
JoystickWImpl_GetDeviceInfo
(
LPDIRECTINPUTDEVICE8W
iface
,
LPDIDEVICEINSTANCEW
pdidi
)
{
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
TRACE
(
"(%p) %p
\n
"
,
This
,
pdidi
);
if
(
pdidi
==
NULL
)
return
E_POINTER
;
if
((
pdidi
->
dwSize
!=
sizeof
(
DIDEVICEINSTANCE_DX3W
))
&&
(
pdidi
->
dwSize
!=
sizeof
(
DIDEVICEINSTANCEW
)))
return
DIERR_INVALIDPARAM
;
fill_joystick_dideviceinstanceW
(
pdidi
,
This
->
base
.
dinput
->
dwVersion
,
get_joystick_index
(
&
This
->
base
.
guid
));
return
DI_OK
;
}
static
const
IDirectInputDevice8AVtbl
JoystickAvt
=
{
IDirectInputDevice2AImpl_QueryInterface
,
...
...
@@ -1342,7 +1401,7 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
IDirectInputDevice2AImpl_SetEventNotification
,
IDirectInputDevice2AImpl_SetCooperativeLevel
,
JoystickAImpl_GetObjectInfo
,
IDirectInputDevice2
AImpl_GetDeviceInfo
,
Joystick
AImpl_GetDeviceInfo
,
IDirectInputDevice2AImpl_RunControlPanel
,
IDirectInputDevice2AImpl_Initialize
,
JoystickAImpl_CreateEffect
,
...
...
@@ -1384,7 +1443,7 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
XCAST
(
SetEventNotification
)
IDirectInputDevice2AImpl_SetEventNotification
,
XCAST
(
SetCooperativeLevel
)
IDirectInputDevice2AImpl_SetCooperativeLevel
,
JoystickWImpl_GetObjectInfo
,
IDirectInputDevice2
WImpl_GetDeviceInfo
,
Joystick
WImpl_GetDeviceInfo
,
XCAST
(
RunControlPanel
)
IDirectInputDevice2AImpl_RunControlPanel
,
XCAST
(
Initialize
)
IDirectInputDevice2AImpl_Initialize
,
XCAST
(
CreateEffect
)
JoystickAImpl_CreateEffect
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment