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
0d0a4075
Commit
0d0a4075
authored
Jun 07, 2003
by
Christian Costa
Committed by
Alexandre Julliard
Jun 07, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix SetDataFormat and implement GetDeviceInfo for mouse device.
parent
b7c429ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
17 deletions
+48
-17
main.c
dlls/dinput/mouse/main.c
+48
-17
No files found.
dlls/dinput/mouse/main.c
View file @
0d0a4075
...
@@ -136,6 +136,9 @@ struct SysMouseAImpl
...
@@ -136,6 +136,9 @@ struct SysMouseAImpl
Wine_InternalMouseData
m_state
;
Wine_InternalMouseData
m_state
;
};
};
/* FIXME: This is ugly and not thread safe :/ */
static
IDirectInputDevice8A
*
current_lock
=
NULL
;
static
GUID
DInput_Wine_Mouse_GUID
=
{
/* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 */
static
GUID
DInput_Wine_Mouse_GUID
=
{
/* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 */
0x9e573ed8
,
0x9e573ed8
,
0x7734
,
0x7734
,
...
@@ -143,21 +146,33 @@ static GUID DInput_Wine_Mouse_GUID = { /* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 *
...
@@ -143,21 +146,33 @@ static GUID DInput_Wine_Mouse_GUID = { /* 9e573ed8-7734-11d2-8d4a-23903fb6bdf7 *
{
0x8d
,
0x4a
,
0x23
,
0x90
,
0x3f
,
0xb6
,
0xbd
,
0xf7
}
{
0x8d
,
0x4a
,
0x23
,
0x90
,
0x3f
,
0xb6
,
0xbd
,
0xf7
}
};
};
/* FIXME: This is ugly and not thread safe :/ */
static
void
fill_mouse_dideviceinstancea
(
LPDIDEVICEINSTANCEA
lpddi
)
{
static
IDirectInputDevice8A
*
current_lock
=
NULL
;
DWORD
dwSize
;
DIDEVICEINSTANCEA
ddi
;
dwSize
=
lpddi
->
dwSize
;
TRACE
(
"%ld %p
\n
"
,
dwSize
,
lpddi
);
memset
(
lpddi
,
0
,
dwSize
);
memset
(
&
ddi
,
0
,
sizeof
(
ddi
));
ddi
.
dwSize
=
dwSize
;
ddi
.
guidInstance
=
GUID_SysMouse
;
/* DInput's GUID */
ddi
.
guidProduct
=
DInput_Wine_Mouse_GUID
;
/* Vendor's GUID */
ddi
.
dwDevType
=
DIDEVTYPE_MOUSE
|
(
DIDEVTYPEMOUSE_UNKNOWN
<<
8
);
strcpy
(
ddi
.
tszInstanceName
,
"Mouse"
);
strcpy
(
ddi
.
tszProductName
,
"Wine Mouse"
);
memcpy
(
lpddi
,
&
ddi
,
(
dwSize
<
sizeof
(
ddi
)
?
dwSize
:
sizeof
(
ddi
)));
}
static
BOOL
mousedev_enum_device
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
)
static
BOOL
mousedev_enum_device
(
DWORD
dwDevType
,
DWORD
dwFlags
,
LPDIDEVICEINSTANCEA
lpddi
)
{
{
if
((
dwDevType
==
0
)
||
(
dwDevType
==
DIDEVTYPE_MOUSE
))
{
if
((
dwDevType
==
0
)
||
(
dwDevType
==
DIDEVTYPE_MOUSE
))
{
TRACE
(
"Enumerating the mouse device
\n
"
);
TRACE
(
"Enumerating the mouse device
\n
"
);
/* Return mouse */
fill_mouse_dideviceinstancea
(
lpddi
);
lpddi
->
guidInstance
=
GUID_SysMouse
;
/* DInput's GUID */
lpddi
->
guidProduct
=
DInput_Wine_Mouse_GUID
;
/* Vendor's GUID */
lpddi
->
dwDevType
=
DIDEVTYPE_MOUSE
|
(
DIDEVTYPEMOUSE_UNKNOWN
<<
8
);
strcpy
(
lpddi
->
tszInstanceName
,
"Mouse"
);
strcpy
(
lpddi
->
tszProductName
,
"Wine Mouse"
);
return
TRUE
;
return
TRUE
;
}
}
...
@@ -315,13 +330,10 @@ static HRESULT WINAPI SysMouseAImpl_SetDataFormat(
...
@@ -315,13 +330,10 @@ static HRESULT WINAPI SysMouseAImpl_SetDataFormat(
TRACE
(
"df.rgodf[%d].dwFlags 0x%08lx
\n
"
,
i
,
df
->
rgodf
[
i
].
dwFlags
);
TRACE
(
"df.rgodf[%d].dwFlags 0x%08lx
\n
"
,
i
,
df
->
rgodf
[
i
].
dwFlags
);
}
}
/* Check if the mouse is in absolute or relative mode */
/* Tests under windows show that a call to SetDataFormat always sets the mouse
if
(
df
->
dwFlags
==
DIDF_ABSAXIS
)
in relative mode whatever the dwFlags value (DIDF_ABSAXIS/DIDF_RELAXIS).
This
->
absolute
=
1
;
To switch in absolute mode, SetProperty must be used. */
else
if
(
df
->
dwFlags
==
DIDF_RELAXIS
)
This
->
absolute
=
0
;
This
->
absolute
=
0
;
else
ERR
(
"Neither absolute nor relative flag set
\n
"
);
/* Store the new data format */
/* Store the new data format */
This
->
df
=
HeapAlloc
(
GetProcessHeap
(),
0
,
df
->
dwSize
);
This
->
df
=
HeapAlloc
(
GetProcessHeap
(),
0
,
df
->
dwSize
);
...
@@ -934,6 +946,25 @@ static HRESULT WINAPI SysMouseAImpl_EnumObjects(
...
@@ -934,6 +946,25 @@ static HRESULT WINAPI SysMouseAImpl_EnumObjects(
return
DI_OK
;
return
DI_OK
;
}
}
/******************************************************************************
* GetDeviceInfo : get information about a device's identity
*/
static
HRESULT
WINAPI
SysMouseAImpl_GetDeviceInfo
(
LPDIRECTINPUTDEVICE8A
iface
,
LPDIDEVICEINSTANCEA
pdidi
)
{
ICOM_THIS
(
SysMouseAImpl
,
iface
);
TRACE
(
"(this=%p,%p)
\n
"
,
This
,
pdidi
);
if
(
pdidi
->
dwSize
!=
sizeof
(
DIDEVICEINSTANCEA
))
{
WARN
(
" dinput3 not supporte yet...
\n
"
);
return
DI_OK
;
}
fill_mouse_dideviceinstancea
(
pdidi
);
return
DI_OK
;
}
static
ICOM_VTABLE
(
IDirectInputDevice8A
)
SysMouseAvt
=
static
ICOM_VTABLE
(
IDirectInputDevice8A
)
SysMouseAvt
=
{
{
...
@@ -953,7 +984,7 @@ static ICOM_VTABLE(IDirectInputDevice8A) SysMouseAvt =
...
@@ -953,7 +984,7 @@ static ICOM_VTABLE(IDirectInputDevice8A) SysMouseAvt =
SysMouseAImpl_SetEventNotification
,
SysMouseAImpl_SetEventNotification
,
SysMouseAImpl_SetCooperativeLevel
,
SysMouseAImpl_SetCooperativeLevel
,
IDirectInputDevice2AImpl_GetObjectInfo
,
IDirectInputDevice2AImpl_GetObjectInfo
,
IDirectInputDevice2
AImpl_GetDeviceInfo
,
SysMouse
AImpl_GetDeviceInfo
,
IDirectInputDevice2AImpl_RunControlPanel
,
IDirectInputDevice2AImpl_RunControlPanel
,
IDirectInputDevice2AImpl_Initialize
,
IDirectInputDevice2AImpl_Initialize
,
IDirectInputDevice2AImpl_CreateEffect
,
IDirectInputDevice2AImpl_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