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
da745fee
Commit
da745fee
authored
Mar 08, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Mar 08, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windows.gaming.input: Implement IGamepadStatics2_FromGameController.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a9fbfa1b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
gamepad.c
dlls/windows.gaming.input/gamepad.c
+40
-0
No files found.
dlls/windows.gaming.input/gamepad.c
View file @
da745fee
...
...
@@ -27,6 +27,7 @@ struct gamepad_statics
{
IActivationFactory
IActivationFactory_iface
;
IGamepadStatics
IGamepadStatics_iface
;
IGamepadStatics2
IGamepadStatics2_iface
;
ICustomGameControllerFactory
ICustomGameControllerFactory_iface
;
LONG
ref
;
};
...
...
@@ -57,6 +58,12 @@ static HRESULT WINAPI factory_QueryInterface( IActivationFactory *iface, REFIID
return
S_OK
;
}
if
(
IsEqualGUID
(
iid
,
&
IID_IGamepadStatics2
))
{
IInspectable_AddRef
(
(
*
out
=
&
impl
->
IGamepadStatics2_iface
)
);
return
S_OK
;
}
if
(
IsEqualGUID
(
iid
,
&
IID_ICustomGameControllerFactory
))
{
IInspectable_AddRef
(
(
*
out
=
&
impl
->
ICustomGameControllerFactory_iface
)
);
...
...
@@ -188,6 +195,38 @@ static const struct IGamepadStaticsVtbl statics_vtbl =
statics_get_Gamepads
,
};
DEFINE_IINSPECTABLE
(
statics2
,
IGamepadStatics2
,
struct
gamepad_statics
,
IActivationFactory_iface
)
static
HRESULT
WINAPI
statics2_FromGameController
(
IGamepadStatics2
*
iface
,
IGameController
*
game_controller
,
IGamepad
**
value
)
{
struct
gamepad_statics
*
impl
=
impl_from_IGamepadStatics2
(
iface
);
IGameController
*
controller
;
HRESULT
hr
;
TRACE
(
"iface %p, game_controller %p, value %p.
\n
"
,
iface
,
game_controller
,
value
);
hr
=
IGameControllerFactoryManagerStatics2_TryGetFactoryControllerFromGameController
(
manager_factory
,
&
impl
->
ICustomGameControllerFactory_iface
,
game_controller
,
&
controller
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IGameController_QueryInterface
(
controller
,
&
IID_IGamepad
,
(
void
**
)
value
);
IGameController_Release
(
controller
);
return
hr
;
}
static
const
struct
IGamepadStatics2Vtbl
statics2_vtbl
=
{
statics2_QueryInterface
,
statics2_AddRef
,
statics2_Release
,
/* IInspectable methods */
statics2_GetIids
,
statics2_GetRuntimeClassName
,
statics2_GetTrustLevel
,
/* IGamepadStatics2 methods */
statics2_FromGameController
,
};
DEFINE_IINSPECTABLE
(
controller_factory
,
ICustomGameControllerFactory
,
struct
gamepad_statics
,
IActivationFactory_iface
)
static
HRESULT
WINAPI
controller_factory_CreateGameController
(
ICustomGameControllerFactory
*
iface
,
IGameControllerProvider
*
provider
,
...
...
@@ -228,6 +267,7 @@ static struct gamepad_statics gamepad_statics =
{
{
&
factory_vtbl
},
{
&
statics_vtbl
},
{
&
statics2_vtbl
},
{
&
controller_factory_vtbl
},
1
,
};
...
...
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