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
3834eaf9
Commit
3834eaf9
authored
Nov 18, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 18, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Move SetProperty implementation to the generic device.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
801bc147
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
70 deletions
+40
-70
device.c
dlls/dinput/device.c
+29
-2
device_private.h
dlls/dinput/device_private.h
+0
-2
joystick_hid.c
dlls/dinput/joystick_hid.c
+11
-52
keyboard.c
dlls/dinput/keyboard.c
+0
-7
mouse.c
dlls/dinput/mouse.c
+0
-7
No files found.
dlls/dinput/device.c
View file @
3834eaf9
...
...
@@ -1143,8 +1143,35 @@ static BOOL CALLBACK set_object_property( const DIDEVICEOBJECTINSTANCEW *instanc
{
struct
set_object_property_params
*
params
=
context
;
struct
dinput_device
*
impl
=
impl_from_IDirectInputDevice8W
(
params
->
iface
);
impl
->
vtbl
->
set_property
(
params
->
iface
,
params
->
property
,
params
->
header
,
instance
);
return
DIENUM_CONTINUE
;
struct
object_properties
*
properties
=
NULL
;
if
(
!
impl
->
object_properties
)
return
DIENUM_STOP
;
properties
=
impl
->
object_properties
+
instance
->
dwOfs
/
sizeof
(
LONG
);
switch
(
params
->
property
)
{
case
(
DWORD_PTR
)
DIPROP_RANGE
:
{
const
DIPROPRANGE
*
value
=
(
const
DIPROPRANGE
*
)
params
->
header
;
properties
->
range_min
=
value
->
lMin
;
properties
->
range_max
=
value
->
lMax
;
return
DIENUM_CONTINUE
;
}
case
(
DWORD_PTR
)
DIPROP_DEADZONE
:
{
const
DIPROPDWORD
*
value
=
(
const
DIPROPDWORD
*
)
params
->
header
;
properties
->
deadzone
=
value
->
dwData
;
return
DIENUM_CONTINUE
;
}
case
(
DWORD_PTR
)
DIPROP_SATURATION
:
{
const
DIPROPDWORD
*
value
=
(
const
DIPROPDWORD
*
)
params
->
header
;
properties
->
saturation
=
value
->
dwData
;
return
DIENUM_CONTINUE
;
}
}
return
DIENUM_STOP
;
}
static
BOOL
CALLBACK
reset_object_value
(
const
DIDEVICEOBJECTINSTANCEW
*
instance
,
void
*
context
)
...
...
dlls/dinput/device_private.h
View file @
3834eaf9
...
...
@@ -45,8 +45,6 @@ struct dinput_device_vtbl
LPDIENUMDEVICEOBJECTSCALLBACKW
callback
,
void
*
context
);
HRESULT
(
*
get_property
)(
IDirectInputDevice8W
*
iface
,
DWORD
property
,
DIPROPHEADER
*
header
,
DIDEVICEOBJECTINSTANCEW
*
instance
);
HRESULT
(
*
set_property
)(
IDirectInputDevice8W
*
iface
,
DWORD
property
,
const
DIPROPHEADER
*
header
,
const
DIDEVICEOBJECTINSTANCEW
*
instance
);
HRESULT
(
*
get_effect_info
)(
IDirectInputDevice8W
*
iface
,
DIEFFECTINFOW
*
info
,
const
GUID
*
guid
);
HRESULT
(
*
create_effect
)(
IDirectInputDevice8W
*
iface
,
IDirectInputEffect
**
out
);
HRESULT
(
*
send_force_feedback_command
)(
IDirectInputDevice8W
*
iface
,
DWORD
command
,
BOOL
unacquire
);
...
...
dlls/dinput/joystick_hid.c
View file @
3834eaf9
...
...
@@ -780,22 +780,6 @@ static HRESULT hid_joystick_get_property( IDirectInputDevice8W *iface, DWORD pro
return
DIERR_UNSUPPORTED
;
}
static
void
set_extra_caps_range
(
struct
hid_joystick
*
impl
,
const
DIDEVICEOBJECTINSTANCEW
*
instance
,
LONG
min
,
LONG
max
)
{
struct
object_properties
*
properties
=
impl
->
base
.
object_properties
+
instance
->
dwOfs
/
sizeof
(
LONG
);
LONG
tmp
;
properties
->
range_min
=
min
;
properties
->
range_max
=
max
;
if
(
instance
->
dwType
&
DIDFT_POV
)
{
tmp
=
properties
->
logical_max
-
properties
->
logical_min
;
if
(
tmp
>
0
)
properties
->
range_max
-=
max
/
(
tmp
+
1
);
}
}
static
HRESULT
hid_joystick_send_device_gain
(
IDirectInputDevice8W
*
iface
,
LONG
device_gain
)
{
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
...
...
@@ -817,39 +801,6 @@ static HRESULT hid_joystick_send_device_gain( IDirectInputDevice8W *iface, LONG
return
DI_OK
;
}
static
HRESULT
hid_joystick_set_property
(
IDirectInputDevice8W
*
iface
,
DWORD
property
,
const
DIPROPHEADER
*
header
,
const
DIDEVICEOBJECTINSTANCEW
*
instance
)
{
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
struct
object_properties
*
properties
=
NULL
;
if
(
instance
)
properties
=
impl
->
base
.
object_properties
+
instance
->
dwOfs
/
sizeof
(
LONG
);
switch
(
property
)
{
case
(
DWORD_PTR
)
DIPROP_RANGE
:
{
const
DIPROPRANGE
*
value
=
(
const
DIPROPRANGE
*
)
header
;
set_extra_caps_range
(
impl
,
instance
,
value
->
lMin
,
value
->
lMax
);
return
DI_OK
;
}
case
(
DWORD_PTR
)
DIPROP_DEADZONE
:
{
const
DIPROPDWORD
*
value
=
(
const
DIPROPDWORD
*
)
header
;
properties
->
deadzone
=
value
->
dwData
;
return
DI_OK
;
}
case
(
DWORD_PTR
)
DIPROP_SATURATION
:
{
const
DIPROPDWORD
*
value
=
(
const
DIPROPDWORD
*
)
header
;
properties
->
saturation
=
value
->
dwData
;
return
DI_OK
;
}
}
return
DIERR_UNSUPPORTED
;
}
static
HRESULT
hid_joystick_acquire
(
IDirectInputDevice8W
*
iface
)
{
struct
hid_joystick
*
impl
=
impl_from_IDirectInputDevice8W
(
iface
);
...
...
@@ -1301,7 +1252,6 @@ static const struct dinput_device_vtbl hid_joystick_vtbl =
hid_joystick_unacquire
,
hid_joystick_enum_objects
,
hid_joystick_get_property
,
hid_joystick_set_property
,
hid_joystick_get_effect_info
,
hid_joystick_create_effect
,
hid_joystick_send_force_feedback_command
,
...
...
@@ -1561,11 +1511,20 @@ static BOOL init_object_properties( struct hid_joystick *impl, struct hid_value_
DIDEVICEOBJECTINSTANCEW
*
instance
,
void
*
data
)
{
struct
object_properties
*
properties
=
impl
->
base
.
object_properties
+
instance
->
dwOfs
/
sizeof
(
LONG
);
LONG
range_max
=
(
instance
->
dwType
&
DIDFT_AXIS
)
?
65535
:
36000
;
LONG
tmp
;
properties
->
bit_size
=
caps
->
bit_size
;
properties
->
logical_min
=
caps
->
logical_min
;
properties
->
logical_max
=
caps
->
logical_max
;
set_extra_caps_range
(
impl
,
instance
,
0
,
range_max
);
if
(
instance
->
dwType
&
DIDFT_AXIS
)
properties
->
range_max
=
65535
;
else
{
properties
->
range_max
=
36000
;
tmp
=
caps
->
logical_max
-
caps
->
logical_min
;
if
(
tmp
>
0
)
properties
->
range_max
-=
36000
/
(
tmp
+
1
);
}
properties
->
saturation
=
10000
;
return
DIENUM_CONTINUE
;
}
...
...
dlls/dinput/keyboard.c
View file @
3834eaf9
...
...
@@ -274,12 +274,6 @@ static HRESULT keyboard_get_property( IDirectInputDevice8W *iface, DWORD propert
return
DIERR_UNSUPPORTED
;
}
static
HRESULT
keyboard_set_property
(
IDirectInputDevice8W
*
iface
,
DWORD
property
,
const
DIPROPHEADER
*
header
,
const
DIDEVICEOBJECTINSTANCEW
*
instance
)
{
return
DIERR_UNSUPPORTED
;
}
static
const
struct
dinput_device_vtbl
keyboard_vtbl
=
{
NULL
,
...
...
@@ -289,7 +283,6 @@ static const struct dinput_device_vtbl keyboard_vtbl =
keyboard_unacquire
,
keyboard_enum_objects
,
keyboard_get_property
,
keyboard_set_property
,
NULL
,
NULL
,
NULL
,
...
...
dlls/dinput/mouse.c
View file @
3834eaf9
...
...
@@ -576,12 +576,6 @@ static HRESULT mouse_get_property( IDirectInputDevice8W *iface, DWORD property,
return
DIERR_UNSUPPORTED
;
}
static
HRESULT
mouse_set_property
(
IDirectInputDevice8W
*
iface
,
DWORD
property
,
const
DIPROPHEADER
*
header
,
const
DIDEVICEOBJECTINSTANCEW
*
instance
)
{
return
DIERR_UNSUPPORTED
;
}
static
const
struct
dinput_device_vtbl
mouse_vtbl
=
{
NULL
,
...
...
@@ -591,7 +585,6 @@ static const struct dinput_device_vtbl mouse_vtbl =
mouse_unacquire
,
mouse_enum_objects
,
mouse_get_property
,
mouse_set_property
,
NULL
,
NULL
,
NULL
,
...
...
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