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
ca8b8664
Commit
ca8b8664
authored
Jun 21, 2018
by
Józef Kucia
Committed by
Alexandre Julliard
Jun 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ninput: Implement SetPropertyInteractionContext().
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
116ad149
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
109 additions
and
2 deletions
+109
-2
main.c
dlls/ninput/main.c
+59
-0
ninput.spec
dlls/ninput/ninput.spec
+2
-2
ninput.c
dlls/ninput/tests/ninput.c
+48
-0
No files found.
dlls/ninput/main.c
View file @
ca8b8664
...
...
@@ -72,6 +72,65 @@ HRESULT WINAPI DestroyInteractionContext(HINTERACTIONCONTEXT handle)
return
S_OK
;
}
HRESULT
WINAPI
GetPropertyInteractionContext
(
HINTERACTIONCONTEXT
handle
,
INTERACTION_CONTEXT_PROPERTY
property
,
UINT32
*
value
)
{
struct
interaction_context
*
context
=
context_from_handle
(
handle
);
TRACE
(
"context %p, property %#x, value %p.
\n
"
,
context
,
property
,
value
);
if
(
!
context
)
return
E_HANDLE
;
if
(
!
value
)
return
E_POINTER
;
switch
(
property
)
{
case
INTERACTION_CONTEXT_PROPERTY_MEASUREMENT_UNITS
:
case
INTERACTION_CONTEXT_PROPERTY_INTERACTION_UI_FEEDBACK
:
FIXME
(
"Unhandled property %#x.
\n
"
,
property
);
*
value
=
0
;
return
E_NOTIMPL
;
case
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
:
*
value
=
context
->
filter_pointers
;
return
S_OK
;
default:
WARN
(
"Invalid property %#x.
\n
"
,
property
);
return
E_INVALIDARG
;
}
}
HRESULT
WINAPI
SetPropertyInteractionContext
(
HINTERACTIONCONTEXT
handle
,
INTERACTION_CONTEXT_PROPERTY
property
,
UINT32
value
)
{
struct
interaction_context
*
context
=
context_from_handle
(
handle
);
TRACE
(
"context %p, property %#x, value %#x.
\n
"
,
context
,
property
,
value
);
if
(
!
context
)
return
E_HANDLE
;
switch
(
property
)
{
case
INTERACTION_CONTEXT_PROPERTY_MEASUREMENT_UNITS
:
case
INTERACTION_CONTEXT_PROPERTY_INTERACTION_UI_FEEDBACK
:
FIXME
(
"Unhandled property %#x.
\n
"
,
property
);
return
E_NOTIMPL
;
case
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
:
if
(
value
!=
FALSE
&&
value
!=
TRUE
)
return
E_INVALIDARG
;
context
->
filter_pointers
=
value
;
return
S_OK
;
default:
WARN
(
"Invalid property %#x.
\n
"
,
property
);
return
E_INVALIDARG
;
}
}
HRESULT
WINAPI
ProcessInertiaInteractionContext
(
HINTERACTIONCONTEXT
context
)
{
FIXME
(
"context %p: stub!
\n
"
,
context
);
...
...
dlls/ninput/ninput.spec
View file @
ca8b8664
...
...
@@ -7,7 +7,7 @@
@ stub GetInertiaParameterInteractionContext
@ stub GetInteractionConfigurationInteractionContext
@ stub GetMouseWheelParameterInteractionContext
@ st
ub GetPropertyInteractionContext
@ st
dcall GetPropertyInteractionContext(ptr long ptr)
@ stub GetStateInteractionContext
@ stub ProcessBufferedPacketsInteractionContext
@ stdcall ProcessInertiaInteractionContext(ptr)
...
...
@@ -20,5 +20,5 @@
@ stub SetInteractionConfigurationInteractionContext
@ stub SetMouseWheelParameterInteractionContext
@ stub SetPivotInteractionContext
@ st
ub SetPropertyInteractionContext
@ st
dcall SetPropertyInteractionContext(ptr long long)
@ stub StopInteractionContext
dlls/ninput/tests/ninput.c
View file @
ca8b8664
...
...
@@ -35,7 +35,55 @@ static void test_context(void)
ok
(
hr
==
E_HANDLE
,
"Got hr %#x.
\n
"
,
hr
);
}
static
void
test_properties
(
void
)
{
HINTERACTIONCONTEXT
context
;
UINT32
value
;
HRESULT
hr
;
hr
=
CreateInteractionContext
(
&
context
);
ok
(
hr
==
S_OK
,
"Failed to create context, hr %#x.
\n
"
,
hr
);
hr
=
GetPropertyInteractionContext
(
context
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
&
value
);
ok
(
hr
==
S_OK
,
"Failed to get property, hr %#x.
\n
"
,
hr
);
ok
(
value
==
TRUE
,
"Got unexpected value %#x.
\n
"
,
value
);
hr
=
SetPropertyInteractionContext
(
context
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
TRUE
);
ok
(
hr
==
S_OK
,
"Failed to set property, hr %#x.
\n
"
,
hr
);
hr
=
GetPropertyInteractionContext
(
context
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
&
value
);
ok
(
hr
==
S_OK
,
"Failed to get property, hr %#x.
\n
"
,
hr
);
ok
(
value
==
TRUE
,
"Got unexpected value %#x.
\n
"
,
value
);
hr
=
SetPropertyInteractionContext
(
context
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
FALSE
);
ok
(
hr
==
S_OK
,
"Failed to set property, hr %#x.
\n
"
,
hr
);
hr
=
GetPropertyInteractionContext
(
context
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
&
value
);
ok
(
hr
==
S_OK
,
"Failed to get property, hr %#x.
\n
"
,
hr
);
ok
(
value
==
FALSE
,
"Got unexpected value %#x.
\n
"
,
value
);
hr
=
SetPropertyInteractionContext
(
context
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
2
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
SetPropertyInteractionContext
(
context
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
3
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
SetPropertyInteractionContext
(
context
,
0xdeadbeef
,
0
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
GetPropertyInteractionContext
(
context
,
0xdeadbeef
,
&
value
);
ok
(
hr
==
E_INVALIDARG
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
GetPropertyInteractionContext
(
context
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
NULL
);
ok
(
hr
==
E_POINTER
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
SetPropertyInteractionContext
(
NULL
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
FALSE
);
ok
(
hr
==
E_HANDLE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
GetPropertyInteractionContext
(
NULL
,
INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
,
&
value
);
ok
(
hr
==
E_HANDLE
,
"Got hr %#x.
\n
"
,
hr
);
hr
=
DestroyInteractionContext
(
context
);
ok
(
hr
==
S_OK
,
"Failed to destroy context, hr %#x.
\n
"
,
hr
);
}
START_TEST
(
ninput
)
{
test_context
();
test_properties
();
}
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