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
e6a8aa67
Commit
e6a8aa67
authored
Jan 09, 2011
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Jan 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Explicitly define ASCII and Unicode methods in joydev joystick.
parent
d88cbac1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
16 deletions
+29
-16
joystick_linux.c
dlls/dinput/joystick_linux.c
+29
-16
No files found.
dlls/dinput/joystick_linux.c
View file @
e6a8aa67
...
...
@@ -107,6 +107,14 @@ static inline JoystickImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W
{
return
(
JoystickImpl
*
)
iface
;
}
static
inline
IDirectInputDevice8A
*
IDirectInputDevice8A_from_impl
(
JoystickImpl
*
This
)
{
return
(
IDirectInputDevice8A
*
)
This
;
}
static
inline
IDirectInputDevice8W
*
IDirectInputDevice8W_from_impl
(
JoystickImpl
*
This
)
{
return
(
IDirectInputDevice8W
*
)
This
;
}
static
const
GUID
DInput_Wine_Joystick_GUID
=
{
/* 9e573ed9-7734-11d2-8d4a-23903fb6bdf7 */
0x9e573ed9
,
...
...
@@ -502,14 +510,14 @@ const struct dinput_device joystick_linux_device = {
/******************************************************************************
* Acquire : gets exclusive control of the joystick
*/
static
HRESULT
WINAPI
JoystickLinux
AImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
static
HRESULT
WINAPI
JoystickLinux
WImpl_Acquire
(
LPDIRECTINPUTDEVICE8W
iface
)
{
JoystickImpl
*
This
=
impl_from_IDirectInputDevice8
A
(
iface
);
JoystickImpl
*
This
=
impl_from_IDirectInputDevice8
W
(
iface
);
HRESULT
res
;
TRACE
(
"(%p)
\n
"
,
This
);
res
=
IDirectInputDevice2
A
Impl_Acquire
(
iface
);
res
=
IDirectInputDevice2
W
Impl_Acquire
(
iface
);
if
(
res
!=
DI_OK
)
return
res
;
...
...
@@ -520,7 +528,7 @@ static HRESULT WINAPI JoystickLinuxAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
This
->
joyfd
=
open
(
This
->
joydev
->
device
,
O_RDONLY
);
if
(
This
->
joyfd
==-
1
)
{
ERR
(
"open(%s) failed: %s
\n
"
,
This
->
joydev
->
device
,
strerror
(
errno
));
IDirectInputDevice2
A
Impl_Unacquire
(
iface
);
IDirectInputDevice2
W
Impl_Unacquire
(
iface
);
return
DIERR_NOTFOUND
;
}
}
...
...
@@ -528,17 +536,23 @@ static HRESULT WINAPI JoystickLinuxAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
return
DI_OK
;
}
static
HRESULT
WINAPI
JoystickLinuxAImpl_Acquire
(
LPDIRECTINPUTDEVICE8A
iface
)
{
JoystickImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
return
JoystickLinuxWImpl_Acquire
(
IDirectInputDevice8W_from_impl
(
This
));
}
/******************************************************************************
* Unacquire : frees the joystick
*/
static
HRESULT
WINAPI
JoystickLinux
AImpl_Unacquire
(
LPDIRECTINPUTDEVICE8A
iface
)
static
HRESULT
WINAPI
JoystickLinux
WImpl_Unacquire
(
LPDIRECTINPUTDEVICE8W
iface
)
{
JoystickImpl
*
This
=
impl_from_IDirectInputDevice8
A
(
iface
);
JoystickImpl
*
This
=
impl_from_IDirectInputDevice8
W
(
iface
);
HRESULT
res
;
TRACE
(
"(%p)
\n
"
,
This
);
res
=
IDirectInputDevice2
A
Impl_Unacquire
(
iface
);
res
=
IDirectInputDevice2
W
Impl_Unacquire
(
iface
);
if
(
res
!=
DI_OK
)
return
res
;
...
...
@@ -553,6 +567,12 @@ static HRESULT WINAPI JoystickLinuxAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
return
DI_NOEFFECT
;
}
static
HRESULT
WINAPI
JoystickLinuxAImpl_Unacquire
(
LPDIRECTINPUTDEVICE8A
iface
)
{
JoystickImpl
*
This
=
impl_from_IDirectInputDevice8A
(
iface
);
return
JoystickLinuxWImpl_Unacquire
(
IDirectInputDevice8W_from_impl
(
This
));
}
static
void
joy_polldev
(
LPDIRECTINPUTDEVICE8A
iface
)
{
struct
pollfd
plfd
;
...
...
@@ -665,12 +685,6 @@ static const IDirectInputDevice8AVtbl JoystickAvt =
IDirectInputDevice8AImpl_GetImageInfo
};
#if !defined(__STRICT_ANSI__) && defined(__GNUC__)
# define XCAST(fun) (typeof(JoystickWvt.fun))
#else
# define XCAST(fun) (void*)
#endif
static
const
IDirectInputDevice8WVtbl
JoystickWvt
=
{
IDirectInputDevice2WImpl_QueryInterface
,
...
...
@@ -680,8 +694,8 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
IDirectInputDevice2WImpl_EnumObjects
,
JoystickWGenericImpl_GetProperty
,
JoystickWGenericImpl_SetProperty
,
XCAST
(
Acquire
)
JoystickLinuxA
Impl_Acquire
,
XCAST
(
Unacquire
)
JoystickLinuxA
Impl_Unacquire
,
JoystickLinuxW
Impl_Acquire
,
JoystickLinuxW
Impl_Unacquire
,
JoystickWGenericImpl_GetDeviceState
,
IDirectInputDevice2WImpl_GetDeviceData
,
IDirectInputDevice2WImpl_SetDataFormat
,
...
...
@@ -706,7 +720,6 @@ static const IDirectInputDevice8WVtbl JoystickWvt =
IDirectInputDevice8WImpl_SetActionMap
,
IDirectInputDevice8WImpl_GetImageInfo
};
#undef XCAST
#else
/* HAVE_LINUX_22_JOYSTICK_API */
...
...
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