2 * Copyright 2019 Alistair Leslie-Hughes
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
26 #include "wine/debug.h"
28 #include "directmanipulation.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(manipulation
);
32 struct directmanipulation
34 IDirectManipulationManager2 IDirectManipulationManager2_iface
;
35 IDirectManipulationUpdateManager
*updatemanager
;
39 struct directupdatemanager
41 IDirectManipulationUpdateManager IDirectManipulationUpdateManager_iface
;
45 static inline struct directmanipulation
*impl_from_IDirectManipulationManager2(IDirectManipulationManager2
*iface
)
47 return CONTAINING_RECORD(iface
, struct directmanipulation
, IDirectManipulationManager2_iface
);
50 static inline struct directupdatemanager
*impl_from_IDirectManipulationUpdateManager(IDirectManipulationUpdateManager
*iface
)
52 return CONTAINING_RECORD(iface
, struct directupdatemanager
, IDirectManipulationUpdateManager_iface
);
55 static HRESULT WINAPI
update_manager_QueryInterface(IDirectManipulationUpdateManager
*iface
, REFIID riid
,void **ppv
)
57 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
59 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppv
);
61 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
62 IsEqualGUID(riid
, &IID_IDirectManipulationUpdateManager
)) {
63 IUnknown_AddRef(iface
);
68 FIXME("(%p)->(%s,%p), not found\n", This
, debugstr_guid(riid
), ppv
);
72 ULONG WINAPI
update_manager_AddRef(IDirectManipulationUpdateManager
*iface
)
74 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
75 ULONG ref
= InterlockedIncrement(&This
->ref
);
77 TRACE("(%p) ref=%lu\n", This
, ref
);
82 ULONG WINAPI
update_manager_Release(IDirectManipulationUpdateManager
*iface
)
84 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
85 ULONG ref
= InterlockedDecrement(&This
->ref
);
87 TRACE("(%p) ref=%lu\n", This
, ref
);
96 static HRESULT WINAPI
update_manager_RegisterWaitHandleCallback(IDirectManipulationUpdateManager
*iface
, HANDLE handle
,
97 IDirectManipulationUpdateHandler
*handler
, DWORD
*cookie
)
99 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
100 FIXME("%p, %p, %p, %p\n", This
, handle
, handler
, cookie
);
104 static HRESULT WINAPI
update_manager_UnregisterWaitHandleCallback(IDirectManipulationUpdateManager
*iface
, DWORD cookie
)
106 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
107 FIXME("%p, %lx\n", This
, cookie
);
111 static HRESULT WINAPI
update_manager_Update(IDirectManipulationUpdateManager
*iface
, IDirectManipulationFrameInfoProvider
*provider
)
113 struct directupdatemanager
*This
= impl_from_IDirectManipulationUpdateManager(iface
);
114 FIXME("%p, %p\n", This
, provider
);
118 struct IDirectManipulationUpdateManagerVtbl updatemanagerVtbl
=
120 update_manager_QueryInterface
,
121 update_manager_AddRef
,
122 update_manager_Release
,
123 update_manager_RegisterWaitHandleCallback
,
124 update_manager_UnregisterWaitHandleCallback
,
125 update_manager_Update
128 static HRESULT
create_update_manager(IDirectManipulationUpdateManager
**obj
)
130 struct directupdatemanager
*object
;
132 object
= malloc(sizeof(*object
));
134 return E_OUTOFMEMORY
;
136 object
->IDirectManipulationUpdateManager_iface
.lpVtbl
= &updatemanagerVtbl
;
139 *obj
= &object
->IDirectManipulationUpdateManager_iface
;
144 struct primarycontext
146 IDirectManipulationPrimaryContent IDirectManipulationPrimaryContent_iface
;
147 IDirectManipulationContent IDirectManipulationContent_iface
;
151 static inline struct primarycontext
*impl_from_IDirectManipulationPrimaryContent(IDirectManipulationPrimaryContent
*iface
)
153 return CONTAINING_RECORD(iface
, struct primarycontext
, IDirectManipulationPrimaryContent_iface
);
156 static inline struct primarycontext
*impl_from_IDirectManipulationContent(IDirectManipulationContent
*iface
)
158 return CONTAINING_RECORD(iface
, struct primarycontext
, IDirectManipulationContent_iface
);
161 static HRESULT WINAPI
primary_QueryInterface(IDirectManipulationPrimaryContent
*iface
, REFIID riid
, void **ppv
)
163 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
164 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppv
);
166 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
167 IsEqualGUID(riid
, &IID_IDirectManipulationPrimaryContent
))
169 IDirectManipulationPrimaryContent_AddRef(&This
->IDirectManipulationPrimaryContent_iface
);
170 *ppv
= &This
->IDirectManipulationPrimaryContent_iface
;
173 else if(IsEqualGUID(riid
, &IID_IDirectManipulationContent
))
175 IUnknown_AddRef(iface
);
176 *ppv
= &This
->IDirectManipulationContent_iface
;
180 FIXME("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppv
);
181 return E_NOINTERFACE
;
184 static ULONG WINAPI
primary_AddRef(IDirectManipulationPrimaryContent
*iface
)
186 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
187 ULONG ref
= InterlockedIncrement(&This
->ref
);
189 TRACE("(%p) ref=%lu\n", This
, ref
);
194 static ULONG WINAPI
primary_Release(IDirectManipulationPrimaryContent
*iface
)
196 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
197 ULONG ref
= InterlockedDecrement(&This
->ref
);
199 TRACE("(%p) ref=%lu\n", This
, ref
);
208 static HRESULT WINAPI
primary_SetSnapInterval(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_MOTION_TYPES motion
,
209 float interval
, float offset
)
211 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
212 FIXME("%p, %d, %f, %f\n", This
, motion
, interval
, offset
);
216 static HRESULT WINAPI
primary_SetSnapPoints(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_MOTION_TYPES motion
,
217 const float *points
, DWORD count
)
219 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
220 FIXME("%p, %d, %p, %ld\n", This
, motion
, points
, count
);
224 static HRESULT WINAPI
primary_SetSnapType(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_MOTION_TYPES motion
,
225 DIRECTMANIPULATION_SNAPPOINT_TYPE type
)
227 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
228 FIXME("%p, %d, %d\n", This
, motion
, type
);
232 static HRESULT WINAPI
primary_SetSnapCoordinate(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_MOTION_TYPES motion
,
233 DIRECTMANIPULATION_SNAPPOINT_COORDINATE coordinate
, float origin
)
235 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
236 FIXME("%p, %d, %d, %f\n", This
, motion
, coordinate
, origin
);
240 static HRESULT WINAPI
primary_SetZoomBoundaries(IDirectManipulationPrimaryContent
*iface
, float minimum
, float maximum
)
242 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
243 FIXME("%p, %f, %f\n", This
, minimum
, maximum
);
247 static HRESULT WINAPI
primary_SetHorizontalAlignment(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_HORIZONTALALIGNMENT alignment
)
249 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
250 FIXME("%p, %d\n", This
, alignment
);
254 static HRESULT WINAPI
primary_SetVerticalAlignment(IDirectManipulationPrimaryContent
*iface
, DIRECTMANIPULATION_VERTICALALIGNMENT alignment
)
256 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
257 FIXME("%p, %d\n", This
, alignment
);
261 static HRESULT WINAPI
primary_GetInertiaEndTransform(IDirectManipulationPrimaryContent
*iface
, float *matrix
, DWORD count
)
263 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
264 FIXME("%p, %p, %ld\n", This
, matrix
, count
);
268 static HRESULT WINAPI
primary_GetCenterPoint(IDirectManipulationPrimaryContent
*iface
, float *x
, float *y
)
270 struct primarycontext
*This
= impl_from_IDirectManipulationPrimaryContent(iface
);
271 FIXME("%p, %p, %p\n", This
, x
, y
);
275 static const IDirectManipulationPrimaryContentVtbl primaryVtbl
=
277 primary_QueryInterface
,
280 primary_SetSnapInterval
,
281 primary_SetSnapPoints
,
283 primary_SetSnapCoordinate
,
284 primary_SetZoomBoundaries
,
285 primary_SetHorizontalAlignment
,
286 primary_SetVerticalAlignment
,
287 primary_GetInertiaEndTransform
,
288 primary_GetCenterPoint
292 static HRESULT WINAPI
content_QueryInterface(IDirectManipulationContent
*iface
, REFIID riid
, void **ppv
)
294 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
295 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppv
);
297 return IDirectManipulationPrimaryContent_QueryInterface(&This
->IDirectManipulationPrimaryContent_iface
,
301 static ULONG WINAPI
content_AddRef(IDirectManipulationContent
*iface
)
303 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
304 return IDirectManipulationPrimaryContent_AddRef(&This
->IDirectManipulationPrimaryContent_iface
);
307 static ULONG WINAPI
content_Release(IDirectManipulationContent
*iface
)
309 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
310 return IDirectManipulationPrimaryContent_Release(&This
->IDirectManipulationPrimaryContent_iface
);
313 static HRESULT WINAPI
content_GetContentRect(IDirectManipulationContent
*iface
, RECT
*size
)
315 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
316 FIXME("%p, %p\n", This
, size
);
320 static HRESULT WINAPI
content_SetContentRect(IDirectManipulationContent
*iface
, const RECT
*size
)
322 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
323 FIXME("%p, %p\n", This
, size
);
327 static HRESULT WINAPI
content_GetViewport(IDirectManipulationContent
*iface
, REFIID riid
, void **object
)
329 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
330 FIXME("%p, %s, %p\n", This
, debugstr_guid(riid
), object
);
334 static HRESULT WINAPI
content_GetTag(IDirectManipulationContent
*iface
, REFIID riid
, void **object
, UINT32
*id
)
336 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
337 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(riid
), object
, id
);
341 static HRESULT WINAPI
content_SetTag(IDirectManipulationContent
*iface
, IUnknown
*object
, UINT32 id
)
343 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
344 FIXME("%p, %p, %d\n", This
, object
, id
);
348 static HRESULT WINAPI
content_GetOutputTransform(IDirectManipulationContent
*iface
,
349 float *matrix
, DWORD count
)
351 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
352 FIXME("%p, %p, %ld\n", This
, matrix
, count
);
356 static HRESULT WINAPI
content_GetContentTransform(IDirectManipulationContent
*iface
,
357 float *matrix
, DWORD count
)
359 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
360 FIXME("%p, %p, %ld\n", This
, matrix
, count
);
364 static HRESULT WINAPI
content_SyncContentTransform(IDirectManipulationContent
*iface
,
365 const float *matrix
, DWORD count
)
367 struct primarycontext
*This
= impl_from_IDirectManipulationContent(iface
);
368 FIXME("%p, %p, %ld\n", This
, matrix
, count
);
372 static const IDirectManipulationContentVtbl contentVtbl
=
374 content_QueryInterface
,
377 content_GetContentRect
,
378 content_SetContentRect
,
382 content_GetOutputTransform
,
383 content_GetContentTransform
,
384 content_SyncContentTransform
387 struct directviewport
389 IDirectManipulationViewport2 IDirectManipulationViewport2_iface
;
393 static inline struct directviewport
*impl_from_IDirectManipulationViewport2(IDirectManipulationViewport2
*iface
)
395 return CONTAINING_RECORD(iface
, struct directviewport
, IDirectManipulationViewport2_iface
);
398 static HRESULT WINAPI
viewport_QueryInterface(IDirectManipulationViewport2
*iface
, REFIID riid
, void **ppv
)
400 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
401 TRACE("(%p)->(%s,%p)\n", This
, debugstr_guid(riid
), ppv
);
403 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
404 IsEqualGUID(riid
, &IID_IDirectManipulationViewport
) ||
405 IsEqualGUID(riid
, &IID_IDirectManipulationViewport2
))
407 IDirectManipulationViewport2_AddRef(&This
->IDirectManipulationViewport2_iface
);
408 *ppv
= &This
->IDirectManipulationViewport2_iface
;
412 FIXME("(%p)->(%s,%p),not found\n", This
, debugstr_guid(riid
), ppv
);
413 return E_NOINTERFACE
;
416 static ULONG WINAPI
viewport_AddRef(IDirectManipulationViewport2
*iface
)
418 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
419 ULONG ref
= InterlockedIncrement(&This
->ref
);
421 TRACE("(%p) ref=%lu\n", This
, ref
);
426 static ULONG WINAPI
viewport_Release(IDirectManipulationViewport2
*iface
)
428 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
429 ULONG ref
= InterlockedDecrement(&This
->ref
);
431 TRACE("(%p) ref=%lu\n", This
, ref
);
440 static HRESULT WINAPI
viewport_Enable(IDirectManipulationViewport2
*iface
)
442 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
447 static HRESULT WINAPI
viewport_Disable(IDirectManipulationViewport2
*iface
)
449 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
454 static HRESULT WINAPI
viewport_SetContact(IDirectManipulationViewport2
*iface
, UINT32 id
)
456 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
457 FIXME("%p, %d\n", This
, id
);
461 static HRESULT WINAPI
viewport_ReleaseContact(IDirectManipulationViewport2
*iface
, UINT32 id
)
463 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
464 FIXME("%p, %d\n", This
, id
);
468 static HRESULT WINAPI
viewport_ReleaseAllContacts(IDirectManipulationViewport2
*iface
)
470 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
475 static HRESULT WINAPI
viewport_GetStatus(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_STATUS
*status
)
477 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
478 FIXME("%p, %p\n", This
, status
);
482 static HRESULT WINAPI
viewport_GetTag(IDirectManipulationViewport2
*iface
, REFIID riid
, void **object
, UINT32
*id
)
484 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
485 FIXME("%p, %s, %p, %p\n", This
, debugstr_guid(riid
), object
, id
);
489 static HRESULT WINAPI
viewport_SetTag(IDirectManipulationViewport2
*iface
, IUnknown
*object
, UINT32 id
)
491 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
492 FIXME("%p, %p, %u\n", This
, object
, id
);
496 static HRESULT WINAPI
viewport_GetViewportRect(IDirectManipulationViewport2
*iface
, RECT
*viewport
)
498 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
499 FIXME("%p, %p\n", This
, viewport
);
503 static HRESULT WINAPI
viewport_SetViewportRect(IDirectManipulationViewport2
*iface
, const RECT
*viewport
)
505 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
506 FIXME("%p, %p\n", This
, viewport
);
510 static HRESULT WINAPI
viewport_ZoomToRect(IDirectManipulationViewport2
*iface
, const float left
,
511 const float top
, const float right
, const float bottom
, BOOL animate
)
513 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
514 FIXME("%p, %f, %f, %f, %f, %d\n", This
, left
, top
, right
, bottom
, animate
);
518 static HRESULT WINAPI
viewport_SetViewportTransform(IDirectManipulationViewport2
*iface
,
519 const float *matrix
, DWORD count
)
521 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
522 FIXME("%p, %p, %ld\n", This
, matrix
, count
);
526 static HRESULT WINAPI
viewport_SyncDisplayTransform(IDirectManipulationViewport2
*iface
,
527 const float *matrix
, DWORD count
)
529 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
530 FIXME("%p, %p, %ld\n", This
, matrix
, count
);
534 static HRESULT WINAPI
viewport_GetPrimaryContent(IDirectManipulationViewport2
*iface
, REFIID riid
, void **object
)
536 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
537 TRACE("%p, %s, %p\n", This
, debugstr_guid(riid
), object
);
538 if(IsEqualGUID(riid
, &IID_IDirectManipulationPrimaryContent
))
540 struct primarycontext
*primary
;
541 TRACE("IDirectManipulationPrimaryContent\n");
542 primary
= malloc( sizeof(*primary
));
544 return E_OUTOFMEMORY
;
546 primary
->IDirectManipulationPrimaryContent_iface
.lpVtbl
= &primaryVtbl
;
547 primary
->IDirectManipulationContent_iface
.lpVtbl
= &contentVtbl
;
550 *object
= &primary
->IDirectManipulationPrimaryContent_iface
;
555 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
559 static HRESULT WINAPI
viewport_AddContent(IDirectManipulationViewport2
*iface
, IDirectManipulationContent
*content
)
561 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
562 FIXME("%p, %p\n", This
, content
);
566 static HRESULT WINAPI
viewport_RemoveContent(IDirectManipulationViewport2
*iface
, IDirectManipulationContent
*content
)
568 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
569 FIXME("%p, %p\n", This
, content
);
573 static HRESULT WINAPI
viewport_SetViewportOptions(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_VIEWPORT_OPTIONS options
)
575 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
576 FIXME("%p, %d\n", This
, options
);
580 static HRESULT WINAPI
viewport_AddConfiguration(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_CONFIGURATION configuration
)
582 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
583 FIXME("%p, %d\n", This
, configuration
);
587 static HRESULT WINAPI
viewport_RemoveConfiguration(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_CONFIGURATION configuration
)
589 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
590 FIXME("%p, %d\n", This
, configuration
);
594 static HRESULT WINAPI
viewport_ActivateConfiguration(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_CONFIGURATION configuration
)
596 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
597 FIXME("%p, %d\n", This
, configuration
);
601 static HRESULT WINAPI
viewport_SetManualGesture(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_GESTURE_CONFIGURATION configuration
)
603 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
604 FIXME("%p, %d\n", This
, configuration
);
608 static HRESULT WINAPI
viewport_SetChaining(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_MOTION_TYPES enabledTypes
)
610 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
611 FIXME("%p, %d\n", This
, enabledTypes
);
615 static HRESULT WINAPI
viewport_AddEventHandler(IDirectManipulationViewport2
*iface
, HWND window
,
616 IDirectManipulationViewportEventHandler
*eventHandler
, DWORD
*cookie
)
618 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
619 FIXME("%p, %p, %p, %p\n", This
, window
, eventHandler
, cookie
);
623 static HRESULT WINAPI
viewport_RemoveEventHandler(IDirectManipulationViewport2
*iface
, DWORD cookie
)
625 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
626 FIXME("%p, %ld\n", This
, cookie
);
630 static HRESULT WINAPI
viewport_SetInputMode(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_INPUT_MODE mode
)
632 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
633 FIXME("%p, %d\n", This
, mode
);
637 static HRESULT WINAPI
viewport_SetUpdateMode(IDirectManipulationViewport2
*iface
, DIRECTMANIPULATION_INPUT_MODE mode
)
639 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
640 FIXME("%p, %d\n", This
, mode
);
644 static HRESULT WINAPI
viewport_Stop(IDirectManipulationViewport2
*iface
)
646 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
651 static HRESULT WINAPI
viewport_Abandon(IDirectManipulationViewport2
*iface
)
653 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
658 static HRESULT WINAPI
viewport_AddBehavior(IDirectManipulationViewport2
*iface
, IUnknown
*behavior
, DWORD
*cookie
)
660 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
661 FIXME("%p, %p, %p\n", This
, behavior
, cookie
);
665 static HRESULT WINAPI
viewport_RemoveBehavior(IDirectManipulationViewport2
*iface
, DWORD cookie
)
667 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
668 FIXME("%p, %ld\n", This
, cookie
);
672 static HRESULT WINAPI
viewport_RemoveAllBehaviors(IDirectManipulationViewport2
*iface
)
674 struct directviewport
*This
= impl_from_IDirectManipulationViewport2(iface
);
679 static const IDirectManipulationViewport2Vtbl viewportVtbl
=
681 viewport_QueryInterface
,
687 viewport_ReleaseContact
,
688 viewport_ReleaseAllContacts
,
692 viewport_GetViewportRect
,
693 viewport_SetViewportRect
,
695 viewport_SetViewportTransform
,
696 viewport_SyncDisplayTransform
,
697 viewport_GetPrimaryContent
,
699 viewport_RemoveContent
,
700 viewport_SetViewportOptions
,
701 viewport_AddConfiguration
,
702 viewport_RemoveConfiguration
,
703 viewport_ActivateConfiguration
,
704 viewport_SetManualGesture
,
705 viewport_SetChaining
,
706 viewport_AddEventHandler
,
707 viewport_RemoveEventHandler
,
708 viewport_SetInputMode
,
709 viewport_SetUpdateMode
,
712 viewport_AddBehavior
,
713 viewport_RemoveBehavior
,
714 viewport_RemoveAllBehaviors
717 static HRESULT
create_viewport(IDirectManipulationViewport2
**obj
)
719 struct directviewport
*object
;
721 object
= malloc(sizeof(*object
));
723 return E_OUTOFMEMORY
;
725 object
->IDirectManipulationViewport2_iface
.lpVtbl
= &viewportVtbl
;
728 *obj
= &object
->IDirectManipulationViewport2_iface
;
733 static HRESULT WINAPI
direct_manip_QueryInterface(IDirectManipulationManager2
*iface
, REFIID riid
, void **ppv
)
735 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
736 IsEqualGUID(riid
, &IID_IDirectManipulationManager
) ||
737 IsEqualGUID(riid
, &IID_IDirectManipulationManager2
)) {
738 IUnknown_AddRef(iface
);
743 FIXME("(%p)->(%s,%p),not found\n", iface
, debugstr_guid(riid
), ppv
);
744 return E_NOINTERFACE
;
747 static ULONG WINAPI
direct_manip_AddRef(IDirectManipulationManager2
*iface
)
749 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
750 ULONG ref
= InterlockedIncrement(&This
->ref
);
752 TRACE("(%p) ref=%lu\n", This
, ref
);
757 static ULONG WINAPI
direct_manip_Release(IDirectManipulationManager2
*iface
)
759 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
760 ULONG ref
= InterlockedDecrement(&This
->ref
);
762 TRACE("(%p) ref=%lu\n", This
, ref
);
766 if(This
->updatemanager
)
767 IDirectManipulationUpdateManager_Release(This
->updatemanager
);
773 static HRESULT WINAPI
direct_manip_Activate(IDirectManipulationManager2
*iface
, HWND window
)
775 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
776 FIXME("%p, %p\n", This
, window
);
780 static HRESULT WINAPI
direct_manip_Deactivate(IDirectManipulationManager2
*iface
, HWND window
)
782 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
783 FIXME("%p, %p\n", This
, window
);
787 static HRESULT WINAPI
direct_manip_RegisterHitTestTarget(IDirectManipulationManager2
*iface
, HWND window
,
788 HWND hittest
, DIRECTMANIPULATION_HITTEST_TYPE type
)
790 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
791 FIXME("%p, %p, %p, %d\n", This
, window
, hittest
, type
);
795 static HRESULT WINAPI
direct_manip_ProcessInput(IDirectManipulationManager2
*iface
, const MSG
*msg
, BOOL
*handled
)
797 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
798 FIXME("%p, %p, %p\n", This
, msg
, handled
);
802 static HRESULT WINAPI
direct_manip_GetUpdateManager(IDirectManipulationManager2
*iface
, REFIID riid
, void **obj
)
804 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
807 TRACE("%p, %s, %p\n", This
, debugstr_guid(riid
), obj
);
810 if(IsEqualGUID(riid
, &IID_IDirectManipulationUpdateManager
))
812 if(!This
->updatemanager
)
814 hr
= create_update_manager(&This
->updatemanager
);
823 IDirectManipulationUpdateManager_AddRef(This
->updatemanager
);
824 *obj
= This
->updatemanager
;
828 FIXME("Interface %s currently not supported.\n", debugstr_guid(riid
));
833 static HRESULT WINAPI
direct_manip_CreateViewport(IDirectManipulationManager2
*iface
, IDirectManipulationFrameInfoProvider
*frame
,
834 HWND window
, REFIID riid
, void **obj
)
836 HRESULT hr
= E_NOTIMPL
;
837 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
838 TRACE("%p, %p, %p, %s, %p\n", This
, frame
, window
, debugstr_guid(riid
), obj
);
840 if(IsEqualGUID(riid
, &IID_IDirectManipulationViewport
) ||
841 IsEqualGUID(riid
, &IID_IDirectManipulationViewport2
) )
843 hr
= create_viewport( (IDirectManipulationViewport2
**)obj
);
846 FIXME("Unsupported interface %s\n", debugstr_guid(riid
));
850 static HRESULT WINAPI
direct_manip_CreateContent(IDirectManipulationManager2
*iface
, IDirectManipulationFrameInfoProvider
*frame
,
851 REFCLSID clsid
, REFIID riid
, void **obj
)
853 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
854 FIXME("%p, %p, %s, %p\n", This
, frame
, debugstr_guid(riid
), obj
);
858 static HRESULT WINAPI
direct_manip_CreateBehavior(IDirectManipulationManager2
*iface
, REFCLSID clsid
, REFIID riid
, void **obj
)
860 struct directmanipulation
*This
= impl_from_IDirectManipulationManager2(iface
);
861 FIXME("%p, %s, %s, %p\n", This
, debugstr_guid(clsid
), debugstr_guid(riid
), obj
);
865 static const struct IDirectManipulationManager2Vtbl directmanipVtbl
=
867 direct_manip_QueryInterface
,
869 direct_manip_Release
,
870 direct_manip_Activate
,
871 direct_manip_Deactivate
,
872 direct_manip_RegisterHitTestTarget
,
873 direct_manip_ProcessInput
,
874 direct_manip_GetUpdateManager
,
875 direct_manip_CreateViewport
,
876 direct_manip_CreateContent
,
877 direct_manip_CreateBehavior
880 static HRESULT WINAPI
DirectManipulation_CreateInstance(IClassFactory
*iface
, IUnknown
*outer
, REFIID riid
, void **ppv
)
882 struct directmanipulation
*object
;
885 TRACE("(%p, %s, %p)\n", outer
, debugstr_guid(riid
), ppv
);
889 object
= calloc(1, sizeof(*object
));
891 return E_OUTOFMEMORY
;
893 object
->IDirectManipulationManager2_iface
.lpVtbl
= &directmanipVtbl
;
896 ret
= direct_manip_QueryInterface(&object
->IDirectManipulationManager2_iface
, riid
, ppv
);
897 direct_manip_Release(&object
->IDirectManipulationManager2_iface
);
902 struct directcompositor
904 IDirectManipulationCompositor2 IDirectManipulationCompositor2_iface
;
905 IDirectManipulationFrameInfoProvider IDirectManipulationFrameInfoProvider_iface
;
906 IDirectManipulationUpdateManager
*manager
;
910 static inline struct directcompositor
*impl_from_IDirectManipulationCompositor2(IDirectManipulationCompositor2
*iface
)
912 return CONTAINING_RECORD(iface
, struct directcompositor
, IDirectManipulationCompositor2_iface
);
915 static inline struct directcompositor
*impl_from_IDirectManipulationFrameInfoProvider(IDirectManipulationFrameInfoProvider
*iface
)
917 return CONTAINING_RECORD(iface
, struct directcompositor
, IDirectManipulationFrameInfoProvider_iface
);
920 static HRESULT WINAPI
compositor_QueryInterface(IDirectManipulationCompositor2
*iface
, REFIID riid
, void **ppv
)
922 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
924 if (IsEqualGUID(riid
, &IID_IUnknown
) ||
925 IsEqualGUID(riid
, &IID_IDirectManipulationCompositor
) ||
926 IsEqualGUID(riid
, &IID_IDirectManipulationCompositor2
))
928 IUnknown_AddRef(iface
);
932 else if(IsEqualGUID(riid
, &IID_IDirectManipulationFrameInfoProvider
))
934 IUnknown_AddRef(iface
);
935 *ppv
= &This
->IDirectManipulationFrameInfoProvider_iface
;
939 FIXME("(%p)->(%s,%p),not found\n", iface
, debugstr_guid(riid
), ppv
);
940 return E_NOINTERFACE
;
943 static ULONG WINAPI
compositor_AddRef(IDirectManipulationCompositor2
*iface
)
945 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
946 ULONG ref
= InterlockedIncrement(&This
->ref
);
948 TRACE("(%p) ref=%lu\n", This
, ref
);
953 static ULONG WINAPI
compositor_Release(IDirectManipulationCompositor2
*iface
)
955 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
956 ULONG ref
= InterlockedDecrement(&This
->ref
);
958 TRACE("(%p) ref=%lu\n", This
, ref
);
963 IDirectManipulationUpdateManager_Release(This
->manager
);
969 static HRESULT WINAPI
compositor_AddContent(IDirectManipulationCompositor2
*iface
, IDirectManipulationContent
*content
,
970 IUnknown
*device
, IUnknown
*parent
, IUnknown
*child
)
972 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
973 FIXME("%p, %p, %p, %p, %p\n", This
, content
, device
, parent
, child
);
977 static HRESULT WINAPI
compositor_RemoveContent(IDirectManipulationCompositor2
*iface
, IDirectManipulationContent
*content
)
979 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
980 FIXME("%p, %p\n", This
, content
);
984 static HRESULT WINAPI
compositor_SetUpdateManager(IDirectManipulationCompositor2
*iface
, IDirectManipulationUpdateManager
*manager
)
986 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
987 TRACE("%p, %p\n", This
, manager
);
992 This
->manager
= manager
;
993 IDirectManipulationUpdateManager_AddRef(This
->manager
);
997 static HRESULT WINAPI
compositor_Flush(IDirectManipulationCompositor2
*iface
)
999 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
1000 FIXME("%p\n", This
);
1004 static HRESULT WINAPI
compositor_AddContentWithCrossProcessChaining(IDirectManipulationCompositor2
*iface
,
1005 IDirectManipulationPrimaryContent
*content
, IUnknown
*device
, IUnknown
*parentvisual
, IUnknown
*childvisual
)
1007 struct directcompositor
*This
= impl_from_IDirectManipulationCompositor2(iface
);
1008 FIXME("%p %p %p %p %p\n", This
, content
, device
, parentvisual
, childvisual
);
1012 static const struct IDirectManipulationCompositor2Vtbl compositorVtbl
=
1014 compositor_QueryInterface
,
1017 compositor_AddContent
,
1018 compositor_RemoveContent
,
1019 compositor_SetUpdateManager
,
1021 compositor_AddContentWithCrossProcessChaining
1024 static HRESULT WINAPI
provider_QueryInterface(IDirectManipulationFrameInfoProvider
*iface
, REFIID riid
, void **ppv
)
1026 struct directcompositor
*This
= impl_from_IDirectManipulationFrameInfoProvider(iface
);
1027 return IDirectManipulationCompositor2_QueryInterface(&This
->IDirectManipulationCompositor2_iface
, riid
, ppv
);
1030 static ULONG WINAPI
provider_AddRef(IDirectManipulationFrameInfoProvider
*iface
)
1032 struct directcompositor
*This
= impl_from_IDirectManipulationFrameInfoProvider(iface
);
1033 return IDirectManipulationCompositor2_AddRef(&This
->IDirectManipulationCompositor2_iface
);
1036 static ULONG WINAPI
provider_Release(IDirectManipulationFrameInfoProvider
*iface
)
1038 struct directcompositor
*This
= impl_from_IDirectManipulationFrameInfoProvider(iface
);
1039 return IDirectManipulationCompositor2_Release(&This
->IDirectManipulationCompositor2_iface
);
1042 static HRESULT WINAPI
provider_GetNextFrameInfo(IDirectManipulationFrameInfoProvider
*iface
, ULONGLONG
*time
,
1043 ULONGLONG
*process
, ULONGLONG
*composition
)
1045 struct directcompositor
*This
= impl_from_IDirectManipulationFrameInfoProvider(iface
);
1046 FIXME("%p, %p, %p, %p\n", This
, time
, process
, composition
);
1050 static const struct IDirectManipulationFrameInfoProviderVtbl providerVtbl
=
1052 provider_QueryInterface
,
1055 provider_GetNextFrameInfo
1058 static HRESULT WINAPI
DirectCompositor_CreateInstance(IClassFactory
*iface
, IUnknown
*outer
, REFIID riid
, void **ppv
)
1060 struct directcompositor
*object
;
1063 TRACE("(%p, %s, %p)\n", outer
, debugstr_guid(riid
), ppv
);
1067 object
= calloc(1, sizeof(*object
));
1069 return E_OUTOFMEMORY
;
1071 object
->IDirectManipulationCompositor2_iface
.lpVtbl
= &compositorVtbl
;
1072 object
->IDirectManipulationFrameInfoProvider_iface
.lpVtbl
= &providerVtbl
;
1075 ret
= compositor_QueryInterface(&object
->IDirectManipulationCompositor2_iface
, riid
, ppv
);
1076 compositor_Release(&object
->IDirectManipulationCompositor2_iface
);
1081 static HRESULT WINAPI
ClassFactory_QueryInterface(IClassFactory
*iface
, REFIID riid
, void **ppv
)
1085 if(IsEqualGUID(&IID_IUnknown
, riid
) || IsEqualGUID(&IID_IClassFactory
, riid
)) {
1090 IUnknown_AddRef((IUnknown
*)*ppv
);
1094 WARN("(%p)->(%s %p)\n", iface
, debugstr_guid(riid
), ppv
);
1095 return E_NOINTERFACE
;
1098 static ULONG WINAPI
ClassFactory_AddRef(IClassFactory
*iface
)
1100 TRACE("(%p)\n", iface
);
1104 static ULONG WINAPI
ClassFactory_Release(IClassFactory
*iface
)
1106 TRACE("(%p)\n", iface
);
1110 static HRESULT WINAPI
ClassFactory_LockServer(IClassFactory
*iface
, BOOL fLock
)
1112 TRACE("(%p)->(%x)\n", iface
, fLock
);
1116 static const IClassFactoryVtbl DirectFactoryVtbl
= {
1117 ClassFactory_QueryInterface
,
1118 ClassFactory_AddRef
,
1119 ClassFactory_Release
,
1120 DirectManipulation_CreateInstance
,
1121 ClassFactory_LockServer
1124 static const IClassFactoryVtbl DirectCompositorVtbl
= {
1125 ClassFactory_QueryInterface
,
1126 ClassFactory_AddRef
,
1127 ClassFactory_Release
,
1128 DirectCompositor_CreateInstance
,
1129 ClassFactory_LockServer
1132 static IClassFactory direct_factory
= { &DirectFactoryVtbl
};
1133 static IClassFactory compositor_factory
= { &DirectCompositorVtbl
};
1135 HRESULT WINAPI
DllGetClassObject(REFCLSID rclsid
, REFIID riid
, LPVOID
*ppv
)
1137 if(IsEqualGUID(&CLSID_DirectManipulationManager
, rclsid
) ||
1138 IsEqualGUID(&CLSID_DirectManipulationSharedManager
, rclsid
) ) {
1139 TRACE("(CLSID_DirectManipulationManager %s %p)\n", debugstr_guid(riid
), ppv
);
1140 return IClassFactory_QueryInterface(&direct_factory
, riid
, ppv
);
1142 else if(IsEqualGUID(&CLSID_DCompManipulationCompositor
, rclsid
)) {
1143 TRACE("(CLSID_DCompManipulationCompositor %s %p)\n", debugstr_guid(riid
), ppv
);
1144 return IClassFactory_QueryInterface(&compositor_factory
, riid
, ppv
);
1147 FIXME("%s %s %p\n", debugstr_guid(rclsid
), debugstr_guid(riid
), ppv
);
1148 return CLASS_E_CLASSNOTAVAILABLE
;