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
7d838d9e
Commit
7d838d9e
authored
Oct 15, 2006
by
Vitaliy Margolen
Committed by
Alexandre Julliard
Oct 17, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput: Use dinput device as a base class for keyboard, mouse and joystick.
parent
4205c64e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
31 deletions
+25
-31
device_private.h
dlls/dinput/device_private.h
+3
-3
joystick_linux.c
dlls/dinput/joystick_linux.c
+6
-7
joystick_linuxinput.c
dlls/dinput/joystick_linuxinput.c
+6
-7
keyboard.c
dlls/dinput/keyboard.c
+5
-7
mouse.c
dlls/dinput/mouse.c
+5
-7
No files found.
dlls/dinput/device_private.h
View file @
7d838d9e
...
...
@@ -30,9 +30,9 @@
typedef
struct
IDirectInputDevice2AImpl
IDirectInputDevice2AImpl
;
struct
IDirectInputDevice2AImpl
{
const
IDirectInputDevice2AVtbl
*
lpVtbl
;
LONG
ref
;
GUID
guid
;
const
void
*
lpVtbl
;
LONG
ref
;
GUID
guid
;
};
/* Routines to do DataFormat / WineFormat conversions */
...
...
dlls/dinput/joystick_linux.c
View file @
7d838d9e
...
...
@@ -89,9 +89,8 @@ static const IDirectInputDevice8AVtbl JoystickAvt;
static
const
IDirectInputDevice8WVtbl
JoystickWvt
;
struct
JoystickImpl
{
const
void
*
lpVtbl
;
LONG
ref
;
GUID
guid
;
struct
IDirectInputDevice2AImpl
base
;
char
dev
[
32
];
/* The 'parent' DInput */
...
...
@@ -495,12 +494,12 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
}
#endif
newDevice
->
lpVtbl
=
jvt
;
newDevice
->
ref
=
1
;
newDevice
->
base
.
lpVtbl
=
jvt
;
newDevice
->
base
.
ref
=
1
;
newDevice
->
dinput
=
dinput
;
newDevice
->
acquired
=
FALSE
;
newDevice
->
overflow
=
FALSE
;
CopyMemory
(
&
(
newDevice
->
guid
),
rguid
,
sizeof
(
*
rguid
));
CopyMemory
(
&
newDevice
->
base
.
guid
,
rguid
,
sizeof
(
*
rguid
));
/* setup_dinput_options may change these */
newDevice
->
deadzone
=
5000
;
...
...
@@ -672,7 +671,7 @@ static ULONG WINAPI JoystickAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
(
&
This
->
ref
)
);
ref
=
InterlockedDecrement
(
&
This
->
base
.
ref
);
if
(
ref
)
return
ref
;
...
...
dlls/dinput/joystick_linuxinput.c
View file @
7d838d9e
...
...
@@ -118,9 +118,8 @@ struct JoyDev {
struct
JoystickImpl
{
const
void
*
lpVtbl
;
LONG
ref
;
GUID
guid
;
struct
IDirectInputDevice2AImpl
base
;
struct
JoyDev
*
joydev
;
/* The 'parent' DInput */
...
...
@@ -373,15 +372,15 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
return
NULL
;
}
newDevice
->
lpVtbl
=
jvt
;
newDevice
->
ref
=
1
;
newDevice
->
base
.
lpVtbl
=
jvt
;
newDevice
->
base
.
ref
=
1
;
memcpy
(
&
newDevice
->
base
.
guid
,
rguid
,
sizeof
(
*
rguid
));
newDevice
->
joyfd
=
-
1
;
newDevice
->
dinput
=
dinput
;
newDevice
->
joydev
=
joydev
;
#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION
newDevice
->
ff_state
=
FF_STATUS_STOPPED
;
#endif
memcpy
(
&
(
newDevice
->
guid
),
rguid
,
sizeof
(
*
rguid
));
for
(
i
=
0
;
i
<
ABS_MAX
;
i
++
)
{
/* apps expect the range to be the same they would get from the
* GetProperty/range method */
...
...
@@ -522,7 +521,7 @@ static ULONG WINAPI JoystickAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
JoystickImpl
*
This
=
(
JoystickImpl
*
)
iface
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
(
This
->
ref
)
);
ref
=
InterlockedDecrement
(
&
This
->
base
.
ref
);
if
(
ref
)
return
ref
;
...
...
dlls/dinput/keyboard.c
View file @
7d838d9e
...
...
@@ -46,9 +46,7 @@ static const IDirectInputDevice8WVtbl SysKeyboardWvt;
typedef
struct
SysKeyboardImpl
SysKeyboardImpl
;
struct
SysKeyboardImpl
{
const
void
*
lpVtbl
;
LONG
ref
;
GUID
guid
;
struct
IDirectInputDevice2AImpl
base
;
IDirectInputImpl
*
dinput
;
...
...
@@ -204,9 +202,9 @@ static SysKeyboardImpl *alloc_device(REFGUID rguid, const void *kvt, IDirectInpu
SysKeyboardImpl
*
newDevice
;
newDevice
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
SysKeyboardImpl
));
newDevice
->
lpVtbl
=
kvt
;
newDevice
->
ref
=
1
;
memcpy
(
&
(
newDevice
->
guid
),
rguid
,
sizeof
(
*
rguid
));
newDevice
->
base
.
lpVtbl
=
kvt
;
newDevice
->
base
.
ref
=
1
;
memcpy
(
&
newDevice
->
base
.
guid
,
rguid
,
sizeof
(
*
rguid
));
newDevice
->
dinput
=
dinput
;
InitializeCriticalSection
(
&
(
newDevice
->
crit
));
...
...
@@ -263,7 +261,7 @@ static ULONG WINAPI SysKeyboardAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
SysKeyboardImpl
*
This
=
(
SysKeyboardImpl
*
)
iface
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
(
This
->
ref
)
);
ref
=
InterlockedDecrement
(
&
This
->
base
.
ref
);
if
(
ref
)
return
ref
;
set_dinput_hook
(
WH_KEYBOARD_LL
,
NULL
);
...
...
dlls/dinput/mouse.c
View file @
7d838d9e
...
...
@@ -108,9 +108,7 @@ typedef enum {
struct
SysMouseImpl
{
const
void
*
lpVtbl
;
LONG
ref
;
GUID
guid
;
struct
IDirectInputDevice2AImpl
base
;
IDirectInputImpl
*
dinput
;
...
...
@@ -251,10 +249,10 @@ static SysMouseImpl *alloc_device(REFGUID rguid, const void *mvt, IDirectInputIm
};
SysMouseImpl
*
newDevice
;
newDevice
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
SysMouseImpl
));
newDevice
->
ref
=
1
;
newDevice
->
lpVtbl
=
mvt
;
newDevice
->
base
.
lpVtbl
=
mvt
;
newDevice
->
base
.
ref
=
1
;
memcpy
(
&
newDevice
->
base
.
guid
,
rguid
,
sizeof
(
*
rguid
));
InitializeCriticalSection
(
&
(
newDevice
->
crit
));
memcpy
(
&
(
newDevice
->
guid
),
rguid
,
sizeof
(
*
rguid
));
/* Per default, Wine uses its internal data format */
newDevice
->
df
=
(
DIDATAFORMAT
*
)
&
Wine_InternalMouseFormat
;
...
...
@@ -327,7 +325,7 @@ static ULONG WINAPI SysMouseAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
SysMouseImpl
*
This
=
(
SysMouseImpl
*
)
iface
;
ULONG
ref
;
ref
=
InterlockedDecrement
(
&
(
This
->
ref
)
);
ref
=
InterlockedDecrement
(
&
This
->
base
.
ref
);
if
(
ref
)
return
ref
;
...
...
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