2 * Copyright 2018 Andrey Gusev
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "wine/debug.h"
24 #include "wine/heap.h"
26 #include "interactioncontext.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(ninput
);
30 struct interaction_context
35 static struct interaction_context
*context_from_handle(HINTERACTIONCONTEXT handle
)
37 return (struct interaction_context
*)handle
;
40 HRESULT WINAPI
CreateInteractionContext(HINTERACTIONCONTEXT
*handle
)
42 struct interaction_context
*context
;
44 TRACE("handle %p.\n", handle
);
49 if (!(context
= heap_alloc(sizeof(*context
))))
52 context
->filter_pointers
= TRUE
;
54 TRACE("Created context %p.\n", context
);
56 *handle
= (HINTERACTIONCONTEXT
)context
;
61 HRESULT WINAPI
DestroyInteractionContext(HINTERACTIONCONTEXT handle
)
63 struct interaction_context
*context
= context_from_handle(handle
);
65 TRACE("context %p.\n", context
);
74 HRESULT WINAPI
GetPropertyInteractionContext(HINTERACTIONCONTEXT handle
,
75 INTERACTION_CONTEXT_PROPERTY property
, UINT32
*value
)
77 struct interaction_context
*context
= context_from_handle(handle
);
79 TRACE("context %p, property %#x, value %p.\n", context
, property
, value
);
88 case INTERACTION_CONTEXT_PROPERTY_MEASUREMENT_UNITS
:
89 case INTERACTION_CONTEXT_PROPERTY_INTERACTION_UI_FEEDBACK
:
90 FIXME("Unhandled property %#x.\n", property
);
94 case INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
:
95 *value
= context
->filter_pointers
;
99 WARN("Invalid property %#x.\n", property
);
104 HRESULT WINAPI
SetPropertyInteractionContext(HINTERACTIONCONTEXT handle
,
105 INTERACTION_CONTEXT_PROPERTY property
, UINT32 value
)
107 struct interaction_context
*context
= context_from_handle(handle
);
109 TRACE("context %p, property %#x, value %#x.\n", context
, property
, value
);
116 case INTERACTION_CONTEXT_PROPERTY_MEASUREMENT_UNITS
:
117 case INTERACTION_CONTEXT_PROPERTY_INTERACTION_UI_FEEDBACK
:
118 FIXME("Unhandled property %#x.\n", property
);
121 case INTERACTION_CONTEXT_PROPERTY_FILTER_POINTERS
:
122 if (value
!= FALSE
&& value
!= TRUE
)
124 context
->filter_pointers
= value
;
128 WARN("Invalid property %#x.\n", property
);
133 HRESULT WINAPI
SetInteractionConfigurationInteractionContext(HINTERACTIONCONTEXT handle
,
134 UINT32 count
, const INTERACTION_CONTEXT_CONFIGURATION
*configuration
)
136 struct interaction_context
*context
= context_from_handle(handle
);
138 FIXME("context %p, count %u, configuration %p: stub!.\n", context
, count
, configuration
);
150 HRESULT WINAPI
RegisterOutputCallbackInteractionContext(HINTERACTIONCONTEXT handle
,
151 INTERACTION_CONTEXT_OUTPUT_CALLBACK callback
, void *data
)
153 struct interaction_context
*context
= context_from_handle(handle
);
155 FIXME("context %p, callback %p, data %p: stub!.\n", context
, callback
, data
);
163 HRESULT WINAPI
ProcessInertiaInteractionContext(HINTERACTIONCONTEXT context
)
165 FIXME("context %p: stub!\n", context
);