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
42feef0c
Commit
42feef0c
authored
Dec 27, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Dec 28, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Implement EnumOjects[A|W] in the base device class.
parent
18ee811e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
14 deletions
+52
-14
device.c
dlls/dinput/device.c
+52
-14
No files found.
dlls/dinput/device.c
View file @
42feef0c
...
...
@@ -800,13 +800,49 @@ HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(
LPVOID
lpvRef
,
DWORD
dwFlags
)
{
FIXME
(
"(this=%p,%p,%p,%08x): stub!
\n
"
,
iface
,
lpCallback
,
lpvRef
,
dwFlags
);
if
(
TRACE_ON
(
dinput
))
{
DPRINTF
(
" - flags = "
);
_dump_EnumObjects_flags
(
dwFlags
);
DPRINTF
(
"
\n
"
);
IDirectInputDevice2AImpl
*
This
=
(
IDirectInputDevice2AImpl
*
)
iface
;
DIDEVICEOBJECTINSTANCEA
ddoi
;
int
i
,
axis
=
0
,
button
=
0
;
TRACE
(
"(%p) %p,%p flags:%08x)
\n
"
,
iface
,
lpCallback
,
lpvRef
,
dwFlags
);
TRACE
(
" - flags = "
);
_dump_EnumObjects_flags
(
dwFlags
);
TRACE
(
"
\n
"
);
/* Only the fields till dwFFMaxForce are relevant */
memset
(
&
ddoi
,
0
,
sizeof
(
ddoi
));
ddoi
.
dwSize
=
FIELD_OFFSET
(
DIDEVICEOBJECTINSTANCEA
,
dwFFMaxForce
);
for
(
i
=
0
;
i
<
This
->
data_format
.
wine_df
->
dwNumObjs
;
i
++
)
{
LPDIOBJECTDATAFORMAT
odf
;
DWORD
type
;
odf
=
(
LPDIOBJECTDATAFORMAT
)((
LPBYTE
)
This
->
data_format
.
wine_df
->
rgodf
+
i
*
This
->
data_format
.
wine_df
->
dwObjSize
);
type
=
DIEFT_GETTYPE
(
odf
->
dwType
);
if
(
type
&
DIDFT_AXIS
)
axis
++
;
else
if
(
type
&
DIDFT_BUTTON
)
button
++
;
if
(
dwFlags
!=
DIDFT_ALL
&&
!
(
dwFlags
&
type
))
continue
;
ddoi
.
guidType
=
*
odf
->
pguid
;
ddoi
.
dwType
=
odf
->
dwType
;
ddoi
.
dwFlags
=
odf
->
dwFlags
;
ddoi
.
dwOfs
=
!
This
->
data_format
.
offsets
?
odf
->
dwOfs
:
This
->
data_format
.
offsets
[
i
];
if
(
IsEqualGUID
(
&
ddoi
.
guidType
,
&
GUID_XAxis
))
strcpy
(
ddoi
.
tszName
,
"X-Axis"
);
else
if
(
IsEqualGUID
(
&
ddoi
.
guidType
,
&
GUID_YAxis
))
strcpy
(
ddoi
.
tszName
,
"Y-Axis"
);
else
if
(
IsEqualGUID
(
&
ddoi
.
guidType
,
&
GUID_ZAxis
))
strcpy
(
ddoi
.
tszName
,
"Z-Axis"
);
else
if
(
type
&
DIDFT_AXIS
)
wsprintfA
(
ddoi
.
tszName
,
"%d-Axis"
,
axis
-
1
);
else
if
(
type
&
DIDFT_BUTTON
)
wsprintfA
(
ddoi
.
tszName
,
"Button %d"
,
button
-
1
);
else
FIXME
(
"no name
\n
"
);
_dump_OBJECTINSTANCEA
(
&
ddoi
);
if
(
lpCallback
(
&
ddoi
,
lpvRef
)
!=
DIENUM_CONTINUE
)
break
;
}
return
DI_OK
;
}
...
...
@@ -816,14 +852,15 @@ HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(
LPVOID
lpvRef
,
DWORD
dwFlags
)
{
FIXME
(
"(this=%p,%p,%p,%08x): stub!
\n
"
,
iface
,
lpCallback
,
lpvRef
,
dwFlags
);
if
(
TRACE_ON
(
dinput
))
{
DPRINTF
(
" - flags = "
);
_dump_EnumObjects_flags
(
dwFlags
);
DPRINTF
(
"
\n
"
);
}
return
DI_OK
;
device_enumobjects_AtoWcb_data
data
;
data
.
lpCallBack
=
lpCallback
;
data
.
lpvRef
=
lpvRef
;
return
IDirectInputDevice2AImpl_EnumObjects
(
(
LPDIRECTINPUTDEVICE8A
)
iface
,
(
LPDIENUMDEVICEOBJECTSCALLBACKA
)
DIEnumDevicesCallbackAtoW
,
(
LPVOID
)
&
data
,
dwFlags
);
}
/******************************************************************************
...
...
@@ -884,6 +921,7 @@ HRESULT WINAPI IDirectInputDevice2AImpl_SetProperty(
if
(
pdiph
->
dwHow
==
DIPH_DEVICE
&&
pdiph
->
dwObj
)
return
DIERR_INVALIDPARAM
;
if
(
This
->
acquired
)
return
DIERR_ACQUIRED
;
if
(
pdiph
->
dwHow
!=
DIPH_DEVICE
)
return
DIERR_UNSUPPORTED
;
if
(
!
This
->
data_format
.
user_df
)
return
DI_OK
;
TRACE
(
"Axis mode: %s
\n
"
,
pd
->
dwData
==
DIPROPAXISMODE_ABS
?
"absolute"
:
"relative"
);
...
...
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